@studiolxd/brand 49.8.1 → 49.10.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/CHANGELOG.md +126 -0
- package/dist/_shared/calendargrid.js +111 -30
- package/dist/_shared/tokens.js +9 -0
- package/dist/_types/molecules/AppLauncher/AppLauncher.d.ts +19 -0
- package/dist/_types/molecules/CalendarPlanner/CalendarPlanner.d.ts +54 -1
- package/dist/_types/molecules/Card/Card.d.ts +50 -3
- package/dist/_types/molecules/SiteNav/SiteNav.d.ts +12 -0
- package/dist/_types/molecules/_shared/calendarGrid.d.ts +32 -0
- package/dist/_types/molecules/_shared/dropdownItems.d.ts +8 -3
- package/dist/app-launcher.css +1 -1
- package/dist/app-launcher.js +15 -10
- package/dist/brand.css +20 -1
- package/dist/calendar-planner.css +1 -1
- package/dist/calendar-planner.js +185 -89
- package/dist/calendar-roster.js +8 -8
- package/dist/calendar.js +56 -56
- package/dist/card.css +1 -1
- package/dist/card.js +31 -18
- package/dist/site-nav.css +1 -1
- package/dist/site-nav.js +31 -21
- package/dist/tokens.css +20 -1
- package/package.json +341 -171
- package/src/tokens/molecules/app-launcher.css +2 -0
- package/src/tokens/molecules/calendar-planner.css +7 -0
- package/src/tokens/molecules/site-nav.css +3 -0
- package/src/tokens/scss/molecules/_app-launcher.scss +1 -0
- package/src/tokens/scss/molecules/_calendar-planner.scss +6 -0
- package/src/tokens/scss/molecules/_site-nav.scss +2 -0
- package/src/tokens/surface-invert.css +3 -0
- package/src/tokens/surface-light.css +3 -0
- package/src/tokens/surface-public.css +1 -0
- package/src/tokens/tokens.json +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.calendar-planner{gap:var(--calendar-planner-gap);font-family:var(--calendar-planner-font-family);flex-direction:column;width:100%;display:flex}.calendar-planner__header{justify-content:space-between;align-items:center;gap:var(--calendar-planner-items-gap);display:flex}.calendar-planner__title{text-align:center;font-family:var(--calendar-planner-font-family);font-size:var(--calendar-planner-title-font-size);font-weight:var(--calendar-planner-title-font-weight);color:var(--calendar-planner-title-color);flex:1;margin-block:0}.calendar-planner__nav{padding-block:var(--calendar-planner-items-gap);padding-inline:var(--calendar-planner-items-gap);border-radius:var(--calendar-planner-nav-radius);color:var(--calendar-planner-nav-color);cursor:pointer;transition-property:box-shadow;transition-duration:var(--calendar-planner-transition-duration);transition-timing-function:var(--calendar-planner-transition-easing);background-color:#0000;border:none;justify-content:center;align-items:center;display:inline-flex}.calendar-planner__nav:hover{box-shadow:inset 0 calc(-1 * var(--calendar-planner-hover-line-width)) 0 0 var(--calendar-planner-hover-line-color)}.calendar-planner__nav:focus-visible{outline:var(--calendar-planner-nav-focus-ring-width) solid var(--calendar-planner-nav-focus-ring-color);outline-offset:var(--calendar-planner-nav-focus-ring-offset)}.calendar-planner__chevron--prev{transform:rotate(180deg)}.calendar-planner__grid{border-block-start:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);border-inline-start:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);grid-template-columns:1fr;display:grid}.calendar-planner__row{grid-template-columns:repeat(7,1fr);display:grid}.calendar-planner__weekday abbr{cursor:inherit;text-decoration:none}.calendar-planner__weekday{padding-block:var(--calendar-planner-weekday-padding-block);padding-inline:var(--calendar-planner-cell-padding-inline);font-size:var(--calendar-planner-weekday-font-size);font-weight:var(--calendar-planner-weekday-font-weight);color:var(--calendar-planner-weekday-color);text-align:center;border-block-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);border-inline-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);font-family:var(--calendar-planner-font-family)}.calendar-planner__cell{gap:var(--calendar-planner-items-gap);min-height:var(--calendar-planner-cell-min-height);min-width:0;padding-block:var(--calendar-planner-cell-padding-block);padding-inline:var(--calendar-planner-cell-padding-inline);background-color:var(--calendar-planner-cell-bg);border-block-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);border-inline-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);flex-direction:column;display:flex;overflow:hidden}.calendar-planner__cell.calendar-planner__cell--outside{background-color:var(--calendar-planner-cell-outside-bg)}.calendar-planner__cell.calendar-planner__cell--clickable{cursor:pointer}.calendar-planner__cell.calendar-planner__cell--clickable:hover{box-shadow:inset 0 calc(-1 * var(--calendar-planner-hover-line-width)) 0 0 var(--calendar-planner-hover-line-color)}.calendar-planner__cell.calendar-planner__cell--clickable:focus-visible{outline:var(--calendar-planner-cell-focus-ring-width) solid var(--calendar-planner-cell-focus-ring-color);outline-offset:var(--calendar-planner-cell-focus-ring-offset)}.calendar-planner__day-number{width:var(--calendar-planner-day-number-size);height:var(--calendar-planner-day-number-size);border-radius:var(--calendar-planner-day-number-radius);font-size:var(--calendar-planner-day-number-font-size);font-weight:var(--calendar-planner-day-number-font-weight);color:var(--calendar-planner-day-number-color);font-family:var(--calendar-planner-font-family);flex-shrink:0;justify-content:center;align-self:flex-start;align-items:center;display:inline-flex}.calendar-planner__day-number.calendar-planner__day-number--outside{color:var(--calendar-planner-day-number-outside-color)}.calendar-planner__day-number.calendar-planner__day-number--today{background-color:var(--calendar-planner-cell-today-number-bg);color:var(--calendar-planner-cell-today-number-color)}.calendar-planner__cell-body{gap:var(--calendar-planner-items-gap);flex-direction:column;min-width:0;display:flex;overflow:hidden}.calendar-planner__cell-body .tag{text-overflow:ellipsis;max-width:100%;display:block;overflow:hidden}.calendar-planner__more{font-family:var(--calendar-planner-font-family);font-size:var(--calendar-planner-more-font-size);color:var(--calendar-planner-more-color);cursor:pointer;text-align:start;transition-property:color;transition-duration:var(--calendar-planner-transition-duration);transition-timing-function:var(--calendar-planner-transition-easing);background:0 0;border:none;padding-block:0;padding-inline:0;display:inline-block}.calendar-planner__more:hover{color:var(--calendar-planner-more-hover-color)}.calendar-planner__more:focus-visible{outline:var(--calendar-planner-nav-focus-ring-width) solid var(--calendar-planner-more-focus-ring-color);outline-offset:var(--calendar-planner-nav-focus-ring-offset)}.calendar-planner.calendar-planner--sm .calendar-planner__cell{min-height:var(--calendar-planner-sm-cell-min-height)}.calendar-planner.calendar-planner--lg .calendar-planner__cell{min-height:var(--calendar-planner-lg-cell-min-height)}.calendar-planner__modal-events{gap:var(--calendar-planner-items-gap);flex-direction:column;display:flex}
|
|
1
|
+
.calendar-planner{gap:var(--calendar-planner-gap);font-family:var(--calendar-planner-font-family);flex-direction:column;width:100%;display:flex}.calendar-planner__header{justify-content:space-between;align-items:center;gap:var(--calendar-planner-items-gap);display:flex}.calendar-planner__title{text-align:center;font-family:var(--calendar-planner-font-family);font-size:var(--calendar-planner-title-font-size);font-weight:var(--calendar-planner-title-font-weight);color:var(--calendar-planner-title-color);flex:1;margin-block:0}.calendar-planner__nav{padding-block:var(--calendar-planner-items-gap);padding-inline:var(--calendar-planner-items-gap);border-radius:var(--calendar-planner-nav-radius);color:var(--calendar-planner-nav-color);cursor:pointer;transition-property:box-shadow;transition-duration:var(--calendar-planner-transition-duration);transition-timing-function:var(--calendar-planner-transition-easing);background-color:#0000;border:none;justify-content:center;align-items:center;display:inline-flex}.calendar-planner__nav:hover{box-shadow:inset 0 calc(-1 * var(--calendar-planner-hover-line-width)) 0 0 var(--calendar-planner-hover-line-color)}.calendar-planner__nav:focus-visible{outline:var(--calendar-planner-nav-focus-ring-width) solid var(--calendar-planner-nav-focus-ring-color);outline-offset:var(--calendar-planner-nav-focus-ring-offset)}.calendar-planner__chevron--prev{transform:rotate(180deg)}.calendar-planner__grid{border-block-start:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);border-inline-start:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);grid-template-columns:1fr;display:grid}.calendar-planner__row{grid-template-columns:repeat(7,1fr);display:grid}.calendar-planner__weekday abbr{cursor:inherit;text-decoration:none}.calendar-planner__weekday{padding-block:var(--calendar-planner-weekday-padding-block);padding-inline:var(--calendar-planner-cell-padding-inline);font-size:var(--calendar-planner-weekday-font-size);font-weight:var(--calendar-planner-weekday-font-weight);color:var(--calendar-planner-weekday-color);text-align:center;border-block-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);border-inline-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);font-family:var(--calendar-planner-font-family)}.calendar-planner__cell{gap:var(--calendar-planner-items-gap);min-height:var(--calendar-planner-cell-min-height);min-width:0;padding-block:var(--calendar-planner-cell-padding-block);padding-inline:var(--calendar-planner-cell-padding-inline);background-color:var(--calendar-planner-cell-bg);border-block-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);border-inline-end:var(--calendar-planner-grid-border-width) solid var(--calendar-planner-grid-border-color);flex-direction:column;display:flex;overflow:hidden}.calendar-planner__cell.calendar-planner__cell--outside{background-color:var(--calendar-planner-cell-outside-bg)}.calendar-planner__cell.calendar-planner__cell--clickable{cursor:pointer}.calendar-planner__cell.calendar-planner__cell--clickable:hover{box-shadow:inset 0 calc(-1 * var(--calendar-planner-hover-line-width)) 0 0 var(--calendar-planner-hover-line-color)}.calendar-planner__cell.calendar-planner__cell--clickable:focus-visible{outline:var(--calendar-planner-cell-focus-ring-width) solid var(--calendar-planner-cell-focus-ring-color);outline-offset:var(--calendar-planner-cell-focus-ring-offset)}.calendar-planner__day-number{width:var(--calendar-planner-day-number-size);height:var(--calendar-planner-day-number-size);border-radius:var(--calendar-planner-day-number-radius);font-size:var(--calendar-planner-day-number-font-size);font-weight:var(--calendar-planner-day-number-font-weight);color:var(--calendar-planner-day-number-color);font-family:var(--calendar-planner-font-family);flex-shrink:0;justify-content:center;align-self:flex-start;align-items:center;display:inline-flex}.calendar-planner__day-number.calendar-planner__day-number--outside{color:var(--calendar-planner-day-number-outside-color)}.calendar-planner__day-number.calendar-planner__day-number--today{background-color:var(--calendar-planner-cell-today-number-bg);color:var(--calendar-planner-cell-today-number-color)}.calendar-planner__cell-body{gap:var(--calendar-planner-items-gap);flex-direction:column;min-width:0;display:flex;overflow:hidden}.calendar-planner__cell-body .tag{text-overflow:ellipsis;max-width:100%;display:block;overflow:hidden}.calendar-planner__more{font-family:var(--calendar-planner-font-family);font-size:var(--calendar-planner-more-font-size);color:var(--calendar-planner-more-color);cursor:pointer;text-align:start;transition-property:color;transition-duration:var(--calendar-planner-transition-duration);transition-timing-function:var(--calendar-planner-transition-easing);background:0 0;border:none;padding-block:0;padding-inline:0;display:inline-block}.calendar-planner__more:hover{color:var(--calendar-planner-more-hover-color)}.calendar-planner__more:focus-visible{outline:var(--calendar-planner-nav-focus-ring-width) solid var(--calendar-planner-more-focus-ring-color);outline-offset:var(--calendar-planner-nav-focus-ring-offset)}.calendar-planner.calendar-planner--sm .calendar-planner__cell{min-height:var(--calendar-planner-sm-cell-min-height)}.calendar-planner.calendar-planner--lg .calendar-planner__cell{min-height:var(--calendar-planner-lg-cell-min-height)}.calendar-planner__modal-events{gap:var(--calendar-planner-items-gap);flex-direction:column;display:flex}.calendar-planner__weekday.calendar-planner__weekday--dated{justify-content:center;align-items:center;gap:var(--calendar-planner-weekday-gap);display:flex}.calendar-planner__cell.calendar-planner__cell--week{min-height:var(--calendar-planner-week-cell-min-height)}.calendar-planner.calendar-planner--sm .calendar-planner__cell.calendar-planner__cell--week{min-height:var(--calendar-planner-sm-week-cell-min-height)}.calendar-planner.calendar-planner--lg .calendar-planner__cell.calendar-planner__cell--week{min-height:var(--calendar-planner-lg-week-cell-min-height)}.calendar-planner__event{align-items:baseline;gap:var(--calendar-planner-items-gap);min-width:0;display:flex}.calendar-planner__event-time{font-size:var(--calendar-planner-event-time-font-size);color:var(--calendar-planner-event-time-color);font-variant-numeric:tabular-nums;flex-shrink:0}.calendar-planner__event .tag{text-overflow:ellipsis;min-width:0;overflow:hidden}
|
package/dist/calendar-planner.js
CHANGED
|
@@ -3,115 +3,211 @@ import './calendar-planner.css';
|
|
|
3
3
|
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
4
|
import { VisuallyHidden as t } from "./visually-hidden.js";
|
|
5
5
|
import { Tag as n } from "./tag.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { Toggle as r } from "./toggle.js";
|
|
7
|
+
import { ToggleGroup as i } from "./toggle-group.js";
|
|
8
|
+
import { Modal as a } from "./modal.js";
|
|
9
|
+
import { a as o, c as s, d as c, f as ee, i as te, l, n as u, o as ne, p as re, r as d, s as ie, t as ae, u as f } from "./_shared/calendargrid.js";
|
|
10
|
+
import { useCallback as p, useId as oe, useState as m } from "react";
|
|
11
|
+
import { Fragment as se, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
12
|
//#region src/stories/molecules/CalendarPlanner/CalendarPlanner.tsx
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
function _(e) {
|
|
14
|
+
return e.allDay === void 0 ? e.date.getHours() !== 0 || e.date.getMinutes() !== 0 : !e.allDay;
|
|
15
|
+
}
|
|
16
|
+
function ce(e) {
|
|
17
|
+
return [...e].sort((e, t) => {
|
|
18
|
+
let n = Number(_(e)) - Number(_(t));
|
|
19
|
+
return n === 0 ? e.date.getTime() - t.date.getTime() : n;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function v({ events: v = [], renderDay: y, maxItemsPerDay: le = 3, onMoreClick: b, showMoreDialog: x, onDayClick: S, month: C, defaultMonth: w, onMonthChange: T, view: E, defaultView: ue, onViewChange: D, viewSwitcher: de = !1, week: O, defaultWeek: fe, onWeekChange: k, navigable: A = !0, locale: j = "es-ES", previousMonthLabel: pe, nextMonthLabel: me, previousWeekLabel: he = "Semana anterior", nextWeekLabel: ge = "Semana siguiente", monthViewLabel: _e = "Mes", weekViewLabel: ve = "Semana", viewSwitcherLabel: ye = "Vista del calendario", gridLabel: M, moreLabel: N, size: P = "md", className: be }) {
|
|
23
|
+
let [xe, Se] = m(() => C ?? w ?? /* @__PURE__ */ new Date()), [Ce, we] = m(() => c(O ?? fe ?? C ?? w ?? /* @__PURE__ */ new Date())), [Te, Ee] = m(() => E ?? ue ?? "month"), [F, I] = m(null), De = x ?? !b, Oe = p(() => I(null), []), L = C ?? xe, R = c(O ?? Ce), z = E ?? Te, B = z === "week", V = p((e) => {
|
|
24
|
+
Se(e), T?.(e);
|
|
25
|
+
}, [T]), H = p((e) => {
|
|
26
|
+
let t = c(e);
|
|
27
|
+
we(t), k?.(t);
|
|
28
|
+
}, [k]), ke = p((e) => {
|
|
29
|
+
let t = d(R).some(({ date: e }) => ne(e, L));
|
|
30
|
+
!t && e === "week" && H(new Date(L.getFullYear(), L.getMonth(), 1)), !t && e === "month" && V(new Date(R.getFullYear(), R.getMonth(), 1)), Ee(e), D?.(e);
|
|
31
|
+
}, [
|
|
32
|
+
L,
|
|
33
|
+
R,
|
|
34
|
+
V,
|
|
35
|
+
H,
|
|
36
|
+
D
|
|
37
|
+
]), U = e("calendar"), Ae = e("calendarPlanner"), W = /* @__PURE__ */ new Date(), je = P === "sm" ? "xs" : P === "lg" ? "md" : "sm", Me = new Intl.DateTimeFormat(j, {
|
|
38
|
+
month: "long",
|
|
39
|
+
year: "numeric"
|
|
40
|
+
}), Ne = new Intl.DateTimeFormat(j, {
|
|
41
|
+
day: "numeric",
|
|
15
42
|
month: "long",
|
|
16
43
|
year: "numeric"
|
|
17
|
-
}).
|
|
44
|
+
}), Pe = new Date(R.getFullYear(), R.getMonth(), R.getDate() + 6), Fe = Ne.formatRange(R, Pe), Ie = B ? Fe : Me.format(L), G = new Intl.DateTimeFormat(j, {
|
|
18
45
|
weekday: "long",
|
|
19
46
|
day: "numeric",
|
|
20
47
|
month: "long",
|
|
21
48
|
year: "numeric"
|
|
22
|
-
}),
|
|
49
|
+
}), Le = new Intl.DateTimeFormat(j, {
|
|
50
|
+
hour: "2-digit",
|
|
51
|
+
minute: "2-digit"
|
|
52
|
+
}), Re = new Intl.DateTimeFormat(j, {
|
|
23
53
|
weekday: "long",
|
|
24
54
|
day: "numeric",
|
|
25
55
|
month: "long",
|
|
26
56
|
year: "numeric"
|
|
27
|
-
}),
|
|
28
|
-
month:
|
|
29
|
-
onMonthChange:
|
|
30
|
-
onActivate:
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
57
|
+
}), K = te(j, "short"), ze = ae(u(L)), q = d(R), J = l(L, -1), Be = l(L, 1), Y = (e) => v.filter((t) => o(t.date, e)), Ve = ee({
|
|
58
|
+
month: L,
|
|
59
|
+
onMonthChange: V,
|
|
60
|
+
onActivate: S ? (e) => S(e, Y(e)) : void 0
|
|
61
|
+
}), He = re({
|
|
62
|
+
weekStart: R,
|
|
63
|
+
onWeekChange: H,
|
|
64
|
+
onActivate: S ? (e) => S(e, Y(e)) : void 0
|
|
65
|
+
}), X = B ? He : Ve, Z = oe(), Q = B ? `${Z}-planner-title-week-${R.getFullYear()}-${R.getMonth()}-${R.getDate()}` : `${Z}-planner-title-${L.getFullYear()}-${L.getMonth()}`, Ue = [
|
|
66
|
+
"calendar-planner",
|
|
67
|
+
`calendar-planner--${P}`,
|
|
68
|
+
B ? "calendar-planner--week" : "",
|
|
69
|
+
be
|
|
70
|
+
].filter(Boolean).join(" "), We = (e, t) => {
|
|
71
|
+
if (y) return y(e, t);
|
|
72
|
+
let r = B ? ce(t) : t, i = B ? r : r.slice(0, le), a = r.length - i.length;
|
|
73
|
+
return /* @__PURE__ */ g(se, { children: [i.map((e) => B ? /* @__PURE__ */ g("div", {
|
|
74
|
+
className: "calendar-planner__event",
|
|
75
|
+
children: [_(e) && /* @__PURE__ */ h("span", {
|
|
76
|
+
className: "calendar-planner__event-time",
|
|
77
|
+
children: Le.format(e.date)
|
|
78
|
+
}), /* @__PURE__ */ h(n, {
|
|
79
|
+
variant: e.variant ?? "neutral",
|
|
80
|
+
children: e.label
|
|
81
|
+
})]
|
|
82
|
+
}, e.id) : /* @__PURE__ */ h(n, {
|
|
83
|
+
variant: e.variant ?? "neutral",
|
|
84
|
+
children: e.label
|
|
85
|
+
}, e.id)), a > 0 && /* @__PURE__ */ h("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
className: "calendar-planner__more",
|
|
88
|
+
onClick: (n) => {
|
|
89
|
+
n.stopPropagation(), De && I({
|
|
90
|
+
date: e,
|
|
91
|
+
events: t
|
|
92
|
+
}), b?.(e, t);
|
|
93
|
+
},
|
|
94
|
+
children: Ae("more", N)(a)
|
|
95
|
+
})] });
|
|
96
|
+
}, $ = ({ date: e, outside: n }) => {
|
|
97
|
+
let r = o(e, W), i = Y(e), a = [
|
|
98
|
+
"calendar-planner__cell",
|
|
99
|
+
B ? "calendar-planner__cell--week" : "",
|
|
100
|
+
n && "calendar-planner__cell--outside",
|
|
101
|
+
r && "calendar-planner__cell--today",
|
|
102
|
+
S ? "calendar-planner__cell--clickable" : ""
|
|
103
|
+
].filter(Boolean).join(" "), s = [
|
|
104
|
+
"calendar-planner__day-number",
|
|
105
|
+
r && "calendar-planner__day-number--today",
|
|
106
|
+
n && "calendar-planner__day-number--outside"
|
|
107
|
+
].filter(Boolean).join(" ");
|
|
108
|
+
return /* @__PURE__ */ g("div", {
|
|
109
|
+
ref: S ? X.cellRef(e) : void 0,
|
|
110
|
+
role: "gridcell",
|
|
111
|
+
className: a,
|
|
112
|
+
"aria-current": r ? "date" : void 0,
|
|
113
|
+
tabIndex: S ? X.isTabbable(e) ? 0 : -1 : void 0,
|
|
114
|
+
onFocus: S ? () => X.onCellFocus(e) : void 0,
|
|
115
|
+
onClick: S ? () => S(e, i) : void 0,
|
|
116
|
+
children: [!B && /* @__PURE__ */ g("span", {
|
|
117
|
+
className: s,
|
|
118
|
+
children: [/* @__PURE__ */ h(t, { children: G.format(e) }), /* @__PURE__ */ h("span", {
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
children: e.getDate()
|
|
121
|
+
})]
|
|
122
|
+
}), /* @__PURE__ */ h("div", {
|
|
123
|
+
className: "calendar-planner__cell-body",
|
|
124
|
+
children: We(e, i)
|
|
125
|
+
})]
|
|
126
|
+
}, e.toISOString());
|
|
127
|
+
};
|
|
128
|
+
return /* @__PURE__ */ g("div", {
|
|
129
|
+
className: Ue,
|
|
38
130
|
children: [
|
|
39
|
-
|
|
131
|
+
ie({
|
|
40
132
|
block: "calendar-planner",
|
|
41
|
-
title:
|
|
42
|
-
titleId:
|
|
43
|
-
navigable:
|
|
44
|
-
previousLabel:
|
|
45
|
-
nextLabel:
|
|
46
|
-
onPrev: () =>
|
|
47
|
-
onNext: () =>
|
|
48
|
-
chevronSize:
|
|
133
|
+
title: Ie,
|
|
134
|
+
titleId: Q,
|
|
135
|
+
navigable: A,
|
|
136
|
+
previousLabel: A ? B ? he : U("previousMonth", pe) : void 0,
|
|
137
|
+
nextLabel: A ? B ? ge : U("nextMonth", me) : void 0,
|
|
138
|
+
onPrev: () => B ? H(f(R, -1)) : V(J),
|
|
139
|
+
onNext: () => B ? H(f(R, 1)) : V(Be),
|
|
140
|
+
chevronSize: je,
|
|
141
|
+
children: de ? /* @__PURE__ */ g(i, {
|
|
142
|
+
className: "calendar-planner__views",
|
|
143
|
+
"aria-label": ye,
|
|
144
|
+
size: P,
|
|
145
|
+
value: [z],
|
|
146
|
+
onValueChange: (e) => {
|
|
147
|
+
let t = e[0];
|
|
148
|
+
t && ke(t);
|
|
149
|
+
},
|
|
150
|
+
children: [/* @__PURE__ */ h(r, {
|
|
151
|
+
value: "month",
|
|
152
|
+
children: _e
|
|
153
|
+
}), /* @__PURE__ */ h(r, {
|
|
154
|
+
value: "week",
|
|
155
|
+
children: ve
|
|
156
|
+
})]
|
|
157
|
+
}) : void 0
|
|
49
158
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
className: "calendar-planner__grid",
|
|
159
|
+
/* @__PURE__ */ g("div", {
|
|
160
|
+
className: ["calendar-planner__grid", B ? "calendar-planner__grid--week" : ""].filter(Boolean).join(" "),
|
|
52
161
|
role: "grid",
|
|
53
|
-
"aria-label":
|
|
54
|
-
"aria-labelledby":
|
|
55
|
-
onKeyDown:
|
|
56
|
-
children: [
|
|
57
|
-
block: "calendar-planner",
|
|
58
|
-
rowModifier: "header",
|
|
59
|
-
weekdays: q
|
|
60
|
-
}), J.map((e, r) => /* @__PURE__ */ m("div", {
|
|
162
|
+
"aria-label": M,
|
|
163
|
+
"aria-labelledby": M ? void 0 : Q,
|
|
164
|
+
onKeyDown: S ? X.onKeyDown : void 0,
|
|
165
|
+
children: [B ? /* @__PURE__ */ h("div", {
|
|
61
166
|
role: "row",
|
|
62
|
-
className: "calendar-planner__row",
|
|
63
|
-
children:
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
className: u,
|
|
83
|
-
children: [/* @__PURE__ */ m(t, { children: G.format(e) }), /* @__PURE__ */ m("span", {
|
|
84
|
-
"aria-hidden": "true",
|
|
85
|
-
children: e.getDate()
|
|
86
|
-
})]
|
|
87
|
-
}), /* @__PURE__ */ m("div", {
|
|
88
|
-
className: "calendar-planner__cell-body",
|
|
89
|
-
children: _ ? _(e, o) : /* @__PURE__ */ h(te, { children: [s.map((e) => /* @__PURE__ */ m(n, {
|
|
90
|
-
variant: e.variant ?? "neutral",
|
|
91
|
-
children: e.label
|
|
92
|
-
}, e.id)), c > 0 && /* @__PURE__ */ m("button", {
|
|
93
|
-
type: "button",
|
|
94
|
-
className: "calendar-planner__more",
|
|
95
|
-
onClick: (t) => {
|
|
96
|
-
t.stopPropagation(), I && F({
|
|
97
|
-
date: e,
|
|
98
|
-
events: o
|
|
99
|
-
}), y?.(e, o);
|
|
100
|
-
},
|
|
101
|
-
children: V("more", ne)(c)
|
|
102
|
-
})] })
|
|
167
|
+
className: "calendar-planner__row calendar-planner__row--header",
|
|
168
|
+
children: q.map(({ date: e }, t) => {
|
|
169
|
+
let n = o(e, W);
|
|
170
|
+
return /* @__PURE__ */ g("div", {
|
|
171
|
+
role: "columnheader",
|
|
172
|
+
className: [
|
|
173
|
+
"calendar-planner__weekday",
|
|
174
|
+
"calendar-planner__weekday--dated",
|
|
175
|
+
n && "calendar-planner__weekday--today"
|
|
176
|
+
].filter(Boolean).join(" "),
|
|
177
|
+
"aria-label": G.format(e),
|
|
178
|
+
"aria-current": n ? "date" : void 0,
|
|
179
|
+
children: [/* @__PURE__ */ h("abbr", {
|
|
180
|
+
"aria-hidden": "true",
|
|
181
|
+
title: K[t].long,
|
|
182
|
+
children: K[t].short
|
|
183
|
+
}), /* @__PURE__ */ h("span", {
|
|
184
|
+
"aria-hidden": "true",
|
|
185
|
+
className: ["calendar-planner__day-number", n && "calendar-planner__day-number--today"].filter(Boolean).join(" "),
|
|
186
|
+
children: e.getDate()
|
|
103
187
|
})]
|
|
104
188
|
}, e.toISOString());
|
|
105
189
|
})
|
|
106
|
-
}
|
|
190
|
+
}) : s({
|
|
191
|
+
block: "calendar-planner",
|
|
192
|
+
rowModifier: "header",
|
|
193
|
+
weekdays: K
|
|
194
|
+
}), B ? /* @__PURE__ */ h("div", {
|
|
195
|
+
role: "row",
|
|
196
|
+
className: "calendar-planner__row",
|
|
197
|
+
children: q.map((e) => $(e))
|
|
198
|
+
}) : ze.map((e, t) => /* @__PURE__ */ h("div", {
|
|
199
|
+
role: "row",
|
|
200
|
+
className: "calendar-planner__row",
|
|
201
|
+
children: e.map((e) => $(e))
|
|
202
|
+
}, t))]
|
|
107
203
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
open:
|
|
110
|
-
onClose:
|
|
111
|
-
title:
|
|
112
|
-
children: /* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ h(a, {
|
|
205
|
+
open: F !== null,
|
|
206
|
+
onClose: Oe,
|
|
207
|
+
title: F ? Re.format(F.date) : void 0,
|
|
208
|
+
children: /* @__PURE__ */ h("div", {
|
|
113
209
|
className: "calendar-planner__modal-events",
|
|
114
|
-
children:
|
|
210
|
+
children: F?.events.map((e) => /* @__PURE__ */ h(n, {
|
|
115
211
|
variant: e.variant ?? "neutral",
|
|
116
212
|
children: e.label
|
|
117
213
|
}, e.id))
|
|
@@ -121,4 +217,4 @@ function g({ events: g = [], renderDay: _, maxItemsPerDay: v = 3, onMoreClick: y
|
|
|
121
217
|
});
|
|
122
218
|
}
|
|
123
219
|
//#endregion
|
|
124
|
-
export {
|
|
220
|
+
export { v as CalendarPlanner };
|
package/dist/calendar-roster.js
CHANGED
|
@@ -3,7 +3,7 @@ import './calendar-roster.css';
|
|
|
3
3
|
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
4
|
import { Tag as t } from "./tag.js";
|
|
5
5
|
import { PrevNextNav as n } from "./prev-next-nav.js";
|
|
6
|
-
import {
|
|
6
|
+
import { a as r, l as i } from "./_shared/calendargrid.js";
|
|
7
7
|
import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
//#region src/stories/molecules/CalendarRoster/CalendarRoster.tsx
|
|
9
9
|
function c(e) {
|
|
@@ -50,7 +50,7 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
50
50
|
let D = e("calendar"), O = e("calendarRoster"), k = S ?? (b ? d.map(({ type: e, key: t }) => ({
|
|
51
51
|
type: e,
|
|
52
52
|
label: O(t)
|
|
53
|
-
})) : []), A = /* @__PURE__ */ new Date(), j = l(p), M =
|
|
53
|
+
})) : []), A = /* @__PURE__ */ new Date(), j = l(p), M = i(p, -1), N = i(p, 1), P = new Intl.DateTimeFormat(x, {
|
|
54
54
|
month: "long",
|
|
55
55
|
year: "numeric"
|
|
56
56
|
}).format(p), F = new Intl.DateTimeFormat(x, { weekday: "narrow" }), I = new Intl.DateTimeFormat(x, { weekday: "long" }), L = m ? (e) => (t) => {
|
|
@@ -83,17 +83,17 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
83
83
|
scope: "col",
|
|
84
84
|
children: O("name", v)
|
|
85
85
|
}), j.map((e) => {
|
|
86
|
-
let t =
|
|
86
|
+
let t = r(e, A), n = [
|
|
87
87
|
"calendar-roster__th-day",
|
|
88
88
|
c(e) && "calendar-roster__th-day--weekend",
|
|
89
89
|
t && "calendar-roster__th-day--today"
|
|
90
|
-
].filter(Boolean).join(" "),
|
|
90
|
+
].filter(Boolean).join(" "), i = String(e.getDate()).padStart(2, "0"), a = F.format(e), l = I.format(e);
|
|
91
91
|
return /* @__PURE__ */ s("th", {
|
|
92
92
|
className: n,
|
|
93
93
|
scope: "col",
|
|
94
94
|
children: [/* @__PURE__ */ o("div", {
|
|
95
95
|
className: "calendar-roster__th-day-number",
|
|
96
|
-
children:
|
|
96
|
+
children: i
|
|
97
97
|
}), /* @__PURE__ */ o("div", {
|
|
98
98
|
className: "calendar-roster__th-day-sub",
|
|
99
99
|
children: /* @__PURE__ */ o("abbr", {
|
|
@@ -108,7 +108,7 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
108
108
|
title: e.name,
|
|
109
109
|
children: e.name
|
|
110
110
|
}), j.map((n) => {
|
|
111
|
-
let
|
|
111
|
+
let i = n.getDate(), l = e.cells[i] ?? null, d = c(n), f = r(n, A), p = l?.type === "holiday", m = l?.type === "non-working";
|
|
112
112
|
return /* @__PURE__ */ o("td", {
|
|
113
113
|
className: [
|
|
114
114
|
"calendar-roster__cell",
|
|
@@ -117,14 +117,14 @@ function f({ rows: f, month: p, onMonthChange: m, hrefBuilder: h, linkComponent:
|
|
|
117
117
|
m && "calendar-roster__cell--non-working",
|
|
118
118
|
f && "calendar-roster__cell--today"
|
|
119
119
|
].filter(Boolean).join(" "),
|
|
120
|
-
children: _ ? _(
|
|
120
|
+
children: _ ? _(i, n, l) : /* @__PURE__ */ s(a, { children: [l?.type === "schedule" && /* @__PURE__ */ o("span", {
|
|
121
121
|
className: "calendar-roster__schedule",
|
|
122
122
|
children: l.label
|
|
123
123
|
}), l && l.type !== "schedule" && l.type !== "non-working" && /* @__PURE__ */ o(t, {
|
|
124
124
|
variant: u[l.type],
|
|
125
125
|
children: l.type === "birthday" ? `${y}${l.label}` : l.label
|
|
126
126
|
})] })
|
|
127
|
-
},
|
|
127
|
+
}, i);
|
|
128
128
|
})] }, e.id)) })]
|
|
129
129
|
})
|
|
130
130
|
}),
|
package/dist/calendar.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './calendar.css';
|
|
3
3
|
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
-
import { a as t, c as n,
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { jsx as
|
|
4
|
+
import { a as t, c as n, f as r, i, l as a, n as o, o as s, s as c, t as ee } from "./_shared/calendargrid.js";
|
|
5
|
+
import { useCallback as l, useEffect as u, useId as d, useRef as f, useState as p } from "react";
|
|
6
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
7
7
|
//#region src/stories/molecules/Calendar/Calendar.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
return Math.floor(e /
|
|
8
|
+
var g = 12, _ = 4;
|
|
9
|
+
function v(e) {
|
|
10
|
+
return Math.floor(e / g) * g;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
let j = e("calendar"), [se, ce] =
|
|
14
|
-
ce(e),
|
|
15
|
-
}, [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]), F =
|
|
12
|
+
function y({ value: y, onChange: te, defaultMonth: ne, month: b, onMonthChange: x, navigable: S = !0, disabledDates: C, minDate: w, maxDate: T, locale: E = "es-ES", previousMonthLabel: re, nextMonthLabel: ie, previousYearsLabel: ae, nextYearsLabel: oe, yearGridLabel: D, gridLabel: O, size: k = "md", className: A }) {
|
|
13
|
+
let j = e("calendar"), [se, ce] = p(() => b ?? ne ?? (y instanceof Date ? y : /* @__PURE__ */ new Date())), M = b ?? se, N = l((e) => {
|
|
14
|
+
ce(e), x?.(e);
|
|
15
|
+
}, [x]), P = /* @__PURE__ */ new Date(), le = l((e) => w && e < w || T && e > T ? !0 : Array.isArray(C) ? C.some((n) => t(n, e)) : typeof C == "function" ? C(e) : !1, [
|
|
16
|
+
C,
|
|
17
|
+
w,
|
|
18
|
+
T
|
|
19
|
+
]), F = r({
|
|
20
20
|
month: M,
|
|
21
21
|
onMonthChange: N,
|
|
22
|
-
selected:
|
|
23
|
-
minDate:
|
|
24
|
-
maxDate:
|
|
25
|
-
}), [I, L] =
|
|
22
|
+
selected: y ?? null,
|
|
23
|
+
minDate: w,
|
|
24
|
+
maxDate: T
|
|
25
|
+
}), [I, L] = p("days"), [R, z] = p(() => v(M.getFullYear())), [B, V] = p(() => M.getFullYear()), H = f(null), U = f(/* @__PURE__ */ new Map()), W = f(null), ue = l(() => {
|
|
26
26
|
let e = M.getFullYear();
|
|
27
|
-
z(
|
|
28
|
-
}, [M]), G =
|
|
27
|
+
z(v(e)), V(e), W.current = "year", L("years");
|
|
28
|
+
}, [M]), G = l(() => {
|
|
29
29
|
W.current = "title", L("days");
|
|
30
|
-
}, []), de =
|
|
30
|
+
}, []), de = l((e) => {
|
|
31
31
|
N(new Date(e, M.getMonth(), 1)), G();
|
|
32
32
|
}, [
|
|
33
33
|
G,
|
|
34
34
|
M,
|
|
35
35
|
N
|
|
36
36
|
]);
|
|
37
|
-
|
|
37
|
+
u(() => {
|
|
38
38
|
if (!W.current) return;
|
|
39
39
|
let e = W.current;
|
|
40
40
|
W.current = null, e === "title" ? H.current?.focus() : U.current.get(B)?.focus();
|
|
41
41
|
}, [I, B]);
|
|
42
|
-
let fe = k === "sm" ? "xs" : k === "lg" ? "md" : "sm", pe = new Intl.DateTimeFormat(
|
|
42
|
+
let fe = k === "sm" ? "xs" : k === "lg" ? "md" : "sm", pe = new Intl.DateTimeFormat(E, {
|
|
43
43
|
month: "long",
|
|
44
44
|
year: "numeric"
|
|
45
|
-
}).format(M), me = new Intl.DateTimeFormat(
|
|
45
|
+
}).format(M), me = new Intl.DateTimeFormat(E, { year: "numeric" }), K = (e) => me.format(new Date(e, 0, 1)), he = Array.from({ length: g }, (e, t) => R + t), ge = `${K(R)}–${K(R + g - 1)}`, _e = new Intl.DateTimeFormat(E, {
|
|
46
46
|
weekday: "long",
|
|
47
47
|
day: "numeric",
|
|
48
48
|
month: "long",
|
|
49
49
|
year: "numeric"
|
|
50
|
-
}), ve =
|
|
51
|
-
(e < R || e > R +
|
|
50
|
+
}), ve = i(E, "narrow"), ye = ee(o(M)), q = a(M, -1), J = a(M, 1), be = w ? !s(q, w) && q < w : !1, xe = T ? !s(J, T) && J > T : !1, Se = (e) => (w ? e < w.getFullYear() : !1) || (T ? e > T.getFullYear() : !1), Ce = w ? R - 1 < w.getFullYear() : !1, we = T ? R + g > T.getFullYear() : !1, Y = I === "years", X = B >= R && B <= R + g - 1 ? B : R, Te = (e) => {
|
|
51
|
+
(e < R || e > R + g - 1) && z(v(e)), W.current = "year", V(e);
|
|
52
52
|
}, Z = (e) => {
|
|
53
53
|
let t = null;
|
|
54
54
|
switch (e.key) {
|
|
@@ -59,22 +59,22 @@ function _({ value: _, onChange: re, defaultMonth: ie, month: v, onMonthChange:
|
|
|
59
59
|
t = X + 1;
|
|
60
60
|
break;
|
|
61
61
|
case "ArrowUp":
|
|
62
|
-
t = X -
|
|
62
|
+
t = X - _;
|
|
63
63
|
break;
|
|
64
64
|
case "ArrowDown":
|
|
65
|
-
t = X +
|
|
65
|
+
t = X + _;
|
|
66
66
|
break;
|
|
67
67
|
case "Home":
|
|
68
68
|
t = R;
|
|
69
69
|
break;
|
|
70
70
|
case "End":
|
|
71
|
-
t = R +
|
|
71
|
+
t = R + g - 1;
|
|
72
72
|
break;
|
|
73
73
|
case "PageUp":
|
|
74
|
-
t = X -
|
|
74
|
+
t = X - g;
|
|
75
75
|
break;
|
|
76
76
|
case "PageDown":
|
|
77
|
-
t = X +
|
|
77
|
+
t = X + g;
|
|
78
78
|
break;
|
|
79
79
|
case "Escape":
|
|
80
80
|
e.preventDefault(), G();
|
|
@@ -82,39 +82,39 @@ function _({ value: _, onChange: re, defaultMonth: ie, month: v, onMonthChange:
|
|
|
82
82
|
default: return;
|
|
83
83
|
}
|
|
84
84
|
e.preventDefault(), Te(t);
|
|
85
|
-
}, Q =
|
|
86
|
-
return /* @__PURE__ */
|
|
85
|
+
}, Q = d(), $ = Y ? `${Q}-calendar-title-${R}` : `${Q}-calendar-title-${M.getFullYear()}-${M.getMonth()}`;
|
|
86
|
+
return /* @__PURE__ */ h("div", {
|
|
87
87
|
className: [
|
|
88
88
|
"calendar",
|
|
89
89
|
`calendar--${k}`,
|
|
90
90
|
A
|
|
91
91
|
].filter(Boolean).join(" "),
|
|
92
|
-
children: [
|
|
92
|
+
children: [c({
|
|
93
93
|
block: "calendar",
|
|
94
94
|
title: Y ? ge : pe,
|
|
95
95
|
titleId: $,
|
|
96
|
-
navigable:
|
|
97
|
-
previousLabel:
|
|
98
|
-
nextLabel:
|
|
96
|
+
navigable: S,
|
|
97
|
+
previousLabel: S ? Y ? j("previousYears", ae) : j("previousMonth", re) : void 0,
|
|
98
|
+
nextLabel: S ? Y ? j("nextYears", oe) : j("nextMonth", ie) : void 0,
|
|
99
99
|
prevDisabled: Y ? Ce : be,
|
|
100
100
|
nextDisabled: Y ? we : xe,
|
|
101
|
-
onPrev: Y ? () => z(R -
|
|
102
|
-
onNext: Y ? () => z(R +
|
|
101
|
+
onPrev: Y ? () => z(R - g) : () => N(q),
|
|
102
|
+
onNext: Y ? () => z(R + g) : () => N(J),
|
|
103
103
|
chevronSize: fe,
|
|
104
104
|
onTitleClick: Y ? G : ue,
|
|
105
105
|
titleExpanded: Y,
|
|
106
106
|
titleRef: H
|
|
107
|
-
}), Y ? /* @__PURE__ */
|
|
107
|
+
}), Y ? /* @__PURE__ */ m("div", {
|
|
108
108
|
className: "calendar__years",
|
|
109
109
|
role: "grid",
|
|
110
110
|
"aria-label": j("yearGrid", D),
|
|
111
111
|
onKeyDown: Z,
|
|
112
|
-
children: Array.from({ length:
|
|
112
|
+
children: Array.from({ length: g / _ }, (e, t) => /* @__PURE__ */ m("div", {
|
|
113
113
|
role: "row",
|
|
114
114
|
className: "calendar__row",
|
|
115
|
-
children: he.slice(t *
|
|
116
|
-
let t = Se(e), n = e === P.getFullYear(), r =
|
|
117
|
-
return /* @__PURE__ */
|
|
115
|
+
children: he.slice(t * _, t * _ + _).map((e) => {
|
|
116
|
+
let t = Se(e), n = e === P.getFullYear(), r = y instanceof Date ? y.getFullYear() === e : !1;
|
|
117
|
+
return /* @__PURE__ */ m("button", {
|
|
118
118
|
ref: (t) => {
|
|
119
119
|
t ? U.current.set(e, t) : U.current.delete(e);
|
|
120
120
|
},
|
|
@@ -136,44 +136,44 @@ function _({ value: _, onChange: re, defaultMonth: ie, month: v, onMonthChange:
|
|
|
136
136
|
}, e);
|
|
137
137
|
})
|
|
138
138
|
}, t))
|
|
139
|
-
}) : /* @__PURE__ */
|
|
139
|
+
}) : /* @__PURE__ */ h("div", {
|
|
140
140
|
className: "calendar__grid",
|
|
141
141
|
role: "grid",
|
|
142
142
|
"aria-label": O,
|
|
143
143
|
"aria-labelledby": O ? void 0 : $,
|
|
144
144
|
onKeyDown: F.onKeyDown,
|
|
145
|
-
children: [
|
|
145
|
+
children: [n({
|
|
146
146
|
block: "calendar",
|
|
147
147
|
weekdays: ve
|
|
148
|
-
}), ye.map((e,
|
|
148
|
+
}), ye.map((e, n) => /* @__PURE__ */ m("div", {
|
|
149
149
|
role: "row",
|
|
150
150
|
className: "calendar__row",
|
|
151
|
-
children: e.map(({ date: e, outside:
|
|
152
|
-
let
|
|
151
|
+
children: e.map(({ date: e, outside: n }) => {
|
|
152
|
+
let r = le(e), i = t(e, P), a = y instanceof Date ? t(e, y) : !1, o = [
|
|
153
153
|
"calendar__day",
|
|
154
|
-
|
|
154
|
+
n && "calendar__day--outside",
|
|
155
155
|
i && "calendar__day--today",
|
|
156
156
|
a && "calendar__day--selected",
|
|
157
|
-
|
|
157
|
+
r && "calendar__day--disabled"
|
|
158
158
|
].filter(Boolean).join(" ");
|
|
159
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ m("button", {
|
|
160
160
|
ref: F.cellRef(e),
|
|
161
161
|
type: "button",
|
|
162
162
|
role: "gridcell",
|
|
163
163
|
className: o,
|
|
164
164
|
"aria-label": _e.format(e),
|
|
165
165
|
"aria-selected": a,
|
|
166
|
-
"aria-disabled":
|
|
166
|
+
"aria-disabled": r ? "true" : void 0,
|
|
167
167
|
"aria-current": i ? "date" : void 0,
|
|
168
168
|
tabIndex: F.isTabbable(e) ? 0 : -1,
|
|
169
169
|
onFocus: () => F.onCellFocus(e),
|
|
170
|
-
onClick:
|
|
170
|
+
onClick: r ? void 0 : () => te?.(e),
|
|
171
171
|
children: e.getDate()
|
|
172
172
|
}, e.toISOString());
|
|
173
173
|
})
|
|
174
|
-
},
|
|
174
|
+
}, n))]
|
|
175
175
|
})]
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
//#endregion
|
|
179
|
-
export {
|
|
179
|
+
export { y as Calendar };
|