@nxgt/material 3.92.0 → 3.94.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 +56 -0
- package/README.md +4 -3
- package/dist/{alert-dialog-Bz5PlYKp.js → alert-dialog-BaqK-rmd.js} +1 -1
- package/dist/{async-slice-veSVxKqt.js → async-slice-BfNpIJAH.js} +1 -1
- package/dist/{button-a3tH3pq4.js → button-CozGHXAv.js} +1 -1
- package/dist/{calculator-BtuKV3PK.js → calculator-BIx6cwgU.js} +10 -10
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-CyB9IhEq.js → calculator-segment-BsaxUtzL.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-BwGvGx_S.js → chip-DMEUGYdC.js} +2 -2
- package/dist/{code-editor-BLkmEoCi.js → code-editor-BWfky-aN.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-DhAC_tCs.js → code-language-items-BUaNYJuw.js} +2 -2
- package/dist/components/components.css +1 -0
- package/dist/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
- package/dist/{components-DX4aHtgP.js → components-CZpdAQMh.js} +19132 -18101
- package/dist/components.js +38 -38
- package/dist/{conversion-variant-C4t7aH9d.js → conversion-variant-aIBhul_U.js} +3 -3
- package/dist/{currency-field-D0UQb5pn.js → currency-field-IcEMAcAw.js} +5 -5
- package/dist/{dialog-vQMypIOm.js → dialog-H40HjqXN.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-B2ctUFti.js → dropdown-menu-CawkIlW8.js} +1 -1
- package/dist/editor.js +442 -442
- package/dist/{empty-state-Bs44jnWk.js → empty-state-sRVjgCis.js} +1 -1
- package/dist/{financial-variant-B5iZ3pYf.js → financial-variant-Bqo9-swy.js} +5 -5
- package/dist/{hooks-CJtRFDYD.js → hooks-BTj_WJm9.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-B8PYUsv_.js → hover-card-BZU1DWGY.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-YT98b2Vx.js → icon-badge-CXgvqMsM.js} +1 -1
- package/dist/{icon-button-BylI02aX.js → icon-button-B9WjQ3RO.js} +1 -1
- package/dist/{input-group-CiayHfBN.js → input-group-Df9vp2EZ.js} +1 -1
- package/dist/lib/components/ui/collections/day-grouped-list/index.d.ts +6 -0
- package/dist/lib/components/ui/display/entity-header/entity-metadata.d.ts +0 -5
- package/dist/lib/components/ui/display/entity-header/entity-stats.d.ts +2 -1
- package/dist/lib/components/ui/display/event-chip/event-chip-badges.d.ts +21 -0
- package/dist/lib/components/ui/display/event-chip/event-chip-content.d.ts +5 -7
- package/dist/lib/components/ui/display/event-chip/event-chip-title.d.ts +9 -0
- package/dist/lib/components/ui/display/event-chip/event-chip.classes.d.ts +9 -0
- package/dist/lib/components/ui/display/event-chip/event-chip.d.ts +15 -2
- package/dist/lib/components/ui/display/markdown/markdown.d.ts +2 -2
- package/dist/lib/components/ui/display/markdown/rehype-katex-classes.d.ts +21 -0
- package/dist/lib/components/ui/fields/attributes/attribute-values-form-field-set/attribute-values-form-field-set.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/choice-list-control.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/choice-list-focus.d.ts +6 -3
- package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +2 -2
- package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +2 -0
- package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +2 -0
- package/dist/lib/components/ui/fields/choice-list/index.d.ts +1 -1
- package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +9 -3
- package/dist/lib/components/ui/fields/choice-list/types.d.ts +20 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/index.d.ts +1 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/index.d.ts +2 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-preview.d.ts +6 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-syntax-help.d.ts +4 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-tabs.d.ts +13 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-textarea-field.d.ts +23 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-textarea-form-field.d.ts +3 -0
- package/dist/lib/components/ui/fields/markdown-textarea-field/use-text-value.d.ts +6 -0
- package/dist/lib/components/ui/layout/record-page/record-details.d.ts +6 -6
- package/dist/lib/components/ui/widgets/education/questions/index.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-hints.d.ts +9 -0
- package/dist/lib/components/ui/widgets/education/questions/partials/question-reveal.d.ts +13 -0
- package/dist/lib/components/ui/widgets/education/questions/partials/rich-text.d.ts +17 -0
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +40 -1
- package/dist/lib/components/ui/widgets/event-calendar/backdrop.types.d.ts +75 -0
- package/dist/lib/components/ui/widgets/event-calendar/chrome.types.d.ts +12 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +8 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-events.utils.d.ts +3 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-shell.d.ts +1 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.backdrop.d.ts +38 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.badges.d.ts +14 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.labels.d.ts +14 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.lanes.d.ts +9 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.read-only.d.ts +57 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.resources.d.ts +6 -1
- package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +2 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/all-day-bars.d.ts +14 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bands.d.ts +11 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bar.d.ts +11 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-cell.d.ts +13 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-row.d.ts +8 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-badge.d.ts +16 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-cell.d.ts +4 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-parts.d.ts +12 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/resource-header.d.ts +2 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/span-event.d.ts +3 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header-day.d.ts +3 -6
- package/dist/lib/components/ui/widgets/event-calendar/partials/zone-corner.d.ts +10 -2
- package/dist/lib/components/ui/widgets/event-calendar/template.types.d.ts +7 -2
- package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +25 -13
- package/dist/lib/components/ui/widgets/event-calendar/use-backdrops.d.ts +8 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-badges.d.ts +5 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +3 -2
- package/dist/lib/components/ui/widgets/event-calendar/use-month-day.d.ts +6 -1
- package/dist/lib/components/ui/widgets/event-calendar/use-time-column.d.ts +1 -0
- package/dist/lib/i18n/resources/en/en.d.ts +31 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +31 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +31 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +31 -0
- package/dist/lib/i18n/resources/resources.d.ts +62 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +54 -54
- package/dist/map.js +7 -7
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-DuoZieW9.js → percent-field-DrI4_J7x.js} +1 -1
- package/dist/{picker-surface-BKzM6TWN.js → picker-surface-D2aYI4v7.js} +4 -4
- package/dist/{popover-ukgGm5B6.js → popover-QQYPWzw6.js} +1 -1
- package/dist/{pos-types-BNXbls3v.js → pos-types-BIeZGGAs.js} +1 -1
- package/dist/{pos-variant-CZ3OZtPq.js → pos-variant-Cdn1AVoA.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-DVu-pYhB.js → programmer-variant-CMBybkqw.js} +2 -2
- package/dist/{public-DtXwn8bx.js → public-CPxFxbi4.js} +9 -9
- package/dist/{rich-code-block-DUaSLxLT.js → rich-code-block-DKJ8eKzL.js} +5 -5
- package/dist/{scientific-variant-Ku9feVN1.js → scientific-variant-CXL1ayb7.js} +2 -2
- package/dist/{sortable-provider-DIb1HgZA.js → sortable-provider-BYqwwyr1.js} +2 -2
- package/dist/{spinner-CHWFXCfd.js → spinner-D7ol2n_-.js} +1 -1
- package/dist/{tabs-BideU0Rb.js → tabs-DyiFTy5g.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-DUQTEe1y.js → theme-toggle-QZ0bIrg9.js} +1 -1
- package/dist/{toolbar-items-azkXY5w2.js → toolbar-items-BpOEBsSt.js} +4 -4
- package/dist/{translate-material-d8Q5K5a_.js → translate-material-DlMetRSJ.js} +1 -1
- package/dist/{translator-CxyFsfO0.js → translator-VtzVrnLm.js} +58 -0
- package/dist/{use-chat-composer-FACltVyX.js → use-chat-composer-DQ2rTD_q.js} +17 -17
- package/dist/{use-heading-spy-DHd5TScW.js → use-heading-spy-17B5xa7B.js} +4 -4
- package/dist/{use-material-translation-DA5ECZfA.js → use-material-translation-Cx5u36V5.js} +1 -1
- package/dist/{use-return-focus-CAAvJ6p5.js → use-return-focus-S7g7q_Yn.js} +1 -1
- package/docs/README.md +1 -0
- package/docs/components/data-display.md +13 -7
- package/docs/components/data-table-filter-and-lists.md +3 -0
- package/docs/components/form-fields.md +77 -5
- package/docs/components/navigation-and-layout.md +1 -0
- package/docs/components/rich-widgets.md +87 -5
- package/docs/guides/csp.md +20 -8
- package/docs/guides/event-calendar.md +163 -0
- package/docs/guides/forms.md +3 -1
- package/docs/guides/i18n.md +3 -1
- package/docs/previews/data-display-entityheader.webp +0 -0
- package/docs/previews/data-display-eventchip.webp +0 -0
- package/docs/previews/form-fields-markdowntextareafield.webp +0 -0
- package/docs/previews/rich-widgets-eventcalendar.webp +0 -0
- package/docs/roadmap.md +12 -0
- package/docs/troubleshooting.md +22 -6
- package/lib/components/components.css +1 -0
- package/lib/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { t } from "./use-material-translation-
|
|
2
|
+
import { t } from "./use-material-translation-Cx5u36V5.js";
|
|
3
3
|
import { t as n } from "./typography-CYEquVeb.js";
|
|
4
4
|
import { a as r, c as i, i as a, n as o, o as s, r as c, t as l, u } from "./state-scenes-BX03WmSu.js";
|
|
5
5
|
import { Suspense as d } from "react";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { d as e, n as t, r as n, t as r } from "./tabs-
|
|
2
|
-
import { t as i } from "./use-material-translation-
|
|
3
|
-
import { r as a, t as o } from "./currency-field-
|
|
4
|
-
import { t as s } from "./percent-field-
|
|
1
|
+
import { d as e, n as t, r as n, t as r } from "./tabs-DyiFTy5g.js";
|
|
2
|
+
import { t as i } from "./use-material-translation-Cx5u36V5.js";
|
|
3
|
+
import { r as a, t as o } from "./currency-field-IcEMAcAw.js";
|
|
4
|
+
import { t as s } from "./percent-field-DrI4_J7x.js";
|
|
5
5
|
import { n as c } from "./calculator-context-BugcKuVG.js";
|
|
6
6
|
import { t as l } from "./calculator-announce-DRd2c6Dq.js";
|
|
7
7
|
import { n as u, t as d } from "./calculator-panel-announce-AZSnZUSr.js";
|
|
8
8
|
import { t as f } from "./currency-B-r3ig11.js";
|
|
9
|
-
import { t as p } from "./calculator-segment-
|
|
9
|
+
import { t as p } from "./calculator-segment-BsaxUtzL.js";
|
|
10
10
|
import { useId as m, useMemo as h, useState as g } from "react";
|
|
11
11
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
12
|
import { currencyFractionDigits as y } from "@nxgt/material-core/currency-digits";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e } from "./translate-material-
|
|
2
|
-
import { n as t } from "./use-heading-spy-
|
|
1
|
+
import { i as e } from "./translate-material-DlMetRSJ.js";
|
|
2
|
+
import { n as t } from "./use-heading-spy-17B5xa7B.js";
|
|
3
3
|
import { t as n } from "./number.utils-CSueQZcv.js";
|
|
4
4
|
import { useCallback as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
5
5
|
import { jsx as l } from "react/jsx-runtime";
|
package/dist/hooks.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./use-ssr-media-query-C6M5m8sf.js";
|
|
2
2
|
import { a as t, i as n, o as r, r as i, s as a } from "./theme-store-BdPp43cV.js";
|
|
3
3
|
import { n as o, t as s } from "./use-theme-BCLireTd.js";
|
|
4
|
-
import { a as c, i as l, m as u, o as d, r as f, s as p, t as m } from "./use-heading-spy-
|
|
4
|
+
import { a as c, i as l, m as u, o as d, r as f, s as p, t as m } from "./use-heading-spy-17B5xa7B.js";
|
|
5
5
|
import { r as h } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
6
6
|
import { t as g } from "./use-mobile-BDro060N.js";
|
|
7
7
|
import { t as _ } from "./use-scroll-away-PQRFZkT2.js";
|
|
8
|
-
import { _ as v, a as y, c as b, d as x, f as S, g as C, h as w, i as T, l as E, m as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P, v as F } from "./hooks-
|
|
8
|
+
import { _ as v, a as y, c as b, d as x, f as S, g as C, h as w, i as T, l as E, m as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P, v as F } from "./hooks-BTj_WJm9.js";
|
|
9
9
|
export { i as DEFAULT_THEME, n as applyResolvedTheme, t as applyThemeName, M as buildOptions, l as busySettler, D as clearDrafts, c as createSubmitGuard, b as extractNode, v as isLeaving, r as resolveTheme, a as resolveThemeName, F as shouldBlockNavigation, k as startPoll, C as useAllowedTransitions, f as useCountdown, h as useCspNonce, O as useDiscardGuard, w as useDrafts, p as useFocusOnMount, A as useFormatters, m as useHeadingSpy, o as useIsClient, g as useIsMobile, u as useLocalizedDate, x as useNavigationHandler, S as useNavigationHandlers, P as useNumberFormatter, E as useOptions, y as usePoll, T as useReactRouterBlock, _ as useScrollAway, j as useSearchParam, e as useSsrMediaQuery, d as useSubmitOnce, s as useTheme, N as useUnsavedGuard };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { o as t } from "./dist-DVRQkaTK.js";
|
|
3
3
|
import { i as n, r, t as i } from "./dist-DWZXlCZR.js";
|
|
4
|
-
import { S as a, d as o, f as s, l as c, p as l, x as u } from "./spinner-
|
|
4
|
+
import { S as a, d as o, f as s, l as c, p as l, x as u } from "./spinner-D7ol2n_-.js";
|
|
5
5
|
import { a as d, i as f } from "./dist-DHdUUM1w.js";
|
|
6
6
|
import { t as p } from "./in-dialog-D61Yeaol.js";
|
|
7
7
|
import { i as m } from "./escape-owner-DpaP0lm1.js";
|
package/dist/i18n.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./is-production-GLw59WU8.js";
|
|
2
|
-
import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-
|
|
3
|
-
import { i as u, n as d, r as f, t as p } from "./translate-material-
|
|
2
|
+
import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-VtzVrnLm.js";
|
|
3
|
+
import { i as u, n as d, r as f, t as p } from "./translate-material-DlMetRSJ.js";
|
|
4
4
|
import { o as m, t as h } from "./merge-BCZE6HGq.js";
|
|
5
|
-
import { t as g } from "./use-material-translation-
|
|
5
|
+
import { t as g } from "./use-material-translation-Cx5u36V5.js";
|
|
6
6
|
import { useCallback as _ } from "react";
|
|
7
7
|
//#region lib/i18n/merge-resources.ts
|
|
8
8
|
function v(e, t, n = "") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { t } from "./icon-button-
|
|
2
|
+
import { t } from "./icon-button-B9WjQ3RO.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region lib/components/ui/actions/icon-button/icon-badge.tsx
|
|
5
5
|
function r({ children: r, className: i, ...a }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { n as t } from "./use-shape-morph-BKA_R5P5.js";
|
|
3
3
|
import { n, t as r } from "./dist-DVRQkaTK.js";
|
|
4
|
-
import { n as i, t as a } from "./spinner-
|
|
4
|
+
import { n as i, t as a } from "./spinner-D7ol2n_-.js";
|
|
5
5
|
import { t as o } from "./dist-DkQbkF9T.js";
|
|
6
6
|
import { a as s, i as c, n as l, o as u, r as d, s as f, t as p } from "./use-click-lock-Bwg_caHO.js";
|
|
7
7
|
import { t as m } from "./is-production-GLw59WU8.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { t } from "./dist-DkQbkF9T.js";
|
|
3
|
-
import { t as n } from "./icon-button-
|
|
3
|
+
import { t as n } from "./icon-button-B9WjQ3RO.js";
|
|
4
4
|
import { a as r, o as i } from "./input-CC2joTjB.js";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
6
|
//#region lib/components/ui/primitives/input-group/input-group.tsx
|
|
@@ -1 +1,7 @@
|
|
|
1
1
|
export { type DateGroup, type GroupByDateOptions, groupByDate, } from '@nxgt/material-core/day-math';
|
|
2
|
+
export type { DayGroupedListProps } from './day-grouped-list.js';
|
|
3
|
+
export { DayGroupedList } from './day-grouped-list.js';
|
|
4
|
+
export type { DayGroup, DayGroupDate, DayGroupKey, } from './day-groups.js';
|
|
5
|
+
export { DAY_GROUP_ORDER, dayGroupOf, groupByDay } from './day-groups.js';
|
|
6
|
+
export type { DayGroupsOptions, ResolvedDayGroup } from './use-day-groups.js';
|
|
7
|
+
export { useDayGroups } from './use-day-groups.js';
|
|
@@ -4,10 +4,5 @@ type EntityMetadataProps = {
|
|
|
4
4
|
value: React.ReactNode;
|
|
5
5
|
}[];
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* The facts under an EntityHeader's title: a quiet label beside its value, in
|
|
9
|
-
* a description list so assistive tech reads the pairs. Empty values drop out.
|
|
10
|
-
* A link in a value takes the primary text colour, not the prose link's info.
|
|
11
|
-
*/
|
|
12
7
|
export declare function EntityMetadata({ data }: EntityMetadataProps): import("react").JSX.Element | null;
|
|
13
8
|
export {};
|
|
@@ -11,6 +11,7 @@ export declare const hasStatValue: (stat: EntityStat) => boolean;
|
|
|
11
11
|
* The figures of an EntityHeader (counts, a mean) as compact StatCard tiles in
|
|
12
12
|
* a StatCardGroup: 2×2 on a phone, a row that wraps beside. A tile with a `tone` is tonal; without one it is outlined.
|
|
13
13
|
*/
|
|
14
|
-
export declare function EntityStats({ data }: {
|
|
14
|
+
export declare function EntityStats({ data, className, }: {
|
|
15
15
|
data: EntityStat[];
|
|
16
|
+
className?: string;
|
|
16
17
|
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Tone } from '../../tones.js';
|
|
2
|
+
/** A small label an event carries, drawn after its title. */
|
|
3
|
+
export type EventChipBadge = {
|
|
4
|
+
label: string;
|
|
5
|
+
tone?: Tone;
|
|
6
|
+
};
|
|
7
|
+
/** The `badge` then the further `badges`: the one place that order is made. */
|
|
8
|
+
export declare function eventChipBadges(badge?: EventChipBadge, badges?: EventChipBadge[]): EventChipBadge[];
|
|
9
|
+
/** Every badge as a pill or a tone dot. */
|
|
10
|
+
export declare function ChipBadges({ badges, tight, }: {
|
|
11
|
+
badges: EventChipBadge[];
|
|
12
|
+
tight: boolean;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* The badges as a wrapping row of small pills, for a place with room (an
|
|
16
|
+
* agenda row, an event preview): the same pill as in a chip, never the dot.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ChipBadgeList({ badges, className, }: {
|
|
19
|
+
badges: EventChipBadge[];
|
|
20
|
+
className?: string;
|
|
21
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** A small label an event carries, drawn after its title. */
|
|
3
|
-
export type EventChipBadge = {
|
|
4
|
-
label: string;
|
|
5
|
-
tone?: Tone;
|
|
6
|
-
};
|
|
1
|
+
import { EventChipBadge } from './event-chip-badges.js';
|
|
7
2
|
type ContentProps = {
|
|
8
3
|
title: string;
|
|
9
4
|
/** The start time alone, shown before the title when compact. */
|
|
@@ -14,7 +9,10 @@ type ContentProps = {
|
|
|
14
9
|
compact: boolean;
|
|
15
10
|
tight: boolean;
|
|
16
11
|
solid: boolean;
|
|
17
|
-
|
|
12
|
+
/** Already merged by `eventChipBadges`. */
|
|
13
|
+
badges?: EventChipBadge[];
|
|
14
|
+
/** The event is cancelled: the title is struck through and "Cancelled" joins its name. */
|
|
15
|
+
cancelled?: boolean;
|
|
18
16
|
};
|
|
19
17
|
/** What a chip says: the title and its time, on one line when `compact`. */
|
|
20
18
|
export declare function EventChipContent(props: ContentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An event's title: struck through (`<del>`) and followed by a hidden
|
|
3
|
+
* "Cancelled" (the chip's own translated word) when `cancelled`, so the state
|
|
4
|
+
* is spoken and not only drawn.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ChipTitle({ title, cancelled, }: {
|
|
7
|
+
title: string;
|
|
8
|
+
cancelled?: boolean;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
export type EventChipVariant = 'soft' | 'solid' | 'outline';
|
|
2
2
|
/** Each variant's surface; the colour comes from `--event-color`. */
|
|
3
3
|
export declare const EVENT_CHIP_VARIANTS: Record<EventChipVariant, string>;
|
|
4
|
+
/** The classes of the chip's button: its variant, shape, size and, when cancelled, the muted dashed look. */
|
|
5
|
+
export declare function eventChipClass({ variant, color, compact, cancelled, continuesBefore, continuesAfter, }: {
|
|
6
|
+
variant: EventChipVariant;
|
|
7
|
+
color: string;
|
|
8
|
+
compact: boolean;
|
|
9
|
+
cancelled: boolean;
|
|
10
|
+
continuesBefore: boolean;
|
|
11
|
+
continuesAfter: boolean;
|
|
12
|
+
}): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, MouseEventHandler } from 'react';
|
|
2
|
+
import { Tone } from '../../tones.js';
|
|
2
3
|
import { EventChipVariant } from './event-chip.classes.js';
|
|
3
|
-
import { EventChipBadge } from './event-chip-
|
|
4
|
+
import { EventChipBadge } from './event-chip-badges.js';
|
|
4
5
|
export type { EventChipVariant } from './event-chip.classes.js';
|
|
5
6
|
export type { EventChipBadge };
|
|
6
7
|
export type EventChipProps = {
|
|
@@ -11,6 +12,16 @@ export type EventChipProps = {
|
|
|
11
12
|
endTime?: string;
|
|
12
13
|
/** Any CSS colour. Default: the primary colour. */
|
|
13
14
|
color?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A tone of the library (or one an app declared) the chip is drawn in when
|
|
17
|
+
* it sets no `color`.
|
|
18
|
+
*/
|
|
19
|
+
tone?: Tone;
|
|
20
|
+
/**
|
|
21
|
+
* The event is cancelled: a muted chip with a dashed outline, the title
|
|
22
|
+
* struck through (`<del>`) and "Cancelled" in its accessible name.
|
|
23
|
+
*/
|
|
24
|
+
cancelled?: boolean;
|
|
14
25
|
allDay?: boolean;
|
|
15
26
|
/** One line, the time before the title (a month cell, a short slot). */
|
|
16
27
|
compact?: boolean;
|
|
@@ -20,6 +31,8 @@ export type EventChipProps = {
|
|
|
20
31
|
variant?: EventChipVariant;
|
|
21
32
|
/** A small label (and tone) after the title; hidden but still named where the box is tiny. */
|
|
22
33
|
badge?: EventChipBadge;
|
|
34
|
+
/** Further badges after `badge` (a status, then a priority). */
|
|
35
|
+
badges?: EventChipBadge[];
|
|
23
36
|
selected?: boolean;
|
|
24
37
|
disabled?: boolean;
|
|
25
38
|
continuesBefore?: boolean;
|
|
@@ -34,4 +47,4 @@ export type EventChipProps = {
|
|
|
34
47
|
* is set from script (a CSS custom property), never as inline style in server
|
|
35
48
|
* markup.
|
|
36
49
|
*/
|
|
37
|
-
export declare function EventChip({ title, time, endTime, color, allDay, compact, tight, variant, badge, selected, disabled, continuesBefore, continuesAfter, onClick, className, style, }: EventChipProps): import("react").JSX.Element;
|
|
50
|
+
export declare function EventChip({ title, time, endTime, color: ownColor, tone, cancelled, allDay, compact, tight, variant, badge, badges, selected, disabled, continuesBefore, continuesAfter, onClick, className, style, }: EventChipProps): import("react").JSX.Element;
|
|
@@ -5,8 +5,8 @@ export type MarkdownProps = {
|
|
|
5
5
|
emojis?: EmojiItem[];
|
|
6
6
|
/**
|
|
7
7
|
* Render `$...$` and `$$...$$` with KaTeX. Default `true`. Under a strict CSP
|
|
8
|
-
* it needs
|
|
9
|
-
*
|
|
8
|
+
* it needs no `style-src-attr`: KaTeX's inline styles become classes and one
|
|
9
|
+
* `<style>` that takes the `NonceProvider` nonce (csp.md).
|
|
10
10
|
*/
|
|
11
11
|
math?: boolean;
|
|
12
12
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Root } from 'hast';
|
|
2
|
+
/**
|
|
3
|
+
* Replaces the inline `style="…"` attributes KaTeX puts on its markup with
|
|
4
|
+
* classes, and appends one `<style>` (given the CSP nonce) holding their
|
|
5
|
+
* rules. A `style` attribute needs `style-src-attr 'unsafe-inline'`, which a
|
|
6
|
+
* server-rendered page cannot avoid otherwise (hydration does not rewrite it);
|
|
7
|
+
* a nonce'd `<style>` element is allowed by `style-src-elem 'nonce-…'`.
|
|
8
|
+
*
|
|
9
|
+
* Runs after `rehype-katex`. A class names one declaration list, by hash, so
|
|
10
|
+
* the server and the client render the same markup. A declaration that is not
|
|
11
|
+
* a plain `property:value` (a quote, a brace, `url(`, a backslash, `@`) is
|
|
12
|
+
* dropped, so no markup can smuggle a rule out of the sheet.
|
|
13
|
+
*/
|
|
14
|
+
export type RehypeKatexClassesOptions = {
|
|
15
|
+
nonce?: string;
|
|
16
|
+
};
|
|
17
|
+
/** FNV-1a, base 36: short and stable between server and client. */
|
|
18
|
+
export declare function hashDeclarations(text: string): string;
|
|
19
|
+
/** The declarations of a `style` value that are safe to put in a sheet. */
|
|
20
|
+
export declare function safeDeclarations(style: string): string[];
|
|
21
|
+
export declare function rehypeKatexClasses(options?: RehypeKatexClassesOptions): (tree: Root) => void;
|
|
@@ -13,4 +13,4 @@ export interface AttributeValuesFormFieldSetProps<T extends Record<string, any>>
|
|
|
13
13
|
/** Keep `label` as the group's accessible name but draw nothing, e.g. under a `FormSection` that already titles it. */
|
|
14
14
|
hideLabel?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export declare function AttributeValuesFormFieldSet<T extends Record<string,
|
|
16
|
+
export declare function AttributeValuesFormFieldSet<T extends Record<string, any>>({ attributes, defaultValues, name, control, label, hideLabel, className, }: AttributeValuesFormFieldSetProps<T>): import("react").JSX.Element;
|
|
@@ -11,7 +11,7 @@ export type ChoiceListControlProps = Pick<ChoiceListFieldProps, 'min' | 'rowLabe
|
|
|
11
11
|
setIds?: (next: ChoiceRow[]) => void;
|
|
12
12
|
t: ReturnType<typeof useMaterialTranslation>['t'];
|
|
13
13
|
label: ReturnType<typeof defaultRowLabel>;
|
|
14
|
-
props: Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'onBlur'>;
|
|
14
|
+
props: Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'rowDetailErrors' | 'onBlur'>;
|
|
15
15
|
};
|
|
16
16
|
/** The list itself, with the group and per-row errors of the field. */
|
|
17
17
|
export declare function ChoiceListControl({ rows, error, focus, setIds, onChange, t, label, min, selection, rowLabel, disabled, props, }: ChoiceListControlProps): import("react").JSX.Element;
|
|
@@ -10,4 +10,4 @@ export type { ChoiceListFieldProps } from './types.js';
|
|
|
10
10
|
* new one, with one call of `onAssignIds` (default: `onChange`) on mount.
|
|
11
11
|
* `ChoiceListFormField` wires it to react-hook-form.
|
|
12
12
|
*/
|
|
13
|
-
export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
|
|
13
|
+
export declare function ChoiceListField({ value, onChange, onAssignIds, selection, rowLabel, reorderable, rowErrors, rowDetail, rowDetailErrors, disabled, onBlur, ref, ...props }: ChoiceListFieldProps): import("react").JSX.Element;
|
|
@@ -10,6 +10,9 @@ export type ArrayError = {
|
|
|
10
10
|
text?: {
|
|
11
11
|
message?: string;
|
|
12
12
|
};
|
|
13
|
+
explanation?: {
|
|
14
|
+
message?: string;
|
|
15
|
+
};
|
|
13
16
|
} | undefined;
|
|
14
17
|
};
|
|
15
18
|
/**
|
|
@@ -43,7 +46,7 @@ export declare function useRefusedFocus(error: () => ArrayError | undefined, bla
|
|
|
43
46
|
};
|
|
44
47
|
/**
|
|
45
48
|
* The handle React Hook Form gets as the `ref` of a row path
|
|
46
|
-
* (`choices.<i>.text`): `setFocus` and `setError(…, { shouldFocus })` on that
|
|
47
|
-
* path call its `focus()`, which goes to the row's text input.
|
|
49
|
+
* (`choices.<i>.text`, or `.explanation`): `setFocus` and `setError(…, { shouldFocus })` on that
|
|
50
|
+
* path call its `focus()`, which goes to the row's text input (the detail textarea for `.explanation`).
|
|
48
51
|
*/
|
|
49
|
-
export declare function rowFocus(list: RefObject<Element | null>, position: number): FocusHandle;
|
|
52
|
+
export declare function rowFocus(list: RefObject<Element | null>, position: number, field?: 'text' | 'explanation'): FocusHandle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
2
|
import { ChoiceListFieldProps } from './types.js';
|
|
3
|
-
export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'onBlur'> & {
|
|
3
|
+
export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<ChoiceListFieldProps, 'value' | 'onChange' | 'onAssignIds' | 'error' | 'rowErrors' | 'rowDetailErrors' | 'onBlur'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The built-in rules ask for one marked row at least. `false` lets a list
|
|
6
6
|
* with none pass (a poll). Default true.
|
|
@@ -16,4 +16,4 @@ export type ChoiceListFormFieldProps<T extends FieldValues> = Pick<UseController
|
|
|
16
16
|
* way: `choices.2.text` under row 3, `choices` under the list. Ids given on
|
|
17
17
|
* mount do not make the form dirty when a `FormProvider` is above.
|
|
18
18
|
*/
|
|
19
|
-
export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
|
|
19
|
+
export declare function ChoiceListFormField<T extends FieldValues>({ control, name, min, selection, requireCorrect, rowLabel, disabled, rowDetail, ...props }: ChoiceListFormFieldProps<T>): import("react").JSX.Element;
|
|
@@ -5,6 +5,8 @@ type Translate = ReturnType<typeof useMaterialTranslation>['t'];
|
|
|
5
5
|
export declare const defaultRowLabel: (t: Translate) => string;
|
|
6
6
|
/** A row's text field label: "Answer 2". */
|
|
7
7
|
export declare const textLabel: (label: string, position: number) => string;
|
|
8
|
+
/** A row's detail textarea label: "Explanation 2". */
|
|
9
|
+
export declare const detailLabel: (label: string | undefined, t: Translate, position: number) => string;
|
|
8
10
|
/** The visible word beside the mark. */
|
|
9
11
|
export declare const correctText: (t: Translate) => string;
|
|
10
12
|
/** The mark's accessible name, which starts with its visible word. */
|
|
@@ -12,6 +12,8 @@ export declare function setCorrect(rows: readonly ChoiceRow[], id: string, corre
|
|
|
12
12
|
/** The rows with one more at the end; in `single` it is marked when none is. */
|
|
13
13
|
export declare function addChoice(rows: readonly ChoiceRow[], selection: ChoiceListSelection): ChoiceRow[];
|
|
14
14
|
export declare function setText(rows: readonly ChoiceRow[], id: string, text: string): ChoiceRow[];
|
|
15
|
+
/** Sets a row's detail text, keeping its other fields. */
|
|
16
|
+
export declare function setExplanation(rows: readonly ChoiceRow[], id: string, explanation: string): ChoiceRow[];
|
|
15
17
|
export declare const removeAt: (rows: readonly ChoiceRow[], index: number) => ChoiceRow[];
|
|
16
18
|
export declare function moveRow(rows: readonly ChoiceRow[], from: number, to: number): ChoiceRow[];
|
|
17
19
|
export type ChoiceListIssue = 'too-few' | 'too-many' | 'none-correct' | 'blank';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { ChoiceListSelection, ChoiceRow as Row } from '../types.js';
|
|
2
|
+
import { ChoiceListSelection, ChoiceRowDetail, ChoiceRow as Row } from '../types.js';
|
|
3
3
|
export type ChoiceRowProps = {
|
|
4
4
|
row: Row;
|
|
5
5
|
position: number;
|
|
@@ -7,6 +7,11 @@ export type ChoiceRowProps = {
|
|
|
7
7
|
selection: ChoiceListSelection;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
error?: ReactNode;
|
|
10
|
+
/** The detail textarea under the row; absent: none. */
|
|
11
|
+
detail?: ChoiceRowDetail & {
|
|
12
|
+
name: string;
|
|
13
|
+
error?: ReactNode;
|
|
14
|
+
};
|
|
10
15
|
names: {
|
|
11
16
|
text: (position: number) => string;
|
|
12
17
|
correctText: string;
|
|
@@ -14,6 +19,7 @@ export type ChoiceRowProps = {
|
|
|
14
19
|
};
|
|
15
20
|
onText: (text: string) => void;
|
|
16
21
|
onCorrect: (correct: boolean) => void;
|
|
22
|
+
onDetail?: (explanation: string) => void;
|
|
17
23
|
};
|
|
18
|
-
/** One row's fields: the answer's text, then its
|
|
19
|
-
export declare function ChoiceListRow({ row, position, radioName, selection, disabled, error, names, onText, onCorrect, }: ChoiceRowProps): import("react").JSX.Element;
|
|
24
|
+
/** One row's fields: the answer's text, its mark, then its detail when asked. */
|
|
25
|
+
export declare function ChoiceListRow({ row, position, radioName, selection, disabled, error, detail, names, onText, onCorrect, onDetail, }: ChoiceRowProps): import("react").JSX.Element;
|
|
@@ -6,6 +6,19 @@ export type ChoiceRow = {
|
|
|
6
6
|
id: string;
|
|
7
7
|
text: string;
|
|
8
8
|
correct: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* A detail about the choice (why it is right or wrong), edited when the
|
|
11
|
+
* list has `rowDetail`. Absent until a user types in it.
|
|
12
|
+
*/
|
|
13
|
+
explanation?: string;
|
|
14
|
+
};
|
|
15
|
+
/** The optional detail textarea under each row (`ChoiceRow.explanation`). */
|
|
16
|
+
export type ChoiceRowDetail = {
|
|
17
|
+
/** The textarea's label, before the row's number. Default "Explanation", translated. */
|
|
18
|
+
label?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** Limits the text and shows a counter. */
|
|
21
|
+
maxLength?: number;
|
|
9
22
|
};
|
|
10
23
|
/**
|
|
11
24
|
* `single` marks one row (radios; marking a row unmarks the others) and
|
|
@@ -35,6 +48,13 @@ export type ChoiceListFieldProps = Omit<ComponentProps<'div'>, 'children' | 'onC
|
|
|
35
48
|
error?: ReactNode;
|
|
36
49
|
/** An error per row, by id: `{ [row.id]: 'Enter the answer' }`. */
|
|
37
50
|
rowErrors?: Readonly<Record<string, ReactNode>>;
|
|
51
|
+
/**
|
|
52
|
+
* Adds a textarea under each row, stored as `ChoiceRow.explanation`
|
|
53
|
+
* (`true` for its defaults). Absent: no detail, rows unchanged.
|
|
54
|
+
*/
|
|
55
|
+
rowDetail?: boolean | ChoiceRowDetail;
|
|
56
|
+
/** An error per row's detail, by id. */
|
|
57
|
+
rowDetailErrors?: Readonly<Record<string, ReactNode>>;
|
|
38
58
|
/**
|
|
39
59
|
* Called when the focus leaves the whole list, for a field used alone;
|
|
40
60
|
* inside a `FieldBlur` the list's root is registered and this is not
|