@homebound/beam 2.123.4 → 2.124.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.
|
@@ -11,7 +11,7 @@ const Css_1 = require("../../Css");
|
|
|
11
11
|
const utils_1 = require("../../utils");
|
|
12
12
|
require("./DatePicker.css");
|
|
13
13
|
function DatePicker(props) {
|
|
14
|
-
const { value, onSelect, disabledDays } = props;
|
|
14
|
+
const { value, onSelect, disabledDays, dottedDays } = props;
|
|
15
15
|
const tid = (0, utils_1.useTestIds)(props, "datePicker");
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ css: {
|
|
17
17
|
...Css_1.Css.dib.bgWhite.xs.$,
|
|
@@ -20,7 +20,7 @@ function DatePicker(props) {
|
|
|
20
20
|
// Un-collapse the borders so we can hover each cell
|
|
21
21
|
"& .DayPicker-Month": Css_1.Css.add({ borderCollapse: "separate" }).$,
|
|
22
22
|
// // Make the boxes smaller, this ends up being 32x32 which matches figma
|
|
23
|
-
"& .DayPicker-Day": Css_1.Css.
|
|
23
|
+
"& .DayPicker-Day": Css_1.Css.px1.ptPx(6).pbPx(10).xs.ba.bWhite.br4.relative.$,
|
|
24
24
|
// For today, use a background
|
|
25
25
|
"& .DayPicker-Day--today": Css_1.Css.bgGray100.$,
|
|
26
26
|
// For selected, use a background - `--outside` modifier is set on placeholder days not within the viewed month
|
|
@@ -33,12 +33,16 @@ function DatePicker(props) {
|
|
|
33
33
|
"& .DayPicker-Day--disabled": Css_1.Css.cursorNotAllowed.$,
|
|
34
34
|
// Override `.DayPicker-Day:active` background when the day is disabled
|
|
35
35
|
"& .DayPicker-Day--disabled:active": Css_1.Css.bgWhite.$,
|
|
36
|
+
// Display dottedDays using positioned pseudo elements.
|
|
37
|
+
"& .DayPicker-Day--indicatorDot": Css_1.Css.addIn("&:after", Css_1.Css.wPx(4).hPx(4).br4.absolute.bottomPx(5).left("calc(50% - 2px)").bgLightBlue700.add("content", "''").$).$,
|
|
38
|
+
// Update dottedDays color if day is "selected"
|
|
39
|
+
"& .DayPicker-Day--selected.DayPicker-Day--indicatorDot": Css_1.Css.addIn("&:after", Css_1.Css.bgWhite.$).$,
|
|
36
40
|
} }, tid, { children: (0, jsx_runtime_1.jsx)(react_day_picker_1.default, { navbarElement: NavbarElement, weekdayElement: Weekday, selectedDays: [value], initialMonth: value !== null && value !== void 0 ? value : new Date(), onDayClick: (day, modifiers) => {
|
|
37
41
|
if (modifiers.disabled)
|
|
38
42
|
return;
|
|
39
43
|
// Set the day value
|
|
40
44
|
onSelect(day);
|
|
41
|
-
}, disabledDays: disabledDays }, void 0) }), void 0));
|
|
45
|
+
}, disabledDays: disabledDays, modifiers: { indicatorDot: dottedDays } }, void 0) }), void 0));
|
|
42
46
|
}
|
|
43
47
|
exports.DatePicker = DatePicker;
|
|
44
48
|
/** Customize the prev/next button to be our SVG icons. */
|