@instructure/ui-options 8.25.1-snapshot-7 → 8.25.1-snapshot-10

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 CHANGED
@@ -3,7 +3,7 @@
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.25.1-snapshot-7](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-7) (2022-06-13)
6
+ ## [8.25.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-10) (2022-06-20)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-options
9
9
 
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _dec3, _class, _class2;
1
+ var _dec, _dec2, _dec3, _class;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -40,11 +40,23 @@ id: Options.Item
40
40
  @tsProps
41
41
  **/
42
42
 
43
- let Item = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Item extends Component {
43
+ let Item = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = class Item extends Component {
44
+ static displayName = "Item";
45
+ static componentId = 'Options.Item';
46
+ static allowedProps = allowedProps;
47
+ static propTypes = propTypes;
48
+ static defaultProps = {
49
+ as: 'span',
50
+ variant: 'default',
51
+ role: 'listitem',
52
+ beforeLabelContentVAlign: 'center',
53
+ afterLabelContentVAlign: 'center'
54
+ };
55
+ ref = null;
56
+ _descriptionId;
57
+
44
58
  constructor(props) {
45
59
  super(props);
46
- this.ref = null;
47
- this._descriptionId = void 0;
48
60
  this._descriptionId = props.deterministicId('OptionsItem-description');
49
61
  }
50
62
 
@@ -118,12 +130,6 @@ let Item = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, gene
118
130
  }, descriptionContent)), renderBeforeLabel && this.renderContent(renderBeforeLabel, styles === null || styles === void 0 ? void 0 : styles.contentBefore), renderAfterLabel && this.renderContent(renderAfterLabel, styles === null || styles === void 0 ? void 0 : styles.contentAfter));
119
131
  }
120
132
 
121
- }, _class2.displayName = "Item", _class2.componentId = 'Options.Item', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
122
- as: 'span',
123
- variant: 'default',
124
- role: 'listitem',
125
- beforeLabelContentVAlign: 'center',
126
- afterLabelContentVAlign: 'center'
127
- }, _class2)) || _class) || _class) || _class);
133
+ }) || _class) || _class) || _class);
128
134
  export default Item;
129
135
  export { Item };
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["as", "styles"];
3
3
 
4
- var _dec, _class, _class2;
4
+ var _dec, _class;
5
5
 
6
6
  /*
7
7
  * The MIT License (MIT)
@@ -43,7 +43,15 @@ id: Options.Separator
43
43
  @tsProps
44
44
  **/
45
45
 
46
- let Separator = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(_class = (_class2 = class Separator extends Component {
46
+ let Separator = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(_class = class Separator extends Component {
47
+ static displayName = "Separator";
48
+ static componentId = 'Options.Separator';
49
+ static allowedProps = allowedProps;
50
+ static propTypes = propTypes;
51
+ static defaultProps = {
52
+ as: 'span'
53
+ };
54
+
47
55
  componentDidMount() {
48
56
  var _this$props$makeStyle, _this$props;
49
57
 
@@ -71,8 +79,6 @@ let Separator = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(
71
79
  })));
72
80
  }
73
81
 
74
- }, _class2.displayName = "Separator", _class2.componentId = 'Options.Separator', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
75
- as: 'span'
76
- }, _class2)) || _class);
82
+ }) || _class);
77
83
  export default Separator;
78
84
  export { Separator };
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _dec3, _class, _class2;
1
+ var _dec, _dec2, _dec3, _class;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -42,17 +42,24 @@ category: components
42
42
  ---
43
43
  @tsProps
44
44
  **/
45
- let Options = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Options extends Component {
46
- constructor() {
47
- super(...arguments);
48
- this.ref = null;
49
-
50
- this.handleRef = el => {
51
- this.ref = el;
52
- };
53
-
54
- this._labelId = this.props.deterministicId('Options-label');
55
- }
45
+ let Options = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = class Options extends Component {
46
+ static displayName = "Options";
47
+ static componentId = 'Options';
48
+ static allowedProps = allowedProps;
49
+ static propTypes = propTypes;
50
+ static defaultProps = {
51
+ as: 'span',
52
+ role: 'list',
53
+ elementRef: () => {},
54
+ renderLabel: null,
55
+ children: null
56
+ };
57
+ static Item = Item;
58
+ static Separator = Separator;
59
+ ref = null;
60
+ handleRef = el => {
61
+ this.ref = el;
62
+ };
56
63
 
57
64
  componentDidMount() {
58
65
  var _this$props$makeStyle, _this$props;
@@ -66,6 +73,8 @@ let Options = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, g
66
73
  (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
67
74
  }
68
75
 
76
+ _labelId = this.props.deterministicId('Options-label');
77
+
69
78
  get childAs() {
70
79
  const as = this.props.as;
71
80
 
@@ -151,12 +160,6 @@ let Options = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, g
151
160
  }), this.renderChildren()));
152
161
  }
153
162
 
154
- }, _class2.displayName = "Options", _class2.componentId = 'Options', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
155
- as: 'span',
156
- role: 'list',
157
- elementRef: () => {},
158
- renderLabel: null,
159
- children: null
160
- }, _class2.Item = Item, _class2.Separator = Separator, _class2)) || _class) || _class) || _class);
163
+ }) || _class) || _class) || _class);
161
164
  export default Options;
162
165
  export { Options };
@@ -21,7 +21,7 @@ var _theme = _interopRequireDefault(require("./theme"));
21
21
 
22
22
  var _props = require("./props");
23
23
 
24
- var _dec, _dec2, _dec3, _class, _class2;
24
+ var _dec, _dec2, _dec3, _class;
25
25
 
26
26
  /**
27
27
  ---
@@ -30,11 +30,23 @@ id: Options.Item
30
30
  ---
31
31
  @tsProps
32
32
  **/
33
- let Item = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Item extends _react.Component {
33
+ let Item = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = class Item extends _react.Component {
34
+ static displayName = "Item";
35
+ static componentId = 'Options.Item';
36
+ static allowedProps = _props.allowedProps;
37
+ static propTypes = _props.propTypes;
38
+ static defaultProps = {
39
+ as: 'span',
40
+ variant: 'default',
41
+ role: 'listitem',
42
+ beforeLabelContentVAlign: 'center',
43
+ afterLabelContentVAlign: 'center'
44
+ };
45
+ ref = null;
46
+ _descriptionId;
47
+
34
48
  constructor(props) {
35
49
  super(props);
36
- this.ref = null;
37
- this._descriptionId = void 0;
38
50
  this._descriptionId = props.deterministicId('OptionsItem-description');
39
51
  }
40
52
 
@@ -108,13 +120,7 @@ let Item = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotio
108
120
  }, descriptionContent)), renderBeforeLabel && this.renderContent(renderBeforeLabel, styles === null || styles === void 0 ? void 0 : styles.contentBefore), renderAfterLabel && this.renderContent(renderAfterLabel, styles === null || styles === void 0 ? void 0 : styles.contentAfter));
109
121
  }
110
122
 
111
- }, _class2.displayName = "Item", _class2.componentId = 'Options.Item', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
112
- as: 'span',
113
- variant: 'default',
114
- role: 'listitem',
115
- beforeLabelContentVAlign: 'center',
116
- afterLabelContentVAlign: 'center'
117
- }, _class2)) || _class) || _class) || _class);
123
+ }) || _class) || _class) || _class);
118
124
  exports.Item = Item;
119
125
  var _default = Item;
120
126
  exports.default = _default;
@@ -23,7 +23,7 @@ var _props = require("./props");
23
23
 
24
24
  const _excluded = ["as", "styles"];
25
25
 
26
- var _dec, _class, _class2;
26
+ var _dec, _class;
27
27
 
28
28
  /**
29
29
  ---
@@ -33,7 +33,15 @@ id: Options.Separator
33
33
  @module Separator
34
34
  @tsProps
35
35
  **/
36
- let Separator = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_class2 = class Separator extends _react.Component {
36
+ let Separator = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = class Separator extends _react.Component {
37
+ static displayName = "Separator";
38
+ static componentId = 'Options.Separator';
39
+ static allowedProps = _props.allowedProps;
40
+ static propTypes = _props.propTypes;
41
+ static defaultProps = {
42
+ as: 'span'
43
+ };
44
+
37
45
  componentDidMount() {
38
46
  var _this$props$makeStyle, _this$props;
39
47
 
@@ -60,9 +68,7 @@ let Separator = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
60
68
  })));
61
69
  }
62
70
 
63
- }, _class2.displayName = "Separator", _class2.componentId = 'Options.Separator', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
64
- as: 'span'
65
- }, _class2)) || _class);
71
+ }) || _class);
66
72
  exports.Separator = Separator;
67
73
  var _default = Separator;
68
74
  exports.default = _default;
@@ -29,7 +29,7 @@ var _Separator = require("./Separator");
29
29
 
30
30
  var _props = require("./props");
31
31
 
32
- var _dec, _dec2, _dec3, _class, _class2;
32
+ var _dec, _dec2, _dec3, _class;
33
33
 
34
34
  /**
35
35
  ---
@@ -37,17 +37,24 @@ category: components
37
37
  ---
38
38
  @tsProps
39
39
  **/
40
- let Options = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Options extends _react.Component {
41
- constructor() {
42
- super(...arguments);
43
- this.ref = null;
44
-
45
- this.handleRef = el => {
46
- this.ref = el;
47
- };
48
-
49
- this._labelId = this.props.deterministicId('Options-label');
50
- }
40
+ let Options = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = class Options extends _react.Component {
41
+ static displayName = "Options";
42
+ static componentId = 'Options';
43
+ static allowedProps = _props.allowedProps;
44
+ static propTypes = _props.propTypes;
45
+ static defaultProps = {
46
+ as: 'span',
47
+ role: 'list',
48
+ elementRef: () => {},
49
+ renderLabel: null,
50
+ children: null
51
+ };
52
+ static Item = _Item.Item;
53
+ static Separator = _Separator.Separator;
54
+ ref = null;
55
+ handleRef = el => {
56
+ this.ref = el;
57
+ };
51
58
 
52
59
  componentDidMount() {
53
60
  var _this$props$makeStyle, _this$props;
@@ -61,6 +68,8 @@ let Options = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emo
61
68
  (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
62
69
  }
63
70
 
71
+ _labelId = this.props.deterministicId('Options-label');
72
+
64
73
  get childAs() {
65
74
  const as = this.props.as;
66
75
 
@@ -147,13 +156,7 @@ let Options = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emo
147
156
  }), this.renderChildren()));
148
157
  }
149
158
 
150
- }, _class2.displayName = "Options", _class2.componentId = 'Options', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
151
- as: 'span',
152
- role: 'list',
153
- elementRef: () => {},
154
- renderLabel: null,
155
- children: null
156
- }, _class2.Item = _Item.Item, _class2.Separator = _Separator.Separator, _class2)) || _class) || _class) || _class);
159
+ }) || _class) || _class) || _class);
157
160
  exports.Options = Options;
158
161
  var _default = Options;
159
162
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-options",
3
- "version": "8.25.1-snapshot-7",
3
+ "version": "8.25.1-snapshot-10",
4
4
  "description": "A view-only component for composing interactive lists and menus.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,21 +23,21 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.25.1-snapshot-7",
27
- "@instructure/ui-color-utils": "8.25.1-snapshot-7",
28
- "@instructure/ui-test-locator": "8.25.1-snapshot-7",
29
- "@instructure/ui-test-utils": "8.25.1-snapshot-7",
30
- "@instructure/ui-themes": "8.25.1-snapshot-7"
26
+ "@instructure/ui-babel-preset": "8.25.1-snapshot-10",
27
+ "@instructure/ui-color-utils": "8.25.1-snapshot-10",
28
+ "@instructure/ui-test-locator": "8.25.1-snapshot-10",
29
+ "@instructure/ui-test-utils": "8.25.1-snapshot-10",
30
+ "@instructure/ui-themes": "8.25.1-snapshot-10"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.25.1-snapshot-7",
35
- "@instructure/shared-types": "8.25.1-snapshot-7",
36
- "@instructure/ui-icons": "8.25.1-snapshot-7",
37
- "@instructure/ui-prop-types": "8.25.1-snapshot-7",
38
- "@instructure/ui-react-utils": "8.25.1-snapshot-7",
39
- "@instructure/ui-testable": "8.25.1-snapshot-7",
40
- "@instructure/ui-view": "8.25.1-snapshot-7",
34
+ "@instructure/emotion": "8.25.1-snapshot-10",
35
+ "@instructure/shared-types": "8.25.1-snapshot-10",
36
+ "@instructure/ui-icons": "8.25.1-snapshot-10",
37
+ "@instructure/ui-prop-types": "8.25.1-snapshot-10",
38
+ "@instructure/ui-react-utils": "8.25.1-snapshot-10",
39
+ "@instructure/ui-testable": "8.25.1-snapshot-10",
40
+ "@instructure/ui-view": "8.25.1-snapshot-10",
41
41
  "prop-types": "^15"
42
42
  },
43
43
  "peerDependencies": {
@@ -34,7 +34,7 @@ import type {
34
34
  import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
35
35
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
36
36
 
37
- type ItemProps = {
37
+ type OptionsItemRenderProps = {
38
38
  children?: React.ReactNode | (() => React.ReactNode)
39
39
  /**
40
40
  * Element type to render as. Will be set to `<a>` if href is provided.
@@ -55,17 +55,21 @@ type ItemProps = {
55
55
  role?: string
56
56
  }
57
57
 
58
- type OptionsItemOwnProps = ItemProps & {
58
+ type OptionsItemOwnProps = OptionsItemRenderProps & {
59
59
  /**
60
60
  * Content to render before the label
61
61
  * (if you pass a function, it has the `props` as its parameter)
62
62
  */
63
- renderBeforeLabel?: React.ReactNode | ((props: ItemProps) => React.ReactNode)
63
+ renderBeforeLabel?:
64
+ | React.ReactNode
65
+ | ((props: OptionsItemRenderProps) => React.ReactNode)
64
66
  /**
65
67
  * Content to render after the label
66
68
  * (if you pass a function, it has the `props` as its parameter)
67
69
  */
68
- renderAfterLabel?: React.ReactNode | ((props: ItemProps) => React.ReactNode)
70
+ renderAfterLabel?:
71
+ | React.ReactNode
72
+ | ((props: OptionsItemRenderProps) => React.ReactNode)
69
73
  /**
70
74
  * Sets the vAlign of renderBeforeLabel content
71
75
  */
@@ -146,5 +150,5 @@ const allowedProps: AllowedPropKeys = [
146
150
  'children'
147
151
  ]
148
152
 
149
- export type { OptionsItemProps, OptionsItemStyle }
153
+ export type { OptionsItemProps, OptionsItemStyle, OptionsItemRenderProps }
150
154
  export { propTypes, allowedProps }
package/src/index.ts CHANGED
@@ -29,5 +29,8 @@ export { optionsItemThemeGenerator } from './Options/Item/theme'
29
29
  export { optionsSeparatorThemeGenerator } from './Options/Separator/theme'
30
30
 
31
31
  export type { OptionsProps } from './Options/props'
32
- export type { OptionsItemProps } from './Options/Item/props'
32
+ export type {
33
+ OptionsItemProps,
34
+ OptionsItemRenderProps
35
+ } from './Options/Item/props'
33
36
  export type { OptionsSeparatorProps } from './Options/Separator/props'