From f75223a04382fd410636d615cfb859fd2452098e Mon Sep 17 00:00:00 2001 From: Daniel Lu Date: Thu, 3 Apr 2025 13:06:25 -0700 Subject: [PATCH 1/3] chore: Fix generated code sample for S2 TooltipTrigger docs (#8000) * Fix generated code sample for S2 TooltipTrigger docs * review * inlining --- .../s2/stories/Tooltip.stories.tsx | 59 +++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/packages/@react-spectrum/s2/stories/Tooltip.stories.tsx b/packages/@react-spectrum/s2/stories/Tooltip.stories.tsx index e1a59705fc0..a13c5862846 100644 --- a/packages/@react-spectrum/s2/stories/Tooltip.stories.tsx +++ b/packages/@react-spectrum/s2/stories/Tooltip.stories.tsx @@ -14,7 +14,7 @@ import {ActionButton, Button, Provider, Tooltip, TooltipTrigger} from '../src'; import {CombinedTooltip} from '../src/Tooltip'; import Crop from '../s2wf-icons/S2_Icon_Crop_20_N.svg'; import LassoSelect from '../s2wf-icons/S2_Icon_LassoSelect_20_N.svg'; -import type {Meta} from '@storybook/react'; +import type {Meta, StoryObj} from '@storybook/react'; import {style} from '../style' with {type: 'macro'}; const meta: Meta = { @@ -80,13 +80,32 @@ const ExampleRender = (args: any) => { ); }; -export const Example = { +type Story = StoryObj; + +export const Example: Story = { render: (args) => , argTypes: { isOpen: { control: 'select', options: [true, false, undefined] } + }, + parameters: { + docs: { + source: { + transform: () => { + return ` + + + Crop + + + + Lasso +`; + } + } + } } }; @@ -126,17 +145,30 @@ const LongLabelRender = (args: any) => { ); }; -export const LongLabel = { +export const LongLabel: Story = { render: (args) => , argTypes: { isOpen: { control: 'select', options: [true, false, undefined] } + }, + parameters: { + docs: { + source: { + transform: () => { + return ` + + + Checkbox with very long label so we can see wrapping +`; + } + } + } } }; -export const ColorScheme = { +export const ColorScheme: Story = { render: (args: any) => ( @@ -147,5 +179,24 @@ export const ColorScheme = { control: 'select', options: [true, false, undefined] } + }, + parameters: { + docs: { + source: { + transform: () => { + return ` + + + + Crop + + + + Lasso + +`; + } + } + } } }; From 148fcf175e22df3fff9cda45e9194bf245bbc0d0 Mon Sep 17 00:00:00 2001 From: Trevor Howell <25328178+ToyWalrus@users.noreply.github.com> Date: Fri, 4 Apr 2025 08:28:28 -0600 Subject: [PATCH 2/3] fix: export SortDescriptor type from S2 (#8030) --- packages/@react-spectrum/s2/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@react-spectrum/s2/src/index.ts b/packages/@react-spectrum/s2/src/index.ts index 69f8619dcbe..adc682d6ac1 100644 --- a/packages/@react-spectrum/s2/src/index.ts +++ b/packages/@react-spectrum/s2/src/index.ts @@ -148,4 +148,4 @@ export type {ToggleButtonProps} from './ToggleButton'; export type {ToggleButtonGroupProps} from './ToggleButtonGroup'; export type {TooltipProps} from './Tooltip'; export type {TreeViewProps, TreeViewItemProps, TreeViewItemContentProps} from './TreeView'; -export type {FileTriggerProps, TooltipTriggerComponentProps as TooltipTriggerProps} from 'react-aria-components'; +export type {FileTriggerProps, TooltipTriggerComponentProps as TooltipTriggerProps, SortDescriptor} from 'react-aria-components'; From c73c066310ca273abc83a328c738329215f54f5a Mon Sep 17 00:00:00 2001 From: Ritesh Kumar Date: Thu, 10 Apr 2025 18:05:20 +0530 Subject: [PATCH 3/3] fix: update import paths in buildI18n.js to reflect package renaming from @react-aria-nutrient to @react-aria --- scripts/buildI18n.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/buildI18n.js b/scripts/buildI18n.js index 715e1d5da85..2f06fd34e3a 100644 --- a/scripts/buildI18n.js +++ b/scripts/buildI18n.js @@ -59,7 +59,7 @@ export default PackageLocalizedStrings; // Generate index files. for (let ext of ['.js', '.mjs']) { let generateImport = (exports, from) => ext === '.mjs' ? `import ${exports} from '${from}'` : `let ${exports} = require('${from}')`; - let index = generateImport('{PackageLocalizationProvider, getPackageLocalizationScript}', '@react-aria-nutrient/i18n/server') + ';\n'; + let index = generateImport('{PackageLocalizationProvider, getPackageLocalizationScript}', '@react-aria/i18n/server') + ';\n'; index += generateImport('{LocalizedStringDictionary}', '@internationalized/string') + ';\n'; index += generateImport('{createElement}', 'react') + ';\n'; for (let lang in languages) { @@ -141,6 +141,6 @@ export declare function createLocalizedStringDictionary(packages: string[]): Loc `); } -build('{@react-aria-nutrient/*,@react-stately/*,@react-spectrum/*,react-aria-components}', '@adobe/react-spectrum'); -build('{@react-aria-nutrient/*,@react-stately/*,react-aria-components}', 'react-aria-components'); -build('{@react-aria,@react-stately}/*', '@react-aria-nutrient/react-aria'); +build('{@react-aria/*,@react-stately/*,@react-spectrum/*,react-aria-components}', '@adobe/react-spectrum'); +build('{@react-aria/*,@react-stately/*,react-aria-components}', 'react-aria-components'); +build('{@react-aria,@react-stately}/*', 'react-aria');