react-circular-range 1.0.6 → 1.0.8

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.
@@ -0,0 +1,2 @@
1
+ .CircularRange-module__knob___2nLWp{cursor:pointer;height:65px;position:relative;user-select:none;width:65px}.CircularRange-module__knobRing___H-KV6{background:linear-gradient(145deg,#1a1a1a,#252525);border:3px solid #333;border-radius:50%;box-shadow:inset 2px 2px 5px rgba(0,0,0,.5),inset -2px -2px 5px rgba(60,60,60,.1),0 4px 8px rgba(0,0,0,.3);height:100%;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.CircularRange-module__knobBackground___t2lGs{height:100%;left:0;pointer-events:none;position:absolute;top:0;transform:rotate(-135deg);width:100%}.CircularRange-module__knobBackgroundPath___ySqrn{fill:none;stroke:#8b5cf6;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;filter:drop-shadow(0 0 3px rgba(139,92,246,.7));transition:stroke-dashoffset .1s ease-out}.CircularRange-module__knobIndicator___FxbT4{background:linear-gradient(180deg,#8b5cf6,#c084fc);border-radius:2px;box-shadow:0 0 6px rgba(139,92,246,.8);height:20px;left:50%;position:absolute;top:5px;transform:translateX(-50%) rotate(-135deg);transform-origin:center 27.5px;width:4px;z-index:2}.CircularRange-module__knobCenter___DftjA{background:radial-gradient(circle,#0a0a0a,#1a1a1a);border-radius:50%;box-shadow:inset 1px 1px 3px rgba(0,0,0,.7),0 1px 2px rgba(139,92,246,.3);height:18px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:18px;z-index:3}.CircularRange-module__knob___2nLWp:hover .CircularRange-module__knobRing___H-KV6{border-color:#8b5cf6;box-shadow:inset 2px 2px 5px rgba(0,0,0,.5),inset -2px -2px 5px rgba(60,60,60,.1),0 4px 12px rgba(139,92,246,.4)}.CircularRange-module__knob___2nLWp:hover .CircularRange-module__knobIndicator___FxbT4{background:linear-gradient(180deg,#a78bfa,#c084fc);box-shadow:0 0 8px rgba(167,139,250,.9)}.CircularRange-module__knob___2nLWp.CircularRange-module__active___SFotz .CircularRange-module__knobRing___H-KV6{border-color:#a78bfa;box-shadow:inset 2px 2px 5px rgba(0,0,0,.6),inset -2px -2px 5px rgba(60,60,60,.15),0 4px 16px rgba(167,139,250,.5)}.CircularRange-module__knob___2nLWp.CircularRange-module__active___SFotz .CircularRange-module__knobIndicator___FxbT4{background:linear-gradient(180deg,#a78bfa,#c084fc);box-shadow:0 0 10px #a78bfa}.CircularRange-module__knob___2nLWp.CircularRange-module__active___SFotz .CircularRange-module__knobBackgroundPath___ySqrn{stroke:#a78bfa;filter:drop-shadow(0 0 4px rgba(167,139,250,.9))}
2
+ /*# sourceMappingURL=index.cjs.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["CircularRange.module.css"],"names":[],"mappings":"AAAA,oCAII,cAAe,CAFf,WAAY,CACZ,iBAAkB,CAElB,gBAAiB,CAJjB,UAKJ,CAEA,wCAKI,kDAAqD,CAFrD,qBAAsB,CACtB,iBAAkB,CAElB,0GAGoC,CAPpC,WAAY,CAQZ,oDAAwD,CATxD,UAUJ,CAEA,8CAKI,WAAY,CAFZ,MAAO,CAGP,mBAAoB,CALpB,iBAAkB,CAClB,KAAM,CAKN,yBAA0B,CAH1B,UAIJ,CAEA,kDACI,SAAU,CACV,cAAe,CACf,gBAAiB,CACjB,oBAAqB,CACrB,sBAAuB,CACvB,uBAAwB,CAExB,+CAAoD,CADpD,yCAEJ,CAEA,6CAII,kDAAwD,CAKxD,iBAAkB,CAGlB,sCAA2C,CAT3C,WAAY,CAGZ,QAAS,CALT,iBAAkB,CAIlB,OAAQ,CAGR,0CAA2C,CAD3C,8BAA+B,CAL/B,SAAU,CAQV,SAGJ,CAEA,0CAII,kDAAqD,CACrD,iBAAkB,CAIlB,yEAEyC,CARzC,WAAY,CAIZ,QAAS,CANT,iBAAkB,CAKlB,OAAQ,CAER,8BAAgC,CANhC,UAAW,CAUX,SACJ,CAGA,kFACI,oBAAqB,CACrB,gHAIJ,CAEA,uFACI,kDAAwD,CACxD,uCACJ,CAEA,iHACI,oBAAqB,CACrB,kHAIJ,CAEA,sHACI,kDAAwD,CACxD,2BACJ,CAEA,2HACI,cAAe,CACf,gDACJ","file":"index.cjs.css","sourcesContent":[".knob {\r\n width: 65px;\r\n height: 65px;\r\n position: relative;\r\n cursor: pointer;\r\n user-select: none;\r\n}\r\n\r\n.knobRing {\r\n width: 100%;\r\n height: 100%;\r\n border: 3px solid #333;\r\n border-radius: 50%;\r\n background: linear-gradient(145deg, #1a1a1a, #252525);\r\n box-shadow:\r\n inset 2px 2px 5px rgba(0, 0, 0, 0.5),\r\n inset -2px -2px 5px rgba(60, 60, 60, 0.1),\r\n 0 4px 8px rgba(0, 0, 0, 0.3);\r\n transition: border-color 0.2s ease, box-shadow 0.2s ease;\r\n}\r\n\r\n.knobBackground {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n pointer-events: none;\r\n transform: rotate(-135deg);\r\n}\r\n\r\n.knobBackgroundPath {\r\n fill: none;\r\n stroke: #8b5cf6;\r\n stroke-width: 3.5;\r\n stroke-linecap: round;\r\n stroke-dasharray: 113.1;\r\n stroke-dashoffset: 113.1;\r\n transition: stroke-dashoffset 0.1s ease-out;\r\n filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.7));\r\n}\r\n\r\n.knobIndicator {\r\n position: absolute;\r\n width: 4px;\r\n height: 20px;\r\n background: linear-gradient(to bottom, #8b5cf6, #c084fc);\r\n top: 5px;\r\n left: 50%;\r\n transform-origin: center 27.5px;\r\n transform: translateX(-50%) rotate(-135deg);\r\n border-radius: 2px;\r\n z-index: 2;\r\n /*transition: transform 0.05s ease-out;*/\r\n box-shadow: 0 0 6px rgba(139, 92, 246, 0.8);\r\n}\r\n\r\n.knobCenter {\r\n position: absolute;\r\n width: 18px;\r\n height: 18px;\r\n background: radial-gradient(circle, #0a0a0a, #1a1a1a);\r\n border-radius: 50%;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -50%);\r\n box-shadow:\r\n inset 1px 1px 3px rgba(0, 0, 0, 0.7),\r\n 0 1px 2px rgba(139, 92, 246, 0.3);\r\n z-index: 3;\r\n}\r\n\r\n/* Hover states */\r\n.knob:hover .knobRing {\r\n border-color: #8b5cf6;\r\n box-shadow:\r\n inset 2px 2px 5px rgba(0, 0, 0, 0.5),\r\n inset -2px -2px 5px rgba(60, 60, 60, 0.1),\r\n 0 4px 12px rgba(139, 92, 246, 0.4);\r\n}\r\n\r\n.knob:hover .knobIndicator {\r\n background: linear-gradient(to bottom, #a78bfa, #c084fc);\r\n box-shadow: 0 0 8px rgba(167, 139, 250, 0.9);\r\n}\r\n\r\n.knob.active .knobRing {\r\n border-color: #a78bfa;\r\n box-shadow:\r\n inset 2px 2px 5px rgba(0, 0, 0, 0.6),\r\n inset -2px -2px 5px rgba(60, 60, 60, 0.15),\r\n 0 4px 16px rgba(167, 139, 250, 0.5);\r\n}\r\n\r\n.knob.active .knobIndicator {\r\n background: linear-gradient(to bottom, #a78bfa, #c084fc);\r\n box-shadow: 0 0 10px rgba(167, 139, 250, 1);\r\n}\r\n\r\n.knob.active .knobBackgroundPath {\r\n stroke: #a78bfa;\r\n filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.9));\r\n}"]}
@@ -0,0 +1,504 @@
1
+ 'use strict';
2
+
3
+ require('react-circular-range/dist/CircularRange.css');
4
+ var require$$0 = require('react');
5
+
6
+ var jsxRuntime = {exports: {}};
7
+
8
+ var reactJsxRuntime_production = {};
9
+
10
+ /**
11
+ * @license React
12
+ * react-jsx-runtime.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */
19
+
20
+ var hasRequiredReactJsxRuntime_production;
21
+
22
+ function requireReactJsxRuntime_production () {
23
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
24
+ hasRequiredReactJsxRuntime_production = 1;
25
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
26
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
27
+ function jsxProd(type, config, maybeKey) {
28
+ var key = null;
29
+ void 0 !== maybeKey && (key = "" + maybeKey);
30
+ void 0 !== config.key && (key = "" + config.key);
31
+ if ("key" in config) {
32
+ maybeKey = {};
33
+ for (var propName in config)
34
+ "key" !== propName && (maybeKey[propName] = config[propName]);
35
+ } else maybeKey = config;
36
+ config = maybeKey.ref;
37
+ return {
38
+ $$typeof: REACT_ELEMENT_TYPE,
39
+ type: type,
40
+ key: key,
41
+ ref: void 0 !== config ? config : null,
42
+ props: maybeKey
43
+ };
44
+ }
45
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
46
+ reactJsxRuntime_production.jsx = jsxProd;
47
+ reactJsxRuntime_production.jsxs = jsxProd;
48
+ return reactJsxRuntime_production;
49
+ }
50
+
51
+ var reactJsxRuntime_development = {};
52
+
53
+ /**
54
+ * @license React
55
+ * react-jsx-runtime.development.js
56
+ *
57
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
58
+ *
59
+ * This source code is licensed under the MIT license found in the
60
+ * LICENSE file in the root directory of this source tree.
61
+ */
62
+
63
+ var hasRequiredReactJsxRuntime_development;
64
+
65
+ function requireReactJsxRuntime_development () {
66
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
67
+ hasRequiredReactJsxRuntime_development = 1;
68
+ "production" !== process.env.NODE_ENV &&
69
+ (function () {
70
+ function getComponentNameFromType(type) {
71
+ if (null == type) return null;
72
+ if ("function" === typeof type)
73
+ return type.$$typeof === REACT_CLIENT_REFERENCE
74
+ ? null
75
+ : type.displayName || type.name || null;
76
+ if ("string" === typeof type) return type;
77
+ switch (type) {
78
+ case REACT_FRAGMENT_TYPE:
79
+ return "Fragment";
80
+ case REACT_PROFILER_TYPE:
81
+ return "Profiler";
82
+ case REACT_STRICT_MODE_TYPE:
83
+ return "StrictMode";
84
+ case REACT_SUSPENSE_TYPE:
85
+ return "Suspense";
86
+ case REACT_SUSPENSE_LIST_TYPE:
87
+ return "SuspenseList";
88
+ case REACT_ACTIVITY_TYPE:
89
+ return "Activity";
90
+ }
91
+ if ("object" === typeof type)
92
+ switch (
93
+ ("number" === typeof type.tag &&
94
+ console.error(
95
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
96
+ ),
97
+ type.$$typeof)
98
+ ) {
99
+ case REACT_PORTAL_TYPE:
100
+ return "Portal";
101
+ case REACT_CONTEXT_TYPE:
102
+ return type.displayName || "Context";
103
+ case REACT_CONSUMER_TYPE:
104
+ return (type._context.displayName || "Context") + ".Consumer";
105
+ case REACT_FORWARD_REF_TYPE:
106
+ var innerType = type.render;
107
+ type = type.displayName;
108
+ type ||
109
+ ((type = innerType.displayName || innerType.name || ""),
110
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
111
+ return type;
112
+ case REACT_MEMO_TYPE:
113
+ return (
114
+ (innerType = type.displayName || null),
115
+ null !== innerType
116
+ ? innerType
117
+ : getComponentNameFromType(type.type) || "Memo"
118
+ );
119
+ case REACT_LAZY_TYPE:
120
+ innerType = type._payload;
121
+ type = type._init;
122
+ try {
123
+ return getComponentNameFromType(type(innerType));
124
+ } catch (x) {}
125
+ }
126
+ return null;
127
+ }
128
+ function testStringCoercion(value) {
129
+ return "" + value;
130
+ }
131
+ function checkKeyStringCoercion(value) {
132
+ try {
133
+ testStringCoercion(value);
134
+ var JSCompiler_inline_result = !1;
135
+ } catch (e) {
136
+ JSCompiler_inline_result = true;
137
+ }
138
+ if (JSCompiler_inline_result) {
139
+ JSCompiler_inline_result = console;
140
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
141
+ var JSCompiler_inline_result$jscomp$0 =
142
+ ("function" === typeof Symbol &&
143
+ Symbol.toStringTag &&
144
+ value[Symbol.toStringTag]) ||
145
+ value.constructor.name ||
146
+ "Object";
147
+ JSCompiler_temp_const.call(
148
+ JSCompiler_inline_result,
149
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
150
+ JSCompiler_inline_result$jscomp$0
151
+ );
152
+ return testStringCoercion(value);
153
+ }
154
+ }
155
+ function getTaskName(type) {
156
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
157
+ if (
158
+ "object" === typeof type &&
159
+ null !== type &&
160
+ type.$$typeof === REACT_LAZY_TYPE
161
+ )
162
+ return "<...>";
163
+ try {
164
+ var name = getComponentNameFromType(type);
165
+ return name ? "<" + name + ">" : "<...>";
166
+ } catch (x) {
167
+ return "<...>";
168
+ }
169
+ }
170
+ function getOwner() {
171
+ var dispatcher = ReactSharedInternals.A;
172
+ return null === dispatcher ? null : dispatcher.getOwner();
173
+ }
174
+ function UnknownOwner() {
175
+ return Error("react-stack-top-frame");
176
+ }
177
+ function hasValidKey(config) {
178
+ if (hasOwnProperty.call(config, "key")) {
179
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
180
+ if (getter && getter.isReactWarning) return false;
181
+ }
182
+ return void 0 !== config.key;
183
+ }
184
+ function defineKeyPropWarningGetter(props, displayName) {
185
+ function warnAboutAccessingKey() {
186
+ specialPropKeyWarningShown ||
187
+ ((specialPropKeyWarningShown = true),
188
+ console.error(
189
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
190
+ displayName
191
+ ));
192
+ }
193
+ warnAboutAccessingKey.isReactWarning = true;
194
+ Object.defineProperty(props, "key", {
195
+ get: warnAboutAccessingKey,
196
+ configurable: true
197
+ });
198
+ }
199
+ function elementRefGetterWithDeprecationWarning() {
200
+ var componentName = getComponentNameFromType(this.type);
201
+ didWarnAboutElementRef[componentName] ||
202
+ ((didWarnAboutElementRef[componentName] = true),
203
+ console.error(
204
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
205
+ ));
206
+ componentName = this.props.ref;
207
+ return void 0 !== componentName ? componentName : null;
208
+ }
209
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
210
+ var refProp = props.ref;
211
+ type = {
212
+ $$typeof: REACT_ELEMENT_TYPE,
213
+ type: type,
214
+ key: key,
215
+ props: props,
216
+ _owner: owner
217
+ };
218
+ null !== (void 0 !== refProp ? refProp : null)
219
+ ? Object.defineProperty(type, "ref", {
220
+ enumerable: false,
221
+ get: elementRefGetterWithDeprecationWarning
222
+ })
223
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
224
+ type._store = {};
225
+ Object.defineProperty(type._store, "validated", {
226
+ configurable: false,
227
+ enumerable: false,
228
+ writable: true,
229
+ value: 0
230
+ });
231
+ Object.defineProperty(type, "_debugInfo", {
232
+ configurable: false,
233
+ enumerable: false,
234
+ writable: true,
235
+ value: null
236
+ });
237
+ Object.defineProperty(type, "_debugStack", {
238
+ configurable: false,
239
+ enumerable: false,
240
+ writable: true,
241
+ value: debugStack
242
+ });
243
+ Object.defineProperty(type, "_debugTask", {
244
+ configurable: false,
245
+ enumerable: false,
246
+ writable: true,
247
+ value: debugTask
248
+ });
249
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
250
+ return type;
251
+ }
252
+ function jsxDEVImpl(
253
+ type,
254
+ config,
255
+ maybeKey,
256
+ isStaticChildren,
257
+ debugStack,
258
+ debugTask
259
+ ) {
260
+ var children = config.children;
261
+ if (void 0 !== children)
262
+ if (isStaticChildren)
263
+ if (isArrayImpl(children)) {
264
+ for (
265
+ isStaticChildren = 0;
266
+ isStaticChildren < children.length;
267
+ isStaticChildren++
268
+ )
269
+ validateChildKeys(children[isStaticChildren]);
270
+ Object.freeze && Object.freeze(children);
271
+ } else
272
+ console.error(
273
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
274
+ );
275
+ else validateChildKeys(children);
276
+ if (hasOwnProperty.call(config, "key")) {
277
+ children = getComponentNameFromType(type);
278
+ var keys = Object.keys(config).filter(function (k) {
279
+ return "key" !== k;
280
+ });
281
+ isStaticChildren =
282
+ 0 < keys.length
283
+ ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
284
+ : "{key: someKey}";
285
+ didWarnAboutKeySpread[children + isStaticChildren] ||
286
+ ((keys =
287
+ 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
288
+ console.error(
289
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
290
+ isStaticChildren,
291
+ children,
292
+ keys,
293
+ children
294
+ ),
295
+ (didWarnAboutKeySpread[children + isStaticChildren] = true));
296
+ }
297
+ children = null;
298
+ void 0 !== maybeKey &&
299
+ (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
300
+ hasValidKey(config) &&
301
+ (checkKeyStringCoercion(config.key), (children = "" + config.key));
302
+ if ("key" in config) {
303
+ maybeKey = {};
304
+ for (var propName in config)
305
+ "key" !== propName && (maybeKey[propName] = config[propName]);
306
+ } else maybeKey = config;
307
+ children &&
308
+ defineKeyPropWarningGetter(
309
+ maybeKey,
310
+ "function" === typeof type
311
+ ? type.displayName || type.name || "Unknown"
312
+ : type
313
+ );
314
+ return ReactElement(
315
+ type,
316
+ children,
317
+ maybeKey,
318
+ getOwner(),
319
+ debugStack,
320
+ debugTask
321
+ );
322
+ }
323
+ function validateChildKeys(node) {
324
+ isValidElement(node)
325
+ ? node._store && (node._store.validated = 1)
326
+ : "object" === typeof node &&
327
+ null !== node &&
328
+ node.$$typeof === REACT_LAZY_TYPE &&
329
+ ("fulfilled" === node._payload.status
330
+ ? isValidElement(node._payload.value) &&
331
+ node._payload.value._store &&
332
+ (node._payload.value._store.validated = 1)
333
+ : node._store && (node._store.validated = 1));
334
+ }
335
+ function isValidElement(object) {
336
+ return (
337
+ "object" === typeof object &&
338
+ null !== object &&
339
+ object.$$typeof === REACT_ELEMENT_TYPE
340
+ );
341
+ }
342
+ var React = require$$0,
343
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
344
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
345
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
346
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
347
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
348
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
349
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
350
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
351
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
352
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
353
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
354
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
355
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
356
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
357
+ ReactSharedInternals =
358
+ React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
359
+ hasOwnProperty = Object.prototype.hasOwnProperty,
360
+ isArrayImpl = Array.isArray,
361
+ createTask = console.createTask
362
+ ? console.createTask
363
+ : function () {
364
+ return null;
365
+ };
366
+ React = {
367
+ react_stack_bottom_frame: function (callStackForError) {
368
+ return callStackForError();
369
+ }
370
+ };
371
+ var specialPropKeyWarningShown;
372
+ var didWarnAboutElementRef = {};
373
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
374
+ React,
375
+ UnknownOwner
376
+ )();
377
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
378
+ var didWarnAboutKeySpread = {};
379
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
380
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
381
+ var trackActualOwner =
382
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
383
+ return jsxDEVImpl(
384
+ type,
385
+ config,
386
+ maybeKey,
387
+ false,
388
+ trackActualOwner
389
+ ? Error("react-stack-top-frame")
390
+ : unknownOwnerDebugStack,
391
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
392
+ );
393
+ };
394
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
395
+ var trackActualOwner =
396
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
397
+ return jsxDEVImpl(
398
+ type,
399
+ config,
400
+ maybeKey,
401
+ true,
402
+ trackActualOwner
403
+ ? Error("react-stack-top-frame")
404
+ : unknownOwnerDebugStack,
405
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
406
+ );
407
+ };
408
+ })();
409
+ return reactJsxRuntime_development;
410
+ }
411
+
412
+ var hasRequiredJsxRuntime;
413
+
414
+ function requireJsxRuntime () {
415
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
416
+ hasRequiredJsxRuntime = 1;
417
+
418
+ if (process.env.NODE_ENV === 'production') {
419
+ jsxRuntime.exports = requireReactJsxRuntime_production();
420
+ } else {
421
+ jsxRuntime.exports = requireReactJsxRuntime_development();
422
+ }
423
+ return jsxRuntime.exports;
424
+ }
425
+
426
+ var jsxRuntimeExports = requireJsxRuntime();
427
+
428
+ var styles = {"knob":"CircularRange-module__knob___2nLWp","knobRing":"CircularRange-module__knobRing___H-KV6","knobBackground":"CircularRange-module__knobBackground___t2lGs","knobBackgroundPath":"CircularRange-module__knobBackgroundPath___ySqrn","knobIndicator":"CircularRange-module__knobIndicator___FxbT4","knobCenter":"CircularRange-module__knobCenter___DftjA","active":"CircularRange-module__active___SFotz"};
429
+
430
+ const ARC_LENGTH = 113.1; // 270°
431
+ const CircularRange = ({ min = 0, max = 100, value = 0, step = 0.01, onChange, theme = styles }) => {
432
+ const knobRef = require$$0.useRef(null);
433
+ const [internalValue, setInternalValue] = require$$0.useState(value);
434
+ const [isActive, setIsActive] = require$$0.useState(false);
435
+ const startY = require$$0.useRef(0);
436
+ const startValue = require$$0.useRef(0);
437
+ const sensitivity = 0.01;
438
+ require$$0.useEffect(() => {
439
+ setInternalValue(value);
440
+ }, [value]);
441
+ const clamp = (v) => Math.min(max, Math.max(min, v));
442
+ const getNormalizedValue = require$$0.useCallback((v) => {
443
+ return (v - min) / (max - min);
444
+ }, [min, max]);
445
+ const setValue = require$$0.useCallback((v) => {
446
+ let next = clamp(v);
447
+ if (step > 0) {
448
+ next = Math.round(next / step) * step;
449
+ }
450
+ setInternalValue(next);
451
+ onChange?.(next);
452
+ }, [min, max, step, onChange]);
453
+ const handleStart = (e) => {
454
+ e.preventDefault();
455
+ setIsActive(true);
456
+ const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
457
+ startY.current = clientY;
458
+ startValue.current = internalValue;
459
+ };
460
+ const handleMove = (e) => {
461
+ if (!isActive)
462
+ return;
463
+ e.preventDefault();
464
+ const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
465
+ const deltaY = startY.current - clientY;
466
+ const deltaValue = deltaY * sensitivity * (max - min);
467
+ setValue(startValue.current + deltaValue);
468
+ };
469
+ const handleEnd = () => {
470
+ setIsActive(false);
471
+ };
472
+ const handleDoubleClick = () => {
473
+ setValue((min + max) / 2);
474
+ };
475
+ require$$0.useEffect(() => {
476
+ const el = knobRef.current;
477
+ if (!el)
478
+ return;
479
+ el.addEventListener("mousedown", handleStart);
480
+ el.addEventListener("touchstart", handleStart);
481
+ document.addEventListener("mousemove", handleMove);
482
+ document.addEventListener("touchmove", handleMove);
483
+ document.addEventListener("mouseup", handleEnd);
484
+ document.addEventListener("touchend", handleEnd);
485
+ el.addEventListener("dblclick", handleDoubleClick);
486
+ return () => {
487
+ el.removeEventListener("mousedown", handleStart);
488
+ el.removeEventListener("touchstart", handleStart);
489
+ document.removeEventListener("mousemove", handleMove);
490
+ document.removeEventListener("touchmove", handleMove);
491
+ document.removeEventListener("mouseup", handleEnd);
492
+ document.removeEventListener("touchend", handleEnd);
493
+ el.removeEventListener("dblclick", handleDoubleClick);
494
+ };
495
+ }, [handleMove, isActive]);
496
+ const normalized = getNormalizedValue(internalValue);
497
+ const rotation = normalized * 270 - 135;
498
+ const dashOffset = ARC_LENGTH - normalized * ARC_LENGTH;
499
+ return (jsxRuntimeExports.jsx("div", { ref: knobRef, className: `${theme.knob} ${isActive ? theme.active : ""}`, children: jsxRuntimeExports.jsxs("div", { className: `${theme.knobRing}`, children: [jsxRuntimeExports.jsx("svg", { className: `${theme.knobBackground}`, viewBox: "0 0 60 60", children: jsxRuntimeExports.jsx("path", { className: `${theme.knobBackgroundPath}`, d: "M 30 6 A 24 24 0 1 1 6 30", strokeDasharray: ARC_LENGTH, strokeDashoffset: dashOffset }) }), jsxRuntimeExports.jsx("div", { className: `${theme.knobIndicator}`, style: {
500
+ transform: `translateX(-50%) rotate(${rotation}deg)`,
501
+ } }), jsxRuntimeExports.jsx("div", { className: `${theme.knobCenter}` })] }) }));
502
+ };
503
+
504
+ exports.CircularRange = CircularRange;
@@ -0,0 +1,2 @@
1
+ .CircularRange-module__knob___2nLWp{cursor:pointer;height:65px;position:relative;user-select:none;width:65px}.CircularRange-module__knobRing___H-KV6{background:linear-gradient(145deg,#1a1a1a,#252525);border:3px solid #333;border-radius:50%;box-shadow:inset 2px 2px 5px rgba(0,0,0,.5),inset -2px -2px 5px rgba(60,60,60,.1),0 4px 8px rgba(0,0,0,.3);height:100%;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.CircularRange-module__knobBackground___t2lGs{height:100%;left:0;pointer-events:none;position:absolute;top:0;transform:rotate(-135deg);width:100%}.CircularRange-module__knobBackgroundPath___ySqrn{fill:none;stroke:#8b5cf6;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;filter:drop-shadow(0 0 3px rgba(139,92,246,.7));transition:stroke-dashoffset .1s ease-out}.CircularRange-module__knobIndicator___FxbT4{background:linear-gradient(180deg,#8b5cf6,#c084fc);border-radius:2px;box-shadow:0 0 6px rgba(139,92,246,.8);height:20px;left:50%;position:absolute;top:5px;transform:translateX(-50%) rotate(-135deg);transform-origin:center 27.5px;width:4px;z-index:2}.CircularRange-module__knobCenter___DftjA{background:radial-gradient(circle,#0a0a0a,#1a1a1a);border-radius:50%;box-shadow:inset 1px 1px 3px rgba(0,0,0,.7),0 1px 2px rgba(139,92,246,.3);height:18px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:18px;z-index:3}.CircularRange-module__knob___2nLWp:hover .CircularRange-module__knobRing___H-KV6{border-color:#8b5cf6;box-shadow:inset 2px 2px 5px rgba(0,0,0,.5),inset -2px -2px 5px rgba(60,60,60,.1),0 4px 12px rgba(139,92,246,.4)}.CircularRange-module__knob___2nLWp:hover .CircularRange-module__knobIndicator___FxbT4{background:linear-gradient(180deg,#a78bfa,#c084fc);box-shadow:0 0 8px rgba(167,139,250,.9)}.CircularRange-module__knob___2nLWp.CircularRange-module__active___SFotz .CircularRange-module__knobRing___H-KV6{border-color:#a78bfa;box-shadow:inset 2px 2px 5px rgba(0,0,0,.6),inset -2px -2px 5px rgba(60,60,60,.15),0 4px 16px rgba(167,139,250,.5)}.CircularRange-module__knob___2nLWp.CircularRange-module__active___SFotz .CircularRange-module__knobIndicator___FxbT4{background:linear-gradient(180deg,#a78bfa,#c084fc);box-shadow:0 0 10px #a78bfa}.CircularRange-module__knob___2nLWp.CircularRange-module__active___SFotz .CircularRange-module__knobBackgroundPath___ySqrn{stroke:#a78bfa;filter:drop-shadow(0 0 4px rgba(167,139,250,.9))}
2
+ /*# sourceMappingURL=index.esm.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["CircularRange.module.css"],"names":[],"mappings":"AAAA,oCAII,cAAe,CAFf,WAAY,CACZ,iBAAkB,CAElB,gBAAiB,CAJjB,UAKJ,CAEA,wCAKI,kDAAqD,CAFrD,qBAAsB,CACtB,iBAAkB,CAElB,0GAGoC,CAPpC,WAAY,CAQZ,oDAAwD,CATxD,UAUJ,CAEA,8CAKI,WAAY,CAFZ,MAAO,CAGP,mBAAoB,CALpB,iBAAkB,CAClB,KAAM,CAKN,yBAA0B,CAH1B,UAIJ,CAEA,kDACI,SAAU,CACV,cAAe,CACf,gBAAiB,CACjB,oBAAqB,CACrB,sBAAuB,CACvB,uBAAwB,CAExB,+CAAoD,CADpD,yCAEJ,CAEA,6CAII,kDAAwD,CAKxD,iBAAkB,CAGlB,sCAA2C,CAT3C,WAAY,CAGZ,QAAS,CALT,iBAAkB,CAIlB,OAAQ,CAGR,0CAA2C,CAD3C,8BAA+B,CAL/B,SAAU,CAQV,SAGJ,CAEA,0CAII,kDAAqD,CACrD,iBAAkB,CAIlB,yEAEyC,CARzC,WAAY,CAIZ,QAAS,CANT,iBAAkB,CAKlB,OAAQ,CAER,8BAAgC,CANhC,UAAW,CAUX,SACJ,CAGA,kFACI,oBAAqB,CACrB,gHAIJ,CAEA,uFACI,kDAAwD,CACxD,uCACJ,CAEA,iHACI,oBAAqB,CACrB,kHAIJ,CAEA,sHACI,kDAAwD,CACxD,2BACJ,CAEA,2HACI,cAAe,CACf,gDACJ","file":"index.esm.css","sourcesContent":[".knob {\r\n width: 65px;\r\n height: 65px;\r\n position: relative;\r\n cursor: pointer;\r\n user-select: none;\r\n}\r\n\r\n.knobRing {\r\n width: 100%;\r\n height: 100%;\r\n border: 3px solid #333;\r\n border-radius: 50%;\r\n background: linear-gradient(145deg, #1a1a1a, #252525);\r\n box-shadow:\r\n inset 2px 2px 5px rgba(0, 0, 0, 0.5),\r\n inset -2px -2px 5px rgba(60, 60, 60, 0.1),\r\n 0 4px 8px rgba(0, 0, 0, 0.3);\r\n transition: border-color 0.2s ease, box-shadow 0.2s ease;\r\n}\r\n\r\n.knobBackground {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n width: 100%;\r\n height: 100%;\r\n pointer-events: none;\r\n transform: rotate(-135deg);\r\n}\r\n\r\n.knobBackgroundPath {\r\n fill: none;\r\n stroke: #8b5cf6;\r\n stroke-width: 3.5;\r\n stroke-linecap: round;\r\n stroke-dasharray: 113.1;\r\n stroke-dashoffset: 113.1;\r\n transition: stroke-dashoffset 0.1s ease-out;\r\n filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.7));\r\n}\r\n\r\n.knobIndicator {\r\n position: absolute;\r\n width: 4px;\r\n height: 20px;\r\n background: linear-gradient(to bottom, #8b5cf6, #c084fc);\r\n top: 5px;\r\n left: 50%;\r\n transform-origin: center 27.5px;\r\n transform: translateX(-50%) rotate(-135deg);\r\n border-radius: 2px;\r\n z-index: 2;\r\n /*transition: transform 0.05s ease-out;*/\r\n box-shadow: 0 0 6px rgba(139, 92, 246, 0.8);\r\n}\r\n\r\n.knobCenter {\r\n position: absolute;\r\n width: 18px;\r\n height: 18px;\r\n background: radial-gradient(circle, #0a0a0a, #1a1a1a);\r\n border-radius: 50%;\r\n top: 50%;\r\n left: 50%;\r\n transform: translate(-50%, -50%);\r\n box-shadow:\r\n inset 1px 1px 3px rgba(0, 0, 0, 0.7),\r\n 0 1px 2px rgba(139, 92, 246, 0.3);\r\n z-index: 3;\r\n}\r\n\r\n/* Hover states */\r\n.knob:hover .knobRing {\r\n border-color: #8b5cf6;\r\n box-shadow:\r\n inset 2px 2px 5px rgba(0, 0, 0, 0.5),\r\n inset -2px -2px 5px rgba(60, 60, 60, 0.1),\r\n 0 4px 12px rgba(139, 92, 246, 0.4);\r\n}\r\n\r\n.knob:hover .knobIndicator {\r\n background: linear-gradient(to bottom, #a78bfa, #c084fc);\r\n box-shadow: 0 0 8px rgba(167, 139, 250, 0.9);\r\n}\r\n\r\n.knob.active .knobRing {\r\n border-color: #a78bfa;\r\n box-shadow:\r\n inset 2px 2px 5px rgba(0, 0, 0, 0.6),\r\n inset -2px -2px 5px rgba(60, 60, 60, 0.15),\r\n 0 4px 16px rgba(167, 139, 250, 0.5);\r\n}\r\n\r\n.knob.active .knobIndicator {\r\n background: linear-gradient(to bottom, #a78bfa, #c084fc);\r\n box-shadow: 0 0 10px rgba(167, 139, 250, 1);\r\n}\r\n\r\n.knob.active .knobBackgroundPath {\r\n stroke: #a78bfa;\r\n filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.9));\r\n}"]}
@@ -0,0 +1,502 @@
1
+ import 'react-circular-range/dist/CircularRange.css';
2
+ import require$$0, { useRef, useState, useEffect, useCallback } from 'react';
3
+
4
+ var jsxRuntime = {exports: {}};
5
+
6
+ var reactJsxRuntime_production = {};
7
+
8
+ /**
9
+ * @license React
10
+ * react-jsx-runtime.production.js
11
+ *
12
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
13
+ *
14
+ * This source code is licensed under the MIT license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ */
17
+
18
+ var hasRequiredReactJsxRuntime_production;
19
+
20
+ function requireReactJsxRuntime_production () {
21
+ if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
22
+ hasRequiredReactJsxRuntime_production = 1;
23
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
24
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
25
+ function jsxProd(type, config, maybeKey) {
26
+ var key = null;
27
+ void 0 !== maybeKey && (key = "" + maybeKey);
28
+ void 0 !== config.key && (key = "" + config.key);
29
+ if ("key" in config) {
30
+ maybeKey = {};
31
+ for (var propName in config)
32
+ "key" !== propName && (maybeKey[propName] = config[propName]);
33
+ } else maybeKey = config;
34
+ config = maybeKey.ref;
35
+ return {
36
+ $$typeof: REACT_ELEMENT_TYPE,
37
+ type: type,
38
+ key: key,
39
+ ref: void 0 !== config ? config : null,
40
+ props: maybeKey
41
+ };
42
+ }
43
+ reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
44
+ reactJsxRuntime_production.jsx = jsxProd;
45
+ reactJsxRuntime_production.jsxs = jsxProd;
46
+ return reactJsxRuntime_production;
47
+ }
48
+
49
+ var reactJsxRuntime_development = {};
50
+
51
+ /**
52
+ * @license React
53
+ * react-jsx-runtime.development.js
54
+ *
55
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
56
+ *
57
+ * This source code is licensed under the MIT license found in the
58
+ * LICENSE file in the root directory of this source tree.
59
+ */
60
+
61
+ var hasRequiredReactJsxRuntime_development;
62
+
63
+ function requireReactJsxRuntime_development () {
64
+ if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
65
+ hasRequiredReactJsxRuntime_development = 1;
66
+ "production" !== process.env.NODE_ENV &&
67
+ (function () {
68
+ function getComponentNameFromType(type) {
69
+ if (null == type) return null;
70
+ if ("function" === typeof type)
71
+ return type.$$typeof === REACT_CLIENT_REFERENCE
72
+ ? null
73
+ : type.displayName || type.name || null;
74
+ if ("string" === typeof type) return type;
75
+ switch (type) {
76
+ case REACT_FRAGMENT_TYPE:
77
+ return "Fragment";
78
+ case REACT_PROFILER_TYPE:
79
+ return "Profiler";
80
+ case REACT_STRICT_MODE_TYPE:
81
+ return "StrictMode";
82
+ case REACT_SUSPENSE_TYPE:
83
+ return "Suspense";
84
+ case REACT_SUSPENSE_LIST_TYPE:
85
+ return "SuspenseList";
86
+ case REACT_ACTIVITY_TYPE:
87
+ return "Activity";
88
+ }
89
+ if ("object" === typeof type)
90
+ switch (
91
+ ("number" === typeof type.tag &&
92
+ console.error(
93
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
94
+ ),
95
+ type.$$typeof)
96
+ ) {
97
+ case REACT_PORTAL_TYPE:
98
+ return "Portal";
99
+ case REACT_CONTEXT_TYPE:
100
+ return type.displayName || "Context";
101
+ case REACT_CONSUMER_TYPE:
102
+ return (type._context.displayName || "Context") + ".Consumer";
103
+ case REACT_FORWARD_REF_TYPE:
104
+ var innerType = type.render;
105
+ type = type.displayName;
106
+ type ||
107
+ ((type = innerType.displayName || innerType.name || ""),
108
+ (type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
109
+ return type;
110
+ case REACT_MEMO_TYPE:
111
+ return (
112
+ (innerType = type.displayName || null),
113
+ null !== innerType
114
+ ? innerType
115
+ : getComponentNameFromType(type.type) || "Memo"
116
+ );
117
+ case REACT_LAZY_TYPE:
118
+ innerType = type._payload;
119
+ type = type._init;
120
+ try {
121
+ return getComponentNameFromType(type(innerType));
122
+ } catch (x) {}
123
+ }
124
+ return null;
125
+ }
126
+ function testStringCoercion(value) {
127
+ return "" + value;
128
+ }
129
+ function checkKeyStringCoercion(value) {
130
+ try {
131
+ testStringCoercion(value);
132
+ var JSCompiler_inline_result = !1;
133
+ } catch (e) {
134
+ JSCompiler_inline_result = true;
135
+ }
136
+ if (JSCompiler_inline_result) {
137
+ JSCompiler_inline_result = console;
138
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
139
+ var JSCompiler_inline_result$jscomp$0 =
140
+ ("function" === typeof Symbol &&
141
+ Symbol.toStringTag &&
142
+ value[Symbol.toStringTag]) ||
143
+ value.constructor.name ||
144
+ "Object";
145
+ JSCompiler_temp_const.call(
146
+ JSCompiler_inline_result,
147
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
148
+ JSCompiler_inline_result$jscomp$0
149
+ );
150
+ return testStringCoercion(value);
151
+ }
152
+ }
153
+ function getTaskName(type) {
154
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
155
+ if (
156
+ "object" === typeof type &&
157
+ null !== type &&
158
+ type.$$typeof === REACT_LAZY_TYPE
159
+ )
160
+ return "<...>";
161
+ try {
162
+ var name = getComponentNameFromType(type);
163
+ return name ? "<" + name + ">" : "<...>";
164
+ } catch (x) {
165
+ return "<...>";
166
+ }
167
+ }
168
+ function getOwner() {
169
+ var dispatcher = ReactSharedInternals.A;
170
+ return null === dispatcher ? null : dispatcher.getOwner();
171
+ }
172
+ function UnknownOwner() {
173
+ return Error("react-stack-top-frame");
174
+ }
175
+ function hasValidKey(config) {
176
+ if (hasOwnProperty.call(config, "key")) {
177
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
178
+ if (getter && getter.isReactWarning) return false;
179
+ }
180
+ return void 0 !== config.key;
181
+ }
182
+ function defineKeyPropWarningGetter(props, displayName) {
183
+ function warnAboutAccessingKey() {
184
+ specialPropKeyWarningShown ||
185
+ ((specialPropKeyWarningShown = true),
186
+ console.error(
187
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
188
+ displayName
189
+ ));
190
+ }
191
+ warnAboutAccessingKey.isReactWarning = true;
192
+ Object.defineProperty(props, "key", {
193
+ get: warnAboutAccessingKey,
194
+ configurable: true
195
+ });
196
+ }
197
+ function elementRefGetterWithDeprecationWarning() {
198
+ var componentName = getComponentNameFromType(this.type);
199
+ didWarnAboutElementRef[componentName] ||
200
+ ((didWarnAboutElementRef[componentName] = true),
201
+ console.error(
202
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
203
+ ));
204
+ componentName = this.props.ref;
205
+ return void 0 !== componentName ? componentName : null;
206
+ }
207
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
208
+ var refProp = props.ref;
209
+ type = {
210
+ $$typeof: REACT_ELEMENT_TYPE,
211
+ type: type,
212
+ key: key,
213
+ props: props,
214
+ _owner: owner
215
+ };
216
+ null !== (void 0 !== refProp ? refProp : null)
217
+ ? Object.defineProperty(type, "ref", {
218
+ enumerable: false,
219
+ get: elementRefGetterWithDeprecationWarning
220
+ })
221
+ : Object.defineProperty(type, "ref", { enumerable: false, value: null });
222
+ type._store = {};
223
+ Object.defineProperty(type._store, "validated", {
224
+ configurable: false,
225
+ enumerable: false,
226
+ writable: true,
227
+ value: 0
228
+ });
229
+ Object.defineProperty(type, "_debugInfo", {
230
+ configurable: false,
231
+ enumerable: false,
232
+ writable: true,
233
+ value: null
234
+ });
235
+ Object.defineProperty(type, "_debugStack", {
236
+ configurable: false,
237
+ enumerable: false,
238
+ writable: true,
239
+ value: debugStack
240
+ });
241
+ Object.defineProperty(type, "_debugTask", {
242
+ configurable: false,
243
+ enumerable: false,
244
+ writable: true,
245
+ value: debugTask
246
+ });
247
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
248
+ return type;
249
+ }
250
+ function jsxDEVImpl(
251
+ type,
252
+ config,
253
+ maybeKey,
254
+ isStaticChildren,
255
+ debugStack,
256
+ debugTask
257
+ ) {
258
+ var children = config.children;
259
+ if (void 0 !== children)
260
+ if (isStaticChildren)
261
+ if (isArrayImpl(children)) {
262
+ for (
263
+ isStaticChildren = 0;
264
+ isStaticChildren < children.length;
265
+ isStaticChildren++
266
+ )
267
+ validateChildKeys(children[isStaticChildren]);
268
+ Object.freeze && Object.freeze(children);
269
+ } else
270
+ console.error(
271
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
272
+ );
273
+ else validateChildKeys(children);
274
+ if (hasOwnProperty.call(config, "key")) {
275
+ children = getComponentNameFromType(type);
276
+ var keys = Object.keys(config).filter(function (k) {
277
+ return "key" !== k;
278
+ });
279
+ isStaticChildren =
280
+ 0 < keys.length
281
+ ? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
282
+ : "{key: someKey}";
283
+ didWarnAboutKeySpread[children + isStaticChildren] ||
284
+ ((keys =
285
+ 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
286
+ console.error(
287
+ 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
288
+ isStaticChildren,
289
+ children,
290
+ keys,
291
+ children
292
+ ),
293
+ (didWarnAboutKeySpread[children + isStaticChildren] = true));
294
+ }
295
+ children = null;
296
+ void 0 !== maybeKey &&
297
+ (checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
298
+ hasValidKey(config) &&
299
+ (checkKeyStringCoercion(config.key), (children = "" + config.key));
300
+ if ("key" in config) {
301
+ maybeKey = {};
302
+ for (var propName in config)
303
+ "key" !== propName && (maybeKey[propName] = config[propName]);
304
+ } else maybeKey = config;
305
+ children &&
306
+ defineKeyPropWarningGetter(
307
+ maybeKey,
308
+ "function" === typeof type
309
+ ? type.displayName || type.name || "Unknown"
310
+ : type
311
+ );
312
+ return ReactElement(
313
+ type,
314
+ children,
315
+ maybeKey,
316
+ getOwner(),
317
+ debugStack,
318
+ debugTask
319
+ );
320
+ }
321
+ function validateChildKeys(node) {
322
+ isValidElement(node)
323
+ ? node._store && (node._store.validated = 1)
324
+ : "object" === typeof node &&
325
+ null !== node &&
326
+ node.$$typeof === REACT_LAZY_TYPE &&
327
+ ("fulfilled" === node._payload.status
328
+ ? isValidElement(node._payload.value) &&
329
+ node._payload.value._store &&
330
+ (node._payload.value._store.validated = 1)
331
+ : node._store && (node._store.validated = 1));
332
+ }
333
+ function isValidElement(object) {
334
+ return (
335
+ "object" === typeof object &&
336
+ null !== object &&
337
+ object.$$typeof === REACT_ELEMENT_TYPE
338
+ );
339
+ }
340
+ var React = require$$0,
341
+ REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
342
+ REACT_PORTAL_TYPE = Symbol.for("react.portal"),
343
+ REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
344
+ REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
345
+ REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
346
+ REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
347
+ REACT_CONTEXT_TYPE = Symbol.for("react.context"),
348
+ REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
349
+ REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
350
+ REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
351
+ REACT_MEMO_TYPE = Symbol.for("react.memo"),
352
+ REACT_LAZY_TYPE = Symbol.for("react.lazy"),
353
+ REACT_ACTIVITY_TYPE = Symbol.for("react.activity"),
354
+ REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
355
+ ReactSharedInternals =
356
+ React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
357
+ hasOwnProperty = Object.prototype.hasOwnProperty,
358
+ isArrayImpl = Array.isArray,
359
+ createTask = console.createTask
360
+ ? console.createTask
361
+ : function () {
362
+ return null;
363
+ };
364
+ React = {
365
+ react_stack_bottom_frame: function (callStackForError) {
366
+ return callStackForError();
367
+ }
368
+ };
369
+ var specialPropKeyWarningShown;
370
+ var didWarnAboutElementRef = {};
371
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
372
+ React,
373
+ UnknownOwner
374
+ )();
375
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
376
+ var didWarnAboutKeySpread = {};
377
+ reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
378
+ reactJsxRuntime_development.jsx = function (type, config, maybeKey) {
379
+ var trackActualOwner =
380
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
381
+ return jsxDEVImpl(
382
+ type,
383
+ config,
384
+ maybeKey,
385
+ false,
386
+ trackActualOwner
387
+ ? Error("react-stack-top-frame")
388
+ : unknownOwnerDebugStack,
389
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
390
+ );
391
+ };
392
+ reactJsxRuntime_development.jsxs = function (type, config, maybeKey) {
393
+ var trackActualOwner =
394
+ 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
395
+ return jsxDEVImpl(
396
+ type,
397
+ config,
398
+ maybeKey,
399
+ true,
400
+ trackActualOwner
401
+ ? Error("react-stack-top-frame")
402
+ : unknownOwnerDebugStack,
403
+ trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
404
+ );
405
+ };
406
+ })();
407
+ return reactJsxRuntime_development;
408
+ }
409
+
410
+ var hasRequiredJsxRuntime;
411
+
412
+ function requireJsxRuntime () {
413
+ if (hasRequiredJsxRuntime) return jsxRuntime.exports;
414
+ hasRequiredJsxRuntime = 1;
415
+
416
+ if (process.env.NODE_ENV === 'production') {
417
+ jsxRuntime.exports = requireReactJsxRuntime_production();
418
+ } else {
419
+ jsxRuntime.exports = requireReactJsxRuntime_development();
420
+ }
421
+ return jsxRuntime.exports;
422
+ }
423
+
424
+ var jsxRuntimeExports = requireJsxRuntime();
425
+
426
+ var styles = {"knob":"CircularRange-module__knob___2nLWp","knobRing":"CircularRange-module__knobRing___H-KV6","knobBackground":"CircularRange-module__knobBackground___t2lGs","knobBackgroundPath":"CircularRange-module__knobBackgroundPath___ySqrn","knobIndicator":"CircularRange-module__knobIndicator___FxbT4","knobCenter":"CircularRange-module__knobCenter___DftjA","active":"CircularRange-module__active___SFotz"};
427
+
428
+ const ARC_LENGTH = 113.1; // 270°
429
+ const CircularRange = ({ min = 0, max = 100, value = 0, step = 0.01, onChange, theme = styles }) => {
430
+ const knobRef = useRef(null);
431
+ const [internalValue, setInternalValue] = useState(value);
432
+ const [isActive, setIsActive] = useState(false);
433
+ const startY = useRef(0);
434
+ const startValue = useRef(0);
435
+ const sensitivity = 0.01;
436
+ useEffect(() => {
437
+ setInternalValue(value);
438
+ }, [value]);
439
+ const clamp = (v) => Math.min(max, Math.max(min, v));
440
+ const getNormalizedValue = useCallback((v) => {
441
+ return (v - min) / (max - min);
442
+ }, [min, max]);
443
+ const setValue = useCallback((v) => {
444
+ let next = clamp(v);
445
+ if (step > 0) {
446
+ next = Math.round(next / step) * step;
447
+ }
448
+ setInternalValue(next);
449
+ onChange?.(next);
450
+ }, [min, max, step, onChange]);
451
+ const handleStart = (e) => {
452
+ e.preventDefault();
453
+ setIsActive(true);
454
+ const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
455
+ startY.current = clientY;
456
+ startValue.current = internalValue;
457
+ };
458
+ const handleMove = (e) => {
459
+ if (!isActive)
460
+ return;
461
+ e.preventDefault();
462
+ const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
463
+ const deltaY = startY.current - clientY;
464
+ const deltaValue = deltaY * sensitivity * (max - min);
465
+ setValue(startValue.current + deltaValue);
466
+ };
467
+ const handleEnd = () => {
468
+ setIsActive(false);
469
+ };
470
+ const handleDoubleClick = () => {
471
+ setValue((min + max) / 2);
472
+ };
473
+ useEffect(() => {
474
+ const el = knobRef.current;
475
+ if (!el)
476
+ return;
477
+ el.addEventListener("mousedown", handleStart);
478
+ el.addEventListener("touchstart", handleStart);
479
+ document.addEventListener("mousemove", handleMove);
480
+ document.addEventListener("touchmove", handleMove);
481
+ document.addEventListener("mouseup", handleEnd);
482
+ document.addEventListener("touchend", handleEnd);
483
+ el.addEventListener("dblclick", handleDoubleClick);
484
+ return () => {
485
+ el.removeEventListener("mousedown", handleStart);
486
+ el.removeEventListener("touchstart", handleStart);
487
+ document.removeEventListener("mousemove", handleMove);
488
+ document.removeEventListener("touchmove", handleMove);
489
+ document.removeEventListener("mouseup", handleEnd);
490
+ document.removeEventListener("touchend", handleEnd);
491
+ el.removeEventListener("dblclick", handleDoubleClick);
492
+ };
493
+ }, [handleMove, isActive]);
494
+ const normalized = getNormalizedValue(internalValue);
495
+ const rotation = normalized * 270 - 135;
496
+ const dashOffset = ARC_LENGTH - normalized * ARC_LENGTH;
497
+ return (jsxRuntimeExports.jsx("div", { ref: knobRef, className: `${theme.knob} ${isActive ? theme.active : ""}`, children: jsxRuntimeExports.jsxs("div", { className: `${theme.knobRing}`, children: [jsxRuntimeExports.jsx("svg", { className: `${theme.knobBackground}`, viewBox: "0 0 60 60", children: jsxRuntimeExports.jsx("path", { className: `${theme.knobBackgroundPath}`, d: "M 30 6 A 24 24 0 1 1 6 30", strokeDasharray: ARC_LENGTH, strokeDashoffset: dashOffset }) }), jsxRuntimeExports.jsx("div", { className: `${theme.knobIndicator}`, style: {
498
+ transform: `translateX(-50%) rotate(${rotation}deg)`,
499
+ } }), jsxRuntimeExports.jsx("div", { className: `${theme.knobCenter}` })] }) }));
500
+ };
501
+
502
+ export { CircularRange };
@@ -0,0 +1,11 @@
1
+ export type StyleSlots = 'knob' | 'knobRing' | 'knobBackground' | 'knobBackgroundPath' | 'knobIndicator' | 'knobCenter' | 'active';
2
+ export type CircularRangeThemeProps = Partial<Record<StyleSlots, string>>;
3
+ export interface CircularRangeProps {
4
+ min?: number;
5
+ max?: number;
6
+ value?: number;
7
+ step?: number;
8
+ onChange?: (value: number) => void;
9
+ theme?: CircularRangeThemeProps;
10
+ }
11
+ export declare const CircularRange: React.FC<CircularRangeProps>;
@@ -0,0 +1,3 @@
1
+ import 'react-circular-range/dist/CircularRange.css';
2
+ export { CircularRange } from './CircularRange';
3
+ export type { CircularRangeProps, CircularRangeThemeProps, StyleSlots } from './CircularRange';
package/package.json CHANGED
@@ -1,24 +1,15 @@
1
1
  {
2
2
  "name": "react-circular-range",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Simple VST-like circular slider/range.",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.esm.js",
7
+ "types": "dist/types/index.d.ts",
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.mjs",
14
- "require": "./dist/index.js",
15
- "types": "./dist/index.d.ts"
16
- }
17
- },
18
11
  "scripts": {
19
- "build": "tsup src/index.ts --format cjs,esm --dts --minify --clean --inject-style",
20
- "dev": "tsup src/index.ts --format cjs,esm --watch --dts",
21
- "lint": "tsc"
12
+ "build": "rollup -c"
22
13
  },
23
14
  "repository": {
24
15
  "type": "git",
@@ -39,16 +30,19 @@
39
30
  },
40
31
  "license": "ISC",
41
32
  "homepage": "https://github.com/executable1210/react-circular-range#readme",
42
- "peerDependencies": {
43
- "react": ">=16.8.0",
44
- "react-dom": ">=16.8.0"
45
- },
46
33
  "devDependencies": {
34
+ "@rollup/plugin-commonjs": "^29.0.0",
35
+ "@rollup/plugin-node-resolve": "^16.0.3",
36
+ "@rollup/plugin-typescript": "^12.3.0",
47
37
  "@types/react": "^19.2.7",
48
38
  "@types/react-dom": "^19.2.3",
49
- "react": "^19.2.3",
50
- "react-dom": "^19.2.3",
51
- "tsup": "^8.5.1",
39
+ "postcss": "^8.5.6",
40
+ "postcss-modules": "^6.0.1",
41
+ "rollup": "^4.54.0",
42
+ "rollup-plugin-postcss": "^4.0.2",
52
43
  "typescript": "^5.9.3"
44
+ },
45
+ "dependencies": {
46
+ "tslib": "^2.8.1"
53
47
  }
54
48
  }
package/dist/index.d.mts DELETED
@@ -1,13 +0,0 @@
1
- type StyleSlots = 'knob' | 'knobRing' | 'knobBackground' | 'knobBackgroundPath' | 'knobIndicator' | 'knobCenter' | 'active';
2
- type CircularRangeThemeProps = Partial<Record<StyleSlots, string>>;
3
- interface CircularRangeProps {
4
- min?: number;
5
- max?: number;
6
- value?: number;
7
- step?: number;
8
- onChange?: (value: number) => void;
9
- theme?: CircularRangeThemeProps;
10
- }
11
- declare const CircularRange: React.FC<CircularRangeProps>;
12
-
13
- export { CircularRange, type CircularRangeProps, type CircularRangeThemeProps, type StyleSlots };
package/dist/index.d.ts DELETED
@@ -1,13 +0,0 @@
1
- type StyleSlots = 'knob' | 'knobRing' | 'knobBackground' | 'knobBackgroundPath' | 'knobIndicator' | 'knobCenter' | 'active';
2
- type CircularRangeThemeProps = Partial<Record<StyleSlots, string>>;
3
- interface CircularRangeProps {
4
- min?: number;
5
- max?: number;
6
- value?: number;
7
- step?: number;
8
- onChange?: (value: number) => void;
9
- theme?: CircularRangeThemeProps;
10
- }
11
- declare const CircularRange: React.FC<CircularRangeProps>;
12
-
13
- export { CircularRange, type CircularRangeProps, type CircularRangeThemeProps, type StyleSlots };
package/dist/index.js DELETED
@@ -1,3 +0,0 @@
1
- "use strict";var h=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var D=(t,o)=>{for(var r in o)h(t,r,{get:o[r],enumerable:!0})},V=(t,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let s of S(o))!$.call(t,s)&&s!==r&&h(t,s,{get:()=>o[s],enumerable:!(n=M(o,s))||n.enumerable});return t};var z=t=>V(h({},"__esModule",{value:!0}),t);var H={};D(H,{CircularRange:()=>A});module.exports=z(H);var a=require("react");var R={};function f(t,{insertAt:o}={}){if(!t||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",o==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}f(`.crc-knob{width:65px;height:65px;position:relative;cursor:pointer;user-select:none}.crc-knobRing{width:100%;height:100%;border:3px solid #333;border-radius:50%;background:linear-gradient(145deg,#1a1a1a,#252525);box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 8px #0000004d;transition:border-color .2s ease,box-shadow .2s ease}.crc-knobBackground{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;transform:rotate(-135deg)}.crc-knobBackgroundPath{fill:none;stroke:#8b5cf6;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;transition:stroke-dashoffset .1s ease-out;filter:drop-shadow(0 0 3px rgba(139,92,246,.7))}.crc-knobIndicator{position:absolute;width:4px;height:20px;background:linear-gradient(to bottom,#8b5cf6,#c084fc);top:5px;left:50%;transform-origin:center 27.5px;transform:translate(-50%) rotate(-135deg);border-radius:2px;z-index:2;box-shadow:0 0 6px #8b5cf6cc}.crc-knobCenter{position:absolute;width:18px;height:18px;background:radial-gradient(circle,#0a0a0a,#1a1a1a);border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:inset 1px 1px 3px #000000b3,0 1px 2px #8b5cf64d;z-index:3}.crc-knob:hover .knobRing{border-color:#8b5cf6;box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 12px #8b5cf666}.crc-knob:hover .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 8px #a78bfae6}.crc-knob.active .knobRing{border-color:#a78bfa;box-shadow:inset 2px 2px 5px #0009,inset -2px -2px 5px #3c3c3c26,0 4px 16px #a78bfa80}.crc-knob.active .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 10px #a78bfa}.crc-knob.active .knobBackgroundPath{stroke:#a78bfa;filter:drop-shadow(0 0 4px rgba(167,139,250,.9))}
2
- `);var i=require("react/jsx-runtime"),x=113.1,A=({min:t=0,max:o=100,value:r=0,step:n=.01,onChange:s,theme:d=R})=>{let m=(0,a.useRef)(null),[v,k]=(0,a.useState)(r),[b,g]=(0,a.useState)(!1),E=(0,a.useRef)(0),w=(0,a.useRef)(0),B=.01;(0,a.useEffect)(()=>{k(r)},[r]);let N=e=>Math.min(o,Math.max(t,e)),I=(0,a.useCallback)(e=>(e-t)/(o-t),[t,o]),y=(0,a.useCallback)(e=>{let c=N(e);n>0&&(c=Math.round(c/n)*n),k(c),s?.(c)},[t,o,n,s]),u=e=>{e.preventDefault(),g(!0);let c="touches"in e?e.touches[0].clientY:e.clientY;E.current=c,w.current=v},l=e=>{if(!b)return;e.preventDefault();let c="touches"in e?e.touches[0].clientY:e.clientY,Y=(E.current-c)*B*(o-t);y(w.current+Y)},p=()=>{g(!1)},C=()=>{y((t+o)/2)};(0,a.useEffect)(()=>{let e=m.current;if(e)return e.addEventListener("mousedown",u),e.addEventListener("touchstart",u),document.addEventListener("mousemove",l),document.addEventListener("touchmove",l),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),e.addEventListener("dblclick",C),()=>{e.removeEventListener("mousedown",u),e.removeEventListener("touchstart",u),document.removeEventListener("mousemove",l),document.removeEventListener("touchmove",l),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),e.removeEventListener("dblclick",C)}},[l,b]);let L=I(v),P=L*270-135,T=x-L*x;return(0,i.jsx)("div",{ref:m,className:`${d.knob} ${b?d.active:""}`,children:(0,i.jsxs)("div",{className:`${d.knobRing}`,children:[(0,i.jsx)("svg",{className:`${d.knobBackground}`,viewBox:"0 0 60 60",children:(0,i.jsx)("path",{className:`${d.knobBackgroundPath}`,d:"M 30 6 A 24 24 0 1 1 6 30",strokeDasharray:x,strokeDashoffset:T})}),(0,i.jsx)("div",{className:`${d.knobIndicator}`,style:{transform:`translateX(-50%) rotate(${P}deg)`}}),(0,i.jsx)("div",{className:`${d.knobCenter}`})]})})};0&&(module.exports={CircularRange});
3
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/CircularRange.tsx","../src/CircularRange.module.css","#style-inject:#style-inject"],"sourcesContent":["// export { CircularRange } from './CircularRange';\r\n// export type { CircularRangeProps, CircularRangeThemeProps, StyleSlots } from './CircularRange';\r\n\r\nexport * from './CircularRange';","import {\r\n useCallback,\r\n useEffect,\r\n useRef,\r\n useState,\r\n} from \"react\";\r\n\r\nimport * as styles from \"./CircularRange.module.css\";\r\n\r\nexport type StyleSlots =\r\n | 'knob'\r\n | 'knobRing'\r\n | 'knobBackground'\r\n | 'knobBackgroundPath'\r\n | 'knobIndicator'\r\n | 'knobCenter'\r\n | 'active'\r\n\r\nexport type CircularRangeThemeProps = Partial<Record<StyleSlots, string>>;\r\n\r\nexport interface CircularRangeProps {\r\n min?: number;\r\n max?: number;\r\n value?: number;\r\n step?: number;\r\n onChange?: (value: number) => void;\r\n\r\n // override styles with css module\r\n theme?: CircularRangeThemeProps;\r\n}\r\n\r\nconst ARC_LENGTH = 113.1; // 270°\r\n\r\nexport const CircularRange: React.FC<CircularRangeProps> = ({\r\n min = 0,\r\n max = 100,\r\n value = 0,\r\n step = 0.01,\r\n onChange,\r\n theme = styles\r\n}) => {\r\n const knobRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const [internalValue, setInternalValue] = useState(value);\r\n const [isActive, setIsActive] = useState(false);\r\n\r\n const startY = useRef(0);\r\n const startValue = useRef(0);\r\n const sensitivity = 0.01;\r\n useEffect(() => {\r\n setInternalValue(value);\r\n }, [value]);\r\n\r\n const clamp = (v: number) => Math.min(max, Math.max(min, v));\r\n\r\n const getNormalizedValue = useCallback(\r\n (v: number) => {\r\n return (v - min) / (max - min);\r\n },\r\n [min, max],\r\n );\r\n\r\n const setValue = useCallback(\r\n (v: number) => {\r\n let next = clamp(v);\r\n if (step > 0) {\r\n next = Math.round(next / step) * step;\r\n }\r\n setInternalValue(next);\r\n onChange?.(next);\r\n },\r\n [min, max, step, onChange],\r\n );\r\n\r\n const handleStart = (e: MouseEvent | TouchEvent) => {\r\n e.preventDefault();\r\n setIsActive(true);\r\n const clientY = \"touches\" in e ? e.touches[0].clientY : e.clientY;\r\n startY.current = clientY;\r\n startValue.current = internalValue;\r\n };\r\n\r\n const handleMove = (e: MouseEvent | TouchEvent) => {\r\n if (!isActive) return;\r\n e.preventDefault();\r\n\r\n const clientY = \"touches\" in e ? e.touches[0].clientY : e.clientY;\r\n const deltaY = startY.current - clientY;\r\n const deltaValue = deltaY * sensitivity * (max - min);\r\n\r\n setValue(startValue.current + deltaValue);\r\n };\r\n\r\n const handleEnd = () => {\r\n setIsActive(false);\r\n };\r\n\r\n const handleDoubleClick = () => {\r\n setValue((min + max) / 2);\r\n };\r\n\r\n useEffect(() => {\r\n const el = knobRef.current;\r\n if (!el) return;\r\n\r\n el.addEventListener(\"mousedown\", handleStart);\r\n el.addEventListener(\"touchstart\", handleStart);\r\n\r\n document.addEventListener(\"mousemove\", handleMove);\r\n document.addEventListener(\"touchmove\", handleMove);\r\n document.addEventListener(\"mouseup\", handleEnd);\r\n document.addEventListener(\"touchend\", handleEnd);\r\n\r\n el.addEventListener(\"dblclick\", handleDoubleClick);\r\n\r\n return () => {\r\n el.removeEventListener(\"mousedown\", handleStart);\r\n el.removeEventListener(\"touchstart\", handleStart);\r\n\r\n document.removeEventListener(\"mousemove\", handleMove);\r\n document.removeEventListener(\"touchmove\", handleMove);\r\n document.removeEventListener(\"mouseup\", handleEnd);\r\n document.removeEventListener(\"touchend\", handleEnd);\r\n\r\n el.removeEventListener(\"dblclick\", handleDoubleClick);\r\n };\r\n }, [handleMove, isActive]);\r\n\r\n const normalized = getNormalizedValue(internalValue);\r\n const rotation = normalized * 270 - 135;\r\n const dashOffset = ARC_LENGTH - normalized * ARC_LENGTH;\r\n\r\n return (\r\n <div\r\n ref={knobRef}\r\n className={`${theme.knob} ${isActive ? theme.active : \"\"}`}\r\n >\r\n <div className={`${theme.knobRing}`}>\r\n <svg\r\n className={`${theme.knobBackground}`}\r\n viewBox=\"0 0 60 60\"\r\n >\r\n <path\r\n className={`${theme.knobBackgroundPath}`}\r\n d=\"M 30 6 A 24 24 0 1 1 6 30\"\r\n strokeDasharray={ARC_LENGTH}\r\n strokeDashoffset={dashOffset}\r\n />\r\n </svg>\r\n\r\n <div\r\n className={`${theme.knobIndicator}`}\r\n style={{\r\n transform: `translateX(-50%) rotate(${rotation}deg)`,\r\n }}\r\n />\r\n\r\n <div\r\n className={`${theme.knobCenter}`}\r\n />\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import styleInject from '#style-inject';styleInject(\".crc-knob{width:65px;height:65px;position:relative;cursor:pointer;user-select:none}.crc-knobRing{width:100%;height:100%;border:3px solid #333;border-radius:50%;background:linear-gradient(145deg,#1a1a1a,#252525);box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 8px #0000004d;transition:border-color .2s ease,box-shadow .2s ease}.crc-knobBackground{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;transform:rotate(-135deg)}.crc-knobBackgroundPath{fill:none;stroke:#8b5cf6;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;transition:stroke-dashoffset .1s ease-out;filter:drop-shadow(0 0 3px rgba(139,92,246,.7))}.crc-knobIndicator{position:absolute;width:4px;height:20px;background:linear-gradient(to bottom,#8b5cf6,#c084fc);top:5px;left:50%;transform-origin:center 27.5px;transform:translate(-50%) rotate(-135deg);border-radius:2px;z-index:2;box-shadow:0 0 6px #8b5cf6cc}.crc-knobCenter{position:absolute;width:18px;height:18px;background:radial-gradient(circle,#0a0a0a,#1a1a1a);border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:inset 1px 1px 3px #000000b3,0 1px 2px #8b5cf64d;z-index:3}.crc-knob:hover .knobRing{border-color:#8b5cf6;box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 12px #8b5cf666}.crc-knob:hover .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 8px #a78bfae6}.crc-knob.active .knobRing{border-color:#a78bfa;box-shadow:inset 2px 2px 5px #0009,inset -2px -2px 5px #3c3c3c26,0 4px 16px #a78bfa80}.crc-knob.active .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 10px #a78bfa}.crc-knob.active .knobBackgroundPath{stroke:#a78bfa;filter:drop-shadow(0 0 4px rgba(167,139,250,.9))}\\n\")","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n "],"mappings":"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","names":["index_exports","__export","CircularRange","__toCommonJS","import_react","CircularRange_exports","styleInject","css","insertAt","head","style","styleInject","import_jsx_runtime","ARC_LENGTH","CircularRange","min","max","value","step","onChange","theme","CircularRange_exports","knobRef","internalValue","setInternalValue","isActive","setIsActive","startY","startValue","sensitivity","clamp","v","getNormalizedValue","setValue","next","handleStart","clientY","handleMove","deltaValue","handleEnd","handleDoubleClick","el","normalized","rotation","dashOffset"]}
package/dist/index.mjs DELETED
@@ -1,3 +0,0 @@
1
- import{useCallback as R,useEffect as B,useRef as b,useState as N}from"react";var L={};function p(o,{insertAt:r}={}){if(!o||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",r==="top"&&n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t),t.styleSheet?t.styleSheet.cssText=o:t.appendChild(document.createTextNode(o))}p(`.crc-knob{width:65px;height:65px;position:relative;cursor:pointer;user-select:none}.crc-knobRing{width:100%;height:100%;border:3px solid #333;border-radius:50%;background:linear-gradient(145deg,#1a1a1a,#252525);box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 8px #0000004d;transition:border-color .2s ease,box-shadow .2s ease}.crc-knobBackground{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;transform:rotate(-135deg)}.crc-knobBackgroundPath{fill:none;stroke:#8b5cf6;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;transition:stroke-dashoffset .1s ease-out;filter:drop-shadow(0 0 3px rgba(139,92,246,.7))}.crc-knobIndicator{position:absolute;width:4px;height:20px;background:linear-gradient(to bottom,#8b5cf6,#c084fc);top:5px;left:50%;transform-origin:center 27.5px;transform:translate(-50%) rotate(-135deg);border-radius:2px;z-index:2;box-shadow:0 0 6px #8b5cf6cc}.crc-knobCenter{position:absolute;width:18px;height:18px;background:radial-gradient(circle,#0a0a0a,#1a1a1a);border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:inset 1px 1px 3px #000000b3,0 1px 2px #8b5cf64d;z-index:3}.crc-knob:hover .knobRing{border-color:#8b5cf6;box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 12px #8b5cf666}.crc-knob:hover .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 8px #a78bfae6}.crc-knob.active .knobRing{border-color:#a78bfa;box-shadow:inset 2px 2px 5px #0009,inset -2px -2px 5px #3c3c3c26,0 4px 16px #a78bfa80}.crc-knob.active .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 10px #a78bfa}.crc-knob.active .knobBackgroundPath{stroke:#a78bfa;filter:drop-shadow(0 0 4px rgba(167,139,250,.9))}
2
- `);import{jsx as i,jsxs as $}from"react/jsx-runtime";var h=113.1,H=({min:o=0,max:r=100,value:n=0,step:t=.01,onChange:f,theme:s=L})=>{let x=b(null),[m,v]=N(n),[u,k]=N(!1),g=b(0),E=b(0),I=.01;B(()=>{v(n)},[n]);let P=e=>Math.min(r,Math.max(o,e)),T=R(e=>(e-o)/(r-o),[o,r]),w=R(e=>{let a=P(e);t>0&&(a=Math.round(a/t)*t),v(a),f?.(a)},[o,r,t,f]),d=e=>{e.preventDefault(),k(!0);let a="touches"in e?e.touches[0].clientY:e.clientY;g.current=a,E.current=m},c=e=>{if(!u)return;e.preventDefault();let a="touches"in e?e.touches[0].clientY:e.clientY,S=(g.current-a)*I*(r-o);w(E.current+S)},l=()=>{k(!1)},y=()=>{w((o+r)/2)};B(()=>{let e=x.current;if(e)return e.addEventListener("mousedown",d),e.addEventListener("touchstart",d),document.addEventListener("mousemove",c),document.addEventListener("touchmove",c),document.addEventListener("mouseup",l),document.addEventListener("touchend",l),e.addEventListener("dblclick",y),()=>{e.removeEventListener("mousedown",d),e.removeEventListener("touchstart",d),document.removeEventListener("mousemove",c),document.removeEventListener("touchmove",c),document.removeEventListener("mouseup",l),document.removeEventListener("touchend",l),e.removeEventListener("dblclick",y)}},[c,u]);let C=T(m),Y=C*270-135,M=h-C*h;return i("div",{ref:x,className:`${s.knob} ${u?s.active:""}`,children:$("div",{className:`${s.knobRing}`,children:[i("svg",{className:`${s.knobBackground}`,viewBox:"0 0 60 60",children:i("path",{className:`${s.knobBackgroundPath}`,d:"M 30 6 A 24 24 0 1 1 6 30",strokeDasharray:h,strokeDashoffset:M})}),i("div",{className:`${s.knobIndicator}`,style:{transform:`translateX(-50%) rotate(${Y}deg)`}}),i("div",{className:`${s.knobCenter}`})]})})};export{H as CircularRange};
3
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/CircularRange.tsx","../src/CircularRange.module.css","#style-inject:#style-inject"],"sourcesContent":["import {\r\n useCallback,\r\n useEffect,\r\n useRef,\r\n useState,\r\n} from \"react\";\r\n\r\nimport * as styles from \"./CircularRange.module.css\";\r\n\r\nexport type StyleSlots =\r\n | 'knob'\r\n | 'knobRing'\r\n | 'knobBackground'\r\n | 'knobBackgroundPath'\r\n | 'knobIndicator'\r\n | 'knobCenter'\r\n | 'active'\r\n\r\nexport type CircularRangeThemeProps = Partial<Record<StyleSlots, string>>;\r\n\r\nexport interface CircularRangeProps {\r\n min?: number;\r\n max?: number;\r\n value?: number;\r\n step?: number;\r\n onChange?: (value: number) => void;\r\n\r\n // override styles with css module\r\n theme?: CircularRangeThemeProps;\r\n}\r\n\r\nconst ARC_LENGTH = 113.1; // 270°\r\n\r\nexport const CircularRange: React.FC<CircularRangeProps> = ({\r\n min = 0,\r\n max = 100,\r\n value = 0,\r\n step = 0.01,\r\n onChange,\r\n theme = styles\r\n}) => {\r\n const knobRef = useRef<HTMLDivElement | null>(null);\r\n\r\n const [internalValue, setInternalValue] = useState(value);\r\n const [isActive, setIsActive] = useState(false);\r\n\r\n const startY = useRef(0);\r\n const startValue = useRef(0);\r\n const sensitivity = 0.01;\r\n useEffect(() => {\r\n setInternalValue(value);\r\n }, [value]);\r\n\r\n const clamp = (v: number) => Math.min(max, Math.max(min, v));\r\n\r\n const getNormalizedValue = useCallback(\r\n (v: number) => {\r\n return (v - min) / (max - min);\r\n },\r\n [min, max],\r\n );\r\n\r\n const setValue = useCallback(\r\n (v: number) => {\r\n let next = clamp(v);\r\n if (step > 0) {\r\n next = Math.round(next / step) * step;\r\n }\r\n setInternalValue(next);\r\n onChange?.(next);\r\n },\r\n [min, max, step, onChange],\r\n );\r\n\r\n const handleStart = (e: MouseEvent | TouchEvent) => {\r\n e.preventDefault();\r\n setIsActive(true);\r\n const clientY = \"touches\" in e ? e.touches[0].clientY : e.clientY;\r\n startY.current = clientY;\r\n startValue.current = internalValue;\r\n };\r\n\r\n const handleMove = (e: MouseEvent | TouchEvent) => {\r\n if (!isActive) return;\r\n e.preventDefault();\r\n\r\n const clientY = \"touches\" in e ? e.touches[0].clientY : e.clientY;\r\n const deltaY = startY.current - clientY;\r\n const deltaValue = deltaY * sensitivity * (max - min);\r\n\r\n setValue(startValue.current + deltaValue);\r\n };\r\n\r\n const handleEnd = () => {\r\n setIsActive(false);\r\n };\r\n\r\n const handleDoubleClick = () => {\r\n setValue((min + max) / 2);\r\n };\r\n\r\n useEffect(() => {\r\n const el = knobRef.current;\r\n if (!el) return;\r\n\r\n el.addEventListener(\"mousedown\", handleStart);\r\n el.addEventListener(\"touchstart\", handleStart);\r\n\r\n document.addEventListener(\"mousemove\", handleMove);\r\n document.addEventListener(\"touchmove\", handleMove);\r\n document.addEventListener(\"mouseup\", handleEnd);\r\n document.addEventListener(\"touchend\", handleEnd);\r\n\r\n el.addEventListener(\"dblclick\", handleDoubleClick);\r\n\r\n return () => {\r\n el.removeEventListener(\"mousedown\", handleStart);\r\n el.removeEventListener(\"touchstart\", handleStart);\r\n\r\n document.removeEventListener(\"mousemove\", handleMove);\r\n document.removeEventListener(\"touchmove\", handleMove);\r\n document.removeEventListener(\"mouseup\", handleEnd);\r\n document.removeEventListener(\"touchend\", handleEnd);\r\n\r\n el.removeEventListener(\"dblclick\", handleDoubleClick);\r\n };\r\n }, [handleMove, isActive]);\r\n\r\n const normalized = getNormalizedValue(internalValue);\r\n const rotation = normalized * 270 - 135;\r\n const dashOffset = ARC_LENGTH - normalized * ARC_LENGTH;\r\n\r\n return (\r\n <div\r\n ref={knobRef}\r\n className={`${theme.knob} ${isActive ? theme.active : \"\"}`}\r\n >\r\n <div className={`${theme.knobRing}`}>\r\n <svg\r\n className={`${theme.knobBackground}`}\r\n viewBox=\"0 0 60 60\"\r\n >\r\n <path\r\n className={`${theme.knobBackgroundPath}`}\r\n d=\"M 30 6 A 24 24 0 1 1 6 30\"\r\n strokeDasharray={ARC_LENGTH}\r\n strokeDashoffset={dashOffset}\r\n />\r\n </svg>\r\n\r\n <div\r\n className={`${theme.knobIndicator}`}\r\n style={{\r\n transform: `translateX(-50%) rotate(${rotation}deg)`,\r\n }}\r\n />\r\n\r\n <div\r\n className={`${theme.knobCenter}`}\r\n />\r\n </div>\r\n </div>\r\n );\r\n};\r\n","import styleInject from '#style-inject';styleInject(\".crc-knob{width:65px;height:65px;position:relative;cursor:pointer;user-select:none}.crc-knobRing{width:100%;height:100%;border:3px solid #333;border-radius:50%;background:linear-gradient(145deg,#1a1a1a,#252525);box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 8px #0000004d;transition:border-color .2s ease,box-shadow .2s ease}.crc-knobBackground{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;transform:rotate(-135deg)}.crc-knobBackgroundPath{fill:none;stroke:#8b5cf6;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;transition:stroke-dashoffset .1s ease-out;filter:drop-shadow(0 0 3px rgba(139,92,246,.7))}.crc-knobIndicator{position:absolute;width:4px;height:20px;background:linear-gradient(to bottom,#8b5cf6,#c084fc);top:5px;left:50%;transform-origin:center 27.5px;transform:translate(-50%) rotate(-135deg);border-radius:2px;z-index:2;box-shadow:0 0 6px #8b5cf6cc}.crc-knobCenter{position:absolute;width:18px;height:18px;background:radial-gradient(circle,#0a0a0a,#1a1a1a);border-radius:50%;top:50%;left:50%;transform:translate(-50%,-50%);box-shadow:inset 1px 1px 3px #000000b3,0 1px 2px #8b5cf64d;z-index:3}.crc-knob:hover .knobRing{border-color:#8b5cf6;box-shadow:inset 2px 2px 5px #00000080,inset -2px -2px 5px #3c3c3c1a,0 4px 12px #8b5cf666}.crc-knob:hover .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 8px #a78bfae6}.crc-knob.active .knobRing{border-color:#a78bfa;box-shadow:inset 2px 2px 5px #0009,inset -2px -2px 5px #3c3c3c26,0 4px 16px #a78bfa80}.crc-knob.active .knobIndicator{background:linear-gradient(to bottom,#a78bfa,#c084fc);box-shadow:0 0 10px #a78bfa}.crc-knob.active .knobBackgroundPath{stroke:#a78bfa;filter:drop-shadow(0 0 4px rgba(167,139,250,.9))}\\n\")","\n export default function styleInject(css, { insertAt } = {}) {\n if (!css || typeof document === 'undefined') return\n \n const head = document.head || document.getElementsByTagName('head')[0]\n const style = document.createElement('style')\n style.type = 'text/css'\n \n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild)\n } else {\n head.appendChild(style)\n }\n } else {\n head.appendChild(style)\n }\n \n if (style.styleSheet) {\n style.styleSheet.cssText = css\n } else {\n style.appendChild(document.createTextNode(css))\n }\n }\n "],"mappings":"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","names":["useCallback","useEffect","useRef","useState","CircularRange_exports","styleInject","css","insertAt","head","style","styleInject","jsx","jsxs","ARC_LENGTH","CircularRange","min","max","value","step","onChange","theme","CircularRange_exports","knobRef","useRef","internalValue","setInternalValue","useState","isActive","setIsActive","startY","startValue","sensitivity","useEffect","clamp","v","getNormalizedValue","useCallback","setValue","next","handleStart","clientY","handleMove","deltaValue","handleEnd","handleDoubleClick","el","normalized","rotation","dashOffset"]}