@buoy-gg/floating-tools-core 2.1.4-beta.2 → 2.1.5
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/lib/commonjs/FloatingToolsStore.js +1 -501
- package/lib/commonjs/colors.js +1 -54
- package/lib/commonjs/constants.js +1 -31
- package/lib/commonjs/devToolsState.js +1 -325
- package/lib/commonjs/dial.js +1 -617
- package/lib/commonjs/easing.js +1 -69
- package/lib/commonjs/icons/benchmark-icon.js +1 -24
- package/lib/commonjs/icons/env-icon.js +1 -24
- package/lib/commonjs/icons/events-icon.js +1 -24
- package/lib/commonjs/icons/highlight-icon.js +1 -24
- package/lib/commonjs/icons/icon-data.js +1 -2268
- package/lib/commonjs/icons/icon-factories.js +1 -173
- package/lib/commonjs/icons/icon-primitives.js +1 -559
- package/lib/commonjs/icons/icon-primitives.native.js +1 -779
- package/lib/commonjs/icons/icon-renderer.js +1 -260
- package/lib/commonjs/icons/network-icon.js +1 -24
- package/lib/commonjs/icons/query-icon.js +1 -24
- package/lib/commonjs/icons/redux-icon.js +1 -85
- package/lib/commonjs/icons/renders-icon.js +1 -33
- package/lib/commonjs/icons/routes-icon.js +1 -49
- package/lib/commonjs/icons/sentry-icon.js +1 -24
- package/lib/commonjs/icons/storage-icon.js +1 -24
- package/lib/commonjs/icons/wifi-icon.js +1 -24
- package/lib/commonjs/index.js +1 -723
- package/lib/commonjs/settings.js +1 -588
- package/lib/commonjs/utils.js +1 -72
- package/lib/module/FloatingToolsStore.js +1 -496
- package/lib/module/colors.js +1 -49
- package/lib/module/constants.js +1 -27
- package/lib/module/devToolsState.js +1 -318
- package/lib/module/dial.js +1 -603
- package/lib/module/easing.js +1 -62
- package/lib/module/icons/benchmark-icon.js +1 -15
- package/lib/module/icons/env-icon.js +1 -15
- package/lib/module/icons/events-icon.js +1 -15
- package/lib/module/icons/highlight-icon.js +1 -15
- package/lib/module/icons/icon-data.js +1 -2264
- package/lib/module/icons/icon-factories.js +1 -163
- package/lib/module/icons/icon-primitives.js +1 -547
- package/lib/module/icons/icon-primitives.native.js +1 -767
- package/lib/module/icons/icon-renderer.js +1 -255
- package/lib/module/icons/network-icon.js +1 -15
- package/lib/module/icons/query-icon.js +1 -15
- package/lib/module/icons/redux-icon.js +1 -81
- package/lib/module/icons/renders-icon.js +1 -17
- package/lib/module/icons/routes-icon.js +1 -41
- package/lib/module/icons/sentry-icon.js +1 -15
- package/lib/module/icons/storage-icon.js +1 -15
- package/lib/module/icons/wifi-icon.js +1 -15
- package/lib/module/index.js +1 -103
- package/lib/module/settings.js +1 -576
- package/lib/module/utils.js +1 -66
- package/package.json +1 -1
- package/lib/typescript/commonjs/FloatingToolsStore.d.ts.map +0 -1
- package/lib/typescript/commonjs/colors.d.ts.map +0 -1
- package/lib/typescript/commonjs/constants.d.ts.map +0 -1
- package/lib/typescript/commonjs/devToolsState.d.ts.map +0 -1
- package/lib/typescript/commonjs/dial.d.ts.map +0 -1
- package/lib/typescript/commonjs/easing.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/benchmark-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/env-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/events-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/highlight-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-data.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-factories.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-primitives.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-primitives.native.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/icon-renderer.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/network-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/query-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/redux-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/renders-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/routes-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/sentry-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/storage-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/icons/wifi-icon.d.ts.map +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/settings.d.ts.map +0 -1
- package/lib/typescript/commonjs/types.d.ts.map +0 -1
- package/lib/typescript/commonjs/utils.d.ts.map +0 -1
- package/lib/typescript/module/FloatingToolsStore.d.ts.map +0 -1
- package/lib/typescript/module/colors.d.ts.map +0 -1
- package/lib/typescript/module/constants.d.ts.map +0 -1
- package/lib/typescript/module/devToolsState.d.ts.map +0 -1
- package/lib/typescript/module/dial.d.ts.map +0 -1
- package/lib/typescript/module/easing.d.ts.map +0 -1
- package/lib/typescript/module/icons/benchmark-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/env-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/events-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/highlight-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-data.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-factories.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-primitives.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-primitives.native.d.ts.map +0 -1
- package/lib/typescript/module/icons/icon-renderer.d.ts.map +0 -1
- package/lib/typescript/module/icons/network-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/query-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/redux-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/renders-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/routes-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/sentry-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/storage-icon.d.ts.map +0 -1
- package/lib/typescript/module/icons/wifi-icon.d.ts.map +0 -1
- package/lib/typescript/module/index.d.ts.map +0 -1
- package/lib/typescript/module/settings.d.ts.map +0 -1
- package/lib/typescript/module/types.d.ts.map +0 -1
- package/lib/typescript/module/utils.d.ts.map +0 -1
|
@@ -1,559 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.IconTriangle = exports.IconSmoothArc = exports.IconSemicircle = exports.IconRect = exports.IconLine = exports.IconContainer = exports.IconCircle = exports.IconArc = void 0;
|
|
7
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
/**
|
|
9
|
-
* Icon Primitives - WEB
|
|
10
|
-
*
|
|
11
|
-
* This file is auto-picked by web bundlers (Vite, webpack).
|
|
12
|
-
* Mobile bundlers (Metro) pick icon-primitives.native.tsx instead.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
// ===========================================
|
|
16
|
-
// Types
|
|
17
|
-
// ===========================================
|
|
18
|
-
|
|
19
|
-
// ===========================================
|
|
20
|
-
// Web Primitives (CSS/divs)
|
|
21
|
-
// ===========================================
|
|
22
|
-
|
|
23
|
-
const IconContainer = ({
|
|
24
|
-
size,
|
|
25
|
-
children
|
|
26
|
-
}) => {
|
|
27
|
-
const style = {
|
|
28
|
-
position: 'relative',
|
|
29
|
-
width: size,
|
|
30
|
-
height: size
|
|
31
|
-
};
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
|
-
style: style,
|
|
34
|
-
children: children
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Creates a neon glow box-shadow string with multiple layers
|
|
40
|
-
* This mimics SVG Gaussian blur filter effects
|
|
41
|
-
*/
|
|
42
|
-
exports.IconContainer = IconContainer;
|
|
43
|
-
function createNeonGlow(color, radius) {
|
|
44
|
-
// Layer 1: Tight bright core
|
|
45
|
-
// Layer 2: Medium spread
|
|
46
|
-
// Layer 3: Wide soft outer glow
|
|
47
|
-
// Layer 4: Very wide ambient glow
|
|
48
|
-
return [`0 0 ${radius * 0.15}px ${color}`,
|
|
49
|
-
// Bright core
|
|
50
|
-
`0 0 ${radius * 0.3}px ${color}`,
|
|
51
|
-
// Inner glow
|
|
52
|
-
`0 0 ${radius * 0.6}px ${color}cc`,
|
|
53
|
-
// Medium glow (80% opacity)
|
|
54
|
-
`0 0 ${radius}px ${color}80`,
|
|
55
|
-
// Outer glow (50% opacity)
|
|
56
|
-
`0 0 ${radius * 1.5}px ${color}40` // Ambient glow (25% opacity)
|
|
57
|
-
].join(', ');
|
|
58
|
-
}
|
|
59
|
-
const IconCircle = ({
|
|
60
|
-
cx,
|
|
61
|
-
cy,
|
|
62
|
-
r,
|
|
63
|
-
fill,
|
|
64
|
-
borderColor,
|
|
65
|
-
borderWidth = 0,
|
|
66
|
-
opacity = 1,
|
|
67
|
-
scaleX = 1,
|
|
68
|
-
scaleY = 1,
|
|
69
|
-
glowColor,
|
|
70
|
-
glowRadius = 0,
|
|
71
|
-
rotation = 0
|
|
72
|
-
}) => {
|
|
73
|
-
const diameter = r * 2;
|
|
74
|
-
const transforms = [];
|
|
75
|
-
if (scaleX !== 1) transforms.push(`scaleX(${scaleX})`);
|
|
76
|
-
if (scaleY !== 1) transforms.push(`scaleY(${scaleY})`);
|
|
77
|
-
if (rotation !== 0) transforms.push(`rotate(${rotation}deg)`);
|
|
78
|
-
const style = {
|
|
79
|
-
position: 'absolute',
|
|
80
|
-
left: cx - r,
|
|
81
|
-
top: cy - r,
|
|
82
|
-
width: diameter,
|
|
83
|
-
height: diameter,
|
|
84
|
-
borderRadius: r,
|
|
85
|
-
backgroundColor: fill,
|
|
86
|
-
border: borderColor ? `${borderWidth}px solid ${borderColor}` : undefined,
|
|
87
|
-
opacity,
|
|
88
|
-
transform: transforms.length > 0 ? transforms.join(' ') : undefined,
|
|
89
|
-
transformOrigin: '50% 50%',
|
|
90
|
-
boxShadow: glowColor && glowRadius > 0 ? createNeonGlow(glowColor, glowRadius) : undefined,
|
|
91
|
-
boxSizing: 'border-box'
|
|
92
|
-
};
|
|
93
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
94
|
-
style: style
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
exports.IconCircle = IconCircle;
|
|
98
|
-
const IconRect = ({
|
|
99
|
-
x,
|
|
100
|
-
y,
|
|
101
|
-
width,
|
|
102
|
-
height,
|
|
103
|
-
fill,
|
|
104
|
-
borderColor,
|
|
105
|
-
borderWidth = 0,
|
|
106
|
-
borderRadius = 0,
|
|
107
|
-
opacity = 1,
|
|
108
|
-
glowColor,
|
|
109
|
-
glowRadius = 0,
|
|
110
|
-
rotation,
|
|
111
|
-
originX = 0,
|
|
112
|
-
originY = 0.5
|
|
113
|
-
}) => {
|
|
114
|
-
const style = {
|
|
115
|
-
position: 'absolute',
|
|
116
|
-
left: x,
|
|
117
|
-
top: y,
|
|
118
|
-
width,
|
|
119
|
-
height,
|
|
120
|
-
borderRadius,
|
|
121
|
-
backgroundColor: fill,
|
|
122
|
-
border: borderColor ? `${borderWidth}px solid ${borderColor}` : undefined,
|
|
123
|
-
opacity,
|
|
124
|
-
boxShadow: glowColor && glowRadius > 0 ? createNeonGlow(glowColor, glowRadius) : undefined,
|
|
125
|
-
boxSizing: 'border-box',
|
|
126
|
-
transform: rotation !== undefined ? `rotate(${rotation}deg)` : undefined,
|
|
127
|
-
transformOrigin: rotation !== undefined ? `${originX * 100}% ${originY * 100}%` : undefined
|
|
128
|
-
};
|
|
129
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
130
|
-
style: style
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Calculates a point on a quadratic Bezier curve (1 control point)
|
|
136
|
-
* B(t) = (1-t)²P0 + 2(1-t)tP1 + t²P2
|
|
137
|
-
*/
|
|
138
|
-
exports.IconRect = IconRect;
|
|
139
|
-
function getQuadraticBezierPoint(t, p0x, p0y, p1x, p1y, p2x, p2y) {
|
|
140
|
-
const mt = 1 - t;
|
|
141
|
-
return {
|
|
142
|
-
x: mt * mt * p0x + 2 * mt * t * p1x + t * t * p2x,
|
|
143
|
-
y: mt * mt * p0y + 2 * mt * t * p1y + t * t * p2y
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Calculates a point on a cubic Bezier curve (2 control points)
|
|
149
|
-
* B(t) = (1-t)³P0 + 3(1-t)²tP1 + 3(1-t)t²P2 + t³P3
|
|
150
|
-
*/
|
|
151
|
-
function getCubicBezierPoint(t, p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) {
|
|
152
|
-
const mt = 1 - t;
|
|
153
|
-
const mt2 = mt * mt;
|
|
154
|
-
const mt3 = mt2 * mt;
|
|
155
|
-
const t2 = t * t;
|
|
156
|
-
const t3 = t2 * t;
|
|
157
|
-
return {
|
|
158
|
-
x: mt3 * p0x + 3 * mt2 * t * p1x + 3 * mt * t2 * p2x + t3 * p3x,
|
|
159
|
-
y: mt3 * p0y + 3 * mt2 * t * p1y + 3 * mt * t2 * p2y + t3 * p3y
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* IconLine - draws a line between two points
|
|
165
|
-
* Auto-calculates length and rotation from coordinates!
|
|
166
|
-
* Supports curved lines via cubic Bezier (2 control points) or quadratic (1 control point).
|
|
167
|
-
*/
|
|
168
|
-
const IconLine = ({
|
|
169
|
-
x1,
|
|
170
|
-
y1,
|
|
171
|
-
x2,
|
|
172
|
-
y2,
|
|
173
|
-
stroke,
|
|
174
|
-
strokeWidth = 1,
|
|
175
|
-
opacity = 1,
|
|
176
|
-
glowColor,
|
|
177
|
-
glowRadius = 0,
|
|
178
|
-
rotation = 0,
|
|
179
|
-
curveX,
|
|
180
|
-
curveY,
|
|
181
|
-
curve2X,
|
|
182
|
-
curve2Y
|
|
183
|
-
}) => {
|
|
184
|
-
// Check if this is a curved line (either control point set)
|
|
185
|
-
const hasCurve1 = curveX !== undefined && curveX !== 0 || curveY !== undefined && curveY !== 0;
|
|
186
|
-
const hasCurve2 = curve2X !== undefined && curve2X !== 0 || curve2Y !== undefined && curve2Y !== 0;
|
|
187
|
-
const isCurved = hasCurve1 || hasCurve2;
|
|
188
|
-
if (isCurved) {
|
|
189
|
-
const midX = (x1 + x2) / 2;
|
|
190
|
-
const midY = (y1 + y2) / 2;
|
|
191
|
-
|
|
192
|
-
// Control points: offset from line midpoint
|
|
193
|
-
const control1X = midX + (curveX ?? 0);
|
|
194
|
-
const control1Y = midY + (curveY ?? 0);
|
|
195
|
-
const control2X = midX + (curve2X ?? 0);
|
|
196
|
-
const control2Y = midY + (curve2Y ?? 0);
|
|
197
|
-
|
|
198
|
-
// Determine if cubic (2 distinct control points) or quadratic (1 control point)
|
|
199
|
-
const isCubic = hasCurve1 && hasCurve2;
|
|
200
|
-
|
|
201
|
-
// Estimate curve length using samples
|
|
202
|
-
let approxLength = 0;
|
|
203
|
-
const sampleCount = 20;
|
|
204
|
-
let prevPt = {
|
|
205
|
-
x: x1,
|
|
206
|
-
y: y1
|
|
207
|
-
};
|
|
208
|
-
for (let i = 1; i <= sampleCount; i++) {
|
|
209
|
-
const t = i / sampleCount;
|
|
210
|
-
const pt = isCubic ? getCubicBezierPoint(t, x1, y1, control1X, control1Y, control2X, control2Y, x2, y2) : getQuadraticBezierPoint(t, x1, y1, hasCurve1 ? control1X : control2X, hasCurve1 ? control1Y : control2Y, x2, y2);
|
|
211
|
-
approxLength += Math.sqrt((pt.x - prevPt.x) ** 2 + (pt.y - prevPt.y) ** 2);
|
|
212
|
-
prevPt = pt;
|
|
213
|
-
}
|
|
214
|
-
const elements = [];
|
|
215
|
-
|
|
216
|
-
// Dense circles for smooth body
|
|
217
|
-
const circleSpacing = Math.max(0.05, strokeWidth * 0.02);
|
|
218
|
-
const numCircles = Math.max(100, Math.ceil(approxLength / circleSpacing));
|
|
219
|
-
for (let i = 0; i <= numCircles; i++) {
|
|
220
|
-
const t = i / numCircles;
|
|
221
|
-
const pt = isCubic ? getCubicBezierPoint(t, x1, y1, control1X, control1Y, control2X, control2Y, x2, y2) : getQuadraticBezierPoint(t, x1, y1, hasCurve1 ? control1X : control2X, hasCurve1 ? control1Y : control2Y, x2, y2);
|
|
222
|
-
const circleStyle = {
|
|
223
|
-
position: 'absolute',
|
|
224
|
-
left: pt.x - strokeWidth / 2,
|
|
225
|
-
top: pt.y - strokeWidth / 2,
|
|
226
|
-
width: strokeWidth,
|
|
227
|
-
height: strokeWidth,
|
|
228
|
-
borderRadius: '50%',
|
|
229
|
-
backgroundColor: stroke,
|
|
230
|
-
opacity,
|
|
231
|
-
boxShadow: i === 0 && glowColor && glowRadius > 0 ? createNeonGlow(glowColor, glowRadius) : undefined
|
|
232
|
-
};
|
|
233
|
-
elements.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
234
|
-
style: circleStyle
|
|
235
|
-
}, `c${i}`));
|
|
236
|
-
}
|
|
237
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
238
|
-
children: elements
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// Straight line (original logic)
|
|
243
|
-
const dx = x2 - x1;
|
|
244
|
-
const dy = y2 - y1;
|
|
245
|
-
const length = Math.sqrt(dx * dx + dy * dy);
|
|
246
|
-
const angle = Math.atan2(dy, dx) * (180 / Math.PI);
|
|
247
|
-
|
|
248
|
-
// Position at midpoint of line
|
|
249
|
-
const centerX = (x1 + x2) / 2;
|
|
250
|
-
const centerY = (y1 + y2) / 2;
|
|
251
|
-
|
|
252
|
-
// Total rotation = line angle + additional rotation
|
|
253
|
-
const totalRotation = angle + rotation;
|
|
254
|
-
const style = {
|
|
255
|
-
position: 'absolute',
|
|
256
|
-
left: centerX - length / 2,
|
|
257
|
-
top: centerY - strokeWidth / 2,
|
|
258
|
-
width: length,
|
|
259
|
-
height: strokeWidth,
|
|
260
|
-
backgroundColor: stroke,
|
|
261
|
-
opacity,
|
|
262
|
-
transform: `rotate(${totalRotation}deg)`,
|
|
263
|
-
transformOrigin: '50% 50%',
|
|
264
|
-
borderRadius: strokeWidth / 2,
|
|
265
|
-
boxShadow: glowColor && glowRadius > 0 ? createNeonGlow(glowColor, glowRadius) : undefined
|
|
266
|
-
};
|
|
267
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
268
|
-
style: style
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* IconTriangle - creates triangles using CSS border trick
|
|
274
|
-
* Works without SVG!
|
|
275
|
-
*/
|
|
276
|
-
exports.IconLine = IconLine;
|
|
277
|
-
const IconTriangle = ({
|
|
278
|
-
x,
|
|
279
|
-
y,
|
|
280
|
-
size,
|
|
281
|
-
direction,
|
|
282
|
-
fill,
|
|
283
|
-
opacity = 1,
|
|
284
|
-
rotation
|
|
285
|
-
}) => {
|
|
286
|
-
// CSS border trick: use transparent borders to create triangle
|
|
287
|
-
// The size is the height of the triangle, width is size * 2 / sqrt(3) for equilateral
|
|
288
|
-
const halfWidth = size * 0.577; // size / sqrt(3) for equilateral-ish triangle
|
|
289
|
-
|
|
290
|
-
// Build border styles based on direction
|
|
291
|
-
let borderStyles = {};
|
|
292
|
-
let offsetX = 0;
|
|
293
|
-
let offsetY = 0;
|
|
294
|
-
switch (direction) {
|
|
295
|
-
case 'down':
|
|
296
|
-
borderStyles = {
|
|
297
|
-
borderLeft: `${halfWidth}px solid transparent`,
|
|
298
|
-
borderRight: `${halfWidth}px solid transparent`,
|
|
299
|
-
borderTop: `${size}px solid ${fill}`
|
|
300
|
-
};
|
|
301
|
-
offsetX = -halfWidth;
|
|
302
|
-
offsetY = 0;
|
|
303
|
-
break;
|
|
304
|
-
case 'up':
|
|
305
|
-
borderStyles = {
|
|
306
|
-
borderLeft: `${halfWidth}px solid transparent`,
|
|
307
|
-
borderRight: `${halfWidth}px solid transparent`,
|
|
308
|
-
borderBottom: `${size}px solid ${fill}`
|
|
309
|
-
};
|
|
310
|
-
offsetX = -halfWidth;
|
|
311
|
-
offsetY = -size;
|
|
312
|
-
break;
|
|
313
|
-
case 'left':
|
|
314
|
-
borderStyles = {
|
|
315
|
-
borderTop: `${halfWidth}px solid transparent`,
|
|
316
|
-
borderBottom: `${halfWidth}px solid transparent`,
|
|
317
|
-
borderRight: `${size}px solid ${fill}`
|
|
318
|
-
};
|
|
319
|
-
offsetX = -size;
|
|
320
|
-
offsetY = -halfWidth;
|
|
321
|
-
break;
|
|
322
|
-
case 'right':
|
|
323
|
-
borderStyles = {
|
|
324
|
-
borderTop: `${halfWidth}px solid transparent`,
|
|
325
|
-
borderBottom: `${halfWidth}px solid transparent`,
|
|
326
|
-
borderLeft: `${size}px solid ${fill}`
|
|
327
|
-
};
|
|
328
|
-
offsetX = 0;
|
|
329
|
-
offsetY = -halfWidth;
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
const transforms = [];
|
|
333
|
-
if (rotation !== undefined) {
|
|
334
|
-
transforms.push(`rotate(${rotation}deg)`);
|
|
335
|
-
}
|
|
336
|
-
const style = {
|
|
337
|
-
position: 'absolute',
|
|
338
|
-
left: x + offsetX,
|
|
339
|
-
top: y + offsetY,
|
|
340
|
-
width: 0,
|
|
341
|
-
height: 0,
|
|
342
|
-
opacity,
|
|
343
|
-
...borderStyles,
|
|
344
|
-
transform: transforms.length > 0 ? transforms.join(' ') : undefined,
|
|
345
|
-
transformOrigin: '50% 50%'
|
|
346
|
-
};
|
|
347
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
348
|
-
style: style
|
|
349
|
-
});
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* IconArc - draws an arc using multiple line segments
|
|
354
|
-
* Creates smooth curves without SVG!
|
|
355
|
-
*/
|
|
356
|
-
exports.IconTriangle = IconTriangle;
|
|
357
|
-
const IconArc = ({
|
|
358
|
-
cx,
|
|
359
|
-
cy,
|
|
360
|
-
r,
|
|
361
|
-
startAngle,
|
|
362
|
-
endAngle,
|
|
363
|
-
stroke,
|
|
364
|
-
strokeWidth = 1.5,
|
|
365
|
-
opacity = 1,
|
|
366
|
-
segments
|
|
367
|
-
}) => {
|
|
368
|
-
// Calculate number of segments based on arc length
|
|
369
|
-
const arcLength = Math.abs(endAngle - startAngle);
|
|
370
|
-
const autoSegments = Math.max(8, Math.ceil(arcLength / 10)); // ~10 degrees per segment
|
|
371
|
-
const numSegments = segments ?? autoSegments;
|
|
372
|
-
|
|
373
|
-
// Generate line segments
|
|
374
|
-
const lines = [];
|
|
375
|
-
const angleStep = (endAngle - startAngle) / numSegments;
|
|
376
|
-
for (let i = 0; i < numSegments; i++) {
|
|
377
|
-
const angle1 = startAngle + i * angleStep;
|
|
378
|
-
const angle2 = startAngle + (i + 1) * angleStep;
|
|
379
|
-
|
|
380
|
-
// Convert to radians
|
|
381
|
-
const rad1 = angle1 * Math.PI / 180;
|
|
382
|
-
const rad2 = angle2 * Math.PI / 180;
|
|
383
|
-
|
|
384
|
-
// Calculate segment endpoints
|
|
385
|
-
const x1 = cx + r * Math.cos(rad1);
|
|
386
|
-
const y1 = cy + r * Math.sin(rad1);
|
|
387
|
-
const x2 = cx + r * Math.cos(rad2);
|
|
388
|
-
const y2 = cy + r * Math.sin(rad2);
|
|
389
|
-
|
|
390
|
-
// Calculate segment geometry
|
|
391
|
-
const dx = x2 - x1;
|
|
392
|
-
const dy = y2 - y1;
|
|
393
|
-
const length = Math.sqrt(dx * dx + dy * dy);
|
|
394
|
-
const angle = Math.atan2(dy, dx) * (180 / Math.PI);
|
|
395
|
-
const midX = (x1 + x2) / 2;
|
|
396
|
-
const midY = (y1 + y2) / 2;
|
|
397
|
-
const style = {
|
|
398
|
-
position: 'absolute',
|
|
399
|
-
left: midX - length / 2,
|
|
400
|
-
top: midY - strokeWidth / 2,
|
|
401
|
-
width: length,
|
|
402
|
-
height: strokeWidth,
|
|
403
|
-
backgroundColor: stroke,
|
|
404
|
-
opacity,
|
|
405
|
-
transform: `rotate(${angle}deg)`,
|
|
406
|
-
transformOrigin: '50% 50%',
|
|
407
|
-
borderRadius: strokeWidth / 2
|
|
408
|
-
};
|
|
409
|
-
lines.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
410
|
-
style: style
|
|
411
|
-
}, i));
|
|
412
|
-
}
|
|
413
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
414
|
-
children: lines
|
|
415
|
-
});
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* IconSemicircle - creates a half circle (filled)
|
|
420
|
-
* Perfect for pokeball-style split designs!
|
|
421
|
-
*/
|
|
422
|
-
exports.IconArc = IconArc;
|
|
423
|
-
const IconSemicircle = ({
|
|
424
|
-
cx,
|
|
425
|
-
cy,
|
|
426
|
-
r,
|
|
427
|
-
half,
|
|
428
|
-
fill,
|
|
429
|
-
borderColor,
|
|
430
|
-
borderWidth = 0,
|
|
431
|
-
opacity = 1,
|
|
432
|
-
glowColor,
|
|
433
|
-
glowRadius = 0
|
|
434
|
-
}) => {
|
|
435
|
-
const diameter = r * 2;
|
|
436
|
-
|
|
437
|
-
// Calculate position and border radii based on which half
|
|
438
|
-
let left;
|
|
439
|
-
let top;
|
|
440
|
-
let width;
|
|
441
|
-
let height;
|
|
442
|
-
let borderRadius;
|
|
443
|
-
switch (half) {
|
|
444
|
-
case 'top':
|
|
445
|
-
left = cx - r;
|
|
446
|
-
top = cy - r;
|
|
447
|
-
width = diameter;
|
|
448
|
-
height = r;
|
|
449
|
-
borderRadius = `${r}px ${r}px 0 0`;
|
|
450
|
-
break;
|
|
451
|
-
case 'bottom':
|
|
452
|
-
left = cx - r;
|
|
453
|
-
top = cy;
|
|
454
|
-
width = diameter;
|
|
455
|
-
height = r;
|
|
456
|
-
borderRadius = `0 0 ${r}px ${r}px`;
|
|
457
|
-
break;
|
|
458
|
-
case 'left':
|
|
459
|
-
left = cx - r;
|
|
460
|
-
top = cy - r;
|
|
461
|
-
width = r;
|
|
462
|
-
height = diameter;
|
|
463
|
-
borderRadius = `${r}px 0 0 ${r}px`;
|
|
464
|
-
break;
|
|
465
|
-
case 'right':
|
|
466
|
-
left = cx;
|
|
467
|
-
top = cy - r;
|
|
468
|
-
width = r;
|
|
469
|
-
height = diameter;
|
|
470
|
-
borderRadius = `0 ${r}px ${r}px 0`;
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
const style = {
|
|
474
|
-
position: 'absolute',
|
|
475
|
-
left,
|
|
476
|
-
top,
|
|
477
|
-
width,
|
|
478
|
-
height,
|
|
479
|
-
borderRadius,
|
|
480
|
-
backgroundColor: fill,
|
|
481
|
-
border: borderColor ? `${borderWidth}px solid ${borderColor}` : undefined,
|
|
482
|
-
opacity,
|
|
483
|
-
boxShadow: glowColor && glowRadius > 0 ? createNeonGlow(glowColor, glowRadius) : undefined,
|
|
484
|
-
boxSizing: 'border-box'
|
|
485
|
-
};
|
|
486
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
487
|
-
style: style
|
|
488
|
-
});
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* IconSmoothArc - creates a smooth arc using the border trick
|
|
493
|
-
* Uses bordered circles with partial borders hidden - gives perfect anti-aliased curves!
|
|
494
|
-
* This is how the WiFi icon achieves smooth lines without dots.
|
|
495
|
-
*/
|
|
496
|
-
exports.IconSemicircle = IconSemicircle;
|
|
497
|
-
const IconSmoothArc = ({
|
|
498
|
-
cx,
|
|
499
|
-
cy,
|
|
500
|
-
r,
|
|
501
|
-
stroke,
|
|
502
|
-
strokeWidth = 2,
|
|
503
|
-
opacity = 1,
|
|
504
|
-
portion = 'bottom'
|
|
505
|
-
}) => {
|
|
506
|
-
const diameter = r * 2;
|
|
507
|
-
|
|
508
|
-
// Build border colors based on which portion to show
|
|
509
|
-
let borderTopColor = stroke;
|
|
510
|
-
let borderBottomColor = stroke;
|
|
511
|
-
let borderLeftColor = stroke;
|
|
512
|
-
let borderRightColor = stroke;
|
|
513
|
-
switch (portion) {
|
|
514
|
-
case 'bottom':
|
|
515
|
-
// Show bottom arc (hide top, left, right)
|
|
516
|
-
borderTopColor = 'transparent';
|
|
517
|
-
borderLeftColor = 'transparent';
|
|
518
|
-
borderRightColor = 'transparent';
|
|
519
|
-
break;
|
|
520
|
-
case 'top':
|
|
521
|
-
// Show top arc (hide bottom, left, right)
|
|
522
|
-
borderBottomColor = 'transparent';
|
|
523
|
-
borderLeftColor = 'transparent';
|
|
524
|
-
borderRightColor = 'transparent';
|
|
525
|
-
break;
|
|
526
|
-
case 'left':
|
|
527
|
-
// Show left arc (hide top, bottom, right)
|
|
528
|
-
borderTopColor = 'transparent';
|
|
529
|
-
borderBottomColor = 'transparent';
|
|
530
|
-
borderRightColor = 'transparent';
|
|
531
|
-
break;
|
|
532
|
-
case 'right':
|
|
533
|
-
// Show right arc (hide top, bottom, left)
|
|
534
|
-
borderTopColor = 'transparent';
|
|
535
|
-
borderBottomColor = 'transparent';
|
|
536
|
-
borderLeftColor = 'transparent';
|
|
537
|
-
break;
|
|
538
|
-
}
|
|
539
|
-
const style = {
|
|
540
|
-
position: 'absolute',
|
|
541
|
-
left: cx - r,
|
|
542
|
-
top: cy - r,
|
|
543
|
-
width: diameter,
|
|
544
|
-
height: diameter,
|
|
545
|
-
borderRadius: r,
|
|
546
|
-
borderWidth: strokeWidth,
|
|
547
|
-
borderStyle: 'solid',
|
|
548
|
-
borderTopColor,
|
|
549
|
-
borderBottomColor,
|
|
550
|
-
borderLeftColor,
|
|
551
|
-
borderRightColor,
|
|
552
|
-
opacity,
|
|
553
|
-
boxSizing: 'border-box'
|
|
554
|
-
};
|
|
555
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
556
|
-
style: style
|
|
557
|
-
});
|
|
558
|
-
};
|
|
559
|
-
exports.IconSmoothArc = IconSmoothArc;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IconTriangle=exports.IconSmoothArc=exports.IconSemicircle=exports.IconRect=exports.IconLine=exports.IconContainer=exports.IconCircle=exports.IconArc=void 0;var _jsxRuntime=require("react/jsx-runtime");const IconContainer=({size:o,children:t})=>{const r={position:"relative",width:o,height:o};return(0,_jsxRuntime.jsx)("div",{style:r,children:t})};function createNeonGlow(o,t){return[`0 0 ${.15*t}px ${o}`,`0 0 ${.3*t}px ${o}`,`0 0 ${.6*t}px ${o}cc`,`0 0 ${t}px ${o}80`,`0 0 ${1.5*t}px ${o}40`].join(", ")}exports.IconContainer=IconContainer;const IconCircle=({cx:o,cy:t,r:r,fill:e,borderColor:i,borderWidth:n=0,opacity:s=1,scaleX:a=1,scaleY:c=1,glowColor:d,glowRadius:l=0,rotation:p=0})=>{const x=2*r,h=[];1!==a&&h.push(`scaleX(${a})`),1!==c&&h.push(`scaleY(${c})`),0!==p&&h.push(`rotate(${p}deg)`);const b={position:"absolute",left:o-r,top:t-r,width:x,height:x,borderRadius:r,backgroundColor:e,border:i?`${n}px solid ${i}`:void 0,opacity:s,transform:h.length>0?h.join(" "):void 0,transformOrigin:"50% 50%",boxShadow:d&&l>0?createNeonGlow(d,l):void 0,boxSizing:"border-box"};return(0,_jsxRuntime.jsx)("div",{style:b})};exports.IconCircle=IconCircle;const IconRect=({x:o,y:t,width:r,height:e,fill:i,borderColor:n,borderWidth:s=0,borderRadius:a=0,opacity:c=1,glowColor:d,glowRadius:l=0,rotation:p,originX:x=0,originY:h=.5})=>{const b={position:"absolute",left:o,top:t,width:r,height:e,borderRadius:a,backgroundColor:i,border:n?`${s}px solid ${n}`:void 0,opacity:c,boxShadow:d&&l>0?createNeonGlow(d,l):void 0,boxSizing:"border-box",transform:void 0!==p?`rotate(${p}deg)`:void 0,transformOrigin:void 0!==p?`${100*x}% ${100*h}%`:void 0};return(0,_jsxRuntime.jsx)("div",{style:b})};function getQuadraticBezierPoint(o,t,r,e,i,n,s){const a=1-o;return{x:a*a*t+2*a*o*e+o*o*n,y:a*a*r+2*a*o*i+o*o*s}}function getCubicBezierPoint(o,t,r,e,i,n,s,a,c){const d=1-o,l=d*d,p=l*d,x=o*o,h=x*o;return{x:p*t+3*l*o*e+3*d*x*n+h*a,y:p*r+3*l*o*i+3*d*x*s+h*c}}exports.IconRect=IconRect;const IconLine=({x1:o,y1:t,x2:r,y2:e,stroke:i,strokeWidth:n=1,opacity:s=1,glowColor:a,glowRadius:c=0,rotation:d=0,curveX:l,curveY:p,curve2X:x,curve2Y:h})=>{const b=void 0!==l&&0!==l||void 0!==p&&0!==p,u=void 0!==x&&0!==x||void 0!==h&&0!==h;if(b||u){const d=(o+r)/2,g=(t+e)/2,$=d+(l??0),m=g+(p??0),y=d+(x??0),f=g+(h??0),v=b&&u;let I=0;const R=20;let w={x:o,y:t};for(let i=1;i<=R;i++){const n=i/R,s=v?getCubicBezierPoint(n,o,t,$,m,y,f,r,e):getQuadraticBezierPoint(n,o,t,b?$:y,b?m:f,r,e);I+=Math.sqrt((s.x-w.x)**2+(s.y-w.y)**2),w=s}const j=[],C=Math.max(.05,.02*n),k=Math.max(100,Math.ceil(I/C));for(let d=0;d<=k;d++){const l=d/k,p=v?getCubicBezierPoint(l,o,t,$,m,y,f,r,e):getQuadraticBezierPoint(l,o,t,b?$:y,b?m:f,r,e),x={position:"absolute",left:p.x-n/2,top:p.y-n/2,width:n,height:n,borderRadius:"50%",backgroundColor:i,opacity:s,boxShadow:0===d&&a&&c>0?createNeonGlow(a,c):void 0};j.push((0,_jsxRuntime.jsx)("div",{style:x},`c${d}`))}return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:j})}const g=r-o,$=e-t,m=Math.sqrt(g*g+$*$),y={position:"absolute",left:(o+r)/2-m/2,top:(t+e)/2-n/2,width:m,height:n,backgroundColor:i,opacity:s,transform:`rotate(${Math.atan2($,g)*(180/Math.PI)+d}deg)`,transformOrigin:"50% 50%",borderRadius:n/2,boxShadow:a&&c>0?createNeonGlow(a,c):void 0};return(0,_jsxRuntime.jsx)("div",{style:y})};exports.IconLine=IconLine;const IconTriangle=({x:o,y:t,size:r,direction:e,fill:i,opacity:n=1,rotation:s})=>{const a=.577*r;let c={},d=0,l=0;switch(e){case"down":c={borderLeft:`${a}px solid transparent`,borderRight:`${a}px solid transparent`,borderTop:`${r}px solid ${i}`},d=-a,l=0;break;case"up":c={borderLeft:`${a}px solid transparent`,borderRight:`${a}px solid transparent`,borderBottom:`${r}px solid ${i}`},d=-a,l=-r;break;case"left":c={borderTop:`${a}px solid transparent`,borderBottom:`${a}px solid transparent`,borderRight:`${r}px solid ${i}`},d=-r,l=-a;break;case"right":c={borderTop:`${a}px solid transparent`,borderBottom:`${a}px solid transparent`,borderLeft:`${r}px solid ${i}`},d=0,l=-a}const p=[];void 0!==s&&p.push(`rotate(${s}deg)`);const x={position:"absolute",left:o+d,top:t+l,width:0,height:0,opacity:n,...c,transform:p.length>0?p.join(" "):void 0,transformOrigin:"50% 50%"};return(0,_jsxRuntime.jsx)("div",{style:x})};exports.IconTriangle=IconTriangle;const IconArc=({cx:o,cy:t,r:r,startAngle:e,endAngle:i,stroke:n,strokeWidth:s=1.5,opacity:a=1,segments:c})=>{const d=Math.abs(i-e),l=Math.max(8,Math.ceil(d/10)),p=c??l,x=[],h=(i-e)/p;for(let i=0;i<p;i++){const c=e+(i+1)*h,d=(e+i*h)*Math.PI/180,l=c*Math.PI/180,p=o+r*Math.cos(d),b=t+r*Math.sin(d),u=o+r*Math.cos(l),g=t+r*Math.sin(l),$=u-p,m=g-b,y=Math.sqrt($*$+m*m),f={position:"absolute",left:(p+u)/2-y/2,top:(b+g)/2-s/2,width:y,height:s,backgroundColor:n,opacity:a,transform:`rotate(${Math.atan2(m,$)*(180/Math.PI)}deg)`,transformOrigin:"50% 50%",borderRadius:s/2};x.push((0,_jsxRuntime.jsx)("div",{style:f},i))}return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:x})};exports.IconArc=IconArc;const IconSemicircle=({cx:o,cy:t,r:r,half:e,fill:i,borderColor:n,borderWidth:s=0,opacity:a=1,glowColor:c,glowRadius:d=0})=>{const l=2*r;let p,x,h,b,u;switch(e){case"top":p=o-r,x=t-r,h=l,b=r,u=`${r}px ${r}px 0 0`;break;case"bottom":p=o-r,x=t,h=l,b=r,u=`0 0 ${r}px ${r}px`;break;case"left":p=o-r,x=t-r,h=r,b=l,u=`${r}px 0 0 ${r}px`;break;case"right":p=o,x=t-r,h=r,b=l,u=`0 ${r}px ${r}px 0`}const g={position:"absolute",left:p,top:x,width:h,height:b,borderRadius:u,backgroundColor:i,border:n?`${s}px solid ${n}`:void 0,opacity:a,boxShadow:c&&d>0?createNeonGlow(c,d):void 0,boxSizing:"border-box"};return(0,_jsxRuntime.jsx)("div",{style:g})};exports.IconSemicircle=IconSemicircle;const IconSmoothArc=({cx:o,cy:t,r:r,stroke:e,strokeWidth:i=2,opacity:n=1,portion:s="bottom"})=>{const a=2*r;let c=e,d=e,l=e,p=e;switch(s){case"bottom":c="transparent",l="transparent",p="transparent";break;case"top":d="transparent",l="transparent",p="transparent";break;case"left":c="transparent",d="transparent",p="transparent";break;case"right":c="transparent",d="transparent",l="transparent"}const x={position:"absolute",left:o-r,top:t-r,width:a,height:a,borderRadius:r,borderWidth:i,borderStyle:"solid",borderTopColor:c,borderBottomColor:d,borderLeftColor:l,borderRightColor:p,opacity:n,boxSizing:"border-box"};return(0,_jsxRuntime.jsx)("div",{style:x})};exports.IconSmoothArc=IconSmoothArc;
|