@instructure/ui-options 11.7.8 → 11.7.9-pr-snapshot-1792147648392
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 +13 -0
- package/es/Options/v1/Item/index.js +100 -129
- package/es/Options/v1/Item/props.js +17 -26
- package/es/Options/v1/Item/styles.js +143 -188
- package/es/Options/v1/Item/theme.js +37 -71
- package/es/Options/v1/Separator/index.js +44 -65
- package/es/Options/v1/Separator/props.js +4 -26
- package/es/Options/v1/Separator/styles.js +11 -45
- package/es/Options/v1/Separator/theme.js +11 -44
- package/es/Options/v1/index.js +125 -147
- package/es/Options/v1/props.js +8 -26
- package/es/Options/v1/styles.js +22 -56
- package/es/Options/v1/theme.js +13 -46
- package/es/Options/v2/Item/index.js +100 -129
- package/es/Options/v2/Item/props.js +17 -26
- package/es/Options/v2/Item/styles.js +143 -188
- package/es/Options/v2/Separator/index.js +44 -65
- package/es/Options/v2/Separator/props.js +4 -26
- package/es/Options/v2/Separator/styles.js +11 -45
- package/es/Options/v2/index.js +125 -147
- package/es/Options/v2/props.js +8 -26
- package/es/Options/v2/styles.js +22 -56
- package/es/exports/a.js +1 -25
- package/es/exports/b.js +1 -25
- package/package.json +13 -19
- package/tsconfig.build.json +0 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/lib/Options/v1/Item/index.js +0 -142
- package/lib/Options/v1/Item/props.js +0 -31
- package/lib/Options/v1/Item/styles.js +0 -197
- package/lib/Options/v1/Item/theme.js +0 -79
- package/lib/Options/v1/Separator/index.js +0 -76
- package/lib/Options/v1/Separator/props.js +0 -31
- package/lib/Options/v1/Separator/styles.js +0 -52
- package/lib/Options/v1/Separator/theme.js +0 -52
- package/lib/Options/v1/index.js +0 -168
- package/lib/Options/v1/props.js +0 -31
- package/lib/Options/v1/styles.js +0 -63
- package/lib/Options/v1/theme.js +0 -54
- package/lib/Options/v2/Item/index.js +0 -141
- package/lib/Options/v2/Item/props.js +0 -31
- package/lib/Options/v2/Item/styles.js +0 -197
- package/lib/Options/v2/Separator/index.js +0 -75
- package/lib/Options/v2/Separator/props.js +0 -31
- package/lib/Options/v2/Separator/styles.js +0 -52
- package/lib/Options/v2/index.js +0 -167
- package/lib/Options/v2/props.js +0 -31
- package/lib/Options/v2/styles.js +0 -63
- package/lib/exports/a.js +0 -47
- package/lib/exports/b.js +0 -26
- package/lib/package.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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
|
+
## [11.7.9-pr-snapshot-1792147648392](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.9-pr-snapshot-1792147648392) (2026-10-16)
|
|
7
|
+
|
|
8
|
+
### Build System
|
|
9
|
+
|
|
10
|
+
* **many:** replace babel with swc ([7e36c54](https://github.com/instructure/instructure-ui/commit/7e36c54d240b4fa483801c03ab18e7f860f561e2))
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
* **many:** `@instructure/ui-babel-preset` and
|
|
15
|
+
`@instructure/browserslist-config-instui` are removed and will no longer be
|
|
16
|
+
published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [11.7.8](https://github.com/instructure/instructure-ui/compare/v11.7.7...v11.7.8) (2026-10-02)
|
|
7
20
|
|
|
8
21
|
**Note:** Version bump only for package @instructure/ui-options
|
|
@@ -1,138 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* The MIT License (MIT)
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
6
|
-
*
|
|
7
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
* in the Software without restriction, including without limitation the rights
|
|
10
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
* furnished to do so, subject to the following conditions:
|
|
13
|
-
*
|
|
14
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
* copies or substantial portions of the Software.
|
|
16
|
-
*
|
|
17
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
* SOFTWARE.
|
|
24
|
-
*/
|
|
25
|
-
|
|
1
|
+
import { _ as _ts_decorate } from "@swc/helpers/_/_ts_decorate";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
26
3
|
import { Component, createElement } from 'react';
|
|
27
4
|
import { omitProps, getElementType, callRenderProp, withDeterministicId } from '@instructure/ui-react-utils';
|
|
28
5
|
import { withStyle } from '@instructure/emotion';
|
|
29
6
|
import generateStyles from './styles.js';
|
|
30
7
|
import generateComponentTheme from './theme.js';
|
|
31
8
|
import { allowedProps } from './props.js';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
ref = null;
|
|
54
|
-
_descriptionId;
|
|
55
|
-
constructor(props) {
|
|
56
|
-
super(props);
|
|
57
|
-
this._descriptionId = props.deterministicId('OptionsItem-description');
|
|
58
|
-
}
|
|
59
|
-
componentDidMount() {
|
|
60
|
-
this.props.makeStyles?.();
|
|
61
|
-
}
|
|
62
|
-
componentDidUpdate() {
|
|
63
|
-
this.props.makeStyles?.();
|
|
64
|
-
}
|
|
65
|
-
renderContent(renderLabel, contentVariant) {
|
|
66
|
-
const {
|
|
67
|
-
styles,
|
|
68
|
-
variant,
|
|
69
|
-
as,
|
|
70
|
-
role,
|
|
71
|
-
children
|
|
72
|
-
} = this.props;
|
|
73
|
-
let labelContent;
|
|
74
|
-
if (typeof renderLabel === 'function') {
|
|
75
|
-
labelContent = /*#__PURE__*/createElement(renderLabel, {
|
|
76
|
-
variant,
|
|
77
|
-
as,
|
|
78
|
-
role
|
|
79
|
-
}, children);
|
|
80
|
-
} else {
|
|
81
|
-
labelContent = renderLabel;
|
|
9
|
+
class Item extends Component {
|
|
10
|
+
static{
|
|
11
|
+
this.displayName = 'Item';
|
|
12
|
+
}
|
|
13
|
+
static{
|
|
14
|
+
this.componentId = 'Options.Item';
|
|
15
|
+
}
|
|
16
|
+
static{
|
|
17
|
+
this.allowedProps = allowedProps;
|
|
18
|
+
}
|
|
19
|
+
static{
|
|
20
|
+
this.defaultProps = {
|
|
21
|
+
as: 'span',
|
|
22
|
+
variant: 'default',
|
|
23
|
+
role: 'listitem',
|
|
24
|
+
voiceoverRoleBugWorkaround: false,
|
|
25
|
+
beforeLabelContentVAlign: 'center',
|
|
26
|
+
afterLabelContentVAlign: 'center',
|
|
27
|
+
isSelected: false
|
|
28
|
+
};
|
|
82
29
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const ElementType = getElementType(Item, this.props, () => as);
|
|
105
|
-
const InnerElementType = href ? 'a' : 'span';
|
|
106
|
-
const passthroughProps = omitProps(this.props, Item.allowedProps);
|
|
107
|
-
const childrenContent = callRenderProp(children);
|
|
108
|
-
const descriptionContent = callRenderProp(description);
|
|
109
|
-
const ariaDescribedBy = this.props['aria-describedby'] || (descriptionContent ? this._descriptionId : undefined);
|
|
110
|
-
return _jsxs(ElementType, {
|
|
111
|
-
role: voiceoverRoleBugWorkaround ? role : 'none',
|
|
112
|
-
"data-cid": "Options.Item",
|
|
113
|
-
css: styles?.item,
|
|
114
|
-
ref: element => {
|
|
115
|
-
this.ref = element;
|
|
116
|
-
if (typeof elementRef === 'function') {
|
|
117
|
-
elementRef(element);
|
|
30
|
+
constructor(props){
|
|
31
|
+
super(props), this.ref = null;
|
|
32
|
+
this._descriptionId = props.deterministicId('OptionsItem-description');
|
|
33
|
+
}
|
|
34
|
+
componentDidMount() {
|
|
35
|
+
this.props.makeStyles?.();
|
|
36
|
+
}
|
|
37
|
+
componentDidUpdate() {
|
|
38
|
+
this.props.makeStyles?.();
|
|
39
|
+
}
|
|
40
|
+
renderContent(renderLabel, contentVariant) {
|
|
41
|
+
const { styles, variant, as, role, children } = this.props;
|
|
42
|
+
let labelContent;
|
|
43
|
+
if (typeof renderLabel === 'function') {
|
|
44
|
+
labelContent = /*#__PURE__*/ createElement(renderLabel, {
|
|
45
|
+
variant,
|
|
46
|
+
as,
|
|
47
|
+
role
|
|
48
|
+
}, children);
|
|
49
|
+
} else {
|
|
50
|
+
labelContent = renderLabel;
|
|
118
51
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
52
|
+
return /*#__PURE__*/ _jsx("span", {
|
|
53
|
+
css: [
|
|
54
|
+
styles?.content,
|
|
55
|
+
contentVariant
|
|
56
|
+
],
|
|
57
|
+
role: "presentation",
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
children: labelContent
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
render() {
|
|
63
|
+
const { as, href, role, styles, description, descriptionRole, renderBeforeLabel, renderAfterLabel, elementRef, children, voiceoverRoleBugWorkaround } = this.props;
|
|
64
|
+
const ElementType = getElementType(Item, this.props, ()=>as);
|
|
65
|
+
const InnerElementType = href ? 'a' : 'span';
|
|
66
|
+
const passthroughProps = omitProps(this.props, Item.allowedProps);
|
|
67
|
+
const childrenContent = callRenderProp(children);
|
|
68
|
+
const descriptionContent = callRenderProp(description);
|
|
69
|
+
const ariaDescribedBy = this.props['aria-describedby'] || (descriptionContent ? this._descriptionId : undefined);
|
|
70
|
+
return /*#__PURE__*/ _jsxs(ElementType, {
|
|
71
|
+
role: voiceoverRoleBugWorkaround ? role : 'none',
|
|
72
|
+
"data-cid": "Options.Item",
|
|
73
|
+
css: styles?.item,
|
|
74
|
+
ref: (element)=>{
|
|
75
|
+
this.ref = element;
|
|
76
|
+
if (typeof elementRef === 'function') {
|
|
77
|
+
elementRef(element);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"aria-describedby": voiceoverRoleBugWorkaround ? ariaDescribedBy : undefined,
|
|
81
|
+
children: [
|
|
82
|
+
/*#__PURE__*/ _jsxs(InnerElementType, {
|
|
83
|
+
...passthroughProps,
|
|
84
|
+
css: styles?.container,
|
|
85
|
+
role: href || voiceoverRoleBugWorkaround ? undefined : role,
|
|
86
|
+
href: href,
|
|
87
|
+
"aria-describedby": voiceoverRoleBugWorkaround ? undefined : ariaDescribedBy,
|
|
88
|
+
children: [
|
|
89
|
+
childrenContent,
|
|
90
|
+
descriptionContent && /*#__PURE__*/ _jsx("span", {
|
|
91
|
+
css: styles?.description,
|
|
92
|
+
role: descriptionRole,
|
|
93
|
+
id: this._descriptionId,
|
|
94
|
+
children: descriptionContent
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}),
|
|
98
|
+
renderBeforeLabel && this.renderContent(renderBeforeLabel, styles?.contentBefore),
|
|
99
|
+
renderAfterLabel && this.renderContent(renderAfterLabel, styles?.contentAfter)
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
Item = _ts_decorate([
|
|
105
|
+
withDeterministicId(),
|
|
106
|
+
withStyle(generateStyles, generateComponentTheme)
|
|
107
|
+
], Item);
|
|
137
108
|
export default Item;
|
|
138
|
-
export { Item };
|
|
109
|
+
export { Item };
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
const allowedProps = ['as', 'variant', 'role', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'voiceoverRoleBugWorkaround', 'href', 'elementRef', 'children', 'isSelected'];
|
|
26
|
-
export { allowedProps };
|
|
1
|
+
const allowedProps = [
|
|
2
|
+
'as',
|
|
3
|
+
'variant',
|
|
4
|
+
'role',
|
|
5
|
+
'renderBeforeLabel',
|
|
6
|
+
'renderAfterLabel',
|
|
7
|
+
'beforeLabelContentVAlign',
|
|
8
|
+
'afterLabelContentVAlign',
|
|
9
|
+
'description',
|
|
10
|
+
'descriptionRole',
|
|
11
|
+
'voiceoverRoleBugWorkaround',
|
|
12
|
+
'href',
|
|
13
|
+
'elementRef',
|
|
14
|
+
'children',
|
|
15
|
+
'isSelected'
|
|
16
|
+
];
|
|
17
|
+
export { allowedProps };
|
|
@@ -1,191 +1,146 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The MIT License (MIT)
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2015 - present Instructure, Inc.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
1
|
import { matchComponentTypes } from '@instructure/ui-react-utils';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
|
|
2
|
+
const generateStyle = (componentTheme, props)=>{
|
|
3
|
+
const { variant, children, renderBeforeLabel: hasContentBeforeLabel, renderAfterLabel: hasContentAfterLabel, beforeLabelContentVAlign, afterLabelContentVAlign } = props;
|
|
4
|
+
const containsList = matchComponentTypes(children, [
|
|
5
|
+
'Options'
|
|
6
|
+
]);
|
|
7
|
+
const variantVariants = {
|
|
8
|
+
highlighted: {
|
|
9
|
+
background: componentTheme.highlightedBackground,
|
|
10
|
+
color: componentTheme.highlightedLabelColor
|
|
11
|
+
},
|
|
12
|
+
selected: {
|
|
13
|
+
background: componentTheme.selectedBackground,
|
|
14
|
+
color: componentTheme.highlightedLabelColor
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
cursor: 'not-allowed',
|
|
18
|
+
opacity: 0.68
|
|
19
|
+
},
|
|
20
|
+
'highlighted-disabled': {
|
|
21
|
+
background: componentTheme.highlightedBackground,
|
|
22
|
+
color: componentTheme.highlightedLabelColor,
|
|
23
|
+
cursor: 'not-allowed'
|
|
24
|
+
},
|
|
25
|
+
'selected-highlighted': {
|
|
26
|
+
background: componentTheme.selectedHighlightedBackground,
|
|
27
|
+
color: componentTheme.highlightedLabelColor
|
|
28
|
+
},
|
|
29
|
+
default: {
|
|
30
|
+
transition: 'background 200ms'
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const getContentVAlign = (type)=>{
|
|
34
|
+
const vAlign = type === 'before' ? beforeLabelContentVAlign : afterLabelContentVAlign;
|
|
35
|
+
const vOffset = type === 'before' ? componentTheme.beforeLabelContentVOffset : componentTheme.afterLabelContentVOffset;
|
|
36
|
+
return ({
|
|
37
|
+
start: {
|
|
38
|
+
alignItems: 'flex-start',
|
|
39
|
+
paddingBlockStart: vOffset
|
|
40
|
+
},
|
|
41
|
+
center: {
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
paddingBlockStart: vOffset,
|
|
44
|
+
paddingBlockEnd: vOffset
|
|
45
|
+
},
|
|
46
|
+
end: {
|
|
47
|
+
alignItems: 'flex-end',
|
|
48
|
+
paddingBlockEnd: vOffset
|
|
49
|
+
}
|
|
50
|
+
})[vAlign];
|
|
51
|
+
};
|
|
52
|
+
const linkStyles = {
|
|
53
|
+
textDecoration: 'none',
|
|
54
|
+
color: 'currentColor'
|
|
55
|
+
};
|
|
78
56
|
return {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
label: 'optionItem__content--before',
|
|
168
|
-
insetInlineEnd: 'auto',
|
|
169
|
-
insetInlineStart: componentTheme.iconPadding,
|
|
170
|
-
...getContentVAlign('before')
|
|
171
|
-
},
|
|
172
|
-
contentAfter: {
|
|
173
|
-
label: 'optionItem__content--after',
|
|
174
|
-
insetInlineEnd: componentTheme.iconPadding,
|
|
175
|
-
insetInlineStart: 'auto',
|
|
176
|
-
...getContentVAlign('after')
|
|
177
|
-
},
|
|
178
|
-
description: {
|
|
179
|
-
label: 'optionItem__description',
|
|
180
|
-
display: 'block',
|
|
181
|
-
paddingBlockStart: componentTheme.descriptionPaddingStart,
|
|
182
|
-
fontWeight: componentTheme.descriptionFontWeight,
|
|
183
|
-
fontSize: componentTheme.descriptionFontSize,
|
|
184
|
-
lineHeight: componentTheme.descriptionLineHeight,
|
|
185
|
-
color: componentTheme.descriptionColor,
|
|
186
|
-
...variantVariants[variant],
|
|
187
|
-
background: 'none' // needed to clear variant background
|
|
188
|
-
}
|
|
189
|
-
};
|
|
57
|
+
item: {
|
|
58
|
+
label: 'optionItem',
|
|
59
|
+
background: componentTheme.background,
|
|
60
|
+
color: componentTheme.color,
|
|
61
|
+
cursor: 'pointer',
|
|
62
|
+
display: 'block',
|
|
63
|
+
fontSize: componentTheme.fontSize,
|
|
64
|
+
fontFamily: componentTheme.fontFamily,
|
|
65
|
+
fontWeight: props.isSelected ? componentTheme.fontWeightSelected : componentTheme.fontWeight,
|
|
66
|
+
lineHeight: componentTheme.lineHeight,
|
|
67
|
+
outline: 'none',
|
|
68
|
+
position: 'relative',
|
|
69
|
+
userSelect: 'none',
|
|
70
|
+
...variantVariants[variant],
|
|
71
|
+
...containsList && {
|
|
72
|
+
cursor: 'default'
|
|
73
|
+
},
|
|
74
|
+
'[class*=-optionItem] &': {
|
|
75
|
+
...!hasContentBeforeLabel && {
|
|
76
|
+
'[class$=-optionItem__container]': {
|
|
77
|
+
paddingInlineStart: componentTheme.nestedPadding
|
|
78
|
+
},
|
|
79
|
+
'[class$=-optionItem__content--before]': {
|
|
80
|
+
insetInlineStart: componentTheme.nestedPadding
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
container: {
|
|
86
|
+
label: 'optionItem__container',
|
|
87
|
+
display: 'block',
|
|
88
|
+
outline: 'none',
|
|
89
|
+
padding: componentTheme.padding,
|
|
90
|
+
...containsList && {
|
|
91
|
+
padding: '0'
|
|
92
|
+
},
|
|
93
|
+
...hasContentBeforeLabel && {
|
|
94
|
+
paddingInlineEnd: componentTheme.iconPadding,
|
|
95
|
+
paddingInlineStart: `calc(${componentTheme.iconPadding} * 2 + 1em)`
|
|
96
|
+
},
|
|
97
|
+
...hasContentAfterLabel && {
|
|
98
|
+
paddingInlineEnd: `calc(${componentTheme.iconPadding} * 2 + 1em)`,
|
|
99
|
+
paddingInlineStart: componentTheme.iconPadding
|
|
100
|
+
},
|
|
101
|
+
...hasContentBeforeLabel && hasContentAfterLabel && {
|
|
102
|
+
paddingInlineEnd: `calc(${componentTheme.iconPadding} * 2 + 1em)`,
|
|
103
|
+
paddingInlineStart: `calc(${componentTheme.iconPadding} * 2 + 1em)`
|
|
104
|
+
},
|
|
105
|
+
'&:is(a)': {
|
|
106
|
+
'&, &:link, &:visited, &:active, &:hover, &:focus': linkStyles
|
|
107
|
+
},
|
|
108
|
+
'&:-webkit-any(a)': {
|
|
109
|
+
'&, &:link, &:visited, &:active, &:hover, &:focus': linkStyles
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
content: {
|
|
113
|
+
label: 'optionItem__content',
|
|
114
|
+
display: 'flex',
|
|
115
|
+
height: '100%',
|
|
116
|
+
boxSizing: 'border-box',
|
|
117
|
+
pointerEvents: 'none',
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
top: '0'
|
|
120
|
+
},
|
|
121
|
+
contentBefore: {
|
|
122
|
+
label: 'optionItem__content--before',
|
|
123
|
+
insetInlineEnd: 'auto',
|
|
124
|
+
insetInlineStart: componentTheme.iconPadding,
|
|
125
|
+
...getContentVAlign('before')
|
|
126
|
+
},
|
|
127
|
+
contentAfter: {
|
|
128
|
+
label: 'optionItem__content--after',
|
|
129
|
+
insetInlineEnd: componentTheme.iconPadding,
|
|
130
|
+
insetInlineStart: 'auto',
|
|
131
|
+
...getContentVAlign('after')
|
|
132
|
+
},
|
|
133
|
+
description: {
|
|
134
|
+
label: 'optionItem__description',
|
|
135
|
+
display: 'block',
|
|
136
|
+
paddingBlockStart: componentTheme.descriptionPaddingStart,
|
|
137
|
+
fontWeight: componentTheme.descriptionFontWeight,
|
|
138
|
+
fontSize: componentTheme.descriptionFontSize,
|
|
139
|
+
lineHeight: componentTheme.descriptionLineHeight,
|
|
140
|
+
color: componentTheme.descriptionColor,
|
|
141
|
+
...variantVariants[variant],
|
|
142
|
+
background: 'none'
|
|
143
|
+
}
|
|
144
|
+
};
|
|
190
145
|
};
|
|
191
|
-
export default generateStyle;
|
|
146
|
+
export default generateStyle;
|