@enact/ui 4.5.2 → 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 (222) hide show
  1. package/AnnounceDecorator/Announce.js +1 -40
  2. package/AnnounceDecorator/AnnounceDecorator.js +3 -21
  3. package/AnnounceDecorator/tests/Announce-specs.js +2 -7
  4. package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -6
  5. package/AnnounceDecorator/tests/useAnnounce-specs.js +8 -19
  6. package/AnnounceDecorator/useAnnounce.js +0 -6
  7. package/BodyText/BodyText.js +8 -28
  8. package/BodyText/tests/BodyText-specs.js +0 -19
  9. package/Button/Button.js +33 -63
  10. package/Button/tests/Button-specs.js +0 -26
  11. package/CHANGELOG.md +45 -0
  12. package/Cancelable/Cancelable.js +8 -47
  13. package/Cancelable/cancelHandler.js +5 -12
  14. package/Cancelable/modalHandler.js +3 -11
  15. package/Cancelable/tests/Cancelable-specs.js +3 -57
  16. package/Changeable/Changeable.js +2 -34
  17. package/Changeable/tests/Changeable-specs.js +20 -66
  18. package/ComponentOverride/ComponentOverride.js +1 -13
  19. package/FloatingLayer/FloatingLayer.js +17 -73
  20. package/FloatingLayer/FloatingLayerContainer.js +0 -15
  21. package/FloatingLayer/FloatingLayerDecorator.js +4 -17
  22. package/FloatingLayer/Scrim.js +9 -53
  23. package/FloatingLayer/index.js +0 -4
  24. package/FloatingLayer/package.json +3 -0
  25. package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
  26. package/FloatingLayer/tests/Scrim-specs.js +0 -9
  27. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
  28. package/FloatingLayer/useFloatingLayer.js +3 -14
  29. package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
  30. package/ForwardRef/ForwardRef.js +1 -10
  31. package/GridListImageItem/GridListImageItem.js +18 -51
  32. package/Group/Group.js +5 -36
  33. package/Group/GroupItem.js +16 -33
  34. package/Group/tests/Group-specs.js +0 -32
  35. package/Heading/Heading.js +8 -36
  36. package/Heading/tests/Heading-specs.js +81 -14
  37. package/Icon/Icon.js +19 -53
  38. package/Icon/tests/Icon-specs.js +0 -22
  39. package/IconButton/IconButton.js +24 -57
  40. package/IconButton/tests/IconButton-specs.js +0 -7
  41. package/Image/Image.js +17 -46
  42. package/Image/tests/Image-specs.js +0 -14
  43. package/ImageItem/ImageItem.js +18 -47
  44. package/ImageItem/tests/ImageItem-specs.js +0 -25
  45. package/Item/Item.js +9 -33
  46. package/Item/tests/Item-specs.js +0 -24
  47. package/LabeledIcon/LabeledIcon.js +22 -53
  48. package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
  49. package/Layout/Cell.js +18 -44
  50. package/Layout/Layout.js +23 -46
  51. package/Layout/tests/Layout-specs.js +10 -39
  52. package/Marquee/MarqueeBase.js +29 -63
  53. package/Marquee/MarqueeController.js +11 -72
  54. package/Marquee/MarqueeDecorator.js +70 -196
  55. package/Marquee/index.js +1 -5
  56. package/Marquee/tests/Marquee-specs.js +295 -87
  57. package/Measurable/Measurable.js +12 -34
  58. package/Measurable/tests/Measurable-specs.js +115 -0
  59. package/Media/Media.js +15 -65
  60. package/Media/tests/Media-specs.js +168 -0
  61. package/Placeholder/PlaceholderControllerDecorator.js +7 -43
  62. package/Placeholder/PlaceholderDecorator.js +7 -38
  63. package/Placeholder/index.js +1 -5
  64. package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
  65. package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
  66. package/ProgressBar/ProgressBar.js +14 -45
  67. package/ProgressBar/tests/ProgressBar-specs.js +0 -17
  68. package/RadioDecorator/RadioControllerDecorator.js +7 -29
  69. package/RadioDecorator/RadioDecorator.js +9 -42
  70. package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
  71. package/Repeater/Repeater.js +9 -33
  72. package/Repeater/tests/Repeater-specs.js +0 -38
  73. package/Resizable/Resizable.js +9 -37
  74. package/Resizable/tests/Resizable-specs.js +34 -0
  75. package/Routable/Link.js +11 -47
  76. package/Routable/Routable.js +12 -35
  77. package/Routable/Route.js +0 -6
  78. package/Routable/Router.js +15 -58
  79. package/Routable/tests/Routable-specs.js +7 -33
  80. package/Routable/tests/Router-specs.js +18 -44
  81. package/Routable/useLink.js +4 -8
  82. package/Routable/util.js +18 -24
  83. package/Scrollable/ScrollAnimator.js +49 -65
  84. package/Scrollable/ScrollThumb.js +2 -13
  85. package/Scrollable/Scrollable.js +180 -387
  86. package/Scrollable/ScrollableNative.js +189 -392
  87. package/Scrollable/Scrollbar.js +30 -102
  88. package/Scroller/Scroller.js +15 -39
  89. package/Scroller/ScrollerBasic.js +34 -89
  90. package/Scroller/UiScrollerBase.js +37 -84
  91. package/Scroller/tests/Scroller-specs.js +56 -0
  92. package/Skinnable/Skinnable.js +11 -38
  93. package/Skinnable/tests/Skinnable-specs.js +3 -74
  94. package/Skinnable/tests/useSkins-specs.js +1 -13
  95. package/Skinnable/tests/util-specs.js +0 -14
  96. package/Skinnable/useSkins.js +8 -15
  97. package/Skinnable/util.js +9 -20
  98. package/Slider/Knob.js +5 -24
  99. package/Slider/PositionDecorator.js +16 -54
  100. package/Slider/Slider.js +29 -67
  101. package/Slider/tests/Slider-specs.js +94 -7
  102. package/Slider/utils.js +0 -2
  103. package/SlotItem/SlotItem.js +23 -45
  104. package/SlotItem/tests/SlotItem-specs.js +0 -5
  105. package/Slottable/Slottable.js +4 -12
  106. package/Slottable/tests/Slottable-specs.js +19 -46
  107. package/Slottable/tests/useSlots-specs.js +27 -65
  108. package/Slottable/useSlots.js +8 -33
  109. package/Spinner/Spinner.js +16 -43
  110. package/Spinner/tests/Spinner-specs.js +0 -15
  111. package/ToggleIcon/ToggleIcon.js +10 -36
  112. package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
  113. package/ToggleItem/ToggleItem.js +24 -57
  114. package/ToggleItem/tests/ToggleItem-specs.js +0 -30
  115. package/Toggleable/Toggle.js +1 -15
  116. package/Toggleable/Toggleable.js +12 -45
  117. package/Toggleable/tests/Toggleable-specs.js +28 -96
  118. package/Toggleable/useToggle.js +3 -19
  119. package/Touchable/ClickAllow.js +5 -14
  120. package/Touchable/Drag.js +16 -54
  121. package/Touchable/Flick.js +11 -42
  122. package/Touchable/Hold.js +21 -68
  123. package/Touchable/Pinch.js +185 -0
  124. package/Touchable/Touch.js +71 -76
  125. package/Touchable/Touchable.js +95 -75
  126. package/Touchable/config.js +27 -24
  127. package/Touchable/tests/Touchable-specs.js +360 -119
  128. package/Touchable/tests/useTouch-specs.js +6 -80
  129. package/Touchable/useTouch.js +57 -65
  130. package/Transition/Transition.js +37 -118
  131. package/Transition/tests/Transition-specs.js +20 -60
  132. package/ViewManager/Arranger.js +10 -22
  133. package/ViewManager/TransitionGroup.js +32 -107
  134. package/ViewManager/View.js +35 -91
  135. package/ViewManager/ViewManager.js +20 -84
  136. package/ViewManager/tests/View-specs.js +0 -17
  137. package/ViewManager/tests/ViewManager-specs.js +236 -305
  138. package/ViewManager/tests/test-utils.js +0 -8
  139. package/VirtualList/UiVirtualListBase.js +265 -409
  140. package/VirtualList/VirtualList.js +29 -69
  141. package/VirtualList/VirtualListBase.js +0 -3
  142. package/VirtualList/VirtualListBasic.js +273 -431
  143. package/VirtualList/tests/VirtualGridList-native-specs.js +161 -0
  144. package/VirtualList/tests/VirtualGridList-specs.js +614 -0
  145. package/VirtualList/tests/VirtualList-native-specs.js +152 -0
  146. package/VirtualList/tests/VirtualList-specs.js +423 -95
  147. package/internal/IdProvider/IdProvider.js +7 -21
  148. package/internal/IdProvider/Provider.js +4 -17
  149. package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
  150. package/internal/IdProvider/tests/useId-specs.js +6 -20
  151. package/internal/IdProvider/useId.js +0 -6
  152. package/internal/Pure/Pure.js +3 -30
  153. package/internal/Pure/tests/Pure-specs.js +88 -0
  154. package/internal/localized-fonts/localized-fonts.js +33 -62
  155. package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
  156. package/internal/selection/selection.js +1 -6
  157. package/internal/selection/tests/selection-specs.js +6 -4
  158. package/internal/validators/tests/validators-specs.js +80 -0
  159. package/internal/validators/validators.js +14 -34
  160. package/package.json +9 -3
  161. package/resolution/ResolutionDecorator.js +4 -40
  162. package/resolution/index.js +0 -7
  163. package/resolution/resolution.js +42 -80
  164. package/resolution/tests/ResolutionDecorator-specs.js +4 -11
  165. package/resolution/tests/resolution-specs.js +2 -2
  166. package/useControlledState/tests/useControlledState-specs.js +15 -46
  167. package/useControlledState/useControlledState.js +11 -22
  168. package/useScroll/ScrollAnimator.js +49 -65
  169. package/useScroll/Scrollbar.js +22 -58
  170. package/useScroll/ScrollbarTrack.js +3 -19
  171. package/useScroll/useScroll.js +267 -454
  172. package/useScroll/utilDOM.js +8 -14
  173. package/useScroll/utilEvent.js +0 -4
  174. package/AnnounceDecorator/AnnounceDecorator.d.ts +0 -64
  175. package/BodyText/BodyText.d.ts +0 -66
  176. package/Button/Button.d.ts +0 -125
  177. package/Cancelable/Cancelable.d.ts +0 -64
  178. package/Changeable/Changeable.d.ts +0 -54
  179. package/ComponentOverride/ComponentOverride.d.ts +0 -52
  180. package/ForwardRef/ForwardRef.d.ts +0 -22
  181. package/GridListImageItem/GridListImageItem.d.ts +0 -85
  182. package/Group/Group.d.ts +0 -107
  183. package/Heading/Heading.d.ts +0 -90
  184. package/Icon/Icon.d.ts +0 -88
  185. package/IconButton/IconButton.d.ts +0 -115
  186. package/Image/Image.d.ts +0 -113
  187. package/ImageItem/ImageItem.d.ts +0 -83
  188. package/Item/Item.d.ts +0 -64
  189. package/LabeledIcon/LabeledIcon.d.ts +0 -130
  190. package/Layout/Layout.d.ts +0 -247
  191. package/Marquee/index.d.ts +0 -258
  192. package/Measurable/Measurable.d.ts +0 -26
  193. package/Media/Media.d.ts +0 -99
  194. package/Placeholder/index.d.ts +0 -53
  195. package/ProgressBar/ProgressBar.d.ts +0 -92
  196. package/RadioDecorator/RadioDecorator.d.ts +0 -35
  197. package/Repeater/Repeater.d.ts +0 -83
  198. package/Resizable/Resizable.d.ts +0 -31
  199. package/Routable/Routable.d.ts +0 -148
  200. package/Scrollable/Scrollable.d.ts +0 -0
  201. package/Scroller/Scroller.d.ts +0 -276
  202. package/Skinnable/Skinnable.d.ts +0 -94
  203. package/Slider/Slider.d.ts +0 -202
  204. package/SlotItem/SlotItem.d.ts +0 -118
  205. package/Slottable/Slottable.d.ts +0 -22
  206. package/Spinner/Spinner.d.ts +0 -95
  207. package/ToggleIcon/ToggleIcon.d.ts +0 -90
  208. package/ToggleItem/ToggleItem.d.ts +0 -134
  209. package/Toggleable/Toggleable.d.ts +0 -103
  210. package/Touchable/Touchable.d.ts +0 -175
  211. package/Transition/Transition.d.ts +0 -196
  212. package/ViewManager/ViewManager.d.ts +0 -191
  213. package/VirtualList/VirtualList.d.ts +0 -530
  214. package/index.d.ts +0 -0
  215. package/internal/IdProvider/IdProvider.d.ts +0 -0
  216. package/internal/Pure/Pure.d.ts +0 -0
  217. package/internal/localized-fonts/localized-fonts.d.ts +0 -53
  218. package/internal/selection/selection.d.ts +0 -0
  219. package/internal/validators/validators.d.ts +0 -0
  220. package/resolution/index.d.ts +0 -187
  221. package/useControlledState/useControlledState.d.ts +0 -0
  222. package/useScroll/useScroll.d.ts +0 -0
@@ -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
- [Layout] 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
- [theming] .
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 [Node] 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 [size] 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 [shrink] , 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
- [relative unit] based on the rules of
61
- [resolution independence] .
62
- */
63
- size?: string | number;
64
- }
65
- /**
66
- * A stateless component that provides a space for your content in a
67
- [Layout] , 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 [Cells] 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 [Cell] 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 [Cells] 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 [Cells] to be
136
- positioned in a row or a column (horizontally or vertically, respectively. It supports an
137
- [orientation] 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
- [Layout] .
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 [Cells] to be
187
- positioned in a row or a column (horizontally or vertically, respectively. It supports an
188
- [orientation] 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
- [Cells] 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
- [Cells] 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;
@@ -1,258 +0,0 @@
1
- // Type definitions for ui/Marquee
2
-
3
- import * as React from "react";
4
-
5
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
6
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
7
-
8
- export interface MarqueeBaseProps {
9
- /**
10
- * Text alignment value of the marquee
11
- *
12
- * Valid values are:
13
- * * `'left'` ,
14
- * * `'right'` , and
15
- * * `'center'`
16
- */
17
- alignment?: string;
18
- /**
19
- * Applies animating styles such as removing the ellipsis.
20
- */
21
- animating?: boolean;
22
- /**
23
- * Sets the value of the `aria-label` attribute for the wrapped component.
24
- */
25
- "aria-label"?: string;
26
- /**
27
- * The text or a set of components that should be marqueed
28
- *
29
- * This prop may be empty in some cases, which is OK.
30
- */
31
- children?: React.ReactNode;
32
- /**
33
- * Called when mounting or unmounting with a reference to the client node
34
- */
35
- clientRef?: object | Function;
36
- /**
37
- * Customizes the component by mapping the supplied collection of CSS class names to the
38
- corresponding internal elements and states of this component.
39
- *
40
- * The following classes are supported:
41
- * * `marquee` - The root component class
42
- * * `animate` - Applied to the inner content node when the text is animating
43
- * * `spacing` - The spacing node used between the repeated content
44
- * * `text` - The inner content node
45
- * * `willAnimate` - Applied to the inner content node shortly before animation
46
- */
47
- css?: object;
48
- /**
49
- * Distance to animate the marquee
50
- *
51
- * Usually, the `distance` is the width of the text minus the width of the container
52
- */
53
- distance?: number;
54
- /**
55
- * Called when the marquee completes its animation
56
- */
57
- onMarqueeComplete?: Function;
58
- /**
59
- * Text overflow setting. Either `'clip'` or `'ellipsis'`
60
- */
61
- overflow?: "clip" | "ellipsis";
62
- /**
63
- * `true` if the directionality of the content is right-to-left
64
- */
65
- rtl?: boolean;
66
- /**
67
- * Amount of spacing, in pixels, between the instances of the content
68
- */
69
- spacing?: number;
70
- /**
71
- * Speed of marquee animation in pixels/second.
72
- */
73
- speed?: number;
74
- /**
75
- * Indicates the marquee will animate soon.
76
- *
77
- * Should be used by the component to prepare itself for animation such as promoting
78
- composite layers for improved performance.
79
- */
80
- willAnimate?: boolean;
81
- }
82
- /**
83
- * Marquees the children of the component.
84
- *
85
- * For automated marquee calculations use .
86
- */
87
-
88
- export class MarqueeBase extends React.Component<
89
- Merge<React.HTMLProps<HTMLElement>, MarqueeBaseProps>
90
- > {}
91
-
92
- export interface MarqueeControllerConfig extends Object {
93
- /**
94
- * When `true` , any `onFocus` events that bubble to the controller will start the contained
95
- `Marquee` instances. This is useful when a component contains `Marquee` instances that need to be
96
- started when sibling components are focused.
97
- */
98
- marqueeOnFocus?: boolean;
99
- }
100
- export interface MarqueeControllerProps {}
101
- export function MarqueeController<P>(
102
- config: MarqueeControllerConfig,
103
- Component: React.ComponentType<P> | string
104
- ): React.ComponentType<P & MarqueeControllerProps>;
105
-
106
- export function MarqueeController<P>(
107
- Component: React.ComponentType<P> | string
108
- ): React.ComponentType<P & MarqueeControllerProps>;
109
-
110
- export interface MarqueeDecoratorConfig extends Object {
111
- /**
112
- * Property containing the callback to stop the animation when `marqueeOn` is `'focus'`
113
- */
114
- blur?: string;
115
- /**
116
- * Optional CSS class name to customize the marquee `component`
117
- */
118
- className?: string;
119
- /**
120
- * The base marquee component wrapping the content.
121
- */
122
- component?: React.ComponentType;
123
- /**
124
- * Customizes the component by mapping the supplied collection of CSS class names to the
125
- corresponding internal elements and states of this component.
126
- *
127
- * The following classes are supported:
128
- * * `marquee` - The root component class
129
- * * `animate` - Applied to the inner content node when the text is animating
130
- * * `spacing` - The spacing node used between the repeated content
131
- * * `text` - The inner content node
132
- * * `willAnimate` - Applied to the inner content node shortly before animation
133
- */
134
- css?: object;
135
- /**
136
- * Property containing the callback to start the animation when `marqueeOn` is `'hover'`
137
- */
138
- enter?: string;
139
- /**
140
- * Property containing the callback to start the animation when `marqueeOn` is `'focus'`
141
- */
142
- focus?: string;
143
- /**
144
- * Invalidate the distance if any property (like 'inline') changes.
145
- Expects an array of props which on change trigger invalidateMetrics.
146
- */
147
- invalidateProps?: string[];
148
- /**
149
- * Property containing the callback to stop the animation when `marqueeOn` is `'hover'`
150
- */
151
- leave?: string;
152
- /**
153
- * A function that determines the text directionality of a string.
154
- *
155
- * Returns:
156
- * * `'rtl'` if the text should marquee to the right
157
- * * `'ltr'` if the text should marquee to the left
158
- */
159
- marqueeDirection?: Function;
160
- }
161
- export interface MarqueeDecoratorProps {
162
- /**
163
- * Text alignment value of the marquee. Valid values are `'left'` , `'right'` and `'center'` .
164
- */
165
- alignment?: string;
166
- /**
167
- * Children to be marqueed
168
- */
169
- children?: React.ReactNode;
170
- /**
171
- * Passed through to the wrapped component.
172
- *
173
- * Does not affect Marquee behavior except that components that are `marqueeOn="focus"`
174
- will be treated as if they were `marqueeOn="hover"` , to allow disabled (and thus,
175
- unfocusable) components to marquee.
176
- */
177
- disabled?: boolean;
178
- /**
179
- * Forces the `direction` of the marquee.
180
- *
181
- * Valid values are `'rtl'` , `'ltr'` , and `'locale'` . This includes non-text elements as well.
182
- The default behavior, if this prop is unset, is to evaluate the text content for
183
- directionality using .
184
- *
185
- * If `'locale'` , the `direction` is determined by the locale, same as .
186
- In other words, it will not consider the text content for determining the direction.
187
- */
188
- forceDirection?: string;
189
- /**
190
- * The current locale as a
191
- .
192
- */
193
- locale?: string;
194
- /**
195
- * Number of milliseconds to wait before starting marquee when `marqueeOn` is `'hover'` or
196
- `'focus'` or before restarting any marquee.
197
- */
198
- marqueeDelay?: number;
199
- /**
200
- * Disables all marquee behavior and removes supporting markup.
201
- */
202
- marqueeDisabled?: boolean;
203
- /**
204
- * Determines what triggers the marquee to start its animation.
205
- */
206
- marqueeOn?: "focus" | "hover" | "render";
207
- /**
208
- * Number of milliseconds to wait before starting marquee the first time.
209
- *
210
- * Has no effect if `marqueeOn` is not `'render'`
211
- */
212
- marqueeOnRenderDelay?: number;
213
- /**
214
- * Number of milliseconds to wait before resetting the marquee position after it
215
- finishes.
216
- *
217
- * A minimum of 40 milliseconds is enforced.
218
- */
219
- marqueeResetDelay?: number;
220
- /**
221
- * Amount of spacing between the instances of the content when animating.
222
- *
223
- * May either be a number indicating the number of pixels or a string indicating the
224
- percentage relative to the width of the component.
225
- *
226
- * _Note:_ When using a number, the value should be based on 1920x1080 display and
227
- will be scaled automatically for the current resolution using .
228
- */
229
- marqueeSpacing?: string | number;
230
- /**
231
- * Rate of marquee measured in pixels/second.
232
- */
233
- marqueeSpeed?: number;
234
- /**
235
- * Indicates the text directionality of the current locale is right-to-left
236
- */
237
- rtl?: string;
238
- }
239
- export function MarqueeDecorator<P>(
240
- config: MarqueeDecoratorConfig,
241
- Component: React.ComponentType<P> | string
242
- ): React.ComponentType<P & MarqueeDecoratorProps>;
243
-
244
- export function MarqueeDecorator<P>(
245
- Component: React.ComponentType<P> | string
246
- ): React.ComponentType<P & MarqueeDecoratorProps>;
247
-
248
- export interface MarqueeProps
249
- extends Merge<MarqueeBaseProps, MarqueeDecoratorProps> {}
250
- /**
251
- * A minimally-styled marquee component.
252
- */
253
-
254
- export class Marquee extends React.Component<
255
- Merge<React.HTMLProps<HTMLElement>, MarqueeProps>
256
- > {}
257
-
258
- export default Marquee;
@@ -1,26 +0,0 @@
1
- // Type definitions for ui/Measurable
2
-
3
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
4
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
5
-
6
- export interface MeasurableConfig extends Object {
7
- /**
8
- * Configures the prop name to pass the measurement object.
9
- */
10
- measurementProp?: string;
11
- /**
12
- * Configures the prop name to pass a function to capture a reference to the element to measure.
13
- */
14
- refProp?: string;
15
- }
16
- export interface MeasurableProps {}
17
- export function Measurable<P>(
18
- config: MeasurableConfig,
19
- Component: React.ComponentType<P> | string
20
- ): React.ComponentType<P & MeasurableProps>;
21
-
22
- export function Measurable<P>(
23
- Component: React.ComponentType<P> | string
24
- ): React.ComponentType<P & MeasurableProps>;
25
-
26
- export default Measurable;