mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
feat(calendar): initial structure
This commit is contained in:
parent
f2205642f4
commit
139b28437b
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
24
packages/components/calendar/README.md
Normal file
24
packages/components/calendar/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# @nextui-org/calendar
|
||||
|
||||
A calendar displays one or more date grids and allows users to select a single date.
|
||||
|
||||
Please refer to the [documentation](https://nextui.org/docs/components/calendar) for more information.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
yarn add @nextui-org/calendar
|
||||
# or
|
||||
npm i @nextui-org/calendar
|
||||
```
|
||||
|
||||
## Contribution
|
||||
|
||||
Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
19
packages/components/calendar/__tests__/calendar.test.tsx
Normal file
19
packages/components/calendar/__tests__/calendar.test.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import * as React from "react";
|
||||
import {render} from "@testing-library/react";
|
||||
|
||||
import {Calendar} from "../src";
|
||||
|
||||
describe("Calendar", () => {
|
||||
it("should render correctly", () => {
|
||||
const wrapper = render(<Calendar />);
|
||||
|
||||
expect(() => wrapper.unmount()).not.toThrow();
|
||||
});
|
||||
|
||||
it("ref should be forwarded", () => {
|
||||
const ref = React.createRef<HTMLDivElement>();
|
||||
|
||||
render(<Calendar ref={ref} />);
|
||||
expect(ref.current).not.toBeNull();
|
||||
});
|
||||
});
|
||||
61
packages/components/calendar/package.json
Normal file
61
packages/components/calendar/package.json
Normal file
@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "@nextui-org/calendar",
|
||||
"version": "2.0.0",
|
||||
"description": "A calendar displays one or more date grids and allows users to select a single date.",
|
||||
"keywords": [
|
||||
"calendar"
|
||||
],
|
||||
"author": "Junior Garcia <jrgarciadev@gmail.com>",
|
||||
"homepage": "https://nextui.org",
|
||||
"license": "MIT",
|
||||
"main": "src/index.ts",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nextui-org/nextui.git",
|
||||
"directory": "packages/components/calendar"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/nextui-org/nextui/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup src --dts",
|
||||
"build:fast": "tsup src",
|
||||
"dev": "pnpm build:fast --watch",
|
||||
"clean": "rimraf dist .turbo",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"prepack": "clean-package",
|
||||
"postpack": "clean-package restore"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nextui-org/system": ">=2.0.0",
|
||||
"@nextui-org/theme": ">=2.0.0",
|
||||
"react": ">=18",
|
||||
"react-dom": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@internationalized/date": "^3.5.2",
|
||||
"@nextui-org/react-utils": "workspace:*",
|
||||
"@nextui-org/shared-utils": "workspace:*",
|
||||
"@react-aria/calendar": "^3.5.6",
|
||||
"@react-aria/focus": "^3.14.3",
|
||||
"@react-aria/i18n": "^3.8.4",
|
||||
"@react-stately/calendar": "^3.4.4",
|
||||
"@react-types/calendar": "^3.4.4",
|
||||
"@react-types/shared": "^3.19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nextui-org/system": "workspace:*",
|
||||
"@nextui-org/theme": "workspace:*",
|
||||
"clean-package": "2.2.0",
|
||||
"react": "^18.0.0",
|
||||
"react-dom": "^18.0.0"
|
||||
},
|
||||
"clean-package": "../../../clean-package.config.json"
|
||||
}
|
||||
28
packages/components/calendar/src/calendar.tsx
Normal file
28
packages/components/calendar/src/calendar.tsx
Normal file
@ -0,0 +1,28 @@
|
||||
import type {DateValue} from "@react-types/calendar";
|
||||
import type {ForwardedRef, ReactElement, Ref} from "react";
|
||||
|
||||
import {forwardRef} from "@nextui-org/system";
|
||||
|
||||
import {UseCalendarProps, useCalendar} from "./use-calendar";
|
||||
|
||||
interface Props<T extends DateValue> extends UseCalendarProps<T> {}
|
||||
|
||||
function Calendar<T extends DateValue>(props: Props<T>, ref: ForwardedRef<HTMLDivElement>) {
|
||||
const {Component, domRef, children, styles, ...otherProps} = useCalendar({...props, ref});
|
||||
|
||||
return (
|
||||
<Component ref={domRef} className={styles} {...otherProps}>
|
||||
{/* TODO: CalendarBase */}
|
||||
{children}
|
||||
</Component>
|
||||
);
|
||||
}
|
||||
|
||||
Calendar.displayName = "NextUI.Calendar";
|
||||
|
||||
export type CalendarProps<T extends DateValue> = Props<T> & {ref?: Ref<HTMLElement>};
|
||||
|
||||
// forwardRef doesn't support generic parameters, so cast the result to the correct type
|
||||
export default forwardRef(Calendar) as <T extends DateValue>(
|
||||
props: CalendarProps<T>,
|
||||
) => ReactElement;
|
||||
10
packages/components/calendar/src/index.ts
Normal file
10
packages/components/calendar/src/index.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import Calendar from "./calendar";
|
||||
|
||||
// export types
|
||||
export type {CalendarProps} from "./calendar";
|
||||
|
||||
// export hooks
|
||||
export {useCalendar} from "./use-calendar";
|
||||
|
||||
// export component
|
||||
export {Calendar};
|
||||
148
packages/components/calendar/src/use-calendar.ts
Normal file
148
packages/components/calendar/src/use-calendar.ts
Normal file
@ -0,0 +1,148 @@
|
||||
import type {CalendarVariantProps} from "@nextui-org/theme";
|
||||
import type {DateValue, AriaCalendarProps} from "@react-types/calendar";
|
||||
import type {CalendarSlots, SlotsToClasses} from "@nextui-org/theme";
|
||||
import type {HTMLNextUIProps, PropGetter} from "@nextui-org/system";
|
||||
|
||||
import {mapPropsVariants} from "@nextui-org/system";
|
||||
import {useMemo} from "react";
|
||||
import {calendar} from "@nextui-org/theme";
|
||||
import {ReactRef, useDOMRef, filterDOMProps} from "@nextui-org/react-utils";
|
||||
import {useLocale} from "@react-aria/i18n";
|
||||
import {useCalendar as useAriaCalendar} from "@react-aria/calendar";
|
||||
import {useCalendarState} from "@react-stately/calendar";
|
||||
import {createCalendar} from "@internationalized/date";
|
||||
import {clsx} from "@nextui-org/shared-utils";
|
||||
|
||||
interface Props extends HTMLNextUIProps<"div"> {
|
||||
/**
|
||||
* Ref to the DOM node.
|
||||
*/
|
||||
ref?: ReactRef<HTMLElement | null>;
|
||||
/**
|
||||
* The number of months to display at once. Up to 3 months are supported.
|
||||
* @default 1
|
||||
*/
|
||||
visibleMonths?: number;
|
||||
/**
|
||||
* Classname or List of classes to change the classNames of the element.
|
||||
* if `className` is passed, it will be added to the base slot.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* <Calendar classNames={{
|
||||
* base:"base-classes",
|
||||
* // TODO: Add the rest of the classes
|
||||
* }} />
|
||||
* ```
|
||||
*/
|
||||
classNames?: SlotsToClasses<CalendarSlots>;
|
||||
}
|
||||
|
||||
export type UseCalendarProps<T extends DateValue> = Props &
|
||||
CalendarVariantProps &
|
||||
AriaCalendarProps<T>;
|
||||
|
||||
export function useCalendar<T extends DateValue>(originalProps: UseCalendarProps<T>) {
|
||||
const [props, variantProps] = mapPropsVariants(originalProps, calendar.variantKeys);
|
||||
|
||||
const {
|
||||
ref,
|
||||
as,
|
||||
children,
|
||||
className,
|
||||
visibleMonths: visibleMonthsProp = 1,
|
||||
classNames,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
const visibleMonths = Math.max(visibleMonthsProp, 1);
|
||||
const Component = as || "div";
|
||||
|
||||
const visibleDuration = useMemo(() => ({months: visibleMonths}), [visibleMonths]);
|
||||
const shouldFilterDOMProps = typeof Component === "string";
|
||||
|
||||
const domRef = useDOMRef(ref);
|
||||
|
||||
const {locale} = useLocale();
|
||||
|
||||
const state = useCalendarState({
|
||||
...otherProps,
|
||||
locale,
|
||||
visibleDuration,
|
||||
createCalendar,
|
||||
});
|
||||
|
||||
const {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps} = useAriaCalendar(
|
||||
originalProps,
|
||||
state,
|
||||
);
|
||||
|
||||
const styles = useMemo(
|
||||
() =>
|
||||
calendar({
|
||||
...variantProps,
|
||||
className,
|
||||
}),
|
||||
[...Object.values(variantProps), className],
|
||||
);
|
||||
|
||||
const slots = useMemo(() => calendar({className}), [className]);
|
||||
|
||||
const baseStyles = clsx(classNames?.base, className);
|
||||
|
||||
const getBaseProps: PropGetter = (props = {}) => {
|
||||
return {
|
||||
ref: domRef,
|
||||
"data-slot": "base",
|
||||
className: slots.base({class: baseStyles}),
|
||||
...calendarProps,
|
||||
...filterDOMProps(otherProps, {
|
||||
enabled: shouldFilterDOMProps,
|
||||
}),
|
||||
...props,
|
||||
};
|
||||
};
|
||||
|
||||
const getPrevButtonProps: PropGetter = (props = {}) => {
|
||||
return {
|
||||
"data-slot": "prev-button",
|
||||
className: slots.prevButton({class: classNames?.prevButton}),
|
||||
...prevButtonProps,
|
||||
...props,
|
||||
};
|
||||
};
|
||||
|
||||
const getNextButtonProps: PropGetter = (props = {}) => {
|
||||
return {
|
||||
"data-slot": "next-button",
|
||||
className: slots.nextButton({class: classNames?.nextButton}),
|
||||
...nextButtonProps,
|
||||
...props,
|
||||
};
|
||||
};
|
||||
|
||||
const getErrorMessageProps: PropGetter = (props = {}) => {
|
||||
return {
|
||||
"data-slot": "error-message",
|
||||
className: slots.errorMessage({class: classNames?.errorMessage}),
|
||||
...errorMessageProps,
|
||||
...props,
|
||||
};
|
||||
};
|
||||
|
||||
return {
|
||||
Component,
|
||||
children,
|
||||
styles,
|
||||
domRef,
|
||||
state,
|
||||
slots,
|
||||
classNames,
|
||||
getBaseProps,
|
||||
getPrevButtonProps,
|
||||
getNextButtonProps,
|
||||
getErrorMessageProps,
|
||||
};
|
||||
}
|
||||
|
||||
export type UseCalendarReturn = ReturnType<typeof useCalendar>;
|
||||
42
packages/components/calendar/stories/calendar.stories.tsx
Normal file
42
packages/components/calendar/stories/calendar.stories.tsx
Normal file
@ -0,0 +1,42 @@
|
||||
import React from "react";
|
||||
import {Meta} from "@storybook/react";
|
||||
import {calendar} from "@nextui-org/theme";
|
||||
|
||||
import {Calendar, CalendarProps} from "../src";
|
||||
|
||||
export default {
|
||||
title: "Components/Calendar",
|
||||
component: Calendar,
|
||||
argTypes: {
|
||||
color: {
|
||||
control: {type: "select"},
|
||||
options: ["default", "primary", "secondary", "success", "warning", "danger"],
|
||||
},
|
||||
radius: {
|
||||
control: {type: "select"},
|
||||
options: ["none", "sm", "md", "lg", "full"],
|
||||
},
|
||||
size: {
|
||||
control: {type: "select"},
|
||||
options: ["sm", "md", "lg"],
|
||||
},
|
||||
isDisabled: {
|
||||
control: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
},
|
||||
} as Meta<typeof Calendar>;
|
||||
|
||||
const defaultProps = {
|
||||
...calendar.defaultVariants,
|
||||
};
|
||||
|
||||
const Template = (args: CalendarProps) => <Calendar {...args} />;
|
||||
|
||||
export const Default = {
|
||||
render: Template,
|
||||
args: {
|
||||
...defaultProps,
|
||||
},
|
||||
};
|
||||
10
packages/components/calendar/tsconfig.json
Normal file
10
packages/components/calendar/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"tailwind-variants": ["../../../node_modules/tailwind-variants"]
|
||||
},
|
||||
},
|
||||
"include": ["src", "index.ts"]
|
||||
}
|
||||
8
packages/components/calendar/tsup.config.ts
Normal file
8
packages/components/calendar/tsup.config.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import {defineConfig} from "tsup";
|
||||
|
||||
export default defineConfig({
|
||||
clean: true,
|
||||
target: "es2019",
|
||||
format: ["cjs", "esm"],
|
||||
banner: {js: '"use client";'},
|
||||
});
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -20,7 +20,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -80,5 +80,3 @@ export type ListboxProps<T = object> = Props<T> & {ref?: Ref<HTMLElement>};
|
||||
|
||||
// forwardRef doesn't support generic parameters, so cast the result to the correct type
|
||||
export default forwardRef(Listbox) as <T = object>(props: ListboxProps<T>) => ReactElement;
|
||||
|
||||
Listbox.displayName = "NextUI.Listbox";
|
||||
|
||||
@ -129,7 +129,7 @@ export function useListbox<T extends object>(props: UseListboxProps<T>) {
|
||||
|
||||
const {listBoxProps} = useAriaListbox({...props, onAction}, state, domRef);
|
||||
|
||||
const slots = useMemo(() => listbox({className}), [, className]);
|
||||
const slots = useMemo(() => listbox({className}), [className]);
|
||||
|
||||
const baseStyles = clsx(classNames?.base, className);
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
24
packages/core/theme/src/components/calendar.ts
Normal file
24
packages/core/theme/src/components/calendar.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import type {VariantProps} from "tailwind-variants";
|
||||
|
||||
import {tv} from "../utils/tv";
|
||||
|
||||
const calendar = tv({
|
||||
slots: {
|
||||
base: [],
|
||||
prevButton: [],
|
||||
nextButton: [],
|
||||
grid: [],
|
||||
gridHeader: [],
|
||||
gridHeaderCell: [],
|
||||
gridBody: [],
|
||||
cell: [],
|
||||
errorMessage: [],
|
||||
},
|
||||
variants: {},
|
||||
defaultVariants: {},
|
||||
});
|
||||
|
||||
export type CalendarVariantProps = VariantProps<typeof calendar>;
|
||||
export type CalendarSlots = keyof ReturnType<typeof calendar>;
|
||||
|
||||
export {calendar};
|
||||
@ -35,3 +35,4 @@ export * from "./scroll-shadow";
|
||||
export * from "./slider";
|
||||
export * from "./breadcrumbs";
|
||||
export * from "./autocomplete";
|
||||
export * from "./calendar";
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
# @nextui-org/{{packageName}}
|
||||
|
||||
A Quick description of the component
|
||||
{{description}}
|
||||
|
||||
> This is an internal utility, not intended for public usage.
|
||||
Please refer to the [documentation](https://nextui.org/docs/components/{{packageName}}) for more information.
|
||||
|
||||
## Installation
|
||||
|
||||
@ -18,7 +18,7 @@ Yes please! See the
|
||||
[contributing guidelines](https://github.com/nextui-org/nextui/blob/master/CONTRIBUTING.md)
|
||||
for details.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
This project is licensed under the terms of the
|
||||
[MIT license](https://github.com/nextui-org/nextui/blob/master/LICENSE).
|
||||
|
||||
862
pnpm-lock.yaml
generated
862
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user