@tidelight/react 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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ - Added typed provider and hooks for instrument listings and asynchronous research jobs.
6
+ - Added an accessible instrument grid with loading, error, retry, and empty states.
7
+ - Kept API credentials outside the browser boundary.
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ Copyright 2026 TidelightOrg
2
+
3
+ This package contains Tidelight-authored package source and documentation in this package directory. Those package files are licensed under the Apache License, Version 2.0 (see LICENSE).
4
+
5
+ This package-scoped license does not apply to the mother repository as a whole, Tidelight's proprietary application or backend, research engines, provider integrations, server secrets, or commercial infrastructure. Third-party dependencies retain their own licenses. Tidelight names and marks are not licensed by this notice.
package/README.md CHANGED
@@ -1,3 +1,76 @@
1
- # Temporary Holding Version
1
+ # `@tidelight/react`
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
+ Typed React hooks and accessible, themeable UI helpers for Tidelight market and research workflows. The source package wraps the official SDK’s typed methods; it does not duplicate API requests, authorization, billing, or research logic.
4
+
5
+ Install with `npm install @tidelight/react @tidelight/sdk react react-dom`.
6
+
7
+ ## Local development
8
+
9
+ ```sh
10
+ cd sdk/typescript && npm ci && npm test
11
+ cd ../../packages/react
12
+ npm ci
13
+ npm test
14
+ ```
15
+
16
+ React 18 and 19 are declared as peer-compatible versions. The package uses the current `@tidelight/sdk` client interface for types.
17
+
18
+ ## Security boundary
19
+
20
+ Never construct the official SDK with a Tidelight API key in a browser bundle. `TidelightProvider` receives a structurally compatible client, so provide an application server route or server action that keeps its project credential in server-only configuration and returns authorized, structured responses to the signed-in user. Apply your application's own user authentication, tenant isolation, CSRF, and request limits at that boundary. The React package itself does not authenticate users or store credentials.
21
+
22
+ ## Hooks
23
+
24
+ - `useTidelightClient()` returns the client from `TidelightProvider` and throws a clear error outside the provider.
25
+ - `useTokenizedEquities(query)` loads supported instruments, aborts stale requests, and exposes data, loading, error, and refresh state.
26
+ - `useResearchJob(jobId, { pollIntervalMs })` reads a research job; polling is opt-in and stops on a terminal state.
27
+ - `useStartCompanyResearch()` exposes `start(ticker, idempotencyKey?)` and `cancel()` with request, error, and loading state.
28
+
29
+ The `TokenizedEquityGrid` component renders provider-returned instruments and has loading, error/retry, and empty states. It preserves the distinction between tokenized equity spot products and direct stock shares or perpetual contracts. Import `@tidelight/react/styles.css` to use its restrained default surface styling, or override the documented `--tidelight-*` CSS custom properties.
30
+
31
+ ## Example
32
+
33
+ ```tsx
34
+ import { TidelightProvider, TokenizedEquityGrid, useTokenizedEquities } from "@tidelight/react";
35
+ import "@tidelight/react/styles.css";
36
+
37
+ function MarketPanel() {
38
+ const result = useTokenizedEquities({ underlyingTicker: "NVDA", limit: 20 });
39
+ return <TokenizedEquityGrid
40
+ instruments={result.data?.data ?? []}
41
+ isLoading={result.isLoading}
42
+ error={result.error?.message}
43
+ onRetry={result.refresh}
44
+ />;
45
+ }
46
+
47
+ // `applicationServerClient` calls your authenticated same-origin BFF.
48
+ // Keep the Tidelight project key on that server, never in this browser bundle.
49
+ export function App({ applicationServerClient }) {
50
+ return <TidelightProvider client={applicationServerClient}><MarketPanel /></TidelightProvider>;
51
+ }
52
+ ```
53
+
54
+ ## Compatibility and support
55
+
56
+ | Surface | Support |
57
+ | --- | --- |
58
+ | React peer versions | React 18 and 19 |
59
+ | Runtime | Browser or React server/client application with an injected compatible transport |
60
+ | API operations | SDK tokenized-equity listing and company research job methods |
61
+ | Styling | Optional CSS file; custom properties can be themed |
62
+ | Peer dependencies | `@tidelight/sdk`, React 18 or 19, and React DOM 18 or 19 |
63
+
64
+ No hosted client-side credential flow or browser direct API usage is provided. API responses retain their normal Tidelight scopes, quota, provider and data-availability behavior. Retry behavior belongs to the supplied server-side SDK client.
65
+
66
+ ## Errors and troubleshooting
67
+
68
+ - A missing provider throws `useTidelightClient must be used inside TidelightProvider.`
69
+ - A request failure is returned in the hook's `error`; loading and prior data remain explicit.
70
+ - Polling is disabled by default; set `pollIntervalMs` between 1 and 30000 to opt in.
71
+ - If no instruments match, the grid shows an empty state based on the returned array; it never invents instruments.
72
+ - If unauthorized requests reach the BFF, verify its user session-to-project authorization mapping and server-side project key configuration.
73
+
74
+ ## Release and security
75
+
76
+ See [CHANGELOG.md](./CHANGELOG.md) for release history. Do not put credentials in UI props, error messages, logs, or examples.
@@ -0,0 +1,50 @@
1
+ import { type ReactNode } from "react";
2
+ import type { InstrumentPage, ResearchJob, TidelightClient, TokenizedEquityInstrument } from "@tidelight/sdk";
3
+ export type TidelightReactClient = Pick<TidelightClient, "listTokenizedEquities" | "startCompanyResearch" | "getResearchJob" | "cancelResearchJob">;
4
+ export type TokenizedEquityQuery = {
5
+ limit?: number;
6
+ cursor?: string;
7
+ underlyingTicker?: string;
8
+ };
9
+ export type AsyncValue<T> = {
10
+ data: T | null;
11
+ isLoading: boolean;
12
+ error: Error | null;
13
+ refresh: () => void;
14
+ };
15
+ export declare function TidelightProvider({ client, children }: {
16
+ client: TidelightReactClient;
17
+ children: ReactNode;
18
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<TidelightReactClient | null>>;
19
+ export declare function useTidelightClient(): TidelightReactClient;
20
+ export declare function useTokenizedEquities(query?: TokenizedEquityQuery): AsyncValue<InstrumentPage>;
21
+ export declare function useResearchJob(jobId: string | null, options?: {
22
+ pollIntervalMs?: number;
23
+ }): AsyncValue<ResearchJob>;
24
+ export declare function useStartCompanyResearch(): {
25
+ job: {
26
+ job_id: string;
27
+ status: string;
28
+ duplicate: boolean;
29
+ request_id: string;
30
+ } | null;
31
+ isLoading: boolean;
32
+ error: Error | null;
33
+ start: (ticker: string, idempotencyKey?: `${string}-${string}-${string}-${string}-${string}`) => Promise<{
34
+ job_id: string;
35
+ status: import("@tidelight/sdk").ResearchJobStatus;
36
+ duplicate: boolean;
37
+ request_id: string;
38
+ }>;
39
+ cancel: () => Promise<{
40
+ job_id: string;
41
+ status: string;
42
+ request_id: string;
43
+ } | null>;
44
+ };
45
+ export declare function TokenizedEquityGrid({ instruments, isLoading, error, onRetry }: {
46
+ instruments: readonly TokenizedEquityInstrument[];
47
+ isLoading?: boolean;
48
+ error?: string | null;
49
+ onRetry?: () => void;
50
+ }): import("react/jsx-runtime").JSX.Element;
package/dist/index.js ADDED
@@ -0,0 +1,119 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, createElement, useCallback, useContext, useEffect, useState } from "react";
3
+ const TidelightContext = createContext(null);
4
+ export function TidelightProvider({ client, children }) {
5
+ return createElement(TidelightContext.Provider, { value: client }, children);
6
+ }
7
+ export function useTidelightClient() {
8
+ const client = useContext(TidelightContext);
9
+ if (!client)
10
+ throw new Error("useTidelightClient must be used inside TidelightProvider.");
11
+ return client;
12
+ }
13
+ function asError(value) {
14
+ return value instanceof Error ? value : new Error("Tidelight could not complete this request.");
15
+ }
16
+ export function useTokenizedEquities(query = {}) {
17
+ const client = useTidelightClient();
18
+ const { limit, cursor, underlyingTicker } = query;
19
+ const [refreshIndex, setRefreshIndex] = useState(0);
20
+ const [result, setResult] = useState({ key: "", data: null, error: null });
21
+ const refresh = useCallback(() => setRefreshIndex(index => index + 1), []);
22
+ const requestKey = JSON.stringify([limit ?? 20, cursor ?? null, underlyingTicker?.toUpperCase() ?? null, refreshIndex]);
23
+ useEffect(() => {
24
+ let active = true;
25
+ const controller = new AbortController();
26
+ client.listTokenizedEquities({ limit, cursor, underlyingTicker, signal: controller.signal }).then(data => { if (active)
27
+ setResult({ key: requestKey, data, error: null }); }, error => { if (active && !controller.signal.aborted)
28
+ setResult(previous => ({ key: requestKey, data: previous.data, error: asError(error) })); });
29
+ return () => { active = false; controller.abort(); };
30
+ }, [client, limit, cursor, underlyingTicker, requestKey]);
31
+ return { data: result.data, isLoading: result.key !== requestKey, error: result.key === requestKey ? result.error : null, refresh };
32
+ }
33
+ export function useResearchJob(jobId, options = {}) {
34
+ const client = useTidelightClient();
35
+ const pollIntervalMs = options.pollIntervalMs ?? 0;
36
+ const [refreshIndex, setRefreshIndex] = useState(0);
37
+ const [result, setResult] = useState({ key: "", data: null, error: null });
38
+ const refresh = useCallback(() => setRefreshIndex(index => index + 1), []);
39
+ const validPollInterval = Number.isInteger(pollIntervalMs) && pollIntervalMs >= 0 && pollIntervalMs <= 30000;
40
+ const requestKey = JSON.stringify([jobId, pollIntervalMs, refreshIndex]);
41
+ useEffect(() => {
42
+ if (!jobId || !validPollInterval)
43
+ return;
44
+ const controller = new AbortController();
45
+ let timer;
46
+ let active = true;
47
+ const read = async () => {
48
+ try {
49
+ const data = await client.getResearchJob(jobId, { signal: controller.signal });
50
+ if (!active)
51
+ return;
52
+ setResult({ key: requestKey, data, error: null });
53
+ if (pollIntervalMs > 0 && !["complete", "failed", "cancelled"].includes(data.status))
54
+ timer = setTimeout(read, pollIntervalMs);
55
+ }
56
+ catch (error) {
57
+ if (active && !controller.signal.aborted)
58
+ setResult(previous => ({ key: requestKey, data: previous.data, error: asError(error) }));
59
+ }
60
+ };
61
+ void read();
62
+ return () => { active = false; controller.abort(); if (timer)
63
+ clearTimeout(timer); };
64
+ }, [client, jobId, pollIntervalMs, validPollInterval, requestKey]);
65
+ const error = !validPollInterval ? new RangeError("pollIntervalMs must be between 0 and 30000.") : result.key === requestKey ? result.error : null;
66
+ return { data: jobId && result.key === requestKey ? result.data : null, isLoading: Boolean(jobId && validPollInterval && result.key !== requestKey), error, refresh };
67
+ }
68
+ export function useStartCompanyResearch() {
69
+ const client = useTidelightClient();
70
+ const [job, setJob] = useState(null);
71
+ const [isLoading, setIsLoading] = useState(false);
72
+ const [error, setError] = useState(null);
73
+ const start = useCallback(async (ticker, idempotencyKey = globalThis.crypto.randomUUID()) => {
74
+ setIsLoading(true);
75
+ setError(null);
76
+ try {
77
+ const result = await client.startCompanyResearch(ticker, idempotencyKey);
78
+ setJob(result);
79
+ return result;
80
+ }
81
+ catch (value) {
82
+ const failure = asError(value);
83
+ setError(failure);
84
+ throw failure;
85
+ }
86
+ finally {
87
+ setIsLoading(false);
88
+ }
89
+ }, [client]);
90
+ const cancel = useCallback(async () => {
91
+ if (!job)
92
+ return null;
93
+ setIsLoading(true);
94
+ setError(null);
95
+ try {
96
+ const result = await client.cancelResearchJob(job.job_id);
97
+ setJob(current => current ? { ...current, status: result.status } : current);
98
+ return result;
99
+ }
100
+ catch (value) {
101
+ const failure = asError(value);
102
+ setError(failure);
103
+ throw failure;
104
+ }
105
+ finally {
106
+ setIsLoading(false);
107
+ }
108
+ }, [client, job]);
109
+ return { job, isLoading, error, start, cancel };
110
+ }
111
+ export function TokenizedEquityGrid({ instruments, isLoading = false, error, onRetry }) {
112
+ if (isLoading)
113
+ return _jsx("div", { className: "tidelight-react-grid", "aria-busy": "true", "aria-label": "Loading tokenized equity instruments", children: Array.from({ length: 3 }, (_, index) => _jsx("div", { className: "tidelight-react-card is-loading", "aria-hidden": "true" }, index)) });
114
+ if (error)
115
+ return _jsxs("div", { className: "tidelight-react-state", role: "alert", children: [_jsx("strong", { children: "Instruments could not be loaded." }), _jsx("span", { children: error }), onRetry && _jsx("button", { type: "button", onClick: onRetry, children: "Try again" })] });
116
+ if (instruments.length === 0)
117
+ return _jsxs("div", { className: "tidelight-react-state", role: "status", children: [_jsx("strong", { children: "No matching instruments" }), _jsx("span", { children: "Tidelight returned no supported instruments for this query." })] });
118
+ return _jsx("div", { className: "tidelight-react-grid", "aria-label": "Tidelight tokenized equity instruments", children: instruments.map(item => _jsxs("article", { className: "tidelight-react-card", children: [_jsxs("div", { className: "tidelight-react-card-top", children: [_jsx("span", { children: item.underlying_ticker }), _jsx("span", { children: item.market_session_status })] }), _jsx("h3", { children: item.symbol }), _jsx("p", { children: item.issuer_name }), _jsxs("footer", { children: [_jsx("span", { children: item.instrument_type.replaceAll("_", " ") }), _jsx("span", { children: item.source })] })] }, item.symbol)) });
119
+ }
package/package.json CHANGED
@@ -1,6 +1,49 @@
1
1
  {
2
2
  "name": "@tidelight/react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Typed React hooks and accessible components for Tidelight research and market integrations.",
6
+ "keywords": [
7
+ "tidelight",
8
+ "react",
9
+ "market-intelligence",
10
+ "research",
11
+ "hooks"
12
+ ],
13
+ "license": "Apache-2.0",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/TidelightOrg/tidelight.git",
17
+ "directory": "packages/react"
18
+ },
19
+ "homepage": "https://tidelight.app/developers/packages/react",
20
+ "bugs": {
21
+ "url": "https://github.com/TidelightOrg/tidelight/issues"
22
+ },
23
+ "engines": {
24
+ "node": ">=22"
25
+ },
26
+ "sideEffects": [
27
+ "./tidelight-react.css"
28
+ ],
29
+ "files": [
30
+ "dist",
31
+ "tidelight-react.css",
32
+ "README.md",
33
+ "CHANGELOG.md",
34
+ "LICENSE",
35
+ "NOTICE"
36
+ ],
37
+ "exports": {
38
+ ".": {
39
+ "types": "./dist/index.d.ts",
40
+ "import": "./dist/index.js"
41
+ },
42
+ "./styles.css": "./tidelight-react.css"
43
+ },
44
+ "peerDependencies": {
45
+ "@tidelight/sdk": "^0.1.0",
46
+ "react": "^18.0.0 || ^19.0.0",
47
+ "react-dom": "^18.0.0 || ^19.0.0"
48
+ }
49
+ }
@@ -0,0 +1,14 @@
1
+ .tidelight-react-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr));gap:1rem;color:var(--tidelight-foreground,#142822)}
2
+ .tidelight-react-card,.tidelight-react-state{min-width:0;border:1px solid var(--tidelight-border,#dfe5dc);border-radius:1rem;background:var(--tidelight-surface,#fffefa);padding:1.15rem;box-shadow:0 10px 30px rgb(14 38 30 / .045)}
3
+ .tidelight-react-card-top,.tidelight-react-card footer{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
4
+ .tidelight-react-card-top span:first-child{font:600 .78rem/1.2 ui-monospace,monospace;letter-spacing:.08em;color:var(--tidelight-accent,#138f7e)}
5
+ .tidelight-react-card-top span:last-child{font-size:.72rem;color:var(--tidelight-muted,#67766e);text-transform:capitalize}
6
+ .tidelight-react-card h3{margin:1.2rem 0 .25rem;font:650 1.3rem/1.2 ui-monospace,monospace;overflow-wrap:anywhere}
7
+ .tidelight-react-card p{margin:0 0 1.2rem;color:var(--tidelight-muted,#67766e)}
8
+ .tidelight-react-card footer{padding-top:.8rem;border-top:1px solid var(--tidelight-border,#dfe5dc);font-size:.68rem;color:var(--tidelight-muted,#67766e)}
9
+ .tidelight-react-state{display:flex;flex-direction:column;align-items:flex-start;gap:.5rem;color:var(--tidelight-muted,#67766e)}
10
+ .tidelight-react-state strong{color:var(--tidelight-foreground,#142822)}
11
+ .tidelight-react-state button{margin-top:.35rem;border:1px solid var(--tidelight-border,#dfe5dc);border-radius:.6rem;background:transparent;color:inherit;padding:.55rem .8rem;font:inherit;cursor:pointer}
12
+ .tidelight-react-card.is-loading{min-height:8.8rem;background:linear-gradient(100deg,var(--tidelight-surface,#fffefa) 35%,var(--tidelight-muted-surface,#f1f2eb) 50%,var(--tidelight-surface,#fffefa) 65%);background-size:220% 100%;animation:tidelight-react-shimmer 1.5s ease-in-out infinite}
13
+ @media(prefers-reduced-motion:reduce){.tidelight-react-card.is-loading{animation:none}}
14
+ @keyframes tidelight-react-shimmer{to{background-position-x:-220%}}