diff --git a/packages/@react-spectrum/ai/stories/chat.mdx b/packages/@react-spectrum/ai/stories/chat.mdx new file mode 100644 index 00000000000..f975dad5280 --- /dev/null +++ b/packages/@react-spectrum/ai/stories/chat.mdx @@ -0,0 +1,26 @@ +{/* Copyright 2026 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. */} + +Let me see what the documents say about travel reimbursement rules. + + +Here are the key rules for travel reimbursement at +Adobe: + +### Booking & Payment + +1. Travel Booking: All travel must be booked through Adobe's preferred travel services provider. Booking outside of approved providers is not allowed. +2. Corporate Card Use: Employees must use their +Adobe Corporate Card for business travel expenses unless the merchant does not accept it. Personal expenses are strictly prohibited on the Corporate Card and must be reimbursed to Adobe immediately if charged. + +### Air & Rail Travel + +1. Advance Booking: Airfare should be purchased as early as possible. Tickets bought less than 7 days before travel are flagged as exceptions. +2. Class of Service: + - Domestic and international flights under 6.5 hours: Econom/Coach class onlv. diff --git a/packages/@react-spectrum/ai/stories/prose.stories.tsx b/packages/@react-spectrum/ai/stories/prose.stories.tsx index 4f008187549..de8557f60cb 100644 --- a/packages/@react-spectrum/ai/stories/prose.stories.tsx +++ b/packages/@react-spectrum/ai/stories/prose.stories.tsx @@ -10,12 +10,23 @@ * governing permissions and limitations under the License. */ +import { + Chat, + PromptField, + PromptFieldSubmitButton, + PromptTokenField, + Thread, + ThreadItem, + UserMessage +} from '../exports'; +import ChatExample from './chat.mdx'; import {createPortal} from 'react-dom'; import type {Meta} from '@storybook/react'; import {prose} from '@react-spectrum/ai/style' with {type: 'macro'}; import ProseExample from './prose.mdx'; // @ts-ignore import React, {ReactNode, useRef, useState} from 'react'; +import {Slider} from '@react-spectrum/s2'; import * as spectrumTokens from '@adobe/spectrum-tokens/dist/json/variables.json'; import {style} from '@react-spectrum/s2/style' with {type: 'macro'}; import {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect'; @@ -27,13 +38,34 @@ const meta: Meta = { export default meta; -export const Example = () => ( - -
- -
-
-); +function ProseStory() { + let [fontSize, setFontSize] = useState(14); + return ( + +
+ +
+
+ +
+
+ ); +} + +export const Example = () => ; // Spectrum tokens applied to each prose element (see style/prose.ts). When a // font isn't specified the element inherits `body`; when a margin isn't @@ -251,7 +283,7 @@ function BlueLine({box}: {box: MarginBox}) { <>
[] = []; @@ -540,3 +574,167 @@ function specificity(selector: string): number { .length; return ids * 100 + classes * 10 + types; } + +// The side panel thread: a user prompt followed by the assistant's reply, +// which is rendered from chat.mdx as prose. +type ChatMessage = {id: number; type: 'user'; content: string} | {id: number; type: 'prose'}; + +const chatMessages: ChatMessage[] = [ + {id: 0, type: 'user', content: 'Summarize key travel reimbursement rules'}, + {id: 1, type: 'prose'} +]; + +function SidePanelExample() { + let [fontSize, setFontSize] = useState(14); + + return ( +
+
+

Heading stuff

+ +
+
+

Left Panel

+
+
+

Main Content

+
+
+
+

+ Ask AI Assistant +

+ + + {(msg: ChatMessage) => { + if (msg.type === 'user') { + return ( + + {msg.content} + + ); + } + return ( + +
+ +
+
+ ); + }} +
+ {}}> +
+ + +
+
+
+
+
+
+ ); +} +export const SidePanel = { + render: () => , + parameters: { + layout: 'fullscreen' + } +};