asterui 0.10.3 → 0.12.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/README.md +1 -100
- package/dist/components/Anchor.d.ts +45 -0
- package/dist/components/Diff.d.ts +12 -0
- package/dist/components/Kbd.d.ts +8 -0
- package/dist/components/Segmented.d.ts +37 -0
- package/dist/components/TextRotate.d.ts +13 -0
- package/dist/components/Tour.d.ts +61 -0
- package/dist/hooks/useClickOutside.d.ts +17 -0
- package/dist/hooks/useClipboard.d.ts +20 -0
- package/dist/hooks/useDebounce.d.ts +18 -0
- package/dist/hooks/useDisclosure.d.ts +20 -0
- package/dist/hooks/useHover.d.ts +18 -0
- package/dist/hooks/useKeyPress.d.ts +40 -0
- package/dist/hooks/useLocalStorage.d.ts +12 -0
- package/dist/hooks/usePrevious.d.ts +15 -0
- package/dist/hooks/useWindowSize.d.ts +21 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +205 -174
- package/dist/index.js.map +1 -1
- package/dist/index10.js +92 -30
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +12 -20
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +29 -22
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +17 -19
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +10788 -95
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +5 -360
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +40 -23
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +2 -73
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +6 -15
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +147 -61
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +26 -140
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +28 -263
- package/dist/index11.js.map +1 -1
- package/dist/index110.js +30 -2
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +2 -56
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +72 -2
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +39 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +26 -2
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +21 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +24 -2
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +20 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +100 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +359 -31
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +259 -89
- package/dist/index12.js.map +1 -1
- package/dist/index120.js +25 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +72 -7
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +16 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +66 -2
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +143 -20
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index126.js +55 -23
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -71
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -21
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +2 -34
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +90 -153
- package/dist/index13.js.map +1 -1
- package/dist/index130.js +2 -70
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index132.js +2 -2
- package/dist/index133.js +2 -22
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +2 -2
- package/dist/index135.js +32 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index137.js +8 -2
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -4
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +5 -0
- package/dist/index139.js.map +1 -0
- package/dist/index14.js +154 -146
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +24 -0
- package/dist/index140.js.map +1 -0
- package/dist/index141.js +5 -0
- package/dist/index141.js.map +1 -0
- package/dist/index142.js +27 -0
- package/dist/index142.js.map +1 -0
- package/dist/index143.js +74 -0
- package/dist/index143.js.map +1 -0
- package/dist/index144.js +24 -0
- package/dist/index144.js.map +1 -0
- package/dist/index145.js +37 -0
- package/dist/index145.js.map +1 -0
- package/dist/index146.js +73 -0
- package/dist/index146.js.map +1 -0
- package/dist/index147.js +5 -0
- package/dist/index147.js.map +1 -0
- package/dist/index148.js +25 -0
- package/dist/index148.js.map +1 -0
- package/dist/index149.js +5 -0
- package/dist/index149.js.map +1 -0
- package/dist/index15.js +150 -5
- package/dist/index15.js.map +1 -1
- package/dist/index150.js +5 -0
- package/dist/index150.js.map +1 -0
- package/dist/index151.js +5 -0
- package/dist/index151.js.map +1 -0
- package/dist/index152.js +5 -0
- package/dist/index152.js.map +1 -0
- package/dist/index153.js +7 -0
- package/dist/index153.js.map +1 -0
- package/dist/index16.js +5 -71
- package/dist/index16.js.map +1 -1
- package/dist/index17.js +71 -17
- package/dist/index17.js.map +1 -1
- package/dist/index18.js +15 -96
- package/dist/index18.js.map +1 -1
- package/dist/index19.js +89 -105
- package/dist/index19.js.map +1 -1
- package/dist/index20.js +107 -177
- package/dist/index20.js.map +1 -1
- package/dist/index21.js +181 -107
- package/dist/index21.js.map +1 -1
- package/dist/index22.js +107 -29
- package/dist/index22.js.map +1 -1
- package/dist/index23.js +19 -41
- package/dist/index23.js.map +1 -1
- package/dist/index24.js +31 -11
- package/dist/index24.js.map +1 -1
- package/dist/index25.js +41 -33
- package/dist/index25.js.map +1 -1
- package/dist/index26.js +12 -63
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +33 -80
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +63 -18
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +78 -159
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +96 -27
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +16 -1080
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +159 -16
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +1081 -121
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +17 -39
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +121 -190
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +37 -94
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +186 -157
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +89 -138
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +161 -14
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +146 -21
- package/dist/index39.js.map +1 -1
- package/dist/index4.js +26 -99
- package/dist/index4.js.map +1 -1
- package/dist/index40.js +12 -116
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +18 -13
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +21 -35
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +117 -114
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +13 -176
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +34 -146
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +116 -12
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +176 -22
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +147 -14
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +10 -5
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +100 -60
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +21 -265
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +10 -13
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +7 -122
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +262 -106
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +14 -167
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +121 -31
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +107 -119
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +161 -77
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +31 -19
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +117 -69
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +61 -130
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +82 -53
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +19 -44
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +70 -48
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +55 -60
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +39 -101
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +52 -41
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +62 -21
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +104 -43
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +41 -134
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +65 -49
- package/dist/index69.js.map +1 -1
- package/dist/index7.js +130 -11
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +21 -22
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +46 -22
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +126 -321
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +52 -56
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +22 -40
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +22 -95
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +311 -112
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +52 -157
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +40 -65
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +23 -35
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +11 -70
- package/dist/index8.js.map +1 -1
- package/dist/index80.js +92 -31
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +116 -196
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +155 -207
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +60 -290
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +34 -177
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +227 -251
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +34 -14
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +208 -31
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +206 -10786
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +295 -5
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +69 -91
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +172 -36
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +258 -2
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +13 -6
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +32 -151
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +5 -29
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +12 -28
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +46 -2
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +12 -71
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +13 -37
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +7 -25
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index146.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { __module as c } from "./index151.js";
|
|
2
|
+
var m;
|
|
3
|
+
function j() {
|
|
4
|
+
return m ? c.exports : (m = 1, (function(y) {
|
|
5
|
+
var u = {
|
|
6
|
+
single_source_shortest_paths: function(o, t, e) {
|
|
7
|
+
var r = {}, i = {};
|
|
8
|
+
i[t] = 0;
|
|
9
|
+
var n = u.PriorityQueue.make();
|
|
10
|
+
n.push(t, 0);
|
|
11
|
+
for (var f, p, s, h, _, d, a, v, l; !n.empty(); ) {
|
|
12
|
+
f = n.pop(), p = f.value, h = f.cost, _ = o[p] || {};
|
|
13
|
+
for (s in _)
|
|
14
|
+
_.hasOwnProperty(s) && (d = _[s], a = h + d, v = i[s], l = typeof i[s] > "u", (l || v > a) && (i[s] = a, n.push(s, a), r[s] = p));
|
|
15
|
+
}
|
|
16
|
+
if (typeof e < "u" && typeof i[e] > "u") {
|
|
17
|
+
var q = ["Could not find a path from ", t, " to ", e, "."].join("");
|
|
18
|
+
throw new Error(q);
|
|
19
|
+
}
|
|
20
|
+
return r;
|
|
21
|
+
},
|
|
22
|
+
extract_shortest_path_from_predecessor_list: function(o, t) {
|
|
23
|
+
for (var e = [], r = t; r; )
|
|
24
|
+
e.push(r), o[r], r = o[r];
|
|
25
|
+
return e.reverse(), e;
|
|
26
|
+
},
|
|
27
|
+
find_path: function(o, t, e) {
|
|
28
|
+
var r = u.single_source_shortest_paths(o, t, e);
|
|
29
|
+
return u.extract_shortest_path_from_predecessor_list(
|
|
30
|
+
r,
|
|
31
|
+
e
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* A very naive priority queue implementation.
|
|
36
|
+
*/
|
|
37
|
+
PriorityQueue: {
|
|
38
|
+
make: function(o) {
|
|
39
|
+
var t = u.PriorityQueue, e = {}, r;
|
|
40
|
+
o = o || {};
|
|
41
|
+
for (r in t)
|
|
42
|
+
t.hasOwnProperty(r) && (e[r] = t[r]);
|
|
43
|
+
return e.queue = [], e.sorter = o.sorter || t.default_sorter, e;
|
|
44
|
+
},
|
|
45
|
+
default_sorter: function(o, t) {
|
|
46
|
+
return o.cost - t.cost;
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* Add a new item to the queue and ensure the highest priority element
|
|
50
|
+
* is at the front of the queue.
|
|
51
|
+
*/
|
|
52
|
+
push: function(o, t) {
|
|
53
|
+
var e = { value: o, cost: t };
|
|
54
|
+
this.queue.push(e), this.queue.sort(this.sorter);
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Return the highest priority element in the queue.
|
|
58
|
+
*/
|
|
59
|
+
pop: function() {
|
|
60
|
+
return this.queue.shift();
|
|
61
|
+
},
|
|
62
|
+
empty: function() {
|
|
63
|
+
return this.queue.length === 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
y.exports = u;
|
|
68
|
+
})(c), c.exports);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
j as __require
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=index146.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index146.js","sources":["../../../node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js"],"sourcesContent":["'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin <self@wyattbaldwin.com>\n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n"],"names":["dijkstra","graph","s","d","predecessors","costs","open","closest","u","v","cost_of_s_to_u","adjacent_nodes","cost_of_e","cost_of_s_to_u_plus_cost_of_e","cost_of_s_to_v","first_visit","msg","nodes","opts","T","t","key","a","b","value","cost","item","module"],"mappings":";;;;AAuBA,QAAIA,IAAW;AAAA,MACb,8BAA8B,SAASC,GAAOC,GAAGC,GAAG;AAGlD,YAAIC,IAAe,CAAA,GAIfC,IAAQ,CAAA;AACZ,QAAAA,EAAMH,CAAC,IAAI;AAMX,YAAII,IAAON,EAAS,cAAc,KAAI;AACtC,QAAAM,EAAK,KAAKJ,GAAG,CAAC;AAUd,iBARIK,GACAC,GAAGC,GACHC,GACAC,GACAC,GACAC,GACAC,GACAC,GACG,CAACT,EAAK,WAAS;AAGpB,UAAAC,IAAUD,EAAK,IAAG,GAClBE,IAAID,EAAQ,OACZG,IAAiBH,EAAQ,MAGzBI,IAAiBV,EAAMO,CAAC,KAAK,CAAA;AAK7B,eAAKC,KAAKE;AACR,YAAIA,EAAe,eAAeF,CAAC,MAEjCG,IAAYD,EAAeF,CAAC,GAK5BI,IAAgCH,IAAiBE,GAMjDE,IAAiBT,EAAMI,CAAC,GACxBM,IAAe,OAAOV,EAAMI,CAAC,IAAM,MAC/BM,KAAeD,IAAiBD,OAClCR,EAAMI,CAAC,IAAII,GACXP,EAAK,KAAKG,GAAGI,CAA6B,GAC1CT,EAAaK,CAAC,I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jC;AAAA;AAAA;AAAA;AAAA,QAKI,KAAK,WAAY;AACf,iBAAO,KAAK,MAAM,MAAK;AAAA,QAC7B;AAAA,QAEI,OAAO,WAAY;AACjB,iBAAO,KAAK,MAAM,WAAW;AAAA,QACnC;AAAA,MACA;AAAA;AAME,IAAAC,YAAiB3B;AAAA;;","x_google_ignoreList":[0]}
|
package/dist/index147.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index147.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index148.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { __exports as t } from "./index152.js";
|
|
2
|
+
var u;
|
|
3
|
+
function f() {
|
|
4
|
+
if (u) return t;
|
|
5
|
+
u = 1;
|
|
6
|
+
const i = new Uint8Array(512), n = new Uint8Array(256);
|
|
7
|
+
return (function() {
|
|
8
|
+
let r = 1;
|
|
9
|
+
for (let e = 0; e < 255; e++)
|
|
10
|
+
i[e] = r, n[r] = e, r <<= 1, r & 256 && (r ^= 285);
|
|
11
|
+
for (let e = 255; e < 512; e++)
|
|
12
|
+
i[e] = i[e - 255];
|
|
13
|
+
})(), t.log = function(r) {
|
|
14
|
+
if (r < 1) throw new Error("log(" + r + ")");
|
|
15
|
+
return n[r];
|
|
16
|
+
}, t.exp = function(r) {
|
|
17
|
+
return i[r];
|
|
18
|
+
}, t.mul = function(r, e) {
|
|
19
|
+
return r === 0 || e === 0 ? 0 : i[n[r] + n[e]];
|
|
20
|
+
}, t;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
f as __require
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index148.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index148.js","sources":["../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js"],"sourcesContent":["const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n let x = 1\n for (let i = 0; i < 255; i++) {\n EXP_TABLE[i] = x\n LOG_TABLE[x] = i\n\n x <<= 1 // multiply by 2\n\n // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n x ^= 0x11D\n }\n }\n\n // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n // stay inside the bounds (because we will mainly use this table for the multiplication of\n // two GF numbers, no more).\n // @see {@link mul}\n for (let i = 255; i < 512; i++) {\n EXP_TABLE[i] = EXP_TABLE[i - 255]\n }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n if (n < 1) throw new Error('log(' + n + ')')\n return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param {Number} x\n * @param {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n if (x === 0 || y === 0) return 0\n\n // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n // @see {@link initTables}\n return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n"],"names":["EXP_TABLE","LOG_TABLE","x","i","galoisField","n","y"],"mappings":";;;;;AAAA,QAAMA,IAAY,IAAI,WAAW,GAAG,GAC9BC,IAAY,IAAI,WAAW,GAAG;AASnC,UAAC,WAAuB;AACvB,QAAIC,IAAI;AACR,aAASC,IAAI,GAAGA,IAAI,KAAKA;AACvB,MAAAH,EAAUG,CAAC,IAAID,GACfD,EAAUC,CAAC,IAAIC,GAEfD,MAAM,GAIFA,IAAI,QACNA,KAAK;AAQT,aAASC,IAAI,KAAKA,IAAI,KAAKA;AACzB,MAAAH,EAAUG,CAAC,IAAIH,EAAUG,IAAI,GAAG;AAAA,EAEpC,GAAC,GAQDC,EAAA,MAAc,SAAcC,GAAG;AAC7B,QAAIA,IAAI,EAAG,OAAM,IAAI,MAAM,SAASA,IAAI,GAAG;AAC3C,WAAOJ,EAAUI,CAAC;AAAA,EACpB,GAQAD,EAAA,MAAc,SAAcC,GAAG;AAC7B,WAAOL,EAAUK,CAAC;AAAA,EACpB,GASAD,EAAA,MAAc,SAAcF,GAAGI,GAAG;AAChC,WAAIJ,MAAM,KAAKI,MAAM,IAAU,IAIxBN,EAAUC,EAAUC,CAAC,IAAID,EAAUK,CAAC,CAAC;AAAA,EAC9C;;","x_google_ignoreList":[0]}
|
package/dist/index149.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index149.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index15.js
CHANGED
|
@@ -1,8 +1,153 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as C, useState as v, useEffect as M } from "react";
|
|
3
|
+
import O from "./index103.js";
|
|
4
|
+
function S(o) {
|
|
5
|
+
return typeof document > "u" ? "" : getComputedStyle(document.documentElement).getPropertyValue(o).trim();
|
|
6
|
+
}
|
|
7
|
+
function x(o) {
|
|
8
|
+
const e = o.match(/oklch\(\s*([\d.]+)%?\s+([\d.]+)\s+([\d.]+)/);
|
|
9
|
+
if (!e) return "";
|
|
10
|
+
const t = parseFloat(e[1]) / 100, r = parseFloat(e[2]), c = parseFloat(e[3]) * Math.PI / 180, l = r * Math.cos(c), u = r * Math.sin(c), n = t + 0.3963377774 * l + 0.2158037573 * u, f = t - 0.1055613458 * l - 0.0638541728 * u, i = t - 0.0894841775 * l - 1.291485548 * u, s = n * n * n, d = f * f * f, m = i * i * i;
|
|
11
|
+
let b = 4.0767416621 * s - 3.3077115913 * d + 0.2309699292 * m, y = -1.2684380046 * s + 2.6097574011 * d - 0.3413193965 * m, g = -0.0041960863 * s - 0.7034186147 * d + 1.707614701 * m;
|
|
12
|
+
const k = (p) => (p = Math.max(0, Math.min(1, p)), p <= 31308e-7 ? 12.92 * p : 1.055 * Math.pow(p, 1 / 2.4) - 0.055);
|
|
13
|
+
return b = Math.round(k(b) * 255), y = Math.round(k(y) * 255), g = Math.round(k(g) * 255), `#${b.toString(16).padStart(2, "0")}${y.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}`;
|
|
14
|
+
}
|
|
15
|
+
function V() {
|
|
16
|
+
return typeof document > "u" ? [] : [
|
|
17
|
+
"--color-primary",
|
|
18
|
+
"--color-secondary",
|
|
19
|
+
"--color-accent",
|
|
20
|
+
"--color-info",
|
|
21
|
+
"--color-success",
|
|
22
|
+
"--color-warning",
|
|
23
|
+
"--color-error"
|
|
24
|
+
].map((e) => {
|
|
25
|
+
const t = S(e);
|
|
26
|
+
return t.includes("oklch") ? x(t) : t;
|
|
27
|
+
}).filter(Boolean);
|
|
28
|
+
}
|
|
29
|
+
function I() {
|
|
30
|
+
const o = V(), e = S("--color-base-content"), t = e.includes("oklch") ? x(e) : e || "#888888", r = S("--color-base-300"), a = r.includes("oklch") ? x(r) : r || "#e0e0e0", c = t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i), l = c ? (parseInt(c[1], 16) + parseInt(c[2], 16) + parseInt(c[3], 16)) / 3 > 128 : !1;
|
|
31
|
+
return {
|
|
32
|
+
colors: o.length > 0 ? o : void 0,
|
|
33
|
+
theme: {
|
|
34
|
+
mode: l ? "dark" : "light"
|
|
35
|
+
},
|
|
36
|
+
chart: {
|
|
37
|
+
background: "transparent",
|
|
38
|
+
foreColor: t
|
|
39
|
+
},
|
|
40
|
+
grid: {
|
|
41
|
+
borderColor: a
|
|
42
|
+
},
|
|
43
|
+
xaxis: {
|
|
44
|
+
labels: {
|
|
45
|
+
style: {
|
|
46
|
+
colors: t
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
axisBorder: {
|
|
50
|
+
color: a
|
|
51
|
+
},
|
|
52
|
+
axisTicks: {
|
|
53
|
+
color: a
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
yaxis: {
|
|
57
|
+
labels: {
|
|
58
|
+
style: {
|
|
59
|
+
colors: t
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
legend: {
|
|
64
|
+
labels: {
|
|
65
|
+
colors: t
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
tooltip: {
|
|
69
|
+
theme: l ? "dark" : "light",
|
|
70
|
+
style: {
|
|
71
|
+
fontSize: "12px"
|
|
72
|
+
},
|
|
73
|
+
x: {
|
|
74
|
+
show: !0
|
|
75
|
+
},
|
|
76
|
+
marker: {
|
|
77
|
+
show: !0
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
dataLabels: {
|
|
81
|
+
style: {
|
|
82
|
+
colors: [t, t, t, t, t, t, t]
|
|
83
|
+
},
|
|
84
|
+
background: {
|
|
85
|
+
enabled: !1
|
|
86
|
+
},
|
|
87
|
+
dropShadow: {
|
|
88
|
+
enabled: !1
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function h(o, e) {
|
|
94
|
+
const t = { ...o };
|
|
95
|
+
for (const r in e)
|
|
96
|
+
e[r] !== void 0 && (typeof e[r] == "object" && e[r] !== null && !Array.isArray(e[r]) && typeof o[r] == "object" && o[r] !== null && !Array.isArray(o[r]) ? t[r] = h(
|
|
97
|
+
o[r],
|
|
98
|
+
e[r]
|
|
99
|
+
) : t[r] = e[r]);
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
const $ = ({
|
|
103
|
+
type: o,
|
|
104
|
+
series: e,
|
|
105
|
+
width: t = "100%",
|
|
106
|
+
height: r = 350,
|
|
107
|
+
options: a = {},
|
|
108
|
+
themed: c = !0,
|
|
109
|
+
className: l = ""
|
|
110
|
+
}) => {
|
|
111
|
+
const u = C(null), n = C(null), [, f] = v(!1), i = () => {
|
|
112
|
+
const s = {
|
|
113
|
+
chart: {
|
|
114
|
+
type: o,
|
|
115
|
+
width: t,
|
|
116
|
+
height: r
|
|
117
|
+
},
|
|
118
|
+
series: e
|
|
119
|
+
};
|
|
120
|
+
if (c) {
|
|
121
|
+
const d = I();
|
|
122
|
+
return h(h(s, d), a);
|
|
123
|
+
}
|
|
124
|
+
return h(s, a);
|
|
125
|
+
};
|
|
126
|
+
return M(() => {
|
|
127
|
+
if (!u.current) return;
|
|
128
|
+
const s = i();
|
|
129
|
+
return n.current = new O(u.current, s), n.current.render(), f(!0), () => {
|
|
130
|
+
n.current && (n.current.destroy(), n.current = null);
|
|
131
|
+
};
|
|
132
|
+
}, []), M(() => {
|
|
133
|
+
if (!n.current) return;
|
|
134
|
+
const s = i();
|
|
135
|
+
n.current.updateOptions(s, !0, !0);
|
|
136
|
+
}, [o, e, t, r, a, c]), M(() => {
|
|
137
|
+
if (!c || typeof window > "u") return;
|
|
138
|
+
const s = new MutationObserver(() => {
|
|
139
|
+
if (n.current) {
|
|
140
|
+
const d = i();
|
|
141
|
+
n.current.updateOptions(d, !0, !0);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return s.observe(document.documentElement, {
|
|
145
|
+
attributes: !0,
|
|
146
|
+
attributeFilter: ["data-theme", "class"]
|
|
147
|
+
}), () => s.disconnect();
|
|
148
|
+
}, [c]), /* @__PURE__ */ w("div", { ref: u, className: l });
|
|
149
|
+
};
|
|
4
150
|
export {
|
|
5
|
-
|
|
6
|
-
o as CarouselItem
|
|
151
|
+
$ as Chart
|
|
7
152
|
};
|
|
8
153
|
//# sourceMappingURL=index15.js.map
|
package/dist/index15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index15.js","sources":["../src/components/Carousel.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n id?: string\n children: React.ReactNode\n}\n\nexport const CarouselItem: React.FC<CarouselItemProps> = ({ id, children, className = '', ...rest }) => {\n return (\n <div id={id} className={`carousel-item ${className}`} {...rest}>\n {children}\n </div>\n )\n}\n\nexport interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n snap?: 'start' | 'center' | 'end'\n vertical?: boolean\n}\n\nexport const Carousel: React.FC<CarouselProps> & {\n Item: typeof CarouselItem\n} = ({ children, snap = 'start', vertical = false, className = '', ...rest }) => {\n const snapClass = snap === 'center' ? 'carousel-center' : snap === 'end' ? 'carousel-end' : ''\n const directionClass = vertical ? 'carousel-vertical' : ''\n\n return (\n <div className={`carousel ${snapClass} ${directionClass} ${className}`.trim()} {...rest}>\n {children}\n </div>\n )\n}\n\nCarousel.Item = CarouselItem\n"],"names":["CarouselItem","id","children","className","rest","jsx","Carousel","snap","vertical"],"mappings":";AAOO,MAAMA,IAA4C,CAAC,EAAE,IAAAC,GAAI,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,QAEzF,gBAAAC,EAAC,SAAI,IAAAJ,GAAQ,WAAW,iBAAiBE,CAAS,IAAK,GAAGC,GACvD,UAAAF,EAAA,CACH,GAUSI,IAET,CAAC,EAAE,UAAAJ,GAAU,MAAAK,IAAO,SAAS,UAAAC,IAAW,IAAO,WAAAL,IAAY,IAAI,GAAGC,EAAA,MAKlE,gBAAAC,EAAC,OAAA,EAAI,WAAW,YAJAE,MAAS,WAAW,oBAAoBA,MAAS,QAAQ,iBAAiB,EAIrD,IAHhBC,IAAW,sBAAsB,EAGC,IAAIL,CAAS,GAAG,KAAA,GAAS,GAAGC,GAChF,UAAAF,GACH;AAIJI,EAAS,OAAON;"}
|
|
1
|
+
{"version":3,"file":"index15.js","sources":["../src/components/Chart.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport ApexCharts from 'apexcharts'\nimport type { ApexOptions } from 'apexcharts'\n\nexport interface ChartProps {\n /** Chart type */\n type: 'line' | 'area' | 'bar' | 'pie' | 'donut' | 'radialBar' | 'scatter' | 'bubble' | 'heatmap' | 'candlestick' | 'boxPlot' | 'radar' | 'polarArea' | 'rangeBar' | 'rangeArea' | 'treemap'\n /** Chart series data */\n series: ApexAxisChartSeries | ApexNonAxisChartSeries\n /** Chart width */\n width?: string | number\n /** Chart height */\n height?: string | number\n /** ApexCharts options (merged with theme defaults) */\n options?: ApexOptions\n /** Use daisyUI theme colors */\n themed?: boolean\n /** Additional CSS classes */\n className?: string\n}\n\n// Get CSS variable value from root\nfunction getCssVar(varName: string): string {\n if (typeof document === 'undefined') return ''\n return getComputedStyle(document.documentElement).getPropertyValue(varName).trim()\n}\n\n// Convert oklch to hex (approximate)\nfunction oklchToHex(oklch: string): string {\n // Parse oklch(L C H) format\n const match = oklch.match(/oklch\\(\\s*([\\d.]+)%?\\s+([\\d.]+)\\s+([\\d.]+)/)\n if (!match) return ''\n\n const l = parseFloat(match[1]) / 100 // Lightness 0-1\n const c = parseFloat(match[2]) // Chroma\n const h = parseFloat(match[3]) // Hue in degrees\n\n // Simplified oklch to sRGB conversion\n // This is an approximation - full conversion is complex\n const hRad = (h * Math.PI) / 180\n const a = c * Math.cos(hRad)\n const b = c * Math.sin(hRad)\n\n // Approximate conversion to linear RGB\n const l_ = l + 0.3963377774 * a + 0.2158037573 * b\n const m_ = l - 0.1055613458 * a - 0.0638541728 * b\n const s_ = l - 0.0894841775 * a - 1.2914855480 * b\n\n const l3 = l_ * l_ * l_\n const m3 = m_ * m_ * m_\n const s3 = s_ * s_ * s_\n\n let r = 4.0767416621 * l3 - 3.3077115913 * m3 + 0.2309699292 * s3\n let g = -1.2684380046 * l3 + 2.6097574011 * m3 - 0.3413193965 * s3\n let bl = -0.0041960863 * l3 - 0.7034186147 * m3 + 1.7076147010 * s3\n\n // Clamp and convert to sRGB\n const toSrgb = (x: number) => {\n x = Math.max(0, Math.min(1, x))\n return x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1/2.4) - 0.055\n }\n\n r = Math.round(toSrgb(r) * 255)\n g = Math.round(toSrgb(g) * 255)\n bl = Math.round(toSrgb(bl) * 255)\n\n return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${bl.toString(16).padStart(2, '0')}`\n}\n\n// Get daisyUI theme colors from CSS variables\nfunction getThemeColors(): string[] {\n if (typeof document === 'undefined') return []\n\n const colorVars = [\n '--color-primary',\n '--color-secondary',\n '--color-accent',\n '--color-info',\n '--color-success',\n '--color-warning',\n '--color-error',\n ]\n\n return colorVars\n .map(varName => {\n const value = getCssVar(varName)\n if (value.includes('oklch')) {\n return oklchToHex(value)\n }\n return value\n })\n .filter(Boolean)\n}\n\n// Get theme-aware chart options\nfunction getThemedOptions(): Partial<ApexOptions> {\n const colors = getThemeColors()\n\n // Get text color from CSS variable\n const baseContentVar = getCssVar('--color-base-content')\n const textColor = baseContentVar.includes('oklch')\n ? oklchToHex(baseContentVar)\n : (baseContentVar || '#888888')\n\n // Get grid color from CSS variable\n const base300Var = getCssVar('--color-base-300')\n const gridColor = base300Var.includes('oklch')\n ? oklchToHex(base300Var)\n : (base300Var || '#e0e0e0')\n\n // Determine if dark theme by checking luminance of text color\n // If text is light, we're on dark theme\n const textMatch = textColor.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)\n const isDark = textMatch\n ? (parseInt(textMatch[1], 16) + parseInt(textMatch[2], 16) + parseInt(textMatch[3], 16)) / 3 > 128\n : false\n\n return {\n colors: colors.length > 0 ? colors : undefined,\n theme: {\n mode: isDark ? 'dark' : 'light',\n },\n chart: {\n background: 'transparent',\n foreColor: textColor,\n },\n grid: {\n borderColor: gridColor,\n },\n xaxis: {\n labels: {\n style: {\n colors: textColor,\n },\n },\n axisBorder: {\n color: gridColor,\n },\n axisTicks: {\n color: gridColor,\n },\n },\n yaxis: {\n labels: {\n style: {\n colors: textColor,\n },\n },\n },\n legend: {\n labels: {\n colors: textColor,\n },\n },\n tooltip: {\n theme: isDark ? 'dark' : 'light',\n style: {\n fontSize: '12px',\n },\n x: {\n show: true,\n },\n marker: {\n show: true,\n },\n },\n dataLabels: {\n style: {\n colors: [textColor, textColor, textColor, textColor, textColor, textColor, textColor],\n },\n background: {\n enabled: false,\n },\n dropShadow: {\n enabled: false,\n },\n },\n }\n}\n\n// Deep merge objects\nfunction deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T {\n const result = { ...target }\n\n for (const key in source) {\n if (source[key] !== undefined) {\n if (\n typeof source[key] === 'object' &&\n source[key] !== null &&\n !Array.isArray(source[key]) &&\n typeof target[key] === 'object' &&\n target[key] !== null &&\n !Array.isArray(target[key])\n ) {\n result[key] = deepMerge(\n target[key] as Record<string, unknown>,\n source[key] as Record<string, unknown>\n ) as T[Extract<keyof T, string>]\n } else {\n result[key] = source[key] as T[Extract<keyof T, string>]\n }\n }\n }\n\n return result\n}\n\nexport const Chart: React.FC<ChartProps> = ({\n type,\n series,\n width = '100%',\n height = 350,\n options = {},\n themed = true,\n className = '',\n}) => {\n const chartRef = useRef<HTMLDivElement>(null)\n const chartInstance = useRef<ApexCharts | null>(null)\n const [, setMounted] = useState(false)\n\n // Build final options\n const buildOptions = (): ApexOptions => {\n const baseOptions: ApexOptions = {\n chart: {\n type,\n width,\n height,\n },\n series,\n }\n\n if (themed) {\n const themedOpts = getThemedOptions()\n return deepMerge(deepMerge(baseOptions as unknown as Record<string, unknown>, themedOpts as unknown as Record<string, unknown>), options as unknown as Record<string, unknown>) as ApexOptions\n }\n\n return deepMerge(baseOptions as unknown as Record<string, unknown>, options as unknown as Record<string, unknown>) as ApexOptions\n }\n\n // Initialize chart\n useEffect(() => {\n if (!chartRef.current) return\n\n const opts = buildOptions()\n chartInstance.current = new ApexCharts(chartRef.current, opts)\n chartInstance.current.render()\n setMounted(true)\n\n return () => {\n if (chartInstance.current) {\n chartInstance.current.destroy()\n chartInstance.current = null\n }\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n // Update chart when props change\n useEffect(() => {\n if (!chartInstance.current) return\n\n const opts = buildOptions()\n chartInstance.current.updateOptions(opts, true, true)\n }, [type, series, width, height, options, themed]) // eslint-disable-line react-hooks/exhaustive-deps\n\n // Listen for theme changes\n useEffect(() => {\n if (!themed || typeof window === 'undefined') return\n\n const observer = new MutationObserver(() => {\n if (chartInstance.current) {\n const opts = buildOptions()\n chartInstance.current.updateOptions(opts, true, true)\n }\n })\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-theme', 'class'],\n })\n\n return () => observer.disconnect()\n }, [themed]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return <div ref={chartRef} className={className} />\n}\n"],"names":["getCssVar","varName","oklchToHex","oklch","match","l","c","hRad","a","b","l_","m_","s_","l3","m3","s3","r","g","bl","toSrgb","x","getThemeColors","value","getThemedOptions","colors","baseContentVar","textColor","base300Var","gridColor","textMatch","isDark","deepMerge","target","source","result","key","Chart","type","series","width","height","options","themed","className","chartRef","useRef","chartInstance","setMounted","useState","buildOptions","baseOptions","themedOpts","useEffect","opts","ApexCharts","observer","jsx"],"mappings":";;;AAsBA,SAASA,EAAUC,GAAyB;AAC1C,SAAI,OAAO,WAAa,MAAoB,KACrC,iBAAiB,SAAS,eAAe,EAAE,iBAAiBA,CAAO,EAAE,KAAA;AAC9E;AAGA,SAASC,EAAWC,GAAuB;AAEzC,QAAMC,IAAQD,EAAM,MAAM,4CAA4C;AACtE,MAAI,CAACC,EAAO,QAAO;AAEnB,QAAMC,IAAI,WAAWD,EAAM,CAAC,CAAC,IAAI,KAC3BE,IAAI,WAAWF,EAAM,CAAC,CAAC,GAKvBG,IAJI,WAAWH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|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index150.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index151.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index151.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index152.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index152.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index153.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index153.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/dist/index16.js
CHANGED
|
@@ -1,74 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function g({
|
|
5
|
-
children: t,
|
|
6
|
-
title: s,
|
|
7
|
-
open: l,
|
|
8
|
-
defaultOpen: u = !1,
|
|
9
|
-
onChange: m,
|
|
10
|
-
icon: C = "arrow",
|
|
11
|
-
className: h = "",
|
|
12
|
-
...c
|
|
13
|
-
}) {
|
|
14
|
-
const [x, b] = f(u), e = l !== void 0 ? l : x, n = v(), a = () => {
|
|
15
|
-
const p = !e;
|
|
16
|
-
l === void 0 && b(p), m?.(p);
|
|
17
|
-
}, i = [
|
|
18
|
-
"collapse",
|
|
19
|
-
"bg-base-200",
|
|
20
|
-
{
|
|
21
|
-
arrow: "collapse-arrow",
|
|
22
|
-
plus: "collapse-plus",
|
|
23
|
-
none: ""
|
|
24
|
-
}[C],
|
|
25
|
-
e && "collapse-open",
|
|
26
|
-
!e && "collapse-close",
|
|
27
|
-
h
|
|
28
|
-
].filter(Boolean).join(" ");
|
|
29
|
-
return s !== void 0 ? /* @__PURE__ */ r("div", { className: i, "data-state": e ? "open" : "closed", ...c, children: [
|
|
30
|
-
/* @__PURE__ */ o(
|
|
31
|
-
"input",
|
|
32
|
-
{
|
|
33
|
-
type: "checkbox",
|
|
34
|
-
id: n,
|
|
35
|
-
className: "peer",
|
|
36
|
-
checked: e,
|
|
37
|
-
onChange: a,
|
|
38
|
-
style: { position: "absolute", opacity: 0, pointerEvents: "none" }
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
/* @__PURE__ */ o("label", { htmlFor: n, className: "collapse-title text-xl font-medium", children: s }),
|
|
42
|
-
/* @__PURE__ */ o("div", { className: "collapse-content", children: t })
|
|
43
|
-
] }) : /* @__PURE__ */ o(d.Provider, { value: { isOpen: e, toggle: a, checkboxId: n }, children: /* @__PURE__ */ r("div", { className: i, "data-state": e ? "open" : "closed", ...c, children: [
|
|
44
|
-
/* @__PURE__ */ o(
|
|
45
|
-
"input",
|
|
46
|
-
{
|
|
47
|
-
type: "checkbox",
|
|
48
|
-
id: n,
|
|
49
|
-
className: "peer",
|
|
50
|
-
checked: e,
|
|
51
|
-
onChange: a,
|
|
52
|
-
style: { position: "absolute", opacity: 0, pointerEvents: "none" }
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
t
|
|
56
|
-
] }) });
|
|
57
|
-
}
|
|
58
|
-
function k({ children: t, className: s = "" }) {
|
|
59
|
-
const l = w(d);
|
|
60
|
-
if (!l)
|
|
61
|
-
throw new Error("Collapse.Title must be used within Collapse");
|
|
62
|
-
return /* @__PURE__ */ o("label", { htmlFor: l.checkboxId, className: `collapse-title text-xl font-medium ${s}`, children: t });
|
|
63
|
-
}
|
|
64
|
-
function y({ children: t, className: s = "" }) {
|
|
65
|
-
return /* @__PURE__ */ o("div", { className: `collapse-content ${s}`, children: t });
|
|
66
|
-
}
|
|
67
|
-
const E = Object.assign(g, {
|
|
68
|
-
Title: k,
|
|
69
|
-
Content: y
|
|
70
|
-
});
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
const o = ({ id: e, children: s, className: r = "", ...a }) => /* @__PURE__ */ t("div", { id: e, className: `carousel-item ${r}`, ...a, children: s }), l = ({ children: e, snap: s = "start", vertical: r = !1, className: a = "", ...c }) => /* @__PURE__ */ t("div", { className: `carousel ${s === "center" ? "carousel-center" : s === "end" ? "carousel-end" : ""} ${r ? "carousel-vertical" : ""} ${a}`.trim(), ...c, children: e });
|
|
3
|
+
l.Item = o;
|
|
71
4
|
export {
|
|
72
|
-
|
|
5
|
+
l as Carousel,
|
|
6
|
+
o as CarouselItem
|
|
73
7
|
};
|
|
74
8
|
//# sourceMappingURL=index16.js.map
|
package/dist/index16.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index16.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index16.js","sources":["../src/components/Carousel.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n id?: string\n children: React.ReactNode\n}\n\nexport const CarouselItem: React.FC<CarouselItemProps> = ({ id, children, className = '', ...rest }) => {\n return (\n <div id={id} className={`carousel-item ${className}`} {...rest}>\n {children}\n </div>\n )\n}\n\nexport interface CarouselProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n snap?: 'start' | 'center' | 'end'\n vertical?: boolean\n}\n\nexport const Carousel: React.FC<CarouselProps> & {\n Item: typeof CarouselItem\n} = ({ children, snap = 'start', vertical = false, className = '', ...rest }) => {\n const snapClass = snap === 'center' ? 'carousel-center' : snap === 'end' ? 'carousel-end' : ''\n const directionClass = vertical ? 'carousel-vertical' : ''\n\n return (\n <div className={`carousel ${snapClass} ${directionClass} ${className}`.trim()} {...rest}>\n {children}\n </div>\n )\n}\n\nCarousel.Item = CarouselItem\n"],"names":["CarouselItem","id","children","className","rest","jsx","Carousel","snap","vertical"],"mappings":";AAOO,MAAMA,IAA4C,CAAC,EAAE,IAAAC,GAAI,UAAAC,GAAU,WAAAC,IAAY,IAAI,GAAGC,QAEzF,gBAAAC,EAAC,SAAI,IAAAJ,GAAQ,WAAW,iBAAiBE,CAAS,IAAK,GAAGC,GACvD,UAAAF,EAAA,CACH,GAUSI,IAET,CAAC,EAAE,UAAAJ,GAAU,MAAAK,IAAO,SAAS,UAAAC,IAAW,IAAO,WAAAL,IAAY,IAAI,GAAGC,EAAA,MAKlE,gBAAAC,EAAC,OAAA,EAAI,WAAW,YAJAE,MAAS,WAAW,oBAAoBA,MAAS,QAAQ,iBAAiB,EAIrD,IAHhBC,IAAW,sBAAsB,EAGC,IAAIL,CAAS,GAAG,KAAA,GAAS,GAAGC,GAChF,UAAAF,GACH;AAIJI,EAAS,OAAON;"}
|
package/dist/index17.js
CHANGED
|
@@ -1,20 +1,74 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as r, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useId as v, createContext as N, useContext as w } from "react";
|
|
3
|
+
const d = N(null);
|
|
4
|
+
function g({
|
|
5
|
+
children: t,
|
|
6
|
+
title: s,
|
|
7
|
+
open: l,
|
|
8
|
+
defaultOpen: u = !1,
|
|
9
|
+
onChange: m,
|
|
10
|
+
icon: C = "arrow",
|
|
11
|
+
className: h = "",
|
|
12
|
+
...c
|
|
13
|
+
}) {
|
|
14
|
+
const [x, b] = f(u), e = l !== void 0 ? l : x, n = v(), a = () => {
|
|
15
|
+
const p = !e;
|
|
16
|
+
l === void 0 && b(p), m?.(p);
|
|
17
|
+
}, i = [
|
|
18
|
+
"collapse",
|
|
19
|
+
"bg-base-200",
|
|
20
|
+
{
|
|
21
|
+
arrow: "collapse-arrow",
|
|
22
|
+
plus: "collapse-plus",
|
|
23
|
+
none: ""
|
|
24
|
+
}[C],
|
|
25
|
+
e && "collapse-open",
|
|
26
|
+
!e && "collapse-close",
|
|
27
|
+
h
|
|
28
|
+
].filter(Boolean).join(" ");
|
|
29
|
+
return s !== void 0 ? /* @__PURE__ */ r("div", { className: i, "data-state": e ? "open" : "closed", ...c, children: [
|
|
30
|
+
/* @__PURE__ */ o(
|
|
31
|
+
"input",
|
|
32
|
+
{
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
id: n,
|
|
35
|
+
className: "peer",
|
|
36
|
+
checked: e,
|
|
37
|
+
onChange: a,
|
|
38
|
+
style: { position: "absolute", opacity: 0, pointerEvents: "none" }
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ o("label", { htmlFor: n, className: "collapse-title text-xl font-medium", children: s }),
|
|
42
|
+
/* @__PURE__ */ o("div", { className: "collapse-content", children: t })
|
|
43
|
+
] }) : /* @__PURE__ */ o(d.Provider, { value: { isOpen: e, toggle: a, checkboxId: n }, children: /* @__PURE__ */ r("div", { className: i, "data-state": e ? "open" : "closed", ...c, children: [
|
|
44
|
+
/* @__PURE__ */ o(
|
|
45
|
+
"input",
|
|
46
|
+
{
|
|
47
|
+
type: "checkbox",
|
|
48
|
+
id: n,
|
|
49
|
+
className: "peer",
|
|
50
|
+
checked: e,
|
|
51
|
+
onChange: a,
|
|
52
|
+
style: { position: "absolute", opacity: 0, pointerEvents: "none" }
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
t
|
|
56
|
+
] }) });
|
|
57
|
+
}
|
|
58
|
+
function k({ children: t, className: s = "" }) {
|
|
59
|
+
const l = w(d);
|
|
60
|
+
if (!l)
|
|
61
|
+
throw new Error("Collapse.Title must be used within Collapse");
|
|
62
|
+
return /* @__PURE__ */ o("label", { htmlFor: l.checkboxId, className: `collapse-title text-xl font-medium ${s}`, children: t });
|
|
63
|
+
}
|
|
64
|
+
function y({ children: t, className: s = "" }) {
|
|
65
|
+
return /* @__PURE__ */ o("div", { className: `collapse-content ${s}`, children: t });
|
|
66
|
+
}
|
|
67
|
+
const E = Object.assign(g, {
|
|
68
|
+
Title: k,
|
|
69
|
+
Content: y
|
|
70
|
+
});
|
|
17
71
|
export {
|
|
18
|
-
|
|
72
|
+
E as Collapse
|
|
19
73
|
};
|
|
20
74
|
//# sourceMappingURL=index17.js.map
|
package/dist/index17.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index17.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index17.js","sources":["../src/components/Collapse.tsx"],"sourcesContent":["import React, { createContext, useContext, useId, useState } from 'react'\n\nexport interface CollapseProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onChange'> {\n children: React.ReactNode\n title?: React.ReactNode\n open?: boolean\n defaultOpen?: boolean\n onChange?: (open: boolean) => void\n icon?: 'arrow' | 'plus' | 'none'\n}\n\nexport interface CollapseTitleProps {\n children: React.ReactNode\n className?: string\n}\n\nexport interface CollapseContentProps {\n children: React.ReactNode\n className?: string\n}\n\ninterface CollapseContextValue {\n isOpen: boolean\n toggle: () => void\n checkboxId: string\n}\n\nconst CollapseContext = createContext<CollapseContextValue | null>(null)\n\nfunction CollapseRoot({\n children,\n title,\n open,\n defaultOpen = false,\n onChange,\n icon = 'arrow',\n className = '',\n ...rest\n}: CollapseProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen)\n const isOpen = open !== undefined ? open : internalOpen\n const checkboxId = useId()\n\n const toggle = () => {\n const newOpen = !isOpen\n if (open === undefined) {\n setInternalOpen(newOpen)\n }\n onChange?.(newOpen)\n }\n\n const iconClasses = {\n arrow: 'collapse-arrow',\n plus: 'collapse-plus',\n none: '',\n }\n\n const classes = [\n 'collapse',\n 'bg-base-200',\n iconClasses[icon],\n isOpen && 'collapse-open',\n !isOpen && 'collapse-close',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n // If title prop is provided, render with automatic structure\n if (title !== undefined) {\n return (\n <div className={classes} data-state={isOpen ? 'open' : 'closed'} {...rest}>\n <input\n type=\"checkbox\"\n id={checkboxId}\n className=\"peer\"\n checked={isOpen}\n onChange={toggle}\n style={{ position: 'absolute', opacity: 0, pointerEvents: 'none' }}\n />\n <label htmlFor={checkboxId} className=\"collapse-title text-xl font-medium\">\n {title}\n </label>\n <div className=\"collapse-content\">{children}</div>\n </div>\n )\n }\n\n // Otherwise, use compound component pattern with Context\n return (\n <CollapseContext.Provider value={{ isOpen, toggle, checkboxId }}>\n <div className={classes} data-state={isOpen ? 'open' : 'closed'} {...rest}>\n <input\n type=\"checkbox\"\n id={checkboxId}\n className=\"peer\"\n checked={isOpen}\n onChange={toggle}\n style={{ position: 'absolute', opacity: 0, pointerEvents: 'none' }}\n />\n {children}\n </div>\n </CollapseContext.Provider>\n )\n}\n\nfunction CollapseTitle({ children, className = '' }: CollapseTitleProps) {\n const context = useContext(CollapseContext)\n if (!context) {\n throw new Error('Collapse.Title must be used within Collapse')\n }\n\n return (\n <label htmlFor={context.checkboxId} className={`collapse-title text-xl font-medium ${className}`}>\n {children}\n </label>\n )\n}\n\nfunction CollapseContent({ children, className = '' }: CollapseContentProps) {\n return <div className={`collapse-content ${className}`}>{children}</div>\n}\n\nexport const Collapse = Object.assign(CollapseRoot, {\n Title: CollapseTitle,\n Content: CollapseContent,\n})\n"],"names":["CollapseContext","createContext","CollapseRoot","children","title","open","defaultOpen","onChange","icon","className","rest","internalOpen","setInternalOpen","useState","isOpen","checkboxId","useId","toggle","newOpen","classes","jsxs","jsx","CollapseTitle","context","useContext","CollapseContent","Collapse"],"mappings":";;AA2BA,MAAMA,IAAkBC,EAA2C,IAAI;AAEvE,SAASC,EAAa;AAAA,EACpB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAAkB;AAChB,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAASP,CAAW,GACtDQ,IAAST,MAAS,SAAYA,IAAOM,GACrCI,IAAaC,EAAA,GAEbC,IAAS,MAA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