@kopexa/calendar 0.0.0-canary-20250721110438

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 ADDED
@@ -0,0 +1,24 @@
1
+ # @kopexa/calendar
2
+
3
+ A Quick description of the component
4
+
5
+ > This is an internal utility, not intended for public usage.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ yarn add @kopexa/calendar
11
+ # or
12
+ npm i @kopexa/calendar
13
+ ```
14
+
15
+ ## Contribution
16
+
17
+ Yes please! See the
18
+ [contributing guidelines](https://github.com/kopexa-grc/sight/blob/master/CONTRIBUTING.md)
19
+ for details.
20
+
21
+ ## License
22
+
23
+ This project is licensed under the terms of the
24
+ [MIT license](https://github.com/kopexa-grc/sight/blob/master/LICENSE).
@@ -0,0 +1,10 @@
1
+ import { DayPickerProps } from 'react-day-picker';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ButtonVariantProps } from '@kopexa/theme';
4
+
5
+ type CalendarProps = DayPickerProps & {
6
+ buttonVariant?: ButtonVariantProps["variant"];
7
+ };
8
+ declare const Calendar: (props: CalendarProps) => react_jsx_runtime.JSX.Element;
9
+
10
+ export { Calendar, type CalendarProps };
@@ -0,0 +1,10 @@
1
+ import { DayPickerProps } from 'react-day-picker';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { ButtonVariantProps } from '@kopexa/theme';
4
+
5
+ type CalendarProps = DayPickerProps & {
6
+ buttonVariant?: ButtonVariantProps["variant"];
7
+ };
8
+ declare const Calendar: (props: CalendarProps) => react_jsx_runtime.JSX.Element;
9
+
10
+ export { Calendar, type CalendarProps };
@@ -0,0 +1,220 @@
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.tsx
22
+ var calendar_exports = {};
23
+ __export(calendar_exports, {
24
+ Calendar: () => Calendar
25
+ });
26
+ module.exports = __toCommonJS(calendar_exports);
27
+ var import_button = require("@kopexa/button");
28
+ var import_icons = require("@kopexa/icons");
29
+ var import_shared_utils = require("@kopexa/shared-utils");
30
+ var import_theme = require("@kopexa/theme");
31
+ var import_react = require("react");
32
+ var import_react_day_picker = require("react-day-picker");
33
+ var import_jsx_runtime = require("react/jsx-runtime");
34
+ var Calendar = (props) => {
35
+ const {
36
+ className,
37
+ classNames,
38
+ showOutsideDays = true,
39
+ captionLayout = "label",
40
+ buttonVariant = "ghost",
41
+ formatters,
42
+ components,
43
+ ...rest
44
+ } = props;
45
+ const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
46
+ const styles = (0, import_theme.calendar)({
47
+ captionLayout: captionLayout === "label" ? "label" : "default",
48
+ className
49
+ });
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ import_react_day_picker.DayPicker,
52
+ {
53
+ showOutsideDays,
54
+ className: styles.base({
55
+ className
56
+ }),
57
+ captionLayout,
58
+ formatters: {
59
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
60
+ ...formatters
61
+ },
62
+ classNames: {
63
+ root: styles.root({ className: defaultClassNames.root }),
64
+ months: styles.months({ className: defaultClassNames.months }),
65
+ month: styles.month({ className: defaultClassNames.month }),
66
+ nav: styles.nav({ className: defaultClassNames.nav }),
67
+ button_previous: (0, import_theme.button)({
68
+ variant: buttonVariant,
69
+ isIconOnly: true,
70
+ className: styles.buttonPrevious({
71
+ className: defaultClassNames.button_previous
72
+ })
73
+ }),
74
+ button_next: (0, import_theme.button)({
75
+ variant: buttonVariant,
76
+ isIconOnly: true,
77
+ className: styles.buttonNext({
78
+ className: defaultClassNames.button_next
79
+ })
80
+ }),
81
+ month_caption: styles.monthCaption({
82
+ className: defaultClassNames.month_caption
83
+ }),
84
+ dropdown: styles.dropdown({
85
+ className: defaultClassNames.dropdown
86
+ }),
87
+ dropdowns: styles.dropdowns({
88
+ className: defaultClassNames.dropdowns
89
+ }),
90
+ dropdown_root: styles.dropdownRoot({
91
+ className: defaultClassNames.dropdown_root
92
+ }),
93
+ caption_label: styles.captionLabel({
94
+ className: defaultClassNames.caption_label
95
+ }),
96
+ table: styles.table(),
97
+ weekdays: styles.weekdays({
98
+ className: defaultClassNames.weekdays
99
+ }),
100
+ weekday: styles.weekday({
101
+ className: defaultClassNames.weekday
102
+ }),
103
+ week: styles.week({
104
+ className: defaultClassNames.week
105
+ }),
106
+ week_number_header: styles.weekNumberHeader({
107
+ className: defaultClassNames.week_number_header
108
+ }),
109
+ week_number: styles.weekNumber({
110
+ className: defaultClassNames.week_number
111
+ }),
112
+ day: styles.day({
113
+ className: defaultClassNames.day
114
+ }),
115
+ range_start: styles.rangeStart({
116
+ className: defaultClassNames.range_start
117
+ }),
118
+ range_middle: styles.rangeMiddle({
119
+ className: defaultClassNames.range_middle
120
+ }),
121
+ range_end: styles.rangeEnd({
122
+ className: defaultClassNames.range_end
123
+ }),
124
+ today: styles.today({
125
+ className: defaultClassNames.today
126
+ }),
127
+ outside: styles.outside({
128
+ className: defaultClassNames.outside
129
+ }),
130
+ disabled: styles.disabled({
131
+ className: defaultClassNames.disabled
132
+ }),
133
+ hidden: styles.hidden({
134
+ className: defaultClassNames.hidden
135
+ }),
136
+ ...classNames
137
+ },
138
+ components: {
139
+ Root: ({ rootRef, ...props2 }) => {
140
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "calendar", ref: rootRef, ...props2 });
141
+ },
142
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
143
+ if (orientation === "left") {
144
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
145
+ import_icons.ChevronLeftIcon,
146
+ {
147
+ className: styles.icon({
148
+ className: className2
149
+ }),
150
+ ...props2
151
+ }
152
+ );
153
+ }
154
+ if (orientation === "right") {
155
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
156
+ import_icons.ChevronRightIcon,
157
+ {
158
+ className: styles.icon({
159
+ className: className2
160
+ }),
161
+ ...props2
162
+ }
163
+ );
164
+ }
165
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
166
+ import_icons.ChevronDownIcon,
167
+ {
168
+ className: styles.icon({
169
+ className: className2
170
+ }),
171
+ ...props2
172
+ }
173
+ );
174
+ },
175
+ DayButton: CalendarDayButton,
176
+ WeekNumber: ({ children, ...props2 }) => {
177
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { ...props2, "data-slot": "week-number", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.weekNumberWrapper(), children }) });
178
+ },
179
+ ...components
180
+ },
181
+ ...rest
182
+ }
183
+ );
184
+ };
185
+ function CalendarDayButton({
186
+ className,
187
+ day,
188
+ modifiers,
189
+ ...props
190
+ }) {
191
+ const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
192
+ const ref = (0, import_react.useRef)(null);
193
+ (0, import_react.useEffect)(() => {
194
+ var _a;
195
+ if (modifiers.focused) (_a = ref.current) == null ? void 0 : _a.focus();
196
+ }, [modifiers.focused]);
197
+ const styles = (0, import_theme.calendar)();
198
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
199
+ import_button.Button,
200
+ {
201
+ ref,
202
+ variant: "ghost",
203
+ "data-slot": "day-button",
204
+ isIconOnly: true,
205
+ "data-day": day.date.toLocaleDateString(),
206
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
207
+ "data-range-start": modifiers.range_start,
208
+ "data-range-end": modifiers.range_end,
209
+ "data-range-middle": modifiers.range_middle,
210
+ className: styles.dayButton({
211
+ className: (0, import_shared_utils.cn)(defaultClassNames.day_button, className)
212
+ }),
213
+ ...props
214
+ }
215
+ );
216
+ }
217
+ // Annotate the CommonJS export names for ESM import in node:
218
+ 0 && (module.exports = {
219
+ Calendar
220
+ });
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ Calendar
4
+ } from "./chunk-TUEUTMOB.mjs";
5
+ export {
6
+ Calendar
7
+ };
@@ -0,0 +1,204 @@
1
+ "use client";
2
+
3
+ // src/calendar.tsx
4
+ import { Button } from "@kopexa/button";
5
+ import {
6
+ ChevronDownIcon,
7
+ ChevronLeftIcon,
8
+ ChevronRightIcon
9
+ } from "@kopexa/icons";
10
+ import { cn } from "@kopexa/shared-utils";
11
+ import { button, calendar } from "@kopexa/theme";
12
+ import { useEffect, useRef } from "react";
13
+ import {
14
+ DayPicker,
15
+ getDefaultClassNames
16
+ } from "react-day-picker";
17
+ import { jsx } from "react/jsx-runtime";
18
+ var Calendar = (props) => {
19
+ const {
20
+ className,
21
+ classNames,
22
+ showOutsideDays = true,
23
+ captionLayout = "label",
24
+ buttonVariant = "ghost",
25
+ formatters,
26
+ components,
27
+ ...rest
28
+ } = props;
29
+ const defaultClassNames = getDefaultClassNames();
30
+ const styles = calendar({
31
+ captionLayout: captionLayout === "label" ? "label" : "default",
32
+ className
33
+ });
34
+ return /* @__PURE__ */ jsx(
35
+ DayPicker,
36
+ {
37
+ showOutsideDays,
38
+ className: styles.base({
39
+ className
40
+ }),
41
+ captionLayout,
42
+ formatters: {
43
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
44
+ ...formatters
45
+ },
46
+ classNames: {
47
+ root: styles.root({ className: defaultClassNames.root }),
48
+ months: styles.months({ className: defaultClassNames.months }),
49
+ month: styles.month({ className: defaultClassNames.month }),
50
+ nav: styles.nav({ className: defaultClassNames.nav }),
51
+ button_previous: button({
52
+ variant: buttonVariant,
53
+ isIconOnly: true,
54
+ className: styles.buttonPrevious({
55
+ className: defaultClassNames.button_previous
56
+ })
57
+ }),
58
+ button_next: button({
59
+ variant: buttonVariant,
60
+ isIconOnly: true,
61
+ className: styles.buttonNext({
62
+ className: defaultClassNames.button_next
63
+ })
64
+ }),
65
+ month_caption: styles.monthCaption({
66
+ className: defaultClassNames.month_caption
67
+ }),
68
+ dropdown: styles.dropdown({
69
+ className: defaultClassNames.dropdown
70
+ }),
71
+ dropdowns: styles.dropdowns({
72
+ className: defaultClassNames.dropdowns
73
+ }),
74
+ dropdown_root: styles.dropdownRoot({
75
+ className: defaultClassNames.dropdown_root
76
+ }),
77
+ caption_label: styles.captionLabel({
78
+ className: defaultClassNames.caption_label
79
+ }),
80
+ table: styles.table(),
81
+ weekdays: styles.weekdays({
82
+ className: defaultClassNames.weekdays
83
+ }),
84
+ weekday: styles.weekday({
85
+ className: defaultClassNames.weekday
86
+ }),
87
+ week: styles.week({
88
+ className: defaultClassNames.week
89
+ }),
90
+ week_number_header: styles.weekNumberHeader({
91
+ className: defaultClassNames.week_number_header
92
+ }),
93
+ week_number: styles.weekNumber({
94
+ className: defaultClassNames.week_number
95
+ }),
96
+ day: styles.day({
97
+ className: defaultClassNames.day
98
+ }),
99
+ range_start: styles.rangeStart({
100
+ className: defaultClassNames.range_start
101
+ }),
102
+ range_middle: styles.rangeMiddle({
103
+ className: defaultClassNames.range_middle
104
+ }),
105
+ range_end: styles.rangeEnd({
106
+ className: defaultClassNames.range_end
107
+ }),
108
+ today: styles.today({
109
+ className: defaultClassNames.today
110
+ }),
111
+ outside: styles.outside({
112
+ className: defaultClassNames.outside
113
+ }),
114
+ disabled: styles.disabled({
115
+ className: defaultClassNames.disabled
116
+ }),
117
+ hidden: styles.hidden({
118
+ className: defaultClassNames.hidden
119
+ }),
120
+ ...classNames
121
+ },
122
+ components: {
123
+ Root: ({ rootRef, ...props2 }) => {
124
+ return /* @__PURE__ */ jsx("div", { "data-slot": "calendar", ref: rootRef, ...props2 });
125
+ },
126
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
127
+ if (orientation === "left") {
128
+ return /* @__PURE__ */ jsx(
129
+ ChevronLeftIcon,
130
+ {
131
+ className: styles.icon({
132
+ className: className2
133
+ }),
134
+ ...props2
135
+ }
136
+ );
137
+ }
138
+ if (orientation === "right") {
139
+ return /* @__PURE__ */ jsx(
140
+ ChevronRightIcon,
141
+ {
142
+ className: styles.icon({
143
+ className: className2
144
+ }),
145
+ ...props2
146
+ }
147
+ );
148
+ }
149
+ return /* @__PURE__ */ jsx(
150
+ ChevronDownIcon,
151
+ {
152
+ className: styles.icon({
153
+ className: className2
154
+ }),
155
+ ...props2
156
+ }
157
+ );
158
+ },
159
+ DayButton: CalendarDayButton,
160
+ WeekNumber: ({ children, ...props2 }) => {
161
+ return /* @__PURE__ */ jsx("td", { ...props2, "data-slot": "week-number", children: /* @__PURE__ */ jsx("div", { className: styles.weekNumberWrapper(), children }) });
162
+ },
163
+ ...components
164
+ },
165
+ ...rest
166
+ }
167
+ );
168
+ };
169
+ function CalendarDayButton({
170
+ className,
171
+ day,
172
+ modifiers,
173
+ ...props
174
+ }) {
175
+ const defaultClassNames = getDefaultClassNames();
176
+ const ref = useRef(null);
177
+ useEffect(() => {
178
+ var _a;
179
+ if (modifiers.focused) (_a = ref.current) == null ? void 0 : _a.focus();
180
+ }, [modifiers.focused]);
181
+ const styles = calendar();
182
+ return /* @__PURE__ */ jsx(
183
+ Button,
184
+ {
185
+ ref,
186
+ variant: "ghost",
187
+ "data-slot": "day-button",
188
+ isIconOnly: true,
189
+ "data-day": day.date.toLocaleDateString(),
190
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
191
+ "data-range-start": modifiers.range_start,
192
+ "data-range-end": modifiers.range_end,
193
+ "data-range-middle": modifiers.range_middle,
194
+ className: styles.dayButton({
195
+ className: cn(defaultClassNames.day_button, className)
196
+ }),
197
+ ...props
198
+ }
199
+ );
200
+ }
201
+
202
+ export {
203
+ Calendar
204
+ };
@@ -0,0 +1,4 @@
1
+ export { DateRange } from 'react-day-picker';
2
+ export { Calendar, CalendarProps } from './calendar.mjs';
3
+ import 'react/jsx-runtime';
4
+ import '@kopexa/theme';
@@ -0,0 +1,4 @@
1
+ export { DateRange } from 'react-day-picker';
2
+ export { Calendar, CalendarProps } from './calendar.js';
3
+ import 'react/jsx-runtime';
4
+ import '@kopexa/theme';
package/dist/index.js ADDED
@@ -0,0 +1,222 @@
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/index.ts
22
+ var index_exports = {};
23
+ __export(index_exports, {
24
+ Calendar: () => Calendar
25
+ });
26
+ module.exports = __toCommonJS(index_exports);
27
+
28
+ // src/calendar.tsx
29
+ var import_button = require("@kopexa/button");
30
+ var import_icons = require("@kopexa/icons");
31
+ var import_shared_utils = require("@kopexa/shared-utils");
32
+ var import_theme = require("@kopexa/theme");
33
+ var import_react = require("react");
34
+ var import_react_day_picker = require("react-day-picker");
35
+ var import_jsx_runtime = require("react/jsx-runtime");
36
+ var Calendar = (props) => {
37
+ const {
38
+ className,
39
+ classNames,
40
+ showOutsideDays = true,
41
+ captionLayout = "label",
42
+ buttonVariant = "ghost",
43
+ formatters,
44
+ components,
45
+ ...rest
46
+ } = props;
47
+ const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
48
+ const styles = (0, import_theme.calendar)({
49
+ captionLayout: captionLayout === "label" ? "label" : "default",
50
+ className
51
+ });
52
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ import_react_day_picker.DayPicker,
54
+ {
55
+ showOutsideDays,
56
+ className: styles.base({
57
+ className
58
+ }),
59
+ captionLayout,
60
+ formatters: {
61
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
62
+ ...formatters
63
+ },
64
+ classNames: {
65
+ root: styles.root({ className: defaultClassNames.root }),
66
+ months: styles.months({ className: defaultClassNames.months }),
67
+ month: styles.month({ className: defaultClassNames.month }),
68
+ nav: styles.nav({ className: defaultClassNames.nav }),
69
+ button_previous: (0, import_theme.button)({
70
+ variant: buttonVariant,
71
+ isIconOnly: true,
72
+ className: styles.buttonPrevious({
73
+ className: defaultClassNames.button_previous
74
+ })
75
+ }),
76
+ button_next: (0, import_theme.button)({
77
+ variant: buttonVariant,
78
+ isIconOnly: true,
79
+ className: styles.buttonNext({
80
+ className: defaultClassNames.button_next
81
+ })
82
+ }),
83
+ month_caption: styles.monthCaption({
84
+ className: defaultClassNames.month_caption
85
+ }),
86
+ dropdown: styles.dropdown({
87
+ className: defaultClassNames.dropdown
88
+ }),
89
+ dropdowns: styles.dropdowns({
90
+ className: defaultClassNames.dropdowns
91
+ }),
92
+ dropdown_root: styles.dropdownRoot({
93
+ className: defaultClassNames.dropdown_root
94
+ }),
95
+ caption_label: styles.captionLabel({
96
+ className: defaultClassNames.caption_label
97
+ }),
98
+ table: styles.table(),
99
+ weekdays: styles.weekdays({
100
+ className: defaultClassNames.weekdays
101
+ }),
102
+ weekday: styles.weekday({
103
+ className: defaultClassNames.weekday
104
+ }),
105
+ week: styles.week({
106
+ className: defaultClassNames.week
107
+ }),
108
+ week_number_header: styles.weekNumberHeader({
109
+ className: defaultClassNames.week_number_header
110
+ }),
111
+ week_number: styles.weekNumber({
112
+ className: defaultClassNames.week_number
113
+ }),
114
+ day: styles.day({
115
+ className: defaultClassNames.day
116
+ }),
117
+ range_start: styles.rangeStart({
118
+ className: defaultClassNames.range_start
119
+ }),
120
+ range_middle: styles.rangeMiddle({
121
+ className: defaultClassNames.range_middle
122
+ }),
123
+ range_end: styles.rangeEnd({
124
+ className: defaultClassNames.range_end
125
+ }),
126
+ today: styles.today({
127
+ className: defaultClassNames.today
128
+ }),
129
+ outside: styles.outside({
130
+ className: defaultClassNames.outside
131
+ }),
132
+ disabled: styles.disabled({
133
+ className: defaultClassNames.disabled
134
+ }),
135
+ hidden: styles.hidden({
136
+ className: defaultClassNames.hidden
137
+ }),
138
+ ...classNames
139
+ },
140
+ components: {
141
+ Root: ({ rootRef, ...props2 }) => {
142
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "data-slot": "calendar", ref: rootRef, ...props2 });
143
+ },
144
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
145
+ if (orientation === "left") {
146
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
147
+ import_icons.ChevronLeftIcon,
148
+ {
149
+ className: styles.icon({
150
+ className: className2
151
+ }),
152
+ ...props2
153
+ }
154
+ );
155
+ }
156
+ if (orientation === "right") {
157
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
158
+ import_icons.ChevronRightIcon,
159
+ {
160
+ className: styles.icon({
161
+ className: className2
162
+ }),
163
+ ...props2
164
+ }
165
+ );
166
+ }
167
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
168
+ import_icons.ChevronDownIcon,
169
+ {
170
+ className: styles.icon({
171
+ className: className2
172
+ }),
173
+ ...props2
174
+ }
175
+ );
176
+ },
177
+ DayButton: CalendarDayButton,
178
+ WeekNumber: ({ children, ...props2 }) => {
179
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("td", { ...props2, "data-slot": "week-number", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.weekNumberWrapper(), children }) });
180
+ },
181
+ ...components
182
+ },
183
+ ...rest
184
+ }
185
+ );
186
+ };
187
+ function CalendarDayButton({
188
+ className,
189
+ day,
190
+ modifiers,
191
+ ...props
192
+ }) {
193
+ const defaultClassNames = (0, import_react_day_picker.getDefaultClassNames)();
194
+ const ref = (0, import_react.useRef)(null);
195
+ (0, import_react.useEffect)(() => {
196
+ var _a;
197
+ if (modifiers.focused) (_a = ref.current) == null ? void 0 : _a.focus();
198
+ }, [modifiers.focused]);
199
+ const styles = (0, import_theme.calendar)();
200
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
201
+ import_button.Button,
202
+ {
203
+ ref,
204
+ variant: "ghost",
205
+ "data-slot": "day-button",
206
+ isIconOnly: true,
207
+ "data-day": day.date.toLocaleDateString(),
208
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
209
+ "data-range-start": modifiers.range_start,
210
+ "data-range-end": modifiers.range_end,
211
+ "data-range-middle": modifiers.range_middle,
212
+ className: styles.dayButton({
213
+ className: (0, import_shared_utils.cn)(defaultClassNames.day_button, className)
214
+ }),
215
+ ...props
216
+ }
217
+ );
218
+ }
219
+ // Annotate the CommonJS export names for ESM import in node:
220
+ 0 && (module.exports = {
221
+ Calendar
222
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import {
3
+ Calendar
4
+ } from "./chunk-TUEUTMOB.mjs";
5
+ export {
6
+ Calendar
7
+ };
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@kopexa/calendar",
3
+ "version": "0.0.0-canary-20250721110438",
4
+ "description": "A Calendar to use within Kopexa",
5
+ "keywords": [
6
+ "calendar"
7
+ ],
8
+ "author": "Kopexa <hello@kopexa.com>",
9
+ "homepage": "https://kopexa.com",
10
+ "license": "MIT",
11
+ "main": "dist/index.js",
12
+ "sideEffects": false,
13
+ "files": [
14
+ "dist"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/kopexa-grc/sight.git",
22
+ "directory": "packages/components/calendar"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/kopexa-grc/sight/issues"
26
+ },
27
+ "peerDependencies": {
28
+ "motion": ">=12.23.6",
29
+ "react": ">=19.0.0-rc.0",
30
+ "react-dom": ">=19.0.0-rc.0",
31
+ "@kopexa/theme": "0.0.0-canary-20250721110438"
32
+ },
33
+ "dependencies": {
34
+ "date-fns": "^4.1.0",
35
+ "react-day-picker": "^9.8.0",
36
+ "@kopexa/react-utils": "2.0.1",
37
+ "@kopexa/shared-utils": "1.1.1",
38
+ "@kopexa/icons": "0.0.0-canary-20250721110438",
39
+ "@kopexa/button": "0.0.0-canary-20250721110438"
40
+ },
41
+ "clean-package": "../../../clean-package.config.json",
42
+ "module": "dist/index.mjs",
43
+ "types": "dist/index.d.ts",
44
+ "exports": {
45
+ ".": {
46
+ "types": "./dist/index.d.ts",
47
+ "import": "./dist/index.mjs",
48
+ "require": "./dist/index.js"
49
+ },
50
+ "./package.json": "./package.json"
51
+ },
52
+ "scripts": {
53
+ "build": "tsup src --dts",
54
+ "build:fast": "tsup src",
55
+ "dev": "pnpm build:fast --watch",
56
+ "clean": "rimraf dist .turbo",
57
+ "typecheck": "tsc --noEmit"
58
+ }
59
+ }