@bgord/ui 0.1.1 → 0.1.2
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/dist/index.js +10 -475
- package/package.json +5 -9
package/dist/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
18
2
|
var __export = (target, all) => {
|
|
19
3
|
for (var name in all)
|
|
20
4
|
__defProp(target, name, {
|
|
@@ -24,455 +8,6 @@ var __export = (target, all) => {
|
|
|
24
8
|
set: (newValue) => all[name] = () => newValue
|
|
25
9
|
});
|
|
26
10
|
};
|
|
27
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
28
|
-
|
|
29
|
-
// node_modules/react/cjs/react.production.js
|
|
30
|
-
var exports_react_production = {};
|
|
31
|
-
__export(exports_react_production, {
|
|
32
|
-
version: () => $version,
|
|
33
|
-
useTransition: () => $useTransition,
|
|
34
|
-
useSyncExternalStore: () => $useSyncExternalStore,
|
|
35
|
-
useState: () => $useState,
|
|
36
|
-
useRef: () => $useRef,
|
|
37
|
-
useReducer: () => $useReducer,
|
|
38
|
-
useOptimistic: () => $useOptimistic,
|
|
39
|
-
useMemo: () => $useMemo,
|
|
40
|
-
useLayoutEffect: () => $useLayoutEffect,
|
|
41
|
-
useInsertionEffect: () => $useInsertionEffect,
|
|
42
|
-
useImperativeHandle: () => $useImperativeHandle,
|
|
43
|
-
useId: () => $useId,
|
|
44
|
-
useEffect: () => $useEffect,
|
|
45
|
-
useDeferredValue: () => $useDeferredValue,
|
|
46
|
-
useDebugValue: () => $useDebugValue,
|
|
47
|
-
useContext: () => $useContext,
|
|
48
|
-
useCallback: () => $useCallback,
|
|
49
|
-
useActionState: () => $useActionState,
|
|
50
|
-
use: () => $use,
|
|
51
|
-
unstable_useCacheRefresh: () => $unstable_useCacheRefresh,
|
|
52
|
-
startTransition: () => $startTransition,
|
|
53
|
-
memo: () => $memo,
|
|
54
|
-
lazy: () => $lazy,
|
|
55
|
-
isValidElement: () => $isValidElement,
|
|
56
|
-
forwardRef: () => $forwardRef,
|
|
57
|
-
createRef: () => $createRef,
|
|
58
|
-
createElement: () => $createElement,
|
|
59
|
-
createContext: () => $createContext,
|
|
60
|
-
cloneElement: () => $cloneElement,
|
|
61
|
-
cache: () => $cache,
|
|
62
|
-
__COMPILER_RUNTIME: () => $__COMPILER_RUNTIME,
|
|
63
|
-
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: () => $__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
64
|
-
Suspense: () => $Suspense,
|
|
65
|
-
StrictMode: () => $StrictMode,
|
|
66
|
-
PureComponent: () => $PureComponent,
|
|
67
|
-
Profiler: () => $Profiler,
|
|
68
|
-
Fragment: () => $Fragment,
|
|
69
|
-
Component: () => $Component,
|
|
70
|
-
Children: () => $Children
|
|
71
|
-
});
|
|
72
|
-
function getIteratorFn(maybeIterable) {
|
|
73
|
-
if (maybeIterable === null || typeof maybeIterable !== "object")
|
|
74
|
-
return null;
|
|
75
|
-
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
76
|
-
return typeof maybeIterable === "function" ? maybeIterable : null;
|
|
77
|
-
}
|
|
78
|
-
function Component(props, context, updater) {
|
|
79
|
-
this.props = props;
|
|
80
|
-
this.context = context;
|
|
81
|
-
this.refs = emptyObject;
|
|
82
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
83
|
-
}
|
|
84
|
-
function ComponentDummy() {}
|
|
85
|
-
function PureComponent(props, context, updater) {
|
|
86
|
-
this.props = props;
|
|
87
|
-
this.context = context;
|
|
88
|
-
this.refs = emptyObject;
|
|
89
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
|
90
|
-
}
|
|
91
|
-
function ReactElement(type, key, self, source, owner, props) {
|
|
92
|
-
self = props.ref;
|
|
93
|
-
return {
|
|
94
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
95
|
-
type,
|
|
96
|
-
key,
|
|
97
|
-
ref: self !== undefined ? self : null,
|
|
98
|
-
props
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
|
102
|
-
return ReactElement(oldElement.type, newKey, undefined, undefined, undefined, oldElement.props);
|
|
103
|
-
}
|
|
104
|
-
function isValidElement(object) {
|
|
105
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
106
|
-
}
|
|
107
|
-
function escape(key) {
|
|
108
|
-
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
109
|
-
return "$" + key.replace(/[=:]/g, function(match) {
|
|
110
|
-
return escaperLookup[match];
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function getElementKey(element, index) {
|
|
114
|
-
return typeof element === "object" && element !== null && element.key != null ? escape("" + element.key) : index.toString(36);
|
|
115
|
-
}
|
|
116
|
-
function noop$1() {}
|
|
117
|
-
function resolveThenable(thenable) {
|
|
118
|
-
switch (thenable.status) {
|
|
119
|
-
case "fulfilled":
|
|
120
|
-
return thenable.value;
|
|
121
|
-
case "rejected":
|
|
122
|
-
throw thenable.reason;
|
|
123
|
-
default:
|
|
124
|
-
switch (typeof thenable.status === "string" ? thenable.then(noop$1, noop$1) : (thenable.status = "pending", thenable.then(function(fulfilledValue) {
|
|
125
|
-
thenable.status === "pending" && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
126
|
-
}, function(error) {
|
|
127
|
-
thenable.status === "pending" && (thenable.status = "rejected", thenable.reason = error);
|
|
128
|
-
})), thenable.status) {
|
|
129
|
-
case "fulfilled":
|
|
130
|
-
return thenable.value;
|
|
131
|
-
case "rejected":
|
|
132
|
-
throw thenable.reason;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
throw thenable;
|
|
136
|
-
}
|
|
137
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
138
|
-
var type = typeof children;
|
|
139
|
-
if (type === "undefined" || type === "boolean")
|
|
140
|
-
children = null;
|
|
141
|
-
var invokeCallback = false;
|
|
142
|
-
if (children === null)
|
|
143
|
-
invokeCallback = true;
|
|
144
|
-
else
|
|
145
|
-
switch (type) {
|
|
146
|
-
case "bigint":
|
|
147
|
-
case "string":
|
|
148
|
-
case "number":
|
|
149
|
-
invokeCallback = true;
|
|
150
|
-
break;
|
|
151
|
-
case "object":
|
|
152
|
-
switch (children.$$typeof) {
|
|
153
|
-
case REACT_ELEMENT_TYPE:
|
|
154
|
-
case REACT_PORTAL_TYPE:
|
|
155
|
-
invokeCallback = true;
|
|
156
|
-
break;
|
|
157
|
-
case REACT_LAZY_TYPE:
|
|
158
|
-
return invokeCallback = children._init, mapIntoArray(invokeCallback(children._payload), array, escapedPrefix, nameSoFar, callback);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (invokeCallback)
|
|
162
|
-
return callback = callback(children), invokeCallback = nameSoFar === "" ? "." + getElementKey(children, 0) : nameSoFar, isArrayImpl(callback) ? (escapedPrefix = "", invokeCallback != null && (escapedPrefix = invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
163
|
-
return c;
|
|
164
|
-
})) : callback != null && (isValidElement(callback) && (callback = cloneAndReplaceKey(callback, escapedPrefix + (callback.key == null || children && children.key === callback.key ? "" : ("" + callback.key).replace(userProvidedKeyEscapeRegex, "$&/") + "/") + invokeCallback)), array.push(callback)), 1;
|
|
165
|
-
invokeCallback = 0;
|
|
166
|
-
var nextNamePrefix = nameSoFar === "" ? "." : nameSoFar + ":";
|
|
167
|
-
if (isArrayImpl(children))
|
|
168
|
-
for (var i = 0;i < children.length; i++)
|
|
169
|
-
nameSoFar = children[i], type = nextNamePrefix + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
|
170
|
-
else if (i = getIteratorFn(children), typeof i === "function")
|
|
171
|
-
for (children = i.call(children), i = 0;!(nameSoFar = children.next()).done; )
|
|
172
|
-
nameSoFar = nameSoFar.value, type = nextNamePrefix + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(nameSoFar, array, escapedPrefix, type, callback);
|
|
173
|
-
else if (type === "object") {
|
|
174
|
-
if (typeof children.then === "function")
|
|
175
|
-
return mapIntoArray(resolveThenable(children), array, escapedPrefix, nameSoFar, callback);
|
|
176
|
-
array = String(children);
|
|
177
|
-
throw Error("Objects are not valid as a React child (found: " + (array === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead.");
|
|
178
|
-
}
|
|
179
|
-
return invokeCallback;
|
|
180
|
-
}
|
|
181
|
-
function mapChildren(children, func, context) {
|
|
182
|
-
if (children == null)
|
|
183
|
-
return children;
|
|
184
|
-
var result = [], count = 0;
|
|
185
|
-
mapIntoArray(children, result, "", "", function(child) {
|
|
186
|
-
return func.call(context, child, count++);
|
|
187
|
-
});
|
|
188
|
-
return result;
|
|
189
|
-
}
|
|
190
|
-
function lazyInitializer(payload) {
|
|
191
|
-
if (payload._status === -1) {
|
|
192
|
-
var ctor = payload._result;
|
|
193
|
-
ctor = ctor();
|
|
194
|
-
ctor.then(function(moduleObject) {
|
|
195
|
-
if (payload._status === 0 || payload._status === -1)
|
|
196
|
-
payload._status = 1, payload._result = moduleObject;
|
|
197
|
-
}, function(error) {
|
|
198
|
-
if (payload._status === 0 || payload._status === -1)
|
|
199
|
-
payload._status = 2, payload._result = error;
|
|
200
|
-
});
|
|
201
|
-
payload._status === -1 && (payload._status = 0, payload._result = ctor);
|
|
202
|
-
}
|
|
203
|
-
if (payload._status === 1)
|
|
204
|
-
return payload._result.default;
|
|
205
|
-
throw payload._result;
|
|
206
|
-
}
|
|
207
|
-
function noop() {}
|
|
208
|
-
var REACT_ELEMENT_TYPE, REACT_PORTAL_TYPE, REACT_FRAGMENT_TYPE, REACT_STRICT_MODE_TYPE, REACT_PROFILER_TYPE, REACT_CONSUMER_TYPE, REACT_CONTEXT_TYPE, REACT_FORWARD_REF_TYPE, REACT_SUSPENSE_TYPE, REACT_MEMO_TYPE, REACT_LAZY_TYPE, MAYBE_ITERATOR_SYMBOL, ReactNoopUpdateQueue, assign, emptyObject, pureComponentPrototype, isArrayImpl, ReactSharedInternals, hasOwnProperty, userProvidedKeyEscapeRegex, reportGlobalError, $Children, $Component, $Fragment, $Profiler, $PureComponent, $StrictMode, $Suspense, $__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $__COMPILER_RUNTIME, $cache = function(fn) {
|
|
209
|
-
return function() {
|
|
210
|
-
return fn.apply(null, arguments);
|
|
211
|
-
};
|
|
212
|
-
}, $cloneElement = function(element, config, children) {
|
|
213
|
-
if (element === null || element === undefined)
|
|
214
|
-
throw Error("The argument must be a React element, but you passed " + element + ".");
|
|
215
|
-
var props = assign({}, element.props), key = element.key, owner = undefined;
|
|
216
|
-
if (config != null)
|
|
217
|
-
for (propName in config.ref !== undefined && (owner = undefined), config.key !== undefined && (key = "" + config.key), config)
|
|
218
|
-
!hasOwnProperty.call(config, propName) || propName === "key" || propName === "__self" || propName === "__source" || propName === "ref" && config.ref === undefined || (props[propName] = config[propName]);
|
|
219
|
-
var propName = arguments.length - 2;
|
|
220
|
-
if (propName === 1)
|
|
221
|
-
props.children = children;
|
|
222
|
-
else if (1 < propName) {
|
|
223
|
-
for (var childArray = Array(propName), i = 0;i < propName; i++)
|
|
224
|
-
childArray[i] = arguments[i + 2];
|
|
225
|
-
props.children = childArray;
|
|
226
|
-
}
|
|
227
|
-
return ReactElement(element.type, key, undefined, undefined, owner, props);
|
|
228
|
-
}, $createContext = function(defaultValue) {
|
|
229
|
-
defaultValue = {
|
|
230
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
|
231
|
-
_currentValue: defaultValue,
|
|
232
|
-
_currentValue2: defaultValue,
|
|
233
|
-
_threadCount: 0,
|
|
234
|
-
Provider: null,
|
|
235
|
-
Consumer: null
|
|
236
|
-
};
|
|
237
|
-
defaultValue.Provider = defaultValue;
|
|
238
|
-
defaultValue.Consumer = {
|
|
239
|
-
$$typeof: REACT_CONSUMER_TYPE,
|
|
240
|
-
_context: defaultValue
|
|
241
|
-
};
|
|
242
|
-
return defaultValue;
|
|
243
|
-
}, $createElement = function(type, config, children) {
|
|
244
|
-
var propName, props = {}, key = null;
|
|
245
|
-
if (config != null)
|
|
246
|
-
for (propName in config.key !== undefined && (key = "" + config.key), config)
|
|
247
|
-
hasOwnProperty.call(config, propName) && propName !== "key" && propName !== "__self" && propName !== "__source" && (props[propName] = config[propName]);
|
|
248
|
-
var childrenLength = arguments.length - 2;
|
|
249
|
-
if (childrenLength === 1)
|
|
250
|
-
props.children = children;
|
|
251
|
-
else if (1 < childrenLength) {
|
|
252
|
-
for (var childArray = Array(childrenLength), i = 0;i < childrenLength; i++)
|
|
253
|
-
childArray[i] = arguments[i + 2];
|
|
254
|
-
props.children = childArray;
|
|
255
|
-
}
|
|
256
|
-
if (type && type.defaultProps)
|
|
257
|
-
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
258
|
-
props[propName] === undefined && (props[propName] = childrenLength[propName]);
|
|
259
|
-
return ReactElement(type, key, undefined, undefined, null, props);
|
|
260
|
-
}, $createRef = function() {
|
|
261
|
-
return { current: null };
|
|
262
|
-
}, $forwardRef = function(render) {
|
|
263
|
-
return { $$typeof: REACT_FORWARD_REF_TYPE, render };
|
|
264
|
-
}, $isValidElement, $lazy = function(ctor) {
|
|
265
|
-
return {
|
|
266
|
-
$$typeof: REACT_LAZY_TYPE,
|
|
267
|
-
_payload: { _status: -1, _result: ctor },
|
|
268
|
-
_init: lazyInitializer
|
|
269
|
-
};
|
|
270
|
-
}, $memo = function(type, compare) {
|
|
271
|
-
return {
|
|
272
|
-
$$typeof: REACT_MEMO_TYPE,
|
|
273
|
-
type,
|
|
274
|
-
compare: compare === undefined ? null : compare
|
|
275
|
-
};
|
|
276
|
-
}, $startTransition = function(scope) {
|
|
277
|
-
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
278
|
-
ReactSharedInternals.T = currentTransition;
|
|
279
|
-
try {
|
|
280
|
-
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
281
|
-
onStartTransitionFinish !== null && onStartTransitionFinish(currentTransition, returnValue);
|
|
282
|
-
typeof returnValue === "object" && returnValue !== null && typeof returnValue.then === "function" && returnValue.then(noop, reportGlobalError);
|
|
283
|
-
} catch (error) {
|
|
284
|
-
reportGlobalError(error);
|
|
285
|
-
} finally {
|
|
286
|
-
ReactSharedInternals.T = prevTransition;
|
|
287
|
-
}
|
|
288
|
-
}, $unstable_useCacheRefresh = function() {
|
|
289
|
-
return ReactSharedInternals.H.useCacheRefresh();
|
|
290
|
-
}, $use = function(usable) {
|
|
291
|
-
return ReactSharedInternals.H.use(usable);
|
|
292
|
-
}, $useActionState = function(action, initialState, permalink) {
|
|
293
|
-
return ReactSharedInternals.H.useActionState(action, initialState, permalink);
|
|
294
|
-
}, $useCallback = function(callback, deps) {
|
|
295
|
-
return ReactSharedInternals.H.useCallback(callback, deps);
|
|
296
|
-
}, $useContext = function(Context) {
|
|
297
|
-
return ReactSharedInternals.H.useContext(Context);
|
|
298
|
-
}, $useDebugValue = function() {}, $useDeferredValue = function(value, initialValue) {
|
|
299
|
-
return ReactSharedInternals.H.useDeferredValue(value, initialValue);
|
|
300
|
-
}, $useEffect = function(create, createDeps, update) {
|
|
301
|
-
var dispatcher = ReactSharedInternals.H;
|
|
302
|
-
if (typeof update === "function")
|
|
303
|
-
throw Error("useEffect CRUD overload is not enabled in this build of React.");
|
|
304
|
-
return dispatcher.useEffect(create, createDeps);
|
|
305
|
-
}, $useId = function() {
|
|
306
|
-
return ReactSharedInternals.H.useId();
|
|
307
|
-
}, $useImperativeHandle = function(ref, create, deps) {
|
|
308
|
-
return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);
|
|
309
|
-
}, $useInsertionEffect = function(create, deps) {
|
|
310
|
-
return ReactSharedInternals.H.useInsertionEffect(create, deps);
|
|
311
|
-
}, $useLayoutEffect = function(create, deps) {
|
|
312
|
-
return ReactSharedInternals.H.useLayoutEffect(create, deps);
|
|
313
|
-
}, $useMemo = function(create, deps) {
|
|
314
|
-
return ReactSharedInternals.H.useMemo(create, deps);
|
|
315
|
-
}, $useOptimistic = function(passthrough, reducer) {
|
|
316
|
-
return ReactSharedInternals.H.useOptimistic(passthrough, reducer);
|
|
317
|
-
}, $useReducer = function(reducer, initialArg, init) {
|
|
318
|
-
return ReactSharedInternals.H.useReducer(reducer, initialArg, init);
|
|
319
|
-
}, $useRef = function(initialValue) {
|
|
320
|
-
return ReactSharedInternals.H.useRef(initialValue);
|
|
321
|
-
}, $useState = function(initialState) {
|
|
322
|
-
return ReactSharedInternals.H.useState(initialState);
|
|
323
|
-
}, $useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
324
|
-
return ReactSharedInternals.H.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
325
|
-
}, $useTransition = function() {
|
|
326
|
-
return ReactSharedInternals.H.useTransition();
|
|
327
|
-
}, $version = "19.1.0";
|
|
328
|
-
var init_react_production = __esm(() => {
|
|
329
|
-
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element");
|
|
330
|
-
REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
331
|
-
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
332
|
-
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
333
|
-
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
334
|
-
REACT_CONSUMER_TYPE = Symbol.for("react.consumer");
|
|
335
|
-
REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
336
|
-
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
337
|
-
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
338
|
-
REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
339
|
-
REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
340
|
-
MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
341
|
-
ReactNoopUpdateQueue = {
|
|
342
|
-
isMounted: function() {
|
|
343
|
-
return false;
|
|
344
|
-
},
|
|
345
|
-
enqueueForceUpdate: function() {},
|
|
346
|
-
enqueueReplaceState: function() {},
|
|
347
|
-
enqueueSetState: function() {}
|
|
348
|
-
};
|
|
349
|
-
assign = Object.assign;
|
|
350
|
-
emptyObject = {};
|
|
351
|
-
Component.prototype.isReactComponent = {};
|
|
352
|
-
Component.prototype.setState = function(partialState, callback) {
|
|
353
|
-
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null)
|
|
354
|
-
throw Error("takes an object of state variables to update or a function which returns an object of state variables.");
|
|
355
|
-
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
356
|
-
};
|
|
357
|
-
Component.prototype.forceUpdate = function(callback) {
|
|
358
|
-
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
359
|
-
};
|
|
360
|
-
ComponentDummy.prototype = Component.prototype;
|
|
361
|
-
pureComponentPrototype = PureComponent.prototype = new ComponentDummy;
|
|
362
|
-
pureComponentPrototype.constructor = PureComponent;
|
|
363
|
-
assign(pureComponentPrototype, Component.prototype);
|
|
364
|
-
pureComponentPrototype.isPureReactComponent = true;
|
|
365
|
-
isArrayImpl = Array.isArray;
|
|
366
|
-
ReactSharedInternals = { H: null, A: null, T: null, S: null, V: null };
|
|
367
|
-
hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
368
|
-
userProvidedKeyEscapeRegex = /\/+/g;
|
|
369
|
-
reportGlobalError = typeof reportError === "function" ? reportError : function(error) {
|
|
370
|
-
if (typeof window === "object" && typeof window.ErrorEvent === "function") {
|
|
371
|
-
var event = new window.ErrorEvent("error", {
|
|
372
|
-
bubbles: true,
|
|
373
|
-
cancelable: true,
|
|
374
|
-
message: typeof error === "object" && error !== null && typeof error.message === "string" ? String(error.message) : String(error),
|
|
375
|
-
error
|
|
376
|
-
});
|
|
377
|
-
if (!window.dispatchEvent(event))
|
|
378
|
-
return;
|
|
379
|
-
} else if (typeof process === "object" && typeof process.emit === "function") {
|
|
380
|
-
process.emit("uncaughtException", error);
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
console.error(error);
|
|
384
|
-
};
|
|
385
|
-
$Children = {
|
|
386
|
-
map: mapChildren,
|
|
387
|
-
forEach: function(children, forEachFunc, forEachContext) {
|
|
388
|
-
mapChildren(children, function() {
|
|
389
|
-
forEachFunc.apply(this, arguments);
|
|
390
|
-
}, forEachContext);
|
|
391
|
-
},
|
|
392
|
-
count: function(children) {
|
|
393
|
-
var n = 0;
|
|
394
|
-
mapChildren(children, function() {
|
|
395
|
-
n++;
|
|
396
|
-
});
|
|
397
|
-
return n;
|
|
398
|
-
},
|
|
399
|
-
toArray: function(children) {
|
|
400
|
-
return mapChildren(children, function(child) {
|
|
401
|
-
return child;
|
|
402
|
-
}) || [];
|
|
403
|
-
},
|
|
404
|
-
only: function(children) {
|
|
405
|
-
if (!isValidElement(children))
|
|
406
|
-
throw Error("React.Children.only expected to receive a single React element child.");
|
|
407
|
-
return children;
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
$Component = Component;
|
|
411
|
-
$Fragment = REACT_FRAGMENT_TYPE;
|
|
412
|
-
$Profiler = REACT_PROFILER_TYPE;
|
|
413
|
-
$PureComponent = PureComponent;
|
|
414
|
-
$StrictMode = REACT_STRICT_MODE_TYPE;
|
|
415
|
-
$Suspense = REACT_SUSPENSE_TYPE;
|
|
416
|
-
$__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
417
|
-
$__COMPILER_RUNTIME = {
|
|
418
|
-
__proto__: null,
|
|
419
|
-
c: function(size) {
|
|
420
|
-
return ReactSharedInternals.H.useMemoCache(size);
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
$isValidElement = isValidElement;
|
|
424
|
-
});
|
|
425
|
-
|
|
426
|
-
// node_modules/react/index.js
|
|
427
|
-
var require_react = __commonJS((exports, module) => {
|
|
428
|
-
init_react_production();
|
|
429
|
-
if (true) {
|
|
430
|
-
module.exports = exports_react_production;
|
|
431
|
-
} else {}
|
|
432
|
-
});
|
|
433
|
-
|
|
434
|
-
// node_modules/react/cjs/react-jsx-runtime.production.js
|
|
435
|
-
var exports_react_jsx_runtime_production = {};
|
|
436
|
-
__export(exports_react_jsx_runtime_production, {
|
|
437
|
-
jsxs: () => $jsxs,
|
|
438
|
-
jsx: () => $jsx,
|
|
439
|
-
Fragment: () => $Fragment2
|
|
440
|
-
});
|
|
441
|
-
function jsxProd(type, config, maybeKey) {
|
|
442
|
-
var key = null;
|
|
443
|
-
maybeKey !== undefined && (key = "" + maybeKey);
|
|
444
|
-
config.key !== undefined && (key = "" + config.key);
|
|
445
|
-
if ("key" in config) {
|
|
446
|
-
maybeKey = {};
|
|
447
|
-
for (var propName in config)
|
|
448
|
-
propName !== "key" && (maybeKey[propName] = config[propName]);
|
|
449
|
-
} else
|
|
450
|
-
maybeKey = config;
|
|
451
|
-
config = maybeKey.ref;
|
|
452
|
-
return {
|
|
453
|
-
$$typeof: REACT_ELEMENT_TYPE2,
|
|
454
|
-
type,
|
|
455
|
-
key,
|
|
456
|
-
ref: config !== undefined ? config : null,
|
|
457
|
-
props: maybeKey
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
var REACT_ELEMENT_TYPE2, REACT_FRAGMENT_TYPE2, $Fragment2, $jsx, $jsxs;
|
|
461
|
-
var init_react_jsx_runtime_production = __esm(() => {
|
|
462
|
-
REACT_ELEMENT_TYPE2 = Symbol.for("react.transitional.element");
|
|
463
|
-
REACT_FRAGMENT_TYPE2 = Symbol.for("react.fragment");
|
|
464
|
-
$Fragment2 = REACT_FRAGMENT_TYPE2;
|
|
465
|
-
$jsx = jsxProd;
|
|
466
|
-
$jsxs = jsxProd;
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
// node_modules/react/jsx-runtime.js
|
|
470
|
-
var require_jsx_runtime = __commonJS((exports, module) => {
|
|
471
|
-
init_react_jsx_runtime_production();
|
|
472
|
-
if (true) {
|
|
473
|
-
module.exports = exports_react_jsx_runtime_production;
|
|
474
|
-
} else {}
|
|
475
|
-
});
|
|
476
11
|
|
|
477
12
|
// src/hooks/index.ts
|
|
478
13
|
var exports_hooks = {};
|
|
@@ -482,14 +17,14 @@ __export(exports_hooks, {
|
|
|
482
17
|
});
|
|
483
18
|
|
|
484
19
|
// src/hooks/use-toggle.ts
|
|
485
|
-
|
|
20
|
+
import { useCallback, useMemo, useState } from "react";
|
|
486
21
|
function useToggle({ name, defaultValue = false }) {
|
|
487
|
-
const [on, setIsOn] =
|
|
488
|
-
const enable =
|
|
489
|
-
const disable =
|
|
490
|
-
const toggle =
|
|
491
|
-
const off =
|
|
492
|
-
const props =
|
|
22
|
+
const [on, setIsOn] = useState(defaultValue);
|
|
23
|
+
const enable = useCallback(() => setIsOn(true), []);
|
|
24
|
+
const disable = useCallback(() => setIsOn(false), []);
|
|
25
|
+
const toggle = useCallback(() => setIsOn((v) => !v), []);
|
|
26
|
+
const off = useMemo(() => !on, [on]);
|
|
27
|
+
const props = useMemo(() => ({
|
|
493
28
|
controller: {
|
|
494
29
|
"aria-expanded": on ? "true" : "false",
|
|
495
30
|
"aria-controls": name,
|
|
@@ -514,11 +49,11 @@ __export(exports_components, {
|
|
|
514
49
|
});
|
|
515
50
|
|
|
516
51
|
// src/components/button.tsx
|
|
517
|
-
|
|
52
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
518
53
|
function Button() {
|
|
519
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ jsxDEV("button", {
|
|
520
55
|
children: "Click"
|
|
521
|
-
});
|
|
56
|
+
}, undefined, false, undefined, this);
|
|
522
57
|
}
|
|
523
58
|
export {
|
|
524
59
|
exports_hooks as hooks,
|
package/package.json
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"main": "./dist/index.cjs",
|
|
6
|
-
"module": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
5
|
"exports": {
|
|
12
6
|
".": {
|
|
13
7
|
"import": "./dist/index.js",
|
|
14
|
-
"require": "./dist/index.cjs",
|
|
15
8
|
"types": "./dist/index.d.ts"
|
|
16
9
|
}
|
|
17
10
|
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
18
14
|
"peerDependencies": {
|
|
19
15
|
"react": "19.1.0",
|
|
20
16
|
"react-dom": "19.1.0"
|
|
21
17
|
},
|
|
22
18
|
"scripts": {
|
|
23
|
-
"build:js": "bun build src/index.ts --outdir dist",
|
|
19
|
+
"build:js": "bun build src/index.ts --format esm --outdir dist --packages external --external react --external react-dom --external react/jsx-runtime",
|
|
24
20
|
"build:types": "bunx tsc --emitDeclarationOnly",
|
|
25
21
|
"build": "bun run build:js && bun run build:types"
|
|
26
22
|
},
|