Skip to content

Commit b4c8501

Browse files
authored
Packages/aiinfo/additional link (#198)
* add privacynotice props * add privacy notice text * map privacy notice to Entry * bump version * lint * entry length is variable with privacy URL * update cache * use ui-instructure 10.29.0 for v2 * set undefined to string * use ui-instructure 10x * remove undefined coersion * fix tsdown config * add privacy URL props to tests * guard oldentry * type writentries test * use proper source for URL * map privacy urls * lint * lint * build * rename types * lint * lint nutritionfacts * update coverage * fix Layout class * add link to extended type * nutritionfacts@2.0.13
1 parent f09a608 commit b4c8501

85 files changed

Lines changed: 1640 additions & 821 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/nutritionfacts/.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ You should use the provided components and utilities from InstUI to build your a
1010

1111
## InstUI Guidelines
1212

13-
- version 11.2.0
13+
- version 11.2.0
1414
- Instructure UI (InstUI) is a comprehensive React component library.
1515

1616
### User Guides
17+
1718
#### Getting Started
1819

1920
- [Accessibility](https://instructure.design/markdowns/accessibility.md): Instructure UI targets WCAG 2.1 AA/AAA standards with proper color contrast, keyboard navigation, screen reader support, and ARIA compliance. Components are perceivable, operable, understandable, and robust.
@@ -146,4 +147,3 @@ You should use the provided components and utilities from InstUI to build your a
146147
- [AiInformation](https://instructure.design/markdowns/AiInformation.md): Displays AI-related data in Instructure products. Composed from NutritionFacts and DataPermissionLevels components with prefixed APIs. Supports fullscreen modals for mobile viewports with comprehensive data structure for AI feature information.
147148
- [DataPermissionLevels](https://instructure.design/markdowns/DataPermissionLevels.md): Displays AI-related data permissions in Instructure products. Shows hierarchical permission levels with titles and descriptions. Includes a modal interface with close functionality and supports highlighting specific levels for emphasis.
148149
- [NutritionFacts](https://instructure.design/markdowns/NutritionFacts.md): A specialized modal component for displaying AI-related data in structured blocks. Includes model info, privacy/compliance details, and output metrics. Features a trigger button and modal presentation.
149-

apps/nutritionfacts/coverage/coverage.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
coverage:
22
totals:
3-
statements: 7.51%
4-
branches: 3.06%
3+
statements: 7.38%
4+
branches: 2.99%
55
functions: 8.33%
6-
lines: 7.78%
7-
total: 6.67%
6+
lines: 7.64%
7+
total: 6.59%
88
src:
99
totals:
1010
statements: 30.63%
@@ -84,7 +84,7 @@ coverage:
8484
branches: 0%
8585
functions: 0%
8686
lines: 0%
87-
uncovered_line_numbers: "16-61"
87+
uncovered_line_numbers: "21-86"
8888
"presets.tsx":
8989
statements: 0%
9090
branches: 0%

apps/nutritionfacts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@instructure.ai/nutritionfacts",
3-
"version": "2.0.12",
3+
"version": "2.0.13",
44
"private": true,
55
"repository": {
66
"type": "git",

apps/nutritionfacts/src/app.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import "./app.css";
22
import { Flex, InlineSVG, Link, Text, View } from "@instructure/ui";
33
import AiInfo from "@instructure.ai/aiinfo";
4-
import type { AiInfoFeatureProps } from "@instructure.ai/aiinfo";
4+
import { type AiInfoFeatureProps } from "@instructure.ai/aiinfo";
55
import { useEffect, useState } from "react";
6-
import type { FC } from "react";
6+
import { type FC } from "react";
77
import { DefaultLayout, Logo, LogoDark, colors, copyright, disclaimer } from "./assets";
88
import { EmbedControl, LinkControl } from "./components/export";
99
import { NutritionFactsForm, getLayoutFromParams } from "./components/layout";
@@ -31,7 +31,7 @@ const App: FC = () => {
3131

3232
useEffect(() => {
3333
if (id && id.toLowerCase() in AiInfo) {
34-
setProduct(AiInfo[id.toLowerCase() as keyof typeof AiInfo]);
34+
setProduct(AiInfo[id.toLowerCase()]);
3535
}
3636
}, [id]);
3737

apps/nutritionfacts/src/assets/consts.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Link } from "@instructure/ui";
2-
import type { LinkProps } from "@instructure/ui";
3-
import type { AiInfoFeatureProps } from "@instructure.ai/aiinfo";
2+
import { type LinkProps } from "@instructure/ui";
3+
import { type AiInfoFeatureProps } from "@instructure.ai/aiinfo";
44
import { colors } from "./colors";
55
import { CanvasBug, IgniteBug, InstructureBug, MasteryBug, ParchmentBug } from "./logos";
6-
import type { SVGWrapperProps } from "./";
6+
import { type SVGWrapperProps } from "./";
77

88
const baseUrl =
99
typeof window !== "undefined"

apps/nutritionfacts/src/assets/layout.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from "vitest";
2-
import type { PageLayout } from "../types";
2+
import { type PageLayout } from "../types";
33
import { DefaultLayout, Layout } from "./layout";
44

55
describe("layout", () => {

apps/nutritionfacts/src/assets/layout.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
import type { PageLayout } from "../types";
1+
import { type PageLayout } from "../types";
22

33
class Layout implements PageLayout {
44
copyright: boolean;
55
disclaimer: boolean;
66
revision: boolean;
7+
permissions: boolean;
78

89
constructor(layout: PageLayout) {
910
this.copyright = layout.copyright;
1011
this.disclaimer = layout.disclaimer;
1112
this.revision = layout.revision;
13+
this.permissions = layout.permissions;
1214
}
1315
}
1416

1517
const DefaultLayout = new Layout({
1618
copyright: true,
1719
disclaimer: true,
20+
permissions: true,
1821
revision: true,
1922
} as PageLayout);
2023

apps/nutritionfacts/src/assets/logos.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { InlineSVG } from "@instructure/ui";
2-
import type { InlineSVGProps } from "@instructure/ui";
3-
import type { FC, ReactNode } from "react";
2+
import { type InlineSVGProps } from "@instructure/ui";
3+
import { type FC, type ReactNode } from "react";
44
import { useId } from "react";
55
import { colors } from "./";
66

apps/nutritionfacts/src/components/export/controlButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IconButton, Tooltip } from "@instructure/ui";
2-
import type { SVGIconProps } from "@instructure/ui";
2+
import { type SVGIconProps } from "@instructure/ui";
33

44
interface ControlButtonProps {
55
label: string;

apps/nutritionfacts/src/components/export/embed.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { IconExternalLinkLine } from "@instructure/ui";
2-
import type { SVGIconProps } from "@instructure/ui";
3-
import type { AiInfoFeatureProps } from "@instructure.ai/aiinfo";
2+
import { type SVGIconProps } from "@instructure/ui";
3+
import { type AiInfoFeatureProps } from "@instructure.ai/aiinfo";
44
import { baseUrl } from "../../assets";
5-
import type { PageLayout } from "../../types.ts";
5+
import { type PageLayout } from "../../types.ts";
66
import { ControlButton } from "./";
77

88
const productToText = (product: AiInfoFeatureProps): string => {

0 commit comments

Comments
 (0)