@instructure/ui-options 8.17.0 → 8.17.1-snapshot.17

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/LICENSE.md ADDED
@@ -0,0 +1,27 @@
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.
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _class, _class2, _temp;
1
+ var _dec, _dec2, _dec3, _class, _class2, _temp;
2
2
 
3
3
  /*
4
4
  * The MIT License (MIT)
@@ -26,9 +26,8 @@ var _dec, _dec2, _class, _class2, _temp;
26
26
 
27
27
  /** @jsx jsx */
28
28
  import React, { Component, Children } from 'react';
29
- import { omitProps, matchComponentTypes, callRenderProp, safeCloneElement } from '@instructure/ui-react-utils';
29
+ import { omitProps, matchComponentTypes, callRenderProp, safeCloneElement, withDeterministicId } from '@instructure/ui-react-utils';
30
30
  import { testable } from '@instructure/ui-testable';
31
- import { uid } from '@instructure/uid';
32
31
  import { View } from '@instructure/ui-view';
33
32
  import { withStyle, jsx } from '@instructure/emotion';
34
33
  import generateStyles from './styles';
@@ -43,7 +42,7 @@ category: components
43
42
  ---
44
43
  @tsProps
45
44
  **/
46
- let Options = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Options extends Component {
45
+ let Options = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class Options extends Component {
47
46
  constructor() {
48
47
  super(...arguments);
49
48
  this.ref = null;
@@ -52,7 +51,7 @@ let Options = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 =
52
51
  this.ref = el;
53
52
  };
54
53
 
55
- this._labelId = uid('Options-label');
54
+ this._labelId = this.props.deterministicId('Options-label');
56
55
  }
57
56
 
58
57
  componentDidMount() {
@@ -146,6 +145,6 @@ let Options = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 =
146
145
  elementRef: () => {},
147
146
  renderLabel: null,
148
147
  children: null
149
- }, _class2.Item = Item, _class2.Separator = Separator, _temp)) || _class) || _class);
148
+ }, _class2.Item = Item, _class2.Separator = Separator, _temp)) || _class) || _class) || _class);
150
149
  export default Options;
151
150
  export { Options };
@@ -15,8 +15,6 @@ var _uiReactUtils = require("@instructure/ui-react-utils");
15
15
 
16
16
  var _uiTestable = require("@instructure/ui-testable");
17
17
 
18
- var _uid = require("@instructure/uid");
19
-
20
18
  var _uiView = require("@instructure/ui-view");
21
19
 
22
20
  var _emotion = require("@instructure/emotion");
@@ -31,7 +29,7 @@ var _Separator = require("./Separator");
31
29
 
32
30
  var _props = require("./props");
33
31
 
34
- var _dec, _dec2, _class, _class2, _temp;
32
+ var _dec, _dec2, _dec3, _class, _class2, _temp;
35
33
 
36
34
  /**
37
35
  ---
@@ -39,7 +37,7 @@ category: components
39
37
  ---
40
38
  @tsProps
41
39
  **/
42
- 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
+ let Options = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_temp = _class2 = class Options extends _react.Component {
43
41
  constructor() {
44
42
  super(...arguments);
45
43
  this.ref = null;
@@ -48,7 +46,7 @@ let Options = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
48
46
  this.ref = el;
49
47
  };
50
48
 
51
- this._labelId = (0, _uid.uid)('Options-label');
49
+ this._labelId = this.props.deterministicId('Options-label');
52
50
  }
53
51
 
54
52
  componentDidMount() {
@@ -143,7 +141,7 @@ let Options = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
143
141
  elementRef: () => {},
144
142
  renderLabel: null,
145
143
  children: null
146
- }, _class2.Item = _Item.Item, _class2.Separator = _Separator.Separator, _temp)) || _class) || _class);
144
+ }, _class2.Item = _Item.Item, _class2.Separator = _Separator.Separator, _temp)) || _class) || _class) || _class);
147
145
  exports.Options = Options;
148
146
  var _default = Options;
149
147
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-options",
3
- "version": "8.17.0",
3
+ "version": "8.17.1-snapshot.17+8e38d5a2e",
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,22 +23,21 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.17.0",
27
- "@instructure/ui-color-utils": "8.17.0",
28
- "@instructure/ui-test-locator": "8.17.0",
29
- "@instructure/ui-test-utils": "8.17.0",
30
- "@instructure/ui-themes": "8.17.0"
26
+ "@instructure/ui-babel-preset": "8.17.1-snapshot.17+8e38d5a2e",
27
+ "@instructure/ui-color-utils": "8.17.1-snapshot.17+8e38d5a2e",
28
+ "@instructure/ui-test-locator": "8.17.1-snapshot.17+8e38d5a2e",
29
+ "@instructure/ui-test-utils": "8.17.1-snapshot.17+8e38d5a2e",
30
+ "@instructure/ui-themes": "8.17.1-snapshot.17+8e38d5a2e"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.17.0",
35
- "@instructure/shared-types": "8.17.0",
36
- "@instructure/ui-icons": "8.17.0",
37
- "@instructure/ui-prop-types": "8.17.0",
38
- "@instructure/ui-react-utils": "8.17.0",
39
- "@instructure/ui-testable": "8.17.0",
40
- "@instructure/ui-view": "8.17.0",
41
- "@instructure/uid": "8.17.0",
34
+ "@instructure/emotion": "8.17.1-snapshot.17+8e38d5a2e",
35
+ "@instructure/shared-types": "8.17.1-snapshot.17+8e38d5a2e",
36
+ "@instructure/ui-icons": "8.17.1-snapshot.17+8e38d5a2e",
37
+ "@instructure/ui-prop-types": "8.17.1-snapshot.17+8e38d5a2e",
38
+ "@instructure/ui-react-utils": "8.17.1-snapshot.17+8e38d5a2e",
39
+ "@instructure/ui-testable": "8.17.1-snapshot.17+8e38d5a2e",
40
+ "@instructure/ui-view": "8.17.1-snapshot.17+8e38d5a2e",
42
41
  "prop-types": "^15"
43
42
  },
44
43
  "peerDependencies": {
@@ -47,5 +46,6 @@
47
46
  "publishConfig": {
48
47
  "access": "public"
49
48
  },
50
- "sideEffects": false
49
+ "sideEffects": false,
50
+ "gitHead": "8e38d5a2e11e842eafa2fa270e47a261c6ebb626"
51
51
  }
@@ -29,10 +29,10 @@ import {
29
29
  omitProps,
30
30
  matchComponentTypes,
31
31
  callRenderProp,
32
- safeCloneElement
32
+ safeCloneElement,
33
+ withDeterministicId
33
34
  } from '@instructure/ui-react-utils'
34
35
  import { testable } from '@instructure/ui-testable'
35
- import { uid } from '@instructure/uid'
36
36
 
37
37
  import { View } from '@instructure/ui-view'
38
38
 
@@ -60,6 +60,7 @@ category: components
60
60
  ---
61
61
  @tsProps
62
62
  **/
63
+ @withDeterministicId()
63
64
  @withStyle(generateStyles, generateComponentTheme)
64
65
  @testable()
65
66
  class Options extends Component<OptionsProps> {
@@ -92,8 +93,7 @@ class Options extends Component<OptionsProps> {
92
93
  componentDidUpdate() {
93
94
  this.props.makeStyles?.()
94
95
  }
95
-
96
- _labelId = uid('Options-label')
96
+ _labelId = this.props.deterministicId!('Options-label')
97
97
 
98
98
  get childAs() {
99
99
  const { as } = this.props
@@ -33,6 +33,7 @@ import type {
33
33
  OtherHTMLAttributes
34
34
  } from '@instructure/shared-types'
35
35
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
36
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
36
37
 
37
38
  type OptionsOwnProps = {
38
39
  /**
@@ -62,7 +63,7 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
62
63
 
63
64
  type OptionsProps = OptionsOwnProps &
64
65
  WithStyleProps<OptionsTheme, OptionsStyle> &
65
- OtherHTMLAttributes<OptionsOwnProps>
66
+ OtherHTMLAttributes<OptionsOwnProps> & WithDeterministicIdProps
66
67
 
67
68
  type OptionsStyle = ComponentStyle<'options' | 'list' | 'label'>
68
69