Skip to content

Commit

Permalink
chore: mark the Calendar component as stable. Update the eslint compo…
Browse files Browse the repository at this point in the history
…nent-lifecycle-imports rule
  • Loading branch information
sirineJ committed Oct 9, 2024
1 parent f8016eb commit 60b2248
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/circuit-ui/components/Calendar/Calendar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as Stories from './Calendar.stories';

# Calendar

<Status variant="experimental" />
<Status variant="stable" />

The Calendar component displays a monthly date grid. This is a low-level component for advanced use cases; you likely want to use the [DateInput](Forms/Input/DateInput/Base) component instead.

Expand Down
1 change: 0 additions & 1 deletion packages/circuit-ui/experimental.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export {
Toggletip,
type ToggletipProps,
} from './components/Toggletip/index.js';
export { Calendar, type CalendarProps } from './components/Calendar/index.js';
export { type PlainDateRange } from './util/date.js';
export { PhoneNumberInput } from './components/PhoneNumberInput/index.js';
export type { PhoneNumberInputProps } from './components/PhoneNumberInput/index.js';
2 changes: 2 additions & 0 deletions packages/circuit-ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export { PercentageInput } from './components/PercentageInput/index.js';
export type { PercentageInputProps } from './components/PercentageInput/index.js';
export { ImageInput } from './components/ImageInput/index.js';
export type { ImageInputProps } from './components/ImageInput/index.js';
export { Calendar } from './components/Calendar/index.js';
export type { CalendarProps } from './components/Calendar/index.js';

// Actions
export { Button } from './components/Button/index.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ruleTester.run('component-lifecycle-imports', componentLifecycleImports, {
],
invalid: [
{
name: 'single import with single match',
name: '[Legacy] single import with single match',
code: `
import { RangePicker } from '@sumup-oss/circuit-ui';
`,
Expand All @@ -70,7 +70,7 @@ ruleTester.run('component-lifecycle-imports', componentLifecycleImports, {
errors: [{ messageId: 'refactor' }],
},
{
name: 'single import with single match with local name',
name: '[Legacy] single import with single match with local name',
code: `
import { RangePicker as RangeInput } from '@sumup-oss/circuit-ui';
`,
Expand All @@ -80,7 +80,7 @@ ruleTester.run('component-lifecycle-imports', componentLifecycleImports, {
errors: [{ messageId: 'refactor' }],
},
{
name: 'multiple imports with single match',
name: '[Legacy] multiple imports with single match',
code: `
import { RangePicker, Button } from '@sumup-oss/circuit-ui';
`,
Expand All @@ -90,7 +90,7 @@ ruleTester.run('component-lifecycle-imports', componentLifecycleImports, {
errors: [{ messageId: 'refactor' }],
},
{
name: 'multiple imports with multiple matches',
name: '[Legacy] multiple imports with multiple matches',
code: `
import { RangePicker, RangePickerController } from '@sumup-oss/circuit-ui';
`,
Expand All @@ -101,7 +101,7 @@ ruleTester.run('component-lifecycle-imports', componentLifecycleImports, {
errors: [{ messageId: 'refactor' }, { messageId: 'refactor' }],
},
{
name: 'single type import with single match',
name: '[Legacy] single type import with single match',
code: `
import type { RangePickerProps } from '@sumup-oss/circuit-ui';
`,
Expand All @@ -110,5 +110,35 @@ ruleTester.run('component-lifecycle-imports', componentLifecycleImports, {
`,
errors: [{ messageId: 'refactor' }],
},
{
name: '[Experimental] single import with single match',
code: `
import { Calendar } from '@sumup/circuit-ui/experimental';
`,
output: `
import { Calendar } from '@sumup/circuit-ui';
`,
errors: [{ messageId: 'refactor' }],
},
{
name: '[Experimental] single import with single match with local name',
code: `
import { Calendar as CuiCalendar } from '@sumup/circuit-ui/experimental';
`,
output: `
import { Calendar as CuiCalendar } from '@sumup/circuit-ui';
`,
errors: [{ messageId: 'refactor' }],
},
{
name: '[Experimental] single type import with single match',
code: `
import type { CalendarProps } from '@sumup/circuit-ui/experimental';
`,
output: `
import type { CalendarProps } from '@sumup/circuit-ui';
`,
errors: [{ messageId: 'refactor' }],
},
],
});
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ const mappings = [
'center',
],
},
{
from: '@sumup/circuit-ui/experimental',
to: '@sumup/circuit-ui',
specifiers: ['Calendar', 'CalendarProps'],
},

];

export const componentLifecycleImports = createRule({
Expand Down

0 comments on commit 60b2248

Please sign in to comment.