@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.
- package/CHANGELOG.md +6 -0
- package/es/Options/Item/OptionsItemLocator.js +2 -2
- package/es/Options/Item/__examples__/Item.examples.js +2 -0
- package/es/Options/Item/index.js +3 -2
- package/es/Options/Item/props.js +0 -21
- package/es/Options/OptionsLocator.js +4 -4
- package/es/Options/Separator/index.js +1 -0
- package/es/Options/Separator/props.js +0 -3
- package/es/Options/index.js +4 -3
- package/es/Options/props.js +0 -15
- package/lib/Options/Item/OptionsItemLocator.js +2 -2
- package/lib/Options/Item/__examples__/Item.examples.js +2 -0
- package/lib/Options/Item/index.js +4 -3
- package/lib/Options/Item/props.js +1 -22
- package/lib/Options/OptionsLocator.js +4 -4
- package/lib/Options/Separator/index.js +2 -1
- package/lib/Options/Separator/props.js +1 -4
- package/lib/Options/index.js +5 -4
- package/lib/Options/props.js +1 -16
- package/package.json +15 -16
- package/src/Options/Item/__examples__/Item.examples.ts +4 -2
- package/src/Options/Item/index.tsx +10 -3
- package/src/Options/Item/props.ts +25 -21
- package/src/Options/README.md +1 -1
- package/src/Options/Separator/index.tsx +1 -0
- package/src/Options/Separator/props.ts +3 -3
- package/src/Options/index.tsx +3 -4
- package/src/Options/props.ts +15 -13
- package/types/Options/Item/__examples__/Item.examples.d.ts +15 -1
- package/types/Options/Item/__examples__/Item.examples.d.ts.map +1 -1
- package/types/Options/Item/index.d.ts +7 -10
- package/types/Options/Item/index.d.ts.map +1 -1
- package/types/Options/Item/props.d.ts +24 -4
- package/types/Options/Item/props.d.ts.map +1 -1
- package/types/Options/Separator/index.d.ts +1 -0
- package/types/Options/Separator/index.d.ts.map +1 -1
- package/types/Options/Separator/props.d.ts +3 -0
- package/types/Options/Separator/props.d.ts.map +1 -1
- package/types/Options/index.d.ts +5 -4
- package/types/Options/index.d.ts.map +1 -1
- package/types/Options/props.d.ts +13 -1
- package/types/Options/props.d.ts.map +1 -1
- 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: (
|
|
29
|
-
return OptionsLocator.find(...
|
|
28
|
+
findNestedOptions: function () {
|
|
29
|
+
return OptionsLocator.find(...arguments);
|
|
30
30
|
}
|
|
31
31
|
});
|
package/es/Options/Item/index.js
CHANGED
|
@@ -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(
|
|
44
|
-
super(...
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
45
46
|
this.ref = null;
|
|
46
47
|
}
|
|
47
48
|
|
package/es/Options/Item/props.js
CHANGED
|
@@ -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: (
|
|
29
|
-
return OptionsItemLocator.findAll(...
|
|
28
|
+
findAllItems: function () {
|
|
29
|
+
return OptionsItemLocator.findAll(...arguments);
|
|
30
30
|
},
|
|
31
|
-
findItem: (
|
|
32
|
-
return OptionsItemLocator.find(...
|
|
31
|
+
findItem: function () {
|
|
32
|
+
return OptionsItemLocator.find(...arguments);
|
|
33
33
|
}
|
|
34
34
|
});
|
package/es/Options/index.js
CHANGED
|
@@ -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(
|
|
47
|
-
super(...
|
|
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:
|
|
146
|
+
elementRef: () => {},
|
|
146
147
|
renderLabel: null,
|
|
147
148
|
children: null
|
|
148
149
|
}, _class2.Item = Item, _class2.Separator = Separator, _temp)) || _class) || _class);
|
package/es/Options/props.js
CHANGED
|
@@ -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: (
|
|
39
|
-
return _OptionsLocator.OptionsLocator.find(...
|
|
38
|
+
findNestedOptions: function () {
|
|
39
|
+
return _OptionsLocator.OptionsLocator.find(...arguments);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
exports.OptionsItemLocator = OptionsItemLocator;
|
|
@@ -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.
|
|
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(
|
|
34
|
-
super(...
|
|
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.
|
|
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: (
|
|
39
|
-
return _OptionsItemLocator.OptionsItemLocator.findAll(...
|
|
38
|
+
findAllItems: function () {
|
|
39
|
+
return _OptionsItemLocator.OptionsItemLocator.findAll(...arguments);
|
|
40
40
|
},
|
|
41
|
-
findItem: (
|
|
42
|
-
return _OptionsItemLocator.OptionsItemLocator.find(...
|
|
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.
|
|
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.
|
|
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;
|
package/lib/Options/index.js
CHANGED
|
@@ -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.
|
|
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(
|
|
41
|
-
super(...
|
|
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:
|
|
141
|
+
elementRef: () => {},
|
|
141
142
|
renderLabel: null,
|
|
142
143
|
children: null
|
|
143
144
|
}, _class2.Item = _Item.Item, _class2.Separator = _Separator.Separator, _temp)) || _class) || _class);
|
package/lib/Options/props.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
28
|
-
"@instructure/ui-color-utils": "8.
|
|
29
|
-
"@instructure/ui-test-locator": "8.
|
|
30
|
-
"@instructure/ui-test-utils": "8.
|
|
31
|
-
"@instructure/ui-themes": "8.
|
|
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.
|
|
36
|
-
"@instructure/shared-types": "8.
|
|
37
|
-
"@instructure/ui-icons": "8.
|
|
38
|
-
"@instructure/ui-prop-types": "8.
|
|
39
|
-
"@instructure/ui-react-utils": "8.
|
|
40
|
-
"@instructure/ui-testable": "8.
|
|
41
|
-
"@instructure/ui-view": "8.
|
|
42
|
-
"@instructure/uid": "8.
|
|
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
|
-
|
|
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
|
-
|
|
76
|
-
|
|
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
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
}
|
package/src/Options/README.md
CHANGED
|
@@ -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
|
|
package/src/Options/index.tsx
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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}>
|
package/src/Options/props.ts
CHANGED
|
@@ -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
|
-
|
|
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:
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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;
|
|
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
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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,
|
|
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,SAAS,GAAG;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAA;IACpD;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAA;IAC7D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,aAAK,mBAAmB,GAAG,SAAS,GAAG;IACrC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAC7E;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAC5E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAA;CACrD,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,mBAAmB,CAAA;AAEzC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,gBAAgB,GAAG,mBAAmB,GACzC,cAAc,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,GAClD,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;AAE1C,aAAK,gBAAgB,GAAG,cAAc,CACpC,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,eAAe,GAAG,cAAc,CACpE,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAOvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAOnB,CAAA;AAED,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -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
|
|
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,
|
|
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"}
|
package/types/Options/index.d.ts
CHANGED
|
@@ -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 | ((
|
|
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 | ((
|
|
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: (
|
|
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:
|
|
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
|
|
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;;;;;GAKG;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;;;;;;MAMlB;IAED,MAAM,CAAC,IAAI,cAAO;IAClB,MAAM,CAAC,SAAS,mBAAY;IAE5B,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IAIjB,kBAAkB;IAIlB,QAAQ,SAAuB;IAE/B,IAAI,OAAO,qBAMV;IAED,WAAW;IAcX,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS;IASvC,cAAc;IAcd,MAAM;CA4BP;AAED,eAAe,OAAO,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/types/Options/props.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
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;;OAEG;IACH,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,MAAM,KAAK,CAAC,SAAS,CAAC,CAAA;IAGvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,eAAe,CAAA;AAErC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,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.
|