@mijn-ui/react-calendar 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +25 -31
- package/dist/metafile-esm.json +1 -1
- package/package.json +9 -4
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @mijn-ui/react-calendar
|
|
2
|
+
|
|
3
|
+
A date field component that allows users to enter and edit date.
|
|
4
|
+
|
|
5
|
+
[Documentation](https://mijn-ui.vercel.app/docs/components/calendar)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @mijn-ui/react-calendar
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## License
|
|
14
|
+
|
|
15
|
+
This project is licensed under the terms of the [MIT license.](https://github.com/mijn-ui/mijn-ui-react/blob/main/LICENSE)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { UnstyledProps } from '@mijn-ui/react-utilities/shared';
|
|
3
4
|
import { DayPicker } from 'react-day-picker';
|
|
4
5
|
|
|
5
|
-
type CalendarProps = React.ComponentProps<typeof DayPicker
|
|
6
|
-
declare const Calendar: ({ className, classNames, showOutsideDays, ...props }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
6
|
+
type CalendarProps = React.ComponentProps<typeof DayPicker> & UnstyledProps;
|
|
7
|
+
declare const Calendar: ({ unstyled, className, classNames, showOutsideDays, ...props }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
7
8
|
|
|
8
9
|
export { Calendar, type CalendarProps };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
// src/calendar.tsx
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
createTVUnstyledSlots
|
|
6
|
+
} from "@mijn-ui/react-utilities/shared";
|
|
6
7
|
import { DayFlag, DayPicker, SelectionState, UI } from "react-day-picker";
|
|
7
8
|
import {
|
|
8
9
|
ChevronDownIcon,
|
|
@@ -10,47 +11,40 @@ import {
|
|
|
10
11
|
ChevronRightIcon,
|
|
11
12
|
ChevronUpIcon
|
|
12
13
|
} from "@mijn-ui/shared-icons";
|
|
14
|
+
import { calendarStyles } from "@mijn-ui/react-theme";
|
|
13
15
|
import { jsx } from "react/jsx-runtime";
|
|
14
16
|
var Calendar = ({
|
|
17
|
+
unstyled,
|
|
15
18
|
className,
|
|
16
19
|
classNames,
|
|
17
20
|
showOutsideDays = true,
|
|
18
21
|
...props
|
|
19
22
|
}) => {
|
|
23
|
+
const styles = createTVUnstyledSlots(calendarStyles(), unstyled);
|
|
20
24
|
return /* @__PURE__ */ jsx(
|
|
21
25
|
DayPicker,
|
|
22
26
|
{
|
|
23
27
|
showOutsideDays,
|
|
24
|
-
className:
|
|
28
|
+
className: styles.base({ className }),
|
|
25
29
|
classNames: {
|
|
26
|
-
[UI.Months]:
|
|
27
|
-
[UI.Month]:
|
|
28
|
-
[UI.MonthCaption]:
|
|
29
|
-
[UI.
|
|
30
|
-
[UI.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
),
|
|
34
|
-
[UI.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
),
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
|
|
44
|
-
"size-9 p-0 font-normal aria-selected:opacity-100"
|
|
45
|
-
),
|
|
46
|
-
[UI.DayButton]: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
|
47
|
-
[SelectionState.range_end]: "day-range-end",
|
|
48
|
-
[SelectionState.selected]: "bg-primary text-primary-text hover:bg-primary hover:text-primary-text focus:bg-primary focus:text-primary-text",
|
|
49
|
-
[SelectionState.range_middle]: "aria-selected:bg-accent/75 aria-selected:text-accent-text",
|
|
50
|
-
[DayFlag.today]: "bg-accent text-accent-text",
|
|
51
|
-
[DayFlag.outside]: "day-outside text-muted-text opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-text aria-selected:opacity-30",
|
|
52
|
-
[DayFlag.disabled]: "text-muted-text opacity-50",
|
|
53
|
-
[DayFlag.hidden]: "invisible",
|
|
30
|
+
[UI.Months]: styles.months(),
|
|
31
|
+
[UI.Month]: styles.month(),
|
|
32
|
+
[UI.MonthCaption]: styles.month_caption(),
|
|
33
|
+
[UI.PreviousMonthButton]: styles.button_previous(),
|
|
34
|
+
[UI.NextMonthButton]: styles.button_next(),
|
|
35
|
+
[UI.MonthGrid]: styles.month_grid(),
|
|
36
|
+
[UI.Weekdays]: styles.weekdays(),
|
|
37
|
+
[UI.Weekday]: styles.weekday(),
|
|
38
|
+
[UI.Week]: styles.week(),
|
|
39
|
+
[UI.Day]: styles.day(),
|
|
40
|
+
[UI.DayButton]: styles.day_button(),
|
|
41
|
+
[SelectionState.range_end]: styles.range_end(),
|
|
42
|
+
[SelectionState.selected]: styles.selected(),
|
|
43
|
+
[SelectionState.range_middle]: styles.range_middle(),
|
|
44
|
+
[DayFlag.today]: styles.today(),
|
|
45
|
+
[DayFlag.outside]: styles.outside(),
|
|
46
|
+
[DayFlag.disabled]: styles.disabled(),
|
|
47
|
+
[DayFlag.hidden]: styles.hidden(),
|
|
54
48
|
...classNames
|
|
55
49
|
},
|
|
56
50
|
components: {
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/calendar.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/calendar.tsx":{"bytes":2150,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"react-day-picker","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":27,"imports":[{"path":"src/calendar.tsx","kind":"import-statement","original":"./calendar"}],"format":"esm"}},"outputs":{"dist/index.js":{"imports":[{"path":"@mijn-ui/react-utilities/shared","kind":"import-statement","external":true},{"path":"react-day-picker","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"@mijn-ui/react-theme","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Calendar"],"entryPoint":"src/index.ts","inputs":{"src/calendar.tsx":{"bytesInOutput":2142},"src/index.ts":{"bytesInOutput":0}},"bytes":2185}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mijn-ui/react-calendar",
|
|
3
3
|
"author": "Htet Aung Lin<htetaunglin.coder@gmail.com>",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"react": "19.0.0-rc-b01722d5-20241114",
|
|
32
32
|
"react-dom": "19.0.0-rc-b01722d5-20241114",
|
|
33
33
|
"react-day-picker": "^9.3.0",
|
|
34
|
-
"@mijn-ui/react-utilities": "0.0.
|
|
35
|
-
"@mijn-ui/react-
|
|
36
|
-
"@mijn-ui/shared-icons": "0.0.
|
|
34
|
+
"@mijn-ui/react-utilities": "0.0.7",
|
|
35
|
+
"@mijn-ui/react-theme": "0.0.6",
|
|
36
|
+
"@mijn-ui/shared-icons": "0.0.2"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "^19.0",
|
|
@@ -42,6 +42,11 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"calendar",
|
|
47
|
+
"react",
|
|
48
|
+
"nextjs"
|
|
49
|
+
],
|
|
45
50
|
"scripts": {
|
|
46
51
|
"clean": "rimraf dist",
|
|
47
52
|
"build": "tsup",
|