@chayns-components/core 5.0.0-beta.409 → 5.0.0-beta.410
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/slider-button/SliderButton.d.ts +23 -0
- package/lib/components/slider-button/SliderButton.js +156 -0
- package/lib/components/slider-button/SliderButton.js.map +1 -0
- package/lib/components/slider-button/SliderButton.styles.d.ts +279 -0
- package/lib/components/slider-button/SliderButton.styles.js +69 -0
- package/lib/components/slider-button/SliderButton.styles.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -1
- package/lib/types/slider-button.d.ts +4 -0
- package/lib/types/slider-button.js +2 -0
- package/lib/types/slider-button.js.map +1 -0
- package/lib/utils/calculate.d.ts +2 -0
- package/lib/utils/calculate.js +25 -1
- package/lib/utils/calculate.js.map +1 -1
- package/lib/utils/sliderButton.d.ts +15 -0
- package/lib/utils/sliderButton.js +53 -0
- package/lib/utils/sliderButton.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { SliderButtonItem } from '../../types/slider-button';
|
|
3
|
+
export type SliderButtonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the button is disabled.
|
|
6
|
+
*/
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Function to be executed when a button is selected.
|
|
10
|
+
* @param id
|
|
11
|
+
*/
|
|
12
|
+
onChange?: (id: string) => void;
|
|
13
|
+
/**
|
|
14
|
+
* The buttons that are slidable.
|
|
15
|
+
*/
|
|
16
|
+
items: SliderButtonItem[];
|
|
17
|
+
/**
|
|
18
|
+
* The id of a button that should be selected.
|
|
19
|
+
*/
|
|
20
|
+
selectedButtonId?: string;
|
|
21
|
+
};
|
|
22
|
+
declare const SliderButton: FC<SliderButtonProps>;
|
|
23
|
+
export default SliderButton;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _SliderButton = require("./SliderButton.styles");
|
|
9
|
+
var _framerMotion = require("framer-motion");
|
|
10
|
+
var _calculate = require("../../utils/calculate");
|
|
11
|
+
var _sliderButton = require("../../utils/sliderButton");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const SliderButton = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
selectedButtonId,
|
|
17
|
+
isDisabled,
|
|
18
|
+
items,
|
|
19
|
+
onChange
|
|
20
|
+
} = _ref;
|
|
21
|
+
const [selectedButton, setSelectedButton] = (0, _react.useState)(undefined);
|
|
22
|
+
const [dragRange, setDragRange] = (0, _react.useState)({
|
|
23
|
+
left: 0,
|
|
24
|
+
right: 0
|
|
25
|
+
});
|
|
26
|
+
const sliderButtonRef = (0, _react.useRef)(null);
|
|
27
|
+
const [scope, animate] = (0, _framerMotion.useAnimate)();
|
|
28
|
+
(0, _react.useEffect)(() => {
|
|
29
|
+
if (selectedButtonId) {
|
|
30
|
+
setSelectedButton(selectedButtonId);
|
|
31
|
+
} else {
|
|
32
|
+
setSelectedButton(items[0]?.id);
|
|
33
|
+
}
|
|
34
|
+
}, [items, selectedButtonId]);
|
|
35
|
+
const itemWidth = (0, _react.useMemo)(() => (0, _calculate.calculateBiggestWidth)(items), [items]);
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
if (sliderButtonRef.current) {
|
|
38
|
+
setDragRange({
|
|
39
|
+
left: 0,
|
|
40
|
+
right: sliderButtonRef.current.offsetWidth - itemWidth
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, [itemWidth]);
|
|
44
|
+
const animation = (0, _react.useCallback)(async x => {
|
|
45
|
+
await animate(scope.current, {
|
|
46
|
+
x
|
|
47
|
+
}, {
|
|
48
|
+
type: 'tween',
|
|
49
|
+
duration: 0.2
|
|
50
|
+
});
|
|
51
|
+
}, [animate, scope]);
|
|
52
|
+
const handleClick = (0, _react.useCallback)((id, index) => {
|
|
53
|
+
if (isDisabled) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setSelectedButton(id);
|
|
57
|
+
if (typeof onChange === 'function') {
|
|
58
|
+
onChange(id);
|
|
59
|
+
}
|
|
60
|
+
void animation(itemWidth * index);
|
|
61
|
+
}, [animation, isDisabled, itemWidth, onChange]);
|
|
62
|
+
const buttons = (0, _react.useMemo)(() => {
|
|
63
|
+
const list = [];
|
|
64
|
+
items.forEach((_ref2, index) => {
|
|
65
|
+
let {
|
|
66
|
+
id,
|
|
67
|
+
text
|
|
68
|
+
} = _ref2;
|
|
69
|
+
list.push( /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
|
|
70
|
+
width: itemWidth,
|
|
71
|
+
key: `slider-button-${id}`,
|
|
72
|
+
onClick: () => handleClick(id, index),
|
|
73
|
+
isSelected: id === selectedButton
|
|
74
|
+
}, text));
|
|
75
|
+
});
|
|
76
|
+
return list;
|
|
77
|
+
}, [handleClick, itemWidth, items, selectedButton]);
|
|
78
|
+
const thumbText = (0, _react.useMemo)(() => {
|
|
79
|
+
const selectedItem = items.find(_ref3 => {
|
|
80
|
+
let {
|
|
81
|
+
id
|
|
82
|
+
} = _ref3;
|
|
83
|
+
return id === selectedButton;
|
|
84
|
+
});
|
|
85
|
+
return selectedItem ? selectedItem.text : '';
|
|
86
|
+
}, [items, selectedButton]);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Creates an array with the snap points relative to the width of the items
|
|
90
|
+
*/
|
|
91
|
+
const snapPoints = (0, _react.useMemo)(() => {
|
|
92
|
+
const points = [0];
|
|
93
|
+
for (let i = 1; i < items.length; i++) {
|
|
94
|
+
points.push(itemWidth * i);
|
|
95
|
+
}
|
|
96
|
+
return points;
|
|
97
|
+
}, [itemWidth, items.length]);
|
|
98
|
+
const handleDragEnd = (0, _react.useCallback)(() => {
|
|
99
|
+
const position = (0, _sliderButton.getThumbPosition)({
|
|
100
|
+
scope,
|
|
101
|
+
itemWidth
|
|
102
|
+
});
|
|
103
|
+
if (!position) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const {
|
|
107
|
+
nearestPoint,
|
|
108
|
+
nearestIndex
|
|
109
|
+
} = (0, _sliderButton.getNearestPoint)({
|
|
110
|
+
snapPoints,
|
|
111
|
+
position
|
|
112
|
+
});
|
|
113
|
+
if (nearestPoint >= 0 && nearestIndex >= 0) {
|
|
114
|
+
void animation(nearestPoint);
|
|
115
|
+
const id = items[nearestIndex]?.id;
|
|
116
|
+
if (typeof onChange === 'function' && id) {
|
|
117
|
+
onChange(id);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, [animation, itemWidth, items, onChange, scope, snapPoints]);
|
|
121
|
+
const handleWhileDrag = (0, _react.useCallback)(() => {
|
|
122
|
+
const position = (0, _sliderButton.getThumbPosition)({
|
|
123
|
+
scope,
|
|
124
|
+
itemWidth
|
|
125
|
+
});
|
|
126
|
+
if (!position) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const {
|
|
130
|
+
nearestIndex
|
|
131
|
+
} = (0, _sliderButton.getNearestPoint)({
|
|
132
|
+
snapPoints,
|
|
133
|
+
position
|
|
134
|
+
});
|
|
135
|
+
if (nearestIndex >= 0) {
|
|
136
|
+
setSelectedButton(items[nearestIndex]?.id);
|
|
137
|
+
}
|
|
138
|
+
}, [itemWidth, items, scope, snapPoints]);
|
|
139
|
+
return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButton, {
|
|
140
|
+
isDisabled: isDisabled,
|
|
141
|
+
ref: sliderButtonRef
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, buttons, /*#__PURE__*/_react.default.createElement(_SliderButton.StyledMotionSliderButtonThumb, {
|
|
143
|
+
ref: scope,
|
|
144
|
+
drag: isDisabled ? false : 'x',
|
|
145
|
+
dragElastic: 0,
|
|
146
|
+
dragConstraints: {
|
|
147
|
+
...dragRange
|
|
148
|
+
},
|
|
149
|
+
width: itemWidth,
|
|
150
|
+
onDrag: handleWhileDrag,
|
|
151
|
+
onDragEnd: handleDragEnd
|
|
152
|
+
}, thumbText))), [buttons, dragRange, handleDragEnd, handleWhileDrag, isDisabled, itemWidth, scope, thumbText]);
|
|
153
|
+
};
|
|
154
|
+
SliderButton.displayName = 'SliderButton';
|
|
155
|
+
var _default = exports.default = SliderButton;
|
|
156
|
+
//# sourceMappingURL=SliderButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderButton.js","names":["_react","_interopRequireWildcard","require","_SliderButton","_framerMotion","_calculate","_sliderButton","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","SliderButton","_ref","selectedButtonId","isDisabled","items","onChange","selectedButton","setSelectedButton","useState","undefined","dragRange","setDragRange","left","right","sliderButtonRef","useRef","scope","animate","useAnimate","useEffect","id","itemWidth","useMemo","calculateBiggestWidth","current","offsetWidth","animation","useCallback","x","type","duration","handleClick","index","buttons","list","forEach","_ref2","text","push","createElement","StyledSliderButtonItem","width","key","onClick","isSelected","thumbText","selectedItem","find","_ref3","snapPoints","points","length","handleDragEnd","position","getThumbPosition","nearestPoint","nearestIndex","getNearestPoint","handleWhileDrag","StyledSliderButton","ref","AnimatePresence","StyledMotionSliderButtonThumb","drag","dragElastic","dragConstraints","onDrag","onDragEnd","displayName","_default","exports"],"sources":["../../../src/components/slider-button/SliderButton.tsx"],"sourcesContent":["import React, {\n FC,\n type ReactElement,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n StyledMotionSliderButtonThumb,\n StyledSliderButton,\n StyledSliderButtonItem,\n} from './SliderButton.styles';\nimport type { SliderButtonItem } from '../../types/slider-button';\nimport { AnimatePresence, useAnimate } from 'framer-motion';\nimport { calculateBiggestWidth } from '../../utils/calculate';\nimport { getNearestPoint, getThumbPosition } from '../../utils/sliderButton';\n\nexport type SliderButtonProps = {\n /**\n * Whether the button is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function to be executed when a button is selected.\n * @param id\n */\n onChange?: (id: string) => void;\n /**\n * The buttons that are slidable.\n */\n items: SliderButtonItem[];\n /**\n * The id of a button that should be selected.\n */\n selectedButtonId?: string;\n};\n\nconst SliderButton: FC<SliderButtonProps> = ({ selectedButtonId, isDisabled, items, onChange }) => {\n const [selectedButton, setSelectedButton] = useState<string | undefined>(undefined);\n const [dragRange, setDragRange] = useState({ left: 0, right: 0 });\n\n const sliderButtonRef = useRef<HTMLDivElement>(null);\n\n const [scope, animate] = useAnimate();\n\n useEffect(() => {\n if (selectedButtonId) {\n setSelectedButton(selectedButtonId);\n } else {\n setSelectedButton(items[0]?.id);\n }\n }, [items, selectedButtonId]);\n\n const itemWidth = useMemo(() => calculateBiggestWidth(items), [items]);\n\n useEffect(() => {\n if (sliderButtonRef.current) {\n setDragRange({ left: 0, right: sliderButtonRef.current.offsetWidth - itemWidth });\n }\n }, [itemWidth]);\n\n const animation = useCallback(\n async (x: number) => {\n await animate(\n scope.current,\n { x },\n {\n type: 'tween',\n duration: 0.2,\n },\n );\n },\n [animate, scope],\n );\n\n const handleClick = useCallback(\n (id: string, index: number) => {\n if (isDisabled) {\n return;\n }\n\n setSelectedButton(id);\n\n if (typeof onChange === 'function') {\n onChange(id);\n }\n\n void animation(itemWidth * index);\n },\n [animation, isDisabled, itemWidth, onChange],\n );\n\n const buttons = useMemo(() => {\n const list: ReactElement[] = [];\n\n items.forEach(({ id, text }, index) => {\n list.push(\n <StyledSliderButtonItem\n width={itemWidth}\n key={`slider-button-${id}`}\n onClick={() => handleClick(id, index)}\n isSelected={id === selectedButton}\n >\n {text}\n </StyledSliderButtonItem>,\n );\n });\n\n return list;\n }, [handleClick, itemWidth, items, selectedButton]);\n\n const thumbText = useMemo(() => {\n const selectedItem = items.find(({ id }) => id === selectedButton);\n\n return selectedItem ? selectedItem.text : '';\n }, [items, selectedButton]);\n\n /**\n * Creates an array with the snap points relative to the width of the items\n */\n const snapPoints = useMemo(() => {\n const points = [0];\n\n for (let i = 1; i < items.length; i++) {\n points.push(itemWidth * i);\n }\n\n return points;\n }, [itemWidth, items.length]);\n\n const handleDragEnd = useCallback(() => {\n const position = getThumbPosition({ scope, itemWidth });\n\n if (!position) {\n return;\n }\n\n const { nearestPoint, nearestIndex } = getNearestPoint({ snapPoints, position });\n\n if (nearestPoint >= 0 && nearestIndex >= 0) {\n void animation(nearestPoint);\n\n const id = items[nearestIndex]?.id;\n\n if (typeof onChange === 'function' && id) {\n onChange(id);\n }\n }\n }, [animation, itemWidth, items, onChange, scope, snapPoints]);\n\n const handleWhileDrag = useCallback(() => {\n const position = getThumbPosition({ scope, itemWidth });\n\n if (!position) {\n return;\n }\n\n const { nearestIndex } = getNearestPoint({ snapPoints, position });\n\n if (nearestIndex >= 0) {\n setSelectedButton(items[nearestIndex]?.id);\n }\n }, [itemWidth, items, scope, snapPoints]);\n\n return useMemo(\n () => (\n <StyledSliderButton isDisabled={isDisabled} ref={sliderButtonRef}>\n <AnimatePresence>\n {buttons}\n <StyledMotionSliderButtonThumb\n ref={scope}\n drag={isDisabled ? false : 'x'}\n dragElastic={0}\n dragConstraints={{ ...dragRange }}\n width={itemWidth}\n onDrag={handleWhileDrag}\n onDragEnd={handleDragEnd}\n >\n {thumbText}\n </StyledMotionSliderButtonThumb>\n </AnimatePresence>\n </StyledSliderButton>\n ),\n [\n buttons,\n dragRange,\n handleDragEnd,\n handleWhileDrag,\n isDisabled,\n itemWidth,\n scope,\n thumbText,\n ],\n );\n};\n\nSliderButton.displayName = 'SliderButton';\n\nexport default SliderButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AASA,IAAAC,aAAA,GAAAD,OAAA;AAMA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAA6E,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,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AAqF,eAAe,QACX5B,OAAO,eACR7D,MAAA,CAAAa,OAAA,CAAAsD,aAAA,CAAChE,aAAA,CAAAuF,6BAA6B;IAC1BF,GAAG,EAAE5C,KAAM;IACX+C,IAAI,EAAE5D,UAAU,GAAG,KAAK,GAAG,GAAI;IAC/B6D,WAAW,EAAE,CAAE;IACfC,eAAe,EAAE;MAAE,GAAGvD;IAAU,CAAE;IAClC+B,KAAK,EAAEpB,SAAU;IACjB6C,MAAM,EAAER,eAAgB;IACxBS,SAAS,EAAEf;EAAc,GAExBP,SAC0B,CAClB,CACD,CACvB,EACD,CACIZ,OAAO,EACPvB,SAAS,EACT0C,aAAa,EACbM,eAAe,EACfvD,UAAU,EACVkB,SAAS,EACTL,KAAK,EACL6B,SAAS,CAEjB,CAAC;AACL,CAAC;AAED7C,YAAY,CAACoE,WAAW,GAAG,cAAc;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArF,OAAA,GAE3Be,YAAY"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';
|
|
4
|
+
type StyledSliderButtonProps = WithTheme<{
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const StyledSliderButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderButtonProps>>;
|
|
8
|
+
type StyledSliderButtonItemProps = WithTheme<{
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
width: number;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const StyledSliderButtonItem: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledSliderButtonItemProps>>;
|
|
13
|
+
type StyledMotionSliderButtonThumbProps = WithTheme<{
|
|
14
|
+
width: number;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const StyledMotionSliderButtonThumb: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<{
|
|
17
|
+
slot?: string | undefined;
|
|
18
|
+
title?: string | undefined;
|
|
19
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
20
|
+
defaultChecked?: boolean | undefined;
|
|
21
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
22
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
23
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
24
|
+
accessKey?: string | undefined;
|
|
25
|
+
autoFocus?: boolean | undefined;
|
|
26
|
+
className?: string | undefined;
|
|
27
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
28
|
+
contextMenu?: string | undefined;
|
|
29
|
+
dir?: string | undefined;
|
|
30
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
31
|
+
hidden?: boolean | undefined;
|
|
32
|
+
id?: string | undefined;
|
|
33
|
+
lang?: string | undefined;
|
|
34
|
+
nonce?: string | undefined;
|
|
35
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
36
|
+
tabIndex?: number | undefined;
|
|
37
|
+
translate?: "yes" | "no" | undefined;
|
|
38
|
+
radioGroup?: string | undefined;
|
|
39
|
+
role?: import("react").AriaRole | undefined;
|
|
40
|
+
about?: string | undefined;
|
|
41
|
+
content?: string | undefined;
|
|
42
|
+
datatype?: string | undefined;
|
|
43
|
+
inlist?: any;
|
|
44
|
+
prefix?: string | undefined;
|
|
45
|
+
property?: string | undefined;
|
|
46
|
+
rel?: string | undefined;
|
|
47
|
+
resource?: string | undefined;
|
|
48
|
+
rev?: string | undefined;
|
|
49
|
+
typeof?: string | undefined;
|
|
50
|
+
vocab?: string | undefined;
|
|
51
|
+
autoCapitalize?: string | undefined;
|
|
52
|
+
autoCorrect?: string | undefined;
|
|
53
|
+
autoSave?: string | undefined;
|
|
54
|
+
color?: string | undefined;
|
|
55
|
+
itemProp?: string | undefined;
|
|
56
|
+
itemScope?: boolean | undefined;
|
|
57
|
+
itemType?: string | undefined;
|
|
58
|
+
itemID?: string | undefined;
|
|
59
|
+
itemRef?: string | undefined;
|
|
60
|
+
results?: number | undefined;
|
|
61
|
+
security?: string | undefined;
|
|
62
|
+
unselectable?: "on" | "off" | undefined;
|
|
63
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
64
|
+
is?: string | undefined;
|
|
65
|
+
"aria-activedescendant"?: string | undefined;
|
|
66
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
67
|
+
"aria-autocomplete"?: "list" | "none" | "both" | "inline" | undefined;
|
|
68
|
+
"aria-braillelabel"?: string | undefined;
|
|
69
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
70
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
71
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
72
|
+
"aria-colcount"?: number | undefined;
|
|
73
|
+
"aria-colindex"?: number | undefined;
|
|
74
|
+
"aria-colindextext"?: string | undefined;
|
|
75
|
+
"aria-colspan"?: number | undefined;
|
|
76
|
+
"aria-controls"?: string | undefined;
|
|
77
|
+
"aria-current"?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
|
|
78
|
+
"aria-describedby"?: string | undefined;
|
|
79
|
+
"aria-description"?: string | undefined;
|
|
80
|
+
"aria-details"?: string | undefined;
|
|
81
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
82
|
+
"aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
83
|
+
"aria-errormessage"?: string | undefined;
|
|
84
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
85
|
+
"aria-flowto"?: string | undefined;
|
|
86
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
88
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
89
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
90
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
91
|
+
"aria-label"?: string | undefined;
|
|
92
|
+
"aria-labelledby"?: string | undefined;
|
|
93
|
+
"aria-level"?: number | undefined;
|
|
94
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
95
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
96
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
97
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
98
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
99
|
+
"aria-owns"?: string | undefined;
|
|
100
|
+
"aria-placeholder"?: string | undefined;
|
|
101
|
+
"aria-posinset"?: number | undefined;
|
|
102
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
103
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
104
|
+
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
105
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
106
|
+
"aria-roledescription"?: string | undefined;
|
|
107
|
+
"aria-rowcount"?: number | undefined;
|
|
108
|
+
"aria-rowindex"?: number | undefined;
|
|
109
|
+
"aria-rowindextext"?: string | undefined;
|
|
110
|
+
"aria-rowspan"?: number | undefined;
|
|
111
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
112
|
+
"aria-setsize"?: number | undefined;
|
|
113
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
114
|
+
"aria-valuemax"?: number | undefined;
|
|
115
|
+
"aria-valuemin"?: number | undefined;
|
|
116
|
+
"aria-valuenow"?: number | undefined;
|
|
117
|
+
"aria-valuetext"?: string | undefined;
|
|
118
|
+
dangerouslySetInnerHTML?: {
|
|
119
|
+
__html: string | TrustedHTML;
|
|
120
|
+
} | undefined;
|
|
121
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
122
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
123
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
124
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
125
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
126
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
127
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
128
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
129
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
130
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
131
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
132
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
133
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
223
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
224
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
225
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
226
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
227
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
228
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
229
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
230
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
231
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
233
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
234
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
235
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
236
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
237
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
238
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
239
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
240
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
241
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
242
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
243
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
244
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
245
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
246
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
247
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
248
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
249
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
250
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
252
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
253
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
254
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
255
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
256
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
257
|
+
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
258
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
259
|
+
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
260
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
261
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
262
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
263
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
264
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
265
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
266
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
267
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
268
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
269
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
270
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
271
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
272
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
273
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
274
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
275
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
276
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
277
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
278
|
+
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement>, StyledMotionSliderButtonThumbProps>> & Omit<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
279
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledSliderButtonItem = exports.StyledSliderButton = exports.StyledMotionSliderButtonThumb = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _framerMotion = require("framer-motion");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const StyledSliderButton = exports.StyledSliderButton = _styledComponents.default.div`
|
|
11
|
+
align-items: center;
|
|
12
|
+
background-color: ${_ref => {
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
return theme['404'];
|
|
17
|
+
}};
|
|
18
|
+
border-radius: 3px;
|
|
19
|
+
box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);
|
|
20
|
+
border: none;
|
|
21
|
+
color: white;
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
line-height: 1.15;
|
|
25
|
+
min-height: 32px;
|
|
26
|
+
opacity: ${_ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
isDisabled
|
|
29
|
+
} = _ref2;
|
|
30
|
+
return isDisabled ? 0.5 : 1;
|
|
31
|
+
}};
|
|
32
|
+
position: relative;
|
|
33
|
+
user-select: none;
|
|
34
|
+
transition: opacity 0.3s ease;
|
|
35
|
+
z-index: 1;
|
|
36
|
+
`;
|
|
37
|
+
const StyledSliderButtonItem = exports.StyledSliderButtonItem = _styledComponents.default.div`
|
|
38
|
+
padding: 7px 12px;
|
|
39
|
+
width: ${_ref3 => {
|
|
40
|
+
let {
|
|
41
|
+
width
|
|
42
|
+
} = _ref3;
|
|
43
|
+
return width;
|
|
44
|
+
}}px;
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
`;
|
|
48
|
+
const StyledMotionSliderButtonThumb = exports.StyledMotionSliderButtonThumb = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
49
|
+
background-color: ${_ref4 => {
|
|
50
|
+
let {
|
|
51
|
+
theme
|
|
52
|
+
} = _ref4;
|
|
53
|
+
return theme['408'];
|
|
54
|
+
}};
|
|
55
|
+
width: ${_ref5 => {
|
|
56
|
+
let {
|
|
57
|
+
width
|
|
58
|
+
} = _ref5;
|
|
59
|
+
return width;
|
|
60
|
+
}}px;
|
|
61
|
+
position: absolute;
|
|
62
|
+
border-radius: 3px;
|
|
63
|
+
z-index: 3;
|
|
64
|
+
height: 100%;
|
|
65
|
+
padding: 7px 12px;
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
`;
|
|
69
|
+
//# sourceMappingURL=SliderButton.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SliderButton.styles.js","names":["_styledComponents","_interopRequireDefault","require","_framerMotion","obj","__esModule","default","StyledSliderButton","exports","styled","div","_ref","theme","_ref2","isDisabled","StyledSliderButtonItem","_ref3","width","StyledMotionSliderButtonThumb","motion","_ref4","_ref5"],"sources":["../../../src/components/slider-button/SliderButton.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\nimport { motion } from 'framer-motion';\n\ntype StyledSliderButtonProps = WithTheme<{ isDisabled?: boolean }>;\n\nexport const StyledSliderButton = styled.div<StyledSliderButtonProps>`\n align-items: center;\n background-color: ${({ theme }: StyledSliderButtonProps) => theme['404']};\n border-radius: 3px;\n box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);\n border: none;\n color: white;\n cursor: pointer;\n display: inline-flex;\n line-height: 1.15;\n min-height: 32px;\n opacity: ${({ isDisabled }) => (isDisabled ? 0.5 : 1)};\n position: relative;\n user-select: none;\n transition: opacity 0.3s ease;\n z-index: 1;\n`;\n\ntype StyledSliderButtonItemProps = WithTheme<{ isSelected: boolean; width: number }>;\n\nexport const StyledSliderButtonItem = styled.div<StyledSliderButtonItemProps>`\n padding: 7px 12px;\n width: ${({ width }) => width}px;\n display: flex;\n justify-content: center;\n`;\n\ntype StyledMotionSliderButtonThumbProps = WithTheme<{ width: number }>;\n\nexport const StyledMotionSliderButtonThumb = styled(motion.div)<StyledMotionSliderButtonThumbProps>`\n background-color: ${({ theme }: StyledMotionSliderButtonThumbProps) => theme['408']};\n width: ${({ width }) => width}px;\n position: absolute;\n border-radius: 3px;\n z-index: 3;\n height: 100%;\n padding: 7px 12px;\n display: flex;\n justify-content: center;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AAAuC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAIhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAA6B;AACtE;AACA,wBAAwBC,IAAA;EAAA,IAAC;IAAEC;EAA+B,CAAC,GAAAD,IAAA;EAAA,OAAKC,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,KAAA;EAAA,IAAC;IAAEC;EAAW,CAAC,GAAAD,KAAA;EAAA,OAAMC,UAAU,GAAG,GAAG,GAAG,CAAC;AAAA,CAAE;AAC1D;AACA;AACA;AACA;AACA,CAAC;AAIM,MAAMC,sBAAsB,GAAAP,OAAA,CAAAO,sBAAA,GAAGN,yBAAM,CAACC,GAAiC;AAC9E;AACA,aAAaM,KAAA;EAAA,IAAC;IAAEC;EAAM,CAAC,GAAAD,KAAA;EAAA,OAAKC,KAAK;AAAA,CAAC;AAClC;AACA;AACA,CAAC;AAIM,MAAMC,6BAA6B,GAAAV,OAAA,CAAAU,6BAAA,GAAG,IAAAT,yBAAM,EAACU,oBAAM,CAACT,GAAG,CAAsC;AACpG,wBAAwBU,KAAA;EAAA,IAAC;IAAER;EAA0C,CAAC,GAAAQ,KAAA;EAAA,OAAKR,KAAK,CAAC,KAAK,CAAC;AAAA,CAAC;AACxF,aAAaS,KAAA;EAAA,IAAC;IAAEJ;EAAM,CAAC,GAAAI,KAAA;EAAA,OAAKJ,KAAK;AAAA,CAAC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -57,3 +57,5 @@ export { default as SelectButton } from './components/select-button/SelectButton
|
|
|
57
57
|
export type { SelectButtonItem } from './components/select-button/types';
|
|
58
58
|
export { default as Signature } from './components/signature/Signature';
|
|
59
59
|
export type { SignatureRef } from './components/signature/Signature';
|
|
60
|
+
export { default as SliderButton } from './components/slider-button/SliderButton';
|
|
61
|
+
export type { SliderButtonItem } from './types/slider-button';
|
package/lib/index.js
CHANGED
|
@@ -249,6 +249,12 @@ Object.defineProperty(exports, "Slider", {
|
|
|
249
249
|
return _Slider.default;
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
+
Object.defineProperty(exports, "SliderButton", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function () {
|
|
255
|
+
return _SliderButton.default;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
252
258
|
Object.defineProperty(exports, "SmallWaitCursor", {
|
|
253
259
|
enumerable: true,
|
|
254
260
|
get: function () {
|
|
@@ -357,6 +363,7 @@ var _isTobitEmployee = require("./utils/isTobitEmployee");
|
|
|
357
363
|
var _uploadFile = require("./utils/uploadFile");
|
|
358
364
|
var _SelectButton = _interopRequireDefault(require("./components/select-button/SelectButton"));
|
|
359
365
|
var _Signature = _interopRequireDefault(require("./components/signature/Signature"));
|
|
366
|
+
var _SliderButton = _interopRequireDefault(require("./components/slider-button/SliderButton"));
|
|
360
367
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
361
368
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
362
369
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_Badge","_Button","_Checkbox","_CodeHighlighter","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_DateInfo","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","_NumberInput","_Popup","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SetupWizardItem","_SetupWizard","_SharingBar","_Slider","_SmallWaitCursor","_interopRequireWildcard","_TextArea","_Tooltip","_Truncation","_codeHighlighter","_comboBox","_fileDialog","_isTobitEmployee","_uploadFile","_SelectButton","_Signature","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as CodeHighlighter } from './components/code-highlighter/CodeHighlighter';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as DateInfo } from './components/date-info/DateInfo';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport type {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem as FilterButtonItem,\n} from './components/filter-buttons/types';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport type { PopupRef } from './components/popup/types';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport type { ISearchBoxItem as SearchBoxItem } from './components/search-box/types';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { CodeHighlighterTheme } from './types/codeHighlighter';\nexport type { CodeHighlighterLanguage, HighlightedLines } from './types/codeHighlighter';\nexport { ComboBoxDirection } from './types/comboBox';\nexport type { FileItem, Image, Meta, Video } from './types/file';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport type { SelectButtonItem } from './components/select-button/types';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_Badge","_Button","_Checkbox","_CodeHighlighter","_ColorSchemeProvider","_ComboBox","_ContentCard","_ContextMenu","_DateInfo","_FileInput","_FilterButtons","_GridImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_alignment","_MentionFinder","_NumberInput","_Popup","_ProgressBar","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SetupWizardItem","_SetupWizard","_SharingBar","_Slider","_SmallWaitCursor","_interopRequireWildcard","_TextArea","_Tooltip","_Truncation","_codeHighlighter","_comboBox","_fileDialog","_isTobitEmployee","_uploadFile","_SelectButton","_Signature","_SliderButton","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj"],"sources":["../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport { default as CodeHighlighter } from './components/code-highlighter/CodeHighlighter';\nexport { default as ColorSchemeProvider } from './components/color-scheme-provider/ColorSchemeProvider';\nexport type {\n FramerMotionBugFix,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport type { IComboBoxItem as ComboBoxItem } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport { default as DateInfo } from './components/date-info/DateInfo';\nexport { default as FileInput } from './components/file-input/FileInput';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport type {\n FilterButtonItemShape,\n FilterButtonSize,\n IFilterButtonItem as FilterButtonItem,\n} from './components/filter-buttons/types';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as Icon } from './components/icon/Icon';\nexport { default as Input } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport { default as ListItem } from './components/list/list-item/ListItem';\nexport { MentionFinderPopupAlignment } from './components/mention-finder/constants/alignment';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as Popup } from './components/popup/Popup';\nexport type { PopupRef } from './components/popup/types';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { default as RadioButtonGroup } from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport type { ISearchBoxItem as SearchBoxItem } from './components/search-box/types';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { CodeHighlighterTheme } from './types/codeHighlighter';\nexport type { CodeHighlighterLanguage, HighlightedLines } from './types/codeHighlighter';\nexport { ComboBoxDirection } from './types/comboBox';\nexport type { FileItem, Image, Meta, Video } from './types/file';\nexport { getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { uploadFile } from './utils/uploadFile';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport type { SelectButtonItem } from './components/select-button/types';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport type { SliderButtonItem } from './types/slider-button';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAF,sBAAA,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J,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAAA,SAAA5D,uBAAAwE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAhB,UAAA,GAAAgB,GAAA,KAAAf,OAAA,EAAAe,GAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-button.js","names":[],"sources":["../../src/types/slider-button.ts"],"sourcesContent":["export interface SliderButtonItem {\n id: string;\n text: string;\n}\n"],"mappings":""}
|
package/lib/utils/calculate.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SliderButtonItem } from '../types/slider-button';
|
|
1
2
|
export declare const calculateContentWidth: (texts: string[]) => number;
|
|
3
|
+
export declare const calculateBiggestWidth: (elements: SliderButtonItem[]) => number;
|
|
2
4
|
export declare const calculateContentHeight: (elements: string[]) => number;
|
|
3
5
|
export declare const getHeightOfSingleTextLine: () => number;
|
package/lib/utils/calculate.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getHeightOfSingleTextLine = exports.calculateContentWidth = exports.calculateContentHeight = void 0;
|
|
6
|
+
exports.getHeightOfSingleTextLine = exports.calculateContentWidth = exports.calculateContentHeight = exports.calculateBiggestWidth = void 0;
|
|
7
7
|
const calculateContentWidth = texts => {
|
|
8
8
|
const length = [];
|
|
9
9
|
texts.forEach(text => {
|
|
@@ -20,6 +20,30 @@ const calculateContentWidth = texts => {
|
|
|
20
20
|
return Math.max.apply(null, length);
|
|
21
21
|
};
|
|
22
22
|
exports.calculateContentWidth = calculateContentWidth;
|
|
23
|
+
const calculateBiggestWidth = elements => {
|
|
24
|
+
const container = document.createElement('div');
|
|
25
|
+
container.style.visibility = 'hidden';
|
|
26
|
+
container.style.position = 'absolute';
|
|
27
|
+
container.style.width = 'auto';
|
|
28
|
+
container.style.whiteSpace = 'nowrap';
|
|
29
|
+
container.style.padding = '7px 12px';
|
|
30
|
+
container.style.display = 'block';
|
|
31
|
+
elements.forEach(_ref => {
|
|
32
|
+
let {
|
|
33
|
+
text,
|
|
34
|
+
id
|
|
35
|
+
} = _ref;
|
|
36
|
+
const element = document.createElement('div');
|
|
37
|
+
element.accessKey = `slider-button-pseudo--${id}`;
|
|
38
|
+
element.innerText = text;
|
|
39
|
+
container.appendChild(element);
|
|
40
|
+
});
|
|
41
|
+
document.body.appendChild(container);
|
|
42
|
+
const width = container.offsetWidth;
|
|
43
|
+
document.body.removeChild(container);
|
|
44
|
+
return width;
|
|
45
|
+
};
|
|
46
|
+
exports.calculateBiggestWidth = calculateBiggestWidth;
|
|
23
47
|
const calculateContentHeight = elements => {
|
|
24
48
|
const length = [];
|
|
25
49
|
elements.forEach(element => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculate.js","names":["calculateContentWidth","texts","length","forEach","text","div","document","createElement","style","visibility","position","width","whiteSpace","body","appendChild","innerText","push","offsetWidth","removeChild","Math","max","apply","exports","
|
|
1
|
+
{"version":3,"file":"calculate.js","names":["calculateContentWidth","texts","length","forEach","text","div","document","createElement","style","visibility","position","width","whiteSpace","body","appendChild","innerText","push","offsetWidth","removeChild","Math","max","apply","exports","calculateBiggestWidth","elements","container","padding","display","_ref","id","element","accessKey","calculateContentHeight","margin","offsetHeight","reduce","partialSum","a","getHeightOfSingleTextLine","span","height"],"sources":["../../src/utils/calculate.ts"],"sourcesContent":["import type { SliderButtonItem } from '../types/slider-button';\n\nexport const calculateContentWidth = (texts: string[]) => {\n const length: number[] = [];\n\n texts.forEach((text) => {\n const div = document.createElement('div');\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.width = 'auto';\n div.style.whiteSpace = 'nowrap';\n document.body.appendChild(div);\n\n div.innerText = text;\n\n length.push(div.offsetWidth);\n\n document.body.removeChild(div);\n });\n\n return Math.max.apply(null, length);\n};\n\nexport const calculateBiggestWidth = (elements: SliderButtonItem[]) => {\n const container = document.createElement('div');\n\n container.style.visibility = 'hidden';\n container.style.position = 'absolute';\n container.style.width = 'auto';\n container.style.whiteSpace = 'nowrap';\n container.style.padding = '7px 12px';\n container.style.display = 'block';\n\n elements.forEach(({ text, id }) => {\n const element = document.createElement('div');\n\n element.accessKey = `slider-button-pseudo--${id}`;\n element.innerText = text;\n\n container.appendChild(element);\n });\n\n document.body.appendChild(container);\n\n const width = container.offsetWidth;\n\n document.body.removeChild(container);\n\n return width;\n};\n\nexport const calculateContentHeight = (elements: string[]) => {\n const length: number[] = [];\n\n elements.forEach((element: string) => {\n const div = document.createElement('p');\n div.style.visibility = 'hidden';\n div.style.position = 'absolute';\n div.style.width = 'auto';\n div.style.margin = '5px';\n div.style.whiteSpace = 'nowrap';\n document.body.appendChild(div);\n div.innerText = element;\n\n length.push(div.offsetHeight);\n\n document.body.removeChild(div);\n });\n\n return length.reduce((partialSum, a) => partialSum + a, 0);\n};\n\nexport const getHeightOfSingleTextLine = () => {\n const span = document.createElement('span');\n\n span.innerText = 'A';\n\n document.body.appendChild(span);\n\n const height = span.offsetHeight;\n\n document.body.removeChild(span);\n\n return height;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,qBAAqB,GAAIC,KAAe,IAAK;EACtD,MAAMC,MAAgB,GAAG,EAAE;EAE3BD,KAAK,CAACE,OAAO,CAAEC,IAAI,IAAK;IACpB,MAAMC,GAAG,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IACzCF,GAAG,CAACG,KAAK,CAACC,UAAU,GAAG,QAAQ;IAC/BJ,GAAG,CAACG,KAAK,CAACE,QAAQ,GAAG,UAAU;IAC/BL,GAAG,CAACG,KAAK,CAACG,KAAK,GAAG,MAAM;IACxBN,GAAG,CAACG,KAAK,CAACI,UAAU,GAAG,QAAQ;IAC/BN,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACT,GAAG,CAAC;IAE9BA,GAAG,CAACU,SAAS,GAAGX,IAAI;IAEpBF,MAAM,CAACc,IAAI,CAACX,GAAG,CAACY,WAAW,CAAC;IAE5BX,QAAQ,CAACO,IAAI,CAACK,WAAW,CAACb,GAAG,CAAC;EAClC,CAAC,CAAC;EAEF,OAAOc,IAAI,CAACC,GAAG,CAACC,KAAK,CAAC,IAAI,EAAEnB,MAAM,CAAC;AACvC,CAAC;AAACoB,OAAA,CAAAtB,qBAAA,GAAAA,qBAAA;AAEK,MAAMuB,qBAAqB,GAAIC,QAA4B,IAAK;EACnE,MAAMC,SAAS,GAAGnB,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAE/CkB,SAAS,CAACjB,KAAK,CAACC,UAAU,GAAG,QAAQ;EACrCgB,SAAS,CAACjB,KAAK,CAACE,QAAQ,GAAG,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C/BN,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACT,GAAG,CAAC;IAC9BA,GAAG,CAACU,SAAS,GAAGe,OAAO;IAEvB5B,MAAM,CAACc,IAAI,CAACX,GAAG,CAAC6B,YAAY,CAAC;IAE7B5B,QAAQ,CAACO,IAAI,CAACK,WAAW,CAACb,GAAG,CAAC;EAClC,CAAC,CAAC;EAEF,OAAOH,MAAM,CAACiC,MAAM,CAAC,CAACC,UAAU,EAAEC,CAAC,KAAKD,UAAU,GAAGC,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAACf,OAAA,CAAAU,sBAAA,GAAAA,sBAAA;AAEK,MAAMM,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,IAAI,GAAGjC,QAAQ,CAACC,aAAa,CAAC,MAAM,CAAC;EAE3CgC,IAAI,CAACxB,SAAS,GAAG,GAAG;EAEpBT,QAAQ,CAACO,IAAI,CAACC,WAAW,CAACyB,IAAI,CAAC;EAE/B,MAAMC,MAAM,GAAGD,IAAI,CAACL,YAAY;EAEhC5B,QAAQ,CAACO,IAAI,CAACK,WAAW,CAACqB,IAAI,CAAC;EAE/B,OAAOC,MAAM;AACjB,CAAC;AAAClB,OAAA,CAAAgB,yBAAA,GAAAA,yBAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AnimationScope } from 'framer-motion';
|
|
2
|
+
interface GetNearestPointProps {
|
|
3
|
+
position: number;
|
|
4
|
+
snapPoints: number[];
|
|
5
|
+
}
|
|
6
|
+
export declare const getNearestPoint: ({ snapPoints, position }: GetNearestPointProps) => {
|
|
7
|
+
nearestIndex: number;
|
|
8
|
+
nearestPoint: number;
|
|
9
|
+
};
|
|
10
|
+
interface GetThumbPositionProps {
|
|
11
|
+
scope: AnimationScope;
|
|
12
|
+
itemWidth: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const getThumbPosition: ({ itemWidth, scope }: GetThumbPositionProps) => number | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getThumbPosition = exports.getNearestPoint = void 0;
|
|
7
|
+
const getNearestPoint = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
snapPoints,
|
|
10
|
+
position
|
|
11
|
+
} = _ref;
|
|
12
|
+
let nearestIndex = -1;
|
|
13
|
+
let nearestPoint = -Infinity;
|
|
14
|
+
for (let i = 0; i < snapPoints.length; i++) {
|
|
15
|
+
const index = snapPoints[i];
|
|
16
|
+
if (index && index < position && index > nearestPoint) {
|
|
17
|
+
nearestPoint = index;
|
|
18
|
+
nearestIndex = i;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
nearestIndex,
|
|
23
|
+
nearestPoint
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.getNearestPoint = getNearestPoint;
|
|
27
|
+
const getThumbPosition = _ref2 => {
|
|
28
|
+
let {
|
|
29
|
+
itemWidth,
|
|
30
|
+
scope
|
|
31
|
+
} = _ref2;
|
|
32
|
+
if (!scope.current) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const {
|
|
36
|
+
transform
|
|
37
|
+
} = scope.current.style;
|
|
38
|
+
let position;
|
|
39
|
+
if (transform === 'none') {
|
|
40
|
+
position = 0;
|
|
41
|
+
} else {
|
|
42
|
+
const match = transform.match(/translateX\(([-\d.]+)px\)/);
|
|
43
|
+
if (match && match[1]) {
|
|
44
|
+
position = parseFloat(match[1]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!position) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
return position + itemWidth / 2;
|
|
51
|
+
};
|
|
52
|
+
exports.getThumbPosition = getThumbPosition;
|
|
53
|
+
//# sourceMappingURL=sliderButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sliderButton.js","names":["getNearestPoint","_ref","snapPoints","position","nearestIndex","nearestPoint","Infinity","i","length","index","exports","getThumbPosition","_ref2","itemWidth","scope","current","undefined","transform","style","match","parseFloat"],"sources":["../../src/utils/sliderButton.ts"],"sourcesContent":["import type { AnimationScope } from 'framer-motion';\n\ninterface GetNearestPointProps {\n position: number;\n snapPoints: number[];\n}\nexport const getNearestPoint = ({ snapPoints, position }: GetNearestPointProps) => {\n let nearestIndex = -1;\n let nearestPoint = -Infinity;\n\n for (let i = 0; i < snapPoints.length; i++) {\n const index = snapPoints[i];\n\n if (index && index < position && index > nearestPoint) {\n nearestPoint = index;\n nearestIndex = i;\n }\n }\n\n return { nearestIndex, nearestPoint };\n};\n\ninterface GetThumbPositionProps {\n scope: AnimationScope;\n itemWidth: number;\n}\n\nexport const getThumbPosition = ({ itemWidth, scope }: GetThumbPositionProps) => {\n if (!scope.current) {\n return undefined;\n }\n\n const { transform } = (scope.current as HTMLElement).style;\n let position;\n\n if (transform === 'none') {\n position = 0;\n } else {\n const match = transform.match(/translateX\\(([-\\d.]+)px\\)/);\n\n if (match && match[1]) {\n position = parseFloat(match[1]);\n }\n }\n\n if (!position) {\n return undefined;\n }\n\n return position + itemWidth / 2;\n};\n"],"mappings":";;;;;;AAMO,MAAMA,eAAe,GAAGC,IAAA,IAAoD;EAAA,IAAnD;IAAEC,UAAU;IAAEC;EAA+B,CAAC,GAAAF,IAAA;EAC1E,IAAIG,YAAY,GAAG,CAAC,CAAC;EACrB,IAAIC,YAAY,GAAG,CAACC,QAAQ;EAE5B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,UAAU,CAACM,MAAM,EAAED,CAAC,EAAE,EAAE;IACxC,MAAME,KAAK,GAAGP,UAAU,CAACK,CAAC,CAAC;IAE3B,IAAIE,KAAK,IAAIA,KAAK,GAAGN,QAAQ,IAAIM,KAAK,GAAGJ,YAAY,EAAE;MACnDA,YAAY,GAAGI,KAAK;MACpBL,YAAY,GAAGG,CAAC;IACpB;EACJ;EAEA,OAAO;IAAEH,YAAY;IAAEC;EAAa,CAAC;AACzC,CAAC;AAACK,OAAA,CAAAV,eAAA,GAAAA,eAAA;AAOK,MAAMW,gBAAgB,GAAGC,KAAA,IAAiD;EAAA,IAAhD;IAAEC,SAAS;IAAEC;EAA6B,CAAC,GAAAF,KAAA;EACxE,IAAI,CAACE,KAAK,CAACC,OAAO,EAAE;IAChB,OAAOC,SAAS;EACpB;EAEA,MAAM;IAAEC;EAAU,CAAC,GAAIH,KAAK,CAACC,OAAO,CAAiBG,KAAK;EAC1D,IAAIf,QAAQ;EAEZ,IAAIc,SAAS,KAAK,MAAM,EAAE;IACtBd,QAAQ,GAAG,CAAC;EAChB,CAAC,MAAM;IACH,MAAMgB,KAAK,GAAGF,SAAS,CAACE,KAAK,CAAC,2BAA2B,CAAC;IAE1D,IAAIA,KAAK,IAAIA,KAAK,CAAC,CAAC,CAAC,EAAE;MACnBhB,QAAQ,GAAGiB,UAAU,CAACD,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC;EACJ;EAEA,IAAI,CAAChB,QAAQ,EAAE;IACX,OAAOa,SAAS;EACpB;EAEA,OAAOb,QAAQ,GAAGU,SAAS,GAAG,CAAC;AACnC,CAAC;AAACH,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chayns-components/core",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.410",
|
|
4
4
|
"description": "A set of beautiful React components for developing your own applications with chayns.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chayns",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "371a9924f89df7c6504261c3efad1146bc2d501d"
|
|
74
74
|
}
|