From ce5f1ec6a0c0f766679ea708c40538fc2d56c6d9 Mon Sep 17 00:00:00 2001 From: Bernardo Sunderhus Date: Wed, 21 Sep 2022 15:05:28 +0200 Subject: [PATCH] chore(react-aria): restructure folder organization (#24884) --- ...ui-react-aria-01c1906f-a6a1-431d-b4a2-e8f0310c26eb.json | 7 +++++++ .../src/{hooks/useARIAButton => button}/index.ts | 0 .../src/{hooks/useARIAButton => button}/types.ts | 0 .../useARIAButton => button}/useARIAButton.stories.tsx | 4 ++-- .../useARIAButton => button}/useARIAButtonProps.test.tsx | 0 .../{hooks/useARIAButton => button}/useARIAButtonProps.ts | 0 .../useARIAButtonShorthand.test.tsx | 6 +++--- .../useARIAButton => button}/useARIAButtonShorthand.ts | 0 packages/react-components/react-aria/src/index.ts | 4 ++-- 9 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 change/@fluentui-react-aria-01c1906f-a6a1-431d-b4a2-e8f0310c26eb.json rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/index.ts (100%) rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/types.ts (100%) rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/useARIAButton.stories.tsx (92%) rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/useARIAButtonProps.test.tsx (100%) rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/useARIAButtonProps.ts (100%) rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/useARIAButtonShorthand.test.tsx (85%) rename packages/react-components/react-aria/src/{hooks/useARIAButton => button}/useARIAButtonShorthand.ts (100%) diff --git a/change/@fluentui-react-aria-01c1906f-a6a1-431d-b4a2-e8f0310c26eb.json b/change/@fluentui-react-aria-01c1906f-a6a1-431d-b4a2-e8f0310c26eb.json new file mode 100644 index 0000000000000..966c59ea76e24 --- /dev/null +++ b/change/@fluentui-react-aria-01c1906f-a6a1-431d-b4a2-e8f0310c26eb.json @@ -0,0 +1,7 @@ +{ + "type": "none", + "comment": "chore: restructure folder organization", + "packageName": "@fluentui/react-aria", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "none" +} diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/index.ts b/packages/react-components/react-aria/src/button/index.ts similarity index 100% rename from packages/react-components/react-aria/src/hooks/useARIAButton/index.ts rename to packages/react-components/react-aria/src/button/index.ts diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/types.ts b/packages/react-components/react-aria/src/button/types.ts similarity index 100% rename from packages/react-components/react-aria/src/hooks/useARIAButton/types.ts rename to packages/react-components/react-aria/src/button/types.ts diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButton.stories.tsx b/packages/react-components/react-aria/src/button/useARIAButton.stories.tsx similarity index 92% rename from packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButton.stories.tsx rename to packages/react-components/react-aria/src/button/useARIAButton.stories.tsx index 339ed0dcc7891..bb0f78f392416 100644 --- a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButton.stories.tsx +++ b/packages/react-components/react-aria/src/button/useARIAButton.stories.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { useARIAButtonShorthand } from '../useARIAButton'; -import type { ARIAButtonSlotProps } from '../useARIAButton'; +import { useARIAButtonShorthand } from '../button'; +import type { ARIAButtonSlotProps } from '../button'; import { getSlots } from '@fluentui/react-components'; import type { ComponentState, Slot } from '@fluentui/react-components'; diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonProps.test.tsx b/packages/react-components/react-aria/src/button/useARIAButtonProps.test.tsx similarity index 100% rename from packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonProps.test.tsx rename to packages/react-components/react-aria/src/button/useARIAButtonProps.test.tsx diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonProps.ts b/packages/react-components/react-aria/src/button/useARIAButtonProps.ts similarity index 100% rename from packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonProps.ts rename to packages/react-components/react-aria/src/button/useARIAButtonProps.ts diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonShorthand.test.tsx b/packages/react-components/react-aria/src/button/useARIAButtonShorthand.test.tsx similarity index 85% rename from packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonShorthand.test.tsx rename to packages/react-components/react-aria/src/button/useARIAButtonShorthand.test.tsx index 336e2f1b0bcaf..6508513036395 100644 --- a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonShorthand.test.tsx +++ b/packages/react-components/react-aria/src/button/useARIAButtonShorthand.test.tsx @@ -6,7 +6,7 @@ describe('useARIAButtonShorthands', () => { const { result: { current: buttonShorthand }, } = renderHook(() => useARIAButtonShorthand({ as: 'button' })); - expect(buttonShorthand.as).toBe('button'); + expect(buttonShorthand?.as).toBe('button'); const { result: { current: buttonShorthand2 }, } = renderHook(() => useARIAButtonShorthand({ as: undefined })); @@ -14,10 +14,10 @@ describe('useARIAButtonShorthands', () => { const { result: { current: anchorShorthand }, } = renderHook(() => useARIAButtonShorthand({ as: 'a' })); - expect(anchorShorthand.as).toBe('a'); + expect(anchorShorthand?.as).toBe('a'); const { result: { current: divShorthand }, } = renderHook(() => useARIAButtonShorthand({ as: 'div' })); - expect(divShorthand.as).toBe('div'); + expect(divShorthand?.as).toBe('div'); }); }); diff --git a/packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonShorthand.ts b/packages/react-components/react-aria/src/button/useARIAButtonShorthand.ts similarity index 100% rename from packages/react-components/react-aria/src/hooks/useARIAButton/useARIAButtonShorthand.ts rename to packages/react-components/react-aria/src/button/useARIAButtonShorthand.ts diff --git a/packages/react-components/react-aria/src/index.ts b/packages/react-components/react-aria/src/index.ts index f5d6693c1789f..86f3713ac66f8 100644 --- a/packages/react-components/react-aria/src/index.ts +++ b/packages/react-components/react-aria/src/index.ts @@ -1,4 +1,4 @@ -export { useARIAButtonShorthand, useARIAButtonProps } from './hooks/useARIAButton/index'; +export { useARIAButtonShorthand, useARIAButtonProps } from './button/index'; export type { ARIAButtonSlotProps, ARIAButtonProps, @@ -6,4 +6,4 @@ export type { ARIAButtonType, ARIAButtonElement, ARIAButtonElementIntersection, -} from './hooks/useARIAButton/index'; +} from './button/index';