@enact/ui 4.6.0 → 4.6.1

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/FloatingLayer/package.json +3 -0
  3. package/IconButton/IconButton.js +7 -2
  4. package/RadioDecorator/RadioControllerDecorator.js +6 -0
  5. package/RadioDecorator/RadioDecorator.js +5 -0
  6. package/Scroller/UiScrollerBase.js +6 -0
  7. package/SlotItem/SlotItem.js +6 -2
  8. package/ToggleItem/ToggleItem.js +6 -2
  9. package/Touchable/Pinch.js +185 -0
  10. package/Touchable/Touch.js +34 -11
  11. package/Touchable/Touchable.js +63 -4
  12. package/Touchable/config.js +19 -2
  13. package/Touchable/tests/Touchable-specs.js +96 -6
  14. package/Touchable/useTouch.js +41 -32
  15. package/VirtualList/UiVirtualListBase.js +6 -0
  16. package/package.json +2 -2
  17. package/AnnounceDecorator/AnnounceDecorator.d.ts +0 -64
  18. package/BodyText/BodyText.d.ts +0 -66
  19. package/Button/Button.d.ts +0 -125
  20. package/Cancelable/Cancelable.d.ts +0 -64
  21. package/Changeable/Changeable.d.ts +0 -54
  22. package/ComponentOverride/ComponentOverride.d.ts +0 -52
  23. package/ForwardRef/ForwardRef.d.ts +0 -22
  24. package/GridListImageItem/GridListImageItem.d.ts +0 -85
  25. package/Group/Group.d.ts +0 -107
  26. package/Heading/Heading.d.ts +0 -90
  27. package/Icon/Icon.d.ts +0 -88
  28. package/IconButton/IconButton.d.ts +0 -115
  29. package/Image/Image.d.ts +0 -113
  30. package/ImageItem/ImageItem.d.ts +0 -83
  31. package/Item/Item.d.ts +0 -64
  32. package/LabeledIcon/LabeledIcon.d.ts +0 -130
  33. package/Layout/Layout.d.ts +0 -247
  34. package/Marquee/index.d.ts +0 -258
  35. package/Measurable/Measurable.d.ts +0 -26
  36. package/Media/Media.d.ts +0 -99
  37. package/Placeholder/index.d.ts +0 -53
  38. package/ProgressBar/ProgressBar.d.ts +0 -92
  39. package/RadioDecorator/RadioDecorator.d.ts +0 -35
  40. package/Repeater/Repeater.d.ts +0 -83
  41. package/Resizable/Resizable.d.ts +0 -31
  42. package/Routable/Routable.d.ts +0 -148
  43. package/Scrollable/Scrollable.d.ts +0 -0
  44. package/Scroller/Scroller.d.ts +0 -276
  45. package/Skinnable/Skinnable.d.ts +0 -94
  46. package/Slider/Slider.d.ts +0 -202
  47. package/SlotItem/SlotItem.d.ts +0 -118
  48. package/Slottable/Slottable.d.ts +0 -22
  49. package/Spinner/Spinner.d.ts +0 -95
  50. package/ToggleIcon/ToggleIcon.d.ts +0 -90
  51. package/ToggleItem/ToggleItem.d.ts +0 -134
  52. package/Toggleable/Toggleable.d.ts +0 -103
  53. package/Touchable/Touchable.d.ts +0 -175
  54. package/Transition/Transition.d.ts +0 -196
  55. package/ViewManager/ViewManager.d.ts +0 -191
  56. package/VirtualList/VirtualList.d.ts +0 -530
  57. package/index.d.ts +0 -0
  58. package/internal/IdProvider/IdProvider.d.ts +0 -0
  59. package/internal/Pure/Pure.d.ts +0 -0
  60. package/internal/localized-fonts/localized-fonts.d.ts +0 -53
  61. package/internal/selection/selection.d.ts +0 -0
  62. package/internal/validators/validators.d.ts +0 -0
  63. package/resolution/index.d.ts +0 -187
  64. package/useControlledState/useControlledState.d.ts +0 -0
  65. package/useScroll/useScroll.d.ts +0 -0
@@ -1,83 +0,0 @@
1
- // Type definitions for ui/ImageItem
2
-
3
- import * as React from "react";
4
- import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
5
-
6
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
7
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
8
-
9
- export interface ImageItemBaseProps {
10
- /**
11
- * The caption displayed with the image.
12
- */
13
- children?: React.ReactNode;
14
- /**
15
- * Called with a reference to the root component.
16
- *
17
- * When using , the `ref` prop is forwarded to this component
18
- as `componentRef` .
19
- */
20
- componentRef?: object | Function;
21
- /**
22
- * Customizes the component by mapping the supplied collection of CSS class names to the
23
- corresponding internal elements and states of this component.
24
- *
25
- * The following classes are supported:
26
- * * `imageItem` - The root component class
27
- * * `caption` - The caption component class
28
- * * `horizontal` - Applied when `orientation="horizontal"
29
- * * `image` - The image component class
30
- * * `selected` - Applied when `selected` prop is `true`
31
- * * `vertical` - Applied when `orientation="vertical"
32
- */
33
- css?: object;
34
- /**
35
- * The component used to render the image component.
36
- */
37
- imageComponent?: React.ComponentType | JSX.Element;
38
- /**
39
- * The layout orientation of the component.
40
- */
41
- orientation?: "horizontal" | "vertical";
42
- /**
43
- * A placeholder image to be displayed before the image is loaded.
44
- */
45
- placeholder?: string;
46
- /**
47
- * Applies a selected visual effect to the image.
48
- */
49
- selected?: boolean;
50
- /**
51
- * String value or Object of values used to determine which image will appear on a specific
52
- screenSize.
53
- */
54
- src?: string | object;
55
- }
56
- /**
57
- * A basic image item without any behavior.
58
- */
59
-
60
- export class ImageItemBase extends React.Component<
61
- Merge<React.HTMLProps<HTMLElement>, ImageItemBaseProps>
62
- > {}
63
-
64
- export interface ImageItemDecoratorProps
65
- extends ui_ForwardRef_ForwardRefProps {}
66
- export function ImageItemDecorator<P>(
67
- Component: React.ComponentType<P> | string
68
- ): React.ComponentType<P & ImageItemDecoratorProps>;
69
-
70
- export interface ImageItemProps
71
- extends Omit<
72
- Merge<ImageItemBaseProps, ImageItemDecoratorProps>,
73
- "componentRef"
74
- > {}
75
- /**
76
- * A minimally styled ImageItem ready for customization by a theme.
77
- */
78
-
79
- export class ImageItem extends React.Component<
80
- Merge<React.HTMLProps<HTMLElement>, ImageItemProps>
81
- > {}
82
-
83
- export default ImageItem;
package/Item/Item.d.ts DELETED
@@ -1,64 +0,0 @@
1
- // Type definitions for ui/Item
2
-
3
- import * as React from "react";
4
- import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
5
- import { TouchableProps as ui_Touchable_TouchableProps } from "@enact/ui/Touchable";
6
-
7
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
8
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
9
-
10
- export interface ItemBaseProps {
11
- /**
12
- * The node to be displayed as the main content of the item.
13
- */
14
- children?: React.ReactNode;
15
- /**
16
- * The type of component to use to render the item. May be a DOM node name (e.g 'div',
17
- 'span', etc.) or a custom component.
18
- */
19
- component?: string | React.ComponentType;
20
- /**
21
- * Customizes the component by mapping the supplied collection of CSS class names to the
22
- corresponding internal elements and states of this component.
23
- *
24
- * The following classes are supported:
25
- * * `item` - The root class name
26
- * * `inline` - Applied when `inline` prop is true
27
- */
28
- css?: object;
29
- /**
30
- * Applies a disabled state to the item.
31
- */
32
- disabled?: boolean;
33
- /**
34
- * Applies inline styling to the item.
35
- */
36
- inline?: boolean;
37
- }
38
- /**
39
- * A basic list item component structure without any behaviors applied to it.
40
- *
41
- * It also has support for overlay to place things before and after the main content.
42
- */
43
-
44
- export class ItemBase extends React.Component<
45
- Merge<React.HTMLProps<HTMLElement>, ItemBaseProps>
46
- > {}
47
-
48
- export interface ItemDecoratorProps
49
- extends Merge<ui_ForwardRef_ForwardRefProps, ui_Touchable_TouchableProps> {}
50
- export function ItemDecorator<P>(
51
- Component: React.ComponentType<P> | string
52
- ): React.ComponentType<P & ItemDecoratorProps>;
53
-
54
- export interface ItemProps
55
- extends Omit<Merge<ItemBaseProps, ItemDecoratorProps>, "componentRef"> {}
56
- /**
57
- * A minimally-styled ready-to-use list item component with touch support.
58
- */
59
-
60
- export class Item extends React.Component<
61
- Merge<React.HTMLProps<HTMLElement>, ItemProps>
62
- > {}
63
-
64
- export default Item;
@@ -1,130 +0,0 @@
1
- // Type definitions for ui/LabeledIcon
2
-
3
- import * as React from "react";
4
- import { SlottableProps as ui_Slottable_SlottableProps } from "@enact/ui/Slottable";
5
-
6
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
7
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
8
-
9
- export interface LabeledIconBaseProps {
10
- /**
11
- * The label.
12
- *
13
- * This accepts strings, DOM, and Components, if you need more elaborate features. It may be
14
- positioned using `labelPosition` .
15
- */
16
- children?: React.ReactNode;
17
- /**
18
- * Called with a reference to the root component.
19
- *
20
- * When using , the `ref` prop is forwarded to this
21
- component as `componentRef` .
22
- */
23
- componentRef?: object | Function;
24
- /**
25
- * Customizes the component by mapping the supplied collection of CSS class names to the
26
- corresponding internal elements and states of this component.
27
- *
28
- * The following classes are supported:
29
- * * `labeledIcon` - The root component class
30
- * * `icon` - The icon component class
31
- * * `iconCell` - Applied to the `iconComponent` directly, like `.icon` . If `icon` in a
32
- React component, this class is applied to the container of the icon,
33
- rather than the icon itself.
34
- * * `label` - The label component class
35
- * * `inline` - Applied when the inline prop is set
36
- * * `above` - Applied when the labelPosition prop is set to above
37
- * * `after` - Applied when the labelPosition prop is set to after
38
- * * `before` - Applied when the labelPosition prop is set to before
39
- * * `below` - Applied when the labelPosition prop is set to below
40
- * * `left` - Applied when the labelPosition prop is set to left
41
- * * `right` - Applied when the labelPosition prop is set to right
42
- */
43
- css?: object;
44
- /**
45
- * Disables the component and becomes non-interactive.
46
- */
47
- disabled?: boolean;
48
- /**
49
- * Flip the icon horizontally, vertically or both.
50
- */
51
- flip?: "both" | "horizontal" | "vertical";
52
- /**
53
- * The icon.
54
- *
55
- * This will be passed as `children` to the `iconComponent` , unless you supply a React
56
- element (like JSX) to this prop, directly or via the `<icon>` slot.
57
- */
58
- icon?: string | JSX.Element | React.ComponentType;
59
- /**
60
- * The component used to render the `icon` .
61
- *
62
- * This will receive the `icon` prop as `children` and should handle it appropriately. This
63
- prop is ignored in the case of a component being passed into the `icon` prop. It will
64
- also receive the `flip` and `size` props as set on the component.
65
- */
66
- iconComponent?: React.ComponentType;
67
- /**
68
- * Enables this component to be used in an "inline" context.
69
- *
70
- * This is useful for when you have several of these components in a row and are not using a
71
- or flex-box configuration.
72
- */
73
- inline?: boolean;
74
- /**
75
- * The position of the label in relation to the icon element.
76
- *
77
- * Allowed values include:
78
- * * 'below' (default),
79
- * * 'above',
80
- * * 'left',
81
- * * 'right',
82
- * * 'before', and
83
- * * 'after'.
84
- *
85
- * The 'before' and 'after' values automatically swap sides when in an RTL locale context.
86
- */
87
- labelPosition?: "above" | "after" | "before" | "below" | "left" | "right";
88
- /**
89
- * The size of the icon.
90
- *
91
- * Applies the CSS class which can be customized by
92
- .
93
- */
94
- size?: string;
95
- }
96
- /**
97
- * An icon component with a label.
98
- */
99
-
100
- export class LabeledIconBase extends React.Component<
101
- Merge<React.HTMLProps<HTMLElement>, LabeledIconBaseProps>
102
- > {}
103
-
104
- export interface LabeledIconDecoratorProps
105
- extends ui_Slottable_SlottableProps {}
106
- export function LabeledIconDecorator<P>(
107
- Component: React.ComponentType<P> | string
108
- ): React.ComponentType<P & LabeledIconDecoratorProps>;
109
-
110
- export interface LabeledIconProps
111
- extends Omit<
112
- Merge<LabeledIconBaseProps, LabeledIconDecoratorProps>,
113
- "componentRef"
114
- > {}
115
- /**
116
- * An icon component with a label without any behaviors applied to it.
117
- *
118
- * Usage:
119
- * ```
120
- <LabeledIcon icon="star" labelPosition="after">
121
- Favorite
122
- </LabeledIcon>
123
- ```
124
- */
125
-
126
- export class LabeledIcon extends React.Component<
127
- Merge<React.HTMLProps<HTMLElement>, LabeledIconProps>
128
- > {}
129
-
130
- export default LabeledIcon;
@@ -1,247 +0,0 @@
1
- // Type definitions for ui/Layout
2
-
3
- import * as React from "react";
4
- import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
5
-
6
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
7
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
8
-
9
- export interface CellBaseProps {
10
- /**
11
- * The alignment of `Cell` .
12
- *
13
- * Aligns this `Cell` vertically in the case of a horizontal layout or
14
- horizontally in the case of a vertical layout. `"start"` , `"center"` and
15
- `"end"` are the most commonly used, although all values of `align-self` are supported.
16
- `"start"` refers to the top in a horizontal layout, and left in a vertical LTR layout
17
- `"end"` refers to the bottom in a horizontal layout, and right in a vertical LTR layout
18
- `"start"` and `"end"` reverse places when in a vertical layout in a RTL locale.
19
- */
20
- align?: string;
21
- /**
22
- * Any valid that should be positioned in this `Cell` .
23
- */
24
- children?: Any;
25
- /**
26
- * The type of component to use to render as the `Cell` . May be a DOM node name (e.g 'div',
27
- 'span', etc.) or a custom component.
28
- */
29
- component?: string | React.ComponentType;
30
- /**
31
- * Called with a reference to the root component.
32
- *
33
- * When using , the `ref` prop is forwarded to this component
34
- as `componentRef` .
35
- */
36
- componentRef?: object | Function;
37
- /**
38
- * Sizes `Cell` to its contents.
39
- *
40
- * A `shrink` able cell will contract to its minimum size, according to the dimensions of its
41
- contents. This is used when you want the size of this Cell's content to influence the
42
- dimensions of this cell. `shrink` will not allow the contents of the Layout to be pushed
43
- beyond its boundaries (overflowing). See the property
44
- for more details.
45
- */
46
- shrink?: boolean;
47
- /**
48
- * Sets the desired size of the Cell using any valid CSS measurement value.
49
- *
50
- * When used in conjunction with , the size will be
51
- the maximum size, shrinking as necessary, to fit the content.
52
- *
53
- * E.g.
54
- * * `size="400px"` -> cell will be 400px, regardless of the dimensions of your content
55
- * * `size="400px" shrink` -> cell will be 400px if your content is greater than 400px,
56
- and will match your contents size if it's smaller
57
- *
58
- * This accepts any valid CSS measurement value string. If a numeric value is used, it will
59
- be treated as a pixel value and converted to a
60
- based on the rules of
61
- .
62
- */
63
- size?: string | number;
64
- }
65
- /**
66
- * A stateless component that provides a space for your content in a
67
- , without applied.
68
- */
69
-
70
- export class CellBase extends React.Component<
71
- Merge<React.HTMLProps<HTMLElement>, CellBaseProps>
72
- > {}
73
-
74
- export interface CellDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
75
- export function CellDecorator<P>(
76
- Component: React.ComponentType<P> | string
77
- ): React.ComponentType<P & CellDecoratorProps>;
78
-
79
- export interface LayoutBaseProps {
80
- /**
81
- * The alignment of children.
82
- *
83
- * Aligns the children vertically in the case of a horizontal
84
- layout or horizontally in the case of a vertical layout. `"start"` , `"center"` and
85
- `"end"` are the most commonly used, although all values of `align-items` are supported.
86
- `"start"` refers to the top in a horizontal layout, and left in a vertical LTR layout
87
- `"end"` refers to the bottom in a horizontal layout, and right in a vertical LTR layout
88
- `"start"` and `"end"` reverse places when in a vertical layout in a RTL locale.
89
- This includes support for `align-parts` which is shorthand for combining `align-items`
90
- and `justify-content` into a single property, separated by a space, in that order.
91
- This allows you to specify both the horizontal and vertical alignment in one property,
92
- separated by a space.
93
- */
94
- align?: string;
95
- /**
96
- * Only components are supported as children.
97
- */
98
- children?: Cell | Cell[];
99
- /**
100
- * The type of component to use to render as the `Layout` . May be a DOM node name (e.g 'div',
101
- 'span', etc.) or a custom component.
102
- */
103
- component?: string | React.ComponentType;
104
- /**
105
- * Called with a reference to the root component.
106
- *
107
- * When using , the `ref` prop is forwarded to this component
108
- as `componentRef` .
109
- */
110
- componentRef?: object | Function;
111
- /**
112
- * Allows this `Layout` to have following siblings drawn on the same line as itself
113
- instead of carving out the entire horizontal space for itself.
114
- */
115
- inline?: boolean;
116
- /**
117
- * The orientation of the `Layout` , i.e. how the children are
118
- positioned on the screen. Must be either `'horizontal'` or `'vertical'` .
119
- */
120
- orientation?: string;
121
- /**
122
- * Sets the Layout's `flex-wrap` values.
123
- *
124
- * Determines how a Layout handles its cells if there are more than fit in the available
125
- space. This works like a normal `Boolean` prop, but also accepts strings for customization
126
- beyond the basic on/off support. In addition to `true` and `false` , the following strings
127
- are supported: 'wrap', 'nowrap', 'reverse'. 'reverse' performs standard line wrapping but
128
- additional lines are placed above/before the preceding line instead of below/after.
129
- */
130
- wrap?: boolean | string;
131
- }
132
- /**
133
- * A container for `Cell` s.
134
- *
135
- * A stateless component that acts as a containing area for to be
136
- positioned in a row or a column (horizontally or vertically, respectively. It supports an
137
- property for laying-out its contents
138
- ( `Cells` ) in an organized, readable way.
139
- *
140
- * Example:
141
- * ```
142
- import Input from '@enact/moonstone/Input';
143
- import css from './LayoutExample.less';
144
- ...
145
- <fieldset>
146
- <Layout align="center">
147
- <Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
148
- <Cell component={Input} placeholder="First" className={css.input} />
149
- </Layout>
150
- <Layout align="center">
151
- <Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
152
- <Cell component={Input} placeholder="Last" className={css.input} />
153
- </Layout>
154
- </fieldset>
155
- ```
156
- */
157
-
158
- export class LayoutBase extends React.Component<
159
- Merge<React.HTMLProps<HTMLElement>, LayoutBaseProps>
160
- > {}
161
-
162
- export interface CellProps
163
- extends Omit<Merge<CellBaseProps, CellDecoratorProps>, "componentRef"> {}
164
- /**
165
- * A stateless component that provides a space for your content in a
166
- .
167
- */
168
-
169
- export class Cell extends React.Component<
170
- Merge<React.HTMLProps<HTMLElement>, CellProps>
171
- > {}
172
-
173
- export interface LayoutDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
174
- export function LayoutDecorator<P>(
175
- Component: React.ComponentType<P> | string
176
- ): React.ComponentType<P & LayoutDecoratorProps>;
177
-
178
- export interface LayoutProps
179
- extends Omit<
180
- Merge<LayoutBaseProps, ui_ForwardRef_ForwardRefProps>,
181
- "componentRef"
182
- > {}
183
- /**
184
- * A container for `Cell` s.
185
- *
186
- * A stateless component that acts as a containing area for to be
187
- positioned in a row or a column (horizontally or vertically, respectively. It supports an
188
- property for laying-out its contents
189
- ( `Cells` ) in an organized, readable way.
190
- *
191
- * Example:
192
- * ```
193
- import Input from '@enact/moonstone/Input';
194
- import css from './LayoutExample.less';
195
- ...
196
- <fieldset>
197
- <Layout align="center">
198
- <Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
199
- <Cell component={Input} placeholder="First" className={css.input} />
200
- </Layout>
201
- <Layout align="center">
202
- <Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
203
- <Cell component={Input} placeholder="Last" className={css.input} />
204
- </Layout>
205
- </fieldset>
206
- ```
207
- */
208
-
209
- export class Layout extends React.Component<
210
- Merge<React.HTMLProps<HTMLElement>, LayoutProps>
211
- > {}
212
-
213
- export interface ColumnProps
214
- extends Merge<LayoutProps, ui_ForwardRef_ForwardRefProps> {}
215
- /**
216
- * Shorthand for `<Layout orientation="vertical">` , which positions its
217
- vertically.
218
- * ```
219
- ┌────┐
220
- ├────┤
221
- ├────┤
222
- ├────┤
223
- └────┘
224
- ```
225
- */
226
-
227
- export class Column extends React.Component<
228
- Merge<React.HTMLProps<HTMLElement>, ColumnProps>
229
- > {}
230
-
231
- export interface RowProps
232
- extends Merge<LayoutProps, ui_ForwardRef_ForwardRefProps> {}
233
- /**
234
- * Shorthand for `<Layout orientation="horizontal">` , which positions its
235
- horizontally.
236
- * ```
237
- ┌─┬─┬─┬─┐
238
- │ │ │ │ │
239
- └─┴─┴─┴─┘
240
- ```
241
- */
242
-
243
- export class Row extends React.Component<
244
- Merge<React.HTMLProps<HTMLElement>, RowProps>
245
- > {}
246
-
247
- export default Layout;