@koine/react 2.0.0-beta.15 → 2.0.0-beta.17
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/Animations/useReveal.js +4 -3
- package/Autocomplete/AutocompleteMui.js +4 -4
- package/Autocomplete/helpers.js +1 -2
- package/Breadcrumbs/Breadcrumbs.js +1 -1
- package/Calendar/CalendarDaygridCell.js +2 -2
- package/Calendar/CalendarDaygridNav.js +3 -2
- package/Calendar/CalendarDaygridTable.js +5 -5
- package/Calendar/CalendarLegend.js +2 -1
- package/Calendar/calendar-api-google.js +1 -3
- package/Calendar/useCalendar.js +15 -15
- package/Details/Details.d.ts +60 -60
- package/Details/Details.js +6 -6
- package/Dialog/DialogMui.d.ts +9 -9
- package/Dialog/DialogMui.js +1 -1
- package/Dialog/css/bare.d.ts +8 -8
- package/Dialog/css/bare.js +2 -1
- package/Dialog/m/bare.js +1 -1
- package/Dialog/sc/bare.d.ts +2 -2
- package/Dialog/sc/bare.js +1 -1
- package/Dialog/sc/framer.js +1 -1
- package/Dialog/sc/framerMaterial.js +1 -1
- package/Dialog/sc/material.d.ts +2 -2
- package/Dialog/sc/material.js +1 -1
- package/Dialog/tw/bare.d.ts +5 -5
- package/Dialog/tw/bare.js +2 -1
- package/Dialog/tw/elegant.d.ts +5 -5
- package/Dialog/tw/elegant.js +2 -1
- package/Dialog/tw/framer.d.ts +2 -2
- package/Dialog/tw/framer.js +1 -1
- package/Dialog/tw/framerMaterial.d.ts +2 -2
- package/Dialog/tw/framerMaterial.js +1 -1
- package/Dialog/tw/material.d.ts +5 -5
- package/Dialog/tw/material.js +2 -1
- package/Form/Form.d.ts +1 -1
- package/Form/Form.js +3 -3
- package/Form/sc/bare.js +1 -1
- package/Forms/Field/FieldControl.js +1 -1
- package/Forms/Password/Password.js +2 -2
- package/Forms/antispam.js +1 -3
- package/Forms/helpers.js +1 -2
- package/Grid/Grid.js +2 -2
- package/Header/useHeader.js +6 -5
- package/MenuItem/useMenuItem.js +2 -2
- package/Pagination/PaginationNav.js +1 -1
- package/Progress/ProgressOverlay.js +2 -2
- package/Rating/Rating.js +3 -3
- package/Sidebar/Sidebar.js +3 -3
- package/Spacing/Spacing.js +4 -4
- package/Tabs/TabsMui.d.ts +5 -5
- package/Tabs/TabsMui.js +1 -1
- package/Tabs/tw/bare.d.ts +4 -4
- package/Tabs/tw/bare.js +2 -1
- package/Tabs/tw/material.d.ts +1 -1
- package/Tabs/tw/material.js +2 -1
- package/Tabs/useTabs.js +3 -2
- package/Typography/ReadMore.js +6 -6
- package/Typography/TextLoop.js +4 -4
- package/{helpers/createUseMediaQueryWidth.d.ts → createUseMediaQueryWidth.d.ts} +1 -1
- package/{helpers/createUseMediaQueryWidth.js → createUseMediaQueryWidth.js} +6 -6
- package/css/index.d.ts +0 -1
- package/css/index.js +0 -1
- package/index.d.ts +25 -1
- package/index.js +24 -1
- package/package.json +79 -94
- package/sc/index.d.ts +0 -1
- package/sc/index.js +0 -1
- package/scm/index.d.ts +0 -1
- package/scm/index.js +0 -1
- package/shared/index.d.ts +3 -4
- package/shared/index.js +3 -4
- package/styles/media.js +3 -2
- package/styles/theme--vanilla.js +4 -3
- package/styles/theme.js +2 -2
- package/tw/index.d.ts +0 -1
- package/tw/index.js +0 -1
- package/twm/index.d.ts +0 -1
- package/twm/index.js +0 -1
- package/types.d.ts +2 -0
- package/{hooks/useAsyncFn.js → useAsyncFn.js} +3 -3
- package/{hooks/useDateLocale.js → useDateLocale.js} +3 -3
- package/{hooks/useFixedOffset.js → useFixedOffset.js} +2 -5
- package/{hooks/useInterval.js → useInterval.js} +3 -3
- package/useIsomorphicLayoutEffect.d.ts +3 -0
- package/{hooks/useIsomorphicLayoutEffect.js → useIsomorphicLayoutEffect.js} +1 -1
- package/{hooks/useKeyUp.js → useKeyUp.js} +3 -3
- package/{hooks/useMeasure.js → useMeasure.js} +11 -15
- package/{hooks/useNavigateAway.js → useNavigateAway.js} +1 -1
- package/{hooks/usePrevious.js → usePrevious.js} +2 -1
- package/{hooks/useScrollPosition.js → useScrollPosition.js} +2 -2
- package/{hooks/useScrollThreshold.js → useScrollThreshold.js} +4 -3
- package/{hooks/useScrollTo.js → useScrollTo.js} +4 -3
- package/{hooks/useSmoothScroll.js → useSmoothScroll.js} +2 -3
- package/{hooks/useSpinDelay.js → useSpinDelay.js} +2 -1
- package/{hooks/useTraceUpdate.js → useTraceUpdate.js} +2 -1
- package/{hooks/useWindowSize.d.ts → useWindowSize.d.ts} +1 -1
- package/{hooks/useWindowSize.js → useWindowSize.js} +4 -4
- package/Meta/index.d.ts +0 -2
- package/Meta/index.js +0 -2
- package/NoJs/index.d.ts +0 -2
- package/NoJs/index.js +0 -2
- package/helpers/index.d.ts +0 -4
- package/helpers/index.js +0 -4
- package/hooks/index.d.ts +0 -20
- package/hooks/index.js +0 -20
- package/hooks/types.d.ts +0 -2
- package/hooks/types.js +0 -1
- package/hooks/useIsomorphicLayoutEffect.d.ts +0 -3
- /package/{Meta/Meta.d.ts → Meta.d.ts} +0 -0
- /package/{Meta/Meta.js → Meta.js} +0 -0
- /package/{NoJs/NoJs.d.ts → NoJs.d.ts} +0 -0
- /package/{NoJs/NoJs.js → NoJs.js} +0 -0
- /package/{helpers/classed.d.ts → classed.d.ts} +0 -0
- /package/{helpers/classed.js → classed.js} +0 -0
- /package/{helpers/extend-component.d.ts → extendComponent.d.ts} +0 -0
- /package/{helpers/extend-component.js → extendComponent.js} +0 -0
- /package/{helpers/mergeRefs.d.ts → mergeRefs.d.ts} +0 -0
- /package/{helpers/mergeRefs.js → mergeRefs.js} +0 -0
- /package/{hooks/useAsyncFn.d.ts → useAsyncFn.d.ts} +0 -0
- /package/{hooks/useDateLocale.d.ts → useDateLocale.d.ts} +0 -0
- /package/{hooks/useFirstMountState.d.ts → useFirstMountState.d.ts} +0 -0
- /package/{hooks/useFirstMountState.js → useFirstMountState.js} +0 -0
- /package/{hooks/useFixedOffset.d.ts → useFixedOffset.d.ts} +0 -0
- /package/{hooks/useFocus.d.ts → useFocus.d.ts} +0 -0
- /package/{hooks/useFocus.js → useFocus.js} +0 -0
- /package/{hooks/useInterval.d.ts → useInterval.d.ts} +0 -0
- /package/{hooks/useKeyUp.d.ts → useKeyUp.d.ts} +0 -0
- /package/{hooks/useMeasure.d.ts → useMeasure.d.ts} +0 -0
- /package/{hooks/useMountedState.d.ts → useMountedState.d.ts} +0 -0
- /package/{hooks/useMountedState.js → useMountedState.js} +0 -0
- /package/{hooks/useNavigateAway.d.ts → useNavigateAway.d.ts} +0 -0
- /package/{hooks/usePrevious.d.ts → usePrevious.d.ts} +0 -0
- /package/{hooks/usePreviousRef.d.ts → usePreviousRef.d.ts} +0 -0
- /package/{hooks/usePreviousRef.js → usePreviousRef.js} +0 -0
- /package/{hooks/useScrollPosition.d.ts → useScrollPosition.d.ts} +0 -0
- /package/{hooks/useScrollThreshold.d.ts → useScrollThreshold.d.ts} +0 -0
- /package/{hooks/useScrollTo.d.ts → useScrollTo.d.ts} +0 -0
- /package/{hooks/useSmoothScroll.d.ts → useSmoothScroll.d.ts} +0 -0
- /package/{hooks/useSpinDelay.d.ts → useSpinDelay.d.ts} +0 -0
- /package/{hooks/useTraceUpdate.d.ts → useTraceUpdate.d.ts} +0 -0
- /package/{hooks/useUpdateEffect.d.ts → useUpdateEffect.d.ts} +0 -0
- /package/{hooks/useUpdateEffect.js → useUpdateEffect.js} +0 -0
package/Animations/useReveal.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
1
2
|
import { useEffect, useRef, useState } from "react";
|
|
2
3
|
export function useReveal(_a) {
|
|
3
4
|
var _b = _a.direction, direction = _b === void 0 ? "left" : _b, _c = _a.offsetStartY, offsetStartY = _c === void 0 ? -2 : _c, _d = _a.offsetEndY, offsetEndY = _d === void 0 ? 0 : _d, _e = _a.offsetStartX, offsetStartX = _e === void 0 ? "all" : _e;
|
|
4
5
|
var ref = useRef(null);
|
|
5
|
-
var _f = useState(0), startY = _f[0], setStartY = _f[1];
|
|
6
|
-
var _g = useState(0), endY = _g[0], setEndY = _g[1];
|
|
7
|
-
var _h = useState(0), startX = _h[0], setStartX = _h[1];
|
|
6
|
+
var _f = __read(useState(0), 2), startY = _f[0], setStartY = _f[1];
|
|
7
|
+
var _g = __read(useState(0), 2), endY = _g[0], setEndY = _g[1];
|
|
8
|
+
var _h = __read(useState(0), 2), startX = _h[0], setStartX = _h[1];
|
|
8
9
|
useEffect(function () {
|
|
9
10
|
if (!ref.current) {
|
|
10
11
|
return;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __rest } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __generator, __read, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import useAutocomplete from "@mui/base/useAutocomplete";
|
|
4
4
|
import { useCallback, useMemo, useState } from "react";
|
|
5
|
-
import isString from "@koine/utils
|
|
5
|
+
import { isString } from "@koine/utils";
|
|
6
6
|
import { normaliseOptions, } from "../Forms/helpers.js";
|
|
7
7
|
import { InputProgress } from "../Forms/styles.js";
|
|
8
8
|
import { AutocompleteInner, AutocompleteInput, AutocompleteInputArrow, AutocompleteItem, AutocompleteItemLabel, AutocompleteItemRemove, AutocompleteLabel, AutocompleteMenu, AutocompleteMenuItem, AutocompleteRoot, AutocompleteWrap, } from "./components.js";
|
|
@@ -10,8 +10,8 @@ import { normaliseAutocompleteValue } from "./helpers.js";
|
|
|
10
10
|
export var Autocomplete = function (_a) {
|
|
11
11
|
var creatable = _a.creatable, multiple = _a.multiple, autoComplete = _a.autoComplete, loadOptions = _a.loadOptions, _b = _a.options, defaultOptions = _b === void 0 ? [] : _b, defaultValue = _a.defaultValue, controlledValue = _a.value, defaultInputValue = _a.defaultInputValue, label = _a.label, placeholder = _a.placeholder, register = _a.register, setValue = _a.setValue, name = _a.name, onChange = _a.onChange, $ref = _a.$ref, children = _a.children, props = __rest(_a, ["creatable", "multiple", "autoComplete", "loadOptions", "options", "defaultValue", "value", "defaultInputValue", "label", "placeholder", "register", "setValue", "name", "onChange", "$ref", "children"]);
|
|
12
12
|
var defaultOptionsMemo = useMemo(function () { return normaliseOptions(defaultOptions); }, [defaultOptions]);
|
|
13
|
-
var _c = useState(defaultOptionsMemo), options = _c[0], setOptions = _c[1];
|
|
14
|
-
var _d = useState(false), loading = _d[0], setLoading = _d[1];
|
|
13
|
+
var _c = __read(useState(defaultOptionsMemo), 2), options = _c[0], setOptions = _c[1];
|
|
14
|
+
var _d = __read(useState(false), 2), loading = _d[0], setLoading = _d[1];
|
|
15
15
|
var _e = useAutocomplete({
|
|
16
16
|
id: "Autocomplete",
|
|
17
17
|
multiple: multiple ? true : undefined,
|
package/Autocomplete/helpers.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { m } from "framer-motion";
|
|
4
4
|
import { MdKeyboardArrowRight as IconDelimiter } from "react-icons/md";
|
|
5
5
|
import styled, { css } from "styled-components";
|
|
6
|
-
import titleCase from "@koine/utils
|
|
6
|
+
import { titleCase } from "@koine/utils";
|
|
7
7
|
import { max, min } from "../styles/media.js";
|
|
8
8
|
var LINK_GUTTER_X = 10;
|
|
9
9
|
var Root = styled.nav(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n position: relative;\n"], ["\n display: flex;\n position: relative;\n"])));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __read } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { Fragment, useState } from "react";
|
|
4
4
|
import { MdAdd as IconExpand, } from "react-icons/md";
|
|
@@ -10,7 +10,7 @@ var styleBtn = {
|
|
|
10
10
|
};
|
|
11
11
|
export var CalendarDaygridCell = function (_a) {
|
|
12
12
|
var eventClicked = _a.eventClicked, setEventClicked = _a.setEventClicked, setEventHovered = _a.setEventHovered, view = _a.view, maxEvents = _a.maxEvents, events = _a.events, calendarsMap = _a.calendarsMap, _b = _a.Cell, Cell = _b === void 0 ? "div" : _b, _c = _a.CellOverflow, CellOverflow = _c === void 0 ? "div" : _c, _d = _a.CellEvent, CellEvent = _d === void 0 ? "div" : _d, _e = _a.CellEventBtn, CellEventBtn = _e === void 0 ? "div" : _e, _f = _a.CellEventTitle, CellEventTitle = _f === void 0 ? "span" : _f, _g = _a.CellEventStart, CellEventStart = _g === void 0 ? "span" : _g;
|
|
13
|
-
var _h = useState(false), isExpanded = _h[0], expand = _h[1];
|
|
13
|
+
var _h = __read(useState(false), 2), isExpanded = _h[0], expand = _h[1];
|
|
14
14
|
var eventsWithoutPlaceholders = events.filter(function (event) { return !event.placeholder; });
|
|
15
15
|
return (_jsx(Cell, { children: events.map(function (event, i) {
|
|
16
16
|
if (i === maxEvents && !isExpanded) {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
3
|
import format from "date-fns/format";
|
|
3
|
-
import { useDateLocale } from "../
|
|
4
|
+
import { useDateLocale } from "../useDateLocale.js";
|
|
4
5
|
export var KoineCalendarDaygridNav = function (_a) {
|
|
5
6
|
var range = _a.range, view = _a.view, todayInView = _a.todayInView, handlePrev = _a.handlePrev, handleNext = _a.handleNext, handleToday = _a.handleToday, handleView = _a.handleView, localeCode = _a.locale, _b = _a.NavRoot, NavRoot = _b === void 0 ? "nav" : _b, _c = _a.NavTitle, NavTitle = _c === void 0 ? "div" : _c, _d = _a.NavBtns, NavBtns = _d === void 0 ? "div" : _d, _e = _a.NavBtnPrev, NavBtnPrev = _e === void 0 ? "button" : _e, _f = _a.NavBtnNext, NavBtnNext = _f === void 0 ? "button" : _f, _g = _a.NavBtnToday, NavBtnToday = _g === void 0 ? "button" : _g, _h = _a.NavBtnViewMonth, NavBtnViewMonth = _h === void 0 ? "button" : _h, _j = _a.NavBtnViewWeek, NavBtnViewWeek = _j === void 0 ? "button" : _j;
|
|
6
|
-
var start =
|
|
7
|
+
var _k = __read(range, 2), start = _k[0], end = _k[1];
|
|
7
8
|
var locale = useDateLocale(localeCode);
|
|
8
9
|
var opts = { locale: locale };
|
|
9
10
|
var formatted = "";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
1
|
+
import { __assign, __read } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import eachWeekOfInterval from "date-fns/eachWeekOfInterval";
|
|
4
4
|
import { useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { useSwipeable } from "react-swipeable";
|
|
6
|
-
import { useDateLocale } from "../
|
|
6
|
+
import { useDateLocale } from "../useDateLocale.js";
|
|
7
7
|
import { CalendarDaygridCell, } from "./CalendarDaygridCell.js";
|
|
8
8
|
import { processEventsInView } from "./utils.js";
|
|
9
9
|
function getView(range) {
|
|
10
|
-
var start =
|
|
10
|
+
var _a = __read(range, 2), start = _a[0], end = _a[1];
|
|
11
11
|
var weeks = eachWeekOfInterval({ start: start, end: end }, { weekStartsOn: 1 });
|
|
12
12
|
return {
|
|
13
13
|
month: start.getMonth(),
|
|
@@ -24,8 +24,8 @@ export var KoineCalendarDaygridTable = function (_a) {
|
|
|
24
24
|
CellEventTitle: CellEventTitle,
|
|
25
25
|
CellEventStart: CellEventStart,
|
|
26
26
|
};
|
|
27
|
-
var _l = useState(dayLabels || [0, 1, 2, 3, 4, 5, 6]), days = _l[0], setDays = _l[1];
|
|
28
|
-
var _m = useState([]), weeksEvents = _m[0], setWeeksEvents = _m[1];
|
|
27
|
+
var _l = __read(useState(dayLabels || [0, 1, 2, 3, 4, 5, 6]), 2), days = _l[0], setDays = _l[1];
|
|
28
|
+
var _m = __read(useState([]), 2), weeksEvents = _m[0], setWeeksEvents = _m[1];
|
|
29
29
|
var locale = useDateLocale(localeCode);
|
|
30
30
|
var _o = useMemo(function () { return getView(range); }, [range]), month = _o.month, weeks = _o.weeks;
|
|
31
31
|
var swipeableHandlers = useSwipeable({
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { __read } from "tslib";
|
|
1
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
3
|
export var KoineCalendarLegend = function (_a) {
|
|
3
4
|
var _b = _a.calendarsMap, calendarsMap = _b === void 0 ? {} : _b, toggleCalendarVisibility = _a.toggleCalendarVisibility, _c = _a.LegendItem, LegendItem = _c === void 0 ? "div" : _c, _d = _a.LegendItemStatus, LegendItemStatus = _d === void 0 ? "span" : _d, _e = _a.LegendItemLabel, LegendItemLabel = _e === void 0 ? "span" : _e, _f = _a.LegendItemEvents, LegendItemEvents = _f === void 0 ? "span" : _f;
|
|
4
5
|
return (_jsx(_Fragment, { children: Object.entries(calendarsMap).map(function (_a) {
|
|
5
|
-
var id =
|
|
6
|
+
var _b = __read(_a, 2), id = _b[0], calendar = _b[1];
|
|
6
7
|
return (_jsxs(LegendItem, { onClick: function () { return toggleCalendarVisibility(id); }, "$color": calendar.color, "$empty": calendar.events === 0, disabled: calendar.events === 0, children: [_jsx(LegendItemStatus, { children: calendar.on ? "\u2b24" : "\u2b58" }), _jsx(LegendItemLabel, { children: calendar.name }), _jsx(LegendItemEvents, { children: calendar.events })] }, "CalendarLegend." + id));
|
|
7
8
|
}) }));
|
|
8
9
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { __assign, __awaiter, __generator, __rest } from "tslib";
|
|
2
2
|
import differenceInDays from "date-fns/differenceInDays";
|
|
3
3
|
import subDays from "date-fns/subDays";
|
|
4
|
-
import arrayToLookup from "@koine/utils
|
|
5
|
-
import isString from "@koine/utils/isString";
|
|
6
|
-
import isUndefined from "@koine/utils/isUndefined";
|
|
4
|
+
import { arrayToLookup, isString, isUndefined } from "@koine/utils";
|
|
7
5
|
import { addCalendarEvents, getEventTimestamp } from "./utils.js";
|
|
8
6
|
var baseURL = "https://www.googleapis.com/calendar/v3/calendars/";
|
|
9
7
|
export function getCalendarsEventsFromGoogle(_a) {
|
package/Calendar/useCalendar.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
|
+
import { __assign, __awaiter, __generator, __read } from "tslib";
|
|
2
2
|
import { useCallback, useEffect, useReducer, useState } from "react";
|
|
3
3
|
import { getCalendarsEventsFromGoogle } from "./calendar-api-google.js";
|
|
4
4
|
import { getEndDate, getNextDate, getPrevDate, getStartDate, isTodayInView, } from "./utils.js";
|
|
5
5
|
export function useCalendar(_a) {
|
|
6
6
|
var _this = this;
|
|
7
7
|
var locale = _a.locale, apiKey = _a.apiKey, calendars = _a.calendars, initialEvents = _a.events, initialStart = _a.start, initialEnd = _a.end, _b = _a.view, initialView = _b === void 0 ? "month" : _b, _c = _a.timeZone, timeZone = _c === void 0 ? "" : _c, onError = _a.onError;
|
|
8
|
-
var _d = useState(initialView), view = _d[0], setView = _d[1];
|
|
8
|
+
var _d = __read(useState(initialView), 2), view = _d[0], setView = _d[1];
|
|
9
9
|
var start = initialStart || getStartDate(new Date(), view);
|
|
10
10
|
var end = initialEnd || getEndDate(start, view);
|
|
11
|
-
var _e = useState([start, end]), range = _e[0], setRange = _e[1];
|
|
12
|
-
var _f = useState(isTodayInView(start, end)), todayInView = _f[0], setTodayInView = _f[1];
|
|
13
|
-
var _g = useState(initialEvents || {}), events = _g[0], setEvents = _g[1];
|
|
14
|
-
var _h = useState(null), eventHovered = _h[0], setEventHovered = _h[1];
|
|
15
|
-
var _j = useState(null), eventClicked = _j[0], setEventClicked = _j[1];
|
|
16
|
-
var _k = useReducer(function (state, action) {
|
|
11
|
+
var _e = __read(useState([start, end]), 2), range = _e[0], setRange = _e[1];
|
|
12
|
+
var _f = __read(useState(isTodayInView(start, end)), 2), todayInView = _f[0], setTodayInView = _f[1];
|
|
13
|
+
var _g = __read(useState(initialEvents || {}), 2), events = _g[0], setEvents = _g[1];
|
|
14
|
+
var _h = __read(useState(null), 2), eventHovered = _h[0], setEventHovered = _h[1];
|
|
15
|
+
var _j = __read(useState(null), 2), eventClicked = _j[0], setEventClicked = _j[1];
|
|
16
|
+
var _k = __read(useReducer(function (state, action) {
|
|
17
17
|
var _a;
|
|
18
18
|
var type = action.type;
|
|
19
19
|
switch (type) {
|
|
20
20
|
case "events": {
|
|
21
21
|
var events_1 = action.payload;
|
|
22
22
|
return Object.entries(state).reduce(function (map, _a) {
|
|
23
|
-
var id =
|
|
23
|
+
var _b = __read(_a, 2), id = _b[0], calendar = _b[1];
|
|
24
24
|
map[id] = __assign(__assign({}, calendar), { events: events_1[id] || 0 });
|
|
25
25
|
return map;
|
|
26
26
|
}, {});
|
|
@@ -32,7 +32,7 @@ export function useCalendar(_a) {
|
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
return Object.entries(state).reduce(function (map, _a) {
|
|
35
|
-
var id =
|
|
35
|
+
var _b = __read(_a, 2), id = _b[0], calendar = _b[1];
|
|
36
36
|
map[id] = __assign(__assign({}, calendar), { on: visible_1.indexOf(id) > -1 });
|
|
37
37
|
return map;
|
|
38
38
|
}, {});
|
|
@@ -44,7 +44,7 @@ export function useCalendar(_a) {
|
|
|
44
44
|
}, calendars.reduce(function (map, calendar) {
|
|
45
45
|
map[calendar.id] = __assign(__assign({}, calendar), { name: calendar.name || "", on: true, events: 0 });
|
|
46
46
|
return map;
|
|
47
|
-
}, {})), calendarsMap = _k[0], updateCalendars = _k[1];
|
|
47
|
+
}, {})), 2), calendarsMap = _k[0], updateCalendars = _k[1];
|
|
48
48
|
var toggleCalendarVisibility = useCallback(function (idOrIds) {
|
|
49
49
|
updateCalendars({ type: "visibility", payload: idOrIds });
|
|
50
50
|
}, [updateCalendars]);
|
|
@@ -84,7 +84,7 @@ export function useCalendar(_a) {
|
|
|
84
84
|
});
|
|
85
85
|
}); }, [setEvents, apiKey, timeZone, onError]);
|
|
86
86
|
var handleToday = useCallback(function () {
|
|
87
|
-
var start =
|
|
87
|
+
var _a = __read(range, 2), start = _a[0], end = _a[1];
|
|
88
88
|
var newStart = getStartDate(new Date(), view);
|
|
89
89
|
var newEnd = getEndDate(newStart, view);
|
|
90
90
|
setRange([newStart, newEnd]);
|
|
@@ -96,7 +96,7 @@ export function useCalendar(_a) {
|
|
|
96
96
|
}, [view, range]);
|
|
97
97
|
var handlePrev = useCallback(function () {
|
|
98
98
|
setRange(function (_a) {
|
|
99
|
-
var start =
|
|
99
|
+
var _b = __read(_a, 1), start = _b[0];
|
|
100
100
|
var newStart = getPrevDate(start, view);
|
|
101
101
|
var newEnd = getEndDate(newStart, view);
|
|
102
102
|
return [newStart, newEnd];
|
|
@@ -106,7 +106,7 @@ export function useCalendar(_a) {
|
|
|
106
106
|
}, [view]);
|
|
107
107
|
var handleNext = useCallback(function () {
|
|
108
108
|
setRange(function (_a) {
|
|
109
|
-
var start =
|
|
109
|
+
var _b = __read(_a, 1), start = _b[0];
|
|
110
110
|
var newStart = getNextDate(start, view);
|
|
111
111
|
var newEnd = getEndDate(newStart, view);
|
|
112
112
|
return [newStart, newEnd];
|
|
@@ -123,7 +123,7 @@ export function useCalendar(_a) {
|
|
|
123
123
|
setEventHovered(null);
|
|
124
124
|
}, [start]);
|
|
125
125
|
useEffect(function () {
|
|
126
|
-
var start =
|
|
126
|
+
var _a = __read(range, 2), start = _a[0], end = _a[1];
|
|
127
127
|
loadCalendars(calendars, start, end);
|
|
128
128
|
setTodayInView(isTodayInView(start, end));
|
|
129
129
|
}, [range]);
|
package/Details/Details.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Simplify } from "@koine/utils";
|
|
2
|
-
import { type WithComponents } from "../
|
|
2
|
+
import { type WithComponents } from "../extendComponent";
|
|
3
3
|
export type OwnProps = React.ComponentPropsWithoutRef<"details"> & {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
onChange?: () => any;
|
|
@@ -49,12 +49,12 @@ export declare const Summary: NonNullable<import("react").ElementType<Omit<impor
|
|
|
49
49
|
} & Pick<OwnProps, "onChange"> & {
|
|
50
50
|
children?: import("react").ReactNode;
|
|
51
51
|
}>>;
|
|
52
|
-
export declare const Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
52
|
+
export declare const Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
53
53
|
$open: OwnProps["open"];
|
|
54
54
|
} & Pick<OwnProps, "onChange"> & {
|
|
55
55
|
children?: import("react").ReactNode;
|
|
56
56
|
}>>;
|
|
57
|
-
export declare const Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
57
|
+
export declare const Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
58
58
|
$open: OwnProps["open"];
|
|
59
59
|
"aria-expanded"?: React.AriaAttributes["aria-expanded"];
|
|
60
60
|
"aria-label"?: React.AriaAttributes["aria-label"];
|
|
@@ -63,55 +63,22 @@ export declare const Content: NonNullable<import("react").ElementType<Omit<Omit<
|
|
|
63
63
|
}>>;
|
|
64
64
|
export declare const KoineDetails: ((props: {
|
|
65
65
|
key?: import("react").Key | null | undefined;
|
|
66
|
-
id?: string | undefined;
|
|
67
66
|
slot?: string | undefined;
|
|
68
67
|
style?: import("react").CSSProperties | undefined;
|
|
69
68
|
title?: string | undefined;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
accessKey?: string | undefined;
|
|
76
|
-
autoFocus?: boolean | undefined;
|
|
69
|
+
onDrag?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
70
|
+
onDragStart?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
71
|
+
onDragEnd?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
72
|
+
onAnimationStart?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
73
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
77
74
|
className?: string | undefined;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
hidden?: boolean | undefined;
|
|
75
|
+
children?: import("react").ReactNode;
|
|
76
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
77
|
+
color?: string | undefined;
|
|
78
|
+
id?: string | undefined;
|
|
83
79
|
lang?: string | undefined;
|
|
84
|
-
nonce?: string | undefined;
|
|
85
|
-
placeholder?: string | undefined;
|
|
86
|
-
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
87
|
-
tabIndex?: number | undefined;
|
|
88
|
-
translate?: "yes" | "no" | undefined;
|
|
89
|
-
radioGroup?: string | undefined;
|
|
90
80
|
role?: import("react").AriaRole | undefined;
|
|
91
|
-
|
|
92
|
-
content?: string | undefined;
|
|
93
|
-
datatype?: string | undefined;
|
|
94
|
-
inlist?: any;
|
|
95
|
-
prefix?: string | undefined;
|
|
96
|
-
property?: string | undefined;
|
|
97
|
-
rel?: string | undefined;
|
|
98
|
-
resource?: string | undefined;
|
|
99
|
-
rev?: string | undefined;
|
|
100
|
-
typeof?: string | undefined;
|
|
101
|
-
vocab?: string | undefined;
|
|
102
|
-
autoCapitalize?: string | undefined;
|
|
103
|
-
autoCorrect?: string | undefined;
|
|
104
|
-
autoSave?: string | undefined;
|
|
105
|
-
itemProp?: string | undefined;
|
|
106
|
-
itemScope?: boolean | undefined;
|
|
107
|
-
itemType?: string | undefined;
|
|
108
|
-
itemID?: string | undefined;
|
|
109
|
-
itemRef?: string | undefined;
|
|
110
|
-
results?: number | undefined;
|
|
111
|
-
security?: string | undefined;
|
|
112
|
-
unselectable?: "on" | "off" | undefined;
|
|
113
|
-
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
114
|
-
is?: string | undefined;
|
|
81
|
+
tabIndex?: number | undefined;
|
|
115
82
|
'aria-activedescendant'?: string | undefined;
|
|
116
83
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
117
84
|
'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
|
|
@@ -124,7 +91,7 @@ export declare const KoineDetails: ((props: {
|
|
|
124
91
|
'aria-colindextext'?: string | undefined;
|
|
125
92
|
'aria-colspan'?: number | undefined;
|
|
126
93
|
'aria-controls'?: string | undefined;
|
|
127
|
-
'aria-current'?: boolean | "time" | "
|
|
94
|
+
'aria-current'?: boolean | "time" | "step" | "true" | "false" | "page" | "location" | "date" | undefined;
|
|
128
95
|
'aria-describedby'?: string | undefined;
|
|
129
96
|
'aria-description'?: string | undefined;
|
|
130
97
|
'aria-details'?: string | undefined;
|
|
@@ -151,7 +118,7 @@ export declare const KoineDetails: ((props: {
|
|
|
151
118
|
'aria-posinset'?: number | undefined;
|
|
152
119
|
'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
|
|
153
120
|
'aria-readonly'?: (boolean | "true" | "false") | undefined;
|
|
154
|
-
'aria-relevant'?: "text" | "
|
|
121
|
+
'aria-relevant'?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
155
122
|
'aria-required'?: (boolean | "true" | "false") | undefined;
|
|
156
123
|
'aria-roledescription'?: string | undefined;
|
|
157
124
|
'aria-rowcount'?: number | undefined;
|
|
@@ -165,7 +132,6 @@ export declare const KoineDetails: ((props: {
|
|
|
165
132
|
'aria-valuemin'?: number | undefined;
|
|
166
133
|
'aria-valuenow'?: number | undefined;
|
|
167
134
|
'aria-valuetext'?: string | undefined;
|
|
168
|
-
children?: import("react").ReactNode;
|
|
169
135
|
dangerouslySetInnerHTML?: {
|
|
170
136
|
__html: string | TrustedHTML;
|
|
171
137
|
} | undefined;
|
|
@@ -261,9 +227,7 @@ export declare const KoineDetails: ((props: {
|
|
|
261
227
|
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDetailsElement> | undefined;
|
|
262
228
|
onDoubleClick?: import("react").MouseEventHandler<HTMLDetailsElement> | undefined;
|
|
263
229
|
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDetailsElement> | undefined;
|
|
264
|
-
onDrag?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
265
230
|
onDragCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
266
|
-
onDragEnd?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
267
231
|
onDragEndCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
268
232
|
onDragEnter?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
269
233
|
onDragEnterCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
@@ -273,7 +237,6 @@ export declare const KoineDetails: ((props: {
|
|
|
273
237
|
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
274
238
|
onDragOver?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
275
239
|
onDragOverCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
276
|
-
onDragStart?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
277
240
|
onDragStartCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
278
241
|
onDrop?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
279
242
|
onDropCapture?: import("react").DragEventHandler<HTMLDetailsElement> | undefined;
|
|
@@ -323,14 +286,51 @@ export declare const KoineDetails: ((props: {
|
|
|
323
286
|
onScrollCapture?: import("react").UIEventHandler<HTMLDetailsElement> | undefined;
|
|
324
287
|
onWheel?: import("react").WheelEventHandler<HTMLDetailsElement> | undefined;
|
|
325
288
|
onWheelCapture?: import("react").WheelEventHandler<HTMLDetailsElement> | undefined;
|
|
326
|
-
onAnimationStart?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
327
289
|
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
328
|
-
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
329
290
|
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
330
291
|
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
331
292
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDetailsElement> | undefined;
|
|
332
293
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDetailsElement> | undefined;
|
|
333
294
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDetailsElement> | undefined;
|
|
295
|
+
defaultChecked?: boolean | undefined;
|
|
296
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
297
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
298
|
+
accessKey?: string | undefined;
|
|
299
|
+
autoFocus?: boolean | undefined;
|
|
300
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
301
|
+
contextMenu?: string | undefined;
|
|
302
|
+
dir?: string | undefined;
|
|
303
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
304
|
+
hidden?: boolean | undefined;
|
|
305
|
+
nonce?: string | undefined;
|
|
306
|
+
placeholder?: string | undefined;
|
|
307
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
308
|
+
translate?: "yes" | "no" | undefined;
|
|
309
|
+
radioGroup?: string | undefined;
|
|
310
|
+
about?: string | undefined;
|
|
311
|
+
content?: string | undefined;
|
|
312
|
+
datatype?: string | undefined;
|
|
313
|
+
inlist?: any;
|
|
314
|
+
prefix?: string | undefined;
|
|
315
|
+
property?: string | undefined;
|
|
316
|
+
rel?: string | undefined;
|
|
317
|
+
resource?: string | undefined;
|
|
318
|
+
rev?: string | undefined;
|
|
319
|
+
typeof?: string | undefined;
|
|
320
|
+
vocab?: string | undefined;
|
|
321
|
+
autoCapitalize?: string | undefined;
|
|
322
|
+
autoCorrect?: string | undefined;
|
|
323
|
+
autoSave?: string | undefined;
|
|
324
|
+
itemProp?: string | undefined;
|
|
325
|
+
itemScope?: boolean | undefined;
|
|
326
|
+
itemType?: string | undefined;
|
|
327
|
+
itemID?: string | undefined;
|
|
328
|
+
itemRef?: string | undefined;
|
|
329
|
+
results?: number | undefined;
|
|
330
|
+
security?: string | undefined;
|
|
331
|
+
unselectable?: "on" | "off" | undefined;
|
|
332
|
+
inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
333
|
+
is?: string | undefined;
|
|
334
334
|
open?: boolean | undefined;
|
|
335
335
|
onToggle?: import("react").ReactEventHandler<HTMLDetailsElement> | undefined;
|
|
336
336
|
summary: null | React.ReactNode;
|
|
@@ -343,12 +343,12 @@ export declare const KoineDetails: ((props: {
|
|
|
343
343
|
} & Pick<OwnProps, "onChange"> & {
|
|
344
344
|
children?: import("react").ReactNode;
|
|
345
345
|
}>>;
|
|
346
|
-
Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
346
|
+
Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
347
347
|
$open: OwnProps["open"];
|
|
348
348
|
} & Pick<OwnProps, "onChange"> & {
|
|
349
349
|
children?: import("react").ReactNode;
|
|
350
350
|
}>>;
|
|
351
|
-
Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
351
|
+
Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
352
352
|
$open: OwnProps["open"];
|
|
353
353
|
"aria-expanded"?: React.AriaAttributes["aria-expanded"];
|
|
354
354
|
"aria-label"?: React.AriaAttributes["aria-label"];
|
|
@@ -362,12 +362,12 @@ export declare const KoineDetails: ((props: {
|
|
|
362
362
|
} & Pick<OwnProps, "onChange"> & {
|
|
363
363
|
children?: import("react").ReactNode;
|
|
364
364
|
}>>;
|
|
365
|
-
Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
365
|
+
Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
366
366
|
$open: OwnProps["open"];
|
|
367
367
|
} & Pick<OwnProps, "onChange"> & {
|
|
368
368
|
children?: import("react").ReactNode;
|
|
369
369
|
}>>;
|
|
370
|
-
Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
370
|
+
Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
371
371
|
$open: OwnProps["open"];
|
|
372
372
|
"aria-expanded"?: React.AriaAttributes["aria-expanded"];
|
|
373
373
|
"aria-label"?: React.AriaAttributes["aria-label"];
|
|
@@ -382,12 +382,12 @@ export declare const KoineDetails: ((props: {
|
|
|
382
382
|
} & Pick<OwnProps, "onChange"> & {
|
|
383
383
|
children?: import("react").ReactNode;
|
|
384
384
|
}>>;
|
|
385
|
-
Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
385
|
+
Body: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
386
386
|
$open: OwnProps["open"];
|
|
387
387
|
} & Pick<OwnProps, "onChange"> & {
|
|
388
388
|
children?: import("react").ReactNode;
|
|
389
389
|
}>>;
|
|
390
|
-
Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
390
|
+
Content: NonNullable<import("react").ElementType<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
391
391
|
$open: OwnProps["open"];
|
|
392
392
|
"aria-expanded"?: React.AriaAttributes["aria-expanded"];
|
|
393
393
|
"aria-label"?: React.AriaAttributes["aria-label"];
|
package/Details/Details.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
1
|
+
import { __assign, __read, __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useCallback, useEffect, useId, useRef, useState, } from "react";
|
|
4
|
-
import { extendComponent, } from "../
|
|
5
|
-
import { useWindowSize } from "../
|
|
4
|
+
import { extendComponent, } from "../extendComponent.js";
|
|
5
|
+
import { useWindowSize } from "../useWindowSize.js";
|
|
6
6
|
export var Root = "details";
|
|
7
7
|
export var Summary = "summary";
|
|
8
8
|
export var Body = "div";
|
|
@@ -10,12 +10,12 @@ export var Content = "div";
|
|
|
10
10
|
var DetailsWithRef = forwardRef(function Details(_a, ref) {
|
|
11
11
|
var id = _a.id, propOpen = _a.open, recalc = _a.recalc, summary = _a.summary, children = _a.children, _Root = _a.Root, _Summary = _a.Summary, _Body = _a.Body, _Content = _a.Content, onChange = _a.onChange, props = __rest(_a, ["id", "open", "recalc", "summary", "children", "Root", "Summary", "Body", "Content", "onChange"]);
|
|
12
12
|
var isControlled = typeof propOpen !== "undefined";
|
|
13
|
-
var _b = useState(propOpen), stateOpen = _b[0], setStateOpen = _b[1];
|
|
14
|
-
var _c = useState(0), setHeight = _c[1];
|
|
13
|
+
var _b = __read(useState(propOpen), 2), stateOpen = _b[0], setStateOpen = _b[1];
|
|
14
|
+
var _c = __read(useState(0), 2), setHeight = _c[1];
|
|
15
15
|
var hash = id ? "#".concat(id) : "";
|
|
16
16
|
var winSize = useWindowSize();
|
|
17
17
|
var open = isControlled ? propOpen : stateOpen;
|
|
18
|
-
var
|
|
18
|
+
var _d = __read(useState(open ? "unset" : "hidden"), 1), overflow = _d[0];
|
|
19
19
|
var content = useRef(null);
|
|
20
20
|
var defaultId = useId();
|
|
21
21
|
id = id || defaultId;
|
package/Dialog/DialogMui.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import ModalUnstyled, { type ModalProps as ModalUnstyledProps } from "@mui/base/
|
|
|
2
2
|
import type { MotionProps } from "framer-motion";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import type { Simplify } from "@koine/utils";
|
|
5
|
-
import { type WithComponents } from "../
|
|
5
|
+
import { type WithComponents } from "../extendComponent.js";
|
|
6
6
|
type ReducedModalUnstyledProps = Omit<ModalUnstyledProps, "onClose" | "BackdropComponent" | "classes" | "closeAfterTransition" | "component" | "components" | "componentsProps">;
|
|
7
7
|
export type OwnProps = React.PropsWithChildren<ReducedModalUnstyledProps & {
|
|
8
8
|
onClose: (event: object, reason?: string) => any;
|
|
@@ -56,13 +56,13 @@ export type Props = Simplify<WithComponents<OwnProps, Components>>;
|
|
|
56
56
|
export type DialogProps = Props;
|
|
57
57
|
export type KoineDialogProps = Props;
|
|
58
58
|
export declare const Root: import("@mui/base/utils").PolymorphicComponent<import("@mui/base/Modal").ModalTypeMap<{}, "div">>;
|
|
59
|
-
export declare const Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
59
|
+
export declare const Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
60
60
|
open?: OwnProps["open"];
|
|
61
61
|
}>>;
|
|
62
62
|
export declare const Container: NonNullable<React.ElementType<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & Pick<OwnProps, "$scrollPaper"> & {
|
|
63
63
|
children?: React.ReactNode;
|
|
64
64
|
}>>;
|
|
65
|
-
export declare const Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
65
|
+
export declare const Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
66
66
|
"aria-label": string;
|
|
67
67
|
} & Pick<OwnProps, "$scrollPaper"> & {
|
|
68
68
|
children?: React.ReactNode;
|
|
@@ -89,13 +89,13 @@ export declare const KoineDialog: ((props: Omit<{
|
|
|
89
89
|
mPaper?: MotionProps | undefined;
|
|
90
90
|
children?: React.ReactNode;
|
|
91
91
|
Root: import("@mui/base/utils").PolymorphicComponent<import("@mui/base/Modal").ModalTypeMap<{}, "div">>;
|
|
92
|
-
Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
92
|
+
Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
93
93
|
open?: OwnProps["open"];
|
|
94
94
|
}>>;
|
|
95
95
|
Container: NonNullable<React.ElementType<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & Pick<OwnProps, "$scrollPaper"> & {
|
|
96
96
|
children?: React.ReactNode;
|
|
97
97
|
}>>;
|
|
98
|
-
Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
98
|
+
Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
99
99
|
"aria-label": string;
|
|
100
100
|
} & Pick<OwnProps, "$scrollPaper"> & {
|
|
101
101
|
children?: React.ReactNode;
|
|
@@ -113,13 +113,13 @@ export declare const KoineDialog: ((props: Omit<{
|
|
|
113
113
|
}>>;
|
|
114
114
|
}, "ref"> & React.RefAttributes<HTMLDivElement>) => React.FunctionComponentElement<any>) & {
|
|
115
115
|
Root: import("@mui/base/utils").PolymorphicComponent<import("@mui/base/Modal").ModalTypeMap<{}, "div">>;
|
|
116
|
-
Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
116
|
+
Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
117
117
|
open?: OwnProps["open"];
|
|
118
118
|
}>>;
|
|
119
119
|
Container: NonNullable<React.ElementType<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & Pick<OwnProps, "$scrollPaper"> & {
|
|
120
120
|
children?: React.ReactNode;
|
|
121
121
|
}>>;
|
|
122
|
-
Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
122
|
+
Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
123
123
|
"aria-label": string;
|
|
124
124
|
} & Pick<OwnProps, "$scrollPaper"> & {
|
|
125
125
|
children?: React.ReactNode;
|
|
@@ -138,13 +138,13 @@ export declare const KoineDialog: ((props: Omit<{
|
|
|
138
138
|
} & {
|
|
139
139
|
defaultProps: {
|
|
140
140
|
Root: import("@mui/base/utils").PolymorphicComponent<import("@mui/base/Modal").ModalTypeMap<{}, "div">>;
|
|
141
|
-
Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
141
|
+
Backdrop: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
142
142
|
open?: OwnProps["open"];
|
|
143
143
|
}>>;
|
|
144
144
|
Container: NonNullable<React.ElementType<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & Pick<OwnProps, "$scrollPaper"> & {
|
|
145
145
|
children?: React.ReactNode;
|
|
146
146
|
}>>;
|
|
147
|
-
Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "
|
|
147
|
+
Paper: NonNullable<React.ElementType<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "style" | "onDrag" | "onDragStart" | "onDragEnd" | "onAnimationStart" | "onAnimationEnd"> & {
|
|
148
148
|
"aria-label": string;
|
|
149
149
|
} & Pick<OwnProps, "$scrollPaper"> & {
|
|
150
150
|
children?: React.ReactNode;
|
package/Dialog/DialogMui.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import ModalUnstyled from "@mui/base/Modal";
|
|
4
4
|
import { forwardRef, useRef } from "react";
|
|
5
5
|
import { MdClear as IconClose } from "react-icons/md";
|
|
6
|
-
import { extendComponent } from "../
|
|
6
|
+
import { extendComponent } from "../extendComponent.js";
|
|
7
7
|
export var Root = ModalUnstyled;
|
|
8
8
|
export var Backdrop = "div";
|
|
9
9
|
export var Container = "div";
|