@mijn-ui/react-calendar 0.2.0 → 0.4.0
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 +149 -3
- package/dist/index.js +40 -2
- package/dist/metafile-esm.json +1 -1
- package/package.json +7 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,155 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import { VariantProps } from 'tailwind-variants';
|
|
4
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
2
5
|
import * as React from 'react';
|
|
3
|
-
import { UnstyledProps } from '@mijn-ui/react-theme';
|
|
4
6
|
import { DayPicker } from 'react-day-picker';
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
declare const calendarStyles: tailwind_variants.TVReturnType<{
|
|
9
|
+
[key: string]: {
|
|
10
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
11
|
+
base?: tailwind_merge.ClassNameValue;
|
|
12
|
+
months?: tailwind_merge.ClassNameValue;
|
|
13
|
+
month?: tailwind_merge.ClassNameValue;
|
|
14
|
+
month_caption?: tailwind_merge.ClassNameValue;
|
|
15
|
+
month_grid?: tailwind_merge.ClassNameValue;
|
|
16
|
+
weekdays?: tailwind_merge.ClassNameValue;
|
|
17
|
+
weekday?: tailwind_merge.ClassNameValue;
|
|
18
|
+
weeks?: tailwind_merge.ClassNameValue;
|
|
19
|
+
week?: tailwind_merge.ClassNameValue;
|
|
20
|
+
day_button?: tailwind_merge.ClassNameValue;
|
|
21
|
+
range_end?: tailwind_merge.ClassNameValue;
|
|
22
|
+
selected?: tailwind_merge.ClassNameValue;
|
|
23
|
+
range_middle?: tailwind_merge.ClassNameValue;
|
|
24
|
+
today?: tailwind_merge.ClassNameValue;
|
|
25
|
+
outside?: tailwind_merge.ClassNameValue;
|
|
26
|
+
disabled?: tailwind_merge.ClassNameValue;
|
|
27
|
+
hidden?: tailwind_merge.ClassNameValue;
|
|
28
|
+
button_previous?: tailwind_merge.ClassNameValue;
|
|
29
|
+
button_next?: tailwind_merge.ClassNameValue;
|
|
30
|
+
day?: tailwind_merge.ClassNameValue;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
[x: string]: {
|
|
35
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
36
|
+
base?: tailwind_merge.ClassNameValue;
|
|
37
|
+
months?: tailwind_merge.ClassNameValue;
|
|
38
|
+
month?: tailwind_merge.ClassNameValue;
|
|
39
|
+
month_caption?: tailwind_merge.ClassNameValue;
|
|
40
|
+
month_grid?: tailwind_merge.ClassNameValue;
|
|
41
|
+
weekdays?: tailwind_merge.ClassNameValue;
|
|
42
|
+
weekday?: tailwind_merge.ClassNameValue;
|
|
43
|
+
weeks?: tailwind_merge.ClassNameValue;
|
|
44
|
+
week?: tailwind_merge.ClassNameValue;
|
|
45
|
+
day_button?: tailwind_merge.ClassNameValue;
|
|
46
|
+
range_end?: tailwind_merge.ClassNameValue;
|
|
47
|
+
selected?: tailwind_merge.ClassNameValue;
|
|
48
|
+
range_middle?: tailwind_merge.ClassNameValue;
|
|
49
|
+
today?: tailwind_merge.ClassNameValue;
|
|
50
|
+
outside?: tailwind_merge.ClassNameValue;
|
|
51
|
+
disabled?: tailwind_merge.ClassNameValue;
|
|
52
|
+
hidden?: tailwind_merge.ClassNameValue;
|
|
53
|
+
button_previous?: tailwind_merge.ClassNameValue;
|
|
54
|
+
button_next?: tailwind_merge.ClassNameValue;
|
|
55
|
+
day?: tailwind_merge.ClassNameValue;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
} | {}, {
|
|
59
|
+
base: string;
|
|
60
|
+
months: string;
|
|
61
|
+
month: string;
|
|
62
|
+
month_caption: string;
|
|
63
|
+
button_previous: string[];
|
|
64
|
+
button_next: string[];
|
|
65
|
+
month_grid: string;
|
|
66
|
+
weekdays: string;
|
|
67
|
+
weekday: string;
|
|
68
|
+
weeks: string;
|
|
69
|
+
week: string;
|
|
70
|
+
day: string[];
|
|
71
|
+
day_button: string;
|
|
72
|
+
range_end: string;
|
|
73
|
+
selected: string;
|
|
74
|
+
range_middle: string;
|
|
75
|
+
today: string;
|
|
76
|
+
outside: string;
|
|
77
|
+
disabled: string;
|
|
78
|
+
hidden: string;
|
|
79
|
+
}, undefined, {
|
|
80
|
+
[key: string]: {
|
|
81
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
82
|
+
base?: tailwind_merge.ClassNameValue;
|
|
83
|
+
months?: tailwind_merge.ClassNameValue;
|
|
84
|
+
month?: tailwind_merge.ClassNameValue;
|
|
85
|
+
month_caption?: tailwind_merge.ClassNameValue;
|
|
86
|
+
month_grid?: tailwind_merge.ClassNameValue;
|
|
87
|
+
weekdays?: tailwind_merge.ClassNameValue;
|
|
88
|
+
weekday?: tailwind_merge.ClassNameValue;
|
|
89
|
+
weeks?: tailwind_merge.ClassNameValue;
|
|
90
|
+
week?: tailwind_merge.ClassNameValue;
|
|
91
|
+
day_button?: tailwind_merge.ClassNameValue;
|
|
92
|
+
range_end?: tailwind_merge.ClassNameValue;
|
|
93
|
+
selected?: tailwind_merge.ClassNameValue;
|
|
94
|
+
range_middle?: tailwind_merge.ClassNameValue;
|
|
95
|
+
today?: tailwind_merge.ClassNameValue;
|
|
96
|
+
outside?: tailwind_merge.ClassNameValue;
|
|
97
|
+
disabled?: tailwind_merge.ClassNameValue;
|
|
98
|
+
hidden?: tailwind_merge.ClassNameValue;
|
|
99
|
+
button_previous?: tailwind_merge.ClassNameValue;
|
|
100
|
+
button_next?: tailwind_merge.ClassNameValue;
|
|
101
|
+
day?: tailwind_merge.ClassNameValue;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
} | {}, {
|
|
105
|
+
base: string;
|
|
106
|
+
months: string;
|
|
107
|
+
month: string;
|
|
108
|
+
month_caption: string;
|
|
109
|
+
button_previous: string[];
|
|
110
|
+
button_next: string[];
|
|
111
|
+
month_grid: string;
|
|
112
|
+
weekdays: string;
|
|
113
|
+
weekday: string;
|
|
114
|
+
weeks: string;
|
|
115
|
+
week: string;
|
|
116
|
+
day: string[];
|
|
117
|
+
day_button: string;
|
|
118
|
+
range_end: string;
|
|
119
|
+
selected: string;
|
|
120
|
+
range_middle: string;
|
|
121
|
+
today: string;
|
|
122
|
+
outside: string;
|
|
123
|
+
disabled: string;
|
|
124
|
+
hidden: string;
|
|
125
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
126
|
+
base: string;
|
|
127
|
+
months: string;
|
|
128
|
+
month: string;
|
|
129
|
+
month_caption: string;
|
|
130
|
+
button_previous: string[];
|
|
131
|
+
button_next: string[];
|
|
132
|
+
month_grid: string;
|
|
133
|
+
weekdays: string;
|
|
134
|
+
weekday: string;
|
|
135
|
+
weeks: string;
|
|
136
|
+
week: string;
|
|
137
|
+
day: string[];
|
|
138
|
+
day_button: string;
|
|
139
|
+
range_end: string;
|
|
140
|
+
selected: string;
|
|
141
|
+
range_middle: string;
|
|
142
|
+
today: string;
|
|
143
|
+
outside: string;
|
|
144
|
+
disabled: string;
|
|
145
|
+
hidden: string;
|
|
146
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
147
|
+
type CalendarVariantProps = VariantProps<typeof calendarStyles>;
|
|
148
|
+
type CalendarSlots = keyof ReturnType<typeof calendarStyles>;
|
|
149
|
+
|
|
150
|
+
type CalendarProps = React.ComponentProps<typeof DayPicker> & {
|
|
151
|
+
unstyled?: boolean;
|
|
152
|
+
};
|
|
7
153
|
declare const Calendar: ({ unstyled, className, classNames, showOutsideDays, ...props }: CalendarProps) => react_jsx_runtime.JSX.Element;
|
|
8
154
|
|
|
9
|
-
export { Calendar, type CalendarProps };
|
|
155
|
+
export { Calendar, type CalendarProps, type CalendarSlots, type CalendarVariantProps, calendarStyles };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
// src/calendar.tsx
|
|
4
4
|
import { createTVUnstyledSlots } from "@mijn-ui/react-core";
|
|
5
|
-
import { calendarStyles } from "@mijn-ui/react-theme";
|
|
6
5
|
import {
|
|
7
6
|
ChevronDownIcon,
|
|
8
7
|
ChevronLeftIcon,
|
|
@@ -10,7 +9,45 @@ import {
|
|
|
10
9
|
ChevronUpIcon
|
|
11
10
|
} from "@mijn-ui/shared-icons";
|
|
12
11
|
import { DayFlag, DayPicker, SelectionState, UI } from "react-day-picker";
|
|
12
|
+
import { tv } from "tailwind-variants";
|
|
13
13
|
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var calendarStyles = tv({
|
|
15
|
+
slots: {
|
|
16
|
+
base: "border-outline-default bg-bg-default p-4",
|
|
17
|
+
months: "relative flex flex-col sm:flex-row",
|
|
18
|
+
month: "space-y-1.5",
|
|
19
|
+
month_caption: "relative flex h-8 items-center justify-center font-normal",
|
|
20
|
+
button_previous: [
|
|
21
|
+
"inline-flex items-center justify-center text-sm font-medium outline-none duration-300 ease-in-out focus-visible:ring-2 focus-visible:ring-offset-bg-default focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 size-8 gap-0 px-0 rounded-md",
|
|
22
|
+
"bg-bg-default-alt text-fg-default hover:bg-bg-secondary focus-visible:ring-outline-brand active:bg-bg-secondary/70 shadow-xs border focus-visible:ring-offset-2",
|
|
23
|
+
"absolute left-1 top-0 z-10"
|
|
24
|
+
],
|
|
25
|
+
button_next: [
|
|
26
|
+
"inline-flex items-center justify-center text-sm font-medium outline-none duration-300 ease-in-out focus-visible:ring-2 focus-visible:ring-offset-bg-default focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 size-8 gap-0 px-0 rounded-md",
|
|
27
|
+
"bg-bg-default-alt text-fg-default hover:bg-bg-secondary focus-visible:ring-outline-brand active:bg-bg-secondary/70 shadow-xs border focus-visible:ring-offset-2",
|
|
28
|
+
"border-outline-default absolute right-1 top-0 z-10"
|
|
29
|
+
],
|
|
30
|
+
month_grid: "w-full border-collapse",
|
|
31
|
+
weekdays: "flex",
|
|
32
|
+
weekday: "text-fg-tertiary mb-1.5 flex size-8 items-center justify-center text-[0.8rem] font-normal",
|
|
33
|
+
weeks: "space-y-1.5",
|
|
34
|
+
week: "flex w-full",
|
|
35
|
+
day: [
|
|
36
|
+
"inline-flex items-center justify-center gap-0.5 text-sm font-medium outline-none duration-300 ease-in-out focus-visible:ring-2 focus-visible:ring-offset-bg-default focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
37
|
+
"text-fg-default hover:bg-bg-secondary focus-visible:ring-outline-brand active:bg-bg-secondary/70 focus-visible:ring-offset-2",
|
|
38
|
+
"h-8 rounded-md px-3",
|
|
39
|
+
"p-0 font-normal aria-selected:opacity-100"
|
|
40
|
+
],
|
|
41
|
+
day_button: "[&:has([aria-selected].day-outside)]:bg-bg-brand/50 [&:has([aria-selected])]:bg-bg-brand relative size-8 p-0 text-center text-sm outline-none focus-within:relative focus-within:z-20 first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md [&:has([aria-selected].day-range-end)]:rounded-r-md",
|
|
42
|
+
range_end: "day-range-end",
|
|
43
|
+
selected: "bg-bg-brand! text-on-bg-brand! hover:bg-bg-brand! hover:text-on-bg-brand! focus:!bg-bg-brandfocus:!text-on-bg-brand",
|
|
44
|
+
range_middle: "aria-selected:bg-bg-secondary/75 aria-selected:text-fg-secondary",
|
|
45
|
+
today: "bg-bg-secondary text-fg-secondary aria-selected:bg-bg-brand aria-selected:text-on-bg-brand",
|
|
46
|
+
outside: "day-outside text-fg-secondary aria-selected:bg-bg-secondary/50 aria-selected:text-fg-tertiary opacity-50 aria-selected:opacity-30",
|
|
47
|
+
disabled: "text-fg-tertiary opacity-50",
|
|
48
|
+
hidden: "invisible"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
14
51
|
var Calendar = ({
|
|
15
52
|
unstyled,
|
|
16
53
|
className,
|
|
@@ -68,5 +105,6 @@ var Chevron = ({ orientation = "left" }) => {
|
|
|
68
105
|
}
|
|
69
106
|
};
|
|
70
107
|
export {
|
|
71
|
-
Calendar
|
|
108
|
+
Calendar,
|
|
109
|
+
calendarStyles
|
|
72
110
|
};
|
package/dist/metafile-esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/calendar.tsx":{"bytes":
|
|
1
|
+
{"inputs":{"src/calendar.tsx":{"bytes":5352,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@mijn-ui/react-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"react-day-picker","kind":"import-statement","external":true},{"path":"tailwind-variants","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-core","kind":"import-statement","external":true},{"path":"@mijn-ui/shared-icons","kind":"import-statement","external":true},{"path":"react-day-picker","kind":"import-statement","external":true},{"path":"tailwind-variants","kind":"import-statement","external":true},{"path":"react/jsx-runtime","kind":"import-statement","external":true}],"exports":["Calendar","calendarStyles"],"entryPoint":"src/index.ts","inputs":{"src/calendar.tsx":{"bytesInOutput":5048},"src/index.ts":{"bytesInOutput":0}},"bytes":5124}}}
|
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.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"homepage": "https://mijn-ui.vercel.app",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
@@ -25,23 +25,22 @@
|
|
|
25
25
|
"@next/eslint-plugin-next": "^15.0.3",
|
|
26
26
|
"@types/react": "^19.0.0",
|
|
27
27
|
"@types/react-dom": "^19.0.0",
|
|
28
|
-
"@mijn-ui/react-badge": "0.
|
|
29
|
-
"@mijn-ui/react-core": "0.
|
|
30
|
-
"@mijn-ui/react-theme": "0.2.0",
|
|
28
|
+
"@mijn-ui/react-badge": "0.4.0",
|
|
29
|
+
"@mijn-ui/react-core": "0.4.0",
|
|
31
30
|
"eslint-config-custom": "0.0.1",
|
|
32
31
|
"tsconfig": "0.0.0",
|
|
33
32
|
"tsup-config": "0.0.0"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"react-day-picker": "^9.3.0",
|
|
37
|
-
"@mijn-ui/shared-icons": "0.1.0"
|
|
38
|
-
"@mijn-ui/react-utilities": "0.0.9"
|
|
36
|
+
"@mijn-ui/shared-icons": "0.1.0"
|
|
39
37
|
},
|
|
40
38
|
"peerDependencies": {
|
|
41
39
|
"react": "^19.0",
|
|
42
40
|
"react-dom": "^19.0",
|
|
43
|
-
"@mijn-ui/react-
|
|
44
|
-
"
|
|
41
|
+
"@mijn-ui/react-core": "^0.4.0",
|
|
42
|
+
"tailwind-merge": "^3.0.0",
|
|
43
|
+
"tailwind-variants": "^3.0.0"
|
|
45
44
|
},
|
|
46
45
|
"publishConfig": {
|
|
47
46
|
"access": "public"
|