@instructure/ui-options 8.26.3 → 8.26.4-snapshot-6
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 +11 -0
- package/es/Options/Item/styles.js +2 -1
- package/lib/Options/Item/styles.js +2 -1
- package/package.json +14 -14
- package/src/Options/Item/props.ts +6 -10
- package/src/Options/Item/styles.ts +3 -2
- package/src/Options/props.ts +2 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Options/Item/props.d.ts +5 -6
- package/types/Options/Item/props.d.ts.map +1 -1
- package/types/Options/Item/styles.d.ts.map +1 -1
- package/types/Options/index.d.ts +2 -2
- package/types/Options/props.d.ts +2 -1
- package/types/Options/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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-6](https://github.com/instructure/instructure-ui/compare/v8.26.3...v8.26.4-snapshot-6) (2022-07-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support React 18 ([0a2bf0c](https://github.com/instructure/instructure-ui/commit/0a2bf0cdd4d8bcec6e42a7ccf28a787e4a35bc40))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [8.26.3](https://github.com/instructure/instructure-ui/compare/v8.26.2...v8.26.3) (2022-07-14)
|
|
7
18
|
|
|
8
19
|
**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.
|
|
3
|
+
"version": "8.26.4-snapshot-6",
|
|
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.
|
|
27
|
-
"@instructure/ui-color-utils": "8.26.
|
|
28
|
-
"@instructure/ui-test-locator": "8.26.
|
|
29
|
-
"@instructure/ui-test-utils": "8.26.
|
|
30
|
-
"@instructure/ui-themes": "8.26.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.26.4-snapshot-6",
|
|
27
|
+
"@instructure/ui-color-utils": "8.26.4-snapshot-6",
|
|
28
|
+
"@instructure/ui-test-locator": "8.26.4-snapshot-6",
|
|
29
|
+
"@instructure/ui-test-utils": "8.26.4-snapshot-6",
|
|
30
|
+
"@instructure/ui-themes": "8.26.4-snapshot-6"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.13.10",
|
|
34
|
-
"@instructure/emotion": "8.26.
|
|
35
|
-
"@instructure/shared-types": "8.26.
|
|
36
|
-
"@instructure/ui-icons": "8.26.
|
|
37
|
-
"@instructure/ui-prop-types": "8.26.
|
|
38
|
-
"@instructure/ui-react-utils": "8.26.
|
|
39
|
-
"@instructure/ui-testable": "8.26.
|
|
40
|
-
"@instructure/ui-view": "8.26.
|
|
34
|
+
"@instructure/emotion": "8.26.4-snapshot-6",
|
|
35
|
+
"@instructure/shared-types": "8.26.4-snapshot-6",
|
|
36
|
+
"@instructure/ui-icons": "8.26.4-snapshot-6",
|
|
37
|
+
"@instructure/ui-prop-types": "8.26.4-snapshot-6",
|
|
38
|
+
"@instructure/ui-react-utils": "8.26.4-snapshot-6",
|
|
39
|
+
"@instructure/ui-testable": "8.26.4-snapshot-6",
|
|
40
|
+
"@instructure/ui-view": "8.26.4-snapshot-6",
|
|
41
41
|
"prop-types": "^15"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"react": ">=16.8 <=
|
|
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?:
|
|
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?:
|
|
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 = {
|
package/src/Options/props.ts
CHANGED
|
@@ -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?:
|
|
55
|
+
renderLabel?: Renderable
|
|
55
56
|
|
|
56
57
|
//TODO children has to be typed better
|
|
57
58
|
//e.g.: ChildrenPropTypes.oneOf(['Options', 'Item', 'Separator']))
|