@antimatter-audio/antimatter-ui 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +19 -6
- package/dist/index.js +180 -73
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,14 @@ declare enum SPACING {
|
|
|
38
38
|
LARGE = "large",
|
|
39
39
|
X_LARGE = "xlarge"
|
|
40
40
|
}
|
|
41
|
+
declare enum POSITION {
|
|
42
|
+
TOP = "top",
|
|
43
|
+
BOTTOM = "bottom"
|
|
44
|
+
}
|
|
45
|
+
declare enum DIRECTION {
|
|
46
|
+
VERTICAL = "vertical",
|
|
47
|
+
HORIZONTAL = "horizontal"
|
|
48
|
+
}
|
|
41
49
|
|
|
42
50
|
interface GridColProps {
|
|
43
51
|
span?: number;
|
|
@@ -79,6 +87,9 @@ declare const Dropdown: React__default.FC<DropdownProps>;
|
|
|
79
87
|
|
|
80
88
|
interface KnobProps {
|
|
81
89
|
id: any;
|
|
90
|
+
label?: string;
|
|
91
|
+
labelPosition?: POSITION;
|
|
92
|
+
showValue?: boolean;
|
|
82
93
|
className?: string;
|
|
83
94
|
style?: object;
|
|
84
95
|
}
|
|
@@ -86,9 +97,13 @@ declare const Knob: React__default.FC<React__default.PropsWithChildren<KnobProps
|
|
|
86
97
|
|
|
87
98
|
interface SliderProps {
|
|
88
99
|
id: any;
|
|
100
|
+
label?: string;
|
|
101
|
+
labelPosition?: POSITION;
|
|
102
|
+
orientation?: DIRECTION;
|
|
103
|
+
showValue?: boolean;
|
|
89
104
|
className?: string;
|
|
90
105
|
}
|
|
91
|
-
declare const Slider:
|
|
106
|
+
declare const Slider: React__default.FC<React__default.PropsWithChildren<SliderProps>>;
|
|
92
107
|
|
|
93
108
|
declare enum TEXT_HEADER_LEVELS {
|
|
94
109
|
H1 = "h1",
|
|
@@ -114,10 +129,6 @@ interface TextLabelProps {
|
|
|
114
129
|
}
|
|
115
130
|
declare const TextLabel: React.FC<React.PropsWithChildren<TextLabelProps>>;
|
|
116
131
|
|
|
117
|
-
declare enum DIRECTION {
|
|
118
|
-
VETICAL = "vertical",
|
|
119
|
-
HORIZONTAL = "horizontal"
|
|
120
|
-
}
|
|
121
132
|
interface LayoutProps {
|
|
122
133
|
className?: string;
|
|
123
134
|
style?: React__default.CSSProperties;
|
|
@@ -126,8 +137,10 @@ interface LayoutProps {
|
|
|
126
137
|
gap?: SPACING;
|
|
127
138
|
direction?: DIRECTION;
|
|
128
139
|
width?: string;
|
|
140
|
+
height?: string;
|
|
141
|
+
border?: boolean;
|
|
129
142
|
padding?: Array<SPACING>;
|
|
130
143
|
}
|
|
131
144
|
declare const Layout: React__default.FC<React__default.PropsWithChildren<LayoutProps>>;
|
|
132
145
|
|
|
133
|
-
export { Button, Col, DIRECTION, Dropdown, FLEX_DIRECTION, SPACING as GRID_SPACING, Knob, Layout, Row, SPACING, Slider, TEXT_HEADER_LEVELS, Tabs, TextHeader, TextLabel };
|
|
146
|
+
export { Button, Col, DIRECTION, Dropdown, FLEX_DIRECTION, SPACING as GRID_SPACING, Knob, Layout, POSITION, Row, SPACING, Slider, TEXT_HEADER_LEVELS, Tabs, TextHeader, TextLabel };
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,16 @@ var SPACING;
|
|
|
50
50
|
SPACING["LARGE"] = "large";
|
|
51
51
|
SPACING["X_LARGE"] = "xlarge";
|
|
52
52
|
})(SPACING || (SPACING = {}));
|
|
53
|
+
var POSITION;
|
|
54
|
+
(function(POSITION) {
|
|
55
|
+
POSITION["TOP"] = "top";
|
|
56
|
+
POSITION["BOTTOM"] = "bottom";
|
|
57
|
+
})(POSITION || (POSITION = {}));
|
|
58
|
+
var DIRECTION;
|
|
59
|
+
(function(DIRECTION) {
|
|
60
|
+
DIRECTION["VERTICAL"] = "vertical";
|
|
61
|
+
DIRECTION["HORIZONTAL"] = "horizontal";
|
|
62
|
+
})(DIRECTION || (DIRECTION = {}));
|
|
53
63
|
|
|
54
64
|
var Tabs = function(param) {
|
|
55
65
|
var items = param.items, className = param.className, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
@@ -94,15 +104,15 @@ var BUTTON_SIZE_CLASSES = {
|
|
|
94
104
|
LARGE: 'button-large'
|
|
95
105
|
};
|
|
96
106
|
|
|
97
|
-
function _array_like_to_array$
|
|
107
|
+
function _array_like_to_array$3(arr, len) {
|
|
98
108
|
if (len == null || len > arr.length) len = arr.length;
|
|
99
109
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
100
110
|
return arr2;
|
|
101
111
|
}
|
|
102
|
-
function _array_with_holes$
|
|
112
|
+
function _array_with_holes$3(arr) {
|
|
103
113
|
if (Array.isArray(arr)) return arr;
|
|
104
114
|
}
|
|
105
|
-
function _iterable_to_array_limit$
|
|
115
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
106
116
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
107
117
|
if (_i == null) return;
|
|
108
118
|
var _arr = [];
|
|
@@ -126,23 +136,23 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
126
136
|
}
|
|
127
137
|
return _arr;
|
|
128
138
|
}
|
|
129
|
-
function _non_iterable_rest$
|
|
139
|
+
function _non_iterable_rest$3() {
|
|
130
140
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
131
141
|
}
|
|
132
|
-
function _sliced_to_array$
|
|
133
|
-
return _array_with_holes$
|
|
142
|
+
function _sliced_to_array$3(arr, i) {
|
|
143
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
134
144
|
}
|
|
135
|
-
function _unsupported_iterable_to_array$
|
|
145
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
136
146
|
if (!o) return;
|
|
137
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
147
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
138
148
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
139
149
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
140
150
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
141
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
151
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
142
152
|
}
|
|
143
153
|
var Button = function(param) {
|
|
144
154
|
var disabled = param.disabled, onClick = param.onClick, text = param.text, id = param.id, className = param.className, style = param.style, children = param.children, _param_size = param.size, size = _param_size === void 0 ? BUTTON_SIZE_CLASSES[BUTTON_SIZE.SMALL] : _param_size;
|
|
145
|
-
var _React_useState = _sliced_to_array$
|
|
155
|
+
var _React_useState = _sliced_to_array$3(React.useState(false), 2), selected = _React_useState[0], setSelected = _React_useState[1];
|
|
146
156
|
var buttonState = Juce.getToggleState(id);
|
|
147
157
|
var handleClick = onClick ? onClick : function() {
|
|
148
158
|
setSelected(!selected);
|
|
@@ -308,15 +318,15 @@ styleInject(css_248z$6);
|
|
|
308
318
|
var css_248z$5 = ".Dropdown-button {\n font-size: 1rem;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: 8px;\n padding-left: 8px;\n cursor: pointer;\n vertical-align: middle;\n white-space: nowrap;\n text-decoration: none;\n text-transform: uppercase;\n text-align: center;\n color: #fff;\n background-color: #737373;\n border: 0;\n border-radius: 3px;\n appearance: none;\n user-select: none;\n height: 24px;\n}\n\n.Dropdown-button:hover,\n.Dropdown-button:focus,\n.Dropdown-button:active {\n outline: 0;\n}\n\n.Dropdown-button:hover {\n color: #eee;\n background-color: #606060;\n}\n\n.Dropdown-button:disabled,\n.Dropdown-button.disabled {\n cursor: not-allowed;\n color: #404040;\n background: #858585;\n}\n.Dropdown-button:disabled:hover,\n.Dropdown-button.disabled:hover {\n color: #404040;\n background: #858585;\n}\n\n.Dropdown-menu {\n background-color: #979797;\n z-index: 10;\n}\n\n.Dropdown-menu-item {\n font-family: \"Arial\", sans-serif;\n color: #fff;\n padding: 12px;\n background-color: #979797;\n cursor: pointer;\n}\n\n.Dropdown-menu-item:hover {\n background-color: #606060;\n}";
|
|
309
319
|
styleInject(css_248z$5);
|
|
310
320
|
|
|
311
|
-
function _array_like_to_array$
|
|
321
|
+
function _array_like_to_array$2(arr, len) {
|
|
312
322
|
if (len == null || len > arr.length) len = arr.length;
|
|
313
323
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
314
324
|
return arr2;
|
|
315
325
|
}
|
|
316
|
-
function _array_with_holes$
|
|
326
|
+
function _array_with_holes$2(arr) {
|
|
317
327
|
if (Array.isArray(arr)) return arr;
|
|
318
328
|
}
|
|
319
|
-
function _iterable_to_array_limit$
|
|
329
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
320
330
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
321
331
|
if (_i == null) return;
|
|
322
332
|
var _arr = [];
|
|
@@ -340,23 +350,23 @@ function _iterable_to_array_limit$1(arr, i) {
|
|
|
340
350
|
}
|
|
341
351
|
return _arr;
|
|
342
352
|
}
|
|
343
|
-
function _non_iterable_rest$
|
|
353
|
+
function _non_iterable_rest$2() {
|
|
344
354
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
345
355
|
}
|
|
346
|
-
function _sliced_to_array$
|
|
347
|
-
return _array_with_holes$
|
|
356
|
+
function _sliced_to_array$2(arr, i) {
|
|
357
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
348
358
|
}
|
|
349
|
-
function _unsupported_iterable_to_array$
|
|
359
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
350
360
|
if (!o) return;
|
|
351
|
-
if (typeof o === "string") return _array_like_to_array$
|
|
361
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
352
362
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
353
363
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
354
364
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
355
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$
|
|
365
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
356
366
|
}
|
|
357
367
|
var Dropdown = function(param) {
|
|
358
368
|
var items = param.items, className = param.className, id = param.id;
|
|
359
|
-
var _useState = _sliced_to_array$
|
|
369
|
+
var _useState = _sliced_to_array$2(useState(0), 2), selectedIndex = _useState[0], setSelectedIndex = _useState[1];
|
|
360
370
|
var dropdownState = Juce.getComboBoxState(id);
|
|
361
371
|
var handleChange = function(val) {
|
|
362
372
|
setSelectedIndex(val);
|
|
@@ -386,15 +396,37 @@ var Dropdown = function(param) {
|
|
|
386
396
|
var css_248z$4 = ".Knob {\n height: 50px;\n background-color: #737373;\n width: 50px;\n border-radius: 100%;\n position: relative;\n aspect-ratio: 1/1;\n}\n\n.Knob-inner {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n height: 100%;\n width: 100%;\n}\n\n.Knob-marker {\n position: absolute;\n top: 0;\n right: 0;\n left: 50%;\n width: 2px;\n height: 50%;\n border-radius: 125rem;\n background-color: #fff;\n transform: translate(-50%, 0) rotate(0) skewX(0) skewY(0) scaleX(1) scaleY(1);\n}";
|
|
387
397
|
styleInject(css_248z$4);
|
|
388
398
|
|
|
389
|
-
|
|
399
|
+
var css_248z$3 = ".TextLabel {\n font-family: \"Arial\", sans-serif;\n font-size: 14px;\n text-align: center;\n}";
|
|
400
|
+
styleInject(css_248z$3);
|
|
401
|
+
|
|
402
|
+
var TextLabel = function(param) {
|
|
403
|
+
var text = param.text, id = param.id, className = param.className, style = param.style, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
404
|
+
SPACING.NONE
|
|
405
|
+
] : _param_padding, children = param.children;
|
|
406
|
+
return /*#__PURE__*/ React.createElement("span", {
|
|
407
|
+
id: id,
|
|
408
|
+
style: style,
|
|
409
|
+
className: classnames('TextLabel', className, padding.length === 1 && 'padding-around-' + padding, padding.length === 2 && 'padding-vertical-' + padding[0], padding.length === 2 && 'padding-horizontal-' + padding[1], padding.length === 4 && 'padding-top-' + [
|
|
410
|
+
padding[0]
|
|
411
|
+
], padding.length === 4 && 'padding-right-' + [
|
|
412
|
+
padding[1]
|
|
413
|
+
], padding.length === 4 && 'padding-bottom-' + [
|
|
414
|
+
padding[2]
|
|
415
|
+
], padding.length === 4 && 'padding-left-' + [
|
|
416
|
+
padding[3]
|
|
417
|
+
])
|
|
418
|
+
}, text ? text : children);
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
function _array_like_to_array$1(arr, len) {
|
|
390
422
|
if (len == null || len > arr.length) len = arr.length;
|
|
391
423
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
392
424
|
return arr2;
|
|
393
425
|
}
|
|
394
|
-
function _array_with_holes(arr) {
|
|
426
|
+
function _array_with_holes$1(arr) {
|
|
395
427
|
if (Array.isArray(arr)) return arr;
|
|
396
428
|
}
|
|
397
|
-
function _iterable_to_array_limit(arr, i) {
|
|
429
|
+
function _iterable_to_array_limit$1(arr, i) {
|
|
398
430
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
399
431
|
if (_i == null) return;
|
|
400
432
|
var _arr = [];
|
|
@@ -418,31 +450,46 @@ function _iterable_to_array_limit(arr, i) {
|
|
|
418
450
|
}
|
|
419
451
|
return _arr;
|
|
420
452
|
}
|
|
421
|
-
function _non_iterable_rest() {
|
|
453
|
+
function _non_iterable_rest$1() {
|
|
422
454
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
423
455
|
}
|
|
424
|
-
function _sliced_to_array(arr, i) {
|
|
425
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
456
|
+
function _sliced_to_array$1(arr, i) {
|
|
457
|
+
return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
|
|
426
458
|
}
|
|
427
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
459
|
+
function _unsupported_iterable_to_array$1(o, minLen) {
|
|
428
460
|
if (!o) return;
|
|
429
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
461
|
+
if (typeof o === "string") return _array_like_to_array$1(o, minLen);
|
|
430
462
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
431
463
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
432
464
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
433
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
465
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
|
|
434
466
|
}
|
|
435
467
|
var Knob = function(param) {
|
|
436
|
-
var id = param.id, className = param.className;
|
|
437
|
-
var _useState = _sliced_to_array(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
438
|
-
// console.log(value, 'VALUE')
|
|
468
|
+
var label = param.label, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? POSITION.TOP : _param_labelPosition, _param_showValue = param.showValue, showValue = _param_showValue === void 0 ? true : _param_showValue, id = param.id, className = param.className;
|
|
469
|
+
var _useState = _sliced_to_array$1(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
439
470
|
useEffect(function() {
|
|
440
471
|
var knobState = Juce.getSliderState(id);
|
|
441
472
|
knobState.setNormalisedValue(Math.round(value) / 100);
|
|
442
473
|
}, [
|
|
443
474
|
value
|
|
444
475
|
]);
|
|
445
|
-
return /*#__PURE__*/ React__default.createElement(
|
|
476
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
|
477
|
+
style: {
|
|
478
|
+
display: 'flex',
|
|
479
|
+
flexDirection: 'column',
|
|
480
|
+
alignItems: 'center',
|
|
481
|
+
justifyContent: 'center'
|
|
482
|
+
}
|
|
483
|
+
}, label && /*#__PURE__*/ React__default.createElement(TextLabel, {
|
|
484
|
+
style: {
|
|
485
|
+
order: labelPosition === POSITION.BOTTOM ? 3 : 0
|
|
486
|
+
},
|
|
487
|
+
padding: [
|
|
488
|
+
SPACING.SMALL,
|
|
489
|
+
SPACING.NONE
|
|
490
|
+
],
|
|
491
|
+
text: label
|
|
492
|
+
}), /*#__PURE__*/ React__default.createElement(KnobHeadless, {
|
|
446
493
|
className: classnames('Knob', className),
|
|
447
494
|
id: id !== null && id !== void 0 ? id : 'Knob',
|
|
448
495
|
"aria-labelledby": "Knob",
|
|
@@ -455,7 +502,9 @@ var Knob = function(param) {
|
|
|
455
502
|
},
|
|
456
503
|
dragSensitivity: 0.009,
|
|
457
504
|
orientation: 'vertical',
|
|
458
|
-
onValueRawChange:
|
|
505
|
+
onValueRawChange: function(val) {
|
|
506
|
+
return setValue(Math.round(val));
|
|
507
|
+
}
|
|
459
508
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
460
509
|
className: "Knob-inner",
|
|
461
510
|
style: {
|
|
@@ -463,26 +512,109 @@ var Knob = function(param) {
|
|
|
463
512
|
}
|
|
464
513
|
}, /*#__PURE__*/ React__default.createElement("div", {
|
|
465
514
|
className: "Knob-marker"
|
|
466
|
-
})))
|
|
515
|
+
}))), showValue && /*#__PURE__*/ React__default.createElement(TextLabel, {
|
|
516
|
+
text: "".concat(value),
|
|
517
|
+
padding: [
|
|
518
|
+
SPACING.SMALL,
|
|
519
|
+
SPACING.NONE
|
|
520
|
+
]
|
|
521
|
+
}));
|
|
467
522
|
};
|
|
468
523
|
|
|
469
|
-
var css_248z$
|
|
470
|
-
styleInject(css_248z$
|
|
524
|
+
var css_248z$2 = ".Slider {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n}\n\n.track {\n background-color: #737373;\n}\n.horizontal .track {\n height: 12px;\n}\n.vertical .track {\n width: 12px;\n}\n\n.thumb {\n height: 12px;\n width: 12px;\n background-color: #404040;\n}";
|
|
525
|
+
styleInject(css_248z$2);
|
|
471
526
|
|
|
527
|
+
function _array_like_to_array(arr, len) {
|
|
528
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
529
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
530
|
+
return arr2;
|
|
531
|
+
}
|
|
532
|
+
function _array_with_holes(arr) {
|
|
533
|
+
if (Array.isArray(arr)) return arr;
|
|
534
|
+
}
|
|
535
|
+
function _iterable_to_array_limit(arr, i) {
|
|
536
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
537
|
+
if (_i == null) return;
|
|
538
|
+
var _arr = [];
|
|
539
|
+
var _n = true;
|
|
540
|
+
var _d = false;
|
|
541
|
+
var _s, _e;
|
|
542
|
+
try {
|
|
543
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
544
|
+
_arr.push(_s.value);
|
|
545
|
+
if (i && _arr.length === i) break;
|
|
546
|
+
}
|
|
547
|
+
} catch (err) {
|
|
548
|
+
_d = true;
|
|
549
|
+
_e = err;
|
|
550
|
+
} finally{
|
|
551
|
+
try {
|
|
552
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
553
|
+
} finally{
|
|
554
|
+
if (_d) throw _e;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
return _arr;
|
|
558
|
+
}
|
|
559
|
+
function _non_iterable_rest() {
|
|
560
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
561
|
+
}
|
|
562
|
+
function _sliced_to_array(arr, i) {
|
|
563
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
564
|
+
}
|
|
565
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
566
|
+
if (!o) return;
|
|
567
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
568
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
569
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
570
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
571
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
572
|
+
}
|
|
472
573
|
var Slider = function(param) {
|
|
473
|
-
var id = param.id, className = param.className;
|
|
574
|
+
var label = param.label, _param_labelPosition = param.labelPosition, labelPosition = _param_labelPosition === void 0 ? POSITION.TOP : _param_labelPosition, _param_orientation = param.orientation, orientation = _param_orientation === void 0 ? DIRECTION.VERTICAL : _param_orientation, _param_showValue = param.showValue, showValue = _param_showValue === void 0 ? true : _param_showValue, id = param.id, className = param.className;
|
|
575
|
+
var _useState = _sliced_to_array(useState(0), 2), value = _useState[0], setValue = _useState[1];
|
|
474
576
|
var handleChange = function(val) {
|
|
577
|
+
setValue(val);
|
|
475
578
|
var sliderState = Juce.getSliderState(id);
|
|
476
579
|
sliderState.setNormalisedValue(val / 100);
|
|
477
580
|
};
|
|
478
|
-
return /*#__PURE__*/
|
|
581
|
+
return /*#__PURE__*/ React__default.createElement("div", {
|
|
582
|
+
style: {
|
|
583
|
+
display: 'flex',
|
|
584
|
+
flexDirection: 'column',
|
|
585
|
+
alignItems: 'center',
|
|
586
|
+
justifyContent: 'center',
|
|
587
|
+
minWidth: orientation === DIRECTION.HORIZONTAL ? '100px' : 'auto',
|
|
588
|
+
minHeight: orientation === DIRECTION.VERTICAL ? '100px' : 'auto',
|
|
589
|
+
width: orientation === DIRECTION.HORIZONTAL ? '100%' : label ? '55px' : '12px',
|
|
590
|
+
height: orientation === DIRECTION.VERTICAL ? '100%' : '55px'
|
|
591
|
+
}
|
|
592
|
+
}, label && /*#__PURE__*/ React__default.createElement(TextLabel, {
|
|
593
|
+
style: {
|
|
594
|
+
order: labelPosition === POSITION.BOTTOM ? 3 : 0
|
|
595
|
+
},
|
|
596
|
+
padding: [
|
|
597
|
+
SPACING.SMALL,
|
|
598
|
+
SPACING.NONE
|
|
599
|
+
],
|
|
600
|
+
text: label
|
|
601
|
+
}), /*#__PURE__*/ React__default.createElement(ReactSlider, {
|
|
602
|
+
invert: orientation === DIRECTION.VERTICAL,
|
|
603
|
+
orientation: orientation,
|
|
479
604
|
onChange: handleChange,
|
|
480
|
-
className: classnames('Slider', className)
|
|
481
|
-
})
|
|
605
|
+
className: classnames('Slider', orientation === DIRECTION.HORIZONTAL ? 'horizontal' : 'vertical', className)
|
|
606
|
+
}), showValue && /*#__PURE__*/ React__default.createElement(TextLabel, {
|
|
607
|
+
// style={{ flex: 1 }}
|
|
608
|
+
text: "".concat(value),
|
|
609
|
+
padding: [
|
|
610
|
+
SPACING.SMALL,
|
|
611
|
+
SPACING.NONE
|
|
612
|
+
]
|
|
613
|
+
}));
|
|
482
614
|
};
|
|
483
615
|
|
|
484
|
-
var css_248z$
|
|
485
|
-
styleInject(css_248z$
|
|
616
|
+
var css_248z$1 = ".h1 {\n font-family: \"Arial\", sans-serif;\n font-size: 20px;\n font-weight: bold;\n}\n\n.h2 {\n font-family: \"Arial\", sans-serif;\n font-size: 16px;\n font-weight: bold;\n}";
|
|
617
|
+
styleInject(css_248z$1);
|
|
486
618
|
|
|
487
619
|
var TEXT_HEADER_LEVELS;
|
|
488
620
|
(function(TEXT_HEADER_LEVELS) {
|
|
@@ -510,28 +642,6 @@ var TextHeader = function(param) {
|
|
|
510
642
|
}, text ? text : children);
|
|
511
643
|
};
|
|
512
644
|
|
|
513
|
-
var css_248z$1 = ".TextLabel {\n font-family: \"Arial\", sans-serif;\n font-size: 16px;\n}";
|
|
514
|
-
styleInject(css_248z$1);
|
|
515
|
-
|
|
516
|
-
var TextLabel = function(param) {
|
|
517
|
-
var text = param.text, id = param.id, className = param.className, style = param.style, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
518
|
-
SPACING.NONE
|
|
519
|
-
] : _param_padding, children = param.children;
|
|
520
|
-
return /*#__PURE__*/ React.createElement("span", {
|
|
521
|
-
id: id,
|
|
522
|
-
style: style,
|
|
523
|
-
className: classnames('TextLabel', className, padding.length === 1 && 'padding-around-' + padding, padding.length === 2 && 'padding-vertical-' + padding[0], padding.length === 2 && 'padding-horizontal-' + padding[1], padding.length === 4 && 'padding-top-' + [
|
|
524
|
-
padding[0]
|
|
525
|
-
], padding.length === 4 && 'padding-right-' + [
|
|
526
|
-
padding[1]
|
|
527
|
-
], padding.length === 4 && 'padding-bottom-' + [
|
|
528
|
-
padding[2]
|
|
529
|
-
], padding.length === 4 && 'padding-left-' + [
|
|
530
|
-
padding[3]
|
|
531
|
-
])
|
|
532
|
-
}, text ? text : children);
|
|
533
|
-
};
|
|
534
|
-
|
|
535
645
|
var css_248z = ".Layout {\n display: flex;\n width: 100%;\n}\n.Layout.gap-xsmall {\n column-gap: 2px;\n}\n.Layout.gap-small {\n column-gap: 4px;\n}\n.Layout.gap-mediumsmall {\n column-gap: 8px;\n}\n.Layout.gap-medium {\n column-gap: 12px;\n}\n.Layout.gap-mediumlarge {\n column-gap: 16px;\n}\n.Layout.gap-large {\n column-gap: 20px;\n}\n.Layout.gap-xlarge {\n column-gap: 24px;\n}";
|
|
536
646
|
styleInject(css_248z);
|
|
537
647
|
|
|
@@ -582,13 +692,8 @@ function _object_spread_props(target, source) {
|
|
|
582
692
|
}
|
|
583
693
|
return target;
|
|
584
694
|
}
|
|
585
|
-
var DIRECTION;
|
|
586
|
-
(function(DIRECTION) {
|
|
587
|
-
DIRECTION["VETICAL"] = "vertical";
|
|
588
|
-
DIRECTION["HORIZONTAL"] = "horizontal";
|
|
589
|
-
})(DIRECTION || (DIRECTION = {}));
|
|
590
695
|
var Layout = function(param) {
|
|
591
|
-
var centerHorizontal = param.centerHorizontal, centerVertical = param.centerVertical, className = param.className, style = param.style, children = param.children, _param_width = param.width, width = _param_width === void 0 ? '100%' : _param_width, _param_direction = param.direction, direction = _param_direction === void 0 ?
|
|
696
|
+
var centerHorizontal = param.centerHorizontal, centerVertical = param.centerVertical, className = param.className, style = param.style, children = param.children, _param_width = param.width, width = _param_width === void 0 ? '100%' : _param_width, _param_height = param.height, height = _param_height === void 0 ? '100%' : _param_height, _param_border = param.border, border = _param_border === void 0 ? false : _param_border, _param_direction = param.direction, direction = _param_direction === void 0 ? DIRECTION.HORIZONTAL : _param_direction, _param_padding = param.padding, padding = _param_padding === void 0 ? [
|
|
592
697
|
SPACING.NONE,
|
|
593
698
|
SPACING.NONE,
|
|
594
699
|
SPACING.MEDIUM,
|
|
@@ -605,13 +710,15 @@ var Layout = function(param) {
|
|
|
605
710
|
padding[3]
|
|
606
711
|
]),
|
|
607
712
|
style: _object_spread_props(_object_spread({}, style), {
|
|
713
|
+
border: border ? '2px solid #999' : '',
|
|
608
714
|
maxWidth: width,
|
|
609
|
-
|
|
715
|
+
height: height,
|
|
716
|
+
flexDirection: direction === DIRECTION.HORIZONTAL ? 'row' : 'column',
|
|
610
717
|
justifyContent: centerHorizontal ? 'center' : 'flex-start',
|
|
611
718
|
alignItems: centerVertical ? 'center' : 'flex-start'
|
|
612
719
|
})
|
|
613
720
|
}, children);
|
|
614
721
|
};
|
|
615
722
|
|
|
616
|
-
export { Button, Col, DIRECTION, Dropdown, FLEX_DIRECTION, SPACING as GRID_SPACING, Knob, Layout, Row, SPACING, Slider, TEXT_HEADER_LEVELS, Tabs, TextHeader, TextLabel };
|
|
723
|
+
export { Button, Col, DIRECTION, Dropdown, FLEX_DIRECTION, SPACING as GRID_SPACING, Knob, Layout, POSITION, Row, SPACING, Slider, TEXT_HEADER_LEVELS, Tabs, TextHeader, TextLabel };
|
|
617
724
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var 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\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var 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\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
|