@instructure/ui-instructure 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.
Files changed (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/AiInformation/v1/index.js +152 -180
  3. package/es/AiInformation/v1/props.js +20 -26
  4. package/es/AiInformation/v1/styles.js +55 -88
  5. package/es/AiInformation/v1/theme.js +20 -52
  6. package/es/AiInformation/v2/index.js +154 -181
  7. package/es/AiInformation/v2/props.js +20 -26
  8. package/es/AiInformation/v2/styles.js +58 -90
  9. package/es/DataPermissionLevels/v1/index.js +106 -127
  10. package/es/DataPermissionLevels/v1/props.js +12 -26
  11. package/es/DataPermissionLevels/v1/styles.js +59 -92
  12. package/es/DataPermissionLevels/v1/theme.js +21 -54
  13. package/es/DataPermissionLevels/v2/index.js +119 -133
  14. package/es/DataPermissionLevels/v2/props.js +12 -26
  15. package/es/DataPermissionLevels/v2/styles.js +68 -102
  16. package/es/NutritionFacts/v1/index.js +134 -136
  17. package/es/NutritionFacts/v1/props.js +11 -26
  18. package/es/NutritionFacts/v1/styles.js +38 -71
  19. package/es/NutritionFacts/v1/theme.js +16 -49
  20. package/es/NutritionFacts/v2/index.js +140 -137
  21. package/es/NutritionFacts/v2/props.js +11 -26
  22. package/es/NutritionFacts/v2/styles.js +44 -78
  23. package/es/exports/a.js +1 -24
  24. package/es/exports/b.js +1 -24
  25. package/package.json +18 -24
  26. package/tsconfig.build.json +0 -3
  27. package/tsconfig.build.tsbuildinfo +1 -1
  28. package/lib/AiInformation/v1/index.js +0 -200
  29. package/lib/AiInformation/v1/props.js +0 -31
  30. package/lib/AiInformation/v1/styles.js +0 -95
  31. package/lib/AiInformation/v1/theme.js +0 -59
  32. package/lib/AiInformation/v2/index.js +0 -200
  33. package/lib/AiInformation/v2/props.js +0 -31
  34. package/lib/AiInformation/v2/styles.js +0 -97
  35. package/lib/DataPermissionLevels/v1/index.js +0 -143
  36. package/lib/DataPermissionLevels/v1/props.js +0 -31
  37. package/lib/DataPermissionLevels/v1/styles.js +0 -102
  38. package/lib/DataPermissionLevels/v1/theme.js +0 -61
  39. package/lib/DataPermissionLevels/v2/index.js +0 -150
  40. package/lib/DataPermissionLevels/v2/props.js +0 -31
  41. package/lib/DataPermissionLevels/v2/styles.js +0 -112
  42. package/lib/NutritionFacts/v1/index.js +0 -152
  43. package/lib/NutritionFacts/v1/props.js +0 -31
  44. package/lib/NutritionFacts/v1/styles.js +0 -78
  45. package/lib/NutritionFacts/v1/theme.js +0 -56
  46. package/lib/NutritionFacts/v2/index.js +0 -154
  47. package/lib/NutritionFacts/v2/props.js +0 -31
  48. package/lib/NutritionFacts/v2/styles.js +0 -85
  49. package/lib/exports/a.js +0 -26
  50. package/lib/exports/b.js +0 -26
  51. 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
  ### Bug Fixes
@@ -1,26 +1,4 @@
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
- */
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
24
2
  import { useState } from 'react';
25
3
  import { Popover } from '@instructure/ui-popover/v11_6';
26
4
  import { CloseButton } from '@instructure/ui-buttons/v11_6';
@@ -33,162 +11,156 @@ import { NutritionFacts } from '../../NutritionFacts/v1/index.js';
33
11
  import { DataPermissionLevels } from '../../DataPermissionLevels/v1/index.js';
34
12
  import generateStyle from './styles.js';
35
13
  import generateComponentTheme from './theme.js';
36
-
37
- /**
38
- ---
39
- category: components/AI Components
40
- ---
41
- **/
42
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
43
- const AiInformation = ({
44
- title,
45
- data,
46
- trigger,
47
- fullscreenModals = false,
48
- dataPermissionLevelsModalLabel,
49
- dataPermissionLevelsTitle,
50
- dataPermissionLevelsData,
51
- dataPermissionLevelsCloseButtonText,
52
- dataPermissionLevelsCloseIconButtonScreenReaderLabel,
53
- dataPermissionLevelsCurrentFeature,
54
- dataPermissionLevelsCurrentFeatureText,
55
- nutritionFactsModalLabel,
56
- nutritionFactsTitle,
57
- nutritionFactsFeatureName,
58
- nutritionFactsData,
59
- nutritionFactsCloseButtonText,
60
- nutritionFactsCloseIconButtonScreenReaderLabel
61
- }) => {
62
- const [open, setOpen] = useState(false);
63
- const styles = useStyleNew({
64
- generateStyle,
65
- generateComponentTheme,
66
- componentId: 'AiInformation',
67
- displayName: 'AiInformation'
68
- });
69
- return _jsx("div", {
70
- children: _jsx(Popover, {
71
- renderTrigger: trigger,
72
- isShowingContent: open,
73
- on: "click",
74
- screenReaderLabel: "Popover Dialog Example",
75
- shouldContainFocus: true,
76
- shouldReturnFocus: true,
77
- shouldCloseOnDocumentClick: true,
78
- offsetY: "1rem",
79
- onShowContent: () => setOpen(true),
80
- onHideContent: () => setOpen(false),
81
- children: _jsxs("div", {
82
- css: styles?.aiInformation,
83
- children: [_jsxs("div", {
84
- css: styles?.header,
85
- children: [_jsx(Heading, {
86
- level: "h2",
87
- aiVariant: "stacked",
88
- variant: "titleModule",
89
- children: title
90
- }), _jsx(CloseButton, {
91
- placement: "end",
92
- offset: "small",
93
- onClick: () => setOpen(false),
94
- screenReaderLabel: "Close"
95
- })]
96
- }), _jsx("div", {
97
- children: data.map(({
98
- featureName,
99
- privacyNoticeText,
100
- privacyNoticeUrl,
101
- permissionLevelText,
102
- permissionLevel,
103
- description,
104
- permissionLevelsModalTriggerText,
105
- modelNameText,
106
- modelName,
107
- nutritionFactsModalTriggerText
108
- }, index) => _jsxs("div", {
109
- children: [_jsx("div", {
110
- css: styles?.privacyNotice,
111
- children: _jsx(Link, {
112
- href: privacyNoticeUrl,
113
- renderIcon: _jsx(IconExternalLinkLine, {}),
114
- iconPlacement: "end",
115
- variant: "standalone",
116
- target: "_blank",
117
- children: privacyNoticeText
118
- })
119
- }), _jsx("div", {
120
- css: styles?.featureName,
121
- children: _jsx(Heading, {
122
- level: "h3",
123
- variant: "titleCardRegular",
124
- children: featureName
125
- })
126
- }), _jsx("div", {
127
- css: styles?.permissionLevelText,
128
- children: _jsx(Heading, {
129
- level: "h4",
130
- variant: "label",
131
- children: permissionLevelText
132
- })
133
- }), _jsx("div", {
134
- css: styles?.permissionLevel,
135
- children: _jsxs(Text, {
136
- variant: "legend",
137
- children: [" ", permissionLevel, " "]
138
- })
139
- }), _jsx("div", {
140
- css: styles?.description,
141
- children: _jsxs(Text, {
142
- variant: "contentSmall",
143
- children: [" ", description, " "]
144
- })
145
- }), _jsx("div", {
146
- css: styles?.permissionLevelsModalTriggerText,
147
- children: _jsx(DataPermissionLevels, {
148
- fullscreen: fullscreenModals,
149
- title: dataPermissionLevelsTitle,
150
- currentFeatureText: dataPermissionLevelsCurrentFeatureText,
151
- currentFeature: dataPermissionLevelsCurrentFeature,
152
- closeIconButtonScreenReaderLabel: dataPermissionLevelsCloseIconButtonScreenReaderLabel,
153
- closeButtonText: dataPermissionLevelsCloseButtonText,
154
- modalLabel: dataPermissionLevelsModalLabel,
155
- triggerText: permissionLevelsModalTriggerText,
156
- data: dataPermissionLevelsData
157
- })
158
- }), _jsx("div", {
159
- css: styles?.modelNameText,
160
- children: _jsxs(Heading, {
161
- level: "h4",
162
- variant: "label",
163
- children: [' ', modelNameText, ' ']
164
- })
165
- }), _jsx("div", {
166
- css: styles?.modelName,
167
- children: _jsxs(Text, {
168
- variant: "contentSmall",
169
- children: [" ", modelName, " "]
170
- })
171
- }), _jsx(NutritionFacts, {
172
- fullscreen: fullscreenModals,
173
- modalLabel: nutritionFactsModalLabel,
174
- title: nutritionFactsTitle,
175
- featureName: nutritionFactsFeatureName,
176
- closeButtonText: nutritionFactsCloseButtonText,
177
- closeIconButtonScreenReaderLabel: nutritionFactsCloseIconButtonScreenReaderLabel,
178
- triggerText: nutritionFactsModalTriggerText,
179
- data: nutritionFactsData
180
- }), data.length !== index + 1 ? _jsx("div", {
181
- css: styles?.divider
182
- }) : null]
183
- }, index))
184
- })]
185
- })
186
- })
187
- });
188
- }
189
-
190
- // expose generateComponentTheme so Document can render "Default Theme Variables" for v11.6
191
- ;
14
+ const AiInformation = ({ title, data, trigger, fullscreenModals = false, dataPermissionLevelsModalLabel, dataPermissionLevelsTitle, dataPermissionLevelsData, dataPermissionLevelsCloseButtonText, dataPermissionLevelsCloseIconButtonScreenReaderLabel, dataPermissionLevelsCurrentFeature, dataPermissionLevelsCurrentFeatureText, nutritionFactsModalLabel, nutritionFactsTitle, nutritionFactsFeatureName, nutritionFactsData, nutritionFactsCloseButtonText, nutritionFactsCloseIconButtonScreenReaderLabel })=>{
15
+ const [open, setOpen] = useState(false);
16
+ const styles = useStyleNew({
17
+ generateStyle,
18
+ generateComponentTheme,
19
+ componentId: 'AiInformation',
20
+ displayName: 'AiInformation'
21
+ });
22
+ return /*#__PURE__*/ _jsx("div", {
23
+ children: /*#__PURE__*/ _jsx(Popover, {
24
+ renderTrigger: trigger,
25
+ isShowingContent: open,
26
+ on: "click",
27
+ screenReaderLabel: "Popover Dialog Example",
28
+ shouldContainFocus: true,
29
+ shouldReturnFocus: true,
30
+ shouldCloseOnDocumentClick: true,
31
+ offsetY: "1rem",
32
+ onShowContent: ()=>setOpen(true),
33
+ onHideContent: ()=>setOpen(false),
34
+ children: /*#__PURE__*/ _jsxs("div", {
35
+ css: styles?.aiInformation,
36
+ children: [
37
+ /*#__PURE__*/ _jsxs("div", {
38
+ css: styles?.header,
39
+ children: [
40
+ /*#__PURE__*/ _jsx(Heading, {
41
+ level: "h2",
42
+ aiVariant: "stacked",
43
+ variant: "titleModule",
44
+ children: title
45
+ }),
46
+ /*#__PURE__*/ _jsx(CloseButton, {
47
+ placement: "end",
48
+ offset: "small",
49
+ onClick: ()=>setOpen(false),
50
+ screenReaderLabel: "Close"
51
+ })
52
+ ]
53
+ }),
54
+ /*#__PURE__*/ _jsx("div", {
55
+ children: data.map(({ featureName, privacyNoticeText, privacyNoticeUrl, permissionLevelText, permissionLevel, description, permissionLevelsModalTriggerText, modelNameText, modelName, nutritionFactsModalTriggerText }, index)=>/*#__PURE__*/ _jsxs("div", {
56
+ children: [
57
+ /*#__PURE__*/ _jsx("div", {
58
+ css: styles?.privacyNotice,
59
+ children: /*#__PURE__*/ _jsx(Link, {
60
+ href: privacyNoticeUrl,
61
+ renderIcon: /*#__PURE__*/ _jsx(IconExternalLinkLine, {}),
62
+ iconPlacement: "end",
63
+ variant: "standalone",
64
+ target: "_blank",
65
+ children: privacyNoticeText
66
+ })
67
+ }),
68
+ /*#__PURE__*/ _jsx("div", {
69
+ css: styles?.featureName,
70
+ children: /*#__PURE__*/ _jsx(Heading, {
71
+ level: "h3",
72
+ variant: "titleCardRegular",
73
+ children: featureName
74
+ })
75
+ }),
76
+ /*#__PURE__*/ _jsx("div", {
77
+ css: styles?.permissionLevelText,
78
+ children: /*#__PURE__*/ _jsx(Heading, {
79
+ level: "h4",
80
+ variant: "label",
81
+ children: permissionLevelText
82
+ })
83
+ }),
84
+ /*#__PURE__*/ _jsx("div", {
85
+ css: styles?.permissionLevel,
86
+ children: /*#__PURE__*/ _jsxs(Text, {
87
+ variant: "legend",
88
+ children: [
89
+ " ",
90
+ permissionLevel,
91
+ " "
92
+ ]
93
+ })
94
+ }),
95
+ /*#__PURE__*/ _jsx("div", {
96
+ css: styles?.description,
97
+ children: /*#__PURE__*/ _jsxs(Text, {
98
+ variant: "contentSmall",
99
+ children: [
100
+ " ",
101
+ description,
102
+ " "
103
+ ]
104
+ })
105
+ }),
106
+ /*#__PURE__*/ _jsx("div", {
107
+ css: styles?.permissionLevelsModalTriggerText,
108
+ children: /*#__PURE__*/ _jsx(DataPermissionLevels, {
109
+ fullscreen: fullscreenModals,
110
+ title: dataPermissionLevelsTitle,
111
+ currentFeatureText: dataPermissionLevelsCurrentFeatureText,
112
+ currentFeature: dataPermissionLevelsCurrentFeature,
113
+ closeIconButtonScreenReaderLabel: dataPermissionLevelsCloseIconButtonScreenReaderLabel,
114
+ closeButtonText: dataPermissionLevelsCloseButtonText,
115
+ modalLabel: dataPermissionLevelsModalLabel,
116
+ triggerText: permissionLevelsModalTriggerText,
117
+ data: dataPermissionLevelsData
118
+ })
119
+ }),
120
+ /*#__PURE__*/ _jsx("div", {
121
+ css: styles?.modelNameText,
122
+ children: /*#__PURE__*/ _jsxs(Heading, {
123
+ level: "h4",
124
+ variant: "label",
125
+ children: [
126
+ ' ',
127
+ modelNameText,
128
+ ' '
129
+ ]
130
+ })
131
+ }),
132
+ /*#__PURE__*/ _jsx("div", {
133
+ css: styles?.modelName,
134
+ children: /*#__PURE__*/ _jsxs(Text, {
135
+ variant: "contentSmall",
136
+ children: [
137
+ " ",
138
+ modelName,
139
+ " "
140
+ ]
141
+ })
142
+ }),
143
+ /*#__PURE__*/ _jsx(NutritionFacts, {
144
+ fullscreen: fullscreenModals,
145
+ modalLabel: nutritionFactsModalLabel,
146
+ title: nutritionFactsTitle,
147
+ featureName: nutritionFactsFeatureName,
148
+ closeButtonText: nutritionFactsCloseButtonText,
149
+ closeIconButtonScreenReaderLabel: nutritionFactsCloseIconButtonScreenReaderLabel,
150
+ triggerText: nutritionFactsModalTriggerText,
151
+ data: nutritionFactsData
152
+ }),
153
+ data.length !== index + 1 ? /*#__PURE__*/ _jsx("div", {
154
+ css: styles?.divider
155
+ }) : null
156
+ ]
157
+ }, index))
158
+ })
159
+ ]
160
+ })
161
+ })
162
+ });
163
+ };
192
164
  AiInformation.generateComponentTheme = generateComponentTheme;
193
165
  export default AiInformation;
194
- export { AiInformation };
166
+ export { AiInformation };
@@ -1,26 +1,20 @@
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
- const allowedProps = ['fullscreenModals', 'title', 'data', 'trigger', 'dataPermissionLevelsModalLabel', 'dataPermissionLevelsTitle', 'dataPermissionLevelsData', 'dataPermissionLevelsCloseButtonText', 'dataPermissionLevelsCloseIconButtonScreenReaderLabel', 'dataPermissionLevelsCurrentFeatureText', 'dataPermissionLevelsCurrentFeature', 'nutritionFactsModalLabel', 'nutritionFactsTitle', 'nutritionFactsFeatureName', 'nutritionFactsData', 'nutritionFactsCloseButtonText', 'nutritionFactsCloseIconButtonScreenReaderLabel'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'fullscreenModals',
3
+ 'title',
4
+ 'data',
5
+ 'trigger',
6
+ 'dataPermissionLevelsModalLabel',
7
+ 'dataPermissionLevelsTitle',
8
+ 'dataPermissionLevelsData',
9
+ 'dataPermissionLevelsCloseButtonText',
10
+ 'dataPermissionLevelsCloseIconButtonScreenReaderLabel',
11
+ 'dataPermissionLevelsCurrentFeatureText',
12
+ 'dataPermissionLevelsCurrentFeature',
13
+ 'nutritionFactsModalLabel',
14
+ 'nutritionFactsTitle',
15
+ 'nutritionFactsFeatureName',
16
+ 'nutritionFactsData',
17
+ 'nutritionFactsCloseButtonText',
18
+ 'nutritionFactsCloseIconButtonScreenReaderLabel'
19
+ ];
20
+ export { allowedProps };
@@ -1,89 +1,56 @@
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
- /**
26
- * ---
27
- * private: true
28
- * ---
29
- * Generates the style object from the theme and provided additional information
30
- * @param {Object} componentTheme The theme variable object.
31
- * @param {Object} props the props of the component, the style is applied to
32
- * @return {Object} The final style object, which will be used in the component
33
- */
34
- const generateStyle = (componentTheme, _props) => {
35
- return {
36
- aiInformation: {
37
- label: 'ai-information',
38
- width: '18.5rem',
39
- padding: componentTheme.bodyPadding,
40
- boxSizing: 'border-box'
41
- },
42
- header: {
43
- label: 'ai-information__header',
44
- marginBottom: componentTheme.headingBottomMargin
45
- },
46
- privacyNotice: {
47
- label: 'ai-information__privacyNotice',
48
- marginBottom: componentTheme.headingBottomMargin
49
- },
50
- featureName: {
51
- label: 'ai-information__feature-name',
52
- marginBottom: componentTheme.featureNameBottomMargin
53
- },
54
- permissionLevelText: {
55
- label: 'ai-information__permission-level-text',
56
- marginBottom: componentTheme.permissionLevelTextBottomMargin
57
- },
58
- permissionLevel: {
59
- label: 'ai-information__permission-level',
60
- marginBottom: componentTheme.permissionLevelBottomMargin,
61
- color: componentTheme.levelColor
62
- },
63
- description: {
64
- label: 'ai-information__description',
65
- marginBottom: componentTheme.descriptionBottomMargin
66
- },
67
- permissionLevelsModalTriggerText: {
68
- label: 'ai-information__permission-levels-modal-trigger-text',
69
- marginBottom: componentTheme.permissionLevelsModalTriggerBottomMargin
70
- },
71
- modelNameText: {
72
- label: 'ai-information__model-name-text',
73
- marginBottom: componentTheme.modelNameTextBottomMargin
74
- },
75
- modelName: {
76
- label: 'ai-information__model-name',
77
- marginBottom: componentTheme.modelNameBottomMargin
78
- },
79
- divider: {
80
- label: 'ai-information__divider',
81
- marginBottom: componentTheme.dividerMargin,
82
- marginTop: componentTheme.dividerMargin,
83
- borderTop: 'solid 1px',
84
- width: '100%',
85
- borderColor: componentTheme.dividerColor
86
- }
87
- };
1
+ const generateStyle = (componentTheme, _props)=>{
2
+ return {
3
+ aiInformation: {
4
+ label: 'ai-information',
5
+ width: '18.5rem',
6
+ padding: componentTheme.bodyPadding,
7
+ boxSizing: 'border-box'
8
+ },
9
+ header: {
10
+ label: 'ai-information__header',
11
+ marginBottom: componentTheme.headingBottomMargin
12
+ },
13
+ privacyNotice: {
14
+ label: 'ai-information__privacyNotice',
15
+ marginBottom: componentTheme.headingBottomMargin
16
+ },
17
+ featureName: {
18
+ label: 'ai-information__feature-name',
19
+ marginBottom: componentTheme.featureNameBottomMargin
20
+ },
21
+ permissionLevelText: {
22
+ label: 'ai-information__permission-level-text',
23
+ marginBottom: componentTheme.permissionLevelTextBottomMargin
24
+ },
25
+ permissionLevel: {
26
+ label: 'ai-information__permission-level',
27
+ marginBottom: componentTheme.permissionLevelBottomMargin,
28
+ color: componentTheme.levelColor
29
+ },
30
+ description: {
31
+ label: 'ai-information__description',
32
+ marginBottom: componentTheme.descriptionBottomMargin
33
+ },
34
+ permissionLevelsModalTriggerText: {
35
+ label: 'ai-information__permission-levels-modal-trigger-text',
36
+ marginBottom: componentTheme.permissionLevelsModalTriggerBottomMargin
37
+ },
38
+ modelNameText: {
39
+ label: 'ai-information__model-name-text',
40
+ marginBottom: componentTheme.modelNameTextBottomMargin
41
+ },
42
+ modelName: {
43
+ label: 'ai-information__model-name',
44
+ marginBottom: componentTheme.modelNameBottomMargin
45
+ },
46
+ divider: {
47
+ label: 'ai-information__divider',
48
+ marginBottom: componentTheme.dividerMargin,
49
+ marginTop: componentTheme.dividerMargin,
50
+ borderTop: 'solid 1px',
51
+ width: '100%',
52
+ borderColor: componentTheme.dividerColor
53
+ }
54
+ };
88
55
  };
89
- export default generateStyle;
56
+ export default generateStyle;
@@ -1,53 +1,21 @@
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
- /**
26
- * Generates the theme object for the component from the theme and provided additional information
27
- * @param {Object} theme The actual theme object.
28
- * @return {Object} The final theme object with the overrides and component variables
29
- */
30
- const generateComponentTheme = theme => {
31
- const {
32
- colors,
33
- spacing
34
- } = theme;
35
- const componentVariables = {
36
- bodyPadding: spacing?.paddingCardLarge,
37
- headingBottomMargin: spacing?.sectionElements,
38
- featureNameBottomMargin: spacing?.moduleElements,
39
- permissionLevelTextBottomMargin: spacing?.space8,
40
- permissionLevelBottomMargin: spacing?.space8,
41
- descriptionBottomMargin: spacing?.space8,
42
- permissionLevelsModalTriggerBottomMargin: spacing?.moduleElements,
43
- modelNameTextBottomMargin: spacing?.space4,
44
- modelNameBottomMargin: spacing?.space4,
45
- dividerMargin: spacing?.moduleElements,
46
- dividerColor: colors?.ui?.surfaceDivider,
47
- levelColor: colors?.contrasts?.violet5790
48
- };
49
- return {
50
- ...componentVariables
51
- };
1
+ const generateComponentTheme = (theme)=>{
2
+ const { colors, spacing } = theme;
3
+ const componentVariables = {
4
+ bodyPadding: spacing?.paddingCardLarge,
5
+ headingBottomMargin: spacing?.sectionElements,
6
+ featureNameBottomMargin: spacing?.moduleElements,
7
+ permissionLevelTextBottomMargin: spacing?.space8,
8
+ permissionLevelBottomMargin: spacing?.space8,
9
+ descriptionBottomMargin: spacing?.space8,
10
+ permissionLevelsModalTriggerBottomMargin: spacing?.moduleElements,
11
+ modelNameTextBottomMargin: spacing?.space4,
12
+ modelNameBottomMargin: spacing?.space4,
13
+ dividerMargin: spacing?.moduleElements,
14
+ dividerColor: colors?.ui?.surfaceDivider,
15
+ levelColor: colors?.contrasts?.violet5790
16
+ };
17
+ return {
18
+ ...componentVariables
19
+ };
52
20
  };
53
- export default generateComponentTheme;
21
+ export default generateComponentTheme;