etudes 1.2.0 → 2.0.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/README.md +1 -1
- package/lib/Accordion.d.ts +80 -71
- package/lib/Accordion.js +173 -183
- package/lib/Accordion.js.map +1 -1
- package/lib/BurgerButton.d.ts +20 -7
- package/lib/BurgerButton.js +113 -20
- package/lib/BurgerButton.js.map +1 -1
- package/lib/Conditional.d.ts +2 -3
- package/lib/Conditional.js +0 -1
- package/lib/Conditional.js.map +1 -1
- package/lib/DebugConsole.d.ts +14 -23
- package/lib/DebugConsole.js +86 -87
- package/lib/DebugConsole.js.map +1 -1
- package/lib/Dial.d.ts +53 -16
- package/lib/Dial.js +121 -35
- package/lib/Dial.js.map +1 -1
- package/lib/Dropdown.d.ts +68 -83
- package/lib/Dropdown.js +226 -161
- package/lib/Dropdown.js.map +1 -1
- package/lib/Each.d.ts +2 -2
- package/lib/Each.js.map +1 -1
- package/lib/ExtractChild.d.ts +5 -4
- package/lib/ExtractChild.js +13 -11
- package/lib/ExtractChild.js.map +1 -1
- package/lib/ExtractChildren.d.ts +2 -2
- package/lib/ExtractChildren.js +7 -5
- package/lib/ExtractChildren.js.map +1 -1
- package/lib/FlatSVG.d.ts +30 -25
- package/lib/FlatSVG.js +28 -37
- package/lib/FlatSVG.js.map +1 -1
- package/lib/List.d.ts +97 -54
- package/lib/List.js +124 -63
- package/lib/List.js.map +1 -1
- package/lib/MasonryGrid.d.ts +27 -15
- package/lib/MasonryGrid.js +163 -148
- package/lib/MasonryGrid.js.map +1 -1
- package/lib/Panorama.d.ts +100 -21
- package/lib/Panorama.js +45 -44
- package/lib/Panorama.js.map +1 -1
- package/lib/PanoramaSlider.d.ts +65 -23
- package/lib/PanoramaSlider.js +150 -45
- package/lib/PanoramaSlider.js.map +1 -1
- package/lib/RangeSlider.d.ts +29 -89
- package/lib/RangeSlider.js +272 -286
- package/lib/RangeSlider.js.map +1 -1
- package/lib/Repeat.d.ts +4 -3
- package/lib/Repeat.js +3 -2
- package/lib/Repeat.js.map +1 -1
- package/lib/RotatingGallery.d.ts +38 -36
- package/lib/RotatingGallery.js +47 -17
- package/lib/RotatingGallery.js.map +1 -1
- package/lib/SelectableButton.d.ts +13 -4
- package/lib/SelectableButton.js +3 -14
- package/lib/SelectableButton.js.map +1 -1
- package/lib/Slider.d.ts +103 -41
- package/lib/Slider.js +182 -82
- package/lib/Slider.js.map +1 -1
- package/lib/StepwiseSlider.d.ts +146 -59
- package/lib/StepwiseSlider.js +248 -142
- package/lib/StepwiseSlider.js.map +1 -1
- package/lib/SwipeContainer.d.ts +13 -5
- package/lib/SwipeContainer.js +5 -15
- package/lib/SwipeContainer.js.map +1 -1
- package/lib/TextField.d.ts +1 -1
- package/lib/TextField.js +5 -15
- package/lib/TextField.js.map +1 -1
- package/lib/Video.d.ts +30 -51
- package/lib/Video.js +77 -119
- package/lib/Video.js.map +1 -1
- package/lib/WithTooltip.d.ts +16 -18
- package/lib/WithTooltip.js +167 -101
- package/lib/WithTooltip.js.map +1 -1
- package/lib/hooks/useDocumentTitle.d.ts +2 -1
- package/lib/hooks/useDocumentTitle.js +2 -1
- package/lib/hooks/useDocumentTitle.js.map +1 -1
- package/lib/hooks/useDragEffect.d.ts +25 -16
- package/lib/hooks/useDragEffect.js +30 -20
- package/lib/hooks/useDragEffect.js.map +1 -1
- package/lib/hooks/useElementRect.d.ts +2 -1
- package/lib/hooks/useElementRect.js +5 -4
- package/lib/hooks/useElementRect.js.map +1 -1
- package/lib/hooks/useInterval.d.ts +2 -2
- package/lib/hooks/useInterval.js +1 -1
- package/lib/hooks/useInterval.js.map +1 -1
- package/lib/hooks/useLoadImageEffect.d.ts +6 -6
- package/lib/hooks/useLoadImageEffect.js.map +1 -1
- package/lib/hooks/usePrevious.d.ts +6 -0
- package/lib/hooks/usePrevious.js +17 -0
- package/lib/hooks/usePrevious.js.map +1 -0
- package/lib/hooks/useResizeEffect.d.ts +2 -2
- package/lib/hooks/useResizeEffect.js +5 -8
- package/lib/hooks/useResizeEffect.js.map +1 -1
- package/lib/hooks/useSearchParamState.d.ts +10 -7
- package/lib/hooks/useSearchParamState.js +14 -10
- package/lib/hooks/useSearchParamState.js.map +1 -1
- package/lib/utils/asClassNameDict.d.ts +3 -0
- package/lib/utils/asClassNameDict.js +7 -0
- package/lib/utils/asClassNameDict.js.map +1 -0
- package/lib/utils/asComponentDict.d.ts +5 -0
- package/lib/utils/asComponentDict.js +23 -0
- package/lib/utils/asComponentDict.js.map +1 -0
- package/lib/utils/asStyleDict.d.ts +4 -0
- package/lib/utils/asStyleDict.js +7 -0
- package/lib/utils/asStyleDict.js.map +1 -0
- package/lib/utils/cloneStyledElement.d.ts +18 -0
- package/lib/utils/cloneStyledElement.js +63 -0
- package/lib/utils/cloneStyledElement.js.map +1 -0
- package/lib/utils/styles.d.ts +2 -0
- package/lib/utils/styles.js +22 -0
- package/lib/utils/styles.js.map +1 -0
- package/lib/utils/useDebug.d.ts +2 -0
- package/lib/utils/useDebug.js +46 -0
- package/lib/utils/useDebug.js.map +1 -0
- package/package.json +25 -33
- package/lib/AbstractSelectableCollection.d.ts +0 -94
- package/lib/AbstractSelectableCollection.js +0 -151
- package/lib/AbstractSelectableCollection.js.map +0 -1
- package/lib/types/index.d.ts +0 -7
- package/lib/types/index.js +0 -3
- package/lib/types/index.js.map +0 -1
package/lib/StepwiseSlider.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
1
|
+
import React, { HTMLAttributes, PropsWithChildren } from 'react';
|
|
2
|
+
declare type Orientation = 'horizontal' | 'vertical';
|
|
3
|
+
export declare type StepwiseSliderProps = HTMLAttributes<HTMLDivElement> & PropsWithChildren<{
|
|
3
4
|
/**
|
|
4
|
-
* By default the position is a value from 0 - 1, 0 being the start of the
|
|
5
|
-
* end. Switching on this flag inverts this behavior,
|
|
6
|
-
* being the start.
|
|
5
|
+
* By default the position is a value from 0 - 1, 0 being the start of the
|
|
6
|
+
* slider and 1 being the end. Switching on this flag inverts this behavior,
|
|
7
|
+
* where 0 becomes the end of the slider and 1 being the start.
|
|
7
8
|
*/
|
|
8
9
|
isInverted?: boolean;
|
|
9
10
|
/**
|
|
@@ -11,20 +12,11 @@ export declare type Props = HTMLAttributes<HTMLDivElement> & {
|
|
|
11
12
|
*/
|
|
12
13
|
isTrackInteractive?: boolean;
|
|
13
14
|
/**
|
|
14
|
-
* Indicates if position/index change events are dispatched only when dragging
|
|
15
|
-
* disabled, aforementioned events are fired repeatedly while
|
|
15
|
+
* Indicates if position/index change events are dispatched only when dragging
|
|
16
|
+
* ends. When disabled, aforementioned events are fired repeatedly while
|
|
17
|
+
* dragging.
|
|
16
18
|
*/
|
|
17
19
|
onlyDispatchesOnDragEnd?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* A function that returns the label to be displayed at a given slider position and closest step
|
|
20
|
-
* index (if steps are provided).
|
|
21
|
-
*
|
|
22
|
-
* @param position - The current slider position.
|
|
23
|
-
* @param index - The nearest step index (if steps are provided), or -1 if no steps are provided.
|
|
24
|
-
*
|
|
25
|
-
* @returns The label.
|
|
26
|
-
*/
|
|
27
|
-
labelProvider?: (position: number, index: number) => string;
|
|
28
20
|
/**
|
|
29
21
|
* Padding between the track and the knob in pixels.
|
|
30
22
|
*/
|
|
@@ -40,11 +32,12 @@ export declare type Props = HTMLAttributes<HTMLDivElement> & {
|
|
|
40
32
|
/**
|
|
41
33
|
* Orientation of the slider.
|
|
42
34
|
*/
|
|
43
|
-
orientation?:
|
|
35
|
+
orientation?: Orientation;
|
|
44
36
|
/**
|
|
45
|
-
* An array of step descriptors. A step is a position (0 - 1 inclusive) on the
|
|
46
|
-
* knob should snap to if dragging stops near it. Ensure that
|
|
47
|
-
* for the start of the track and one for
|
|
37
|
+
* An array of step descriptors. A step is a position (0 - 1 inclusive) on the
|
|
38
|
+
* track where the knob should snap to if dragging stops near it. Ensure that
|
|
39
|
+
* there are at least two steps: one for the start of the track and one for
|
|
40
|
+
* the end.
|
|
48
41
|
*/
|
|
49
42
|
steps?: readonly number[];
|
|
50
43
|
/**
|
|
@@ -52,9 +45,21 @@ export declare type Props = HTMLAttributes<HTMLDivElement> & {
|
|
|
52
45
|
*/
|
|
53
46
|
index?: number;
|
|
54
47
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
48
|
+
* A function that returns the label to be displayed at a given slider
|
|
49
|
+
* position and closest step index (if steps are provided).
|
|
50
|
+
*
|
|
51
|
+
* @param position - The current slider position.
|
|
52
|
+
* @param index - The nearest step index (if steps are provided), or -1 if no
|
|
53
|
+
* steps are provided.
|
|
54
|
+
*
|
|
55
|
+
* @returns The label.
|
|
56
|
+
*/
|
|
57
|
+
labelProvider?: (position: number, index: number) => string;
|
|
58
|
+
/**
|
|
59
|
+
* Handler invoked when index changes. This can either be invoked from the
|
|
60
|
+
* `index` prop being changed or from the slider being dragged. Note that if
|
|
61
|
+
* the event is emitted at the end of dragging due to
|
|
62
|
+
* `onlyDispatchesOnDragEnd` set to `true`, the `isDragging` parameter here is
|
|
58
63
|
* still `true`. This event is emitted right after `onPositionChange`.
|
|
59
64
|
*
|
|
60
65
|
* @param index - The current slider index.
|
|
@@ -62,9 +67,10 @@ export declare type Props = HTMLAttributes<HTMLDivElement> & {
|
|
|
62
67
|
*/
|
|
63
68
|
onIndexChange?: (index: number, isDragging: boolean) => void;
|
|
64
69
|
/**
|
|
65
|
-
* Handler invoked when position changes. This can either be invoked from the
|
|
66
|
-
* being changed or from the slider being dragged. Note that if
|
|
67
|
-
*
|
|
70
|
+
* Handler invoked when position changes. This can either be invoked from the
|
|
71
|
+
* `index` prop being changed or from the slider being dragged. Note that if
|
|
72
|
+
* the event is emitted at the end of dragging due to
|
|
73
|
+
* `onlyDispatchesOnDragEnd` set to `true`, the `isDragging` parameter here is
|
|
68
74
|
* still `true`. This event is emitted right before `onIndexChange`.
|
|
69
75
|
*
|
|
70
76
|
* @param position - The current slider position.
|
|
@@ -79,42 +85,123 @@ export declare type Props = HTMLAttributes<HTMLDivElement> & {
|
|
|
79
85
|
* Handler invoked when dragging begins.
|
|
80
86
|
*/
|
|
81
87
|
onDragStart?: () => void;
|
|
82
|
-
}
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* A "stepwise" slider component supporting both horizontal and vertical
|
|
91
|
+
* orientations that automatically snaps to a set of predefined points on the
|
|
92
|
+
* slider when dragged. These points are referred to as "steps", indexed by an
|
|
93
|
+
* integer referred to as "index". This index can be two-way binded. The
|
|
94
|
+
* component consists of four customizable elements: a draggable knob, a label
|
|
95
|
+
* on the knob, a scroll track before the knob and a scroll track after the
|
|
96
|
+
* knob. While the width and height of the slider is inferred from its CSS
|
|
97
|
+
* rules, the width and height of the knob are set via props (`knobWidth` and
|
|
98
|
+
* `knobHeight`, respectively). The size of the knob does not impact the size of
|
|
99
|
+
* the slider. While dragging, the slider still emits a position change event,
|
|
100
|
+
* where the position is a decimal ranging between 0.0 and 1.0, inclusive.
|
|
101
|
+
*
|
|
102
|
+
* @exports StepwiseSliderKnob - The component for the knob.
|
|
103
|
+
* @exports StepwiseSliderLabel - The component for the label on the knob.
|
|
104
|
+
* @exports StepwiseSliderTrack - The component for the slide track on either
|
|
105
|
+
* side of the knob.
|
|
106
|
+
*/
|
|
107
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
108
|
+
/**
|
|
109
|
+
* By default the position is a value from 0 - 1, 0 being the start of the
|
|
110
|
+
* slider and 1 being the end. Switching on this flag inverts this behavior,
|
|
111
|
+
* where 0 becomes the end of the slider and 1 being the start.
|
|
112
|
+
*/
|
|
113
|
+
isInverted?: boolean | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Specifies if the track is clickable to set the position of the knob.
|
|
116
|
+
*/
|
|
117
|
+
isTrackInteractive?: boolean | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Indicates if position/index change events are dispatched only when dragging
|
|
120
|
+
* ends. When disabled, aforementioned events are fired repeatedly while
|
|
121
|
+
* dragging.
|
|
122
|
+
*/
|
|
123
|
+
onlyDispatchesOnDragEnd?: boolean | undefined;
|
|
124
|
+
/**
|
|
125
|
+
* Padding between the track and the knob in pixels.
|
|
126
|
+
*/
|
|
127
|
+
trackPadding?: number | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Height of the knob in pixels.
|
|
130
|
+
*/
|
|
131
|
+
knobHeight?: number | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Width of the knob in pixels.
|
|
134
|
+
*/
|
|
135
|
+
knobWidth?: number | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Orientation of the slider.
|
|
138
|
+
*/
|
|
139
|
+
orientation?: Orientation | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* An array of step descriptors. A step is a position (0 - 1 inclusive) on the
|
|
142
|
+
* track where the knob should snap to if dragging stops near it. Ensure that
|
|
143
|
+
* there are at least two steps: one for the start of the track and one for
|
|
144
|
+
* the end.
|
|
145
|
+
*/
|
|
146
|
+
steps?: readonly number[] | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* The current index.
|
|
149
|
+
*/
|
|
150
|
+
index?: number | undefined;
|
|
151
|
+
/**
|
|
152
|
+
* A function that returns the label to be displayed at a given slider
|
|
153
|
+
* position and closest step index (if steps are provided).
|
|
154
|
+
*
|
|
155
|
+
* @param position - The current slider position.
|
|
156
|
+
* @param index - The nearest step index (if steps are provided), or -1 if no
|
|
157
|
+
* steps are provided.
|
|
158
|
+
*
|
|
159
|
+
* @returns The label.
|
|
160
|
+
*/
|
|
161
|
+
labelProvider?: ((position: number, index: number) => string) | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* Handler invoked when index changes. This can either be invoked from the
|
|
164
|
+
* `index` prop being changed or from the slider being dragged. Note that if
|
|
165
|
+
* the event is emitted at the end of dragging due to
|
|
166
|
+
* `onlyDispatchesOnDragEnd` set to `true`, the `isDragging` parameter here is
|
|
167
|
+
* still `true`. This event is emitted right after `onPositionChange`.
|
|
168
|
+
*
|
|
169
|
+
* @param index - The current slider index.
|
|
170
|
+
* @param isDragging - Specifies if the index change is due to dragging.
|
|
171
|
+
*/
|
|
172
|
+
onIndexChange?: ((index: number, isDragging: boolean) => void) | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* Handler invoked when position changes. This can either be invoked from the
|
|
175
|
+
* `index` prop being changed or from the slider being dragged. Note that if
|
|
176
|
+
* the event is emitted at the end of dragging due to
|
|
177
|
+
* `onlyDispatchesOnDragEnd` set to `true`, the `isDragging` parameter here is
|
|
178
|
+
* still `true`. This event is emitted right before `onIndexChange`.
|
|
179
|
+
*
|
|
180
|
+
* @param position - The current slider position.
|
|
181
|
+
* @param isDragging - Specifies if the position change is due to dragging.
|
|
182
|
+
*/
|
|
183
|
+
onPositionChange?: ((position: number, isDragging: boolean) => void) | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* Handler invoked when dragging ends.
|
|
186
|
+
*/
|
|
187
|
+
onDragEnd?: (() => void) | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Handler invoked when dragging begins.
|
|
190
|
+
*/
|
|
191
|
+
onDragStart?: (() => void) | undefined;
|
|
192
|
+
} & {
|
|
193
|
+
children?: React.ReactNode;
|
|
194
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
195
|
+
export default _default;
|
|
196
|
+
export declare const StepwiseSliderTrack: ({ ...props }: HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
197
|
+
export declare const StepwiseSliderKnob: ({ ...props }: HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
198
|
+
export declare const StepwiseSliderLabel: ({ ...props }: HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
83
199
|
/**
|
|
84
200
|
* Generates a set of steps compatible with this component.
|
|
85
201
|
*
|
|
86
|
-
* @param length - The number of steps. This must be at least 2 because you must
|
|
87
|
-
* starting and ending points.
|
|
202
|
+
* @param length - The number of steps. This must be at least 2 because you must
|
|
203
|
+
* include the starting and ending points.
|
|
88
204
|
*
|
|
89
205
|
* @returns An array of steps.
|
|
90
206
|
*/
|
|
91
207
|
export declare function generateSteps(length: number): readonly number[];
|
|
92
|
-
/**
|
|
93
|
-
* A "stepwise" slider component supporting both horizontal and vertical orientations that
|
|
94
|
-
* automatically snaps to a set of predefined points on the slider when dragged. These points are
|
|
95
|
-
* referred to as "steps", indexed by an integer referred to as "index". This index can be two-way
|
|
96
|
-
* binded. The component consists of four customizable elements: a draggable knob, a label on the
|
|
97
|
-
* knob, a scroll track before the knob and a scroll track after the knob. While the width and
|
|
98
|
-
* height of the slider is inferred from its CSS rules, the width and height of the knob are set via
|
|
99
|
-
* props (`knobWidth` and `knobHeight`, respectively). The size of the knob does not impact the size
|
|
100
|
-
* of the slider. While dragging, the slider still emits a position change event, where the position
|
|
101
|
-
* is a decimal ranging between 0.0 and 1.0, inclusive.
|
|
102
|
-
*
|
|
103
|
-
* @exports StepwiseSliderKnob - The component for the knob.
|
|
104
|
-
* @exports StepwiseSliderKnobLabel - The component for the label on the knob.
|
|
105
|
-
* @exports StepwiseSliderStartingTrack - The component for the slide track before the knob.
|
|
106
|
-
* @exports StepwiseSliderEndingTrack - The component for the slide track after the knob.
|
|
107
|
-
*/
|
|
108
|
-
export default function StepwiseSlider({ index: externalIndex, isInverted, isTrackInteractive, knobHeight, knobWidth, labelProvider, onlyDispatchesOnDragEnd, orientation, steps, trackPadding, onDragEnd, onDragStart, onIndexChange, onPositionChange, ...props }: Props): JSX.Element;
|
|
109
|
-
export declare const StepwiseSliderStartingTrack: import("styled-components").StyledComponent<"div", any, {
|
|
110
|
-
orientation: NonNullable<Props['orientation']>;
|
|
111
|
-
isClickable: boolean;
|
|
112
|
-
}, never>;
|
|
113
|
-
export declare const StepwiseSliderEndingTrack: import("styled-components").StyledComponent<"div", any, {
|
|
114
|
-
orientation: NonNullable<Props['orientation']>;
|
|
115
|
-
isClickable: boolean;
|
|
116
|
-
}, never>;
|
|
117
|
-
export declare const StepwiseSliderKnob: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
118
|
-
export declare const StepwiseSliderKnobLabel: import("styled-components").StyledComponent<"label", any, {
|
|
119
|
-
knobHeight: NonNullable<Props['knobHeight']>;
|
|
120
|
-
}, never>;
|