@molecule/app-mini-calendar-react 1.0.0 → 1.0.2
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 +122 -0
- package/package.json +16 -9
package/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T01:52:08.848Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-mini-calendar-react
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
React mini month-view calendar.
|
|
16
|
+
|
|
17
|
+
Exports `<MiniCalendar>` — compact day picker with prev/next navigation,
|
|
18
|
+
Intl-localized weekday + month names, controlled-optional `selected` +
|
|
19
|
+
`month` props, and an `isDisabled` day predicate.
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { MiniCalendar } from '@molecule/app-mini-calendar-react'
|
|
25
|
+
|
|
26
|
+
;<MiniCalendar
|
|
27
|
+
selected={new Date('2026-06-15')}
|
|
28
|
+
onSelect={(date) => console.log(date.toISOString())}
|
|
29
|
+
locale="en-US"
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Type
|
|
34
|
+
|
|
35
|
+
`feature`
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @molecule/app-mini-calendar-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
|
|
41
|
+
npm install -D @types/react
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## API
|
|
45
|
+
|
|
46
|
+
### Interfaces
|
|
47
|
+
|
|
48
|
+
#### `MiniCalendarProps`
|
|
49
|
+
|
|
50
|
+
Props for {@link MiniCalendar}.
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
interface MiniCalendarProps {
|
|
54
|
+
/** Controlled selected date (ISO yyyy-mm-dd or Date). */
|
|
55
|
+
selected?: Date | string
|
|
56
|
+
/** Called when the user picks a day. */
|
|
57
|
+
onSelect?: (date: Date) => void
|
|
58
|
+
/** Controlled visible month. If omitted the component tracks its own. */
|
|
59
|
+
month?: Date
|
|
60
|
+
/** Called when the user navigates months. */
|
|
61
|
+
onMonthChange?: (date: Date) => void
|
|
62
|
+
/** Locale for weekday + month name formatting. */
|
|
63
|
+
locale?: string
|
|
64
|
+
/** Optional day-disabled predicate. */
|
|
65
|
+
isDisabled?: (date: Date) => boolean
|
|
66
|
+
/** Extra classes. */
|
|
67
|
+
className?: string
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Functions
|
|
72
|
+
|
|
73
|
+
#### `MiniCalendar(props)`
|
|
74
|
+
|
|
75
|
+
Compact month-view calendar. Supports controlled `selected` + `month`
|
|
76
|
+
props or runs uncontrolled. Weekday / month names come from
|
|
77
|
+
`Intl.DateTimeFormat` so locales render correctly without extra data.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
function MiniCalendar({
|
|
81
|
+
selected,
|
|
82
|
+
onSelect,
|
|
83
|
+
month: monthProp,
|
|
84
|
+
onMonthChange,
|
|
85
|
+
locale,
|
|
86
|
+
isDisabled,
|
|
87
|
+
className,
|
|
88
|
+
}: MiniCalendarProps): JSX.Element
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- `props` — Component props (see {@link MiniCalendarProps}).
|
|
92
|
+
|
|
93
|
+
## Injection Notes
|
|
94
|
+
|
|
95
|
+
### Requirements
|
|
96
|
+
|
|
97
|
+
Peer dependencies:
|
|
98
|
+
|
|
99
|
+
- `@molecule/app-react` ^1.0.1
|
|
100
|
+
- `@molecule/app-ui` ^1.0.1
|
|
101
|
+
- `@molecule/app-ui-react` ^1.0.1
|
|
102
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
103
|
+
|
|
104
|
+
### Runtime Dependencies
|
|
105
|
+
|
|
106
|
+
- `@molecule/app-react`
|
|
107
|
+
- `@molecule/app-ui`
|
|
108
|
+
- `@molecule/app-ui-react`
|
|
109
|
+
- `react`
|
|
110
|
+
|
|
111
|
+
Requires a wired ClassMap bond (`setClassMap(...)` at startup) —
|
|
112
|
+
`getClassMap()` throws before wiring, and the prev/next buttons come
|
|
113
|
+
from `@molecule/app-ui-react`.
|
|
114
|
+
|
|
115
|
+
Weekday and month names localize automatically through
|
|
116
|
+
`Intl.DateTimeFormat(locale)` — no locale bond involved. The prev/next
|
|
117
|
+
button aria-labels are currently English-only.
|
|
118
|
+
|
|
119
|
+
When `month` is supplied the visible month is fully controlled —
|
|
120
|
+
wire `onMonthChange` too or the arrows will appear dead. The grid
|
|
121
|
+
always renders 6 weeks; days outside the visible month render dimmed
|
|
122
|
+
and remain clickable unless `isDisabled` filters them.
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-mini-calendar-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Month-view calendar with day selection and prev/next navigation",
|
|
5
|
+
"homepage": "https://www.molecule.dev/packages/app-mini-calendar-react",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +18,8 @@
|
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
21
23
|
],
|
|
22
24
|
"keywords": [
|
|
23
25
|
"molecule",
|
|
@@ -25,22 +27,27 @@
|
|
|
25
27
|
"react"
|
|
26
28
|
],
|
|
27
29
|
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
33
|
+
"directory": "packages/app/features/mini-calendar-react"
|
|
34
|
+
},
|
|
28
35
|
"peerDependencies": {
|
|
29
|
-
"@molecule/app-react": "^1.0.
|
|
30
|
-
"@molecule/app-ui": "^1.0.
|
|
31
|
-
"@molecule/app-ui-react": "^1.0.
|
|
36
|
+
"@molecule/app-react": "^1.0.1",
|
|
37
|
+
"@molecule/app-ui": "^1.0.1",
|
|
38
|
+
"@molecule/app-ui-react": "^1.0.1",
|
|
32
39
|
"react": "^18.0.0 || ^19.0.0"
|
|
33
40
|
},
|
|
34
41
|
"devDependencies": {
|
|
35
|
-
"@molecule/app-react": "1.
|
|
36
|
-
"@molecule/app-ui": "1.
|
|
37
|
-
"@molecule/app-ui-react": "1.0.
|
|
42
|
+
"@molecule/app-react": "1.5.1",
|
|
43
|
+
"@molecule/app-ui": "1.1.1",
|
|
44
|
+
"@molecule/app-ui-react": "1.0.2",
|
|
38
45
|
"@types/node": "26.1.2",
|
|
39
46
|
"@types/react": "19.2.17",
|
|
40
47
|
"@types/react-dom": "19.2.3",
|
|
41
48
|
"react": "19.2.8",
|
|
42
49
|
"react-dom": "19.2.8",
|
|
43
50
|
"typescript": "6.0.3",
|
|
44
|
-
"vitest": "4.1.
|
|
51
|
+
"vitest": "4.1.11"
|
|
45
52
|
}
|
|
46
53
|
}
|