@rnwonder/solid-date-picker
Version:
A responsive, highly-customizable datepicker component for SolidJS.
33 lines (30 loc) • 1.3 kB
JavaScript
import { createComponent as o, mergeProps as p } from "solid-js/web";
import { Button as i } from "../Button/index.js";
import { cn as s } from "../../utils/class.js";
const c = (t) => o(i, p(t, { get class() {
return s(`
date-selector-trigger
rn-animate-none
rn-p-[5px]
rn-text-[15px]
rn-font-bold
rn-text-black
dark:rn-text-white
breakTwoCalendar:rn-text-sm`, t.monthYearTriggerBtnClass);
}, get "aria-haspopup"() {
return t.type === "compact-dropdown";
}, get "aria-label"() {
return t.useValueAsName ? "Select a year" : "Select a month";
}, "data-scope": "button", "data-part": "root", get "aria-expanded"() {
return t.isOpen;
}, "data-type": "date-selector-trigger", get style() {
return { ...t.textColor && { color: t.textColor } };
}, get noButtonAnimation() {
return t.noButtonAnimation;
}, get children() {
var r, e, n, a;
return t.children || (t.useValueAsName ? t.option() : t.twoMonthsDisplay ? `${(r = t.optionsArray) == null ? void 0 : r[t.option()]} - ${t.option() === 11 ? (e = t.optionsArray) == null ? void 0 : e[0] : (n = t.optionsArray) == null ? void 0 : n[t.option() + 1]}` : (a = t.optionsArray) == null ? void 0 : a[t.option()]);
} }));
export {
c as SelectorTriggerButton
};