@bgord/ui 0.1.0 → 0.1.1

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 (70) hide show
  1. package/dist/components/button.d.ts +1 -0
  2. package/dist/hooks/use-toggle.d.ts +32 -0
  3. package/dist/index.js +526 -0
  4. package/package.json +4 -1
  5. package/.gitmodules +0 -3
  6. package/bgord-scripts/ansible-decrypt-file.sh +0 -13
  7. package/bgord-scripts/ansible-encrypt-file.sh +0 -13
  8. package/bgord-scripts/ansible-view-file.sh +0 -13
  9. package/bgord-scripts/app-readme-generate.sh +0 -79
  10. package/bgord-scripts/base.sh +0 -209
  11. package/bgord-scripts/biome-check.sh +0 -14
  12. package/bgord-scripts/build-prechecks.sh +0 -14
  13. package/bgord-scripts/changelog-generate.sh +0 -17
  14. package/bgord-scripts/compare-configs.sh +0 -33
  15. package/bgord-scripts/compressor.ts +0 -103
  16. package/bgord-scripts/cspell.sh +0 -30
  17. package/bgord-scripts/css-purge.sh +0 -10
  18. package/bgord-scripts/database-sync-production-to-local.sh +0 -12
  19. package/bgord-scripts/drizzle-generate.sh +0 -10
  20. package/bgord-scripts/drizzle-migrate.sh +0 -10
  21. package/bgord-scripts/drizzle-open-studio.sh +0 -3
  22. package/bgord-scripts/drizzle-seed.sh +0 -12
  23. package/bgord-scripts/e2e-open.sh +0 -10
  24. package/bgord-scripts/e2e-run.sh +0 -19
  25. package/bgord-scripts/format-staged.sh +0 -14
  26. package/bgord-scripts/format.sh +0 -10
  27. package/bgord-scripts/frontend-build.sh +0 -15
  28. package/bgord-scripts/frontend-watch.sh +0 -12
  29. package/bgord-scripts/image-identify.sh +0 -14
  30. package/bgord-scripts/image-svg-optmise.sh +0 -14
  31. package/bgord-scripts/lint-commit-message.sh +0 -10
  32. package/bgord-scripts/list.sh +0 -20
  33. package/bgord-scripts/local-server-start.sh +0 -25
  34. package/bgord-scripts/npm-publish.sh +0 -77
  35. package/bgord-scripts/outdated-dependencies.sh +0 -24
  36. package/bgord-scripts/production-server-inspect.sh +0 -13
  37. package/bgord-scripts/production-sqlite-backup.sh +0 -20
  38. package/bgord-scripts/shellcheck.sh +0 -14
  39. package/bgord-scripts/templates/.commitlint-config.cjs +0 -11
  40. package/bgord-scripts/templates/biome.json +0 -66
  41. package/bgord-scripts/templates/cspell.json +0 -117
  42. package/bgord-scripts/templates/drizzle.config.ts +0 -8
  43. package/bgord-scripts/templates/index.html +0 -30
  44. package/bgord-scripts/templates/knip.json +0 -11
  45. package/bgord-scripts/templates/lefthook-target.yml +0 -2
  46. package/bgord-scripts/templates/lefthook.yml +0 -46
  47. package/bgord-scripts/templates/postcss.config.js +0 -10
  48. package/bgord-scripts/templates/server.tsconfig.json +0 -15
  49. package/bgord-scripts/test-coverage.sh +0 -11
  50. package/bgord-scripts/test-run.sh +0 -16
  51. package/bgord-scripts/test-watch.sh +0 -16
  52. package/bgord-scripts/typecheck-frontend-watch.sh +0 -20
  53. package/bgord-scripts/typecheck-frontend.sh +0 -22
  54. package/bgord-scripts/typecheck-prune.sh +0 -10
  55. package/bgord-scripts/typecheck-watch.sh +0 -8
  56. package/bgord-scripts/typecheck.sh +0 -10
  57. package/bgord-scripts/update.sh +0 -15
  58. package/bgord-scripts/workflows/codeql-analysis.yml +0 -35
  59. package/bgord-scripts/workflows/dependabot.yml +0 -7
  60. package/bgord-scripts/workflows/deploy-project.yml +0 -65
  61. package/bgord-scripts/workflows/deploy-server.yml +0 -71
  62. package/bgord-scripts/workflows/docs-app.yml +0 -47
  63. package/bun.lock +0 -29
  64. package/bunfig.toml +0 -6
  65. package/src/components/button.tsx +0 -3
  66. package/src/hooks/use-toggle.ts +0 -68
  67. package/tsconfig.json +0 -15
  68. /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
  69. /package/{src/hooks/index.ts → dist/hooks/index.d.ts} +0 -0
  70. /package/{src/index.ts → dist/index.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ export declare function Button(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ export type UseToggleValueType = boolean;
2
+ export type UseToggleConfigType = {
3
+ name: string;
4
+ defaultValue?: UseToggleValueType;
5
+ };
6
+ type UseToggleProps = {
7
+ controller: {
8
+ "aria-expanded": "true" | "false";
9
+ "aria-controls": string;
10
+ role: "button";
11
+ tabIndex: 0;
12
+ };
13
+ target: {
14
+ id: string;
15
+ role: "region";
16
+ "aria-hidden": "true" | "false";
17
+ };
18
+ };
19
+ export type UseToggleReturnType = {
20
+ on: UseToggleValueType;
21
+ off: UseToggleValueType;
22
+ enable: () => void;
23
+ disable: () => void;
24
+ toggle: () => void;
25
+ props: UseToggleProps;
26
+ };
27
+ export declare function useToggle({ name, defaultValue }: UseToggleConfigType): UseToggleReturnType;
28
+ export declare function extractUseToggle<X>(_props: UseToggleReturnType & X): {
29
+ toggle: UseToggleReturnType;
30
+ rest: X;
31
+ };
32
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,526 @@
1
+ var __create = Object.create;
2
+ var __getProtoOf = Object.getPrototypeOf;
3
+ 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
+ var __export = (target, all) => {
19
+ for (var name in all)
20
+ __defProp(target, name, {
21
+ get: all[name],
22
+ enumerable: true,
23
+ configurable: true,
24
+ set: (newValue) => all[name] = () => newValue
25
+ });
26
+ };
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
+
477
+ // src/hooks/index.ts
478
+ var exports_hooks = {};
479
+ __export(exports_hooks, {
480
+ useToggle: () => useToggle,
481
+ extractUseToggle: () => extractUseToggle
482
+ });
483
+
484
+ // src/hooks/use-toggle.ts
485
+ var import_react = __toESM(require_react(), 1);
486
+ function useToggle({ name, defaultValue = false }) {
487
+ const [on, setIsOn] = import_react.useState(defaultValue);
488
+ const enable = import_react.useCallback(() => setIsOn(true), []);
489
+ const disable = import_react.useCallback(() => setIsOn(false), []);
490
+ const toggle = import_react.useCallback(() => setIsOn((v) => !v), []);
491
+ const off = import_react.useMemo(() => !on, [on]);
492
+ const props = import_react.useMemo(() => ({
493
+ controller: {
494
+ "aria-expanded": on ? "true" : "false",
495
+ "aria-controls": name,
496
+ role: "button",
497
+ tabIndex: 0
498
+ },
499
+ target: { id: name, role: "region", "aria-hidden": on ? "false" : "true" }
500
+ }), [on, name]);
501
+ return { on, off, enable, disable, toggle, props };
502
+ }
503
+ function extractUseToggle(_props) {
504
+ const { on, off, enable, disable, toggle, props, ...rest } = _props;
505
+ return {
506
+ toggle: { on, off, enable, disable, toggle, props },
507
+ rest
508
+ };
509
+ }
510
+ // src/components/index.ts
511
+ var exports_components = {};
512
+ __export(exports_components, {
513
+ Button: () => Button
514
+ });
515
+
516
+ // src/components/button.tsx
517
+ var jsx_runtime = __toESM(require_jsx_runtime(), 1);
518
+ function Button() {
519
+ return /* @__PURE__ */ jsx_runtime.jsx("button", {
520
+ children: "Click"
521
+ });
522
+ }
523
+ export {
524
+ exports_hooks as hooks,
525
+ exports_components as Components
526
+ };
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@bgord/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
8
11
  "exports": {
9
12
  ".": {
10
13
  "import": "./dist/index.js",
package/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "bgord-scripts"]
2
- path = bgord-scripts
3
- url = git@github.com:bgord/bgord-scripts.git
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- source bgord-scripts/base.sh
4
- setup_base_config
5
-
6
- info "Decrypting a file with ansible-vault..."
7
-
8
- FILE_TO_DECRYPT=$1
9
-
10
- validate_non_empty "FILE_TO_DECRYPT" $FILE_TO_DECRYPT
11
- check_if_file_exists $FILE_TO_DECRYPT
12
-
13
- ansible-vault decrypt $FILE_TO_DECRYPT --vault-password-file ansible-vault-password.txt
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- source bgord-scripts/base.sh
4
- setup_base_config
5
-
6
- info "Encrypting a file with ansible-vault..."
7
-
8
- FILE_TO_ENCRYPT=$1
9
-
10
- validate_non_empty "FILE_TO_ENCRYPT" $FILE_TO_ENCRYPT
11
- check_if_file_exists $FILE_TO_ENCRYPT
12
-
13
- ansible-vault encrypt $FILE_TO_ENCRYPT --vault-password-file ansible-vault-password.txt
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- source bgord-scripts/base.sh
4
- setup_base_config
5
-
6
- info "Viewing an encrypted file with ansible-vault..."
7
-
8
- FILE_TO_VIEW=$1
9
-
10
- validate_non_empty "FILE_TO_VIEW" $FILE_TO_VIEW
11
- check_if_file_exists $FILE_TO_VIEW
12
-
13
- ansible-vault view $FILE_TO_VIEW --vault-password-file ansible-vault-password.txt