@nxgt/material 3.96.1 → 3.97.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 +34 -0
- package/README.md +2 -2
- package/dist/{alert-dialog-CXrzx0_F.js → alert-dialog-VyVfYwzv.js} +1 -1
- package/dist/{async-slice-BU95-2E-.js → async-slice-jR8f-SJC.js} +1 -1
- package/dist/{button-BWrgbYzl.js → button-ClrQMe_S.js} +1 -1
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-CSzocvaa.js → calculator-kdSjeRhf.js} +10 -10
- package/dist/{calculator-segment-eqckz2Gh.js → calculator-segment-OI0rHAjA.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-CXHTVFNy.js → chip-DzKhmUzo.js} +2 -2
- package/dist/{code-editor-jL17cLkd.js → code-editor-DV0TiySE.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-CefP9Ag7.js → code-language-items-6o5SAVbP.js} +2 -2
- package/dist/{components-CrglpttC.js → components-Bk8KDjaj.js} +11383 -11228
- package/dist/components.js +24 -24
- package/dist/{conversion-variant-BQYmd3cd.js → conversion-variant-QaaNYhTr.js} +4 -4
- package/dist/{currency-field-BT6V3B9k.js → currency-field-5Zg_sjY1.js} +95 -61
- package/dist/{dialog-CraDDyZ5.js → dialog-Bti9bn6a.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-BvCQYzou.js → dropdown-menu-B21gOpBE.js} +1 -1
- package/dist/editor.js +8 -8
- package/dist/{empty-state-BZ-z6vFF.js → empty-state-Dw-X-0aA.js} +1 -1
- package/dist/{financial-variant-CIeXbVuZ.js → financial-variant-DR7pCGqi.js} +5 -5
- package/dist/{hooks-DnDZqwHK.js → hooks-ppNryrR_.js} +2 -2
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-Dnaux56l.js → hover-card-tmyRjh2p.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-DoQcaVIt.js → icon-badge-DW6-PxOt.js} +1 -1
- package/dist/{icon-button-Cn1iJKLh.js → icon-button-DKpk5gLZ.js} +1 -1
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +1 -0
- package/dist/lib/components/ui/collections/row-menu/use-row-menu-focus.d.ts +4 -2
- package/dist/lib/components/ui/display/event-chip/event-chip-badges.d.ts +2 -1
- package/dist/lib/components/ui/display/event-chip/event-chip-content.d.ts +2 -0
- package/dist/lib/components/ui/display/event-chip/event-chip.d.ts +3 -1
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/currency-field/currency-field.d.ts +9 -1
- package/dist/lib/components/ui/fields/currency-field/use-currency-amount.d.ts +3 -1
- package/dist/lib/components/ui/fields/currency-field/use-minor-units.d.ts +9 -0
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-heading.d.ts +12 -0
- package/dist/lib/components/ui/fields/repeatable-group/repeatable-group.d.ts +1 -1
- package/dist/lib/components/ui/fields/repeatable-group/types.d.ts +5 -0
- package/dist/lib/components/ui/fields/repeatable-group/use-repeatable-group-text.d.ts +19 -0
- package/dist/lib/components/ui/fields/textarea-field/textarea-field.d.ts +3 -1
- package/dist/lib/components/ui/media/image-cropper/image-cropper.d.ts +6 -1
- package/dist/lib/components/ui/media/image-cropper/use-apply-crop.d.ts +16 -0
- package/dist/lib/components/ui/media/image-cropper/use-image-cropper.d.ts +2 -2
- package/dist/lib/components/ui/widgets/education/questions/partials/content-lang.d.ts +14 -0
- package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question-props.types.d.ts +87 -0
- package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +1 -74
- package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-badge.d.ts +1 -3
- package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-event-chip.d.ts +3 -1
- package/dist/lib/i18n/resources/en/en.d.ts +2 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +3 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +2 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +3 -1
- package/dist/lib/i18n/resources/resources.d.ts +4 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +28 -28
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/{pdf-MkmivNXn.js → pdf-9BAZhzg9.js} +9777 -7726
- package/dist/pdf-reader.js +1 -1
- package/dist/pdf.worker.min.mjs +5 -5
- package/dist/{percent-field-Cb1aKl2E.js → percent-field-D1Y4HUPt.js} +2 -2
- package/dist/{picker-surface-GsabnsXj.js → picker-surface-Bc7jhjjV.js} +4 -4
- package/dist/{popover-ChQHl-f7.js → popover-C2AG-fER.js} +1 -1
- package/dist/{pos-types-D29gSY6o.js → pos-types-BXMMXwbI.js} +1 -1
- package/dist/{pos-variant-DqPKfqlj.js → pos-variant-DCf4-Val.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-eUfpdy1g.js → programmer-variant-BnvZqPJs.js} +2 -2
- package/dist/{public-BZqEkG6p.js → public-BuRnxJOK.js} +11 -11
- package/dist/{rich-code-block-LhH6kbbp.js → rich-code-block-C30r7TeB.js} +5 -5
- package/dist/{scientific-variant-Df2INIYv.js → scientific-variant-Z1vVCSJv.js} +2 -2
- package/dist/{sortable-provider-COpuXp55.js → sortable-provider-DZzc_tN2.js} +2 -2
- package/dist/{spinner-CJFQWd2O.js → spinner-BiGzIQFB.js} +1 -1
- package/dist/{tabs-D5YrKdgT.js → tabs-CzBz8Doo.js} +1 -1
- package/dist/{text-field-D8y_9TyA.js → text-field-bla3PUdk.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-B6k9-nbm.js → theme-toggle-B7rO23w0.js} +1 -1
- package/dist/{toolbar-items-DSVVI5_f.js → toolbar-items-CBv3l8sn.js} +4 -4
- package/dist/{translate-material-B_3mzvSr.js → translate-material-9bYZA_nV.js} +1 -1
- package/dist/{translator-DcF9o74-.js → translator-B5RR8VyT.js} +6 -2
- package/dist/{use-chat-composer-DaD-HRc_.js → use-chat-composer-4cs6opDX.js} +2108 -2101
- package/dist/{use-heading-spy-BrH2blon.js → use-heading-spy-De3zZEMX.js} +4 -4
- package/dist/{use-material-translation-CvL9XRpG.js → use-material-translation-DM4nCI16.js} +1 -1
- package/dist/{use-return-focus-Dl3XUhck.js → use-return-focus-CbTPRBcn.js} +1 -1
- package/docs/components/data-display.md +3 -2
- package/docs/components/data-table-filter-and-lists.md +3 -1
- package/docs/components/form-fields.md +6 -2
- package/docs/components/media-and-files.md +20 -2
- package/docs/components/rich-widgets.md +13 -3
- package/docs/guides/csp.md +0 -1
- package/docs/guides/event-calendar.md +12 -3
- package/docs/guides/forms.md +1 -1
- package/docs/guides/i18n.md +1 -1
- package/docs/guides/pdf-reader.md +13 -2
- package/docs/troubleshooting.md +7 -0
- package/package.json +5 -5
|
@@ -17,5 +17,13 @@ export type CurrencyFieldProps = Omit<TextFieldProps, 'type' | 'value' | 'defaul
|
|
|
17
17
|
* (`CalculatorField`'s "Open calculator"). It keeps its own name and focus.
|
|
18
18
|
*/
|
|
19
19
|
trailingAction?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* `value`, `defaultValue` and `onChange` are whole minor units (cents,
|
|
22
|
+
* centimes, yen) instead of major units: `1999` shows `19.99` in EUR.
|
|
23
|
+
* The decimals are the currency's own (EUR 2, XAF 0, KWD 3), or
|
|
24
|
+
* `fractionDigits` when given, as `formatAmount`'s `minorUnits` option.
|
|
25
|
+
* Off by default.
|
|
26
|
+
*/
|
|
27
|
+
minorUnits?: boolean;
|
|
20
28
|
};
|
|
21
|
-
export declare function CurrencyField({ value, defaultValue, onChange, currency, fractionDigits, trailingAction, className, ...props }: CurrencyFieldProps): import("react").JSX.Element;
|
|
29
|
+
export declare function CurrencyField({ value, defaultValue, onChange, currency, fractionDigits, trailingAction, minorUnits, className, ...props }: CurrencyFieldProps): import("react").JSX.Element;
|
|
@@ -4,12 +4,14 @@ type Options = {
|
|
|
4
4
|
onChange?: (value: number | null) => void;
|
|
5
5
|
currency: string;
|
|
6
6
|
fractionDigits?: number;
|
|
7
|
+
/** `value`, `defaultValue` and `onChange` are whole minor units. */
|
|
8
|
+
minorUnits?: boolean;
|
|
7
9
|
};
|
|
8
10
|
/**
|
|
9
11
|
* The text a currency field shows and the amount it holds, controlled or
|
|
10
12
|
* not: `change` follows typing, `commit` formats the amount on blur.
|
|
11
13
|
*/
|
|
12
|
-
export declare function useCurrencyAmount({ value, defaultValue, onChange, currency, fractionDigits, }: Options): {
|
|
14
|
+
export declare function useCurrencyAmount({ value, defaultValue, onChange, currency, fractionDigits, minorUnits, }: Options): {
|
|
13
15
|
draft: string;
|
|
14
16
|
change: (raw: string) => void;
|
|
15
17
|
commit: (raw: string) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two conversions between the amount a currency field holds (major
|
|
3
|
+
* units) and the one its props carry: identity, or whole minor units when
|
|
4
|
+
* `minorUnits` is set.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useMinorUnits(minorUnits: boolean, currency: string, fractionDigits?: number): {
|
|
7
|
+
toMajor: (external: number | null | undefined) => number | null | undefined;
|
|
8
|
+
toExternal: (major: number | null) => number | null;
|
|
9
|
+
};
|
package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-heading.d.ts
CHANGED
|
@@ -6,6 +6,18 @@ export declare function RepeatableGroupLabel({ id, children, }: {
|
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
7
|
/** An error about the whole group, under the rows; it describes the group. */
|
|
8
8
|
export declare function RepeatableGroupError({ id, children, }: {
|
|
9
|
+
id: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element | null;
|
|
12
|
+
/** Help text under the label; it describes the group. */
|
|
13
|
+
export declare function RepeatableGroupDescription({ id, children, }: {
|
|
9
14
|
id: string;
|
|
10
15
|
children: ReactNode;
|
|
11
16
|
}): import("react").JSX.Element;
|
|
17
|
+
/** The label, then the description under it, each only when given. */
|
|
18
|
+
export declare function RepeatableGroupHeading({ label, labelId, description, descriptionId, }: {
|
|
19
|
+
label?: ReactNode;
|
|
20
|
+
labelId: string;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
descriptionId: string;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
@@ -9,4 +9,4 @@ export type { RepeatableGroupProps, RepeatableGroupRowContext, } from './types.j
|
|
|
9
9
|
* politely. For react-hook-form, `RepeatableGroupFormField` wires it to
|
|
10
10
|
* `useFieldArray`.
|
|
11
11
|
*/
|
|
12
|
-
export declare function RepeatableGroup<TItem>({ items, renderRow, getKey, label, rowLabel, addLabel, onAdd, onRemove, onMove, reorderable, min, removeAtMin, max, removable, removeDisabledReason, disabled, error, emptyTitle, emptyDescription, className, ref, ...props }: RepeatableGroupProps<TItem>): import("react").JSX.Element;
|
|
12
|
+
export declare function RepeatableGroup<TItem>({ items, renderRow, getKey, label, description, rowLabel, addLabel, onAdd, onRemove, onMove, reorderable, min, removeAtMin, max, removable, removeDisabledReason, disabled, error, emptyTitle, emptyDescription, className, ref, 'aria-describedby': own, ...props }: RepeatableGroupProps<TItem>): import("react").JSX.Element;
|
|
@@ -19,6 +19,11 @@ export type RepeatableGroupProps<TItem> = Omit<ComponentProps<'div'>, 'children'
|
|
|
19
19
|
getKey?: (item: TItem, index: number) => Key;
|
|
20
20
|
/** The group's label, above the rows; it names the group and the list. */
|
|
21
21
|
label?: ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Help text under the label, like other fields' help text; the group's
|
|
24
|
+
* `aria-describedby` points at it, so it is announced with the group.
|
|
25
|
+
*/
|
|
26
|
+
description?: ReactNode;
|
|
22
27
|
/**
|
|
23
28
|
* What one row is, lower case: it names the row's buttons ("Remove
|
|
24
29
|
* period 2") and the announcements. Default "row", translated.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The ids of the group's label, description and error, which of the three are
|
|
4
|
+
* given, and the group's `aria-describedby` (the caller's own ids, then the
|
|
5
|
+
* description's and the error's).
|
|
6
|
+
*/
|
|
7
|
+
export declare function useRepeatableGroupText(label: ReactNode, description: ReactNode, error: ReactNode, own?: string): {
|
|
8
|
+
named: boolean;
|
|
9
|
+
failed: boolean;
|
|
10
|
+
errorId: string;
|
|
11
|
+
/** The `RepeatableGroupHeading` props: what is not given stays undefined. */
|
|
12
|
+
heading: {
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
labelId: string;
|
|
15
|
+
description: ReactNode;
|
|
16
|
+
descriptionId: string;
|
|
17
|
+
};
|
|
18
|
+
describedBy: string | undefined;
|
|
19
|
+
};
|
|
@@ -6,5 +6,7 @@ export type TextareaProps = {
|
|
|
6
6
|
minRows?: number;
|
|
7
7
|
maxRows?: number;
|
|
8
8
|
showCount?: boolean;
|
|
9
|
+
/** Sets the theme's monospace font (`--font-mono`) for code-like plain text. */
|
|
10
|
+
monospace?: boolean;
|
|
9
11
|
} & ComponentProps<'textarea'>;
|
|
10
|
-
export declare function TextareaField({ error, helperText, label, className, placeholder, minRows, maxRows, showCount, maxLength, value, defaultValue, onChange, ...props }: TextareaProps): import("react").JSX.Element;
|
|
12
|
+
export declare function TextareaField({ error, helperText, label, className, placeholder, minRows, maxRows, showCount, monospace, maxLength, value, defaultValue, onChange, ...props }: TextareaProps): import("react").JSX.Element;
|
|
@@ -5,7 +5,12 @@ export type ImageCropperProps = {
|
|
|
5
5
|
aspect?: number;
|
|
6
6
|
cropShape?: ImageCropShape;
|
|
7
7
|
fileName?: string;
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Receives the cropped file. May return a promise (an upload, say): Apply
|
|
10
|
+
* stays busy and Cancel disabled until it settles. A rejection keeps the
|
|
11
|
+
* crop, so the user can apply again; show your own error.
|
|
12
|
+
*/
|
|
13
|
+
onCrop: (result: ImageCropResult) => void | Promise<void>;
|
|
9
14
|
onCancel?: () => void;
|
|
10
15
|
/** The Cancel button's variant. Default `'tonal'`; `'ghost'` restores the earlier look. */
|
|
11
16
|
cancelVariant?: ButtonVariant;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Area } from 'react-easy-crop';
|
|
2
|
+
import { ImageCropResult } from './types.js';
|
|
3
|
+
type Options = {
|
|
4
|
+
src: string;
|
|
5
|
+
area: Area | null;
|
|
6
|
+
rotation: number;
|
|
7
|
+
fileName?: string;
|
|
8
|
+
onCrop: (result: ImageCropResult) => void | Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
/** The apply step: crops the image, hands it to `onCrop` and tracks saving. */
|
|
11
|
+
export declare function useApplyCrop({ src, area, rotation, fileName, onCrop, }: Options): {
|
|
12
|
+
apply: () => Promise<void>;
|
|
13
|
+
isSaving: boolean;
|
|
14
|
+
error: string | null;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -6,10 +6,10 @@ type Options = {
|
|
|
6
6
|
src: string;
|
|
7
7
|
aspect?: number;
|
|
8
8
|
fileName?: string;
|
|
9
|
-
onCrop: (result: ImageCropResult) => void
|
|
9
|
+
onCrop: (result: ImageCropResult) => void | Promise<void>;
|
|
10
10
|
frameRef: RefObject<HTMLDivElement | null>;
|
|
11
11
|
};
|
|
12
|
-
/** The cropper's crop, zoom, rotation and aspect state, and the apply
|
|
12
|
+
/** The cropper's crop, zoom, rotation and aspect state, and the area to apply. */
|
|
13
13
|
export declare function useImageCropper({ src, aspect: aspectProp, fileName, onCrop, frameRef, }: Options): {
|
|
14
14
|
crop: Point;
|
|
15
15
|
setCrop: import('react').Dispatch<import('react').SetStateAction<Point>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare const ContentLangProvider: import('react').Provider<string | undefined>;
|
|
3
|
+
export declare function useContentLang(): string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Marks a content part (prompt, option, hint, explanation, reference, example)
|
|
6
|
+
* with the question's `contentLang`. Without one it renders its children as
|
|
7
|
+
* they are, so a card with no `contentLang` keeps its markup. The card's own
|
|
8
|
+
* strings never go through it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ContentLang({ children, block, }: {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
/** A `div` instead of a `span`, for block content. */
|
|
13
|
+
block?: boolean;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { QuestionProps } from '../types.js';
|
|
2
2
|
/** A question's fieldset: prompt, header, media, hint, the answer body and the feedback. */
|
|
3
|
-
export declare function QuestionContent({ question, value, onValueChange, revealed: revealedProp, verdict, points, feedback, disabled, readOnly, busy, renderCode, promptId: promptIdProp, variant, density, showShortcuts, number, showFeedback: showFeedbackProp, preview, }: QuestionProps): import("react").JSX.Element;
|
|
3
|
+
export declare function QuestionContent({ question, value, onValueChange, revealed: revealedProp, verdict, points, feedback, disabled, readOnly, busy, renderCode, promptId: promptIdProp, variant, density, showShortcuts, number, showFeedback: showFeedbackProp, preview, contentLang, }: QuestionProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Question, QuestionAnswer, QuestionPoints, QuestionVerdict } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* What `renderCode` gets to draw the code field of a `code` question. The
|
|
5
|
+
* editor must be named by the prompt (`label`, or `aria-labelledby={labelledBy}`)
|
|
6
|
+
* and honour `readOnly` and `disabled`.
|
|
7
|
+
*/
|
|
8
|
+
export type QuestionCodeField = {
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
/** The prompt's id: name the field with `aria-labelledby`. */
|
|
12
|
+
labelledBy: string;
|
|
13
|
+
/** The id of the `description` line, when there is one: add it to `aria-describedby`. */
|
|
14
|
+
describedBy?: string;
|
|
15
|
+
/** The prompt, as a text label for editors that take one. */
|
|
16
|
+
label: string;
|
|
17
|
+
language?: string;
|
|
18
|
+
maxLength?: number;
|
|
19
|
+
readOnly: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
/** The card's `contentLang`, for an editor that takes a `lang` (the starter code's language). */
|
|
22
|
+
lang?: string;
|
|
23
|
+
};
|
|
24
|
+
export type QuestionProps = {
|
|
25
|
+
question: Question;
|
|
26
|
+
value?: QuestionAnswer;
|
|
27
|
+
onValueChange?: (value: QuestionAnswer) => void;
|
|
28
|
+
revealed?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The id of the prompt (the fieldset's legend text), so a wrapper can use
|
|
31
|
+
* `aria-labelledby`. Default: a generated id. The `description` line is
|
|
32
|
+
* `${promptId}-description`.
|
|
33
|
+
*/
|
|
34
|
+
promptId?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The verdict the server gave, shown as given (no comparison with
|
|
37
|
+
* `question.correct` in the browser). It reveals the card; `pending` is a
|
|
38
|
+
* free answer still waiting for a grader; `unanswered` is a question left
|
|
39
|
+
* blank (no value is shown, the points read 0). `question.correct` may still
|
|
40
|
+
* be passed to highlight the correct choices.
|
|
41
|
+
*/
|
|
42
|
+
verdict?: QuestionVerdict;
|
|
43
|
+
/** Points earned, shown in the verdict banner (needs `verdict`). */
|
|
44
|
+
points?: QuestionPoints;
|
|
45
|
+
/** A grader's remark, shown in the verdict banner (needs `verdict`). */
|
|
46
|
+
feedback?: string;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** The answer is shown but not editable (already submitted), without the revealed marks. Every kind honours it. */
|
|
49
|
+
readOnly?: boolean;
|
|
50
|
+
/** An answer is being saved: the field is locked like `readOnly` and `aria-busy`. Every kind honours it. */
|
|
51
|
+
busy?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The code field of a `code` question, e.g. `@nxgt/material/code-editor`'s
|
|
54
|
+
* `CodeEditor` (kept out of this bundle: Monaco is heavy). Without it the
|
|
55
|
+
* field is a monospace textarea.
|
|
56
|
+
*/
|
|
57
|
+
renderCode?: (field: QuestionCodeField) => ReactNode;
|
|
58
|
+
className?: string;
|
|
59
|
+
/** `card` (the default) is framed; `plain` sits inside another surface. */
|
|
60
|
+
variant?: 'card' | 'plain';
|
|
61
|
+
density?: 'comfortable' | 'compact';
|
|
62
|
+
/** Shows a key badge (1, 2, 3…) on each option. */
|
|
63
|
+
showShortcuts?: boolean;
|
|
64
|
+
/** The question's number, shown above the prompt ("Question 2"). */
|
|
65
|
+
number?: number;
|
|
66
|
+
/** The verdict banner once revealed: right or wrong, the correct answer. */
|
|
67
|
+
showFeedback?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* An author's preview: the card is read-only and shows the marks, the
|
|
70
|
+
* `question.correct` answer (the right options marked, the expected text or
|
|
71
|
+
* number filled in) and the `explanation`, with no verdict banner.
|
|
72
|
+
* `verdict` and `showFeedback` are always ignored in a preview; `value` is
|
|
73
|
+
* ignored when the question has a `correct`. An `open` or `code` question
|
|
74
|
+
* has none, so pass its reference answer as `value`. Never used for a
|
|
75
|
+
* learner's attempt.
|
|
76
|
+
*/
|
|
77
|
+
preview?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The language of the question's content (a BCP 47 tag, `en`): sets `lang`
|
|
80
|
+
* on the prompt, the options, the hints, the explanation, the option
|
|
81
|
+
* explanations, the references and the code examples and starter, so a
|
|
82
|
+
* screen reader announces them in their own language. The card's own
|
|
83
|
+
* strings (buttons, labels, notes) keep the page's language. Default: no
|
|
84
|
+
* `lang`, the content takes the page's.
|
|
85
|
+
*/
|
|
86
|
+
contentLang?: string;
|
|
87
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { QuestionProps } from './types.js';
|
|
2
|
-
export declare function QuestionCard({ question, value, onValueChange, revealed, verdict, points, feedback, disabled, readOnly, busy, renderCode, promptId, className, variant, density, showShortcuts, number, showFeedback, preview, }: QuestionProps): import("react").JSX.Element;
|
|
2
|
+
export declare function QuestionCard({ question, value, onValueChange, revealed, verdict, points, feedback, disabled, readOnly, busy, renderCode, promptId, className, variant, density, showShortcuts, number, showFeedback, preview, contentLang, }: QuestionProps): import("react").JSX.Element;
|
|
@@ -109,77 +109,4 @@ export type Question = {
|
|
|
109
109
|
/** `code`: the language of the code ("python"), given to `renderCode`. */
|
|
110
110
|
language?: string;
|
|
111
111
|
};
|
|
112
|
-
|
|
113
|
-
* What `renderCode` gets to draw the code field of a `code` question. The
|
|
114
|
-
* editor must be named by the prompt (`label`, or `aria-labelledby={labelledBy}`)
|
|
115
|
-
* and honour `readOnly` and `disabled`.
|
|
116
|
-
*/
|
|
117
|
-
export type QuestionCodeField = {
|
|
118
|
-
value: string;
|
|
119
|
-
onChange: (value: string) => void;
|
|
120
|
-
/** The prompt's id: name the field with `aria-labelledby`. */
|
|
121
|
-
labelledBy: string;
|
|
122
|
-
/** The id of the `description` line, when there is one: add it to `aria-describedby`. */
|
|
123
|
-
describedBy?: string;
|
|
124
|
-
/** The prompt, as a text label for editors that take one. */
|
|
125
|
-
label: string;
|
|
126
|
-
language?: string;
|
|
127
|
-
maxLength?: number;
|
|
128
|
-
readOnly: boolean;
|
|
129
|
-
disabled: boolean;
|
|
130
|
-
};
|
|
131
|
-
export type QuestionProps = {
|
|
132
|
-
question: Question;
|
|
133
|
-
value?: QuestionAnswer;
|
|
134
|
-
onValueChange?: (value: QuestionAnswer) => void;
|
|
135
|
-
revealed?: boolean;
|
|
136
|
-
/**
|
|
137
|
-
* The id of the prompt (the fieldset's legend text), so a wrapper can use
|
|
138
|
-
* `aria-labelledby`. Default: a generated id. The `description` line is
|
|
139
|
-
* `${promptId}-description`.
|
|
140
|
-
*/
|
|
141
|
-
promptId?: string;
|
|
142
|
-
/**
|
|
143
|
-
* The verdict the server gave, shown as given (no comparison with
|
|
144
|
-
* `question.correct` in the browser). It reveals the card; `pending` is a
|
|
145
|
-
* free answer still waiting for a grader; `unanswered` is a question left
|
|
146
|
-
* blank (no value is shown, the points read 0). `question.correct` may still
|
|
147
|
-
* be passed to highlight the correct choices.
|
|
148
|
-
*/
|
|
149
|
-
verdict?: QuestionVerdict;
|
|
150
|
-
/** Points earned, shown in the verdict banner (needs `verdict`). */
|
|
151
|
-
points?: QuestionPoints;
|
|
152
|
-
/** A grader's remark, shown in the verdict banner (needs `verdict`). */
|
|
153
|
-
feedback?: string;
|
|
154
|
-
disabled?: boolean;
|
|
155
|
-
/** The answer is shown but not editable (already submitted), without the revealed marks. Every kind honours it. */
|
|
156
|
-
readOnly?: boolean;
|
|
157
|
-
/** An answer is being saved: the field is locked like `readOnly` and `aria-busy`. Every kind honours it. */
|
|
158
|
-
busy?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* The code field of a `code` question, e.g. `@nxgt/material/code-editor`'s
|
|
161
|
-
* `CodeEditor` (kept out of this bundle: Monaco is heavy). Without it the
|
|
162
|
-
* field is a monospace textarea.
|
|
163
|
-
*/
|
|
164
|
-
renderCode?: (field: QuestionCodeField) => ReactNode;
|
|
165
|
-
className?: string;
|
|
166
|
-
/** `card` (the default) is framed; `plain` sits inside another surface. */
|
|
167
|
-
variant?: 'card' | 'plain';
|
|
168
|
-
density?: 'comfortable' | 'compact';
|
|
169
|
-
/** Shows a key badge (1, 2, 3…) on each option. */
|
|
170
|
-
showShortcuts?: boolean;
|
|
171
|
-
/** The question's number, shown above the prompt ("Question 2"). */
|
|
172
|
-
number?: number;
|
|
173
|
-
/** The verdict banner once revealed: right or wrong, the correct answer. */
|
|
174
|
-
showFeedback?: boolean;
|
|
175
|
-
/**
|
|
176
|
-
* An author's preview: the card is read-only and shows the marks, the
|
|
177
|
-
* `question.correct` answer (the right options marked, the expected text or
|
|
178
|
-
* number filled in) and the `explanation`, with no verdict banner.
|
|
179
|
-
* `verdict` and `showFeedback` are always ignored in a preview; `value` is
|
|
180
|
-
* ignored when the question has a `correct`. An `open` or `code` question
|
|
181
|
-
* has none, so pass its reference answer as `value`. Never used for a
|
|
182
|
-
* learner's attempt.
|
|
183
|
-
*/
|
|
184
|
-
preview?: boolean;
|
|
185
|
-
};
|
|
112
|
+
export type { QuestionCodeField, QuestionProps, } from './question-props.types.js';
|
|
@@ -5,12 +5,10 @@ import { CalendarEventBadge } from '../types.js';
|
|
|
5
5
|
* and, hidden visually, its text. The container that names it (a button, a
|
|
6
6
|
* cell) holds the label in its own name.
|
|
7
7
|
*/
|
|
8
|
-
export declare function CalendarBadge({ badge, slot, dot,
|
|
8
|
+
export declare function CalendarBadge({ badge, slot, dot, className, }: {
|
|
9
9
|
badge: CalendarEventBadge;
|
|
10
10
|
/** The `data-slot` of the pill; the dot adds `-dot`. */
|
|
11
11
|
slot: string;
|
|
12
12
|
dot?: boolean;
|
|
13
|
-
/** The label may take two lines instead of one clipped (a narrow corner). */
|
|
14
|
-
wrap?: boolean;
|
|
15
13
|
className?: string;
|
|
16
14
|
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CalendarEvent } from '../types.js';
|
|
2
|
-
export declare function CalendarEventChip({ event: drawn, compact, tight, className, continuesBefore, continuesAfter, appearance, }: {
|
|
2
|
+
export declare function CalendarEventChip({ event: drawn, compact, tight, short, className, continuesBefore, continuesAfter, appearance, }: {
|
|
3
3
|
event: CalendarEvent;
|
|
4
4
|
compact?: boolean;
|
|
5
5
|
/** The chip's box is under 20px tall (back-to-back short events). */
|
|
6
6
|
tight?: boolean;
|
|
7
|
+
/** The box is under 60px: a badge joins the time's line instead of a row of its own. */
|
|
8
|
+
short?: boolean;
|
|
7
9
|
className?: string;
|
|
8
10
|
continuesBefore?: boolean;
|
|
9
11
|
continuesAfter?: boolean;
|
|
@@ -1861,7 +1861,9 @@ declare const _default: {
|
|
|
1861
1861
|
"lane-all": "All weeks",
|
|
1862
1862
|
"cancelled": "Cancelled",
|
|
1863
1863
|
"week-badge": "Week: {label}",
|
|
1864
|
-
"time-zone": "Time zone: {zone}"
|
|
1864
|
+
"time-zone": "Time zone: {zone}",
|
|
1865
|
+
"from": "From {time}",
|
|
1866
|
+
"until": "Until {time}"
|
|
1865
1867
|
},
|
|
1866
1868
|
"event-chip": {
|
|
1867
1869
|
"cancelled": "Cancelled"
|
|
@@ -1861,7 +1861,9 @@ declare const _default: {
|
|
|
1861
1861
|
"lane-all": "Toutes les semaines",
|
|
1862
1862
|
"cancelled": "Annulé",
|
|
1863
1863
|
"week-badge": "Semaine : {label}",
|
|
1864
|
-
"time-zone": "Fuseau horaire : {zone}"
|
|
1864
|
+
"time-zone": "Fuseau horaire : {zone}",
|
|
1865
|
+
"from": "À partir de {time}",
|
|
1866
|
+
"until": "Jusqu’à {time}"
|
|
1865
1867
|
},
|
|
1866
1868
|
"event-chip": {
|
|
1867
1869
|
"cancelled": "Annulé"
|
|
@@ -1870,6 +1870,8 @@ export declare const resources: {
|
|
|
1870
1870
|
cancelled: string;
|
|
1871
1871
|
"week-badge": string;
|
|
1872
1872
|
"time-zone": string;
|
|
1873
|
+
from: string;
|
|
1874
|
+
until: string;
|
|
1873
1875
|
};
|
|
1874
1876
|
"event-chip": {
|
|
1875
1877
|
cancelled: string;
|
|
@@ -5461,6 +5463,8 @@ export declare const resources: {
|
|
|
5461
5463
|
cancelled: string;
|
|
5462
5464
|
"week-badge": string;
|
|
5463
5465
|
"time-zone": string;
|
|
5466
|
+
from: string;
|
|
5467
|
+
until: string;
|
|
5464
5468
|
};
|
|
5465
5469
|
"event-chip": {
|
|
5466
5470
|
cancelled: string;
|