Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(react-spinbutton): migrate to new package structure #25813

Merged
merged 3 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: Migrate to new package structure.",
"packageName": "@fluentui/react-spinbutton",
"email": "[email protected]",
"dependentChangeType": "patch"
}
5 changes: 3 additions & 2 deletions packages/react-components/react-spinbutton/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
bundle-size/
config/
coverage/
e2e/
docs/
etc/
node_modules/
src/
stories/
dist/types/
temp/
__fixtures__
Expand All @@ -16,7 +17,7 @@ __tests__
*.api.json
*.log
*.spec.*
*.stories.*
*.cy.*
*.test.*
*.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const rootMain = require('../../../../.storybook/main');

module.exports = /** @type {Omit<import('../../../../.storybook/main'), 'typescript'|'babel'>} */ ({
...rootMain,
stories: [...rootMain.stories, '../src/**/*.stories.mdx', '../src/**/index.stories.@(ts|tsx)'],
stories: [...rootMain.stories, '../stories/**/*.stories.mdx', '../stories/**/index.stories.@(ts|tsx)'],
addons: [...rootMain.addons],
webpackFinal: (config, options) => {
const localConfig = { ...rootMain.webpackFinal(config, options) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"checkJs": true,
"types": ["static-assets", "environment", "storybook__addons"]
},
"include": ["../src/**/*.stories.ts", "../src/**/*.stories.tsx", "*.js"]
"include": ["../stories/**/*.stories.ts", "../stories/**/*.stories.tsx", "*.js"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Note that labels and helper text are included here for completeness but will be

#### Base `SpinButton` Anatomy

![Base SpinButton Anatomy (annotated)](./spec-assets/spec-spinbutton-anatomy.png)
![Base SpinButton Anatomy (annotated)](./assets/spec-spinbutton-anatomy.png)

#### Alternate/Optional `SpinButton` Anatomy

![Alternate/Optional SpinButton Anatomy (annotated)](./spec-assets/spec-spinbutton-anatomy-alt-optional.png)
![Alternate/Optional SpinButton Anatomy (annotated)](./assets/spec-spinbutton-anatomy-alt-optional.png)

### Common Features

Expand Down Expand Up @@ -74,7 +74,7 @@ Unlike directly typing input into the control, step buttons do not allow input o

Most implementations flip the layout of the control for RTL. Using the base example, the step buttons appear on the left with the value on the right as opposed to the LTR version where the value is on the left and the steppers on the right.

![Example of an RTL SpinButton](./spec-assets/spec-spinbutton-rtl.png)
![Example of an RTL SpinButton](./assets/spec-spinbutton-rtl.png)

### a11y

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { SpinButton } from './SpinButton';
import { isConformant } from '../../common/isConformant';
import { isConformant } from '../../testing/isConformant';
import * as Keys from '@fluentui/keyboard-keys';

const getSpinButtonInput = (): HTMLInputElement => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isConformant } from '../../common/isConformant';
import { isConformant } from '../../testing/isConformant';
import { SpinButtonField } from './SpinButtonField';

describe('SpinButtonField', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"types": ["static-assets", "environment"]
},
"exclude": [
"./src/common/**",
"./src/testing/**",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
"outDir": "dist",
"types": ["jest", "node"]
},
"include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
"include": [
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.d.ts",
"./src/testing/**/*.ts",
"./src/testing/**/*.tsx"
]
}