@sytechui/calendar 2.2.32
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/LICENSE +21 -0
- package/README.md +24 -0
- package/dist/calendar-base.d.mts +23 -0
- package/dist/calendar-base.d.ts +23 -0
- package/dist/calendar-base.js +604 -0
- package/dist/calendar-base.mjs +17 -0
- package/dist/calendar-cell.d.mts +18 -0
- package/dist/calendar-cell.d.ts +18 -0
- package/dist/calendar-cell.js +97 -0
- package/dist/calendar-cell.mjs +7 -0
- package/dist/calendar-context.d.mts +19 -0
- package/dist/calendar-context.d.ts +19 -0
- package/dist/calendar-context.js +38 -0
- package/dist/calendar-context.mjs +9 -0
- package/dist/calendar-header.d.mts +14 -0
- package/dist/calendar-header.d.ts +14 -0
- package/dist/calendar-header.js +156 -0
- package/dist/calendar-header.mjs +10 -0
- package/dist/calendar-month.d.mts +13 -0
- package/dist/calendar-month.d.ts +13 -0
- package/dist/calendar-month.js +226 -0
- package/dist/calendar-month.mjs +10 -0
- package/dist/calendar-picker.d.mts +12 -0
- package/dist/calendar-picker.d.ts +12 -0
- package/dist/calendar-picker.js +83 -0
- package/dist/calendar-picker.mjs +9 -0
- package/dist/calendar-transitions.d.mts +10 -0
- package/dist/calendar-transitions.d.ts +10 -0
- package/dist/calendar-transitions.js +48 -0
- package/dist/calendar-transitions.mjs +9 -0
- package/dist/calendar.d.mts +24 -0
- package/dist/calendar.d.ts +24 -0
- package/dist/calendar.js +876 -0
- package/dist/calendar.mjs +20 -0
- package/dist/chevron-down.d.mts +6 -0
- package/dist/chevron-down.d.ts +6 -0
- package/dist/chevron-down.js +54 -0
- package/dist/chevron-down.mjs +7 -0
- package/dist/chevron-left.d.mts +6 -0
- package/dist/chevron-left.d.ts +6 -0
- package/dist/chevron-left.js +54 -0
- package/dist/chevron-left.mjs +7 -0
- package/dist/chevron-right.d.mts +6 -0
- package/dist/chevron-right.d.ts +6 -0
- package/dist/chevron-right.js +54 -0
- package/dist/chevron-right.mjs +7 -0
- package/dist/chunk-5CY7DCRB.mjs +24 -0
- package/dist/chunk-AJXW2JXW.mjs +23 -0
- package/dist/chunk-BEC3B3UO.mjs +23 -0
- package/dist/chunk-CPBF6DM2.mjs +120 -0
- package/dist/chunk-DN6I5LXB.mjs +125 -0
- package/dist/chunk-H34OUI62.mjs +157 -0
- package/dist/chunk-HUKPVIZ5.mjs +31 -0
- package/dist/chunk-IDU5RSFL.mjs +93 -0
- package/dist/chunk-IFK7FCNU.mjs +42 -0
- package/dist/chunk-JJRY4BYN.mjs +31 -0
- package/dist/chunk-JQFIYCMS.mjs +19 -0
- package/dist/chunk-MCZLP73P.mjs +14 -0
- package/dist/chunk-MDGP3JHC.mjs +74 -0
- package/dist/chunk-MUYVZHWM.mjs +31 -0
- package/dist/chunk-OEB7VI2R.mjs +125 -0
- package/dist/chunk-ZJZG3P2K.mjs +181 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +1020 -0
- package/dist/index.mjs +36 -0
- package/dist/range-calendar.d.mts +24 -0
- package/dist/range-calendar.d.ts +24 -0
- package/dist/range-calendar.js +876 -0
- package/dist/range-calendar.mjs +20 -0
- package/dist/use-calendar-base.d.mts +1224 -0
- package/dist/use-calendar-base.d.ts +1224 -0
- package/dist/use-calendar-base.js +174 -0
- package/dist/use-calendar-base.mjs +7 -0
- package/dist/use-calendar-picker.d.mts +482 -0
- package/dist/use-calendar-picker.d.ts +482 -0
- package/dist/use-calendar-picker.js +49 -0
- package/dist/use-calendar-picker.mjs +8 -0
- package/dist/use-calendar.d.mts +494 -0
- package/dist/use-calendar.d.ts +494 -0
- package/dist/use-calendar.js +293 -0
- package/dist/use-calendar.mjs +8 -0
- package/dist/use-range-calendar.d.mts +498 -0
- package/dist/use-range-calendar.d.ts +498 -0
- package/dist/use-range-calendar.js +293 -0
- package/dist/use-range-calendar.mjs +8 -0
- package/dist/utils.d.mts +7 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +59 -0
- package/dist/utils.mjs +33 -0
- package/package.json +74 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { CalendarPickerProps } from './use-calendar-picker.js';
|
|
3
|
+
import '@sytechui/theme';
|
|
4
|
+
import 'tailwind-variants';
|
|
5
|
+
import '@react-types/calendar';
|
|
6
|
+
import '@react-stately/calendar';
|
|
7
|
+
import '@internationalized/date';
|
|
8
|
+
import '@sytechui/system';
|
|
9
|
+
|
|
10
|
+
declare function CalendarPicker(props: CalendarPickerProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { CalendarPicker };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/calendar-picker.tsx
|
|
22
|
+
var calendar_picker_exports = {};
|
|
23
|
+
__export(calendar_picker_exports, {
|
|
24
|
+
CalendarPicker: () => CalendarPicker
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(calendar_picker_exports);
|
|
27
|
+
var import_time_picker = require("@sytechui/time-picker");
|
|
28
|
+
|
|
29
|
+
// src/calendar-context.ts
|
|
30
|
+
var import_react_utils = require("@sytechui/react-utils");
|
|
31
|
+
var [CalendarProvider, useCalendarContext] = (0, import_react_utils.createContext)({
|
|
32
|
+
name: "CalendarContext",
|
|
33
|
+
strict: true,
|
|
34
|
+
errorMessage: "useContext: `context` is undefined. Seems you forgot to wrap component within the CalendarProvider"
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// src/use-calendar-picker.ts
|
|
38
|
+
function useCalendarPicker(_props) {
|
|
39
|
+
const { slots, state, isHeaderExpanded, classNames } = useCalendarContext();
|
|
40
|
+
return {
|
|
41
|
+
state,
|
|
42
|
+
slots,
|
|
43
|
+
classNames,
|
|
44
|
+
isHeaderExpanded
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/calendar-picker.tsx
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
function CalendarPicker(props) {
|
|
51
|
+
const { state, slots, classNames, isHeaderExpanded } = useCalendarPicker(props);
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: slots == null ? void 0 : slots.pickerWrapper({
|
|
56
|
+
class: classNames == null ? void 0 : classNames.pickerWrapper
|
|
57
|
+
}),
|
|
58
|
+
"data-slot": "picker-wrapper",
|
|
59
|
+
inert: !isHeaderExpanded ? true : void 0,
|
|
60
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_time_picker.TimePicker,
|
|
62
|
+
{
|
|
63
|
+
isMonth: true,
|
|
64
|
+
isYear: true,
|
|
65
|
+
isDay: false,
|
|
66
|
+
value: state.focusedDate,
|
|
67
|
+
onChange: (date) => {
|
|
68
|
+
state.setFocusedDate(
|
|
69
|
+
state.focusedDate.set({
|
|
70
|
+
year: date.year,
|
|
71
|
+
month: date.month
|
|
72
|
+
})
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
CalendarPicker
|
|
83
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/calendar-transitions.ts
|
|
22
|
+
var calendar_transitions_exports = {};
|
|
23
|
+
__export(calendar_transitions_exports, {
|
|
24
|
+
slideVariants: () => slideVariants,
|
|
25
|
+
transition: () => transition
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(calendar_transitions_exports);
|
|
28
|
+
var transition = {
|
|
29
|
+
type: "spring",
|
|
30
|
+
bounce: 0,
|
|
31
|
+
duration: 0.3
|
|
32
|
+
};
|
|
33
|
+
var slideVariants = {
|
|
34
|
+
enter: (direction) => ({
|
|
35
|
+
x: `${direction * 100}%`
|
|
36
|
+
}),
|
|
37
|
+
center: {
|
|
38
|
+
x: "0%"
|
|
39
|
+
},
|
|
40
|
+
exit: (direction) => ({
|
|
41
|
+
x: `${direction * -100}%`
|
|
42
|
+
})
|
|
43
|
+
};
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
slideVariants,
|
|
47
|
+
transition
|
|
48
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DateValue } from '@internationalized/date';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { UseCalendarProps } from './use-calendar.mjs';
|
|
4
|
+
import '@sytechui/theme';
|
|
5
|
+
import 'tailwind-variants';
|
|
6
|
+
import '@sytechui/system';
|
|
7
|
+
import '@react-types/calendar';
|
|
8
|
+
import '@react-stately/calendar';
|
|
9
|
+
import './use-calendar-base.mjs';
|
|
10
|
+
import '@react-types/shared';
|
|
11
|
+
import '@sytechui/system/src/types';
|
|
12
|
+
import '@react-aria/calendar';
|
|
13
|
+
import '@react-types/button';
|
|
14
|
+
import '@sytechui/button';
|
|
15
|
+
import '@sytechui/react-utils';
|
|
16
|
+
import './calendar-base.mjs';
|
|
17
|
+
import 'react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
interface Props<T extends DateValue> extends Omit<UseCalendarProps<T>, "isHeaderWrapperExpanded"> {
|
|
20
|
+
}
|
|
21
|
+
type CalendarProps<T extends DateValue = DateValue> = Props<T>;
|
|
22
|
+
declare const Calendar: <T extends DateValue>(props: CalendarProps<T>) => ReactElement;
|
|
23
|
+
|
|
24
|
+
export { type CalendarProps, Calendar as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DateValue } from '@internationalized/date';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { UseCalendarProps } from './use-calendar.js';
|
|
4
|
+
import '@sytechui/theme';
|
|
5
|
+
import 'tailwind-variants';
|
|
6
|
+
import '@sytechui/system';
|
|
7
|
+
import '@react-types/calendar';
|
|
8
|
+
import '@react-stately/calendar';
|
|
9
|
+
import './use-calendar-base.js';
|
|
10
|
+
import '@react-types/shared';
|
|
11
|
+
import '@sytechui/system/src/types';
|
|
12
|
+
import '@react-aria/calendar';
|
|
13
|
+
import '@react-types/button';
|
|
14
|
+
import '@sytechui/button';
|
|
15
|
+
import '@sytechui/react-utils';
|
|
16
|
+
import './calendar-base.js';
|
|
17
|
+
import 'react/jsx-runtime';
|
|
18
|
+
|
|
19
|
+
interface Props<T extends DateValue> extends Omit<UseCalendarProps<T>, "isHeaderWrapperExpanded"> {
|
|
20
|
+
}
|
|
21
|
+
type CalendarProps<T extends DateValue = DateValue> = Props<T>;
|
|
22
|
+
declare const Calendar: <T extends DateValue>(props: CalendarProps<T>) => ReactElement;
|
|
23
|
+
|
|
24
|
+
export { type CalendarProps, Calendar as default };
|