@utrecht/calendar-react 1.0.14 → 1.0.16

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/dist/css.mjs CHANGED
@@ -3561,9 +3561,18 @@ function chunk(array, size, guard) {
3561
3561
  const CalendarNavigation = ({ children, ...props }) => (jsx("div", { className: "utrecht-calendar__navigation", ...props, children: children }));
3562
3562
 
3563
3563
  function r$1(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r$1(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx$1(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r$1(e))&&(n&&(n+=" "),n+=t);return n}
3564
-
3564
+ const APPEARANCE = {
3565
+ 'primary-action-button': 'utrecht-button--primary-action',
3566
+ 'secondary-action-button': 'utrecht-button--secondary-action',
3567
+ 'subtle-button': 'utrecht-button--subtle',
3568
+ };
3569
+ const HINT = {
3570
+ danger: 'utrecht-button--danger',
3571
+ warning: 'utrecht-button--warning',
3572
+ ready: 'utrecht-button--ready',
3573
+ };
3565
3574
  const Button = forwardRef(({ appearance, busy, disabled, children, className, hint, icon, label, pressed, type, ...restProps }, ref) => {
3566
- return (jsxs("button", { ref: ref, className: clsx$1('utrecht-button', busy && 'utrecht-button--busy', disabled && 'utrecht-button--disabled', type === 'submit' && 'utrecht-button--submit', appearance === 'primary-action-button' && 'utrecht-button--primary-action', appearance === 'secondary-action-button' && 'utrecht-button--secondary-action', appearance === 'subtle-button' && 'utrecht-button--subtle', hint === 'danger' && 'utrecht-button--danger', hint === 'warning' && 'utrecht-button--warning', hint === 'ready' && 'utrecht-button--ready', pressed === true && 'utrecht-button--pressed', className), "aria-busy": busy || undefined, "aria-pressed": typeof pressed === 'boolean' ? pressed : undefined, disabled: disabled, type: type || 'button', ...restProps, children: [icon, label && jsx("span", { className: "utrecht-button__label", children: label }), children] }));
3575
+ return (jsxs("button", { ref: ref, className: clsx$1('utrecht-button', busy && 'utrecht-button--busy', disabled && 'utrecht-button--disabled', type === 'submit' && 'utrecht-button--submit', appearance && APPEARANCE[appearance], hint && HINT[hint], pressed === true && 'utrecht-button--pressed', className), "aria-busy": busy || undefined, "aria-pressed": typeof pressed === 'boolean' ? pressed : undefined, disabled: disabled, type: type || 'button', ...restProps, children: [icon, label && jsx("span", { className: "utrecht-button__label", children: label }), children] }));
3567
3576
  });
3568
3577
  Button.displayName = 'Button';
3569
3578
 
@@ -3635,7 +3644,7 @@ const Calendar = ({ onCalendarClick, events, currentDate, locale: locale$1 = loc
3635
3644
  };
3636
3645
  }
3637
3646
  }));
3638
- return (jsxs("div", { className: "utrecht-calendar", children: [jsx(CalendarNavigation, { children: jsx(CalendarNavigationButtons, { previousIcon: jsx(IconArrowLeftDouble, { title: previousYearButtonTitle }), nextIcon: jsx(IconArrowRightDouble, { title: nextYearButtonTitle }), onPreviousClick: () => setVisibleMonth(setYear(visibleMonth, getYear(visibleMonth) - 1)), onNextClick: () => setVisibleMonth(addYears(visibleMonth, 1)), children: jsx(CalendarNavigationButtons, { previousIcon: jsx(IconArrowLeft, { title: previousMonthButtonTitle }), nextIcon: jsx(IconArrowRight, { title: nextMonthButtonTitle }), onPreviousClick: () => setVisibleMonth(setMonth(visibleMonth, visibleMonth.getMonth() - 1)), onNextClick: () => setVisibleMonth(addMonths(visibleMonth, 1)), children: jsx(CalendarNavigationLabel, { dateTime: format(visibleMonth, 'yyyy-mm'), children: format(visibleMonth, 'LLLL Y', { locale: locale$1 }) }) }) }) }), jsxs("table", { className: "utrecht-calendar__table", role: "grid", children: [jsx(CalendarTableWeeksContainer, { children: currentWeek &&
3647
+ return (jsxs("div", { className: "utrecht-calendar", children: [jsx(CalendarNavigation, { children: jsx(CalendarNavigationButtons, { previousIcon: jsx(IconArrowLeftDouble, { title: previousYearButtonTitle }), nextIcon: jsx(IconArrowRightDouble, { title: nextYearButtonTitle }), onPreviousClick: () => setVisibleMonth(setYear(visibleMonth, getYear(visibleMonth) - 1)), onNextClick: () => setVisibleMonth(addYears(visibleMonth, 1)), children: jsx(CalendarNavigationButtons, { previousIcon: jsx(IconArrowLeft, { title: previousMonthButtonTitle }), nextIcon: jsx(IconArrowRight, { title: nextMonthButtonTitle }), onPreviousClick: () => setVisibleMonth(setMonth(visibleMonth, visibleMonth.getMonth() - 1)), onNextClick: () => setVisibleMonth(addMonths(visibleMonth, 1)), children: jsx(CalendarNavigationLabel, { dateTime: format(visibleMonth, 'yyyy-mm'), children: format(visibleMonth, 'LLLL y', { locale: locale$1 }) }) }) }) }), jsxs("table", { className: "utrecht-calendar__table", role: "grid", children: [jsx(CalendarTableWeeksContainer, { children: currentWeek &&
3639
3648
  currentWeek.length > 0 &&
3640
3649
  currentWeek.map((day, index) => (jsx(CalendarTableWeeksItem, { scope: "col", abbr: format(day, 'EEEE', { locale: locale$1 }), children: format(day, 'EEEEEE', { locale: locale$1 }) }, index))) }), jsx(CalendarTableDaysContainer, { children: weeks &&
3641
3650
  weeks.length > 0 &&