@telemetryos/sdk 1.5.1 → 1.7.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 +38 -0
- package/README.md +12 -18
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +25 -19
- package/dist/index.js +1270 -1616
- package/dist/react/Settings.d.ts +50 -0
- package/dist/react/hooks.d.ts +6 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/inject-styles.d.ts +1 -0
- package/dist/react.cjs +295 -0
- package/dist/react.js +655 -0
- package/package.json +20 -6
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface SettingsProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function SettingsContainer({ children }: SettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
interface SettingsFieldProps {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function SettingsField({ children }: SettingsFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface SettingsLabelProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function SettingsLabel({ children }: SettingsLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
interface SettingsInputFrameProps {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function SettingsInputFrame({ children }: SettingsInputFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
interface SettingsSelectFrameProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare function SettingsSelectFrame({ children }: SettingsSelectFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
interface SettingsTextAreaFrameProps {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function SettingsTextAreaFrame({ children }: SettingsTextAreaFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
interface SettingsSwitchFrameProps {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare function SettingsSwitchFrame({ children }: SettingsSwitchFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
interface SettingsSwitchLabelProps {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export declare function SettingsSwitchLabel({ children }: SettingsSwitchLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
interface SettingsCheckboxFrameProps {
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
export declare function SettingsCheckboxFrame({ children }: SettingsCheckboxFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
interface SettingsCheckboxLabelProps {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare function SettingsCheckboxLabel({ children }: SettingsCheckboxLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
interface SettingsRadioFrameProps {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
export declare function SettingsRadioFrame({ children }: SettingsRadioFrameProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
interface SettingsRadioLabelProps {
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export declare function SettingsRadioLabel({ children }: SettingsRadioLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { StoreSlice } from '@telemetryos/root-sdk';
|
|
3
|
+
export declare function useStoreState<S>(storeSlice: StoreSlice, key: string, initialState: S | (() => S), debounceDelay?: number): [boolean, S, Dispatch<SetStateAction<S>>];
|
|
4
|
+
export declare function useStoreState<S = undefined>(storeSlice: StoreSlice, key: string, initialState?: undefined, debounceDelay?: number): [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
5
|
+
export declare function createUseStoreState<S>(key: string, initialState: S | (() => S)): (storeSlice: StoreSlice, debounceDelay?: number) => [boolean, S, Dispatch<SetStateAction<S>>];
|
|
6
|
+
export declare function createUseStoreState<S = undefined>(key: string, initialState?: undefined): (storeSlice: StoreSlice, debounceDelay?: number) => [boolean, S | undefined, Dispatch<SetStateAction<S | undefined>>];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { SettingsContainer, SettingsField, SettingsLabel, SettingsInputFrame, SettingsSelectFrame, SettingsTextAreaFrame, SettingsSwitchFrame, SettingsSwitchLabel, SettingsCheckboxFrame, SettingsCheckboxLabel, SettingsRadioFrame, SettingsRadioLabel, } from './Settings.js';
|
|
2
|
+
export { useStoreState, createUseStoreState } from './hooks.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function injectStyles(): void;
|
package/dist/react.cjs
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),C=require("./index.cjs");var y={exports:{}},k={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var D;function oe(){if(D)return k;D=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function u(l,s,c){var f=null;if(c!==void 0&&(f=""+c),s.key!==void 0&&(f=""+s.key),"key"in s){c={};for(var b in s)b!=="key"&&(c[b]=s[b])}else c=s;return s=c.ref,{$$typeof:n,type:l,key:f,ref:s!==void 0?s:null,props:c}}return k.Fragment=i,k.jsx=u,k.jsxs=u,k}var E={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var M;function ae(){return M||(M=1,process.env.NODE_ENV!=="production"&&(function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case G:return"Profiler";case J:return"StrictMode";case Q:return"Suspense";case Z:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case q:return"Portal";case B:return e.displayName||"Context";case X:return(e._context.displayName||"Context")+".Consumer";case H:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return r=e.displayName||null,r!==null?r:n(e.type)||"Memo";case T:r=e._payload,e=e._init;try{return n(e(r))}catch{}}return null}function i(e){return""+e}function u(e){try{i(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,o=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),i(e)}}function l(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===T)return"<...>";try{var r=n(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=j.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function f(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function t(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function x(){var e=n(this.type);return Y[e]||(Y[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function R(e,r,t,o,S,O){var a=t.ref;return e={$$typeof:P,type:e,key:r,props:t,_owner:o},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:x}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function p(e,r,t,o,S,O){var a=r.children;if(a!==void 0)if(o)if(re(a)){for(o=0;o<a.length;o++)v(a[o]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else v(a);if(F.call(r,"key")){a=n(e);var _=Object.keys(r).filter(function(te){return te!=="key"});o=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",z[a+o]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,o,a,_,a),z[a+o]=!0)}if(a=null,t!==void 0&&(u(t),a=""+t),f(r)&&(u(r.key),a=""+r.key),"key"in r){t={};for(var N in r)N!=="key"&&(t[N]=r[N])}else t=r;return a&&b(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),R(e,a,t,s(),S,O)}function v(e){m(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===T&&(e._payload.status==="fulfilled"?m(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function m(e){return typeof e=="object"&&e!==null&&e.$$typeof===P}var h=g,P=Symbol.for("react.transitional.element"),q=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),J=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),B=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),ne=Symbol.for("react.client.reference"),j=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,re=Array.isArray,A=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var L,Y={},I=h.react_stack_bottom_frame.bind(h,c)(),$=A(l(c)),z={};E.Fragment=w,E.jsx=function(e,r,t){var o=1e4>j.recentlyCreatedOwnerStacks++;return p(e,r,t,!1,o?Error("react-stack-top-frame"):I,o?A(l(e)):$)},E.jsxs=function(e,r,t){var o=1e4>j.recentlyCreatedOwnerStacks++;return p(e,r,t,!0,o?Error("react-stack-top-frame"):I,o?A(l(e)):$)}})()),E}var V;function se(){return V||(V=1,process.env.NODE_ENV==="production"?y.exports=oe():y.exports=ae()),y.exports}var d=se();const ie=`:root {
|
|
23
|
+
--background: 0 0% 100%;
|
|
24
|
+
--foreground: 222.2 84% 4.9%;
|
|
25
|
+
|
|
26
|
+
--muted: 220 12% 95%;
|
|
27
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
28
|
+
|
|
29
|
+
--border: 214.3 31.8% 91.4%;
|
|
30
|
+
--input: 214.3 31.8% 91.4%;
|
|
31
|
+
|
|
32
|
+
--card: 0 0% 100%;
|
|
33
|
+
--card-foreground: 222.2 84% 4.9%;
|
|
34
|
+
|
|
35
|
+
--accent: 220 12% 95%;
|
|
36
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
37
|
+
|
|
38
|
+
--primary: 39 93% 59%;
|
|
39
|
+
--primary-foreground: 210 40% 98%;
|
|
40
|
+
|
|
41
|
+
--secondary: 210 40% 96.1%;
|
|
42
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
43
|
+
|
|
44
|
+
--destructive: 6 86% 61%;
|
|
45
|
+
--destructive-foreground: 210 40% 98%;
|
|
46
|
+
|
|
47
|
+
--ring: 222.2 84% 4.9%;
|
|
48
|
+
|
|
49
|
+
--radius: 0.5rem;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.dark {
|
|
53
|
+
--background: 210 28% 8%;
|
|
54
|
+
--foreground: 210 40% 88%;
|
|
55
|
+
|
|
56
|
+
--muted: 212, 28%, 10%;
|
|
57
|
+
--muted-foreground: 215 20.2% 65.1%;
|
|
58
|
+
|
|
59
|
+
--border: 212 24% 19%;
|
|
60
|
+
--input: 210 5% 31%;
|
|
61
|
+
|
|
62
|
+
--card: 212 28% 10%;
|
|
63
|
+
--card-foreground: 210 40% 98%;
|
|
64
|
+
|
|
65
|
+
--accent: 211 30% 15%;
|
|
66
|
+
--accent-foreground: 210 40% 98%;
|
|
67
|
+
|
|
68
|
+
--primary: 39 93% 59%;
|
|
69
|
+
--primary-foreground: 210 40% 98%;
|
|
70
|
+
|
|
71
|
+
--secondary: 217.2 32.6% 17.5%;
|
|
72
|
+
--secondary-foreground: 210 40% 98%;
|
|
73
|
+
|
|
74
|
+
--destructive: 6 86% 61%;
|
|
75
|
+
--destructive-foreground: 210 40% 98%;
|
|
76
|
+
|
|
77
|
+
--ring: 212.7 26.8% 83.9%;
|
|
78
|
+
|
|
79
|
+
--radius: 0.5rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.settings__container {
|
|
83
|
+
padding: 16px;
|
|
84
|
+
background: hsl(var(--background));
|
|
85
|
+
color: hsl(var(--foreground));
|
|
86
|
+
font-family: 'Rubik', sans-serif;
|
|
87
|
+
font-feature-settings: "rlig" 1, "calt" 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.settings__field {
|
|
91
|
+
margin-bottom: 24px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.settings__label {
|
|
95
|
+
font-size: 14px;
|
|
96
|
+
margin-bottom: 6px;
|
|
97
|
+
font-weight: 500;
|
|
98
|
+
color: hsl(var(--foreground));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.settings__input-frame > * {
|
|
102
|
+
height: 40px;
|
|
103
|
+
width: 100%;
|
|
104
|
+
font-size: 14px;
|
|
105
|
+
padding: 8px 12px;
|
|
106
|
+
border: 1px solid hsl(var(--border));
|
|
107
|
+
border-radius: var(--radius);
|
|
108
|
+
background: hsl(var(--background));
|
|
109
|
+
color: hsl(var(--foreground));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.settings__input-frame > *:focus {
|
|
113
|
+
outline: 1px solid hsl(var(--primary));
|
|
114
|
+
outline-offset: 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.settings__input-frame > *::placeholder {
|
|
118
|
+
color: hsl(var(--muted-foreground));
|
|
119
|
+
opacity: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.settings__select-frame > select {
|
|
123
|
+
appearance: none;
|
|
124
|
+
height: 40px;
|
|
125
|
+
width: 100%;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
padding: 8px 36px 8px 12px;
|
|
128
|
+
border: 1px solid hsl(var(--border));
|
|
129
|
+
border-radius: var(--radius);
|
|
130
|
+
background-color: hsl(var(--background));
|
|
131
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
|
|
132
|
+
background-repeat: no-repeat;
|
|
133
|
+
background-position: right 12px center;
|
|
134
|
+
color: hsl(var(--foreground));
|
|
135
|
+
cursor: pointer;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.settings__select-frame > select:hover {
|
|
139
|
+
background-color: hsl(var(--accent));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.settings__select-frame > select:focus {
|
|
143
|
+
outline: 1px solid hsl(var(--primary));
|
|
144
|
+
outline-offset: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.settings__textarea-frame > textarea {
|
|
148
|
+
width: 100%;
|
|
149
|
+
min-height: 80px;
|
|
150
|
+
font-family: inherit;
|
|
151
|
+
font-size: 14px;
|
|
152
|
+
line-height: 1.4em;
|
|
153
|
+
padding: 8px 12px;
|
|
154
|
+
border: 1px solid hsl(var(--border));
|
|
155
|
+
border-radius: var(--radius);
|
|
156
|
+
background: hsl(var(--background));
|
|
157
|
+
color: hsl(var(--foreground));
|
|
158
|
+
resize: vertical;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.settings__textarea-frame > textarea:focus {
|
|
162
|
+
outline: 1px solid hsl(var(--primary));
|
|
163
|
+
outline-offset: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.settings__textarea-frame > textarea::placeholder {
|
|
167
|
+
color: hsl(var(--muted-foreground));
|
|
168
|
+
opacity: 1;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.settings__switch-frame {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
gap: 8px;
|
|
175
|
+
font-size: 14px;
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.settings__switch-frame > input[type="checkbox"] {
|
|
180
|
+
appearance: none;
|
|
181
|
+
width: 44px;
|
|
182
|
+
height: 24px;
|
|
183
|
+
background: hsl(var(--input));
|
|
184
|
+
border-radius: 12px;
|
|
185
|
+
position: relative;
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
transition: background 0.2s;
|
|
188
|
+
flex-shrink: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.settings__switch-frame > input[type="checkbox"]::after {
|
|
192
|
+
content: '';
|
|
193
|
+
position: absolute;
|
|
194
|
+
top: 2px;
|
|
195
|
+
left: 2px;
|
|
196
|
+
width: 20px;
|
|
197
|
+
height: 20px;
|
|
198
|
+
background: hsl(var(--background));
|
|
199
|
+
border-radius: 50%;
|
|
200
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
|
|
201
|
+
transition: transform 0.2s;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.settings__switch-frame > input[type="checkbox"]:checked {
|
|
205
|
+
background: hsl(var(--primary));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.settings__switch-frame > input[type="checkbox"]:checked::after {
|
|
209
|
+
transform: translateX(20px);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.settings__switch-label {
|
|
213
|
+
flex: 1;
|
|
214
|
+
color: hsl(var(--foreground));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.settings__checkbox-frame {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
gap: 8px;
|
|
221
|
+
font-size: 14px;
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.settings__checkbox-frame > input[type="checkbox"] {
|
|
226
|
+
appearance: none;
|
|
227
|
+
width: 16px;
|
|
228
|
+
height: 16px;
|
|
229
|
+
background: hsl(var(--background));
|
|
230
|
+
border: 1px solid hsl(var(--primary));
|
|
231
|
+
border-radius: 2px;
|
|
232
|
+
cursor: pointer;
|
|
233
|
+
position: relative;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.settings__checkbox-frame > input[type="checkbox"]:checked {
|
|
237
|
+
background: hsl(var(--primary));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.settings__checkbox-frame > input[type="checkbox"]:checked::after {
|
|
241
|
+
content: '';
|
|
242
|
+
position: absolute;
|
|
243
|
+
top: 1px;
|
|
244
|
+
left: 5px;
|
|
245
|
+
width: 4px;
|
|
246
|
+
height: 8px;
|
|
247
|
+
border: solid hsl(var(--primary-foreground));
|
|
248
|
+
border-width: 0 2px 2px 0;
|
|
249
|
+
transform: rotate(45deg);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.settings__checkbox-label {
|
|
253
|
+
flex: 1;
|
|
254
|
+
color: hsl(var(--foreground));
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.settings__radio-frame {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: 8px;
|
|
261
|
+
font-size: 14px;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.settings__radio-frame > input[type="radio"] {
|
|
266
|
+
appearance: none;
|
|
267
|
+
width: 16px;
|
|
268
|
+
height: 16px;
|
|
269
|
+
background: hsl(var(--background));
|
|
270
|
+
border: 1px solid hsl(var(--primary));
|
|
271
|
+
border-radius: 50%;
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
position: relative;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.settings__radio-frame > input[type="radio"]:checked {
|
|
277
|
+
background: hsl(var(--primary));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.settings__radio-frame > input[type="radio"]:checked::after {
|
|
281
|
+
content: '';
|
|
282
|
+
position: absolute;
|
|
283
|
+
top: 4px;
|
|
284
|
+
left: 4px;
|
|
285
|
+
width: 6px;
|
|
286
|
+
height: 6px;
|
|
287
|
+
background: hsl(var(--primary-foreground));
|
|
288
|
+
border-radius: 50%;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.settings__radio-label {
|
|
292
|
+
flex: 1;
|
|
293
|
+
color: hsl(var(--foreground));
|
|
294
|
+
}
|
|
295
|
+
`;let U=!1;function ce(){if(U||typeof document>"u")return;const n=document.createElement("style");n.setAttribute("data-telemetryos-sdk",""),n.textContent=ie,document.head.appendChild(n),U=!0}ce();function ue({children:n}){return g.useEffect(()=>{const i=window.matchMedia("(prefers-color-scheme: dark)"),u=c=>{let f;c==="system"?f=i.matches:f=c!=="light",f?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},l=C.environment().subscribeColorScheme(u);l.catch(console.error);const s=()=>{C.environment().getColorScheme().then(u).catch(console.error)};return i.addEventListener("change",s),()=>{l.then(()=>C.environment().unsubscribeColorScheme(u)).catch(console.error),i.removeEventListener("change",s)}},[]),d.jsx("div",{className:"settings__container",children:n})}function le({children:n}){return d.jsx("div",{className:"settings__field",children:n})}function de({children:n}){return d.jsx("div",{className:"settings__label",children:n})}function fe({children:n}){return d.jsx("div",{className:"settings__input-frame",children:n})}function pe({children:n}){return d.jsx("div",{className:"settings__select-frame",children:n})}function me({children:n}){return d.jsx("div",{className:"settings__textarea-frame",children:n})}function ge({children:n}){return d.jsx("label",{className:"settings__switch-frame",children:n})}function be({children:n}){return d.jsx("span",{className:"settings__switch-label",children:n})}function he({children:n}){return d.jsx("label",{className:"settings__checkbox-frame",children:n})}function _e({children:n}){return d.jsx("span",{className:"settings__checkbox-label",children:n})}function xe({children:n}){return d.jsx("label",{className:"settings__radio-frame",children:n})}function ve({children:n}){return d.jsx("span",{className:"settings__radio-label",children:n})}function W(n,i,u,l=0){var s;const[c,f]=g.useState(!0),[b]=g.useState(u),[x,R]=g.useState(void 0),[p,v]=g.useState(void 0);return g.useEffect(()=>{const m=h=>{R(h),f(!1)};return n.subscribe(i,m).catch(console.error),()=>{n.unsubscribe(i,m).catch(console.error)}},[n,i]),g.useEffect(()=>{if(typeof p<"u"){const m=setTimeout(()=>{n.set(i,p)},l);return()=>clearTimeout(m)}},[p,n,i,l]),g.useEffect(()=>{if(JSON.stringify(p)===JSON.stringify(x)){const m=setTimeout(()=>{v(void 0)},500);return()=>clearTimeout(m)}},[p,x]),[c,(s=p??x)!==null&&s!==void 0?s:b,v]}function ke(n,i){return(u,l=0)=>W(u,n,i,l)}exports.SettingsCheckboxFrame=he;exports.SettingsCheckboxLabel=_e;exports.SettingsContainer=ue;exports.SettingsField=le;exports.SettingsInputFrame=fe;exports.SettingsLabel=de;exports.SettingsRadioFrame=xe;exports.SettingsRadioLabel=ve;exports.SettingsSelectFrame=pe;exports.SettingsSwitchFrame=ge;exports.SettingsSwitchLabel=be;exports.SettingsTextAreaFrame=me;exports.createUseStoreState=ke;exports.useStoreState=W;
|