@instructure/ui-options 10.8.1-snapshot-4 → 10.9.0

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,9 +3,13 @@
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
- ## [10.8.1-snapshot-4](https://github.com/instructure/instructure-ui/compare/v10.8.0...v10.8.1-snapshot-4) (2024-12-12)
6
+ # [10.9.0](https://github.com/instructure/instructure-ui/compare/v10.8.0...v10.9.0) (2024-12-12)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-options
8
+
9
+ ### Features
10
+
11
+ * **many:** make meta package export every component and type definition ([dee9abb](https://github.com/instructure/instructure-ui/commit/dee9abb9cbffa4abc9edf48fb7d8ad41fea385b4))
12
+ * **shared-types,ui-options,ui-select:** allow to change font weight of selected option item in Select ([6818928](https://github.com/instructure/instructure-ui/commit/6818928536ad0145516c8d7d25eb8079c84089b6))
9
13
 
10
14
 
11
15
 
@@ -117,7 +117,8 @@ let Item = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyles, gene
117
117
  role: 'listitem',
118
118
  voiceoverRoleBugWorkaround: false,
119
119
  beforeLabelContentVAlign: 'center',
120
- afterLabelContentVAlign: 'center'
120
+ afterLabelContentVAlign: 'center',
121
+ isSelected: false
121
122
  }, _Item)) || _class) || _class) || _class);
122
123
  export default Item;
123
124
  export { Item };
@@ -36,7 +36,8 @@ const propTypes = {
36
36
  href: PropTypes.string,
37
37
  voiceoverRoleBugWorkaround: PropTypes.bool,
38
38
  elementRef: PropTypes.func,
39
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
39
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
40
+ isSelected: PropTypes.bool
40
41
  };
41
- const allowedProps = ['as', 'variant', 'role', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'voiceoverRoleBugWorkaround', 'href', 'elementRef', 'children'];
42
+ const allowedProps = ['as', 'variant', 'role', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'voiceoverRoleBugWorkaround', 'href', 'elementRef', 'children', 'isSelected'];
42
43
  export { propTypes, allowedProps };
@@ -98,7 +98,7 @@ const generateStyle = (componentTheme, props) => {
98
98
  display: 'block',
99
99
  fontSize: componentTheme.fontSize,
100
100
  fontFamily: componentTheme.fontFamily,
101
- fontWeight: componentTheme.fontWeight,
101
+ fontWeight: props.isSelected ? componentTheme.fontWeightSelected : componentTheme.fontWeight,
102
102
  lineHeight: componentTheme.lineHeight,
103
103
  outline: 'none',
104
104
  position: 'relative',
@@ -44,6 +44,7 @@ const generateComponentTheme = theme => {
44
44
  fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
45
45
  fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
46
46
  lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
47
+ fontWeightSelected: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
47
48
  color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
48
49
  background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
49
50
  highlightedLabelColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.white1010,
package/es/index.js CHANGED
@@ -23,6 +23,8 @@
23
23
  */
24
24
 
25
25
  export { Options } from './Options';
26
+ export { Item as OptionItem } from './Options/Item';
27
+ export { Separator as OptionSeparator } from './Options/Separator';
26
28
  export { optionsThemeGenerator } from './Options/theme';
27
29
  export { optionsItemThemeGenerator } from './Options/Item/theme';
28
30
  export { optionsSeparatorThemeGenerator } from './Options/Separator/theme';
@@ -122,6 +122,7 @@ let Item = exports.Item = (_dec = (0, _uiReactUtils.withDeterministicId)(), _dec
122
122
  role: 'listitem',
123
123
  voiceoverRoleBugWorkaround: false,
124
124
  beforeLabelContentVAlign: 'center',
125
- afterLabelContentVAlign: 'center'
125
+ afterLabelContentVAlign: 'center',
126
+ isSelected: false
126
127
  }, _Item)) || _class) || _class) || _class);
127
128
  var _default = exports.default = Item;
@@ -43,6 +43,7 @@ const propTypes = exports.propTypes = {
43
43
  href: _propTypes.default.string,
44
44
  voiceoverRoleBugWorkaround: _propTypes.default.bool,
45
45
  elementRef: _propTypes.default.func,
46
- children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func])
46
+ children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
47
+ isSelected: _propTypes.default.bool
47
48
  };
48
- const allowedProps = exports.allowedProps = ['as', 'variant', 'role', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'voiceoverRoleBugWorkaround', 'href', 'elementRef', 'children'];
49
+ const allowedProps = exports.allowedProps = ['as', 'variant', 'role', 'renderBeforeLabel', 'renderAfterLabel', 'beforeLabelContentVAlign', 'afterLabelContentVAlign', 'description', 'descriptionRole', 'voiceoverRoleBugWorkaround', 'href', 'elementRef', 'children', 'isSelected'];
@@ -104,7 +104,7 @@ const generateStyle = (componentTheme, props) => {
104
104
  display: 'block',
105
105
  fontSize: componentTheme.fontSize,
106
106
  fontFamily: componentTheme.fontFamily,
107
- fontWeight: componentTheme.fontWeight,
107
+ fontWeight: props.isSelected ? componentTheme.fontWeightSelected : componentTheme.fontWeight,
108
108
  lineHeight: componentTheme.lineHeight,
109
109
  outline: 'none',
110
110
  position: 'relative',
@@ -50,6 +50,7 @@ const generateComponentTheme = theme => {
50
50
  fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
51
51
  fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
52
52
  lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
53
+ fontWeightSelected: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
53
54
  color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
54
55
  background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
55
56
  highlightedLabelColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.white1010,
package/lib/index.js CHANGED
@@ -3,6 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "OptionItem", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _Item.Item;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "OptionSeparator", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _Separator.Separator;
16
+ }
17
+ });
6
18
  Object.defineProperty(exports, "Options", {
7
19
  enumerable: true,
8
20
  get: function () {
@@ -28,6 +40,8 @@ Object.defineProperty(exports, "optionsThemeGenerator", {
28
40
  }
29
41
  });
30
42
  var _Options = require("./Options");
43
+ var _Item = require("./Options/Item");
44
+ var _Separator = require("./Options/Separator");
31
45
  var _theme = require("./Options/theme");
32
46
  var _theme2 = require("./Options/Item/theme");
33
47
  var _theme3 = require("./Options/Separator/theme");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-options",
3
- "version": "10.8.1-snapshot-4",
3
+ "version": "10.9.0",
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,21 +23,21 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "10.8.1-snapshot-4",
27
- "@instructure/ui-color-utils": "10.8.1-snapshot-4",
28
- "@instructure/ui-test-locator": "10.8.1-snapshot-4",
29
- "@instructure/ui-test-utils": "10.8.1-snapshot-4",
30
- "@instructure/ui-themes": "10.8.1-snapshot-4"
26
+ "@instructure/ui-babel-preset": "10.9.0",
27
+ "@instructure/ui-color-utils": "10.9.0",
28
+ "@instructure/ui-test-locator": "10.9.0",
29
+ "@instructure/ui-test-utils": "10.9.0",
30
+ "@instructure/ui-themes": "10.9.0"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.26.0",
34
- "@instructure/emotion": "10.8.1-snapshot-4",
35
- "@instructure/shared-types": "10.8.1-snapshot-4",
36
- "@instructure/ui-icons": "10.8.1-snapshot-4",
37
- "@instructure/ui-prop-types": "10.8.1-snapshot-4",
38
- "@instructure/ui-react-utils": "10.8.1-snapshot-4",
39
- "@instructure/ui-testable": "10.8.1-snapshot-4",
40
- "@instructure/ui-view": "10.8.1-snapshot-4",
34
+ "@instructure/emotion": "10.9.0",
35
+ "@instructure/shared-types": "10.9.0",
36
+ "@instructure/ui-icons": "10.9.0",
37
+ "@instructure/ui-prop-types": "10.9.0",
38
+ "@instructure/ui-react-utils": "10.9.0",
39
+ "@instructure/ui-testable": "10.9.0",
40
+ "@instructure/ui-view": "10.9.0",
41
41
  "prop-types": "^15.8.1"
42
42
  },
43
43
  "peerDependencies": {
@@ -61,7 +61,8 @@ class Item extends Component<OptionsItemProps> {
61
61
  role: 'listitem',
62
62
  voiceoverRoleBugWorkaround: false,
63
63
  beforeLabelContentVAlign: 'center',
64
- afterLabelContentVAlign: 'center'
64
+ afterLabelContentVAlign: 'center',
65
+ isSelected: false
65
66
  } as const
66
67
 
67
68
  ref: Element | null = null
@@ -94,6 +94,10 @@ type OptionsItemOwnProps = OptionsItemRenderProps & {
94
94
  * provides a reference to the underlying html root element
95
95
  */
96
96
  elementRef?: (element: Element | null) => void
97
+ /**
98
+ * Whether or not this option is selected
99
+ */
100
+ isSelected?: boolean
97
101
  }
98
102
 
99
103
  type PropKeys = keyof OptionsItemOwnProps
@@ -133,7 +137,8 @@ const propTypes: PropValidators<PropKeys> = {
133
137
  href: PropTypes.string,
134
138
  voiceoverRoleBugWorkaround: PropTypes.bool,
135
139
  elementRef: PropTypes.func,
136
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func])
140
+ children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
141
+ isSelected: PropTypes.bool
137
142
  }
138
143
 
139
144
  const allowedProps: AllowedPropKeys = [
@@ -149,7 +154,8 @@ const allowedProps: AllowedPropKeys = [
149
154
  'voiceoverRoleBugWorkaround',
150
155
  'href',
151
156
  'elementRef',
152
- 'children'
157
+ 'children',
158
+ 'isSelected'
153
159
  ]
154
160
 
155
161
  export type { OptionsItemProps, OptionsItemStyle, OptionsItemRenderProps }
@@ -112,7 +112,9 @@ const generateStyle = (
112
112
  display: 'block',
113
113
  fontSize: componentTheme.fontSize,
114
114
  fontFamily: componentTheme.fontFamily,
115
- fontWeight: componentTheme.fontWeight,
115
+ fontWeight: props.isSelected
116
+ ? componentTheme.fontWeightSelected
117
+ : componentTheme.fontWeight,
116
118
  lineHeight: componentTheme.lineHeight,
117
119
  outline: 'none',
118
120
  position: 'relative',
@@ -45,6 +45,7 @@ const generateComponentTheme = (theme: Theme): OptionsItemTheme => {
45
45
  fontFamily: typography?.fontFamily,
46
46
  fontWeight: typography?.fontWeightNormal,
47
47
  lineHeight: typography?.lineHeightCondensed,
48
+ fontWeightSelected: typography?.fontWeightNormal,
48
49
 
49
50
  color: colors?.contrasts?.grey125125,
50
51
  background: colors?.contrasts?.white1010,
package/src/index.ts CHANGED
@@ -23,6 +23,8 @@
23
23
  */
24
24
 
25
25
  export { Options } from './Options'
26
+ export { Item as OptionItem } from './Options/Item'
27
+ export { Separator as OptionSeparator } from './Options/Separator'
26
28
 
27
29
  export { optionsThemeGenerator } from './Options/theme'
28
30
  export { optionsItemThemeGenerator } from './Options/Item/theme'