@elaraai/east-ui-components 0.0.1-beta.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 (140) hide show
  1. package/CLA.md +26 -0
  2. package/CONTRIBUTING.md +28 -0
  3. package/LICENSE.md +682 -0
  4. package/dist/buttons/button/index.d.ts +25 -0
  5. package/dist/buttons/button/index.d.ts.map +1 -0
  6. package/dist/buttons/icon-button/index.d.ts +22 -0
  7. package/dist/buttons/icon-button/index.d.ts.map +1 -0
  8. package/dist/buttons/index.d.ts +10 -0
  9. package/dist/buttons/index.d.ts.map +1 -0
  10. package/dist/charts/area/index.d.ts +16 -0
  11. package/dist/charts/area/index.d.ts.map +1 -0
  12. package/dist/charts/bar/index.d.ts +16 -0
  13. package/dist/charts/bar/index.d.ts.map +1 -0
  14. package/dist/charts/bar-list/index.d.ts +16 -0
  15. package/dist/charts/bar-list/index.d.ts.map +1 -0
  16. package/dist/charts/bar-segment/index.d.ts +16 -0
  17. package/dist/charts/bar-segment/index.d.ts.map +1 -0
  18. package/dist/charts/index.d.ts +17 -0
  19. package/dist/charts/index.d.ts.map +1 -0
  20. package/dist/charts/line/index.d.ts +16 -0
  21. package/dist/charts/line/index.d.ts.map +1 -0
  22. package/dist/charts/pie/index.d.ts +16 -0
  23. package/dist/charts/pie/index.d.ts.map +1 -0
  24. package/dist/charts/radar/index.d.ts +16 -0
  25. package/dist/charts/radar/index.d.ts.map +1 -0
  26. package/dist/charts/scatter/index.d.ts +16 -0
  27. package/dist/charts/scatter/index.d.ts.map +1 -0
  28. package/dist/charts/sparkline/index.d.ts +35 -0
  29. package/dist/charts/sparkline/index.d.ts.map +1 -0
  30. package/dist/charts/utils.d.ts +151 -0
  31. package/dist/charts/utils.d.ts.map +1 -0
  32. package/dist/collections/data-list/index.d.ts +24 -0
  33. package/dist/collections/data-list/index.d.ts.map +1 -0
  34. package/dist/collections/index.d.ts +8 -0
  35. package/dist/collections/index.d.ts.map +1 -0
  36. package/dist/collections/table/index.d.ts +24 -0
  37. package/dist/collections/table/index.d.ts.map +1 -0
  38. package/dist/collections/tree-view/index.d.ts +31 -0
  39. package/dist/collections/tree-view/index.d.ts.map +1 -0
  40. package/dist/component.d.ts +15 -0
  41. package/dist/component.d.ts.map +1 -0
  42. package/dist/container/card/index.d.ts +22 -0
  43. package/dist/container/card/index.d.ts.map +1 -0
  44. package/dist/container/index.d.ts +6 -0
  45. package/dist/container/index.d.ts.map +1 -0
  46. package/dist/disclosure/accordion/index.d.ts +36 -0
  47. package/dist/disclosure/accordion/index.d.ts.map +1 -0
  48. package/dist/disclosure/carousel/index.d.ts +22 -0
  49. package/dist/disclosure/carousel/index.d.ts.map +1 -0
  50. package/dist/disclosure/index.d.ts +8 -0
  51. package/dist/disclosure/index.d.ts.map +1 -0
  52. package/dist/disclosure/tabs/index.d.ts +45 -0
  53. package/dist/disclosure/tabs/index.d.ts.map +1 -0
  54. package/dist/display/avatar/index.d.ts +22 -0
  55. package/dist/display/avatar/index.d.ts.map +1 -0
  56. package/dist/display/badge/index.d.ts +22 -0
  57. package/dist/display/badge/index.d.ts.map +1 -0
  58. package/dist/display/icon/index.d.ts +22 -0
  59. package/dist/display/icon/index.d.ts.map +1 -0
  60. package/dist/display/index.d.ts +10 -0
  61. package/dist/display/index.d.ts.map +1 -0
  62. package/dist/display/stat/index.d.ts +16 -0
  63. package/dist/display/stat/index.d.ts.map +1 -0
  64. package/dist/display/tag/index.d.ts +22 -0
  65. package/dist/display/tag/index.d.ts.map +1 -0
  66. package/dist/feedback/alert/index.d.ts +22 -0
  67. package/dist/feedback/alert/index.d.ts.map +1 -0
  68. package/dist/feedback/index.d.ts +7 -0
  69. package/dist/feedback/index.d.ts.map +1 -0
  70. package/dist/feedback/progress/index.d.ts +22 -0
  71. package/dist/feedback/progress/index.d.ts.map +1 -0
  72. package/dist/forms/checkbox/index.d.ts +22 -0
  73. package/dist/forms/checkbox/index.d.ts.map +1 -0
  74. package/dist/forms/field/index.d.ts +22 -0
  75. package/dist/forms/field/index.d.ts.map +1 -0
  76. package/dist/forms/fieldset/index.d.ts +76 -0
  77. package/dist/forms/fieldset/index.d.ts.map +1 -0
  78. package/dist/forms/file-upload/index.d.ts +22 -0
  79. package/dist/forms/file-upload/index.d.ts.map +1 -0
  80. package/dist/forms/index.d.ts +15 -0
  81. package/dist/forms/index.d.ts.map +1 -0
  82. package/dist/forms/input/index.d.ts +60 -0
  83. package/dist/forms/input/index.d.ts.map +1 -0
  84. package/dist/forms/select/index.d.ts +31 -0
  85. package/dist/forms/select/index.d.ts.map +1 -0
  86. package/dist/forms/slider/index.d.ts +22 -0
  87. package/dist/forms/slider/index.d.ts.map +1 -0
  88. package/dist/forms/switch/index.d.ts +22 -0
  89. package/dist/forms/switch/index.d.ts.map +1 -0
  90. package/dist/forms/tags-input/index.d.ts +22 -0
  91. package/dist/forms/tags-input/index.d.ts.map +1 -0
  92. package/dist/forms/textarea/index.d.ts +22 -0
  93. package/dist/forms/textarea/index.d.ts.map +1 -0
  94. package/dist/index.cjs +50804 -0
  95. package/dist/index.cjs.map +1 -0
  96. package/dist/index.d.ts +23 -0
  97. package/dist/index.d.ts.map +1 -0
  98. package/dist/index.js +50780 -0
  99. package/dist/index.js.map +1 -0
  100. package/dist/layout/box/index.d.ts +25 -0
  101. package/dist/layout/box/index.d.ts.map +1 -0
  102. package/dist/layout/grid/index.d.ts +25 -0
  103. package/dist/layout/grid/index.d.ts.map +1 -0
  104. package/dist/layout/index.d.ts +13 -0
  105. package/dist/layout/index.d.ts.map +1 -0
  106. package/dist/layout/separator/index.d.ts +25 -0
  107. package/dist/layout/separator/index.d.ts.map +1 -0
  108. package/dist/layout/splitter/index.d.ts +33 -0
  109. package/dist/layout/splitter/index.d.ts.map +1 -0
  110. package/dist/layout/stack/index.d.ts +25 -0
  111. package/dist/layout/stack/index.d.ts.map +1 -0
  112. package/dist/overlays/action-bar/index.d.ts +18 -0
  113. package/dist/overlays/action-bar/index.d.ts.map +1 -0
  114. package/dist/overlays/dialog/index.d.ts +16 -0
  115. package/dist/overlays/dialog/index.d.ts.map +1 -0
  116. package/dist/overlays/drawer/index.d.ts +16 -0
  117. package/dist/overlays/drawer/index.d.ts.map +1 -0
  118. package/dist/overlays/hover-card/index.d.ts +16 -0
  119. package/dist/overlays/hover-card/index.d.ts.map +1 -0
  120. package/dist/overlays/index.d.ts +13 -0
  121. package/dist/overlays/index.d.ts.map +1 -0
  122. package/dist/overlays/menu/index.d.ts +18 -0
  123. package/dist/overlays/menu/index.d.ts.map +1 -0
  124. package/dist/overlays/popover/index.d.ts +16 -0
  125. package/dist/overlays/popover/index.d.ts.map +1 -0
  126. package/dist/overlays/toggle-tip/index.d.ts +17 -0
  127. package/dist/overlays/toggle-tip/index.d.ts.map +1 -0
  128. package/dist/overlays/tooltip/index.d.ts +16 -0
  129. package/dist/overlays/tooltip/index.d.ts.map +1 -0
  130. package/dist/platform/hooks.d.ts +145 -0
  131. package/dist/platform/hooks.d.ts.map +1 -0
  132. package/dist/platform/index.d.ts +16 -0
  133. package/dist/platform/index.d.ts.map +1 -0
  134. package/dist/platform/store.d.ts +114 -0
  135. package/dist/platform/store.d.ts.map +1 -0
  136. package/dist/typography/index.d.ts +6 -0
  137. package/dist/typography/index.d.ts.map +1 -0
  138. package/dist/typography/text/index.d.ts +25 -0
  139. package/dist/typography/text/index.d.ts.map +1 -0
  140. package/package.json +85 -0
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import type { PlatformFunction, EastIR } from "@elaraai/east/internal";
6
+ /**
7
+ * Options for creating an EastStore.
8
+ */
9
+ export interface EastStoreOptions {
10
+ /** Initial state as a Map of string keys to Beast2-encoded blobs */
11
+ initialState?: Map<string, Uint8Array> | undefined;
12
+ }
13
+ /**
14
+ * A reactive state store for East UI applications.
15
+ *
16
+ * State is stored as Beast2-encoded blobs, allowing any East type to be stored.
17
+ * When state changes, registered functions are re-executed and subscribers notified.
18
+ */
19
+ export declare class EastStore {
20
+ private state;
21
+ private registrations;
22
+ private keySubscribers;
23
+ private globalSubscribers;
24
+ private batchDepth;
25
+ private changedKeys;
26
+ constructor(options?: EastStoreOptions);
27
+ /**
28
+ * Register an East function for reactive execution.
29
+ * The function will be compiled and executed immediately with current state.
30
+ * When state changes, it will be re-executed automatically.
31
+ *
32
+ * @param id - Unique identifier for this registration
33
+ * @param ir - The East IR to compile and register
34
+ */
35
+ register(id: string, ir: EastIR<[Map<string, Uint8Array>], any>): void;
36
+ /**
37
+ * Get the last result of a registered function.
38
+ *
39
+ * @param id - The registration identifier
40
+ * @returns The last computed result, or undefined if not registered
41
+ */
42
+ getResult(id: string): any;
43
+ /**
44
+ * Write a Beast2-encoded value to state.
45
+ * Triggers re-execution of registered functions and notifies subscribers.
46
+ *
47
+ * @param key - The string key to write to
48
+ * @param value - The Beast2-encoded blob value
49
+ */
50
+ write(key: string, value: Uint8Array): void;
51
+ /**
52
+ * Read a Beast2-encoded value from state.
53
+ * Returns an empty Uint8Array if the key doesn't exist.
54
+ *
55
+ * @param key - The string key to read from
56
+ * @returns The Beast2-encoded blob value
57
+ */
58
+ read(key: string): Uint8Array;
59
+ /**
60
+ * Get the current state as a Map.
61
+ *
62
+ * @returns The current state
63
+ */
64
+ getState(): Map<string, Uint8Array>;
65
+ /**
66
+ * Batch multiple writes together.
67
+ * Re-execution and notifications happen only once at the end.
68
+ *
69
+ * @param fn - Function containing multiple write operations
70
+ * @returns The return value of the function
71
+ */
72
+ batch<T>(fn: () => T): T;
73
+ /**
74
+ * Subscribe to all state changes.
75
+ *
76
+ * @param callback - Function to call when state changes
77
+ * @returns Unsubscribe function
78
+ */
79
+ subscribe(callback: () => void): () => void;
80
+ /**
81
+ * Subscribe to changes for a specific key.
82
+ *
83
+ * @param key - The key to subscribe to
84
+ * @param callback - Function to call when the key changes
85
+ * @returns Unsubscribe function
86
+ */
87
+ subscribe(key: string, callback: () => void): () => void;
88
+ /**
89
+ * Create platform function implementations bound to this store.
90
+ *
91
+ * @returns Array of platform functions for use with ir.compile()
92
+ */
93
+ createPlatform(): PlatformFunction[];
94
+ /**
95
+ * Flush pending changes: re-execute registered functions and notify subscribers.
96
+ */
97
+ private flush;
98
+ }
99
+ /**
100
+ * Create a new EastStore with optional initial state.
101
+ *
102
+ * @param initialState - Optional initial state as a plain object
103
+ * @returns A new EastStore instance
104
+ *
105
+ * @example
106
+ * ```ts
107
+ * const store = createEastStore({
108
+ * count: encodeBeast2(0n),
109
+ * name: encodeBeast2("Alice"),
110
+ * });
111
+ * ```
112
+ */
113
+ export declare function createEastStore(initialState?: Record<string, Uint8Array>): EastStore;
114
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/platform/store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGvE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,oEAAoE;IACpE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS,CAAC;CACtD;AAUD;;;;;GAKG;AACH,qBAAa,SAAS;IAClB,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,aAAa,CAAwC;IAC7D,OAAO,CAAC,cAAc,CAA2C;IACjE,OAAO,CAAC,iBAAiB,CAA8B;IACvD,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,WAAW,CAA0B;gBAEjC,OAAO,CAAC,EAAE,gBAAgB;IAItC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI;IActE;;;;;OAKG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IAS3C;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAI7B;;;;OAIG;IACH,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC;IAInC;;;;;;OAMG;IACH,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC;IAYxB;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAC3C;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAyBxD;;;;OAIG;IACH,cAAc,IAAI,gBAAgB,EAAE;IAWpC;;OAEG;IACH,OAAO,CAAC,KAAK;CAqBhB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS,CAIpF"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ export { toChakraText, EastChakraText, type TextValue, type EastChakraTextProps, } from "./text/index.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typography/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,YAAY,EACZ,cAAc,EACd,KAAK,SAAS,EACd,KAAK,mBAAmB,GAC3B,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ import { type TextProps } from "@chakra-ui/react";
6
+ import { type ValueTypeOf } from "@elaraai/east";
7
+ import { Text } from "@elaraai/east-ui";
8
+ /** East Text value type */
9
+ export type TextValue = ValueTypeOf<typeof Text.Types.Text>;
10
+ /**
11
+ * Converts an East UI Text value to Chakra UI Text props.
12
+ * Pure function - easy to test independently.
13
+ *
14
+ * @param value - The East Text value
15
+ * @returns Chakra Text props
16
+ */
17
+ export declare function toChakraText(value: TextValue): TextProps;
18
+ export interface EastChakraTextProps {
19
+ value: TextValue;
20
+ }
21
+ /**
22
+ * Renders an East UI Text value using Chakra UI Text component.
23
+ */
24
+ export declare const EastChakraText: import("react").NamedExoticComponent<EastChakraTextProps>;
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typography/text/index.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAY,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAMxC,2BAA2B;AAC3B,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAaxD;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,SAAS,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,2DAQ0B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@elaraai/east-ui-components",
3
+ "version": "0.0.1-beta.0",
4
+ "description": "React components for rendering East UI types with Chakra UI",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "LICENSE.md",
19
+ "CONTRIBUTING.md",
20
+ "CLA.md"
21
+ ],
22
+ "sideEffects": false,
23
+ "scripts": {
24
+ "build": "vite build && tsc --emitDeclarationOnly",
25
+ "lint": "eslint .",
26
+ "lint:fix": "eslint . --fix",
27
+ "test": "vitest run",
28
+ "test:watch": "vitest",
29
+ "test:coverage": "vitest run --coverage"
30
+ },
31
+ "peerDependencies": {
32
+ "react": "^19.0.0",
33
+ "react-dom": "^19.0.0"
34
+ },
35
+ "dependencies": {
36
+ "@chakra-ui/charts": "^3.30.0",
37
+ "@chakra-ui/react": "^3.0.0",
38
+ "@elaraai/east": "^0.0.1-beta.0",
39
+ "@elaraai/east-ui": "*",
40
+ "@emotion/react": "^11.14.0",
41
+ "@fortawesome/fontawesome-svg-core": "^7.1.0",
42
+ "@fortawesome/free-brands-svg-icons": "^7.1.0",
43
+ "@fortawesome/free-regular-svg-icons": "^7.1.0",
44
+ "@fortawesome/free-solid-svg-icons": "^7.1.0",
45
+ "@fortawesome/react-fontawesome": "^3.1.1",
46
+ "recharts": "^3.5.0",
47
+ "sorted-btree": "^2.0.0-alpha.0"
48
+ },
49
+ "devDependencies": {
50
+ "@types/node": "^22.18.1",
51
+ "@types/react": "^19.0.0",
52
+ "@types/react-dom": "^19.0.0",
53
+ "@typescript-eslint/eslint-plugin": "^8.42.0",
54
+ "@typescript-eslint/parser": "^8.42.0",
55
+ "@vitejs/plugin-react": "^4.3.0",
56
+ "@vitest/coverage-v8": "^4.0.14",
57
+ "eslint": "^9.34.0",
58
+ "eslint-plugin-headers": "^1.3.3",
59
+ "eslint-plugin-react-hooks": "^5.0.0",
60
+ "react": "^19.0.0",
61
+ "react-dom": "^19.0.0",
62
+ "tsx": "^4.20.6",
63
+ "typescript": "~5.9.2",
64
+ "vite": "^6.0.0",
65
+ "vite-plugin-dts": "^4.3.0",
66
+ "vitest": "^4.0.14"
67
+ },
68
+ "repository": {
69
+ "type": "git",
70
+ "url": "https://github.com/elaraai/east-ui.git",
71
+ "directory": "packages/east-ui-components"
72
+ },
73
+ "keywords": [
74
+ "east",
75
+ "elara",
76
+ "ui",
77
+ "react",
78
+ "chakra"
79
+ ],
80
+ "author": "Elara AI Pty Ltd",
81
+ "license": "SEE LICENSE IN LICENSE",
82
+ "engines": {
83
+ "node": ">=22.0.0"
84
+ }
85
+ }