@instructure/ui-instructure 11.6.0 → 11.6.1-snapshot-129

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 (106) hide show
  1. package/CHANGELOG.md +30 -75
  2. package/es/AiInformation/{index.js → v1/index.js} +8 -7
  3. package/es/AiInformation/v2/index.js +195 -0
  4. package/es/AiInformation/v2/props.js +26 -0
  5. package/es/AiInformation/v2/styles.js +93 -0
  6. package/es/DataPermissionLevels/{index.js → v1/index.js} +6 -6
  7. package/es/NutritionFacts/{index.js → v1/index.js} +6 -6
  8. package/es/{index.js → exports/a.js} +3 -3
  9. package/es/exports/b.js +26 -0
  10. package/lib/AiInformation/{index.js → v1/index.js} +21 -20
  11. package/lib/AiInformation/v2/index.js +202 -0
  12. package/lib/AiInformation/v2/props.js +31 -0
  13. package/lib/AiInformation/v2/styles.js +99 -0
  14. package/lib/DataPermissionLevels/{index.js → v1/index.js} +18 -19
  15. package/lib/NutritionFacts/{index.js → v1/index.js} +20 -21
  16. package/lib/{index.js → exports/a.js} +6 -6
  17. package/lib/exports/b.js +26 -0
  18. package/package.json +45 -23
  19. package/src/AiInformation/{index.tsx → v1/index.tsx} +8 -7
  20. package/src/AiInformation/{props.ts → v1/props.ts} +2 -1
  21. package/src/AiInformation/v2/README.md +302 -0
  22. package/src/AiInformation/v2/index.tsx +197 -0
  23. package/src/AiInformation/v2/props.ts +163 -0
  24. package/src/AiInformation/v2/styles.ts +101 -0
  25. package/src/DataPermissionLevels/{index.tsx → v1/index.tsx} +6 -6
  26. package/src/NutritionFacts/{index.tsx → v1/index.tsx} +6 -6
  27. package/src/{index.ts → exports/a.ts} +6 -6
  28. package/src/exports/b.ts +29 -0
  29. package/tsconfig.build.tsbuildinfo +1 -1
  30. package/types/AiInformation/v1/index.d.ts.map +1 -0
  31. package/types/AiInformation/{props.d.ts → v1/props.d.ts} +2 -1
  32. package/types/AiInformation/v1/props.d.ts.map +1 -0
  33. package/types/AiInformation/v1/styles.d.ts.map +1 -0
  34. package/types/AiInformation/v1/theme.d.ts.map +1 -0
  35. package/types/AiInformation/v2/index.d.ts +10 -0
  36. package/types/AiInformation/v2/index.d.ts.map +1 -0
  37. package/types/AiInformation/v2/props.d.ts +97 -0
  38. package/types/AiInformation/v2/props.d.ts.map +1 -0
  39. package/types/AiInformation/v2/styles.d.ts +15 -0
  40. package/types/AiInformation/v2/styles.d.ts.map +1 -0
  41. package/types/DataPermissionLevels/v1/index.d.ts.map +1 -0
  42. package/types/DataPermissionLevels/v1/props.d.ts.map +1 -0
  43. package/types/DataPermissionLevels/v1/styles.d.ts.map +1 -0
  44. package/types/DataPermissionLevels/v1/theme.d.ts.map +1 -0
  45. package/types/NutritionFacts/v1/index.d.ts.map +1 -0
  46. package/types/NutritionFacts/v1/props.d.ts.map +1 -0
  47. package/types/NutritionFacts/v1/styles.d.ts.map +1 -0
  48. package/types/NutritionFacts/v1/theme.d.ts.map +1 -0
  49. package/types/exports/a.d.ts +7 -0
  50. package/types/exports/a.d.ts.map +1 -0
  51. package/types/exports/b.d.ts +7 -0
  52. package/types/exports/b.d.ts.map +1 -0
  53. package/types/AiInformation/index.d.ts.map +0 -1
  54. package/types/AiInformation/props.d.ts.map +0 -1
  55. package/types/AiInformation/styles.d.ts.map +0 -1
  56. package/types/AiInformation/theme.d.ts.map +0 -1
  57. package/types/DataPermissionLevels/index.d.ts.map +0 -1
  58. package/types/DataPermissionLevels/props.d.ts.map +0 -1
  59. package/types/DataPermissionLevels/styles.d.ts.map +0 -1
  60. package/types/DataPermissionLevels/theme.d.ts.map +0 -1
  61. package/types/NutritionFacts/index.d.ts.map +0 -1
  62. package/types/NutritionFacts/props.d.ts.map +0 -1
  63. package/types/NutritionFacts/styles.d.ts.map +0 -1
  64. package/types/NutritionFacts/theme.d.ts.map +0 -1
  65. package/types/index.d.ts +0 -7
  66. package/types/index.d.ts.map +0 -1
  67. /package/es/AiInformation/{props.js → v1/props.js} +0 -0
  68. /package/es/AiInformation/{styles.js → v1/styles.js} +0 -0
  69. /package/es/AiInformation/{theme.js → v1/theme.js} +0 -0
  70. /package/es/DataPermissionLevels/{props.js → v1/props.js} +0 -0
  71. /package/es/DataPermissionLevels/{styles.js → v1/styles.js} +0 -0
  72. /package/es/DataPermissionLevels/{theme.js → v1/theme.js} +0 -0
  73. /package/es/NutritionFacts/{props.js → v1/props.js} +0 -0
  74. /package/es/NutritionFacts/{styles.js → v1/styles.js} +0 -0
  75. /package/es/NutritionFacts/{theme.js → v1/theme.js} +0 -0
  76. /package/lib/AiInformation/{props.js → v1/props.js} +0 -0
  77. /package/lib/AiInformation/{styles.js → v1/styles.js} +0 -0
  78. /package/lib/AiInformation/{theme.js → v1/theme.js} +0 -0
  79. /package/lib/DataPermissionLevels/{props.js → v1/props.js} +0 -0
  80. /package/lib/DataPermissionLevels/{styles.js → v1/styles.js} +0 -0
  81. /package/lib/DataPermissionLevels/{theme.js → v1/theme.js} +0 -0
  82. /package/lib/NutritionFacts/{props.js → v1/props.js} +0 -0
  83. /package/lib/NutritionFacts/{styles.js → v1/styles.js} +0 -0
  84. /package/lib/NutritionFacts/{theme.js → v1/theme.js} +0 -0
  85. /package/src/AiInformation/{README.md → v1/README.md} +0 -0
  86. /package/src/AiInformation/{styles.ts → v1/styles.ts} +0 -0
  87. /package/src/AiInformation/{theme.ts → v1/theme.ts} +0 -0
  88. /package/src/DataPermissionLevels/{README.md → v1/README.md} +0 -0
  89. /package/src/DataPermissionLevels/{props.ts → v1/props.ts} +0 -0
  90. /package/src/DataPermissionLevels/{styles.ts → v1/styles.ts} +0 -0
  91. /package/src/DataPermissionLevels/{theme.ts → v1/theme.ts} +0 -0
  92. /package/src/NutritionFacts/{README.md → v1/README.md} +0 -0
  93. /package/src/NutritionFacts/{props.ts → v1/props.ts} +0 -0
  94. /package/src/NutritionFacts/{styles.ts → v1/styles.ts} +0 -0
  95. /package/src/NutritionFacts/{theme.ts → v1/theme.ts} +0 -0
  96. /package/types/AiInformation/{index.d.ts → v1/index.d.ts} +0 -0
  97. /package/types/AiInformation/{styles.d.ts → v1/styles.d.ts} +0 -0
  98. /package/types/AiInformation/{theme.d.ts → v1/theme.d.ts} +0 -0
  99. /package/types/DataPermissionLevels/{index.d.ts → v1/index.d.ts} +0 -0
  100. /package/types/DataPermissionLevels/{props.d.ts → v1/props.d.ts} +0 -0
  101. /package/types/DataPermissionLevels/{styles.d.ts → v1/styles.d.ts} +0 -0
  102. /package/types/DataPermissionLevels/{theme.d.ts → v1/theme.d.ts} +0 -0
  103. /package/types/NutritionFacts/{index.d.ts → v1/index.d.ts} +0 -0
  104. /package/types/NutritionFacts/{props.d.ts → v1/props.d.ts} +0 -0
  105. /package/types/NutritionFacts/{styles.d.ts → v1/styles.d.ts} +0 -0
  106. /package/types/NutritionFacts/{theme.d.ts → v1/theme.d.ts} +0 -0
@@ -0,0 +1,197 @@
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
+ import { useState } from 'react'
25
+ import { Popover } from '@instructure/ui-popover/latest'
26
+ import { CloseButton } from '@instructure/ui-buttons/latest'
27
+ import { Heading } from '@instructure/ui-heading/latest'
28
+ import { Text } from '@instructure/ui-text/latest'
29
+ import { Link } from '@instructure/ui-link/latest'
30
+ import { ExternalLinkInstUIIcon } from '@instructure/ui-icons'
31
+ import { useStyle } from '@instructure/emotion'
32
+ import { NutritionFacts } from '../../NutritionFacts/v1'
33
+ import { DataPermissionLevels } from '../../DataPermissionLevels/v1'
34
+
35
+ import { AiInformationProps } from './props'
36
+ import generateStyle from './styles'
37
+
38
+ /**
39
+ ---
40
+ category: components/AI Components
41
+ ---
42
+ **/
43
+ const AiInformation = ({
44
+ title,
45
+ data,
46
+ trigger,
47
+ fullscreenModals = false,
48
+
49
+ dataPermissionLevelsModalLabel,
50
+ dataPermissionLevelsTitle,
51
+ dataPermissionLevelsData,
52
+ dataPermissionLevelsCloseButtonText,
53
+ dataPermissionLevelsCloseIconButtonScreenReaderLabel,
54
+ dataPermissionLevelsCurrentFeature,
55
+ dataPermissionLevelsCurrentFeatureText,
56
+
57
+ nutritionFactsModalLabel,
58
+ nutritionFactsTitle,
59
+ nutritionFactsFeatureName,
60
+ nutritionFactsData,
61
+ nutritionFactsCloseButtonText,
62
+ nutritionFactsCloseIconButtonScreenReaderLabel,
63
+ themeOverride
64
+ }: AiInformationProps) => {
65
+ const [open, setOpen] = useState(false)
66
+
67
+ const styles = useStyle({
68
+ generateStyle,
69
+ themeOverride,
70
+ componentId: 'AiInformation',
71
+ displayName: 'AiInformation'
72
+ })
73
+
74
+ return (
75
+ <div>
76
+ <Popover
77
+ renderTrigger={trigger}
78
+ isShowingContent={open}
79
+ on="click"
80
+ screenReaderLabel="Popover Dialog Example"
81
+ shouldContainFocus
82
+ shouldReturnFocus
83
+ shouldCloseOnDocumentClick
84
+ offsetY="1rem"
85
+ onShowContent={() => setOpen(true)}
86
+ onHideContent={() => setOpen(false)}
87
+ >
88
+ <div css={styles?.aiInformation}>
89
+ <div css={styles?.header}>
90
+ <Heading level="h2" aiVariant="stacked" variant="titleModule">
91
+ {title}
92
+ </Heading>
93
+ <CloseButton
94
+ placement="end"
95
+ offset="small"
96
+ onClick={() => setOpen(false)}
97
+ screenReaderLabel="Close"
98
+ />
99
+ </div>
100
+ <div>
101
+ {data.map(
102
+ (
103
+ {
104
+ featureName,
105
+ privacyNoticeText,
106
+ privacyNoticeUrl,
107
+ permissionLevelText,
108
+ permissionLevel,
109
+ description,
110
+ permissionLevelsModalTriggerText,
111
+ modelNameText,
112
+ modelName,
113
+ nutritionFactsModalTriggerText
114
+ },
115
+ index
116
+ ) => (
117
+ <div key={index}>
118
+ <div css={styles?.privacyNotice}>
119
+ <Link
120
+ href={privacyNoticeUrl}
121
+ renderIcon={<ExternalLinkInstUIIcon size="sm" />}
122
+ iconPlacement="end"
123
+ variant="standalone"
124
+ >
125
+ {privacyNoticeText}
126
+ </Link>
127
+ </div>
128
+ <div css={styles?.featureName}>
129
+ <Heading level="h3" variant="titleCardRegular">
130
+ {featureName}
131
+ </Heading>
132
+ </div>
133
+
134
+ <div css={styles?.permissionLevelText}>
135
+ <Heading level="h4" variant="label">
136
+ {permissionLevelText}
137
+ </Heading>
138
+ </div>
139
+ <div css={styles?.permissionLevel}>
140
+ <Text variant="legend"> {permissionLevel} </Text>
141
+ </div>
142
+ <div css={styles?.description}>
143
+ <Text variant="contentSmall"> {description} </Text>
144
+ </div>
145
+ <div css={styles?.permissionLevelsModalTriggerText}>
146
+ <DataPermissionLevels
147
+ fullscreen={fullscreenModals}
148
+ title={dataPermissionLevelsTitle}
149
+ currentFeatureText={
150
+ dataPermissionLevelsCurrentFeatureText
151
+ }
152
+ currentFeature={dataPermissionLevelsCurrentFeature}
153
+ closeIconButtonScreenReaderLabel={
154
+ dataPermissionLevelsCloseIconButtonScreenReaderLabel
155
+ }
156
+ closeButtonText={dataPermissionLevelsCloseButtonText}
157
+ modalLabel={dataPermissionLevelsModalLabel}
158
+ triggerText={permissionLevelsModalTriggerText}
159
+ data={dataPermissionLevelsData}
160
+ />
161
+ </div>
162
+ <div css={styles?.modelNameText}>
163
+ <Heading level="h3" variant="label">
164
+ {' '}
165
+ {modelNameText}{' '}
166
+ </Heading>
167
+ </div>
168
+ <div css={styles?.modelName}>
169
+ <Text variant="contentSmall"> {modelName} </Text>
170
+ </div>
171
+ <NutritionFacts
172
+ fullscreen={fullscreenModals}
173
+ modalLabel={nutritionFactsModalLabel}
174
+ title={nutritionFactsTitle}
175
+ featureName={nutritionFactsFeatureName}
176
+ closeButtonText={nutritionFactsCloseButtonText}
177
+ closeIconButtonScreenReaderLabel={
178
+ nutritionFactsCloseIconButtonScreenReaderLabel
179
+ }
180
+ triggerText={nutritionFactsModalTriggerText}
181
+ data={nutritionFactsData}
182
+ />
183
+ {data.length !== index + 1 ? (
184
+ <div css={styles?.divider} />
185
+ ) : null}
186
+ </div>
187
+ )
188
+ )}
189
+ </div>
190
+ </div>
191
+ </Popover>
192
+ </div>
193
+ )
194
+ }
195
+
196
+ export default AiInformation
197
+ export { AiInformation }
@@ -0,0 +1,163 @@
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
+ import type { ComponentStyle, ThemeOverrideValue } from '@instructure/emotion'
25
+ import type { OtherHTMLAttributes, Renderable } from '@instructure/shared-types'
26
+ import type { NutritionFactsProps } from '../../NutritionFacts/v1/props'
27
+ import type { DataPermissionLevelsProps } from '../../DataPermissionLevels/v1/props'
28
+
29
+ type AiInformationOwnProps = {
30
+ /**
31
+ * i18n text for the title of popover
32
+ */
33
+ title: string
34
+ /**
35
+ * the data structure of the Features on the popover
36
+ */
37
+ data: {
38
+ featureName: string
39
+ privacyNoticeText: string
40
+ privacyNoticeUrl: string
41
+ permissionLevelText: string
42
+ permissionLevel: string
43
+ description: string
44
+ permissionLevelsModalTriggerText: string
45
+ modelNameText: string
46
+ modelName: string
47
+ nutritionFactsModalTriggerText: string
48
+ }[]
49
+ /**
50
+ * sets the modal size to 'fullscreen' for NutritionFacts and DataPermissionLevels. Used for small viewports
51
+ */
52
+ fullscreenModals?: boolean
53
+
54
+ /**
55
+ * The element that triggers the popover
56
+ */
57
+ trigger: Renderable
58
+
59
+ // this is the same as DataPermissionLevels' props
60
+
61
+ /**
62
+ * i18n text for the label of the dataPermissionLevels modal
63
+ */
64
+ dataPermissionLevelsModalLabel: DataPermissionLevelsProps['modalLabel']
65
+ /**
66
+ * i18n text for the dataPermissionLevels title
67
+ */
68
+ dataPermissionLevelsTitle: DataPermissionLevelsProps['title']
69
+ /**
70
+ * i18n text for the "model and data" heading of the dataPermissionLevels
71
+ */
72
+ dataPermissionLevelsData: DataPermissionLevelsProps['data']
73
+ /**
74
+ * i18n text for the dataPermissionLevels close button
75
+ */
76
+ dataPermissionLevelsCloseButtonText: DataPermissionLevelsProps['closeButtonText']
77
+ /**
78
+ * i18n text for the dataPermissionLevels close iconButton
79
+ */
80
+ dataPermissionLevelsCloseIconButtonScreenReaderLabel: DataPermissionLevelsProps['closeIconButtonScreenReaderLabel']
81
+ /**
82
+ * i18n text for the dataPermissionLevels "current feature" text
83
+ */
84
+ dataPermissionLevelsCurrentFeatureText: DataPermissionLevelsProps['currentFeatureText']
85
+ /**
86
+ * i18n text for the dataPermissionLevels current feature
87
+ */
88
+ dataPermissionLevelsCurrentFeature: DataPermissionLevelsProps['currentFeature']
89
+
90
+ // this is the same as NutritionFacts' props
91
+
92
+ /**
93
+ * i18n text for the NutritionFacts label of the modal
94
+ */
95
+ nutritionFactsModalLabel: NutritionFactsProps['modalLabel']
96
+ /**
97
+ * i18n text for the NutritionFacts title
98
+ */
99
+ nutritionFactsTitle: NutritionFactsProps['title']
100
+ /**
101
+ * i18n text for the feature name that the NutritionFacts describes
102
+ */
103
+ nutritionFactsFeatureName: NutritionFactsProps['featureName']
104
+ /**
105
+ * i18n text for the "model and data" heading of the NutritionFacts
106
+ */
107
+ nutritionFactsData: NutritionFactsProps['data']
108
+ /**
109
+ * i18n text for the NutritionFacts close button
110
+ */
111
+ nutritionFactsCloseButtonText: NutritionFactsProps['closeButtonText']
112
+ /**
113
+ * i18n text for the NutritionFacts close iconButton
114
+ */
115
+ nutritionFactsCloseIconButtonScreenReaderLabel: NutritionFactsProps['closeIconButtonScreenReaderLabel']
116
+ }
117
+
118
+ type PropKeys = keyof AiInformationOwnProps
119
+
120
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
121
+
122
+ type AiInformationProps = AiInformationOwnProps & {
123
+ themeOverride?: ThemeOverrideValue
124
+ } & OtherHTMLAttributes<AiInformationOwnProps>
125
+
126
+ type AiInformationStyle = ComponentStyle<
127
+ | 'aiInformation'
128
+ | 'header'
129
+ | 'privacyNotice'
130
+ | 'featureName'
131
+ | 'permissionLevelText'
132
+ | 'permissionLevel'
133
+ | 'description'
134
+ | 'permissionLevelsModalTriggerText'
135
+ | 'modelNameText'
136
+ | 'modelName'
137
+ | 'divider'
138
+ > & {
139
+ maxWidth?: string
140
+ }
141
+
142
+ const allowedProps: AllowedPropKeys = [
143
+ 'fullscreenModals',
144
+ 'title',
145
+ 'data',
146
+ 'trigger',
147
+ 'dataPermissionLevelsModalLabel',
148
+ 'dataPermissionLevelsTitle',
149
+ 'dataPermissionLevelsData',
150
+ 'dataPermissionLevelsCloseButtonText',
151
+ 'dataPermissionLevelsCloseIconButtonScreenReaderLabel',
152
+ 'dataPermissionLevelsCurrentFeatureText',
153
+ 'dataPermissionLevelsCurrentFeature',
154
+ 'nutritionFactsModalLabel',
155
+ 'nutritionFactsTitle',
156
+ 'nutritionFactsFeatureName',
157
+ 'nutritionFactsData',
158
+ 'nutritionFactsCloseButtonText',
159
+ 'nutritionFactsCloseIconButtonScreenReaderLabel'
160
+ ]
161
+
162
+ export type { AiInformationProps, AiInformationStyle }
163
+ export { allowedProps }
@@ -0,0 +1,101 @@
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
+ import type { NewComponentTypes, SharedTokens } from '@instructure/ui-themes'
26
+ import type { AiInformationStyle } from './props'
27
+
28
+ /**
29
+ * ---
30
+ * private: true
31
+ * ---
32
+ * Generates the style object from the theme and provided additional information
33
+ * @param componentTheme The theme variable object.
34
+ * @param params Additional parameters to customize the style.
35
+ * @param sharedTokens Shared token object that stores common values for the theme.
36
+ * @return The final style object, which will be used in the component
37
+ */
38
+ const generateStyle = (
39
+ componentTheme: NewComponentTypes['AiInformation'],
40
+ _params: Record<string, never>,
41
+ _sharedTokens: SharedTokens
42
+ ): AiInformationStyle => {
43
+ return {
44
+ aiInformation: {
45
+ label: 'ai-information',
46
+ width: '18.5rem',
47
+ padding: componentTheme.bodyPadding,
48
+ boxSizing: 'border-box'
49
+ },
50
+ header: {
51
+ label: 'ai-information__header',
52
+ marginBottom: componentTheme.headingBottomMargin
53
+ },
54
+ privacyNotice: {
55
+ label: 'ai-information__privacyNotice',
56
+ marginBottom: componentTheme.headingBottomMargin
57
+ },
58
+ featureName: {
59
+ label: 'ai-information__feature-name',
60
+ marginBottom: componentTheme.featureNameBottomMargin
61
+ },
62
+ permissionLevelText: {
63
+ label: 'ai-information__permission-level-text',
64
+ marginBottom: componentTheme.permissionLevelTextBottomMargin
65
+ },
66
+ permissionLevel: {
67
+ label: 'ai-information__permission-level',
68
+ marginBottom: componentTheme.permissionLevelBottomMargin,
69
+ color: componentTheme.levelColor,
70
+ '& > *': {
71
+ color: `${componentTheme.levelColor} !important`
72
+ }
73
+ },
74
+ description: {
75
+ label: 'ai-information__description',
76
+ marginBottom: componentTheme.descriptionBottomMargin
77
+ },
78
+ permissionLevelsModalTriggerText: {
79
+ label: 'ai-information__permission-levels-modal-trigger-text',
80
+ marginBottom: componentTheme.permissionLevelsModalTriggerBottomMargin
81
+ },
82
+ modelNameText: {
83
+ label: 'ai-information__model-name-text',
84
+ marginBottom: componentTheme.modelNameTextBottomMargin
85
+ },
86
+ modelName: {
87
+ label: 'ai-information__model-name',
88
+ marginBottom: componentTheme.modelNameBottomMargin
89
+ },
90
+ divider: {
91
+ label: 'ai-information__divider',
92
+ marginBottom: componentTheme.dividerMargin,
93
+ marginTop: componentTheme.dividerMargin,
94
+ borderTop: 'solid 1px',
95
+ width: '100%',
96
+ borderColor: componentTheme.dividerColor
97
+ }
98
+ }
99
+ }
100
+
101
+ export default generateStyle
@@ -22,12 +22,12 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
  import { useState } from 'react'
25
- import { Modal } from '@instructure/ui-modal'
26
- import { Button, CloseButton } from '@instructure/ui-buttons'
27
- import { Heading } from '@instructure/ui-heading'
28
- import { Text } from '@instructure/ui-text'
29
- import { Link } from '@instructure/ui-link'
30
- import { useStyle } from '@instructure/emotion'
25
+ import { Modal } from '@instructure/ui-modal/v11_6'
26
+ import { Button, CloseButton } from '@instructure/ui-buttons/v11_6'
27
+ import { Heading } from '@instructure/ui-heading/v11_6'
28
+ import { Text } from '@instructure/ui-text/v11_6'
29
+ import { Link } from '@instructure/ui-link/v11_6'
30
+ import { useStyleLegacy as useStyle } from '@instructure/emotion'
31
31
 
32
32
  import { DataPermissionLevelsProps } from './props'
33
33
  import generateStyle from './styles'
@@ -22,12 +22,12 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
  import { useState } from 'react'
25
- import { Modal } from '@instructure/ui-modal'
26
- import { Button, CloseButton } from '@instructure/ui-buttons'
27
- import { Heading } from '@instructure/ui-heading'
28
- import { Text } from '@instructure/ui-text'
29
- import { Link } from '@instructure/ui-link'
30
- import { useStyle } from '@instructure/emotion'
25
+ import { Modal } from '@instructure/ui-modal/v11_6'
26
+ import { Button, CloseButton } from '@instructure/ui-buttons/v11_6'
27
+ import { Heading } from '@instructure/ui-heading/v11_6'
28
+ import { Text } from '@instructure/ui-text/v11_6'
29
+ import { Link } from '@instructure/ui-link/v11_6'
30
+ import { useStyleLegacy as useStyle } from '@instructure/emotion'
31
31
 
32
32
  import { NutritionFactsProps } from './props'
33
33
  import generateStyle from './styles'
@@ -21,9 +21,9 @@
21
21
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  * SOFTWARE.
23
23
  */
24
- export { NutritionFacts } from './NutritionFacts'
25
- export { DataPermissionLevels } from './DataPermissionLevels'
26
- export { AiInformation } from './AiInformation'
27
- export type { NutritionFactsProps } from './NutritionFacts/props'
28
- export type { DataPermissionLevelsProps } from './DataPermissionLevels/props'
29
- export type { AiInformationProps } from './AiInformation/props'
24
+ export { NutritionFacts } from '../NutritionFacts/v1'
25
+ export { DataPermissionLevels } from '../DataPermissionLevels/v1'
26
+ export { AiInformation } from '../AiInformation/v1'
27
+ export type { NutritionFactsProps } from '../NutritionFacts/v1/props'
28
+ export type { DataPermissionLevelsProps } from '../DataPermissionLevels/v1/props'
29
+ export type { AiInformationProps } from '../AiInformation/v1/props'
@@ -0,0 +1,29 @@
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
+ export { NutritionFacts } from '../NutritionFacts/v1'
25
+ export { DataPermissionLevels } from '../DataPermissionLevels/v1'
26
+ export { AiInformation } from '../AiInformation/v2'
27
+ export type { NutritionFactsProps } from '../NutritionFacts/v1/props'
28
+ export type { DataPermissionLevelsProps } from '../DataPermissionLevels/v1/props'
29
+ export type { AiInformationProps } from '../AiInformation/v2/props'