@nucleux/calendar 0.2.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nucleux
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # @nucleux/calendar
2
+
3
+ Month calendar / date grid — Nucleux agentic UI for React.
4
+
5
+ Part of **[Nucleux](https://github.com/intelligaia-open-labs/nucleux)** — agentic UI components for React. Install a single component, or the full kit via [`@nucleux/react`](https://www.npmjs.com/package/@nucleux/react).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @nucleux/calendar @nucleux/tokens
11
+ ```
12
+
13
+ `react` / `react-dom` are peer dependencies.
14
+
15
+ ## Usage
16
+
17
+ ```tsx
18
+ import { Calendar } from "@nucleux/calendar";
19
+ ```
20
+
21
+ Requires the theme once in your app: `import "@nucleux/tokens/styles.css";`
22
+ and the Tailwind preset from `@nucleux/tokens/preset`.
23
+
24
+ ## License
25
+
26
+ MIT © Nucleux
package/dist/index.cjs ADDED
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ require('react');
5
+ var lucideReact = require('lucide-react');
6
+ var reactDayPicker = require('react-day-picker');
7
+ var utils = require('@nucleux/utils');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ // src/index.tsx
11
+ function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
12
+ const navButton = "inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 text-foreground opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none disabled:opacity-30";
13
+ const dayButton = "inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-sm font-normal text-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-selected:opacity-100";
14
+ return /* @__PURE__ */ jsxRuntime.jsx(
15
+ reactDayPicker.DayPicker,
16
+ {
17
+ showOutsideDays,
18
+ className: utils.cn("p-3", className),
19
+ classNames: {
20
+ months: "flex flex-col sm:flex-row gap-4",
21
+ month: "flex flex-col gap-4",
22
+ caption: "flex justify-center pt-1 relative items-center",
23
+ caption_label: "text-sm font-medium text-foreground",
24
+ nav: "flex items-center gap-1",
25
+ nav_button: navButton,
26
+ nav_button_previous: "absolute left-1",
27
+ nav_button_next: "absolute right-1",
28
+ table: "w-full border-collapse space-y-1",
29
+ head_row: "flex",
30
+ head_cell: "w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground",
31
+ row: "flex w-full mt-2",
32
+ cell: "relative p-0 text-center text-sm focus-within:relative focus-within:z-20",
33
+ day: dayButton,
34
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
35
+ day_today: "bg-accent text-accent-foreground",
36
+ day_outside: "text-muted-foreground opacity-50",
37
+ day_disabled: "text-muted-foreground opacity-50",
38
+ day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
39
+ day_hidden: "invisible",
40
+ ...classNames
41
+ },
42
+ components: {
43
+ IconLeft: () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" }),
44
+ IconRight: () => /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
45
+ },
46
+ ...props
47
+ }
48
+ );
49
+ }
50
+ Calendar.displayName = "Calendar";
51
+
52
+ exports.Calendar = Calendar;
53
+ //# sourceMappingURL=index.cjs.map
54
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":["jsx","DayPicker","cn","ChevronLeft","ChevronRight"],"mappings":";;;;;;;;;AAWO,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,UAAA,EAAY,kBAAkB,IAAA,EAAM,GAAG,OAAM,EAAkB;AACnG,EAAA,MAAM,SAAA,GACJ,oNAAA;AACF,EAAA,MAAM,SAAA,GACJ,6LAAA;AAEF,EAAA,uBACEA,cAAA;AAAA,IAACC,wBAAA;AAAA,IAAA;AAAA,MACC,eAAA;AAAA,MACA,SAAA,EAAWC,QAAA,CAAG,KAAA,EAAO,SAAS,CAAA;AAAA,MAC9B,UAAA,EAAY;AAAA,QACV,MAAA,EAAQ,iCAAA;AAAA,QACR,KAAA,EAAO,qBAAA;AAAA,QACP,OAAA,EAAS,gDAAA;AAAA,QACT,aAAA,EAAe,qCAAA;AAAA,QACf,GAAA,EAAK,yBAAA;AAAA,QACL,UAAA,EAAY,SAAA;AAAA,QACZ,mBAAA,EAAqB,iBAAA;AAAA,QACrB,eAAA,EAAiB,kBAAA;AAAA,QACjB,KAAA,EAAO,kCAAA;AAAA,QACP,QAAA,EAAU,MAAA;AAAA,QACV,SAAA,EAAW,gEAAA;AAAA,QACX,GAAA,EAAK,kBAAA;AAAA,QACL,IAAA,EAAM,0EAAA;AAAA,QACN,GAAA,EAAK,SAAA;AAAA,QACL,YAAA,EACE,kIAAA;AAAA,QACF,SAAA,EAAW,kCAAA;AAAA,QACX,WAAA,EAAa,kCAAA;AAAA,QACb,YAAA,EAAc,kCAAA;AAAA,QACd,gBAAA,EAAkB,8DAAA;AAAA,QAClB,UAAA,EAAY,WAAA;AAAA,QACZ,GAAG;AAAA,OACL;AAAA,MACA,UAAA,EAAY;AAAA,QACV,QAAA,EAAU,sBAAMF,cAAA,CAACG,uBAAA,EAAA,EAAY,WAAU,SAAA,EAAU,CAAA;AAAA,QACjD,SAAA,EAAW,sBAAMH,cAAA,CAACI,wBAAA,EAAA,EAAa,WAAU,SAAA,EAAU;AAAA,OACrD;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AACA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"index.cjs","sourcesContent":["import * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { cn } from \"@nucleux/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\n/**\n * A month calendar / date grid built on react-day-picker, restyled with Nucleux\n * tokens. Supports single, multiple, and range selection via the `mode` prop.\n */\nexport function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n const navButton =\n \"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 text-foreground opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none disabled:opacity-30\";\n const dayButton =\n \"inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-sm font-normal text-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-selected:opacity-100\";\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row gap-4\",\n month: \"flex flex-col gap-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium text-foreground\",\n nav: \"flex items-center gap-1\",\n nav_button: navButton,\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground\",\n row: \"flex w-full mt-2\",\n cell: \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20\",\n day: dayButton,\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside: \"text-muted-foreground opacity-50\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: () => <ChevronLeft className=\"h-4 w-4\" />,\n IconRight: () => <ChevronRight className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = \"Calendar\";\n"]}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { DayPicker } from 'react-day-picker';
3
+
4
+ type CalendarProps = React.ComponentProps<typeof DayPicker>;
5
+ /**
6
+ * A month calendar / date grid built on react-day-picker, restyled with Nucleux
7
+ * tokens. Supports single, multiple, and range selection via the `mode` prop.
8
+ */
9
+ declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): React.JSX.Element;
10
+ declare namespace Calendar {
11
+ var displayName: string;
12
+ }
13
+
14
+ export { Calendar, type CalendarProps };
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { DayPicker } from 'react-day-picker';
3
+
4
+ type CalendarProps = React.ComponentProps<typeof DayPicker>;
5
+ /**
6
+ * A month calendar / date grid built on react-day-picker, restyled with Nucleux
7
+ * tokens. Supports single, multiple, and range selection via the `mode` prop.
8
+ */
9
+ declare function Calendar({ className, classNames, showOutsideDays, ...props }: CalendarProps): React.JSX.Element;
10
+ declare namespace Calendar {
11
+ var displayName: string;
12
+ }
13
+
14
+ export { Calendar, type CalendarProps };
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import 'react';
3
+ import { ChevronRight, ChevronLeft } from 'lucide-react';
4
+ import { DayPicker } from 'react-day-picker';
5
+ import { cn } from '@nucleux/utils';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ // src/index.tsx
9
+ function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
10
+ const navButton = "inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 text-foreground opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none disabled:opacity-30";
11
+ const dayButton = "inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-sm font-normal text-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-selected:opacity-100";
12
+ return /* @__PURE__ */ jsx(
13
+ DayPicker,
14
+ {
15
+ showOutsideDays,
16
+ className: cn("p-3", className),
17
+ classNames: {
18
+ months: "flex flex-col sm:flex-row gap-4",
19
+ month: "flex flex-col gap-4",
20
+ caption: "flex justify-center pt-1 relative items-center",
21
+ caption_label: "text-sm font-medium text-foreground",
22
+ nav: "flex items-center gap-1",
23
+ nav_button: navButton,
24
+ nav_button_previous: "absolute left-1",
25
+ nav_button_next: "absolute right-1",
26
+ table: "w-full border-collapse space-y-1",
27
+ head_row: "flex",
28
+ head_cell: "w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground",
29
+ row: "flex w-full mt-2",
30
+ cell: "relative p-0 text-center text-sm focus-within:relative focus-within:z-20",
31
+ day: dayButton,
32
+ day_selected: "bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
33
+ day_today: "bg-accent text-accent-foreground",
34
+ day_outside: "text-muted-foreground opacity-50",
35
+ day_disabled: "text-muted-foreground opacity-50",
36
+ day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
37
+ day_hidden: "invisible",
38
+ ...classNames
39
+ },
40
+ components: {
41
+ IconLeft: () => /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }),
42
+ IconRight: () => /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
43
+ },
44
+ ...props
45
+ }
46
+ );
47
+ }
48
+ Calendar.displayName = "Calendar";
49
+
50
+ export { Calendar };
51
+ //# sourceMappingURL=index.js.map
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.tsx"],"names":[],"mappings":";;;;;;;AAWO,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,UAAA,EAAY,kBAAkB,IAAA,EAAM,GAAG,OAAM,EAAkB;AACnG,EAAA,MAAM,SAAA,GACJ,oNAAA;AACF,EAAA,MAAM,SAAA,GACJ,6LAAA;AAEF,EAAA,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,eAAA;AAAA,MACA,SAAA,EAAW,EAAA,CAAG,KAAA,EAAO,SAAS,CAAA;AAAA,MAC9B,UAAA,EAAY;AAAA,QACV,MAAA,EAAQ,iCAAA;AAAA,QACR,KAAA,EAAO,qBAAA;AAAA,QACP,OAAA,EAAS,gDAAA;AAAA,QACT,aAAA,EAAe,qCAAA;AAAA,QACf,GAAA,EAAK,yBAAA;AAAA,QACL,UAAA,EAAY,SAAA;AAAA,QACZ,mBAAA,EAAqB,iBAAA;AAAA,QACrB,eAAA,EAAiB,kBAAA;AAAA,QACjB,KAAA,EAAO,kCAAA;AAAA,QACP,QAAA,EAAU,MAAA;AAAA,QACV,SAAA,EAAW,gEAAA;AAAA,QACX,GAAA,EAAK,kBAAA;AAAA,QACL,IAAA,EAAM,0EAAA;AAAA,QACN,GAAA,EAAK,SAAA;AAAA,QACL,YAAA,EACE,kIAAA;AAAA,QACF,SAAA,EAAW,kCAAA;AAAA,QACX,WAAA,EAAa,kCAAA;AAAA,QACb,YAAA,EAAc,kCAAA;AAAA,QACd,gBAAA,EAAkB,8DAAA;AAAA,QAClB,UAAA,EAAY,WAAA;AAAA,QACZ,GAAG;AAAA,OACL;AAAA,MACA,UAAA,EAAY;AAAA,QACV,QAAA,EAAU,sBAAM,GAAA,CAAC,WAAA,EAAA,EAAY,WAAU,SAAA,EAAU,CAAA;AAAA,QACjD,SAAA,EAAW,sBAAM,GAAA,CAAC,YAAA,EAAA,EAAa,WAAU,SAAA,EAAU;AAAA,OACrD;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AACA,QAAA,CAAS,WAAA,GAAc,UAAA","file":"index.js","sourcesContent":["import * as React from \"react\";\nimport { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport { DayPicker } from \"react-day-picker\";\nimport { cn } from \"@nucleux/utils\";\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>;\n\n/**\n * A month calendar / date grid built on react-day-picker, restyled with Nucleux\n * tokens. Supports single, multiple, and range selection via the `mode` prop.\n */\nexport function Calendar({ className, classNames, showOutsideDays = true, ...props }: CalendarProps) {\n const navButton =\n \"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent p-0 text-foreground opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none disabled:opacity-30\";\n const dayButton =\n \"inline-flex h-9 w-9 items-center justify-center rounded-md p-0 text-sm font-normal text-foreground transition-colors hover:bg-accent hover:text-accent-foreground aria-selected:opacity-100\";\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row gap-4\",\n month: \"flex flex-col gap-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium text-foreground\",\n nav: \"flex items-center gap-1\",\n nav_button: navButton,\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell: \"w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground\",\n row: \"flex w-full mt-2\",\n cell: \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20\",\n day: dayButton,\n day_selected:\n \"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground\",\n day_today: \"bg-accent text-accent-foreground\",\n day_outside: \"text-muted-foreground opacity-50\",\n day_disabled: \"text-muted-foreground opacity-50\",\n day_range_middle: \"aria-selected:bg-accent aria-selected:text-accent-foreground\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: () => <ChevronLeft className=\"h-4 w-4\" />,\n IconRight: () => <ChevronRight className=\"h-4 w-4\" />,\n }}\n {...props}\n />\n );\n}\nCalendar.displayName = \"Calendar\";\n"]}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@nucleux/calendar",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "description": "Month calendar / date grid — Nucleux agentic UI for React.",
7
+ "keywords": [
8
+ "nucleux",
9
+ "react",
10
+ "ui",
11
+ "components",
12
+ "agentic",
13
+ "ai",
14
+ "tailwind",
15
+ "calendar"
16
+ ],
17
+ "main": "./dist/index.cjs",
18
+ "module": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "import": "./dist/index.js",
24
+ "require": "./dist/index.cjs"
25
+ }
26
+ },
27
+ "files": [
28
+ "dist",
29
+ "README.md"
30
+ ],
31
+ "peerDependencies": {
32
+ "react": ">=18",
33
+ "react-dom": ">=18"
34
+ },
35
+ "dependencies": {
36
+ "lucide-react": "^0.469.0",
37
+ "react-day-picker": "^8.10.1",
38
+ "@nucleux/utils": "0.2.0"
39
+ },
40
+ "devDependencies": {
41
+ "tsup": "^8.3.5",
42
+ "typescript": "^5.7.2",
43
+ "@types/react": "^18.3.18",
44
+ "react": "^18.3.1"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "license": "MIT",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/intelligaia-open-labs/nucleux.git",
53
+ "directory": "packages/calendar"
54
+ },
55
+ "homepage": "https://github.com/intelligaia-open-labs/nucleux#readme",
56
+ "scripts": {
57
+ "build": "tsup"
58
+ }
59
+ }