@lit-material/calendar 0.0.0-stage → 1.0.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.
@@ -0,0 +1,168 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@lit-material/calendar",
4
+ "version": "1.0.0",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "lit-material-calendar",
11
+ "description": "Material Design 3 styled calendar and scheduler: a month grid, week and day time grids, and an agenda list, with a toolbar (previous / today / next, the period's title, and a view switch). Events are controlled: the element never moves an event itself. Dragging, resizing or Alt+arrow keys fire a cancelable `event-change` with the new times; update `events` to accept it. Times are in the browser's (or server's) local time zone. ISO strings without an offset are read as local wall-clock time; date-only strings are local days. `slot-click` and `event-change` hand back local `Date`s. The month view is an ARIA grid of days. The week and day views are one ARIA grid too: a header row of days, an \"All day\" row, then a row per time slot, each with a time row header. One cell is in the tab order (arrow keys move it); Tab goes on to the events in that cell, each a button named by its title and time.",
12
+ "doc-url": "https://lit.rws8.tech/components/calendar/",
13
+ "attributes": [
14
+ {
15
+ "name": "view",
16
+ "description": "Which view is shown.",
17
+ "value": {
18
+ "type": "CalendarView"
19
+ }
20
+ },
21
+ {
22
+ "name": "date",
23
+ "description": "The day in focus, as an ISO `\"YYYY-MM-DD\"` string; the view shows the month, week or day around it. Default: today.",
24
+ "value": {
25
+ "type": "string | undefined"
26
+ }
27
+ },
28
+ {
29
+ "name": "events",
30
+ "description": "The events: `{ id, title, start, end?, allDay?, color?, editable?, ...data }`. Property or JSON attribute.",
31
+ "value": {
32
+ "type": "CalendarEvent[]"
33
+ }
34
+ },
35
+ {
36
+ "name": "first-day-of-week",
37
+ "description": "0 = Sunday, 1 = Monday, ... Default: the first day of the week in the element's language, else Sunday.",
38
+ "value": {
39
+ "type": "number | undefined"
40
+ }
41
+ },
42
+ {
43
+ "name": "slot-minutes",
44
+ "description": "Minutes per row of the week and day views; also the step for keyboard moves.",
45
+ "value": {
46
+ "type": "number"
47
+ }
48
+ },
49
+ {
50
+ "name": "scroll-to-hour",
51
+ "description": "The hour the week and day views scroll to when they open.",
52
+ "value": {
53
+ "type": "number"
54
+ }
55
+ },
56
+ {
57
+ "name": "day-max-events",
58
+ "description": "Event rows per day in the month view before \"+N more\".",
59
+ "value": {
60
+ "type": "number"
61
+ }
62
+ },
63
+ {
64
+ "name": "agenda-days",
65
+ "description": "Days the agenda view lists, from `date`.",
66
+ "value": {
67
+ "type": "number"
68
+ }
69
+ },
70
+ {
71
+ "name": "readonly",
72
+ "description": "No dragging, resizing or keyboard moves (clicks still fire).",
73
+ "value": {
74
+ "type": "boolean"
75
+ }
76
+ }
77
+ ],
78
+ "slots": [],
79
+ "events": [
80
+ {
81
+ "name": "navigate",
82
+ "description": "`detail: { view, date, start, end }` when the toolbar, keyboard or a \"+N more\" link changes the view or the period shown."
83
+ },
84
+ {
85
+ "name": "slot-click",
86
+ "description": "`detail: { start, end, allDay }` when an empty day, all-day cell or time slot is clicked or activated, or a time range is dragged out (pointer) or extended with Shift+arrows."
87
+ },
88
+ {
89
+ "name": "event-click",
90
+ "description": "`detail: { event }` when an event is clicked or activated with Enter/Space."
91
+ },
92
+ {
93
+ "name": "event-change",
94
+ "description": "Cancelable. `detail: { event, start, end, allDay }` when an event is dragged, resized or moved with the keyboard. The app updates `events`."
95
+ }
96
+ ],
97
+ "js": {
98
+ "properties": [
99
+ {
100
+ "name": "agendaDays",
101
+ "description": "Days the agenda view lists, from `date`.",
102
+ "type": "number"
103
+ },
104
+ {
105
+ "name": "date",
106
+ "description": "The day in focus, as an ISO `\"YYYY-MM-DD\"` string; the view shows the month, week or day around it. Default: today.",
107
+ "type": "string | undefined"
108
+ },
109
+ {
110
+ "name": "dayMaxEvents",
111
+ "description": "Event rows per day in the month view before \"+N more\".",
112
+ "type": "number"
113
+ },
114
+ {
115
+ "name": "events",
116
+ "description": "The events: `{ id, title, start, end?, allDay?, color?, editable?, ...data }`. Property or JSON attribute.",
117
+ "type": "CalendarEvent[]"
118
+ },
119
+ {
120
+ "name": "firstDayOfWeek",
121
+ "description": "0 = Sunday, 1 = Monday, ... Default: the first day of the week in the element's language, else Sunday.",
122
+ "type": "number | undefined"
123
+ },
124
+ {
125
+ "name": "readonly",
126
+ "description": "No dragging, resizing or keyboard moves (clicks still fire).",
127
+ "type": "boolean"
128
+ },
129
+ {
130
+ "name": "scrollToHour",
131
+ "description": "The hour the week and day views scroll to when they open.",
132
+ "type": "number"
133
+ },
134
+ {
135
+ "name": "slotMinutes",
136
+ "description": "Minutes per row of the week and day views; also the step for keyboard moves.",
137
+ "type": "number"
138
+ },
139
+ {
140
+ "name": "view",
141
+ "description": "Which view is shown.",
142
+ "type": "CalendarView"
143
+ }
144
+ ],
145
+ "events": [
146
+ {
147
+ "name": "navigate",
148
+ "description": "`detail: { view, date, start, end }` when the toolbar, keyboard or a \"+N more\" link changes the view or the period shown."
149
+ },
150
+ {
151
+ "name": "slot-click",
152
+ "description": "`detail: { start, end, allDay }` when an empty day, all-day cell or time slot is clicked or activated, or a time range is dragged out (pointer) or extended with Shift+arrows."
153
+ },
154
+ {
155
+ "name": "event-click",
156
+ "description": "`detail: { event }` when an event is clicked or activated with Enter/Space."
157
+ },
158
+ {
159
+ "name": "event-change",
160
+ "description": "Cancelable. `detail: { event, start, end, allDay }` when an event is dragged, resized or moved with the keyboard. The app updates `events`."
161
+ }
162
+ ]
163
+ }
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ }
package/package.json CHANGED
@@ -1,6 +1,100 @@
1
1
  {
2
2
  "name": "@lit-material/calendar",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Material Design 3 styled calendar and scheduler web component: month, week, day and agenda views with drag, resize and keyboard moves.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "bohdaq",
8
+ "email": "bohdaq@gmail.com",
9
+ "url": "https://github.com/bohdaq"
10
+ },
11
+ "homepage": "https://lit.rws8.tech/components/calendar/",
12
+ "bugs": "https://github.com/bohdaq/lit-material/issues",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+ssh://git@github.com/bohdaq/lit-material.git",
16
+ "directory": "packages/calendar"
17
+ },
18
+ "keywords": [
19
+ "lit",
20
+ "web-components",
21
+ "lit-material",
22
+ "material-design",
23
+ "material-design-3",
24
+ "calendar",
25
+ "scheduler",
26
+ "agenda",
27
+ "events"
28
+ ],
29
+ "type": "module",
30
+ "main": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "./calendar.js": {
38
+ "types": "./dist/calendar.d.ts",
39
+ "default": "./dist/calendar.js"
40
+ },
41
+ "./calendar-utils.js": {
42
+ "types": "./dist/calendar-utils.d.ts",
43
+ "default": "./dist/calendar-utils.js"
44
+ },
45
+ "./react": {
46
+ "types": "./dist/react.d.ts",
47
+ "default": "./dist/react.js"
48
+ },
49
+ "./jsx": {
50
+ "types": "./types/jsx.d.ts"
51
+ },
52
+ "./vue": {
53
+ "types": "./types/vue.d.ts"
54
+ }
55
+ },
56
+ "files": [
57
+ "dist",
58
+ "custom-elements.json",
59
+ "types"
60
+ ],
61
+ "web-types": "./dist/web-types.json",
62
+ "publishConfig": {
63
+ "access": "public"
64
+ },
65
+ "dependencies": {
66
+ "lit": "^3.2.0",
67
+ "@lit-material/core": "1.0.0",
68
+ "@lit-material/segmented-button": "1.0.0",
69
+ "@lit-material/tokens": "1.0.0"
70
+ },
71
+ "peerDependencies": {
72
+ "@lit/react": "^1.0.0",
73
+ "react": ">=18"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "@lit/react": {
77
+ "optional": true
78
+ },
79
+ "react": {
80
+ "optional": true
81
+ }
82
+ },
83
+ "devDependencies": {
84
+ "@lit-labs/ssr": "^3.3.1",
85
+ "@open-wc/testing": "^4.0.0",
86
+ "@web/dev-server-esbuild": "^1.0.0",
87
+ "@web/test-runner": "^0.19.0",
88
+ "@web/test-runner-commands": "^0.9.0",
89
+ "@web/test-runner-playwright": "^0.11.0",
90
+ "tsx": "^4.19.0",
91
+ "typescript": "^5.7.0"
92
+ },
93
+ "customElements": "custom-elements.json",
94
+ "scripts": {
95
+ "build": "tsc -p tsconfig.json",
96
+ "typecheck": "tsc -p tsconfig.json --noEmit",
97
+ "test": "web-test-runner && node --import tsx --test src/*.ssr.test.ts",
98
+ "analyze": "custom-elements-manifest analyze --litelement --globs \"src/**/*.ts\" --exclude \"src/**/*.test.ts\" --exclude \"src/**/*.ssr.test.ts\""
99
+ }
6
100
  }
package/types/jsx.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ // Generated by tools/framework-bindings.mjs from custom-elements.json. Do not edit.
2
+ // React 19 renders custom elements natively; this types them in JSX. Load it with
3
+ // `import type {} from "<package>/jsx";`. React 19 adds a listener for `on<event>` props as written.
4
+ import type { DetailedHTMLProps, HTMLAttributes } from "react";
5
+ import type { LitMaterialCalendar } from "../dist/calendar.js";
6
+
7
+ type ElementProps<E, K extends keyof E> = Omit<DetailedHTMLProps<HTMLAttributes<E>, E>, K> & Partial<Pick<E, K>>;
8
+
9
+ declare module "react" {
10
+ namespace JSX {
11
+ interface IntrinsicElements {
12
+ /** Material Design 3 styled calendar and scheduler: a month grid, week and day time grids, and an agenda list, with a toolbar (previous / today / next, the period's title, and a view switch). Events are controlled: the element never moves an event itself. Dragging, resizing or Alt+arrow keys fire a cancelable `event-change` with the new times; update `events` to accept it. Times are in the browser's (or server's) local time zone. ISO strings without an offset are read as local wall-clock time; date-only strings are local days. `slot-click` and `event-change` hand back local `Date`s. The month view is an ARIA grid of days. The week and day views are one ARIA grid too: a header row of days, an "All day" row, then a row per time slot, each with a time row header. One cell is in the tab order (arrow keys move it); Tab goes on to the events in that cell, each a button named by its title and time. */
13
+ "lit-material-calendar": ElementProps<LitMaterialCalendar, "agendaDays" | "date" | "dayMaxEvents" | "events" | "firstDayOfWeek" | "readonly" | "scrollToHour" | "slotMinutes" | "view"> & {
14
+ "onnavigate"?: (event: CustomEvent) => void;
15
+ "onslot-click"?: (event: CustomEvent) => void;
16
+ "onevent-click"?: (event: CustomEvent) => void;
17
+ "onevent-change"?: (event: CustomEvent) => void;
18
+ };
19
+ }
20
+ }
21
+ }
package/types/vue.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ // Generated by tools/framework-bindings.mjs from custom-elements.json. Do not edit.
2
+ // Types the elements in Vue templates (Volar). Load it with `import type {} from "<package>/vue";`, and
3
+ // tell the compiler they're custom elements: compilerOptions.isCustomElement = (tag) => tag.startsWith("lit-material-").
4
+ import type { DefineComponent } from "vue";
5
+ import type { LitMaterialCalendar } from "../dist/calendar.js";
6
+
7
+ declare module "vue" {
8
+ interface GlobalComponents {
9
+ /** Material Design 3 styled calendar and scheduler: a month grid, week and day time grids, and an agenda list, with a toolbar (previous / today / next, the period's title, and a view switch). Events are controlled: the element never moves an event itself. Dragging, resizing or Alt+arrow keys fire a cancelable `event-change` with the new times; update `events` to accept it. Times are in the browser's (or server's) local time zone. ISO strings without an offset are read as local wall-clock time; date-only strings are local days. `slot-click` and `event-change` hand back local `Date`s. The month view is an ARIA grid of days. The week and day views are one ARIA grid too: a header row of days, an "All day" row, then a row per time slot, each with a time row header. One cell is in the tab order (arrow keys move it); Tab goes on to the events in that cell, each a button named by its title and time. */
10
+ "lit-material-calendar": DefineComponent<Partial<Pick<LitMaterialCalendar, "agendaDays" | "date" | "dayMaxEvents" | "events" | "firstDayOfWeek" | "readonly" | "scrollToHour" | "slotMinutes" | "view">> & {
11
+ onNavigate?: (event: CustomEvent) => void;
12
+ onSlotClick?: (event: CustomEvent) => void;
13
+ onEventClick?: (event: CustomEvent) => void;
14
+ onEventChange?: (event: CustomEvent) => void;
15
+ }>;
16
+ }
17
+ }