@instructure/ui-heading 10.26.1-snapshot-2 → 10.26.1
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 +2 -23
- package/es/Heading/index.js +6 -6
- package/es/Heading/props.js +15 -1
- package/lib/Heading/index.js +5 -5
- package/lib/Heading/props.js +16 -1
- package/package.json +15 -12
- package/src/Heading/index.tsx +4 -2
- package/src/Heading/props.ts +40 -4
- package/tsconfig.build.json +6 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Heading/index.d.ts +12 -0
- package/types/Heading/index.d.ts.map +1 -1
- package/types/Heading/props.d.ts +5 -5
- package/types/Heading/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,30 +3,9 @@
|
|
|
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.26.1
|
|
6
|
+
## [10.26.1](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1) (2025-10-06)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
### Features
|
|
10
|
-
|
|
11
|
-
* **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### BREAKING CHANGES
|
|
15
|
-
|
|
16
|
-
* **many:** InstUI v11 contains the following breaking changes:
|
|
17
|
-
- React 16 and 17 are no longer supported
|
|
18
|
-
- remove `PropTypes` from all packages
|
|
19
|
-
- remove `CodeEditor` component
|
|
20
|
-
- remove `@instui/theme-registry` package
|
|
21
|
-
- remove `@testable`, `@experimental`, `@hack` decorators
|
|
22
|
-
- InstUISettingsProvider's `as` prop is removed
|
|
23
|
-
- `canvas.use()`, `canvasHighContrast.use()` functions are removed
|
|
24
|
-
- `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
|
|
25
|
-
- `variables` field on theme objects are removed
|
|
26
|
-
- remove deprecated props from Table: Row's `isStacked`, Body's
|
|
27
|
-
`isStacked`, `hover`, and `headers`
|
|
28
|
-
- `Table`'s `caption` prop is now required
|
|
29
|
-
- `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-heading
|
|
30
9
|
|
|
31
10
|
|
|
32
11
|
|
package/es/Heading/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["border", "children", "color", "level", "margin", "elementRef", "makeStyles", "variant"];
|
|
3
|
-
var _dec, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
|
|
3
|
+
var _dec, _dec2, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
|
|
4
4
|
/*
|
|
5
5
|
* The MIT License (MIT)
|
|
6
6
|
*
|
|
@@ -28,11 +28,12 @@ var _dec, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiCo
|
|
|
28
28
|
import { Component } from 'react';
|
|
29
29
|
import { View } from '@instructure/ui-view';
|
|
30
30
|
import { passthroughProps, callRenderProp } from '@instructure/ui-react-utils';
|
|
31
|
+
import { testable } from '@instructure/ui-testable';
|
|
31
32
|
import { IconAiColoredSolid } from '@instructure/ui-icons';
|
|
32
33
|
import { withStyle } from '@instructure/emotion';
|
|
33
34
|
import generateStyle from './styles';
|
|
34
35
|
import generateComponentTheme from './theme';
|
|
35
|
-
import { allowedProps } from './props';
|
|
36
|
+
import { propTypes, allowedProps } from './props';
|
|
36
37
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
37
38
|
const variantLevels = {
|
|
38
39
|
titlePageDesktop: 'h1',
|
|
@@ -52,7 +53,7 @@ const variantLevels = {
|
|
|
52
53
|
category: components
|
|
53
54
|
---
|
|
54
55
|
**/
|
|
55
|
-
let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_Heading = class Heading extends Component {
|
|
56
|
+
let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_Heading = class Heading extends Component {
|
|
56
57
|
constructor(...args) {
|
|
57
58
|
super(...args);
|
|
58
59
|
this.ref = null;
|
|
@@ -211,14 +212,13 @@ let Heading = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_cl
|
|
|
211
212
|
as: ElementType,
|
|
212
213
|
elementRef: this.handleRef,
|
|
213
214
|
margin: margin,
|
|
214
|
-
"data-cid": "Heading",
|
|
215
215
|
children: this.renderContent()
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
-
}, _Heading.displayName = "Heading", _Heading.componentId = 'Heading', _Heading.allowedProps = allowedProps, _Heading.defaultProps = {
|
|
218
|
+
}, _Heading.displayName = "Heading", _Heading.componentId = 'Heading', _Heading.propTypes = propTypes, _Heading.allowedProps = allowedProps, _Heading.defaultProps = {
|
|
219
219
|
children: null,
|
|
220
220
|
border: 'none',
|
|
221
221
|
color: 'inherit'
|
|
222
|
-
}, _Heading)) || _class);
|
|
222
|
+
}, _Heading)) || _class) || _class);
|
|
223
223
|
export default Heading;
|
|
224
224
|
export { Heading };
|
package/es/Heading/props.js
CHANGED
|
@@ -22,5 +22,19 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import PropTypes from 'prop-types';
|
|
26
|
+
import { childrenOrValue } from '@instructure/ui-prop-types';
|
|
27
|
+
const propTypes = {
|
|
28
|
+
aiVariant: PropTypes.oneOf(['stacked', 'horizontal', 'iconOnly']),
|
|
29
|
+
border: PropTypes.oneOf(['none', 'top', 'bottom']),
|
|
30
|
+
children: childrenOrValue,
|
|
31
|
+
color: PropTypes.oneOf(['primary', 'secondary', 'primary-inverse', 'secondary-inverse', 'inherit', 'ai']),
|
|
32
|
+
level: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'reset']),
|
|
33
|
+
as: PropTypes.elementType,
|
|
34
|
+
margin: PropTypes.string,
|
|
35
|
+
elementRef: PropTypes.func,
|
|
36
|
+
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
37
|
+
variant: PropTypes.oneOf(['titlePageDesktop', 'titlePageMobile', 'titleSection', 'titleCardSection', 'titleModule', 'titleCardLarge', 'titleCardRegular', 'titleCardMini', 'label', 'labelInline'])
|
|
38
|
+
};
|
|
25
39
|
const allowedProps = ['aiVariant', 'border', 'children', 'color', 'level', 'as', 'margin', 'elementRef', 'variant'];
|
|
26
|
-
export { allowedProps };
|
|
40
|
+
export { propTypes, allowedProps };
|
package/lib/Heading/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var _react = require("react");
|
|
|
10
10
|
var _View = require("@instructure/ui-view/lib/View");
|
|
11
11
|
var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
|
|
12
12
|
var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
|
|
13
|
+
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
13
14
|
var _IconAiColoredSolid7 = require("@instructure/ui-icons/lib/IconAiColoredSolid.js");
|
|
14
15
|
var _emotion = require("@instructure/emotion");
|
|
15
16
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
@@ -17,7 +18,7 @@ var _theme = _interopRequireDefault(require("./theme"));
|
|
|
17
18
|
var _props = require("./props");
|
|
18
19
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
19
20
|
const _excluded = ["border", "children", "color", "level", "margin", "elementRef", "makeStyles", "variant"];
|
|
20
|
-
var _dec, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
|
|
21
|
+
var _dec, _dec2, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
|
|
21
22
|
/*
|
|
22
23
|
* The MIT License (MIT)
|
|
23
24
|
*
|
|
@@ -59,7 +60,7 @@ const variantLevels = {
|
|
|
59
60
|
category: components
|
|
60
61
|
---
|
|
61
62
|
**/
|
|
62
|
-
let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Heading = class Heading extends _react.Component {
|
|
63
|
+
let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_Heading = class Heading extends _react.Component {
|
|
63
64
|
constructor(...args) {
|
|
64
65
|
super(...args);
|
|
65
66
|
this.ref = null;
|
|
@@ -218,13 +219,12 @@ let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default,
|
|
|
218
219
|
as: ElementType,
|
|
219
220
|
elementRef: this.handleRef,
|
|
220
221
|
margin: margin,
|
|
221
|
-
"data-cid": "Heading",
|
|
222
222
|
children: this.renderContent()
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
}, _Heading.displayName = "Heading", _Heading.componentId = 'Heading', _Heading.allowedProps = _props.allowedProps, _Heading.defaultProps = {
|
|
225
|
+
}, _Heading.displayName = "Heading", _Heading.componentId = 'Heading', _Heading.propTypes = _props.propTypes, _Heading.allowedProps = _props.allowedProps, _Heading.defaultProps = {
|
|
226
226
|
children: null,
|
|
227
227
|
border: 'none',
|
|
228
228
|
color: 'inherit'
|
|
229
|
-
}, _Heading)) || _class);
|
|
229
|
+
}, _Heading)) || _class) || _class);
|
|
230
230
|
var _default = exports.default = Heading;
|
package/lib/Heading/props.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.allowedProps = void 0;
|
|
7
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _childrenOrValue = require("@instructure/ui-prop-types/lib/childrenOrValue.js");
|
|
7
10
|
/*
|
|
8
11
|
* The MIT License (MIT)
|
|
9
12
|
*
|
|
@@ -28,4 +31,16 @@ exports.allowedProps = void 0;
|
|
|
28
31
|
* SOFTWARE.
|
|
29
32
|
*/
|
|
30
33
|
|
|
34
|
+
const propTypes = exports.propTypes = {
|
|
35
|
+
aiVariant: _propTypes.default.oneOf(['stacked', 'horizontal', 'iconOnly']),
|
|
36
|
+
border: _propTypes.default.oneOf(['none', 'top', 'bottom']),
|
|
37
|
+
children: _childrenOrValue.childrenOrValue,
|
|
38
|
+
color: _propTypes.default.oneOf(['primary', 'secondary', 'primary-inverse', 'secondary-inverse', 'inherit', 'ai']),
|
|
39
|
+
level: _propTypes.default.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'reset']),
|
|
40
|
+
as: _propTypes.default.elementType,
|
|
41
|
+
margin: _propTypes.default.string,
|
|
42
|
+
elementRef: _propTypes.default.func,
|
|
43
|
+
renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
44
|
+
variant: _propTypes.default.oneOf(['titlePageDesktop', 'titlePageMobile', 'titleSection', 'titleCardSection', 'titleModule', 'titleCardLarge', 'titleCardRegular', 'titleCardMini', 'label', 'labelInline'])
|
|
45
|
+
};
|
|
31
46
|
const allowedProps = exports.allowedProps = ['aiVariant', 'border', 'children', 'color', 'level', 'as', 'margin', 'elementRef', 'variant'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-heading",
|
|
3
|
-
"version": "10.26.1
|
|
3
|
+
"version": "10.26.1",
|
|
4
4
|
"description": "A component for creating typographic headings",
|
|
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.1
|
|
28
|
-
"@instructure/emotion": "10.26.1
|
|
29
|
-
"@instructure/shared-types": "10.26.1
|
|
30
|
-
"@instructure/ui-icons": "10.26.1
|
|
31
|
-
"@instructure/ui-
|
|
32
|
-
"@instructure/ui-
|
|
27
|
+
"@instructure/console": "10.26.1",
|
|
28
|
+
"@instructure/emotion": "10.26.1",
|
|
29
|
+
"@instructure/shared-types": "10.26.1",
|
|
30
|
+
"@instructure/ui-icons": "10.26.1",
|
|
31
|
+
"@instructure/ui-prop-types": "10.26.1",
|
|
32
|
+
"@instructure/ui-react-utils": "10.26.1",
|
|
33
|
+
"@instructure/ui-testable": "10.26.1",
|
|
34
|
+
"@instructure/ui-view": "10.26.1",
|
|
35
|
+
"prop-types": "^15.8.1"
|
|
33
36
|
},
|
|
34
37
|
"devDependencies": {
|
|
35
|
-
"@instructure/ui-axe-check": "10.26.1
|
|
36
|
-
"@instructure/ui-babel-preset": "10.26.1
|
|
37
|
-
"@instructure/ui-themes": "10.26.1
|
|
38
|
+
"@instructure/ui-axe-check": "10.26.1",
|
|
39
|
+
"@instructure/ui-babel-preset": "10.26.1",
|
|
40
|
+
"@instructure/ui-themes": "10.26.1",
|
|
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"
|
package/src/Heading/index.tsx
CHANGED
|
@@ -26,6 +26,7 @@ import { Component } from 'react'
|
|
|
26
26
|
|
|
27
27
|
import { View } from '@instructure/ui-view'
|
|
28
28
|
import { passthroughProps, callRenderProp } from '@instructure/ui-react-utils'
|
|
29
|
+
import { testable } from '@instructure/ui-testable'
|
|
29
30
|
import { IconAiColoredSolid } from '@instructure/ui-icons'
|
|
30
31
|
|
|
31
32
|
import { withStyle } from '@instructure/emotion'
|
|
@@ -33,7 +34,7 @@ import { withStyle } from '@instructure/emotion'
|
|
|
33
34
|
import generateStyle from './styles'
|
|
34
35
|
import generateComponentTheme from './theme'
|
|
35
36
|
|
|
36
|
-
import { allowedProps } from './props'
|
|
37
|
+
import { propTypes, allowedProps } from './props'
|
|
37
38
|
import type { HeadingProps } from './props'
|
|
38
39
|
import { AsElementType } from '@instructure/shared-types'
|
|
39
40
|
|
|
@@ -59,9 +60,11 @@ category: components
|
|
|
59
60
|
---
|
|
60
61
|
**/
|
|
61
62
|
@withStyle(generateStyle, generateComponentTheme)
|
|
63
|
+
@testable()
|
|
62
64
|
class Heading extends Component<HeadingProps> {
|
|
63
65
|
static readonly componentId = 'Heading'
|
|
64
66
|
|
|
67
|
+
static propTypes = propTypes
|
|
65
68
|
static allowedProps = allowedProps
|
|
66
69
|
static defaultProps = {
|
|
67
70
|
children: null,
|
|
@@ -223,7 +226,6 @@ class Heading extends Component<HeadingProps> {
|
|
|
223
226
|
as={ElementType}
|
|
224
227
|
elementRef={this.handleRef}
|
|
225
228
|
margin={margin}
|
|
226
|
-
data-cid="Heading"
|
|
227
229
|
>
|
|
228
230
|
{this.renderContent()}
|
|
229
231
|
</View>
|
package/src/Heading/props.ts
CHANGED
|
@@ -22,9 +22,13 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import
|
|
25
|
+
import PropTypes from 'prop-types'
|
|
26
|
+
|
|
27
|
+
import { childrenOrValue } from '@instructure/ui-prop-types'
|
|
28
|
+
|
|
26
29
|
import type {
|
|
27
30
|
AsElementType,
|
|
31
|
+
PropValidators,
|
|
28
32
|
HeadingTheme,
|
|
29
33
|
OtherHTMLAttributes,
|
|
30
34
|
Renderable
|
|
@@ -35,7 +39,7 @@ import type {
|
|
|
35
39
|
ComponentStyle
|
|
36
40
|
} from '@instructure/emotion'
|
|
37
41
|
|
|
38
|
-
type HeadingLevel<U extends keyof
|
|
42
|
+
type HeadingLevel<U extends keyof JSX.IntrinsicElements> = U
|
|
39
43
|
|
|
40
44
|
type HeadingOwnProps = {
|
|
41
45
|
/**
|
|
@@ -61,7 +65,7 @@ type HeadingOwnProps = {
|
|
|
61
65
|
| 'inherit'
|
|
62
66
|
| 'ai'
|
|
63
67
|
/**
|
|
64
|
-
* The level of the heading in the DOM: h1 is largest;
|
|
68
|
+
* The level of the heading in the DOM: h1 is largest; h5 is smallest.
|
|
65
69
|
*/
|
|
66
70
|
level?: HeadingLevel<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'> | 'reset'
|
|
67
71
|
/**
|
|
@@ -115,6 +119,38 @@ type HeadingProps = HeadingOwnProps &
|
|
|
115
119
|
type HeadingStyle = ComponentStyle<
|
|
116
120
|
'heading' | 'igniteAI' | 'igniteAIStacked' | 'withIcon'
|
|
117
121
|
>
|
|
122
|
+
|
|
123
|
+
const propTypes: PropValidators<PropKeys> = {
|
|
124
|
+
aiVariant: PropTypes.oneOf(['stacked', 'horizontal', 'iconOnly']),
|
|
125
|
+
border: PropTypes.oneOf(['none', 'top', 'bottom']),
|
|
126
|
+
children: childrenOrValue,
|
|
127
|
+
color: PropTypes.oneOf([
|
|
128
|
+
'primary',
|
|
129
|
+
'secondary',
|
|
130
|
+
'primary-inverse',
|
|
131
|
+
'secondary-inverse',
|
|
132
|
+
'inherit',
|
|
133
|
+
'ai'
|
|
134
|
+
]),
|
|
135
|
+
level: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'reset']),
|
|
136
|
+
as: PropTypes.elementType,
|
|
137
|
+
margin: PropTypes.string,
|
|
138
|
+
elementRef: PropTypes.func,
|
|
139
|
+
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
140
|
+
variant: PropTypes.oneOf([
|
|
141
|
+
'titlePageDesktop',
|
|
142
|
+
'titlePageMobile',
|
|
143
|
+
'titleSection',
|
|
144
|
+
'titleCardSection',
|
|
145
|
+
'titleModule',
|
|
146
|
+
'titleCardLarge',
|
|
147
|
+
'titleCardRegular',
|
|
148
|
+
'titleCardMini',
|
|
149
|
+
'label',
|
|
150
|
+
'labelInline'
|
|
151
|
+
])
|
|
152
|
+
}
|
|
153
|
+
|
|
118
154
|
const allowedProps: AllowedPropKeys = [
|
|
119
155
|
'aiVariant',
|
|
120
156
|
'border',
|
|
@@ -128,4 +164,4 @@ const allowedProps: AllowedPropKeys = [
|
|
|
128
164
|
]
|
|
129
165
|
|
|
130
166
|
export type { HeadingProps, HeadingStyle }
|
|
131
|
-
export { allowedProps }
|
|
167
|
+
export { propTypes, allowedProps }
|
package/tsconfig.build.json
CHANGED
|
@@ -19,9 +19,15 @@
|
|
|
19
19
|
{
|
|
20
20
|
"path": "../ui-axe-check/tsconfig.build.json"
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
"path": "../ui-prop-types/tsconfig.build.json"
|
|
24
|
+
},
|
|
22
25
|
{
|
|
23
26
|
"path": "../ui-react-utils/tsconfig.build.json"
|
|
24
27
|
},
|
|
28
|
+
{
|
|
29
|
+
"path": "../ui-testable/tsconfig.build.json"
|
|
30
|
+
},
|
|
25
31
|
{
|
|
26
32
|
"path": "../ui-icons/tsconfig.build.json"
|
|
27
33
|
},
|