@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
@@ -4,14 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.utilDOM = exports["default"] = void 0;
7
-
8
7
  var _warning = _interopRequireDefault(require("warning"));
9
-
10
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
-
12
9
  // At the end, wes should not use DOM APIs as well as the APIs in the `utilDOM`. If we use them, we have to try to remove them first if possible.
10
+
13
11
  var utilDOM = function () {
14
12
  // Functions
13
+
15
14
  function containsDangerously(ref, target) {
16
15
  if (!target) {
17
16
  return false;
@@ -22,9 +21,10 @@ var utilDOM = function () {
22
21
  process.env.NODE_ENV !== "production" ? (0, _warning["default"])(ref.contains, 'The `contains` function of the Ref is not supported.') : void 0;
23
22
  return ref.contains(target);
24
23
  }
25
-
26
24
  return false;
27
- } // TBD
25
+ }
26
+
27
+ // TBD
28
28
  // Need to define functions for the following DOM APIs
29
29
  // getBoundingClientRect
30
30
  // dataset.spotlightId
@@ -33,20 +33,15 @@ var utilDOM = function () {
33
33
  // removeAttribute
34
34
  // scrollLeft
35
35
  // scrollTop
36
-
37
-
38
36
  function datasetDangerously() {}
39
-
40
37
  function getBoundingClientRectDangerously() {}
41
-
42
38
  function getRectDangerously() {}
43
-
44
39
  function removeAttributeDangerously() {}
45
-
46
40
  function setAttributeDangerously() {}
47
-
48
41
  var scrollLeftDangerously = 0;
49
- var scrollTopDangerously = 0; // Return
42
+ var scrollTopDangerously = 0;
43
+
44
+ // Return
50
45
 
51
46
  return {
52
47
  containsDangerously: containsDangerously,
@@ -59,7 +54,6 @@ var utilDOM = function () {
59
54
  setAttributeDangerously: setAttributeDangerously
60
55
  };
61
56
  }();
62
-
63
57
  exports.utilDOM = utilDOM;
64
58
  var _default = utilDOM;
65
59
  exports["default"] = _default;
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.utilEvent = exports["default"] = void 0;
7
-
8
7
  // A `React.useEvent` hooks is introduced in https://github.com/facebook/react/pull/17651
9
8
  // The `useEvent` below will be replaced with the `React.useEvent` later.
10
9
  var utilEvent = function utilEvent(eventName) {
11
10
  return {
12
11
  addEventListener: function addEventListener(ref, fn, param) {
13
12
  if (!ref) return;
14
-
15
13
  if (typeof window !== 'undefined' && (ref === window || ref === document)) {
16
14
  ref.addEventListener(eventName, fn, param);
17
15
  } else if (ref.current) {
@@ -22,7 +20,6 @@ var utilEvent = function utilEvent(eventName) {
22
20
  },
23
21
  removeEventListener: function removeEventListener(ref, fn, param) {
24
22
  if (!ref) return;
25
-
26
23
  if (typeof window !== 'undefined' && (ref === window || ref === document)) {
27
24
  ref.removeEventListener(eventName, fn, param);
28
25
  } else if (ref.current) {
@@ -33,7 +30,6 @@ var utilEvent = function utilEvent(eventName) {
33
30
  }
34
31
  };
35
32
  };
36
-
37
33
  exports.utilEvent = utilEvent;
38
34
  var _default = utilEvent;
39
35
  exports["default"] = _default;
@@ -1,64 +0,0 @@
1
- // Type definitions for ui/AnnounceDecorator
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 AnnounceDecoratorProps {
9
- /**
10
- * The wrapped component's children.
11
- *
12
- * An instance of will be appended to `children` .
13
- */
14
- children?: React.ReactNode;
15
- }
16
- export function AnnounceDecorator<P>(
17
- Component: React.ComponentType<P> | string
18
- ): React.ComponentType<P & AnnounceDecoratorProps>;
19
-
20
- export interface AnnounceProps {
21
- /**
22
- * Time, in milliseconds, to wait to remove the alert message.
23
- *
24
- * Subsequent updates to the
25
- message before the timeout are ignored.
26
- */
27
- timeout?: number;
28
- }
29
- /**
30
- * An unstyled component with an imperative API to alert the user.
31
- *
32
- * The `announce()` method should be used to alert the user of behavior for accessibility.
33
- *
34
- * Example:
35
- * ```
36
- import {Announce} from '@enact/ui/AnnounceDecorator';
37
- import {Component} from 'react';
38
-
39
- class Example extends Component {
40
- notify = () => {
41
- if (this.announce) {
42
- this.announce.announce('this text will be alerted to user by TTS');
43
- }
44
- }
45
-
46
- setAnnounceRef = (announce) => {
47
- this.announce = announce;
48
- }
49
-
50
- render () {
51
- <div>
52
- <button onClick={this.notify}>Notify on Click</button>
53
- <Announce ref={this.setAnnounceRef} />
54
- </div>
55
- }
56
- }
57
- ```
58
- */
59
-
60
- export class Announce extends React.Component<
61
- Merge<React.HTMLProps<HTMLElement>, AnnounceProps>
62
- > {}
63
-
64
- export default AnnounceDecorator;
@@ -1,66 +0,0 @@
1
- // Type definitions for ui/BodyText
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 BodyTextBaseProps {
10
- /**
11
- * Centers the contents.
12
- *
13
- * Applies the `centered` CSS class which can be customized by
14
- [theming] .
15
- */
16
- centered?: boolean;
17
- /**
18
- * The type of component to use to render the item. May be a DOM node name (e.g 'div',
19
- 'p', etc.) or a custom component.
20
- */
21
- component?: React.ComponentType;
22
- /**
23
- * Called with a reference to the root component.
24
- *
25
- * When using , the `ref` prop is forwarded to this component
26
- as `componentRef` .
27
- */
28
- componentRef?: object | Function;
29
- /**
30
- * Customizes the component by mapping the supplied collection of CSS class names to the
31
- corresponding internal elements and states of this component.
32
- *
33
- * The following classes are supported:
34
- * * `bodyText` - The root class name
35
- * * `centered` - Applied when `centered` prop is `true`
36
- */
37
- css?: object;
38
- }
39
- /**
40
- * A simple, unstyled text block component, without
41
- applied.
42
- */
43
-
44
- export class BodyTextBase extends React.Component<
45
- Merge<React.HTMLProps<HTMLElement>, BodyTextBaseProps>
46
- > {}
47
-
48
- export interface BodyTextDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
49
- export function BodyTextDecorator<P>(
50
- Component: React.ComponentType<P> | string
51
- ): React.ComponentType<P & BodyTextDecoratorProps>;
52
-
53
- export interface BodyTextProps
54
- extends Omit<
55
- Merge<BodyTextBaseProps, BodyTextDecoratorProps>,
56
- "componentRef"
57
- > {}
58
- /**
59
- * A simple, unstyled text block component.
60
- */
61
-
62
- export class BodyText extends React.Component<
63
- Merge<React.HTMLProps<HTMLElement>, BodyTextProps>
64
- > {}
65
-
66
- export default BodyText;
@@ -1,125 +0,0 @@
1
- // Type definitions for ui/Button
2
-
3
- import * as React from "react";
4
- import { TouchableProps as ui_Touchable_TouchableProps } from "@enact/ui/Touchable";
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 ButtonBaseProps {
10
- /**
11
- * Called with a reference to the root component.
12
- *
13
- * When using , the `ref` prop is forwarded to this component
14
- as `componentRef` .
15
- */
16
- componentRef?: object | Function;
17
- /**
18
- * Customizes the component by mapping the supplied collection of CSS class names to the
19
- corresponding internal elements and states of this component.
20
- *
21
- * The following classes are supported:
22
- * * `button` - The root component class
23
- * * `bg` - The background node of the button
24
- * * `client` - The content node of the button
25
- * * `hasIcon` - Applied when there is an `icon` present
26
- * * `icon` - The icon node, when `icon` is set
27
- * * `large` - Applied when `size` prop is `'large'`
28
- * * `minWidth` - Applied when `minWidth` prop is `true`
29
- * * `pressed` - Applied when `pressed` prop is `true`
30
- * * `selected` - Applied when `selected` prop is `true`
31
- * * `small` - Applied when `size` prop is `'small'`
32
- */
33
- css?: object;
34
- /**
35
- * Applies the `disabled` class.
36
- *
37
- * When `true` , the button is shown as disabled.
38
- */
39
- disabled?: boolean;
40
- /**
41
- * The icon displayed within the Button.
42
- *
43
- * The icon will be displayed before the natural reading order of the text, regardless
44
- of locale. Any string that is valid for its is
45
- valid here. If `icon` is specified as a string and `iconButton` is undefined, the icon is
46
- not rendered.
47
- *
48
- * This also supports a custom icon, in the form of a DOM node or a Component,
49
- with the caveat that if you supply a custom icon, you are responsible for sizing and
50
- locale positioning of the custom component.
51
- *
52
- * Setting this to `true` means the `iconComponent` will be rendered but with empty content.
53
- This may be useful if you've customized the `iconComponent` to render the icon content
54
- externally.
55
- */
56
- icon?: React.ReactNode | boolean;
57
- /**
58
- * The component used to render the [icon] .
59
- *
60
- * This component will receive the `icon` class to customize its styling.
61
- If [icon] is not assigned or is false, this component
62
- will not be rendered.
63
- *
64
- * If this is a component rather than an HTML element string, this component will also
65
- receive the `size` and `iconFlip` (as `flip` ) properties and should be configured to
66
- handle it.
67
- */
68
- iconComponent?: React.ComponentType | React.ReactNode;
69
- /**
70
- * Flips the icon.
71
- */
72
- iconFlip?: string;
73
- /**
74
- * Enforces a minimum width for the component.
75
- *
76
- * Applies the `minWidth` CSS class which can be customized by
77
- [theming] .
78
- */
79
- minWidth?: boolean;
80
- /**
81
- * Indicates the component is depressed.
82
- *
83
- * Applies the `pressed` CSS class which can be customized by
84
- [theming] .
85
- */
86
- pressed?: boolean;
87
- /**
88
- * Indicates the component is selected.
89
- *
90
- * Applies the `selected` CSS class which can be customized by
91
- [theming] .
92
- */
93
- selected?: boolean;
94
- /**
95
- * The size of the button.
96
- *
97
- * Applies the CSS class which can be customized by
98
- [theming] .
99
- */
100
- size?: string;
101
- }
102
- /**
103
- * A basic button component structure without any behaviors applied to it.
104
- */
105
-
106
- export class ButtonBase extends React.Component<
107
- Merge<React.HTMLProps<HTMLElement>, ButtonBaseProps>
108
- > {}
109
-
110
- export interface ButtonDecoratorProps extends ui_Touchable_TouchableProps {}
111
- export function ButtonDecorator<P>(
112
- Component: React.ComponentType<P> | string
113
- ): React.ComponentType<P & ButtonDecoratorProps>;
114
-
115
- export interface ButtonProps
116
- extends Omit<Merge<ButtonBaseProps, ButtonDecoratorProps>, "componentRef"> {}
117
- /**
118
- * A minimally-styled button component with touch support.
119
- */
120
-
121
- export class Button extends React.Component<
122
- Merge<React.HTMLProps<HTMLElement>, ButtonProps>
123
- > {}
124
-
125
- export default Button;
@@ -1,64 +0,0 @@
1
- // Type definitions for ui/Cancelable
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 CancelableConfig extends Object {
7
- /**
8
- * Called when a cancel action is invoked by the user.
9
- *
10
- * If it is a string, the cancel handler will attempt to invoke a function passed as a prop of
11
- that name. If it is a function, that function will be called with the current props as the
12
- only argument.
13
- *
14
- * If the function handles the cancel action, it should call `stopPropagation()` on the provided
15
- event object prevent container or `modal` Cancelable instances from also handling the action.
16
- */
17
- onCancel: string | Function;
18
- /**
19
- * Subscribes to cancel events globally for this instance.
20
- *
21
- * When `true` , the `Cancelable` instance will handle cancel events globally that successfully
22
- bubble up to `window` regardless of which component is focused.
23
- *
24
- * `modal` cancel handlers are processed in reverse of the order they are created such that the
25
- innermost instance (in terms of the component hierarchy) have the first opportunity to handle
26
- the event before its container components.
27
- */
28
- modal?: string;
29
- /**
30
- * The component that will contain the wrapped component.
31
- *
32
- * When set, the wrapped component will be contained within an instance of `component` . This may
33
- be necessary if the props passed to the wrapped component are not placed on the root element.
34
- */
35
- component?: React.ComponentType;
36
- }
37
- export interface CancelableProps {
38
- /**
39
- * Called when a cancel action is received.
40
- *
41
- * This callback is invoked for every cancel action before the config or prop handler is
42
- invoked.
43
- */
44
- onCancel?: Function;
45
- }
46
- export function Cancelable<P>(
47
- config: CancelableConfig,
48
- Component: React.ComponentType<P> | string
49
- ): React.ComponentType<P & CancelableProps>;
50
-
51
- export function Cancelable<P>(
52
- Component: React.ComponentType<P> | string
53
- ): React.ComponentType<P & CancelableProps>;
54
-
55
- /**
56
- * Adds an event handler to filter cancel events.
57
- */
58
- export function addCancelHandler(handler: Function): void;
59
- /**
60
- * Removes an event handler to filter cancel events
61
- */
62
- export function removeCancelHandler(handler: Function): void;
63
-
64
- export default Cancelable;
@@ -1,54 +0,0 @@
1
- // Type definitions for ui/Changeable
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 ChangeableConfig extends Object {
7
- /**
8
- * Configures the prop name to pass the callback to change the value
9
- */
10
- change?: string;
11
- /**
12
- * Configures the prop name to pass the current value
13
- */
14
- prop?: string;
15
- }
16
- export interface ChangeableProps {
17
- /**
18
- * Called to notify `Changeable` that the value has changed.
19
- *
20
- * The event object must contain a property with the same name as the configured `prop` .
21
- */
22
- onChange?: Function;
23
- /**
24
- * The value set at construction when the value prop is `undefined` or `null` .
25
- *
26
- * This prop is consumed by `Changeable` and not passed onto the wrapped component.
27
- */
28
- defaultValue?: any;
29
- /**
30
- * The current value.
31
- *
32
- * When set at construction, the component is considered "controlled" and will only
33
- update its internal value when updated by new props. If `undefined` , the component is
34
- "uncontrolled" and `Changeable` will manage the value using callbacks defined by its
35
- configuration.
36
- */
37
- prop?: any;
38
- /**
39
- * Prevents updates to the internal state of `Changeable` .
40
- *
41
- * `disabled` is forwarded on to the wrapped component.
42
- */
43
- disabled?: boolean;
44
- }
45
- export function Changeable<P>(
46
- config: ChangeableConfig,
47
- Component: React.ComponentType<P> | string
48
- ): React.ComponentType<P & ChangeableProps>;
49
-
50
- export function Changeable<P>(
51
- Component: React.ComponentType<P> | string
52
- ): React.ComponentType<P & ChangeableProps>;
53
-
54
- export default Changeable;
@@ -1,52 +0,0 @@
1
- // Type definitions for ui/ComponentOverride
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 ComponentOverrideProps {}
9
- /**
10
- * Utility to either create or clone a component instance with the given set of props.
11
- *
12
- * `ComponentOverride` can be used to support props that either accept a type, (e.g. `Button` ) or an
13
- element (e.g. `<Button customProp="value" />` ) and return a new element which includes the
14
- remaining props specified.
15
- *
16
- * Example:
17
- * ```
18
- const LabeledIconButton = ({iconComponent, label, ...rest}) => {
19
- return (
20
- <div {...rest}>
21
- <ComponentOverride
22
- component={iconComponent}
23
- icon="house"
24
- />
25
- <span>{label}</span>
26
- </div>
27
- );
28
- };
29
-
30
- // Usage
31
-
32
- // Only the props defined by LabeledIconButton will be passed to CustomIcon
33
- <LabeledIconButton
34
- label="Home"
35
- iconComponent={CustomIcon}
36
- />
37
-
38
- // The color prop along with props defined by LabeledIconButton will be passed to CustomIcon
39
- <LabeledIconButton
40
- label="Home"
41
- iconComponent={
42
- <CustomIcon color="green" />
43
- }
44
- />
45
- ```
46
- */
47
-
48
- export class ComponentOverride extends React.Component<
49
- Merge<React.HTMLProps<HTMLElement>, ComponentOverrideProps>
50
- > {}
51
-
52
- export default ComponentOverride;
@@ -1,22 +0,0 @@
1
- // Type definitions for ui/ForwardRef
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 ForwardRefConfig extends Object {
7
- /**
8
- * The prop name to pass the ref callback
9
- */
10
- prop?: string;
11
- }
12
- export interface ForwardRefProps {}
13
- export function ForwardRef<P>(
14
- config: ForwardRefConfig,
15
- Component: React.ComponentType<P> | string
16
- ): React.ComponentType<P & ForwardRefProps>;
17
-
18
- export function ForwardRef<P>(
19
- Component: React.ComponentType<P> | string
20
- ): React.ComponentType<P & ForwardRefProps>;
21
-
22
- export default ForwardRef;
@@ -1,85 +0,0 @@
1
- // Type definitions for ui/GridListImageItem
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 GridListImageItemProps {
9
- /**
10
- * The primary caption to be displayed with the image.
11
- */
12
- caption?: string;
13
- /**
14
- * The component used to render the captions
15
- */
16
- captionComponent?: string | React.ComponentType;
17
- /**
18
- * Customizes the component by mapping the supplied collection of CSS class names to the
19
- corresponding internal elements and states of this component.
20
- *
21
- * The following classes are supported:
22
- * * `icon` - The icon component class for default selection overlay
23
- * * `image` - The image component class
24
- * * `selected` - Applied when `selected` prop is `true`
25
- * * `caption` - The caption component class
26
- * * `subCaption` - The subCaption component class
27
- */
28
- css?: object;
29
- /**
30
- * The component used to render the default check icon when selected.
31
- If there is custom selectionOverlay component, this icon will not be shown.
32
- */
33
- iconComponent?: React.ComponentType;
34
- /**
35
- * The component used to render the image component
36
- */
37
- imageComponent?: React.ComponentType;
38
- /**
39
- * Placeholder image used while [source]
40
- is loaded.
41
- */
42
- placeholder?: string;
43
- /**
44
- * Applies a selected visual effect to the image, but only if `selectionOverlayShowing`
45
- is also `true` .
46
- */
47
- selected?: boolean;
48
- /**
49
- * The custom selection overlay component to render.
50
- *
51
- * A component can be a stateless functional component, `kind()` or React component.
52
- The following is an example with custom selection overlay kind.
53
- *
54
- * Example:
55
- * ```
56
- const SelectionOverlay = kind({
57
- render: () => <div>custom overlay</div>
58
- });
59
-
60
- <GridListImageItem selectionOverlay={SelectionOverlay} />
61
- ```
62
- */
63
- selectionOverlay?: Function;
64
- /**
65
- * Shows a selection overlay with a centered icon. When `selected` is true, a check mark is shown.
66
- */
67
- selectionOverlayShowing?: boolean;
68
- /**
69
- * The absolute URL path to the image.
70
- */
71
- source?: string;
72
- /**
73
- * The second caption line to be displayed with the image.
74
- */
75
- subCaption?: string;
76
- }
77
- /**
78
- * A basic grid list image item without any behavior.
79
- */
80
-
81
- export class GridListImageItem extends React.Component<
82
- Merge<React.HTMLProps<HTMLElement>, GridListImageItemProps>
83
- > {}
84
-
85
- export default GridListImageItem;