@instructure/ui-options 8.26.2 → 8.26.4-snapshot-3

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,6 +3,21 @@
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.26.4-snapshot-3](https://github.com/instructure/instructure-ui/compare/v8.26.3...v8.26.4-snapshot-3) (2022-07-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * support React 18 ([0a2bf0c](https://github.com/instructure/instructure-ui/commit/0a2bf0cdd4d8bcec6e42a7ccf28a787e4a35bc40))
12
+
13
+
14
+
15
+
16
+
17
+ ## [8.26.3](https://github.com/instructure/instructure-ui/compare/v8.26.2...v8.26.3) (2022-07-14)
18
+
19
+ **Note:** Version bump only for package @instructure/ui-options
20
+
6
21
  ## [8.26.2](https://github.com/instructure/instructure-ui/compare/v8.26.1...v8.26.2) (2022-07-11)
7
22
 
8
23
  **Note:** Version bump only for package @instructure/ui-options
@@ -39,7 +39,8 @@ const generateStyle = (componentTheme, props) => {
39
39
  hasContentBeforeLabel = props.renderBeforeLabel,
40
40
  hasContentAfterLabel = props.renderAfterLabel,
41
41
  beforeLabelContentVAlign = props.beforeLabelContentVAlign,
42
- afterLabelContentVAlign = props.afterLabelContentVAlign;
42
+ afterLabelContentVAlign = props.afterLabelContentVAlign; // TODO if children are () => ReactNode this wont match anything
43
+
43
44
  const containsList = matchComponentTypes(children, ['Options']); // used for label and description too
44
45
 
45
46
  const variantVariants = {
@@ -47,7 +47,8 @@ const generateStyle = (componentTheme, props) => {
47
47
  hasContentBeforeLabel = props.renderBeforeLabel,
48
48
  hasContentAfterLabel = props.renderAfterLabel,
49
49
  beforeLabelContentVAlign = props.beforeLabelContentVAlign,
50
- afterLabelContentVAlign = props.afterLabelContentVAlign;
50
+ afterLabelContentVAlign = props.afterLabelContentVAlign; // TODO if children are () => ReactNode this wont match anything
51
+
51
52
  const containsList = (0, _uiReactUtils.matchComponentTypes)(children, ['Options']); // used for label and description too
52
53
 
53
54
  const variantVariants = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-options",
3
- "version": "8.26.2",
3
+ "version": "8.26.4-snapshot-3",
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,25 +23,25 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.26.2",
27
- "@instructure/ui-color-utils": "8.26.2",
28
- "@instructure/ui-test-locator": "8.26.2",
29
- "@instructure/ui-test-utils": "8.26.2",
30
- "@instructure/ui-themes": "8.26.2"
26
+ "@instructure/ui-babel-preset": "8.26.4-snapshot-3",
27
+ "@instructure/ui-color-utils": "8.26.4-snapshot-3",
28
+ "@instructure/ui-test-locator": "8.26.4-snapshot-3",
29
+ "@instructure/ui-test-utils": "8.26.4-snapshot-3",
30
+ "@instructure/ui-themes": "8.26.4-snapshot-3"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/emotion": "8.26.2",
35
- "@instructure/shared-types": "8.26.2",
36
- "@instructure/ui-icons": "8.26.2",
37
- "@instructure/ui-prop-types": "8.26.2",
38
- "@instructure/ui-react-utils": "8.26.2",
39
- "@instructure/ui-testable": "8.26.2",
40
- "@instructure/ui-view": "8.26.2",
34
+ "@instructure/emotion": "8.26.4-snapshot-3",
35
+ "@instructure/shared-types": "8.26.4-snapshot-3",
36
+ "@instructure/ui-icons": "8.26.4-snapshot-3",
37
+ "@instructure/ui-prop-types": "8.26.4-snapshot-3",
38
+ "@instructure/ui-react-utils": "8.26.4-snapshot-3",
39
+ "@instructure/ui-testable": "8.26.4-snapshot-3",
40
+ "@instructure/ui-view": "8.26.4-snapshot-3",
41
41
  "prop-types": "^15"
42
42
  },
43
43
  "peerDependencies": {
44
- "react": ">=16.8 <=17"
44
+ "react": ">=16.8 <=18"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -22,20 +22,20 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import React from 'react'
26
25
  import PropTypes from 'prop-types'
27
26
 
28
27
  import type {
29
28
  AsElementType,
30
29
  PropValidators,
31
30
  OptionsItemTheme,
32
- OtherHTMLAttributes
31
+ OtherHTMLAttributes,
32
+ Renderable
33
33
  } from '@instructure/shared-types'
34
34
  import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
35
35
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
36
36
 
37
37
  type OptionsItemRenderProps = {
38
- children?: React.ReactNode | (() => React.ReactNode)
38
+ children?: Renderable
39
39
  /**
40
40
  * Element type to render as. Will be set to `<a>` if href is provided.
41
41
  */
@@ -60,16 +60,12 @@ type OptionsItemOwnProps = OptionsItemRenderProps & {
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?:
64
- | React.ReactNode
65
- | ((props: OptionsItemRenderProps) => React.ReactNode)
63
+ renderBeforeLabel?: Renderable<OptionsItemRenderProps>
66
64
  /**
67
65
  * Content to render after the label
68
66
  * (if you pass a function, it has the `props` as its parameter)
69
67
  */
70
- renderAfterLabel?:
71
- | React.ReactNode
72
- | ((props: OptionsItemRenderProps) => React.ReactNode)
68
+ renderAfterLabel?: Renderable<OptionsItemRenderProps>
73
69
  /**
74
70
  * Sets the vAlign of renderBeforeLabel content
75
71
  */
@@ -81,7 +77,7 @@ type OptionsItemOwnProps = OptionsItemRenderProps & {
81
77
  /**
82
78
  * Additional "secondary" description text
83
79
  */
84
- description?: React.ReactNode | (() => React.ReactNode)
80
+ description?: Renderable
85
81
  /**
86
82
  * The ARIA role of the description element
87
83
  */
@@ -26,6 +26,7 @@ import { matchComponentTypes } from '@instructure/ui-react-utils'
26
26
 
27
27
  import type { OptionsItemTheme } from '@instructure/shared-types'
28
28
  import type { OptionsItemProps, OptionsItemStyle } from './props'
29
+ import { ReactNode } from 'react'
29
30
 
30
31
  /**
31
32
  * ---
@@ -49,8 +50,8 @@ const generateStyle = (
49
50
  beforeLabelContentVAlign,
50
51
  afterLabelContentVAlign
51
52
  } = props
52
-
53
- const containsList = matchComponentTypes(children, ['Options'])
53
+ // TODO if children are () => ReactNode this wont match anything
54
+ const containsList = matchComponentTypes(children as ReactNode, ['Options'])
54
55
 
55
56
  // used for label and description too
56
57
  const variantVariants = {
@@ -34,6 +34,7 @@ import type {
34
34
  } from '@instructure/shared-types'
35
35
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
36
36
  import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
37
+ import { Renderable } from '@instructure/shared-types'
37
38
 
38
39
  type OptionsOwnProps = {
39
40
  /**
@@ -51,7 +52,7 @@ type OptionsOwnProps = {
51
52
  /**
52
53
  * Content to render as a label. Mostly for when the component is nested
53
54
  */
54
- renderLabel?: React.ReactNode | (() => React.ReactNode)
55
+ renderLabel?: Renderable
55
56
 
56
57
  //TODO children has to be typed better
57
58
  //e.g.: ChildrenPropTypes.oneOf(['Options', 'Item', 'Separator']))