@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.
Files changed (151) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +4 -3
  3. package/dist/{alert-dialog-Bz5PlYKp.js → alert-dialog-BaqK-rmd.js} +1 -1
  4. package/dist/{async-slice-veSVxKqt.js → async-slice-BfNpIJAH.js} +1 -1
  5. package/dist/{button-a3tH3pq4.js → button-CozGHXAv.js} +1 -1
  6. package/dist/{calculator-BtuKV3PK.js → calculator-BIx6cwgU.js} +10 -10
  7. package/dist/calculator-field.js +6 -6
  8. package/dist/{calculator-segment-CyB9IhEq.js → calculator-segment-BsaxUtzL.js} +1 -1
  9. package/dist/calculator.js +1 -1
  10. package/dist/charts.js +3 -3
  11. package/dist/{chip-BwGvGx_S.js → chip-DMEUGYdC.js} +2 -2
  12. package/dist/{code-editor-BLkmEoCi.js → code-editor-BWfky-aN.js} +4 -4
  13. package/dist/code-editor.js +4 -4
  14. package/dist/{code-language-items-DhAC_tCs.js → code-language-items-BUaNYJuw.js} +2 -2
  15. package/dist/components/components.css +1 -0
  16. package/dist/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
  17. package/dist/{components-DX4aHtgP.js → components-CZpdAQMh.js} +19132 -18101
  18. package/dist/components.js +38 -38
  19. package/dist/{conversion-variant-C4t7aH9d.js → conversion-variant-aIBhul_U.js} +3 -3
  20. package/dist/{currency-field-D0UQb5pn.js → currency-field-IcEMAcAw.js} +5 -5
  21. package/dist/{dialog-vQMypIOm.js → dialog-H40HjqXN.js} +3 -3
  22. package/dist/dnd.js +1 -1
  23. package/dist/{dropdown-menu-B2ctUFti.js → dropdown-menu-CawkIlW8.js} +1 -1
  24. package/dist/editor.js +442 -442
  25. package/dist/{empty-state-Bs44jnWk.js → empty-state-sRVjgCis.js} +1 -1
  26. package/dist/{financial-variant-B5iZ3pYf.js → financial-variant-Bqo9-swy.js} +5 -5
  27. package/dist/{hooks-CJtRFDYD.js → hooks-BTj_WJm9.js} +2 -2
  28. package/dist/hooks.js +2 -2
  29. package/dist/{hover-card-B8PYUsv_.js → hover-card-BZU1DWGY.js} +1 -1
  30. package/dist/i18n.js +3 -3
  31. package/dist/{icon-badge-YT98b2Vx.js → icon-badge-CXgvqMsM.js} +1 -1
  32. package/dist/{icon-button-BylI02aX.js → icon-button-B9WjQ3RO.js} +1 -1
  33. package/dist/{input-group-CiayHfBN.js → input-group-Df9vp2EZ.js} +1 -1
  34. package/dist/lib/components/ui/collections/day-grouped-list/index.d.ts +6 -0
  35. package/dist/lib/components/ui/display/entity-header/entity-metadata.d.ts +0 -5
  36. package/dist/lib/components/ui/display/entity-header/entity-stats.d.ts +2 -1
  37. package/dist/lib/components/ui/display/event-chip/event-chip-badges.d.ts +21 -0
  38. package/dist/lib/components/ui/display/event-chip/event-chip-content.d.ts +5 -7
  39. package/dist/lib/components/ui/display/event-chip/event-chip-title.d.ts +9 -0
  40. package/dist/lib/components/ui/display/event-chip/event-chip.classes.d.ts +9 -0
  41. package/dist/lib/components/ui/display/event-chip/event-chip.d.ts +15 -2
  42. package/dist/lib/components/ui/display/markdown/markdown.d.ts +2 -2
  43. package/dist/lib/components/ui/display/markdown/rehype-katex-classes.d.ts +21 -0
  44. package/dist/lib/components/ui/fields/attributes/attribute-values-form-field-set/attribute-values-form-field-set.d.ts +1 -1
  45. package/dist/lib/components/ui/fields/choice-list/choice-list-control.d.ts +1 -1
  46. package/dist/lib/components/ui/fields/choice-list/choice-list-field.d.ts +1 -1
  47. package/dist/lib/components/ui/fields/choice-list/choice-list-focus.d.ts +6 -3
  48. package/dist/lib/components/ui/fields/choice-list/choice-list-form-field.d.ts +2 -2
  49. package/dist/lib/components/ui/fields/choice-list/choice-list-names.d.ts +2 -0
  50. package/dist/lib/components/ui/fields/choice-list/choice-list.utils.d.ts +2 -0
  51. package/dist/lib/components/ui/fields/choice-list/index.d.ts +1 -1
  52. package/dist/lib/components/ui/fields/choice-list/partials/choice-row.d.ts +9 -3
  53. package/dist/lib/components/ui/fields/choice-list/types.d.ts +20 -0
  54. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  55. package/dist/lib/components/ui/fields/index.d.ts +1 -0
  56. package/dist/lib/components/ui/fields/markdown-textarea-field/index.d.ts +2 -0
  57. package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-preview.d.ts +6 -0
  58. package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-syntax-help.d.ts +4 -0
  59. package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-tabs.d.ts +13 -0
  60. package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-textarea-field.d.ts +23 -0
  61. package/dist/lib/components/ui/fields/markdown-textarea-field/markdown-textarea-form-field.d.ts +3 -0
  62. package/dist/lib/components/ui/fields/markdown-textarea-field/use-text-value.d.ts +6 -0
  63. package/dist/lib/components/ui/layout/record-page/record-details.d.ts +6 -6
  64. package/dist/lib/components/ui/widgets/education/questions/index.d.ts +1 -1
  65. package/dist/lib/components/ui/widgets/education/questions/partials/question-hints.d.ts +9 -0
  66. package/dist/lib/components/ui/widgets/education/questions/partials/question-reveal.d.ts +13 -0
  67. package/dist/lib/components/ui/widgets/education/questions/partials/rich-text.d.ts +17 -0
  68. package/dist/lib/components/ui/widgets/education/questions/types.d.ts +40 -1
  69. package/dist/lib/components/ui/widgets/event-calendar/backdrop.types.d.ts +75 -0
  70. package/dist/lib/components/ui/widgets/event-calendar/chrome.types.d.ts +12 -0
  71. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +8 -1
  72. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-events.utils.d.ts +3 -1
  73. package/dist/lib/components/ui/widgets/event-calendar/event-calendar-shell.d.ts +1 -1
  74. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.backdrop.d.ts +38 -0
  75. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.badges.d.ts +14 -0
  76. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.labels.d.ts +14 -1
  77. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.lanes.d.ts +9 -0
  78. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.read-only.d.ts +57 -0
  79. package/dist/lib/components/ui/widgets/event-calendar/event-calendar.resources.d.ts +6 -1
  80. package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +2 -1
  81. package/dist/lib/components/ui/widgets/event-calendar/partials/all-day-bars.d.ts +14 -0
  82. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bands.d.ts +11 -0
  83. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-bar.d.ts +11 -0
  84. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-cell.d.ts +13 -0
  85. package/dist/lib/components/ui/widgets/event-calendar/partials/backdrop-row.d.ts +8 -0
  86. package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-badge.d.ts +16 -0
  87. package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-cell.d.ts +4 -1
  88. package/dist/lib/components/ui/widgets/event-calendar/partials/month-day-parts.d.ts +12 -1
  89. package/dist/lib/components/ui/widgets/event-calendar/partials/resource-header.d.ts +2 -1
  90. package/dist/lib/components/ui/widgets/event-calendar/partials/span-event.d.ts +3 -1
  91. package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header-day.d.ts +3 -6
  92. package/dist/lib/components/ui/widgets/event-calendar/partials/zone-corner.d.ts +10 -2
  93. package/dist/lib/components/ui/widgets/event-calendar/template.types.d.ts +7 -2
  94. package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +25 -13
  95. package/dist/lib/components/ui/widgets/event-calendar/use-backdrops.d.ts +8 -0
  96. package/dist/lib/components/ui/widgets/event-calendar/use-badges.d.ts +5 -0
  97. package/dist/lib/components/ui/widgets/event-calendar/use-event-calendar.d.ts +3 -2
  98. package/dist/lib/components/ui/widgets/event-calendar/use-month-day.d.ts +6 -1
  99. package/dist/lib/components/ui/widgets/event-calendar/use-time-column.d.ts +1 -0
  100. package/dist/lib/i18n/resources/en/en.d.ts +31 -0
  101. package/dist/lib/i18n/resources/en/material.json.d.ts +31 -0
  102. package/dist/lib/i18n/resources/fr/fr.d.ts +31 -0
  103. package/dist/lib/i18n/resources/fr/material.json.d.ts +31 -0
  104. package/dist/lib/i18n/resources/resources.d.ts +62 -0
  105. package/dist/lib/i18n/translator.d.ts +1 -1
  106. package/dist/lib.js +1 -1
  107. package/dist/main.js +54 -54
  108. package/dist/map.js +7 -7
  109. package/dist/material.css +1 -1
  110. package/dist/pdf-reader.js +1 -1
  111. package/dist/{percent-field-DuoZieW9.js → percent-field-DrI4_J7x.js} +1 -1
  112. package/dist/{picker-surface-BKzM6TWN.js → picker-surface-D2aYI4v7.js} +4 -4
  113. package/dist/{popover-ukgGm5B6.js → popover-QQYPWzw6.js} +1 -1
  114. package/dist/{pos-types-BNXbls3v.js → pos-types-BIeZGGAs.js} +1 -1
  115. package/dist/{pos-variant-CZ3OZtPq.js → pos-variant-Cdn1AVoA.js} +4 -4
  116. package/dist/print.js +1 -1
  117. package/dist/{programmer-variant-DVu-pYhB.js → programmer-variant-CMBybkqw.js} +2 -2
  118. package/dist/{public-DtXwn8bx.js → public-CPxFxbi4.js} +9 -9
  119. package/dist/{rich-code-block-DUaSLxLT.js → rich-code-block-DKJ8eKzL.js} +5 -5
  120. package/dist/{scientific-variant-Ku9feVN1.js → scientific-variant-CXL1ayb7.js} +2 -2
  121. package/dist/{sortable-provider-DIb1HgZA.js → sortable-provider-BYqwwyr1.js} +2 -2
  122. package/dist/{spinner-CHWFXCfd.js → spinner-D7ol2n_-.js} +1 -1
  123. package/dist/{tabs-BideU0Rb.js → tabs-DyiFTy5g.js} +1 -1
  124. package/dist/theme-picker.js +2 -2
  125. package/dist/{theme-toggle-DUQTEe1y.js → theme-toggle-QZ0bIrg9.js} +1 -1
  126. package/dist/{toolbar-items-azkXY5w2.js → toolbar-items-BpOEBsSt.js} +4 -4
  127. package/dist/{translate-material-d8Q5K5a_.js → translate-material-DlMetRSJ.js} +1 -1
  128. package/dist/{translator-CxyFsfO0.js → translator-VtzVrnLm.js} +58 -0
  129. package/dist/{use-chat-composer-FACltVyX.js → use-chat-composer-DQ2rTD_q.js} +17 -17
  130. package/dist/{use-heading-spy-DHd5TScW.js → use-heading-spy-17B5xa7B.js} +4 -4
  131. package/dist/{use-material-translation-DA5ECZfA.js → use-material-translation-Cx5u36V5.js} +1 -1
  132. package/dist/{use-return-focus-CAAvJ6p5.js → use-return-focus-S7g7q_Yn.js} +1 -1
  133. package/docs/README.md +1 -0
  134. package/docs/components/data-display.md +13 -7
  135. package/docs/components/data-table-filter-and-lists.md +3 -0
  136. package/docs/components/form-fields.md +77 -5
  137. package/docs/components/navigation-and-layout.md +1 -0
  138. package/docs/components/rich-widgets.md +87 -5
  139. package/docs/guides/csp.md +20 -8
  140. package/docs/guides/event-calendar.md +163 -0
  141. package/docs/guides/forms.md +3 -1
  142. package/docs/guides/i18n.md +3 -1
  143. package/docs/previews/data-display-entityheader.webp +0 -0
  144. package/docs/previews/data-display-eventchip.webp +0 -0
  145. package/docs/previews/form-fields-markdowntextareafield.webp +0 -0
  146. package/docs/previews/rich-widgets-eventcalendar.webp +0 -0
  147. package/docs/roadmap.md +12 -0
  148. package/docs/troubleshooting.md +22 -6
  149. package/lib/components/components.css +1 -0
  150. package/lib/components/ui/widgets/event-calendar/event-calendar-backdrop.css +43 -0
  151. package/package.json +1 -1
@@ -10,6 +10,7 @@ export * from './form-section/index.js';
10
10
  export * from './inline-edit/index.js';
11
11
  export * from './input-group-field/index.js';
12
12
  export * from './localized-text-fields/index.js';
13
+ export * from './markdown-textarea-field/index.js';
13
14
  export * from './number-field/index.js';
14
15
  export * from './opening-hours/index.js';
15
16
  export * from './otp-field/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './markdown-textarea-field.js';
2
+ export * from './markdown-textarea-form-field.js';
@@ -0,0 +1,6 @@
1
+ /** The body of the Preview tab: the rendered Markdown, or a hint when empty. */
2
+ export declare function MarkdownPreview({ text, math, mermaid, }: {
3
+ text: string;
4
+ math: boolean;
5
+ mermaid: boolean;
6
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /** The short syntax reminder under a Markdown textarea, collapsed by default. */
2
+ export declare function MarkdownSyntaxHelp({ id }: {
3
+ id: string;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ type MarkdownTabsProps = {
3
+ /** The textarea (the Write tab). */
4
+ children: ReactNode;
5
+ text: string;
6
+ minRows: number;
7
+ math: boolean;
8
+ mermaid: boolean;
9
+ previewClassName?: string;
10
+ };
11
+ /** The Write / Preview tab list and its two panels. */
12
+ export declare function MarkdownTabs({ children, text, minRows, math, mermaid, previewClassName, }: MarkdownTabsProps): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,23 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ export type MarkdownTextareaProps = {
3
+ label?: ReactNode;
4
+ helperText?: ReactNode;
5
+ error?: boolean;
6
+ /** Minimum height of the textarea, in lines. Default 6. */
7
+ minRows?: number;
8
+ /** Show the character counter. Default: when `maxLength` is set. */
9
+ showCount?: boolean;
10
+ /** Render `$...$` and `$$...$$` with KaTeX in the preview. Default `true`. */
11
+ math?: boolean;
12
+ /** Draw ```` ```mermaid ```` fences as diagrams in the preview. Default `false`. */
13
+ mermaid?: boolean;
14
+ /** Show the collapsible syntax help. Default `true`. */
15
+ showHelp?: boolean;
16
+ /** Class of the preview panel. */
17
+ previewClassName?: string;
18
+ } & ComponentProps<'textarea'>;
19
+ /**
20
+ * A textarea for Markdown with a Write / Preview tab list. The preview is
21
+ * rendered with `Markdown` (raw HTML is never rendered).
22
+ */
23
+ export declare function MarkdownTextareaField({ error, helperText, label, className, minRows, showCount, maxLength, math, mermaid, showHelp, previewClassName, value, defaultValue, onChange, ...props }: MarkdownTextareaProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { UseControllerProps } from 'react-hook-form';
2
+ import { MarkdownTextareaProps } from './markdown-textarea-field.js';
3
+ export declare function MarkdownTextareaFormField<T extends Record<string, any>>({ control, name, ...props }: Pick<UseControllerProps<T>, 'control' | 'name'> & Omit<MarkdownTextareaProps, 'name'>): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ChangeEventHandler, ComponentProps } from 'react';
2
+ /** The text of a textarea that may be controlled or not, for the counter and the preview. */
3
+ export declare function useTextValue(value: ComponentProps<'textarea'>['value'], defaultValue: ComponentProps<'textarea'>['defaultValue'], onChange: ComponentProps<'textarea'>['onChange']): {
4
+ text: string;
5
+ handleChange: ChangeEventHandler<HTMLTextAreaElement>;
6
+ };
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentProps, ReactNode } from 'react';
2
2
  import { CardTitleElement } from '../../primitives/card/card.js';
3
3
  /** One « label date » segment of the meta line. */
4
4
  export type RecordDetailsStamp = {
@@ -7,8 +7,8 @@ export type RecordDetailsStamp = {
7
7
  /** The instant: a `Date`, an ISO string or a timestamp. */
8
8
  at: Date | string | number;
9
9
  };
10
- export type RecordDetailsProps = {
11
- /** The card's heading. */
10
+ export type RecordDetailsProps = Omit<ComponentProps<'div'>, 'title'> & {
11
+ /** The card's heading, set in `title-md` emphasized like a section title, whatever its level. */
12
12
  title?: ReactNode;
13
13
  /** The heading level of `title`, `'h2'` by default (under the page's `h1`). */
14
14
  titleAs?: CardTitleElement;
@@ -28,13 +28,13 @@ export type RecordDetailsProps = {
28
28
  maxColumns?: number;
29
29
  /** The `Description`s. */
30
30
  children?: ReactNode;
31
- className?: string;
32
31
  };
33
32
  /**
34
33
  * RecordDetails - the record's facts as one card: a title and a status, the
35
34
  * `Description`s in a `DescriptionList` (one column in a side panel, up to
36
35
  * `maxColumns` once the panel is stacked and wide) and a muted
37
36
  * « Added on … · Updated on … » line under them, the dates written without
38
- * seconds in `timeZone`. Made for `RecordPage`'s `details`.
37
+ * seconds in `timeZone`. Made for `RecordPage`'s `details`. Any other `div`
38
+ * prop (`data-*`, `id`, `aria-*`, `className`) goes to the root.
39
39
  */
40
- export declare function RecordDetails({ title, titleAs, status, created, updated, timeZone, maxColumns, children, className, }: RecordDetailsProps): import("react").JSX.Element;
40
+ export declare function RecordDetails({ title, titleAs, status, created, updated, timeZone, maxColumns, children, className, ...props }: RecordDetailsProps): import("react").JSX.Element;
@@ -2,4 +2,4 @@ export { QuestionCard } from './question.js';
2
2
  export { answerParts, isAnswerCorrect, isAnswered, parseAnswerNumber, } from './question.utils.js';
3
3
  export { QuestionMediaView } from './question-media-view.js';
4
4
  export type { QuestionMediaFile, QuestionMediaViewProps, } from './question-media-view.types.js';
5
- export type { Question, QuestionAnswer, QuestionCodeField, QuestionImage, QuestionKind, QuestionMedia, QuestionMediaKind, QuestionOption, QuestionPoints, QuestionProps, QuestionVerdict, } from './types.js';
5
+ export type { Question, QuestionAnswer, QuestionCodeField, QuestionExample, QuestionImage, QuestionKind, QuestionMedia, QuestionMediaKind, QuestionOption, QuestionPoints, QuestionProps, QuestionReference, QuestionVerdict, } from './types.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Hints revealed one at a time. The button names the next one ("Show hint 2
3
+ * of 3"); the revealed hint takes the focus, and a status line keeps the count
4
+ * ("Hint 2 of 3") for a screen reader.
5
+ */
6
+ export declare function QuestionHints({ hints, markdown, }: {
7
+ hints: string[];
8
+ markdown?: boolean;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { Question } from '../types.js';
2
+ /** Why each option is right or wrong, for the options that carry an `explanation`. */
3
+ export declare function QuestionOptionExplanations({ question, }: {
4
+ question: Question;
5
+ }): import("react").JSX.Element | null;
6
+ /** The sources of a question: a labelled list, a link when there is a safe `url`. */
7
+ export declare function QuestionReferences({ question }: {
8
+ question: Question;
9
+ }): import("react").JSX.Element | null;
10
+ /** A `code` question's examples: a table with an input and an expected column. */
11
+ export declare function QuestionExamples({ question }: {
12
+ question: Question;
13
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { Question } from '../types.js';
3
+ /**
4
+ * A question's text: plain, or Markdown with math when the question's
5
+ * `markdown` is on. Raw HTML is never rendered; mermaid is off. `inline` keeps
6
+ * it to phrasing content (the prompt, a label, a sentence).
7
+ */
8
+ export declare function RichText({ markdown, inline, children, className, }: {
9
+ markdown?: boolean;
10
+ inline?: boolean;
11
+ children: string;
12
+ className?: string;
13
+ }): import("react").JSX.Element;
14
+ /** An option label: inline Markdown only when it is a string and the question asks for it. */
15
+ export declare function richLabel(label: ReactNode, markdown?: boolean): ReactNode;
16
+ /** The answer parts of a sentence ("Correct answer: …"): option labels as inline Markdown, typed answers as they are. */
17
+ export declare function richParts(question: Question, parts: ReactNode[]): ReactNode[];
@@ -38,6 +38,22 @@ export type QuestionOption = {
38
38
  description?: ReactNode;
39
39
  /** A picture: the options of the question become picture cards. */
40
40
  image?: QuestionImage;
41
+ /**
42
+ * Why this option is right or wrong, shown once the card is revealed (and in
43
+ * a `preview`), in a list under the question. Markdown when the question's
44
+ * `markdown` is on.
45
+ */
46
+ explanation?: string;
47
+ };
48
+ /** A source quoted in the reveal: a plain title, or a link when it has a `url`. */
49
+ export type QuestionReference = {
50
+ title: string;
51
+ url?: string;
52
+ };
53
+ /** A visible example of a `code` question: what goes in and what must come out. */
54
+ export type QuestionExample = {
55
+ input: string;
56
+ expected: string;
41
57
  };
42
58
  /** A choice id, the ids of a multi, the text (or the number as text) typed. */
43
59
  export type QuestionAnswer = string | string[] | null;
@@ -47,14 +63,37 @@ export type Question = {
47
63
  kind: QuestionKind;
48
64
  options?: QuestionOption[];
49
65
  correct?: string | string[];
66
+ /** Markdown when `markdown` is on. */
50
67
  explanation?: string;
51
68
  required?: boolean;
52
69
  placeholder?: string;
53
70
  exact?: boolean;
54
71
  /** A picture shown with the prompt; give it an `alt` unless decorative. */
55
72
  media?: QuestionMedia;
56
- /** Shown on demand, behind a "Show hint" button. */
73
+ /**
74
+ * Draws the `prompt`, the string option labels, the `explanation`, the
75
+ * option explanations and the hints as Markdown with math (`$x^2$`), through
76
+ * the library's safe `Markdown` (raw HTML is not rendered, mermaid is off).
77
+ * Default `false`: plain text, as before.
78
+ */
79
+ markdown?: boolean;
80
+ /**
81
+ * Shown on demand, behind a "Show hint" button.
82
+ * @deprecated Use `hints`. Ignored when `hints` is not empty.
83
+ */
57
84
  hint?: string;
85
+ /**
86
+ * Hints revealed one at a time, in order, behind a "Show hint 1 of N" button
87
+ * that moves the focus to the hint it reveals. Hidden once the card is
88
+ * revealed.
89
+ */
90
+ hints?: string[];
91
+ /** Sources listed in the reveal; a `url` makes an external link (`rel="noopener noreferrer"`). */
92
+ references?: QuestionReference[];
93
+ /** `code`: the code field starts with this when there is no draft (`value` is null or undefined). */
94
+ starterCode?: string;
95
+ /** `code`: examples shown as a table (input, expected output) above the field. */
96
+ examples?: QuestionExample[];
58
97
  /** `number`: how far off an answer may be and still count (default 0). */
59
98
  tolerance?: number;
60
99
  /** `number`: the unit shown after the field ("km", "%"). */
@@ -0,0 +1,75 @@
1
+ import { Tone } from '../../tones.js';
2
+ import { CalendarEventBadge } from './types.js';
3
+ /**
4
+ * A stretch of time the calendar shades behind its events, such as a holiday,
5
+ * a term, a closure or a half day off. It never blocks a slot: events can be
6
+ * made and dropped over it.
7
+ *
8
+ * `start` and `end` are ISO strings. A date-only value (`2026-12-25`) means
9
+ * whole days, read in the calendar's `timeZone`; `end` is always exclusive, so
10
+ * `2026-12-25` to `2026-12-26` is the single day of 25 December. A value with
11
+ * a time is an instant, which gives a half day (`2026-12-24T12:00:00` to
12
+ * `2026-12-25`).
13
+ */
14
+ export type EventCalendarSpan = {
15
+ id: string;
16
+ start: string;
17
+ end: string;
18
+ label: string;
19
+ /** Default `'neutral'`. */
20
+ tone?: Tone;
21
+ /**
22
+ * The resource column the span belongs to. One with none shades every
23
+ * column; one with an unknown id shades none.
24
+ */
25
+ resourceId?: string;
26
+ };
27
+ /** The part of a span that falls on one day of the zone's calendar. */
28
+ export type BackdropSegment = {
29
+ span: EventCalendarSpan;
30
+ /** The `YYYY-MM-DD` day. */
31
+ day: string;
32
+ /** Wall-clock minutes from midnight where the span starts on this day (0 for a whole day). */
33
+ fromMin: number;
34
+ /** Wall-clock minutes where it ends (1440 for a whole day or one running on). */
35
+ toMin: number;
36
+ /** The span covers the whole day, whatever its length (23 or 25 hours on a clock change). */
37
+ whole: boolean;
38
+ };
39
+ /** A span laid out as a bar over the day columns of the all-day strip. */
40
+ export type BackdropLane = {
41
+ span: EventCalendarSpan;
42
+ /** The first column (day) of the bar. */
43
+ startCol: number;
44
+ /** The number of columns it covers. */
45
+ cols: number;
46
+ /** The lane (row) of the strip. */
47
+ row: number;
48
+ continuesBefore: boolean;
49
+ continuesAfter: boolean;
50
+ };
51
+ /** A label with a tone that marks a day or a week, keyed by date (`2026-12-24`). */
52
+ export type EventCalendarBadges = Record<string, CalendarEventBadge>;
53
+ /** The props that decorate the days: shaded spans and badges. */
54
+ export type EventCalendarDayMarksProps = {
55
+ /**
56
+ * Stretches of time shaded behind the events (a holiday, a term, a half day
57
+ * off). They never block a slot, take no pointer event, and are read in the
58
+ * name of the day or column they fall on. Not a prop of `mode="template"`.
59
+ */
60
+ spans?: EventCalendarSpan[];
61
+ /**
62
+ * A badge on a day, keyed by its `YYYY-MM-DD` date (`{ '2026-12-24': { label:
63
+ * 'Eve', tone: 'info' } }`): in the day's header (week and day views) and
64
+ * next to its number (month). It is read in the name of the day. Not a prop of `mode="template"`, which has no dates. Where the
65
+ * room is short (a phone's week column or month cell) it becomes a short tone bar.
66
+ */
67
+ dayBadges?: EventCalendarBadges;
68
+ /**
69
+ * A badge on a week, keyed by the `YYYY-MM-DD` date of its first day, which
70
+ * follows `weekStartsOn` (Monday `2026-12-21` when weeks start on Monday). It
71
+ * is drawn in the time views' gutter corner and on the first cell of the
72
+ * month's row, and is read in that cell's name. Not a prop of `mode="template"`.
73
+ */
74
+ weekBadges?: EventCalendarBadges;
75
+ };
@@ -0,0 +1,12 @@
1
+ export type EventCalendarChromeState = {
2
+ focusedEventId: string | null;
3
+ query: string;
4
+ /** The way the last move went (-1 back, 1 forward): the view slides from it. */
5
+ direction: -1 | 0 | 1;
6
+ /** A view was picked in the switcher: `phoneView` no longer applies. */
7
+ viewPicked: boolean;
8
+ /** The keyboard moved the cursor: its day takes the focus once rendered. */
9
+ dayFocus: boolean;
10
+ /** The resource the phone's switcher shows; `null` is the first. */
11
+ resourceId: string | null;
12
+ };
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { EventChipVariant } from '../../display/event-chip/event-chip.classes.js';
3
+ import { EventCalendarBadges, EventCalendarSpan } from './backdrop.types.js';
3
4
  import { TemplateContext } from './template.types.js';
4
5
  import { CalendarEvent, EventCalendarPreviewField, EventCalendarRenderEvent, EventCalendarSlot, EventCalendarView } from './types.js';
5
6
  import { EventCalendarModel } from './use-event-calendar.js';
@@ -8,7 +9,13 @@ export type EventCalendarContextValue = EventCalendarModel & {
8
9
  sourceEvents?: CalendarEvent[];
9
10
  /** Set in `mode="template"`: the lanes, and the lane of each event. */
10
11
  template?: TemplateContext;
11
- dragLabel: string;
12
+ /** The spans to shade behind the events (see `EventCalendarProps.spans`). */
13
+ spans?: EventCalendarSpan[];
14
+ /** Badges on days and on weeks (see `EventCalendarProps.dayBadges`). */
15
+ dayBadges?: EventCalendarBadges;
16
+ weekBadges?: EventCalendarBadges;
17
+ /** The hint that events can be dragged, read as the board's description; unset when they cannot (`readOnlyEvents`). */
18
+ dragHint?: string;
12
19
  searchable: boolean;
13
20
  /** The views the switcher offers. */
14
21
  views?: EventCalendarView[];
@@ -1,5 +1,5 @@
1
1
  import { closestCenter } from '@dnd-kit/core';
2
- import { CalendarEvent } from './types.js';
2
+ import { CalendarEvent, CalendarEventBadge } from './types.js';
3
3
  export declare const calendarCollisionDetection: typeof closestCenter;
4
4
  export declare function snapToStep(date: Date, stepMinutes?: number): Date;
5
5
  /** `date` rounded to the nearest `stepMinutes` of the clock's epoch: right in a zone whose offset is a multiple of the step. */
@@ -15,3 +15,5 @@ export declare function moveEventToDay(event: CalendarEvent, day: Date): Calenda
15
15
  export declare function moveEventToDateTime(event: CalendarEvent, dateTime: Date, snap?: (date: Date) => Date): CalendarEvent;
16
16
  export declare function resizeEventEnd(event: CalendarEvent, end: Date, snap?: (date: Date) => Date): CalendarEvent;
17
17
  export declare function isToday(day: Date, now?: Date): boolean;
18
+ /** Every badge of an event, `badge` first. */
19
+ export declare function eventBadges(event: CalendarEvent): CalendarEventBadge[];
@@ -12,4 +12,4 @@ export type EventCalendarShellProps = EventCalendarProps & {
12
12
  * mini-month side panel and a phone layout of its own. Events are props; the
13
13
  * chrome (search, focus, the last move's direction) lives in a slice.
14
14
  */
15
- export declare function EventCalendarShell({ template, visible, onEventClick, onSlotClick, eventPreview, previewFields, onEventEdit, onEventDelete, className, renderEvent, toolbar, searchable, views, phoneView, sidebar, eventVariant, scrollToHour, ...options }: EventCalendarShellProps): import("react").JSX.Element;
15
+ export declare function EventCalendarShell({ template, visible, onEventClick, onSlotClick, eventPreview, previewFields, onEventEdit, onEventDelete, className, renderEvent, toolbar, searchable, views, phoneView, sidebar, eventVariant, scrollToHour, spans, dayBadges, weekBadges, ...options }: EventCalendarShellProps): import("react").JSX.Element;
@@ -0,0 +1,38 @@
1
+ import { BackdropLane, BackdropSegment, EventCalendarSpan } from './backdrop.types.js';
2
+ /** Whether a span value is a date (`2026-12-25`): whole days, not an instant. */
3
+ export declare function isDateOnly(value: string): boolean;
4
+ /**
5
+ * The instants a span covers, `end` exclusive. A date-only value is the first
6
+ * instant of that day in the zone; a time with no offset (`2026-12-24T12:00`)
7
+ * is that wall-clock time in the zone; one with an offset or `Z` is the
8
+ * instant it names. A span
9
+ * with an invalid value, or that ends at or before its start, gives `null`.
10
+ */
11
+ export declare function spanRange(span: EventCalendarSpan, timeZone?: string): {
12
+ start: Date;
13
+ end: Date;
14
+ } | null;
15
+ /**
16
+ * Whether a span shades a resource column. Without `resourceId` (no
17
+ * resources) every span counts; `null` is the unassigned column, which only
18
+ * the spans with no `resourceId` shade.
19
+ */
20
+ export declare function spanMatchesResource(span: EventCalendarSpan, resourceId?: string | null): boolean;
21
+ /**
22
+ * The part of a span on the zone's day `day`, or `null` when it does not touch
23
+ * it. The day runs from its first instant to the next day's, so on a clock
24
+ * change it is 23 or 25 hours long and a span over all of it is `whole`.
25
+ */
26
+ export declare function spanOnDay(span: EventCalendarSpan, day: string, timeZone?: string): BackdropSegment | null;
27
+ /**
28
+ * The spans on one day, for one resource column when given, in the order of
29
+ * `spans`. Spans never block anything: this only says what to draw.
30
+ */
31
+ export declare function spansForDay(spans: EventCalendarSpan[] | undefined, day: string, timeZone?: string, resourceId?: string | null): BackdropSegment[];
32
+ /**
33
+ * The all-day strip: each span as a bar over the consecutive `days` it covers
34
+ * wholly, put in the first lane with room (longest and earliest first). A
35
+ * span that only covers part of a day (a half day) has no bar: it is drawn as
36
+ * a band in the time grid, and by `spansForDay` in the month.
37
+ */
38
+ export declare function layoutBackdropLanes(spans: EventCalendarSpan[] | undefined, days: string[], timeZone?: string, resourceId?: string | null): BackdropLane[];
@@ -0,0 +1,14 @@
1
+ import { Locale } from 'date-fns';
2
+ import { EventCalendarBadges } from './backdrop.types.js';
3
+ import { CalendarEventBadge } from './types.js';
4
+ type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
5
+ /** The badge set on a day, keyed by its `YYYY-MM-DD` date. */
6
+ export declare function dayBadgeOf(dayBadges: EventCalendarBadges | undefined, day: Date): CalendarEventBadge | undefined;
7
+ /**
8
+ * The key of the week a day falls in: the date of its first day, which follows
9
+ * `weekStartsOn` (the locale's when unset), whatever the view draws of it.
10
+ */
11
+ export declare function weekBadgeKey(day: Date, locale?: Locale, weekStartsOn?: WeekStart): string;
12
+ /** The badge set on the week a day falls in. */
13
+ export declare function weekBadgeOf(weekBadges: EventCalendarBadges | undefined, day: Date, locale?: Locale, weekStartsOn?: WeekStart): CalendarEventBadge | undefined;
14
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { Locale } from 'date-fns';
2
- import { CalendarEvent } from './types.js';
2
+ import { BackdropSegment } from './backdrop.types.js';
3
+ import { CalendarEvent, CalendarEventBadge } from './types.js';
3
4
  /**
4
5
  * The times a chip or an agenda row shows. In a zone they are read from the
5
6
  * true instants with the zone's own clock (`wallOf`), never through the
@@ -10,9 +11,21 @@ export declare function eventTimes(drawn: CalendarEvent, source: CalendarEvent,
10
11
  time?: string;
11
12
  endTime?: string;
12
13
  };
14
+ /**
15
+ * The accessible name of an event's group: its title, then its badge, then
16
+ * `cancelled` (the translated word) when its status says so.
17
+ */
18
+ export declare function eventName(event: CalendarEvent, title: string, cancelled: string): string;
13
19
  /**
14
20
  * The range label of the popover, in the zone: the day is read at noon and
15
21
  * the time on a fixed day, so a wall time the browser's own clock skips never
16
22
  * shifts what is said.
17
23
  */
18
24
  export declare function zonedRangeLabel(event: CalendarEvent, locale: Locale, zone: string): string;
25
+ /** A day's name with its spans' labels after it: the cell or the column reads them out, the shading is decoration. */
26
+ export declare function nameWithSpans(date: string, segments: BackdropSegment[]): string;
27
+ /** A day's name with its badges after it, for the cell or column that reads them out. */
28
+ export declare function nameWithBadges(name: string, day: CalendarEventBadge | undefined, week: {
29
+ badge: CalendarEventBadge | undefined;
30
+ text: (label: string) => string;
31
+ }): string;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The lane (row) of each item, already in the order they should win a lane:
3
+ * the first lane with room over its columns, a new one when none has. An item
4
+ * covers `cols` columns from `startCol`; `columns` is the width of a lane.
5
+ */
6
+ export declare function packLanes(items: {
7
+ startCol: number;
8
+ cols: number;
9
+ }[], columns: number): number[];
@@ -0,0 +1,57 @@
1
+ import { CalendarEvent } from './types.js';
2
+ /**
3
+ * What a read-only event's draggable wrapper must not say: dnd-kit marks it
4
+ * "draggable", points to its pick-up instructions and gives it a tab stop of
5
+ * its own. The chip's own button stays the one focusable, named control.
6
+ */
7
+ export declare function readOnlyDragProps(readOnly: boolean): {
8
+ readonly 'aria-roledescription': undefined;
9
+ readonly 'aria-describedby': undefined;
10
+ readonly 'aria-disabled': undefined;
11
+ readonly tabIndex: undefined;
12
+ } | {
13
+ readonly 'aria-roledescription'?: undefined;
14
+ 'aria-describedby'?: undefined;
15
+ readonly 'aria-disabled'?: undefined;
16
+ readonly tabIndex?: undefined;
17
+ };
18
+ /**
19
+ * The props of an event's draggable wrapper (`Draggable`), the same in the
20
+ * time grid, the all-day strip and the month's overflow list: its drag
21
+ * switches (off with `disabled`, `readOnlyEvents` or the event's own
22
+ * `disabled`), a named group in place of dnd-kit's `button` (which would hold
23
+ * the chip's own button), and the focus that follows the event.
24
+ */
25
+ export declare function useEventDragProps(event: CalendarEvent, title: string): {
26
+ readonly role: "group";
27
+ readonly 'aria-label': string;
28
+ readonly onFocus: () => void;
29
+ readonly onClick: (click: {
30
+ stopPropagation: () => void;
31
+ }) => void;
32
+ readonly 'aria-roledescription': undefined;
33
+ readonly 'aria-describedby': undefined;
34
+ readonly 'aria-disabled': undefined;
35
+ readonly tabIndex: undefined;
36
+ readonly id: string;
37
+ readonly data: {
38
+ readonly type: "event";
39
+ };
40
+ readonly disabled: boolean;
41
+ } | {
42
+ readonly role: "group";
43
+ readonly 'aria-label': string;
44
+ readonly onFocus: () => void;
45
+ readonly onClick: (click: {
46
+ stopPropagation: () => void;
47
+ }) => void;
48
+ readonly 'aria-roledescription'?: undefined;
49
+ readonly 'aria-describedby'?: undefined;
50
+ readonly 'aria-disabled'?: undefined;
51
+ readonly tabIndex?: undefined;
52
+ readonly id: string;
53
+ readonly data: {
54
+ readonly type: "event";
55
+ };
56
+ readonly disabled: boolean;
57
+ };
@@ -24,7 +24,12 @@ export declare function withColumn(event: CalendarEvent, column: string | null):
24
24
  export declare function columnKey(column: ResourceColumn): string;
25
25
  /** The resource an event belongs to; none when it has none or an unknown one. */
26
26
  export declare function ownerOf(event: CalendarEvent, resources?: EventCalendarResource[]): EventCalendarResource | undefined;
27
- /** The event drawn in its resource's tone when it sets no colour of its own. */
27
+ /** The tone an event is drawn in: its own, else its resource's. */
28
+ export declare function toneOf(event: CalendarEvent, owner?: EventCalendarResource): Tone | undefined;
29
+ /**
30
+ * The event drawn in its tone when it sets no colour of its own: its `color`
31
+ * wins, then its `tone`, then its resource's.
32
+ */
28
33
  export declare function withOwnerTone(event: CalendarEvent, owner?: EventCalendarResource): CalendarEvent;
29
34
  /**
30
35
  * The column an event is dropped into, or the event itself when it is already
@@ -1,6 +1,7 @@
1
+ export type { EventCalendarBadges, EventCalendarDayMarksProps, EventCalendarSpan, } from './backdrop.types.js';
1
2
  export type { EventCalendarProps } from './event-calendar.js';
2
3
  export { EventCalendar } from './event-calendar.js';
3
4
  export { EventCalendarProvider, useEventCalendarContext, } from './event-calendar-context.js';
4
5
  export type { EventCalendarLane, EventCalendarTemplateChange, EventCalendarTemplateEvent, EventCalendarTemplateProps, EventCalendarTemplateSlot, EventCalendarWeekday, } from './template.types.js';
5
- export type { CalendarEvent, CalendarEventBadge, EventCalendarChange, EventCalendarDensity, EventCalendarPreviewField, EventCalendarRenderEvent, EventCalendarResource, EventCalendarSlot, EventCalendarView, } from './types.js';
6
+ export type { CalendarEvent, CalendarEventBadge, CalendarEventStatus, EventCalendarChange, EventCalendarDensity, EventCalendarPreviewField, EventCalendarRenderEvent, EventCalendarResource, EventCalendarSlot, EventCalendarView, } from './types.js';
6
7
  export { useEventCalendar } from './use-event-calendar.js';
@@ -0,0 +1,14 @@
1
+ import { BackdropLane } from '../backdrop.types.js';
2
+ import { SpanSegment } from '../event-calendar.spans.js';
3
+ /**
4
+ * What the all-day strip draws: the backdrop spans as bars in the rows on
5
+ * top, then the multi-day events below them.
6
+ */
7
+ export declare function AllDayBars({ days, segments, backdrop, }: {
8
+ days: Date[];
9
+ segments: SpanSegment[];
10
+ backdrop: {
11
+ lanes: BackdropLane[];
12
+ rows: number;
13
+ };
14
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { BackdropSegment } from '../backdrop.types.js';
2
+ import { DayAxis } from '../event-calendar.axis.js';
3
+ /**
4
+ * The spans of one column of hours: a hatched band under the events (z-0)
5
+ * with its label at the top. Decoration only: `aria-hidden`, no pointer
6
+ * events, no tab stop; the column's name carries the text.
7
+ */
8
+ export declare function BackdropBands({ segments, axis, }: {
9
+ segments: BackdropSegment[];
10
+ axis: DayAxis;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { BackdropLane } from '../backdrop.types.js';
2
+ /**
3
+ * A whole-day span as a bar of the all-day strip, in the rows above the
4
+ * events. Decoration: `aria-hidden`, no pointer events (a click reaches the
5
+ * day under it).
6
+ */
7
+ export declare function BackdropBar({ lane, showLabel, }: {
8
+ lane: BackdropLane;
9
+ /** False where the columns are too narrow for a label (a phone's week). */
10
+ showLabel?: boolean;
11
+ }): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { BackdropSegment } from '../backdrop.types.js';
2
+ /**
3
+ * The spans of a month cell: the cell shaded (a half day shades its half),
4
+ * the label in its top corner from 7rem of cell width, and under that a dot.
5
+ * Decoration: `aria-hidden`, no pointer events; the cell's name carries the
6
+ * text. The cell is the `day` container and an `isolate` stacking context, so
7
+ * the shading sits under its content.
8
+ */
9
+ export declare function BackdropCell({ segments, below, }: {
10
+ segments: BackdropSegment[];
11
+ /** The labels sit at the cell's foot: its day badge takes the top row. */
12
+ below?: boolean;
13
+ }): import("react").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The spans of a day in the agenda and the phone's day list: a hatched row
3
+ * with the label, ahead of the events. It is text, not a control: no pointer
4
+ * events (a click reaches the day) and no tab stop.
5
+ */
6
+ export declare function BackdropRow({ day }: {
7
+ day: Date;
8
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import { CalendarEventBadge } from '../types.js';
2
+ /**
3
+ * A day's or a week's badge: a small soft pill, or with `dot` (where the room
4
+ * is short, such as a phone's column) a short tone bar whose label is its tooltip
5
+ * and, hidden visually, its text. The container that names it (a button, a
6
+ * cell) holds the label in its own name.
7
+ */
8
+ export declare function CalendarBadge({ badge, slot, dot, wrap, className, }: {
9
+ badge: CalendarEventBadge;
10
+ /** The `data-slot` of the pill; the dot adds `-dot`. */
11
+ slot: string;
12
+ dot?: boolean;
13
+ /** The label may take two lines instead of one clipped (a narrow corner). */
14
+ wrap?: boolean;
15
+ className?: string;
16
+ }): import("react").JSX.Element;