@instructure/ui-list 10.26.1-snapshot-2 → 10.26.2
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 +5 -18
- package/es/InlineList/InlineListItem/index.js +6 -6
- package/es/InlineList/InlineListItem/props.js +13 -1
- package/es/InlineList/index.js +6 -9
- package/es/InlineList/props.js +13 -1
- package/es/List/ListItem/index.js +6 -6
- package/es/List/ListItem/props.js +12 -1
- package/es/List/index.js +6 -6
- package/es/List/props.js +14 -1
- package/lib/InlineList/InlineListItem/index.js +5 -5
- package/lib/InlineList/InlineListItem/props.js +13 -1
- package/lib/InlineList/index.js +5 -9
- package/lib/InlineList/props.js +14 -1
- package/lib/List/ListItem/index.js +5 -5
- package/lib/List/ListItem/props.js +12 -1
- package/lib/List/index.js +5 -5
- package/lib/List/props.js +15 -1
- package/package.json +15 -12
- package/src/InlineList/InlineListItem/index.tsx +4 -2
- package/src/InlineList/InlineListItem/props.ts +24 -1
- package/src/InlineList/index.tsx +4 -2
- package/src/InlineList/props.ts +31 -2
- package/src/List/ListItem/index.tsx +4 -2
- package/src/List/ListItem/props.ts +24 -1
- package/src/List/index.tsx +4 -2
- package/src/List/props.ts +33 -2
- package/tsconfig.build.json +2 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/InlineList/InlineListItem/index.d.ts +1 -0
- package/types/InlineList/InlineListItem/index.d.ts.map +1 -1
- package/types/InlineList/InlineListItem/props.d.ts +3 -2
- package/types/InlineList/InlineListItem/props.d.ts.map +1 -1
- package/types/InlineList/index.d.ts +9 -0
- package/types/InlineList/index.d.ts.map +1 -1
- package/types/InlineList/props.d.ts +3 -2
- package/types/InlineList/props.d.ts.map +1 -1
- package/types/List/ListItem/index.d.ts +1 -0
- package/types/List/ListItem/index.d.ts.map +1 -1
- package/types/List/ListItem/props.d.ts +3 -2
- package/types/List/ListItem/props.d.ts.map +1 -1
- package/types/List/index.d.ts +10 -0
- package/types/List/index.d.ts.map +1 -1
- package/types/List/props.d.ts +3 -2
- package/types/List/props.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-list",
|
|
3
|
-
"version": "10.26.
|
|
3
|
+
"version": "10.26.2",
|
|
4
4
|
"description": "Components for displaying vertical or horizontal lists.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,23 +24,26 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.27.6",
|
|
27
|
-
"@instructure/console": "10.26.
|
|
28
|
-
"@instructure/emotion": "10.26.
|
|
29
|
-
"@instructure/shared-types": "10.26.
|
|
30
|
-
"@instructure/ui-
|
|
31
|
-
"@instructure/ui-
|
|
27
|
+
"@instructure/console": "10.26.2",
|
|
28
|
+
"@instructure/emotion": "10.26.2",
|
|
29
|
+
"@instructure/shared-types": "10.26.2",
|
|
30
|
+
"@instructure/ui-prop-types": "10.26.2",
|
|
31
|
+
"@instructure/ui-react-utils": "10.26.2",
|
|
32
|
+
"@instructure/ui-testable": "10.26.2",
|
|
33
|
+
"@instructure/ui-view": "10.26.2",
|
|
34
|
+
"prop-types": "^15.8.1"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
|
-
"@instructure/ui-axe-check": "10.26.
|
|
35
|
-
"@instructure/ui-babel-preset": "10.26.
|
|
36
|
-
"@instructure/ui-color-utils": "10.26.
|
|
37
|
-
"@instructure/ui-themes": "10.26.
|
|
37
|
+
"@instructure/ui-axe-check": "10.26.2",
|
|
38
|
+
"@instructure/ui-babel-preset": "10.26.2",
|
|
39
|
+
"@instructure/ui-color-utils": "10.26.2",
|
|
40
|
+
"@instructure/ui-themes": "10.26.2",
|
|
38
41
|
"@testing-library/jest-dom": "^6.6.3",
|
|
39
|
-
"@testing-library/react": "
|
|
42
|
+
"@testing-library/react": "^16.0.1",
|
|
40
43
|
"vitest": "^3.2.2"
|
|
41
44
|
},
|
|
42
45
|
"peerDependencies": {
|
|
43
|
-
"react": ">=
|
|
46
|
+
"react": ">=16.14 <=18"
|
|
44
47
|
},
|
|
45
48
|
"publishConfig": {
|
|
46
49
|
"access": "public"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
27
|
import { View } from '@instructure/ui-view'
|
|
28
|
+
import { testable } from '@instructure/ui-testable'
|
|
28
29
|
import { passthroughProps } from '@instructure/ui-react-utils'
|
|
29
30
|
|
|
30
31
|
import { withStyle } from '@instructure/emotion'
|
|
@@ -32,7 +33,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
32
33
|
import generateStyle from './styles'
|
|
33
34
|
import generateComponentTheme from './theme'
|
|
34
35
|
|
|
35
|
-
import { allowedProps } from './props'
|
|
36
|
+
import { propTypes, allowedProps } from './props'
|
|
36
37
|
import type { InlineListItemProps } from './props'
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -42,9 +43,11 @@ id: InlineList.Item
|
|
|
42
43
|
---
|
|
43
44
|
**/
|
|
44
45
|
@withStyle(generateStyle, generateComponentTheme)
|
|
46
|
+
@testable()
|
|
45
47
|
class InlineListItem extends Component<InlineListItemProps> {
|
|
46
48
|
static readonly componentId = 'InlineList.Item'
|
|
47
49
|
|
|
50
|
+
static propTypes = propTypes
|
|
48
51
|
static allowedProps = allowedProps
|
|
49
52
|
static defaultProps = {
|
|
50
53
|
padding: 'none',
|
|
@@ -98,7 +101,6 @@ class InlineListItem extends Component<InlineListItemProps> {
|
|
|
98
101
|
display="inline-block"
|
|
99
102
|
maxWidth="100%"
|
|
100
103
|
elementRef={this.handleRef}
|
|
101
|
-
data-cid="InlineListItem"
|
|
102
104
|
>
|
|
103
105
|
{children}
|
|
104
106
|
{!lastPlaceholder && (
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { PropsWithChildren } from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
26
27
|
|
|
27
28
|
import type {
|
|
28
29
|
Spacing,
|
|
@@ -30,6 +31,7 @@ import type {
|
|
|
30
31
|
ComponentStyle
|
|
31
32
|
} from '@instructure/emotion'
|
|
32
33
|
import type {
|
|
34
|
+
PropValidators,
|
|
33
35
|
InlineListItemTheme,
|
|
34
36
|
OtherHTMLAttributes
|
|
35
37
|
} from '@instructure/shared-types'
|
|
@@ -85,6 +87,27 @@ type InlineListItemProps = InlineListItemOwnProps &
|
|
|
85
87
|
|
|
86
88
|
type InlineListItemStyle = ComponentStyle<'inlineListItem' | 'delimiter'>
|
|
87
89
|
|
|
90
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
91
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
92
|
+
delimiter: PropTypes.oneOf(['none', 'pipe', 'slash', 'arrow']),
|
|
93
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
94
|
+
margin: PropTypes.string,
|
|
95
|
+
padding: PropTypes.string,
|
|
96
|
+
spacing: PropTypes.oneOf([
|
|
97
|
+
'none',
|
|
98
|
+
'xxx-small',
|
|
99
|
+
'xx-small',
|
|
100
|
+
'x-small',
|
|
101
|
+
'small',
|
|
102
|
+
'medium',
|
|
103
|
+
'large',
|
|
104
|
+
'x-large',
|
|
105
|
+
'xx-large'
|
|
106
|
+
]),
|
|
107
|
+
elementRef: PropTypes.func,
|
|
108
|
+
lastPlaceholder: PropTypes.bool
|
|
109
|
+
}
|
|
110
|
+
|
|
88
111
|
const allowedProps: AllowedPropKeys = [
|
|
89
112
|
'children',
|
|
90
113
|
'delimiter',
|
|
@@ -96,4 +119,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
96
119
|
]
|
|
97
120
|
|
|
98
121
|
export type { InlineListItemProps, InlineListItemStyle }
|
|
99
|
-
export { allowedProps }
|
|
122
|
+
export { propTypes, allowedProps }
|
package/src/InlineList/index.tsx
CHANGED
|
@@ -25,10 +25,11 @@ import { Children, Component, ReactElement } from 'react'
|
|
|
25
25
|
|
|
26
26
|
import { View } from '@instructure/ui-view'
|
|
27
27
|
import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils'
|
|
28
|
+
import { testable } from '@instructure/ui-testable'
|
|
28
29
|
|
|
29
30
|
import { InlineListItem } from './InlineListItem'
|
|
30
31
|
|
|
31
|
-
import { allowedProps } from './props'
|
|
32
|
+
import { propTypes, allowedProps } from './props'
|
|
32
33
|
import type { InlineListProps } from './props'
|
|
33
34
|
|
|
34
35
|
/**
|
|
@@ -37,7 +38,9 @@ category: components
|
|
|
37
38
|
---
|
|
38
39
|
|
|
39
40
|
**/
|
|
41
|
+
@testable()
|
|
40
42
|
class InlineList extends Component<InlineListProps> {
|
|
43
|
+
static propTypes = propTypes
|
|
41
44
|
static allowedProps = allowedProps
|
|
42
45
|
static defaultProps = {
|
|
43
46
|
itemSpacing: 'none',
|
|
@@ -90,7 +93,6 @@ class InlineList extends Component<InlineListProps> {
|
|
|
90
93
|
padding="0"
|
|
91
94
|
elementRef={this.handleRef}
|
|
92
95
|
display="block"
|
|
93
|
-
data-cid="InlineList"
|
|
94
96
|
>
|
|
95
97
|
{this.renderChildren()}
|
|
96
98
|
</View>
|
package/src/InlineList/props.ts
CHANGED
|
@@ -23,8 +23,16 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
28
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
29
|
+
import { InlineListItem } from './InlineListItem'
|
|
30
|
+
|
|
26
31
|
import type { Spacing } from '@instructure/emotion'
|
|
27
|
-
import type {
|
|
32
|
+
import type {
|
|
33
|
+
OtherHTMLAttributes,
|
|
34
|
+
PropValidators
|
|
35
|
+
} from '@instructure/shared-types'
|
|
28
36
|
|
|
29
37
|
type InlineListOwnProps = {
|
|
30
38
|
/**
|
|
@@ -66,6 +74,27 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
|
|
|
66
74
|
|
|
67
75
|
type InlineListProps = InlineListOwnProps &
|
|
68
76
|
OtherHTMLAttributes<InlineListOwnProps>
|
|
77
|
+
|
|
78
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
79
|
+
children: ChildrenPropTypes.oneOf([InlineListItem]),
|
|
80
|
+
as: PropTypes.oneOf(['ul', 'ol']),
|
|
81
|
+
margin: PropTypes.string,
|
|
82
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
83
|
+
delimiter: PropTypes.oneOf(['none', 'pipe', 'slash', 'arrow']),
|
|
84
|
+
itemSpacing: PropTypes.oneOf([
|
|
85
|
+
'none',
|
|
86
|
+
'xxx-small',
|
|
87
|
+
'xx-small',
|
|
88
|
+
'x-small',
|
|
89
|
+
'small',
|
|
90
|
+
'medium',
|
|
91
|
+
'large',
|
|
92
|
+
'x-large',
|
|
93
|
+
'xx-large'
|
|
94
|
+
]),
|
|
95
|
+
elementRef: PropTypes.func
|
|
96
|
+
}
|
|
97
|
+
|
|
69
98
|
const allowedProps: AllowedPropKeys = [
|
|
70
99
|
'children',
|
|
71
100
|
'as',
|
|
@@ -77,4 +106,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
77
106
|
]
|
|
78
107
|
|
|
79
108
|
export type { InlineListProps }
|
|
80
|
-
export { allowedProps }
|
|
109
|
+
export { propTypes, allowedProps }
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
import { Component } from 'react'
|
|
26
26
|
|
|
27
27
|
import { View } from '@instructure/ui-view'
|
|
28
|
+
import { testable } from '@instructure/ui-testable'
|
|
28
29
|
import { passthroughProps } from '@instructure/ui-react-utils'
|
|
29
30
|
|
|
30
31
|
import { withStyle } from '@instructure/emotion'
|
|
@@ -32,7 +33,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
32
33
|
import generateStyle from './styles'
|
|
33
34
|
import generateComponentTheme from './theme'
|
|
34
35
|
|
|
35
|
-
import { allowedProps } from './props'
|
|
36
|
+
import { propTypes, allowedProps } from './props'
|
|
36
37
|
import type { ListItemProps } from './props'
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -42,9 +43,11 @@ id: List.Item
|
|
|
42
43
|
---
|
|
43
44
|
**/
|
|
44
45
|
@withStyle(generateStyle, generateComponentTheme)
|
|
46
|
+
@testable()
|
|
45
47
|
class ListItem extends Component<ListItemProps> {
|
|
46
48
|
static readonly componentId = 'List.Item'
|
|
47
49
|
|
|
50
|
+
static propTypes = propTypes
|
|
48
51
|
static allowedProps = allowedProps
|
|
49
52
|
static defaultProps = {
|
|
50
53
|
padding: 'none',
|
|
@@ -95,7 +98,6 @@ class ListItem extends Component<ListItemProps> {
|
|
|
95
98
|
padding={padding}
|
|
96
99
|
maxWidth="100%"
|
|
97
100
|
elementRef={this.handleRef}
|
|
98
|
-
data-cid="ListItem"
|
|
99
101
|
>
|
|
100
102
|
{children}
|
|
101
103
|
</View>
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { PropsWithChildren } from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
26
27
|
|
|
27
28
|
import type {
|
|
28
29
|
Spacing,
|
|
@@ -30,6 +31,7 @@ import type {
|
|
|
30
31
|
ComponentStyle
|
|
31
32
|
} from '@instructure/emotion'
|
|
32
33
|
import type {
|
|
34
|
+
PropValidators,
|
|
33
35
|
ListItemTheme,
|
|
34
36
|
OtherHTMLAttributes
|
|
35
37
|
} from '@instructure/shared-types'
|
|
@@ -80,6 +82,27 @@ type ListItemProps = ListItemOwnProps &
|
|
|
80
82
|
OtherHTMLAttributes<ListItemOwnProps>
|
|
81
83
|
|
|
82
84
|
type ListItemStyle = ComponentStyle<'listItem'>
|
|
85
|
+
|
|
86
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
87
|
+
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
|
88
|
+
delimiter: PropTypes.oneOf(['none', 'dashed', 'solid']),
|
|
89
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
90
|
+
margin: PropTypes.string,
|
|
91
|
+
padding: PropTypes.string,
|
|
92
|
+
spacing: PropTypes.oneOf([
|
|
93
|
+
'none',
|
|
94
|
+
'xxx-small',
|
|
95
|
+
'xx-small',
|
|
96
|
+
'x-small',
|
|
97
|
+
'small',
|
|
98
|
+
'medium',
|
|
99
|
+
'large',
|
|
100
|
+
'x-large',
|
|
101
|
+
'xx-large'
|
|
102
|
+
]),
|
|
103
|
+
elementRef: PropTypes.func
|
|
104
|
+
}
|
|
105
|
+
|
|
83
106
|
const allowedProps: AllowedPropKeys = [
|
|
84
107
|
'children',
|
|
85
108
|
'delimiter',
|
|
@@ -91,4 +114,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
91
114
|
]
|
|
92
115
|
|
|
93
116
|
export type { ListItemProps, ListItemStyle }
|
|
94
|
-
export { allowedProps }
|
|
117
|
+
export { propTypes, allowedProps }
|
package/src/List/index.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import { Children, Component, ReactElement } from 'react'
|
|
|
26
26
|
|
|
27
27
|
import { View } from '@instructure/ui-view'
|
|
28
28
|
import { passthroughProps, safeCloneElement } from '@instructure/ui-react-utils'
|
|
29
|
+
import { testable } from '@instructure/ui-testable'
|
|
29
30
|
|
|
30
31
|
import { ListItem } from './ListItem'
|
|
31
32
|
|
|
@@ -34,7 +35,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
34
35
|
import generateStyle from './styles'
|
|
35
36
|
import generateComponentTheme from './theme'
|
|
36
37
|
|
|
37
|
-
import { allowedProps } from './props'
|
|
38
|
+
import { propTypes, allowedProps } from './props'
|
|
38
39
|
import type { ListProps } from './props'
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -43,9 +44,11 @@ category: components
|
|
|
43
44
|
---
|
|
44
45
|
**/
|
|
45
46
|
@withStyle(generateStyle, generateComponentTheme)
|
|
47
|
+
@testable()
|
|
46
48
|
class List extends Component<ListProps> {
|
|
47
49
|
static readonly componentId = 'List'
|
|
48
50
|
|
|
51
|
+
static propTypes = propTypes
|
|
49
52
|
static allowedProps = allowedProps
|
|
50
53
|
static defaultProps = {
|
|
51
54
|
as: 'ul',
|
|
@@ -101,7 +104,6 @@ class List extends Component<ListProps> {
|
|
|
101
104
|
margin={margin}
|
|
102
105
|
elementRef={this.handleRef}
|
|
103
106
|
display="block"
|
|
104
|
-
data-cid="List"
|
|
105
107
|
>
|
|
106
108
|
{this.renderChildren()}
|
|
107
109
|
</View>
|
package/src/List/props.ts
CHANGED
|
@@ -23,13 +23,22 @@
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import React from 'react'
|
|
26
|
+
import PropTypes from 'prop-types'
|
|
27
|
+
|
|
28
|
+
import { Children as ChildrenPropTypes } from '@instructure/ui-prop-types'
|
|
29
|
+
|
|
30
|
+
import { ListItem } from './ListItem'
|
|
26
31
|
|
|
27
32
|
import type {
|
|
28
33
|
Spacing,
|
|
29
34
|
WithStyleProps,
|
|
30
35
|
ComponentStyle
|
|
31
36
|
} from '@instructure/emotion'
|
|
32
|
-
import type {
|
|
37
|
+
import type {
|
|
38
|
+
PropValidators,
|
|
39
|
+
ListTheme,
|
|
40
|
+
OtherHTMLAttributes
|
|
41
|
+
} from '@instructure/shared-types'
|
|
33
42
|
|
|
34
43
|
type ListOwnProps = {
|
|
35
44
|
/**
|
|
@@ -80,6 +89,28 @@ type ListProps = ListOwnProps &
|
|
|
80
89
|
OtherHTMLAttributes<ListOwnProps>
|
|
81
90
|
|
|
82
91
|
type ListStyle = ComponentStyle<'list'>
|
|
92
|
+
|
|
93
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
94
|
+
children: ChildrenPropTypes.oneOf([ListItem]),
|
|
95
|
+
as: PropTypes.oneOf(['ul', 'ol']),
|
|
96
|
+
delimiter: PropTypes.oneOf(['none', 'dashed', 'solid']),
|
|
97
|
+
isUnstyled: PropTypes.bool,
|
|
98
|
+
margin: PropTypes.string,
|
|
99
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
100
|
+
itemSpacing: PropTypes.oneOf([
|
|
101
|
+
'none',
|
|
102
|
+
'xxx-small',
|
|
103
|
+
'xx-small',
|
|
104
|
+
'x-small',
|
|
105
|
+
'small',
|
|
106
|
+
'medium',
|
|
107
|
+
'large',
|
|
108
|
+
'x-large',
|
|
109
|
+
'xx-large'
|
|
110
|
+
]),
|
|
111
|
+
elementRef: PropTypes.func
|
|
112
|
+
}
|
|
113
|
+
|
|
83
114
|
const allowedProps: AllowedPropKeys = [
|
|
84
115
|
'children',
|
|
85
116
|
'as',
|
|
@@ -92,4 +123,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
92
123
|
]
|
|
93
124
|
|
|
94
125
|
export type { ListProps, ListStyle }
|
|
95
|
-
export { allowedProps }
|
|
126
|
+
export { propTypes, allowedProps }
|
package/tsconfig.build.json
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
{ "path": "../emotion/tsconfig.build.json" },
|
|
12
12
|
{ "path": "../shared-types/tsconfig.build.json" },
|
|
13
13
|
{ "path": "../ui-axe-check/tsconfig.build.json" },
|
|
14
|
+
{ "path": "../ui-prop-types/tsconfig.build.json" },
|
|
14
15
|
{ "path": "../ui-react-utils/tsconfig.build.json" },
|
|
16
|
+
{ "path": "../ui-testable/tsconfig.build.json" },
|
|
15
17
|
{ "path": "../ui-view/tsconfig.build.json" },
|
|
16
18
|
{ "path": "../ui-babel-preset/tsconfig.build.json" },
|
|
17
19
|
{ "path": "../ui-color-utils/tsconfig.build.json" },
|