@instructure/ui-options 8.12.1-snapshot.7 → 8.13.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es/Options/Item/OptionsItemLocator.js +2 -2
  3. package/es/Options/Item/__examples__/Item.examples.js +2 -0
  4. package/es/Options/Item/index.js +3 -2
  5. package/es/Options/Item/props.js +0 -21
  6. package/es/Options/OptionsLocator.js +4 -4
  7. package/es/Options/Separator/index.js +1 -0
  8. package/es/Options/Separator/props.js +0 -3
  9. package/es/Options/index.js +4 -3
  10. package/es/Options/props.js +0 -15
  11. package/lib/Options/Item/OptionsItemLocator.js +2 -2
  12. package/lib/Options/Item/__examples__/Item.examples.js +2 -0
  13. package/lib/Options/Item/index.js +4 -3
  14. package/lib/Options/Item/props.js +1 -22
  15. package/lib/Options/OptionsLocator.js +4 -4
  16. package/lib/Options/Separator/index.js +2 -1
  17. package/lib/Options/Separator/props.js +1 -4
  18. package/lib/Options/index.js +5 -4
  19. package/lib/Options/props.js +1 -16
  20. package/package.json +15 -16
  21. package/src/Options/Item/__examples__/Item.examples.ts +4 -2
  22. package/src/Options/Item/index.tsx +10 -3
  23. package/src/Options/Item/props.ts +25 -21
  24. package/src/Options/README.md +1 -1
  25. package/src/Options/Separator/index.tsx +1 -0
  26. package/src/Options/Separator/props.ts +3 -3
  27. package/src/Options/index.tsx +3 -4
  28. package/src/Options/props.ts +15 -13
  29. package/types/Options/Item/__examples__/Item.examples.d.ts +15 -1
  30. package/types/Options/Item/__examples__/Item.examples.d.ts.map +1 -1
  31. package/types/Options/Item/index.d.ts +7 -10
  32. package/types/Options/Item/index.d.ts.map +1 -1
  33. package/types/Options/Item/props.d.ts +24 -4
  34. package/types/Options/Item/props.d.ts.map +1 -1
  35. package/types/Options/Separator/index.d.ts +1 -0
  36. package/types/Options/Separator/index.d.ts.map +1 -1
  37. package/types/Options/Separator/props.d.ts +3 -0
  38. package/types/Options/Separator/props.d.ts.map +1 -1
  39. package/types/Options/index.d.ts +5 -4
  40. package/types/Options/index.d.ts.map +1 -1
  41. package/types/Options/props.d.ts +13 -1
  42. package/types/Options/props.d.ts.map +1 -1
  43. package/LICENSE.md +0 -27
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [8.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
7
+
8
+ ### Features
9
+
10
+ - **canvas-theme,ui-theme-tokens,ui-themes:** update canvas theme colors ([a72237d](https://github.com/instructure/instructure-ui/commit/a72237dc213b86aa8f18da2618559ea4c118e1dd))
11
+
6
12
  # [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
13
 
8
14
  **Note:** Version bump only for package @instructure/ui-options
@@ -25,7 +25,7 @@ import { locator } from '@instructure/ui-test-locator';
25
25
  import { OptionsLocator } from '../OptionsLocator';
26
26
  import { Item } from './index';
27
27
  export const OptionsItemLocator = locator(Item.selector, {
28
- findNestedOptions: (...args) => {
29
- return OptionsLocator.find(...args);
28
+ findNestedOptions: function () {
29
+ return OptionsLocator.find(...arguments);
30
30
  }
31
31
  });
@@ -30,6 +30,8 @@ export default {
30
30
  },
31
31
  getComponentProps: props => {
32
32
  return {
33
+ renderAfterLabel: props.renderAfterLabel,
34
+ renderBeforeLabel: props.renderBeforeLabel,
33
35
  children: 'Lorem ipsum dolor sit amet',
34
36
  role: 'none'
35
37
  };
@@ -37,11 +37,12 @@ import { allowedProps, propTypes } from './props';
37
37
  parent: Options
38
38
  id: Options.Item
39
39
  ---
40
+ @tsProps
40
41
  **/
41
42
 
42
43
  let Item = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Item extends Component {
43
- constructor(...args) {
44
- super(...args);
44
+ constructor() {
45
+ super(...arguments);
45
46
  this.ref = null;
46
47
  }
47
48
 
@@ -23,31 +23,10 @@
23
23
  */
24
24
  import PropTypes from 'prop-types';
25
25
  const propTypes = {
26
- /**
27
- * Element type to render as
28
- */
29
26
  as: PropTypes.elementType,
30
-
31
- /**
32
- * The style variant of the item
33
- */
34
27
  variant: PropTypes.oneOf(['default', 'highlighted', 'selected', 'disabled']),
35
-
36
- /**
37
- * The aria role of the element
38
- */
39
28
  role: PropTypes.string,
40
-
41
- /**
42
- * Content to render before the label
43
- * (if you pass a function, it has the `props` as its parameter)
44
- */
45
29
  renderBeforeLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
46
-
47
- /**
48
- * Content to render after the label
49
- * (if you pass a function, it has the `props` as its parameter)
50
- */
51
30
  renderAfterLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
52
31
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
53
32
  };
@@ -25,10 +25,10 @@ import { locator } from '@instructure/ui-test-locator';
25
25
  import { Options } from './index';
26
26
  import { OptionsItemLocator } from './Item/OptionsItemLocator';
27
27
  export const OptionsLocator = locator(Options.selector, {
28
- findAllItems: (...args) => {
29
- return OptionsItemLocator.findAll(...args);
28
+ findAllItems: function () {
29
+ return OptionsItemLocator.findAll(...arguments);
30
30
  },
31
- findItem: (...args) => {
32
- return OptionsItemLocator.find(...args);
31
+ findItem: function () {
32
+ return OptionsItemLocator.find(...arguments);
33
33
  }
34
34
  });
@@ -40,6 +40,7 @@ parent: Options
40
40
  id: Options.Separator
41
41
  ---
42
42
  @module Separator
43
+ @tsProps
43
44
  **/
44
45
 
45
46
  let Separator = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(_class = (_temp = _class2 = class Separator extends Component {
@@ -23,9 +23,6 @@
23
23
  */
24
24
  import PropTypes from 'prop-types';
25
25
  const propTypes = {
26
- /**
27
- * Element type to render as
28
- */
29
26
  as: PropTypes.elementType
30
27
  };
31
28
  const allowedProps = ['as'];
@@ -40,11 +40,12 @@ import { allowedProps, propTypes } from './props';
40
40
  ---
41
41
  category: components
42
42
  ---
43
+ @tsProps
43
44
  **/
44
45
 
45
46
  let Options = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Options extends Component {
46
- constructor(...args) {
47
- super(...args);
47
+ constructor() {
48
+ super(...arguments);
48
49
  this.ref = null;
49
50
 
50
51
  this.handleRef = el => {
@@ -142,7 +143,7 @@ let Options = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 =
142
143
  }, _class2.displayName = "Options", _class2.componentId = 'Options', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
143
144
  as: 'span',
144
145
  role: 'list',
145
- elementRef: node => {},
146
+ elementRef: () => {},
146
147
  renderLabel: null,
147
148
  children: null
148
149
  }, _class2.Item = Item, _class2.Separator = Separator, _temp)) || _class) || _class);
@@ -24,24 +24,9 @@
24
24
  import PropTypes from 'prop-types';
25
25
  import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
26
26
  const propTypes = {
27
- /**
28
- * Element type to render as
29
- */
30
27
  as: PropTypes.elementType,
31
-
32
- /**
33
- * The aria role of the element
34
- */
35
28
  role: PropTypes.string,
36
-
37
- /**
38
- * The the actual list element
39
- */
40
29
  elementRef: PropTypes.func,
41
-
42
- /**
43
- * Content to render as a label. Mostly for when the component is nested
44
- */
45
30
  renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
46
31
  children: ChildrenPropTypes.oneOf(['Options', 'Item', 'Separator'])
47
32
  };
@@ -35,8 +35,8 @@ var _index = require("./index");
35
35
  * SOFTWARE.
36
36
  */
37
37
  const OptionsItemLocator = (0, _uiTestLocator.locator)(_index.Item.selector, {
38
- findNestedOptions: (...args) => {
39
- return _OptionsLocator.OptionsLocator.find(...args);
38
+ findNestedOptions: function () {
39
+ return _OptionsLocator.OptionsLocator.find(...arguments);
40
40
  }
41
41
  });
42
42
  exports.OptionsItemLocator = OptionsItemLocator;
@@ -38,6 +38,8 @@ var _default = {
38
38
  },
39
39
  getComponentProps: props => {
40
40
  return {
41
+ renderAfterLabel: props.renderAfterLabel,
42
+ renderBeforeLabel: props.renderBeforeLabel,
41
43
  children: 'Lorem ipsum dolor sit amet',
42
44
  role: 'none'
43
45
  };
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Item = exports.default = void 0;
8
+ exports.default = exports.Item = void 0;
9
9
 
10
10
  var _react = require("react");
11
11
 
@@ -28,10 +28,11 @@ var _dec, _dec2, _class, _class2, _temp;
28
28
  parent: Options
29
29
  id: Options.Item
30
30
  ---
31
+ @tsProps
31
32
  **/
32
33
  let Item = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class Item extends _react.Component {
33
- constructor(...args) {
34
- super(...args);
34
+ constructor() {
35
+ super(...arguments);
35
36
  this.ref = null;
36
37
  }
37
38
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -33,31 +33,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
33
33
  * SOFTWARE.
34
34
  */
35
35
  const propTypes = {
36
- /**
37
- * Element type to render as
38
- */
39
36
  as: _propTypes.default.elementType,
40
-
41
- /**
42
- * The style variant of the item
43
- */
44
37
  variant: _propTypes.default.oneOf(['default', 'highlighted', 'selected', 'disabled']),
45
-
46
- /**
47
- * The aria role of the element
48
- */
49
38
  role: _propTypes.default.string,
50
-
51
- /**
52
- * Content to render before the label
53
- * (if you pass a function, it has the `props` as its parameter)
54
- */
55
39
  renderBeforeLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
56
-
57
- /**
58
- * Content to render after the label
59
- * (if you pass a function, it has the `props` as its parameter)
60
- */
61
40
  renderAfterLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
62
41
  children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
63
42
  };
@@ -35,11 +35,11 @@ var _OptionsItemLocator = require("./Item/OptionsItemLocator");
35
35
  * SOFTWARE.
36
36
  */
37
37
  const OptionsLocator = (0, _uiTestLocator.locator)(_index.Options.selector, {
38
- findAllItems: (...args) => {
39
- return _OptionsItemLocator.OptionsItemLocator.findAll(...args);
38
+ findAllItems: function () {
39
+ return _OptionsItemLocator.OptionsItemLocator.findAll(...arguments);
40
40
  },
41
- findItem: (...args) => {
42
- return _OptionsItemLocator.OptionsItemLocator.find(...args);
41
+ findItem: function () {
42
+ return _OptionsItemLocator.OptionsItemLocator.find(...arguments);
43
43
  }
44
44
  });
45
45
  exports.OptionsLocator = OptionsLocator;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Separator = exports.default = void 0;
8
+ exports.default = exports.Separator = void 0;
9
9
 
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
 
@@ -31,6 +31,7 @@ parent: Options
31
31
  id: Options.Separator
32
32
  ---
33
33
  @module Separator
34
+ @tsProps
34
35
  **/
35
36
  let Separator = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = class Separator extends _react.Component {
36
37
  componentDidMount() {
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -33,9 +33,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
33
33
  * SOFTWARE.
34
34
  */
35
35
  const propTypes = {
36
- /**
37
- * Element type to render as
38
- */
39
36
  as: _propTypes.default.elementType
40
37
  };
41
38
  exports.propTypes = propTypes;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.Options = exports.default = void 0;
8
+ exports.default = exports.Options = void 0;
9
9
 
10
10
  var _react = require("react");
11
11
 
@@ -35,10 +35,11 @@ var _dec, _dec2, _class, _class2, _temp;
35
35
  ---
36
36
  category: components
37
37
  ---
38
+ @tsProps
38
39
  **/
39
40
  let Options = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class Options extends _react.Component {
40
- constructor(...args) {
41
- super(...args);
41
+ constructor() {
42
+ super(...arguments);
42
43
  this.ref = null;
43
44
 
44
45
  this.handleRef = el => {
@@ -137,7 +138,7 @@ let Options = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
137
138
  }, _class2.displayName = "Options", _class2.componentId = 'Options', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
138
139
  as: 'span',
139
140
  role: 'list',
140
- elementRef: node => {},
141
+ elementRef: () => {},
141
142
  renderLabel: null,
142
143
  children: null
143
144
  }, _class2.Item = _Item.Item, _class2.Separator = _Separator.Separator, _temp)) || _class) || _class);
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
@@ -35,24 +35,9 @@ var _uiPropTypes = require("@instructure/ui-prop-types");
35
35
  * SOFTWARE.
36
36
  */
37
37
  const propTypes = {
38
- /**
39
- * Element type to render as
40
- */
41
38
  as: _propTypes.default.elementType,
42
-
43
- /**
44
- * The aria role of the element
45
- */
46
39
  role: _propTypes.default.string,
47
-
48
- /**
49
- * The the actual list element
50
- */
51
40
  elementRef: _propTypes.default.func,
52
-
53
- /**
54
- * Content to render as a label. Mostly for when the component is nested
55
- */
56
41
  renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
57
42
  children: _uiPropTypes.Children.oneOf(['Options', 'Item', 'Separator'])
58
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-options",
3
- "version": "8.12.1-snapshot.7+1e7ac8219",
3
+ "version": "8.13.0",
4
4
  "description": "A view-only component for composing interactive lists and menus.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -24,22 +24,22 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/ui-babel-preset": "8.12.1-snapshot.7+1e7ac8219",
28
- "@instructure/ui-color-utils": "8.12.1-snapshot.7+1e7ac8219",
29
- "@instructure/ui-test-locator": "8.12.1-snapshot.7+1e7ac8219",
30
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219",
31
- "@instructure/ui-themes": "8.12.1-snapshot.7+1e7ac8219"
27
+ "@instructure/ui-babel-preset": "8.13.0",
28
+ "@instructure/ui-color-utils": "8.13.0",
29
+ "@instructure/ui-test-locator": "8.13.0",
30
+ "@instructure/ui-test-utils": "8.13.0",
31
+ "@instructure/ui-themes": "8.13.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.13.10",
35
- "@instructure/emotion": "8.12.1-snapshot.7+1e7ac8219",
36
- "@instructure/shared-types": "8.12.1-snapshot.7+1e7ac8219",
37
- "@instructure/ui-icons": "8.12.1-snapshot.7+1e7ac8219",
38
- "@instructure/ui-prop-types": "8.12.1-snapshot.7+1e7ac8219",
39
- "@instructure/ui-react-utils": "8.12.1-snapshot.7+1e7ac8219",
40
- "@instructure/ui-testable": "8.12.1-snapshot.7+1e7ac8219",
41
- "@instructure/ui-view": "8.12.1-snapshot.7+1e7ac8219",
42
- "@instructure/uid": "8.12.1-snapshot.7+1e7ac8219",
35
+ "@instructure/emotion": "8.13.0",
36
+ "@instructure/shared-types": "8.13.0",
37
+ "@instructure/ui-icons": "8.13.0",
38
+ "@instructure/ui-prop-types": "8.13.0",
39
+ "@instructure/ui-react-utils": "8.13.0",
40
+ "@instructure/ui-testable": "8.13.0",
41
+ "@instructure/ui-view": "8.13.0",
42
+ "@instructure/uid": "8.13.0",
43
43
  "prop-types": "^15"
44
44
  },
45
45
  "peerDependencies": {
@@ -48,6 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "sideEffects": false,
52
- "gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
51
+ "sideEffects": false
53
52
  }
@@ -22,6 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
  import { IconCheckSolid, IconArrowOpenEndSolid } from '@instructure/ui-icons'
25
+ import { OptionsItemProps } from '../props'
25
26
 
26
27
  export default {
27
28
  maxExamplesPerPage: 50,
@@ -29,9 +30,10 @@ export default {
29
30
  renderAfterLabel: [null, IconArrowOpenEndSolid],
30
31
  renderBeforeLabel: [null, IconCheckSolid]
31
32
  },
32
- // @ts-expect-error ts-migrate(6133) FIXME: 'props' is declared but its value is never read.
33
- getComponentProps: (props) => {
33
+ getComponentProps: (props: OptionsItemProps) => {
34
34
  return {
35
+ renderAfterLabel: props.renderAfterLabel,
36
+ renderBeforeLabel: props.renderBeforeLabel,
35
37
  children: 'Lorem ipsum dolor sit amet',
36
38
  role: 'none'
37
39
  }
@@ -36,7 +36,7 @@ import { withStyle, jsx } from '@instructure/emotion'
36
36
 
37
37
  import generateStyles from './styles'
38
38
  import generateComponentTheme from './theme'
39
- import type { OptionsItemProps } from './props'
39
+ import type { OptionsItemProps, OptionsItemStyle } from './props'
40
40
  import { allowedProps, propTypes } from './props'
41
41
 
42
42
  /**
@@ -44,6 +44,7 @@ import { allowedProps, propTypes } from './props'
44
44
  parent: Options
45
45
  id: Options.Item
46
46
  ---
47
+ @tsProps
47
48
  **/
48
49
  @withStyle(generateStyles, generateComponentTheme)
49
50
  @testable()
@@ -72,8 +73,14 @@ class Item extends Component<OptionsItemProps> {
72
73
  this.props.makeStyles?.()
73
74
  }
74
75
 
75
- // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'renderLabel' implicitly has an 'any' ty... Remove this comment to see the full error message
76
- renderContent(renderLabel, contentVariant) {
76
+ renderContent(
77
+ renderLabel:
78
+ | OptionsItemProps['renderBeforeLabel']
79
+ | OptionsItemProps['renderAfterLabel'],
80
+ contentVariant:
81
+ | OptionsItemStyle['contentBefore']
82
+ | OptionsItemStyle['contentAfter']
83
+ ) {
77
84
  const { styles, variant, as, role, children } = this.props
78
85
 
79
86
  return (
@@ -33,13 +33,34 @@ import type {
33
33
  } from '@instructure/shared-types'
34
34
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
35
35
 
36
- type OptionsItemOwnProps = {
36
+ type ItemProps = {
37
+ children?: React.ReactNode | (() => React.ReactNode)
38
+ /**
39
+ * Element type to render as
40
+ */
37
41
  as?: AsElementType
42
+ /**
43
+ * The style variant of the item
44
+ */
38
45
  variant?: 'default' | 'highlighted' | 'selected' | 'disabled'
46
+ /**
47
+ * The aria role of the element
48
+ */
39
49
  role?: string
40
- renderBeforeLabel?: React.ReactNode | ((...args: any[]) => any)
41
- renderAfterLabel?: React.ReactNode | ((...args: any[]) => any)
42
- children?: React.ReactNode | ((...args: any[]) => React.ReactNode)
50
+ }
51
+
52
+ type OptionsItemOwnProps = ItemProps & {
53
+ /**
54
+ * Content to render before the label
55
+ * (if you pass a function, it has the `props` as its parameter)
56
+ */
57
+ renderBeforeLabel?: React.ReactNode | ((props: ItemProps) => React.ReactNode)
58
+ /**
59
+ * Content to render after the label
60
+ * (if you pass a function, it has the `props` as its parameter)
61
+ */
62
+ renderAfterLabel?: React.ReactNode | ((props: ItemProps) => React.ReactNode)
63
+ children?: React.ReactNode | (() => React.ReactNode)
43
64
  }
44
65
 
45
66
  type PropKeys = keyof OptionsItemOwnProps
@@ -55,27 +76,10 @@ type OptionsItemStyle = ComponentStyle<
55
76
  >
56
77
 
57
78
  const propTypes: PropValidators<PropKeys> = {
58
- /**
59
- * Element type to render as
60
- */
61
79
  as: PropTypes.elementType,
62
- /**
63
- * The style variant of the item
64
- */
65
80
  variant: PropTypes.oneOf(['default', 'highlighted', 'selected', 'disabled']),
66
- /**
67
- * The aria role of the element
68
- */
69
81
  role: PropTypes.string,
70
- /**
71
- * Content to render before the label
72
- * (if you pass a function, it has the `props` as its parameter)
73
- */
74
82
  renderBeforeLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
75
- /**
76
- * Content to render after the label
77
- * (if you pass a function, it has the `props` as its parameter)
78
- */
79
83
  renderAfterLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
80
84
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
81
85
  }
@@ -265,7 +265,7 @@ render(
265
265
  label: 'Text is green',
266
266
  extraProps: {
267
267
  renderBeforeLabel: IconCheckSolid,
268
- themeOverride: { color: "#00AC18" }
268
+ themeOverride: { color: "#0B874B" }
269
269
  }
270
270
  },
271
271
  {
@@ -40,6 +40,7 @@ parent: Options
40
40
  id: Options.Separator
41
41
  ---
42
42
  @module Separator
43
+ @tsProps
43
44
  **/
44
45
  @withStyle(generateStyles, generateComponentTheme)
45
46
  class Separator extends Component<OptionsSeparatorProps> {
@@ -33,6 +33,9 @@ import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
33
33
  import { AllHTMLAttributes } from 'react'
34
34
 
35
35
  type OptionsSeparatorOwnProps = {
36
+ /**
37
+ * Element type to render as
38
+ */
36
39
  as?: AsElementType
37
40
  }
38
41
 
@@ -47,9 +50,6 @@ type OptionsSeparatorProps = OptionsSeparatorOwnProps &
47
50
  type OptionsSeparatorStyle = ComponentStyle<'separator'>
48
51
 
49
52
  const propTypes: PropValidators<PropKeys> = {
50
- /**
51
- * Element type to render as
52
- */
53
53
  as: PropTypes.elementType
54
54
  }
55
55
 
@@ -50,6 +50,7 @@ import { allowedProps, propTypes } from './props'
50
50
  ---
51
51
  category: components
52
52
  ---
53
+ @tsProps
53
54
  **/
54
55
  @withStyle(generateStyles, generateComponentTheme)
55
56
  @testable()
@@ -62,8 +63,7 @@ class Options extends Component<OptionsProps> {
62
63
  static defaultProps = {
63
64
  as: 'span',
64
65
  role: 'list',
65
- // @ts-expect-error ts-migrate(6133) FIXME: 'node' is declared but its value is never read.
66
- elementRef: (node) => {},
66
+ elementRef: () => {},
67
67
  renderLabel: null,
68
68
  children: null
69
69
  }
@@ -109,8 +109,7 @@ class Options extends Component<OptionsProps> {
109
109
  )
110
110
  }
111
111
 
112
- // @ts-expect-error ts-migrate(7006) FIXME: Parameter 'children' implicitly has an 'any' type.
113
- renderSubList(children) {
112
+ renderSubList(children: React.ReactNode) {
114
113
  const { styles } = this.props
115
114
  return (
116
115
  <Item as={this.childAs} role="presentation" css={styles?.label}>
@@ -35,10 +35,24 @@ import type {
35
35
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
36
36
 
37
37
  type OptionsOwnProps = {
38
+ /**
39
+ * Element type to render as
40
+ */
38
41
  as?: AsElementType
42
+ /**
43
+ * The aria role of the element
44
+ */
39
45
  role?: string
46
+ /**
47
+ * The the actual list element
48
+ */
40
49
  elementRef?: (element: Element | null) => void
41
- renderLabel?: React.ReactNode | ((...args: any[]) => any)
50
+ /**
51
+ * Content to render as a label. Mostly for when the component is nested
52
+ */
53
+ renderLabel?: React.ReactNode | (() => React.ReactNode)
54
+ //TODO children has to be typed better
55
+ //e.g.: ChildrenPropTypes.oneOf(['Options', 'Item', 'Separator']))
42
56
  children?: React.ReactNode
43
57
  }
44
58
 
@@ -53,21 +67,9 @@ type OptionsProps = OptionsOwnProps &
53
67
  type OptionsStyle = ComponentStyle<'options' | 'list' | 'label'>
54
68
 
55
69
  const propTypes: PropValidators<PropKeys> = {
56
- /**
57
- * Element type to render as
58
- */
59
70
  as: PropTypes.elementType,
60
- /**
61
- * The aria role of the element
62
- */
63
71
  role: PropTypes.string,
64
- /**
65
- * The the actual list element
66
- */
67
72
  elementRef: PropTypes.func,
68
- /**
69
- * Content to render as a label. Mostly for when the component is nested
70
- */
71
73
  renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
72
74
  children: ChildrenPropTypes.oneOf(['Options', 'Item', 'Separator'])
73
75
  }
@@ -1,11 +1,25 @@
1
+ /// <reference types="react" />
1
2
  import { IconCheckSolid, IconArrowOpenEndSolid } from '@instructure/ui-icons';
3
+ import { OptionsItemProps } from '../props';
2
4
  declare const _default: {
3
5
  maxExamplesPerPage: number;
4
6
  propValues: {
5
7
  renderAfterLabel: (typeof IconArrowOpenEndSolid | null)[];
6
8
  renderBeforeLabel: (typeof IconCheckSolid | null)[];
7
9
  };
8
- getComponentProps: (props: any) => {
10
+ getComponentProps: (props: OptionsItemProps) => {
11
+ renderAfterLabel: import("react").ReactNode | ((props: {
12
+ children?: import("react").ReactNode | (() => import("react").ReactNode);
13
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
14
+ variant?: "default" | "disabled" | "selected" | "highlighted" | undefined;
15
+ role?: string | undefined;
16
+ }) => import("react").ReactNode);
17
+ renderBeforeLabel: import("react").ReactNode | ((props: {
18
+ children?: import("react").ReactNode | (() => import("react").ReactNode);
19
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
20
+ variant?: "default" | "disabled" | "selected" | "highlighted" | undefined;
21
+ role?: string | undefined;
22
+ }) => import("react").ReactNode);
9
23
  children: string;
10
24
  role: string;
11
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Item.examples.d.ts","sourceRoot":"","sources":["../../../../src/Options/Item/__examples__/Item.examples.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE7E,wBAaC"}
1
+ {"version":3,"file":"Item.examples.d.ts","sourceRoot":"","sources":["../../../../src/Options/Item/__examples__/Item.examples.ts"],"names":[],"mappings":";AAuBA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;;;;;;;+BAQd,gBAAgB;;;;;;;;;;;;;;;;;AAN7C,wBAcC"}
@@ -1,31 +1,28 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
3
  import { jsx } from '@instructure/emotion';
4
- import type { OptionsItemProps } from './props';
4
+ import type { OptionsItemProps, OptionsItemStyle } from './props';
5
5
  /**
6
6
  ---
7
7
  parent: Options
8
8
  id: Options.Item
9
9
  ---
10
+ @tsProps
10
11
  **/
11
12
  declare class Item extends Component<OptionsItemProps> {
12
13
  static readonly componentId = "Options.Item";
13
14
  static allowedProps: readonly (keyof {
15
+ children?: import("react").ReactNode | (() => import("react").ReactNode);
14
16
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
15
17
  variant?: "default" | "disabled" | "selected" | "highlighted" | undefined;
16
18
  role?: string | undefined;
17
- renderBeforeLabel?: import("react").ReactNode | ((...args: any[]) => any);
18
- renderAfterLabel?: import("react").ReactNode | ((...args: any[]) => any);
19
- children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
20
- })[];
19
+ } | "renderBeforeLabel" | "renderAfterLabel")[];
21
20
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
21
+ children?: import("react").ReactNode | (() => import("react").ReactNode);
22
22
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
23
23
  variant?: "default" | "disabled" | "selected" | "highlighted" | undefined;
24
24
  role?: string | undefined;
25
- renderBeforeLabel?: import("react").ReactNode | ((...args: any[]) => any);
26
- renderAfterLabel?: import("react").ReactNode | ((...args: any[]) => any);
27
- children?: import("react").ReactNode | ((...args: any[]) => import("react").ReactNode);
28
- }>;
25
+ } | "renderBeforeLabel" | "renderAfterLabel">;
29
26
  static defaultProps: {
30
27
  readonly as: "span";
31
28
  readonly variant: "default";
@@ -37,7 +34,7 @@ declare class Item extends Component<OptionsItemProps> {
37
34
  ref: Element | null;
38
35
  componentDidMount(): void;
39
36
  componentDidUpdate(): void;
40
- renderContent(renderLabel: any, contentVariant: any): jsx.JSX.Element;
37
+ renderContent(renderLabel: OptionsItemProps['renderBeforeLabel'] | OptionsItemProps['renderAfterLabel'], contentVariant: OptionsItemStyle['contentBefore'] | OptionsItemStyle['contentAfter']): jsx.JSX.Element;
41
38
  render(): jsx.JSX.Element;
42
39
  }
43
40
  export default Item;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Options/Item/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AASjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG/C;;;;;GAKG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAC5C,MAAM,CAAC,QAAQ,CAAC,WAAW,kBAAiB;IAE5C,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;MAOT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,iBAAiB;IAIjB,kBAAkB;IAKlB,aAAa,CAAC,WAAW,KAAA,EAAE,cAAc,KAAA;IAmBzC,MAAM;CAgCP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Options/Item/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AASjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAGjE;;;;;;GAMG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAC5C,MAAM,CAAC,QAAQ,CAAC,WAAW,kBAAiB;IAE5C,MAAM,CAAC,YAAY;;;;;oDAAe;IAClC,MAAM,CAAC,SAAS;;;;;kDAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;MAOT;IAEV,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,iBAAiB;IAIjB,kBAAkB;IAIlB,aAAa,CACX,WAAW,EACP,gBAAgB,CAAC,mBAAmB,CAAC,GACrC,gBAAgB,CAAC,kBAAkB,CAAC,EACxC,cAAc,EACV,gBAAgB,CAAC,eAAe,CAAC,GACjC,gBAAgB,CAAC,cAAc,CAAC;IAoBtC,MAAM;CAgCP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -1,13 +1,33 @@
1
1
  import React from 'react';
2
2
  import type { AsElementType, PropValidators, OptionsItemTheme, OtherHTMLAttributes } from '@instructure/shared-types';
3
3
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
- declare type OptionsItemOwnProps = {
4
+ declare type ItemProps = {
5
+ children?: React.ReactNode | (() => React.ReactNode);
6
+ /**
7
+ * Element type to render as
8
+ */
5
9
  as?: AsElementType;
10
+ /**
11
+ * The style variant of the item
12
+ */
6
13
  variant?: 'default' | 'highlighted' | 'selected' | 'disabled';
14
+ /**
15
+ * The aria role of the element
16
+ */
7
17
  role?: string;
8
- renderBeforeLabel?: React.ReactNode | ((...args: any[]) => any);
9
- renderAfterLabel?: React.ReactNode | ((...args: any[]) => any);
10
- children?: React.ReactNode | ((...args: any[]) => React.ReactNode);
18
+ };
19
+ declare type OptionsItemOwnProps = ItemProps & {
20
+ /**
21
+ * Content to render before the label
22
+ * (if you pass a function, it has the `props` as its parameter)
23
+ */
24
+ renderBeforeLabel?: React.ReactNode | ((props: ItemProps) => React.ReactNode);
25
+ /**
26
+ * Content to render after the label
27
+ * (if you pass a function, it has the `props` as its parameter)
28
+ */
29
+ renderAfterLabel?: React.ReactNode | ((props: ItemProps) => React.ReactNode);
30
+ children?: React.ReactNode | (() => React.ReactNode);
11
31
  };
12
32
  declare type PropKeys = keyof OptionsItemOwnProps;
13
33
  declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Options/Item/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,mBAAmB,GAAG;IACzB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAA;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC/D,gB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atorProps> {
13
14
  static readonly componentId = "Options.Separator";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Options/Separator/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGpD;;;;;;GAMG;AACH,cACM,SAAU,SAAQ,SAAS,CAAC,qBAAqB,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,WAAW,uBAAsB;IAEjD,MAAM,CAAC,YAAY,kBAAe;IAClC,MAAM,CAAC,SAAS,8EAAY;IAE5B,MAAM,CAAC,YAAY;;MAET;IAEV,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAUP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Options/Separator/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAGpD;;;;;;;GAOG;AACH,cACM,SAAU,SAAQ,SAAS,CAAC,qBAAqB,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,WAAW,uBAAsB;IAEjD,MAAM,CAAC,YAAY,kBAAe;IAClC,MAAM,CAAC,SAAS,8EAAY;IAE5B,MAAM,CAAC,YAAY;;MAET;IAEV,iBAAiB;IAIjB,kBAAkB;IAIlB,MAAM;CAUP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -2,6 +2,9 @@ import type { AsElementType, PropValidators, OptionsSeparatorTheme, OtherHTMLAtt
2
2
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
3
3
  import { AllHTMLAttributes } from 'react';
4
4
  declare type OptionsSeparatorOwnProps = {
5
+ /**
6
+ * Element type to render as
7
+ */
5
8
  as?: AsElementType;
6
9
  };
7
10
  declare type PropKeys = keyof OptionsSeparatorOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Options/Separator/props.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,aAAK,wBAAwB,GAAG;IAC9B,EAAE,CAAC,EAAE,aAAa,CAAA;CACnB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,wBAAwB,CAAA;AAE9C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,qBAAqB,GAAG,wBAAwB,GACnD,cAAc,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,GAC5D,mBAAmB,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;AAEvE,aAAK,qBAAqB,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;AAExD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAKvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAwB,CAAA;AAE5C,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Options/Separator/props.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEzC,aAAK,wBAAwB,GAAG;IAC9B;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;CACnB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,wBAAwB,CAAA;AAE9C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,qBAAqB,GAAG,wBAAwB,GACnD,cAAc,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,GAC5D,mBAAmB,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAA;AAEvE,aAAK,qBAAqB,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;AAExD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAEvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAAwB,CAAA;AAE5C,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -8,6 +8,7 @@ import type { OptionsProps } from './props';
8
8
  ---
9
9
  category: components
10
10
  ---
11
+ @tsProps
11
12
  **/
12
13
  declare class Options extends Component<OptionsProps> {
13
14
  static readonly componentId = "Options";
@@ -15,20 +16,20 @@ declare class Options extends Component<OptionsProps> {
15
16
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
16
17
  role?: string | undefined;
17
18
  elementRef?: ((element: Element | null) => void) | undefined;
18
- renderLabel?: import("react").ReactNode | ((...args: any[]) => any);
19
+ renderLabel?: import("react").ReactNode | (() => import("react").ReactNode);
19
20
  children?: import("react").ReactNode;
20
21
  })[];
21
22
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
22
23
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
23
24
  role?: string | undefined;
24
25
  elementRef?: ((element: Element | null) => void) | undefined;
25
- renderLabel?: import("react").ReactNode | ((...args: any[]) => any);
26
+ renderLabel?: import("react").ReactNode | (() => import("react").ReactNode);
26
27
  children?: import("react").ReactNode;
27
28
  }>;
28
29
  static defaultProps: {
29
30
  as: string;
30
31
  role: string;
31
- elementRef: (node: any) => void;
32
+ elementRef: () => void;
32
33
  renderLabel: null;
33
34
  children: null;
34
35
  };
@@ -41,7 +42,7 @@ declare class Options extends Component<OptionsProps> {
41
42
  _labelId: string;
42
43
  get childAs(): "li" | undefined;
43
44
  renderLabel(): jsx.JSX.Element;
44
- renderSubList(children: any): jsx.JSX.Element;
45
+ renderSubList(children: React.ReactNode): jsx.JSX.Element;
45
46
  renderChildren(): jsx.JSX.Element[] | null | undefined;
46
47
  render(): jsx.JSX.Element;
47
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Options/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AAazD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;GAIG;AACH,cAEM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAY;IAEvC,MAAM,CAAC,YAAY;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;MAOlB;IAED,MAAM,CAAC,IAAI,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,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -2,10 +2,22 @@ import React from 'react';
2
2
  import type { AsElementType, PropValidators, OptionsTheme, OtherHTMLAttributes } from '@instructure/shared-types';
3
3
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion';
4
4
  declare type OptionsOwnProps = {
5
+ /**
6
+ * Element type to render as
7
+ */
5
8
  as?: AsElementType;
9
+ /**
10
+ * The aria role of the element
11
+ */
6
12
  role?: string;
13
+ /**
14
+ * The the actual list element
15
+ */
7
16
  elementRef?: (element: Element | null) => void;
8
- renderLabel?: React.ReactNode | ((...args: any[]) => any);
17
+ /**
18
+ * Content to render as a label. Mostly for when the component is nested
19
+ */
20
+ renderLabel?: React.ReactNode | (() => React.ReactNode);
9
21
  children?: React.ReactNode;
10
22
  };
11
23
  declare type PropKeys = keyof OptionsOwnProps;
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Options/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1E,aAAK,eAAe,GAAG;IACrB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,eAAe,CAAA;AAErC,aAAK,eAAe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YAAY,GAAG,eAAe,GACjC,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,GAC1C,mBAAmB,CAAC,eAAe,CAAC,CAAA;AAEtC,aAAK,YAAY,GAAG,cAAc,CAAC,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;AAEhE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAMvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAMnB,CAAA;AAED,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,CAAA;AAC1C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: The MIT License (MIT)
3
- category: Getting Started
4
- order: 9
5
- ---
6
-
7
- # The MIT License (MIT)
8
-
9
- Copyright (c) 2015 Instructure, Inc.
10
-
11
- **Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions.**
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.