Skip to content

Commit

Permalink
feat: Datepicker to stable [BAU-699] (contentful#2204)
Browse files Browse the repository at this point in the history
* feat: datepicker stable release 🎉

* refactor: remove export hack for Parcel bundler

* chore: add changeset
  • Loading branch information
bgutsol authored and denkristoffer committed Oct 5, 2022
1 parent 9855e77 commit a12f9ad
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 37 deletions.
6 changes: 6 additions & 0 deletions .changeset/proud-cups-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@contentful/f36-datepicker': minor
'@contentful/f36-components': minor
---

Release Datepicker stable version, include Datepicker to the umbrella @contentful/f36-components pkg
6 changes: 4 additions & 2 deletions packages/components/datepicker/README.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Datepicker'
status: 'beta'
isBeta: true
status: 'stable'
isNew: true
slug: /components/datepicker/
github: 'https://github.com/contentful/forma-36/tree/main/packages/components/datepicker'
storybook: 'https://v4-f36-storybook.netlify.app/?path=/story/components-datepicker'
Expand Down Expand Up @@ -30,6 +30,8 @@ yarn add @contentful/f36-datepicker@beta
## Import

```jsx static=true
import { Datepicker } from '@contentful/f36-components';
// or
import { Datepicker } from '@contentful/f36-datepicker';
```

Expand Down
2 changes: 1 addition & 1 deletion packages/components/datepicker/examples/Calendar/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Calendar } from '@contentful/f36-datepicker';
import { Calendar } from '@contentful/f36-components';

export default function BasicExample() {
const [selectedDay, setSelectedDay] = useState(new Date());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Calendar, DayContent } from '@contentful/f36-datepicker';
import { Calendar, DayContent } from '@contentful/f36-components';
import { css } from 'emotion';
import tokens from '@contentful/f36-tokens';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Calendar } from '@contentful/f36-datepicker';
import { Calendar } from '@contentful/f36-components';
import { css } from 'emotion';
import tokens from '@contentful/f36-tokens';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Calendar } from '@contentful/f36-datepicker';
import { Calendar } from '@contentful/f36-components';

export default function MinMaxExample() {
const today = new Date();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Calendar } from '@contentful/f36-datepicker';
import { Calendar } from '@contentful/f36-components';

export default function MultiMonthsExample() {
const [selectedDay, setSelectedDay] = useState(new Date());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Datepicker } from '@contentful/f36-datepicker';
import { Datepicker } from '@contentful/f36-components';

export default function BasicExample() {
const [selectedDay, setSelectedDay] = useState(new Date());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useRef } from 'react';
import { Calendar } from '@contentful/f36-datepicker';
import { Calendar } from '@contentful/f36-components';
import { TextInput } from '@contentful/f36-forms';
import { format, parse, isValid } from 'date-fns';
import { Popover } from '@contentful/f36-popover';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Datepicker } from '@contentful/f36-datepicker';
import { Datepicker } from '@contentful/f36-components';

export default function BasicExample() {
const [selectedDay, setSelectedDay] = useState(new Date());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { Flex, Box } from '@contentful/f36-components';
import { Datepicker } from '@contentful/f36-datepicker';
import { Datepicker } from '@contentful/f36-components';

export default function FormatExample() {
const [selectedDay, setSelectedDay] = useState(new Date());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { SectionHeading } from '@contentful/f36-components';
import { Datepicker } from '@contentful/f36-datepicker';
import { Datepicker } from '@contentful/f36-components';

export default function VisualStatesExample() {
const [selectedDay, setSelectedDay] = useState(new Date());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Datepicker } from '@contentful/f36-datepicker';
import { Datepicker } from '@contentful/f36-components';
import { FormControl } from '@contentful/f36-forms';

export default function BasicExample() {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/datepicker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentful/f36-datepicker",
"version": "4.1.0-beta.8",
"version": "4.1.0",
"description": "Forma 36: Datepicker component",
"scripts": {
"build": "tsup"
Expand Down
6 changes: 4 additions & 2 deletions packages/components/datepicker/src/Calendar/README.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'Calendar'
status: 'beta'
isBeta: true
status: 'stable'
isNew: true
slug: /components/calendar/
github: 'https://github.com/contentful/forma-36/tree/main/packages/components/datepicker/src/Calendar'
storybook: 'https://v4-f36-storybook.netlify.app/?path=/story/components-datepicker-calendar--default'
Expand Down Expand Up @@ -30,6 +30,8 @@ yarn add @contentful/f36-datepicker@beta
## Import

```jsx static=true
import { Calendar } from '@contentful/f36-components';
// or
import { Calendar } from '@contentful/f36-datepicker';
```

Expand Down
17 changes: 2 additions & 15 deletions packages/components/datepicker/src/Calendar/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import {
Day as _Day,
DayContent as _DayContent,
useDayPicker as _useDayPicker,
DayProps,
DayContentProps,
} from 'react-day-picker';

export * from './Calendar';

// Hack for Parcel bundler, to build a valid commonJS dist
const Day = _Day;
const DayContent = _DayContent;
const useDayPicker = _useDayPicker;
export { Day, DayContent, useDayPicker };
export type { DayProps, DayContentProps };
export { Day, DayContent, useDayPicker } from 'react-day-picker';
export type { DayProps, DayContentProps } from 'react-day-picker';
1 change: 1 addition & 0 deletions packages/forma-36-react-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@contentful/f36-copybutton": "^4.17.0",
"@contentful/f36-core": "^4.17.0",
"@contentful/f36-datetime": "^4.17.0",
"@contentful/f36-datepicker": "^4.1.0",
"@contentful/f36-drag-handle": "^4.17.0",
"@contentful/f36-entity-list": "^4.17.0",
"@contentful/f36-forms": "^4.17.0",
Expand Down
1 change: 1 addition & 0 deletions packages/forma-36-react-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from '@contentful/f36-collapse';
export * from '@contentful/f36-copybutton';
export * from '@contentful/f36-core';
export * from '@contentful/f36-datetime';
export * from '@contentful/f36-datepicker';
export * from '@contentful/f36-drag-handle';
export * from '@contentful/f36-entity-list';
export * from '@contentful/f36-forms';
Expand Down
2 changes: 0 additions & 2 deletions packages/website/components/LiveEditor/ComponentSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { css, cx } from 'emotion';
import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live';
import tokens from '@contentful/f36-tokens';
import * as f36Components from '@contentful/f36-components';
import * as datepickerComponents from '@contentful/f36-datepicker';
import * as f36utils from '@contentful/f36-utils';
import { useForm, useController } from 'react-hook-form';
import { MdAccessAlarm } from 'react-icons/md';
Expand All @@ -33,7 +32,6 @@ const liveProviderScope = {
...f36icons,
...f36Components,
...f36utils,
...datepickerComponents,
css,
f36icons,
tokens,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export function SandpackRenderer({
'react-dom': '^17.0.0',
'react-scripts': '^4.0.0',
'@contentful/f36-components': '^4.0.0',
'@contentful/f36-datepicker': 'beta', //TODO: Remove when not in beta
'@contentful/f36-tokens': '^4.0.0',
'@contentful/f36-icons': '^4.0.0',
emotion: '^10.0.17',
Expand Down
1 change: 0 additions & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"dependencies": {
"@codesandbox/sandpack-react": "0.18.1",
"@contentful/f36-components": "^4.14.0",
"@contentful/f36-datepicker": "^4.1.0-beta.6",
"@contentful/f36-docs-utils": "^4.0.1",
"@contentful/f36-icon": "^4.11.0",
"@contentful/f36-icons": "^4.11.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/website/utils/sidebarLinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{
"title": "Calendar",
"slug": "/components/calendar/",
"isBeta": true
"isNew": true
},
{
"title": "Date utilities",
Expand All @@ -135,7 +135,7 @@
{
"title": "Datepicker",
"slug": "/components/datepicker/",
"isBeta": true
"isNew": true
},
{
"title": "DateTime",
Expand Down

0 comments on commit a12f9ad

Please sign in to comment.