(defaultDate);
+ let {locale} = useLocale();
+
+ let now = today(getLocalTimeZone());
+ let nextWeek = startOfWeek(now.add({weeks: 1}), locale);
+ let nextMonth = startOfMonth(now.add({months: 1}));
+
+ const CustomRadio = (props) => {
+ const {children, ...otherProps} = props;
+
+ return (
+
+ {children}
+
+ );
+ };
+
+ return (
+
+
+ Exact dates
+ 1 day
+ 2 days
+ 3 days
+ 7 days
+ 14 days
+
+ }
+ classNames={{
+ content: "w-full",
+ }}
+ focusedValue={value}
+ nextButtonProps={{
+ variant: "bordered",
+ }}
+ prevButtonProps={{
+ variant: "bordered",
+ }}
+ topContent={
+
+
+
+
+
+ }
+ value={value}
+ onChange={setValue}
+ onFocusChange={setValue}
+ />
+
+ );
+}
diff --git a/apps/docs/content/components/calendar/presets.ts b/apps/docs/content/components/calendar/presets.ts
index f6e9d85919..334d59a763 100644
--- a/apps/docs/content/components/calendar/presets.ts
+++ b/apps/docs/content/components/calendar/presets.ts
@@ -1,185 +1,15 @@
-const App = `import {Calendar, Radio, RadioGroup, Button, ButtonGroup, cn} from "@nextui-org/react";
-import {today, getLocalTimeZone, startOfWeek, startOfMonth} from "@internationalized/date";
-import {useLocale} from "@react-aria/i18n";
-
-export default function App() {
- let defaultDate = today(getLocalTimeZone());
- let [value, setValue] = React.useState(defaultDate);
- let {locale} = useLocale();
-
- let now = today(getLocalTimeZone());
- let nextWeek = startOfWeek(now.add({weeks: 1}), locale);
- let nextMonth = startOfMonth(now.add({months: 1}));
-
- const CustomRadio = (props) => {
- const {children, ...otherProps} = props;
-
- return (
-
- {children}
-
- );
- };
-
- return (
-
-
- Exact dates
- 1 day
- 2 days
- 3 days
- 7 days
- 14 days
-
- }
- classNames={{
- content: "w-full",
- }}
- focusedValue={value}
- nextButtonProps={{
- variant: "bordered",
- }}
- prevButtonProps={{
- variant: "bordered",
- }}
- topContent={
-
-
-
-
-
- }
- value={value}
- onChange={setValue}
- onFocusChange={setValue}
- />
-
- );
-}`;
-
-const AppTs = `import {Calendar, Radio, RadioGroup, Button, ButtonGroup, cn} from "@nextui-org/react";
-import type {DateValue} from "@react-types/calendar";
-import {today, getLocalTimeZone, startOfWeek, startOfMonth} from "@internationalized/date";
-import {useLocale} from "@react-aria/i18n";
-
-export default function App() {
- let defaultDate = today(getLocalTimeZone());
- let [value, setValue] = React.useState(defaultDate);
- let {locale} = useLocale();
-
- let now = today(getLocalTimeZone());
- let nextWeek = startOfWeek(now.add({weeks: 1}), locale);
- let nextMonth = startOfMonth(now.add({months: 1}));
-
- const CustomRadio = (props) => {
- const {children, ...otherProps} = props;
-
- return (
-
- {children}
-
- );
- };
-
- return (
-
-
- Exact dates
- 1 day
- 2 days
- 3 days
- 7 days
- 14 days
-
- }
- classNames={{
- content: "w-full",
- }}
- focusedValue={value}
- nextButtonProps={{
- variant: "bordered",
- }}
- prevButtonProps={{
- variant: "bordered",
- }}
- topContent={
-
-
-
-
-
- }
- value={value}
- onChange={setValue}
- onFocusChange={setValue}
- />
-
- );
-}`;
+import App from "./presets.raw.jsx?raw";
+import AppTs from "./presets.raw.tsx?raw";
const react = {
"/App.jsx": App,
+};
+
+const reactTs = {
"/App.tsx": AppTs,
};
export default {
...react,
+ ...reactTs,
};
diff --git a/apps/docs/content/components/calendar/read-only.raw.jsx b/apps/docs/content/components/calendar/read-only.raw.jsx
new file mode 100644
index 0000000000..ff58e4fbb8
--- /dev/null
+++ b/apps/docs/content/components/calendar/read-only.raw.jsx
@@ -0,0 +1,6 @@
+import {Calendar} from "@nextui-org/react";
+import {today, getLocalTimeZone} from "@internationalized/date";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/calendar/read-only.ts b/apps/docs/content/components/calendar/read-only.ts
index 6fffcd20a6..caf4be10cf 100644
--- a/apps/docs/content/components/calendar/read-only.ts
+++ b/apps/docs/content/components/calendar/read-only.ts
@@ -1,15 +1,4 @@
-const App = `import {Calendar} from "@nextui-org/react";
-import {today, getLocalTimeZone} from "@internationalized/date";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./read-only.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/calendar/unavailable-dates.raw.jsx b/apps/docs/content/components/calendar/unavailable-dates.raw.jsx
new file mode 100644
index 0000000000..b08a78b9da
--- /dev/null
+++ b/apps/docs/content/components/calendar/unavailable-dates.raw.jsx
@@ -0,0 +1,23 @@
+import {Calendar} from "@nextui-org/react";
+import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
+import {useLocale} from "@react-aria/i18n";
+
+export default function App() {
+ let now = today(getLocalTimeZone());
+
+ let disabledRanges = [
+ [now, now.add({days: 5})],
+ [now.add({days: 14}), now.add({days: 16})],
+ [now.add({days: 23}), now.add({days: 24})],
+ ];
+
+ let {locale} = useLocale();
+
+ let isDateUnavailable = (date) =>
+ isWeekend(date, locale) ||
+ disabledRanges.some(
+ (interval) => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0,
+ );
+
+ return ;
+}
diff --git a/apps/docs/content/components/calendar/unavailable-dates.ts b/apps/docs/content/components/calendar/unavailable-dates.ts
index 9a884fb2a9..b4e1f4df1a 100644
--- a/apps/docs/content/components/calendar/unavailable-dates.ts
+++ b/apps/docs/content/components/calendar/unavailable-dates.ts
@@ -1,32 +1,4 @@
-const App = `import {Calendar} from "@nextui-org/react";
-import {today, getLocalTimeZone, isWeekend} from "@internationalized/date";
-import {useLocale} from "@react-aria/i18n";
-
-
-export default function App() {
- let now = today(getLocalTimeZone());
-
- let disabledRanges = [
- [now, now.add({days: 5})],
- [now.add({days: 14}), now.add({days: 16})],
- [now.add({days: 23}), now.add({days: 24})],
- ];
-
- let {locale} = useLocale();
-
- let isDateUnavailable = (date) =>
- isWeekend(date, locale) ||
- disabledRanges.some(
- (interval) => date.compare(interval[0]) >= 0 && date.compare(interval[1]) <= 0,
- );
-
- return (
-
- );
-}`;
+import App from "./unavailable-dates.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/calendar/usage.raw.jsx b/apps/docs/content/components/calendar/usage.raw.jsx
new file mode 100644
index 0000000000..5d2d03dd0b
--- /dev/null
+++ b/apps/docs/content/components/calendar/usage.raw.jsx
@@ -0,0 +1,11 @@
+import {Calendar} from "@nextui-org/react";
+import {parseDate} from "@internationalized/date";
+
+export default function App() {
+ return (
+
+
+
+
+ );
+}
diff --git a/apps/docs/content/components/calendar/usage.ts b/apps/docs/content/components/calendar/usage.ts
index 0a97b863cd..1118304c37 100644
--- a/apps/docs/content/components/calendar/usage.ts
+++ b/apps/docs/content/components/calendar/usage.ts
@@ -1,14 +1,4 @@
-const App = `import {Calendar} from "@nextui-org/react";
-import {parseDate} from '@internationalized/date';
-
-export default function App() {
- return (
-
-
-
-
- );
-}`;
+import App from "./usage.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/calendar/visible-months.raw.jsx b/apps/docs/content/components/calendar/visible-months.raw.jsx
new file mode 100644
index 0000000000..bf0c6aff77
--- /dev/null
+++ b/apps/docs/content/components/calendar/visible-months.raw.jsx
@@ -0,0 +1,5 @@
+import {Calendar} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/calendar/visible-months.ts b/apps/docs/content/components/calendar/visible-months.ts
index 796fc6d9b8..38c2db8f01 100644
--- a/apps/docs/content/components/calendar/visible-months.ts
+++ b/apps/docs/content/components/calendar/visible-months.ts
@@ -1,13 +1,4 @@
-const App = `import {Calendar} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./visible-months.raw.jsx?raw";
const react = {
"/App.jsx": App,
diff --git a/apps/docs/content/components/calendar/with-month-and-year-picker.raw.jsx b/apps/docs/content/components/calendar/with-month-and-year-picker.raw.jsx
new file mode 100644
index 0000000000..a6a3c56866
--- /dev/null
+++ b/apps/docs/content/components/calendar/with-month-and-year-picker.raw.jsx
@@ -0,0 +1,5 @@
+import {Calendar} from "@nextui-org/react";
+
+export default function App() {
+ return ;
+}
diff --git a/apps/docs/content/components/calendar/with-month-and-year-picker.ts b/apps/docs/content/components/calendar/with-month-and-year-picker.ts
index 1774984501..53df2d1367 100644
--- a/apps/docs/content/components/calendar/with-month-and-year-picker.ts
+++ b/apps/docs/content/components/calendar/with-month-and-year-picker.ts
@@ -1,13 +1,4 @@
-const App = `import {Calendar} from "@nextui-org/react";
-
-export default function App() {
- return (
-
- );
-}`;
+import App from "./with-month-and-year-picker.raw.jsx?raw";
const react = {
"/App.jsx": App,