@mijn-ui/react-calendar 0.0.3 → 0.0.5
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/dist/index.d.ts +8 -0
- package/dist/index.js +79 -0
- package/dist/metafile-esm.json +1 -0
- package/package.json +5 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { DayPicker } from 'react-day-picker';
|
|
4
|
+
|
|
5
|
+
type CalendarProps = React.ComponentProps<typeof DayPicker>;
|
|
6
|
+
declare const Calendar: ({ className, classNames, showOutsideDays, ...props }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { Calendar, type CalendarProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
// src/calendar.tsx
|
|
4
|
+
import { buttonStyles } from "@mijn-ui/react-button";
|
|
5
|
+
import { cn } from "@mijn-ui/react-utilities/shared";
|
|
6
|
+
import { DayFlag, DayPicker, SelectionState, UI } from "react-day-picker";
|
|
7
|
+
import {
|
|
8
|
+
LuChevronDown,
|
|
9
|
+
LuChevronLeft,
|
|
10
|
+
LuChevronRight,
|
|
11
|
+
LuChevronUp
|
|
12
|
+
} from "react-icons/lu";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var Calendar = ({
|
|
15
|
+
className,
|
|
16
|
+
classNames,
|
|
17
|
+
showOutsideDays = true,
|
|
18
|
+
...props
|
|
19
|
+
}) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
DayPicker,
|
|
22
|
+
{
|
|
23
|
+
showOutsideDays,
|
|
24
|
+
className: cn("border-main-border bg-surface p-3", className),
|
|
25
|
+
classNames: {
|
|
26
|
+
[UI.Months]: "relative flex flex-col sm:flex-row",
|
|
27
|
+
[UI.Month]: "space-y-0",
|
|
28
|
+
[UI.MonthCaption]: "flex justify-center py-2 relative items-center",
|
|
29
|
+
[UI.CaptionLabel]: "text-sm font-medium",
|
|
30
|
+
[UI.PreviousMonthButton]: cn(
|
|
31
|
+
buttonStyles({ color: "neutral", variant: "outline" }),
|
|
32
|
+
"absolute left-1 top-0 z-10 size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
33
|
+
),
|
|
34
|
+
[UI.NextMonthButton]: cn(
|
|
35
|
+
buttonStyles({ color: "neutral", variant: "outline" }),
|
|
36
|
+
"absolute right-1 top-0 z-10 size-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
37
|
+
),
|
|
38
|
+
[UI.MonthGrid]: "w-full border-collapse space-y-1",
|
|
39
|
+
[UI.Weekdays]: "flex",
|
|
40
|
+
[UI.Weekday]: "text-neutral-text w-9 font-normal text-[0.8rem] h-9 flex items-center justify-center",
|
|
41
|
+
[UI.Week]: "flex w-full mt-0.5",
|
|
42
|
+
[UI.Day]: cn(
|
|
43
|
+
buttonStyles({ variant: "text", color: "accent" }),
|
|
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-neutral-text opacity-50 aria-selected:bg-accent/50 aria-selected:text-neutral-text aria-selected:opacity-30",
|
|
52
|
+
[DayFlag.disabled]: "text-neutral-text opacity-50",
|
|
53
|
+
[DayFlag.hidden]: "invisible",
|
|
54
|
+
...classNames
|
|
55
|
+
},
|
|
56
|
+
components: {
|
|
57
|
+
Chevron: ({ ...props2 }) => /* @__PURE__ */ jsx(Chevron, { ...props2 })
|
|
58
|
+
},
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
var Chevron = ({ orientation = "left" }) => {
|
|
64
|
+
switch (orientation) {
|
|
65
|
+
case "left":
|
|
66
|
+
return /* @__PURE__ */ jsx(LuChevronLeft, { className: "size-4" });
|
|
67
|
+
case "right":
|
|
68
|
+
return /* @__PURE__ */ jsx(LuChevronRight, { className: "size-4" });
|
|
69
|
+
case "up":
|
|
70
|
+
return /* @__PURE__ */ jsx(LuChevronUp, { className: "size-4" });
|
|
71
|
+
case "down":
|
|
72
|
+
return /* @__PURE__ */ jsx(LuChevronDown, { className: "size-4" });
|
|
73
|
+
default:
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
Calendar
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/calendar.tsx":{"bytes":3218,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-button","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":"react-icons/lu","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-button","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":"react-icons/lu","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":3193},"src/index.ts":{"bytesInOutput":0}},"bytes":3236}}}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
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.5",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"sideEffects": false,
|
|
9
9
|
"files": [
|
|
10
|
-
"dist
|
|
10
|
+
"dist"
|
|
11
11
|
],
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "git+https://github.com/mijn-ui/mijn-ui-react.git",
|
|
15
|
-
"directory": "packages/components/
|
|
15
|
+
"directory": "packages/components/calendar"
|
|
16
16
|
},
|
|
17
17
|
"bugs": {
|
|
18
18
|
"url": "https://github.com/mijn-ui/mijn-ui-react/issues"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"react-dom": "19.0.0-rc-b01722d5-20241114",
|
|
32
32
|
"react-day-picker": "^9.3.0",
|
|
33
33
|
"react-icons": "^5.3.0",
|
|
34
|
-
"@mijn-ui/react-utilities": "0.0.
|
|
35
|
-
"@mijn-ui/react-button": "0.0.
|
|
34
|
+
"@mijn-ui/react-utilities": "0.0.4",
|
|
35
|
+
"@mijn-ui/react-button": "0.0.5"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "19.0.0-rc-b01722d5-20241114",
|