Skip to content

Commit

Permalink
docs: move examples to subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
gpbl committed May 31, 2024
1 parent 011bc62 commit 9986fe2
Show file tree
Hide file tree
Showing 63 changed files with 92 additions and 5 deletions.
6 changes: 3 additions & 3 deletions react-day-picker.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"**/versioned_docs": true,
"**/examples/**/*": true
"**/*.code-search": true
// "**/versioned_docs": true,
// "**/examples/**/*": true
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions website/examples-v8/Range.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { useState } from "react";

import { format } from "date-fns";

import { DateRange, DayPicker } from "./react-day-picker-v8";

export function Range() {
const [range, setRange] = useState<DateRange | undefined>();

let footer = <p>Please pick the first day.</p>;
if (range?.from) {
if (!range.to) {
footer = <p>{format(range.from, "PPP")}</p>;
} else if (range.to) {
footer = (
<p>
{format(range.from, "PPP")}{format(range.to, "PPP")}
</p>
);
}
}

return (
<DayPicker
defaultMonth={new Date(2022, 8)}
mode="range"
selected={range}
onSelect={setRange}
footer={footer}
/>
);
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions website/examples-v8/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export * from "./Controlled";
export * from "./CssVariables";
export * from "./CustomCaption";
export * from "./CustomDayContent";
export * from "./CustomMultiple";
export * from "./CustomSingle";
export * from "./CustomWeek";
export * from "./DefaultMonth";
export * from "./Dialog";
export * from "./DisableNavigation";
export * from "./Disabled";
export * from "./Dropdown";
export * from "./DropdownMultipleMonths";
export * from "./Fixedweeks";
export * from "./Formatters";
export * from "./FromToMonth";
export * from "./FromToYear";
export * from "./HideNavigation";
export * from "./Input";
export * from "./InputRange";
export * from "./InputTime";
export * from "./Keyboard";
export * from "./ModifiersClassnames";
export * from "./ModifiersCustom";
export * from "./ModifiersDisabled";
export * from "./ModifiersHidden";
export * from "./ModifiersSelected";
export * from "./ModifiersStyle";
export * from "./ModifiersToday";
export * from "./Multiple";
export * from "./MultipleMinMax";
export * from "./MultipleMonths";
export * from "./MultipleMonthsId";
export * from "./MultipleMonthsPaged";
export * from "./None";
export * from "./NumberingSystem";
export * from "./OutsideDays";
export * from "./Range";
export * from "./RangeMinMax";
export * from "./RangeShiftKey";
export * from "./Rtl";
export * from "./Single";
export * from "./SingleRequired";
export * from "./Spanish";
export * from "./SpanishWeekStartsOn";
export * from "./Start";
export * from "./StylingCss";
export * from "./StylingCssModules";
export * from "./StylingInline";
export * from "./StylingModifiers";
export * from "./WeekIso";
export * from "./Weeknumber";
export * from "./WeeknumberCustom";
export * from "./WeeknumberIso";
export * from "./react-day-picker-v8";
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion website/src/theme/MDXComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import MDXComponents from "@theme-original/MDXComponents";
import * as Examples from "react-day-picker/examples";

import * as ExamplesV8 from "../../../examples";
import * as ExamplesV8 from "../../examples-v8";
import { BrowserWindow } from "../components/BrowserWindow";

export default {
Expand Down
2 changes: 1 addition & 1 deletion website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"@/*": ["./src/*"]
}
},
"include": ["src", "examples"]
"include": ["src", "examples-v8"]
}

0 comments on commit 9986fe2

Please sign in to comment.