@instructure/ui-heading 11.6.0 → 11.6.1-pr-snapshot-1779894247159

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,6 +3,14 @@
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.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-heading
9
+
10
+
11
+
12
+
13
+
6
14
  # [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-heading
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
1
  /*
8
2
  * The MIT License (MIT)
9
3
  *
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
28
22
  * SOFTWARE.
29
23
  */
30
24
 
31
- const allowedProps = exports.allowedProps = ['aiVariant', 'border', 'children', 'color', 'level', 'as', 'margin', 'elementRef', 'variant'];
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ coverage: Boolean(process.env.COVERAGE),
31
+ esModules: Boolean(process.env.ES_MODULES),
32
+ removeConsole: process.env.NODE_ENV === 'production',
33
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
34
+ }
35
+ ]
36
+ ]
37
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-heading",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-pr-snapshot-1779894247159",
4
+ "type": "module",
4
5
  "description": "A component for creating typographic headings",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -15,20 +15,20 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/console": "11.6.0",
19
- "@instructure/emotion": "11.6.0",
20
- "@instructure/shared-types": "11.6.0",
21
- "@instructure/ui-icons": "11.6.0",
22
- "@instructure/ui-react-utils": "11.6.0",
23
- "@instructure/ui-view": "11.6.0"
18
+ "@instructure/console": "11.6.1-pr-snapshot-1779894247159",
19
+ "@instructure/emotion": "11.6.1-pr-snapshot-1779894247159",
20
+ "@instructure/ui-icons": "11.6.1-pr-snapshot-1779894247159",
21
+ "@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
22
+ "@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
23
+ "@instructure/ui-view": "11.6.1-pr-snapshot-1779894247159"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@testing-library/jest-dom": "^6.6.3",
27
27
  "@testing-library/react": "15.0.7",
28
28
  "vitest": "^3.2.2",
29
- "@instructure/ui-themes": "11.6.0",
30
- "@instructure/ui-babel-preset": "11.6.0",
31
- "@instructure/ui-axe-check": "11.6.0"
29
+ "@instructure/ui-axe-check": "11.6.1-pr-snapshot-1779894247159",
30
+ "@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159",
31
+ "@instructure/ui-themes": "11.6.1-pr-snapshot-1779894247159"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=18 <=19"
@@ -41,10 +41,8 @@
41
41
  ".": {
42
42
  "types": "./types/index.d.ts",
43
43
  "import": "./es/index.js",
44
- "require": "./lib/index.js",
45
44
  "default": "./es/index.js"
46
45
  },
47
- "./lib/*": "./lib/*",
48
46
  "./es/*": "./es/*",
49
47
  "./types/*": "./types/*",
50
48
  "./package.json": "./package.json",
@@ -54,7 +52,7 @@
54
52
  "lint": "ui-scripts lint",
55
53
  "lint:fix": "ui-scripts lint --fix",
56
54
  "clean": "ui-scripts clean",
57
- "build": "ui-scripts build --modules es,cjs",
55
+ "build": "ui-scripts build",
58
56
  "build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
59
57
  "build:types": "tsc -p tsconfig.build.json",
60
58
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
@@ -1,230 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.Heading = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _react = require("react");
10
- var _View = require("@instructure/ui-view/lib/View");
11
- var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
12
- var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
13
- var _IconAiColoredSolid7 = require("@instructure/ui-icons/lib/IconAiColoredSolid.js");
14
- var _emotion = require("@instructure/emotion");
15
- var _styles = _interopRequireDefault(require("./styles"));
16
- var _theme = _interopRequireDefault(require("./theme"));
17
- var _props = require("./props");
18
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
19
- const _excluded = ["border", "children", "color", "level", "margin", "elementRef", "makeStyles", "variant"];
20
- var _dec, _class, _Heading, _IconAiColoredSolid, _IconAiColoredSolid2, _IconAiColoredSolid3, _IconAiColoredSolid4, _IconAiColoredSolid5, _IconAiColoredSolid6;
21
- /*
22
- * The MIT License (MIT)
23
- *
24
- * Copyright (c) 2015 - present Instructure, Inc.
25
- *
26
- * Permission is hereby granted, free of charge, to any person obtaining a copy
27
- * of this software and associated documentation files (the "Software"), to deal
28
- * in the Software without restriction, including without limitation the rights
29
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
30
- * copies of the Software, and to permit persons to whom the Software is
31
- * furnished to do so, subject to the following conditions:
32
- *
33
- * The above copyright notice and this permission notice shall be included in all
34
- * copies or substantial portions of the Software.
35
- *
36
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
37
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
38
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
39
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
40
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
41
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
42
- * SOFTWARE.
43
- */
44
- const variantLevels = {
45
- titlePageDesktop: 'h1',
46
- titlePageMobile: 'h1',
47
- titleSection: 'h2',
48
- titleCardSection: 'h2',
49
- titleModule: 'h3',
50
- titleCardLarge: 'h4',
51
- titleCardRegular: 'h4',
52
- titleCardMini: 'h4',
53
- label: 'h5',
54
- labelInline: 'h5'
55
- };
56
-
57
- /**
58
- ---
59
- category: components
60
- ---
61
- **/
62
- let Heading = exports.Heading = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_Heading = class Heading extends _react.Component {
63
- constructor(...args) {
64
- super(...args);
65
- this.ref = null;
66
- this.handleRef = el => {
67
- const elementRef = this.props.elementRef;
68
- this.ref = el;
69
- if (typeof elementRef === 'function') {
70
- elementRef(el);
71
- }
72
- };
73
- }
74
- checkProps() {
75
- const _this$props = this.props,
76
- variant = _this$props.variant,
77
- as = _this$props.as;
78
- if (variant) {
79
- if (as) {}
80
- }
81
- }
82
- componentDidMount() {
83
- var _this$props$makeStyle, _this$props2;
84
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
85
- this.checkProps();
86
- }
87
- componentDidUpdate() {
88
- var _this$props$makeStyle2, _this$props3;
89
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
90
- this.checkProps();
91
- }
92
- renderContent() {
93
- const _this$props4 = this.props,
94
- children = _this$props4.children,
95
- renderIcon = _this$props4.renderIcon,
96
- aiVariant = _this$props4.aiVariant;
97
- if (renderIcon && !aiVariant) {
98
- var _this$props$styles;
99
- return (0, _jsxRuntime.jsxs)("span", {
100
- css: [(_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.withIcon],
101
- "aria-hidden": "true",
102
- children: [(0, _callRenderProp.callRenderProp)(renderIcon), "\xA0", children]
103
- });
104
- }
105
- if (aiVariant === 'stacked') {
106
- var _this$props$styles2, _this$props$styles3, _this$props$styles4;
107
- return (0, _jsxRuntime.jsxs)("span", {
108
- css: [(_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.withIcon],
109
- "aria-hidden": "true",
110
- children: [(0, _jsxRuntime.jsxs)("span", {
111
- css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.igniteAIStacked,
112
- children: [_IconAiColoredSolid || (_IconAiColoredSolid = (0, _jsxRuntime.jsx)(_IconAiColoredSolid7.IconAiColoredSolid, {})), (0, _jsxRuntime.jsx)("span", {
113
- css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.igniteAI,
114
- children: "IgniteAI"
115
- })]
116
- }), children]
117
- });
118
- }
119
- if (aiVariant === 'horizontal') {
120
- var _this$props$styles5, _this$props$styles6;
121
- return (0, _jsxRuntime.jsxs)("span", {
122
- css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.withIcon,
123
- "aria-hidden": "true",
124
- children: [_IconAiColoredSolid2 || (_IconAiColoredSolid2 = (0, _jsxRuntime.jsx)(_IconAiColoredSolid7.IconAiColoredSolid, {})), (0, _jsxRuntime.jsx)("span", {
125
- css: (_this$props$styles6 = this.props.styles) === null || _this$props$styles6 === void 0 ? void 0 : _this$props$styles6.igniteAI,
126
- children: "IgniteAI"
127
- }), children]
128
- });
129
- }
130
- if (aiVariant === 'iconOnly') {
131
- var _this$props$styles7;
132
- return (0, _jsxRuntime.jsxs)("span", {
133
- css: (_this$props$styles7 = this.props.styles) === null || _this$props$styles7 === void 0 ? void 0 : _this$props$styles7.withIcon,
134
- "aria-hidden": "true",
135
- children: [_IconAiColoredSolid3 || (_IconAiColoredSolid3 = (0, _jsxRuntime.jsx)(_IconAiColoredSolid7.IconAiColoredSolid, {})), "\xA0", children]
136
- });
137
- }
138
- if (aiVariant === 'stacked') {
139
- var _this$props$styles8, _this$props$styles9;
140
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
141
- children: [(0, _jsxRuntime.jsxs)("span", {
142
- css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.igniteAIStacked,
143
- children: [_IconAiColoredSolid4 || (_IconAiColoredSolid4 = (0, _jsxRuntime.jsx)(_IconAiColoredSolid7.IconAiColoredSolid, {})), (0, _jsxRuntime.jsx)("span", {
144
- css: (_this$props$styles9 = this.props.styles) === null || _this$props$styles9 === void 0 ? void 0 : _this$props$styles9.igniteAI,
145
- children: "IgniteAI"
146
- })]
147
- }), children]
148
- });
149
- }
150
- if (aiVariant === 'horizontal') {
151
- var _this$props$styles0;
152
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
153
- children: [_IconAiColoredSolid5 || (_IconAiColoredSolid5 = (0, _jsxRuntime.jsx)(_IconAiColoredSolid7.IconAiColoredSolid, {})), (0, _jsxRuntime.jsx)("span", {
154
- css: (_this$props$styles0 = this.props.styles) === null || _this$props$styles0 === void 0 ? void 0 : _this$props$styles0.igniteAI,
155
- children: "IgniteAI"
156
- }), children]
157
- });
158
- }
159
- if (aiVariant === 'iconOnly') {
160
- return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
161
- children: [_IconAiColoredSolid6 || (_IconAiColoredSolid6 = (0, _jsxRuntime.jsx)(_IconAiColoredSolid7.IconAiColoredSolid, {})), "\xA0", children]
162
- });
163
- }
164
- return children;
165
- }
166
-
167
- //overriding default screen reader functionality is needed to read spans in h tags correctly
168
- getAriaLabel() {
169
- const _this$props5 = this.props,
170
- aiVariant = _this$props5.aiVariant,
171
- children = _this$props5.children,
172
- renderIcon = _this$props5.renderIcon;
173
- if (aiVariant === 'stacked' || aiVariant === 'horizontal') {
174
- return `IgniteAI, ${children}`;
175
- }
176
- if (aiVariant === 'iconOnly' || renderIcon) {
177
- return `${children}`;
178
- }
179
- return void 0;
180
- }
181
- render() {
182
- var _this$props$styles1;
183
- const _this$props6 = this.props,
184
- border = _this$props6.border,
185
- children = _this$props6.children,
186
- color = _this$props6.color,
187
- level = _this$props6.level,
188
- margin = _this$props6.margin,
189
- elementRef = _this$props6.elementRef,
190
- makeStyles = _this$props6.makeStyles,
191
- variant = _this$props6.variant,
192
- props = (0, _objectWithoutProperties2.default)(_this$props6, _excluded);
193
- let ElementType = 'h2';
194
- if (variant) {
195
- // TODO deprecated, remove. `variant` should not set DOM level
196
- if (level) {
197
- if (level === 'reset') {
198
- ElementType = 'span';
199
- } else {
200
- ElementType = level;
201
- }
202
- } else {
203
- ElementType = variantLevels[variant];
204
- }
205
- } else if (props.as) {
206
- ElementType = props.as;
207
- } else if (level) {
208
- if (level === 'reset') {
209
- ElementType = 'span';
210
- } else {
211
- ElementType = level;
212
- }
213
- }
214
- return (0, _jsxRuntime.jsx)(_View.View, {
215
- "aria-label": this.getAriaLabel(),
216
- ...(0, _passthroughProps.passthroughProps)(props),
217
- css: (_this$props$styles1 = this.props.styles) === null || _this$props$styles1 === void 0 ? void 0 : _this$props$styles1.heading,
218
- as: ElementType,
219
- elementRef: this.handleRef,
220
- margin: margin,
221
- "data-cid": "Heading",
222
- children: this.renderContent()
223
- });
224
- }
225
- }, _Heading.displayName = "Heading", _Heading.componentId = 'Heading', _Heading.allowedProps = _props.allowedProps, _Heading.defaultProps = {
226
- children: null,
227
- border: 'none',
228
- color: 'inherit'
229
- }, _Heading)) || _class);
230
- var _default = exports.default = Heading;
@@ -1,249 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * ---
33
- * private: true
34
- * ---
35
- * Generates the style object from the theme and provided additional information
36
- * @param {Object} componentTheme The theme variable object.
37
- * @param {Object} props the props of the component, the style is applied to
38
- * @param {Object} state the state of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = (componentTheme, props) => {
42
- const level = props.level,
43
- color = props.color,
44
- border = props.border,
45
- variant = props.variant,
46
- aiVariant = props.aiVariant;
47
- const variants = {
48
- titlePageDesktop: {
49
- fontStyle: 'normal',
50
- fontWeight: componentTheme.weightImportant,
51
- fontSize: componentTheme.titlePageDesktop,
52
- lineHeight: componentTheme.lineHeight125
53
- },
54
- titlePageMobile: {
55
- fontStyle: 'normal',
56
- fontWeight: componentTheme.weightImportant,
57
- fontSize: componentTheme.titlePageMobile,
58
- lineHeight: componentTheme.lineHeight125
59
- },
60
- titleSection: {
61
- fontStyle: 'normal',
62
- fontWeight: componentTheme.weightImportant,
63
- fontSize: componentTheme.titleSection,
64
- lineHeight: componentTheme.lineHeight125
65
- },
66
- titleCardSection: {
67
- fontStyle: 'normal',
68
- fontWeight: componentTheme.weightImportant,
69
- fontSize: componentTheme.titleSection,
70
- lineHeight: componentTheme.lineHeight125
71
- },
72
- titleModule: {
73
- fontStyle: 'normal',
74
- fontWeight: componentTheme.weightImportant,
75
- fontSize: componentTheme.titleModule,
76
- lineHeight: componentTheme.lineHeight125
77
- },
78
- titleCardLarge: {
79
- fontStyle: 'normal',
80
- fontWeight: componentTheme.weightImportant,
81
- fontSize: componentTheme.titleCardLarge,
82
- lineHeight: componentTheme.lineHeight125
83
- },
84
- titleCardRegular: {
85
- fontStyle: 'normal',
86
- fontWeight: componentTheme.weightImportant,
87
- fontSize: componentTheme.titleCardRegular,
88
- lineHeight: componentTheme.lineHeight125
89
- },
90
- titleCardMini: {
91
- fontStyle: 'normal',
92
- fontWeight: componentTheme.weightImportant,
93
- fontSize: componentTheme.titleCardMini,
94
- lineHeight: componentTheme.lineHeight125
95
- },
96
- label: {
97
- fontStyle: 'normal',
98
- fontWeight: componentTheme.weightImportant,
99
- fontSize: componentTheme.label,
100
- lineHeight: componentTheme.lineHeight125
101
- },
102
- labelInline: {
103
- fontStyle: 'normal',
104
- fontWeight: componentTheme.weightImportant,
105
- fontSize: componentTheme.label,
106
- lineHeight: componentTheme.lineHeight150
107
- }
108
- };
109
- const levelStyles = {
110
- h1: {
111
- fontFamily: componentTheme.h1FontFamily,
112
- fontSize: componentTheme.h1FontSize,
113
- fontWeight: componentTheme.h1FontWeight
114
- },
115
- h2: {
116
- fontFamily: componentTheme.h2FontFamily,
117
- fontSize: componentTheme.h2FontSize,
118
- fontWeight: componentTheme.h2FontWeight
119
- },
120
- h3: {
121
- fontFamily: componentTheme.h3FontFamily,
122
- fontSize: componentTheme.h3FontSize,
123
- fontWeight: componentTheme.h3FontWeight
124
- },
125
- h4: {
126
- fontFamily: componentTheme.h4FontFamily,
127
- fontSize: componentTheme.h4FontSize,
128
- fontWeight: componentTheme.h4FontWeight
129
- },
130
- h5: {
131
- fontFamily: componentTheme.h5FontFamily,
132
- fontSize: componentTheme.h5FontSize,
133
- fontWeight: componentTheme.h5FontWeight
134
- },
135
- h6: {
136
- fontFamily: componentTheme.h6FontFamily,
137
- fontSize: componentTheme.h6FontSize,
138
- fontWeight: componentTheme.h6FontWeight
139
- },
140
- reset: {
141
- margin: 0,
142
- fontSize: 'inherit',
143
- fontWeight: 'inherit',
144
- lineHeight: 'inherit'
145
- }
146
- };
147
- const colorStyles = {
148
- inherit: {
149
- color: 'inherit'
150
- },
151
- primary: {
152
- color: componentTheme.primaryColor
153
- },
154
- secondary: {
155
- color: componentTheme.secondaryColor
156
- },
157
- 'primary-inverse': {
158
- color: componentTheme.primaryInverseColor
159
- },
160
- 'secondary-inverse': {
161
- color: componentTheme.secondaryInverseColor
162
- },
163
- ai: {
164
- background: `
165
- linear-gradient(to bottom, ${componentTheme.aiTextTopGradientColor} 0%, ${componentTheme.aiTextBottomGradientColor} 100%) text`,
166
- border: 'solid transparent',
167
- WebkitTextFillColor: 'transparent',
168
- '@media print': {
169
- background: 'transparent',
170
- WebkitTextFillColor: 'unset'
171
- }
172
- }
173
- };
174
- const borderStyles = {
175
- top: {
176
- paddingTop: componentTheme.borderPadding,
177
- borderTop: `${componentTheme.borderWidth} ${componentTheme.borderStyle} ${componentTheme.borderColor}`
178
- },
179
- bottom: {
180
- paddingBottom: componentTheme.borderPadding,
181
- borderBottom: `${componentTheme.borderWidth} ${componentTheme.borderStyle} ${componentTheme.borderColor}`
182
- },
183
- none: {}
184
- };
185
- const inputStyles = {
186
- outline: 0,
187
- appearance: 'none',
188
- boxSizing: 'border-box',
189
- background: 'none',
190
- border: 'none',
191
- borderRadius: 0,
192
- padding: 0,
193
- margin: '-0.375rem 0 0 0',
194
- color: 'inherit',
195
- height: 'auto',
196
- width: '100%',
197
- lineHeight: 'inherit',
198
- textAlign: 'start',
199
- boxShadow: 'none',
200
- display: 'block',
201
- '&:focus': {
202
- outline: 'none'
203
- }
204
- };
205
- return {
206
- heading: {
207
- label: 'heading',
208
- lineHeight: componentTheme.lineHeight,
209
- margin: 0,
210
- // NOTE: the input styles exist to accommodate the InPlaceEdit component
211
- // NOTE: needs separate groups for `:is()` and `:-webkit-any()` because of css selector group validation (see https://www.w3.org/TR/selectors-3/#grouping)
212
- '&:is(input)[type]': inputStyles,
213
- '&:-webkit-any(input)[type]': inputStyles,
214
- ...(variant ? variants[variant] : levelStyles[level]),
215
- ...colorStyles[color],
216
- ...borderStyles[border]
217
- },
218
- igniteAI: {
219
- label: 'heading__ignite-ai',
220
- background: `
221
- linear-gradient(to bottom, ${componentTheme.aiTextTopGradientColor} 0%, ${componentTheme.aiTextBottomGradientColor} 100%) text`,
222
- border: 'solid transparent',
223
- WebkitTextFillColor: 'transparent',
224
- '@media print': {
225
- background: 'transparent',
226
- WebkitTextFillColor: 'unset'
227
- },
228
- paddingRight: '.25rem'
229
- },
230
- igniteAIStacked: {
231
- label: 'heading__ignite-ai-stacked',
232
- fontSize: '1rem',
233
- lineHeight: '1.25rem',
234
- display: 'flex',
235
- alignItems: 'center'
236
- },
237
- withIcon: {
238
- label: 'heading__with-icon',
239
- display: 'flex',
240
- alignItems: 'center',
241
- ...(aiVariant === 'stacked' ? {
242
- display: 'flex',
243
- flexDirection: 'column',
244
- alignItems: 'flex-start'
245
- } : {})
246
- }
247
- };
248
- };
249
- var _default = exports.default = generateStyle;
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /*
8
- * The MIT License (MIT)
9
- *
10
- * Copyright (c) 2015 - present Instructure, Inc.
11
- *
12
- * Permission is hereby granted, free of charge, to any person obtaining a copy
13
- * of this software and associated documentation files (the "Software"), to deal
14
- * in the Software without restriction, including without limitation the rights
15
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
- * copies of the Software, and to permit persons to whom the Software is
17
- * furnished to do so, subject to the following conditions:
18
- *
19
- * The above copyright notice and this permission notice shall be included in all
20
- * copies or substantial portions of the Software.
21
- *
22
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
- * SOFTWARE.
29
- */
30
-
31
- /**
32
- * Generates the theme object for the component from the theme and provided additional information
33
- * @param {Object} theme The actual theme object.
34
- * @return {Object} The final theme object with the overrides and component variables
35
- */
36
- const generateComponentTheme = theme => {
37
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6, _colors$contrasts7;
38
- const typography = theme.typography,
39
- colors = theme.colors,
40
- spacing = theme.spacing,
41
- borders = theme.borders,
42
- themeName = theme.key;
43
- const themeSpecificStyle = {
44
- canvas: {
45
- primaryColor: theme['ic-brand-font-color-dark']
46
- }
47
- };
48
- const componentVariables = {
49
- ...typography,
50
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
51
- h1FontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeXXLarge,
52
- h1FontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
53
- h1FontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
54
- h2FontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeXLarge,
55
- h2FontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
56
- h2FontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
57
- h3FontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeLarge,
58
- h3FontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
59
- h3FontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
60
- h4FontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
61
- h4FontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
62
- h4FontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
63
- h5FontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeSmall,
64
- h5FontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
65
- h5FontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
66
- h6FontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeXSmall,
67
- h6FontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
68
- h6FontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
69
- primaryInverseColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.white1010,
70
- primaryColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.grey125125,
71
- secondaryColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey4570,
72
- secondaryInverseColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.grey1111,
73
- borderPadding: spacing === null || spacing === void 0 ? void 0 : spacing.xxxSmall,
74
- borderColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.grey3045,
75
- borderWidth: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
76
- borderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
77
- aiTextTopGradientColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.violet4570,
78
- aiTextBottomGradientColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts7 = colors.contrasts) === null || _colors$contrasts7 === void 0 ? void 0 : _colors$contrasts7.sea4570
79
- };
80
- return {
81
- ...componentVariables,
82
- ...themeSpecificStyle[themeName]
83
- };
84
- };
85
- var _default = exports.default = generateComponentTheme;
package/lib/index.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Heading", {
7
- enumerable: true,
8
- get: function () {
9
- return _Heading.Heading;
10
- }
11
- });
12
- var _Heading = require("./Heading");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}