atenea-components 1.4.20 → 1.4.23
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/components/atoms/RangeSlider.d.ts +16 -0
- package/dist/components/atoms/RangeSlider.js +23 -0
- package/dist/components/icons/IconSleep1.js +16 -2
- package/dist/components/icons/IconSleep2.js +16 -2
- package/dist/components/icons/IconSleep3.js +16 -2
- package/dist/components/icons/IconSleep4.js +16 -2
- package/dist/components/icons/IconSleep5.js +16 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type RangeSliderProps = {
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
step?: number;
|
|
6
|
+
value: number;
|
|
7
|
+
onChange?: (value: number) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
minLabel?: React.ReactNode;
|
|
10
|
+
maxLabel?: React.ReactNode;
|
|
11
|
+
valueFormat?: (value: number) => string;
|
|
12
|
+
showValue?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const RangeSlider: React.ForwardRefExoticComponent<RangeSliderProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RangeSlider = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
10
|
+
exports.RangeSlider = (0, react_1.forwardRef)(({ min, max, step = 1, value, onChange, disabled = false, minLabel, maxLabel, valueFormat = (v) => String(v), showValue = true, className = "", id, }, ref) => {
|
|
11
|
+
const percentage = max > min ? ((value - min) / (max - min)) * 100 : 0;
|
|
12
|
+
const handleChange = (e) => {
|
|
13
|
+
if (!disabled && onChange) {
|
|
14
|
+
const next = parseFloat(e.target.value);
|
|
15
|
+
onChange(Number.isNaN(next) ? min : next);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, clsx_1.default)("relative pb-10", className), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between mb-2 text-base font-normal leading-6 text-gray-400 align-middle", children: [(0, jsx_runtime_1.jsx)("span", { children: minLabel !== null && minLabel !== void 0 ? minLabel : min }), (0, jsx_runtime_1.jsx)("span", { children: maxLabel !== null && maxLabel !== void 0 ? maxLabel : max })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative h-1.5 bg-gray-100 rounded-full", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 left-0 h-full bg-primary-400 rounded-full transition-[width] duration-150", style: { width: `${percentage}%` } }), (0, jsx_runtime_1.jsx)("input", { ref: ref, type: "range", id: id, min: min, max: max, step: step, value: value, onChange: handleChange, disabled: disabled, className: "absolute top-1/2 -translate-y-1/2 left-0 w-full opacity-0 cursor-pointer z-10 h-6 disabled:cursor-not-allowed", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value }), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-1/2 -translate-y-1/2 w-6 h-6 bg-primary-400 rounded-full border-2 border-white pointer-events-none transition-all duration-150", style: { left: `calc(${percentage}% - 12px)` } })] }), showValue && ((0, jsx_runtime_1.jsx)("span", { className: "absolute -translate-x-1/2 text-2xl font-semibold leading-7 text-primary-500 align-middle", style: {
|
|
19
|
+
left: `${percentage}%`,
|
|
20
|
+
top: "calc(100% - 28px)",
|
|
21
|
+
}, children: valueFormat(value) }))] }));
|
|
22
|
+
});
|
|
23
|
+
exports.RangeSlider.displayName = "RangeSlider";
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.IconSleep1 = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lu_1 = require("react-icons/lu");
|
|
6
16
|
const IconBase_1 = require("./IconBase");
|
|
17
|
+
const Icon = (_a) => {
|
|
18
|
+
var { size = 20, color = 'currentColor', className } = _a, rest = __rest(_a, ["size", "color", "className"]);
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("svg", Object.assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className }, rest, { children: (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: "2", fill: "none" }) })));
|
|
20
|
+
};
|
|
7
21
|
const IconSleep1 = (props) => {
|
|
8
|
-
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon:
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon: Icon }, props));
|
|
9
23
|
};
|
|
10
24
|
exports.IconSleep1 = IconSleep1;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.IconSleep2 = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lu_1 = require("react-icons/lu");
|
|
6
16
|
const IconBase_1 = require("./IconBase");
|
|
17
|
+
const Icon = (_a) => {
|
|
18
|
+
var { size = 20, color = 'currentColor', className } = _a, rest = __rest(_a, ["size", "color", "className"]);
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className }, rest, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: "2", fill: "none" }), (0, jsx_runtime_1.jsx)("path", { d: "M 12 12 L 22 12 A 10 10 0 0 1 12 22 Z", fill: color })] })));
|
|
20
|
+
};
|
|
7
21
|
const IconSleep2 = (props) => {
|
|
8
|
-
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon:
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon: Icon }, props));
|
|
9
23
|
};
|
|
10
24
|
exports.IconSleep2 = IconSleep2;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.IconSleep3 = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lu_1 = require("react-icons/lu");
|
|
6
16
|
const IconBase_1 = require("./IconBase");
|
|
17
|
+
const Icon = (_a) => {
|
|
18
|
+
var { size = 20, color = 'currentColor', className } = _a, rest = __rest(_a, ["size", "color", "className"]);
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className }, rest, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: "2", fill: "none" }), (0, jsx_runtime_1.jsx)("path", { d: "M 12 12 L 22 12 A 10 10 0 0 1 2 12 Z", fill: color })] })));
|
|
20
|
+
};
|
|
7
21
|
const IconSleep3 = (props) => {
|
|
8
|
-
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon:
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon: Icon }, props));
|
|
9
23
|
};
|
|
10
24
|
exports.IconSleep3 = IconSleep3;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.IconSleep4 = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lu_1 = require("react-icons/lu");
|
|
6
16
|
const IconBase_1 = require("./IconBase");
|
|
17
|
+
const Icon = (_a) => {
|
|
18
|
+
var { size = 20, color = 'currentColor', className } = _a, rest = __rest(_a, ["size", "color", "className"]);
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className }, rest, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: color, strokeWidth: "2", fill: "none" }), (0, jsx_runtime_1.jsx)("path", { d: "M 12 12 L 22 12 A 10 10 0 0 1 2 12 A 10 10 0 0 1 12 2 Z", fill: color })] })));
|
|
20
|
+
};
|
|
7
21
|
const IconSleep4 = (props) => {
|
|
8
|
-
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon:
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon: Icon }, props));
|
|
9
23
|
};
|
|
10
24
|
exports.IconSleep4 = IconSleep4;
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.IconSleep5 = void 0;
|
|
4
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const lu_1 = require("react-icons/lu");
|
|
6
16
|
const IconBase_1 = require("./IconBase");
|
|
17
|
+
const Icon = (_a) => {
|
|
18
|
+
var { size = 20, color = 'currentColor', className } = _a, rest = __rest(_a, ["size", "color", "className"]);
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("svg", Object.assign({ width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className }, rest, { children: (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10", fill: color }) })));
|
|
20
|
+
};
|
|
7
21
|
const IconSleep5 = (props) => {
|
|
8
|
-
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon:
|
|
22
|
+
return (0, jsx_runtime_1.jsx)(IconBase_1.IconBase, Object.assign({ icon: Icon }, props));
|
|
9
23
|
};
|
|
10
24
|
exports.IconSleep5 = IconSleep5;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./components/atoms/SelectDropdown";
|
|
|
5
5
|
export * from "./components/atoms/ActionDropdown";
|
|
6
6
|
export * from "./components/atoms/Checkbox";
|
|
7
7
|
export * from "./components/atoms/Radio";
|
|
8
|
+
export * from "./components/atoms/RangeSlider";
|
|
8
9
|
export * from "./components/atoms/Toggle";
|
|
9
10
|
export * from "./components/atoms/ListItem";
|
|
10
11
|
export * from "./components/atoms/IntroIllustration";
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ tslib_1.__exportStar(require("./components/atoms/SelectDropdown"), exports);
|
|
|
11
11
|
tslib_1.__exportStar(require("./components/atoms/ActionDropdown"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./components/atoms/Checkbox"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./components/atoms/Radio"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./components/atoms/RangeSlider"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./components/atoms/Toggle"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./components/atoms/ListItem"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./components/atoms/IntroIllustration"), exports);
|