@nxgt/material 3.80.0 → 3.81.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 +46 -0
- package/README.md +3 -2
- package/dist/{alert-dialog-DgHtXZuB.js → alert-dialog-DOZ0SfQs.js} +1 -1
- package/dist/{async-slice-YBQsGtQT.js → async-slice-BfVokA46.js} +1 -1
- package/dist/{button-_vm-xSBU.js → button-CSKUtMI3.js} +2 -2
- package/dist/{calculator-CTd_S23A.js → calculator-Cv00UQgR.js} +10 -10
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-OI1BT3bA.js → calculator-segment-CwnC2cV_.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-DumcVzUO.js → chip-BGn0V6Pt.js} +3 -3
- package/dist/{code-editor-CiwgfSOK.js → code-editor-B25-mWhb.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-Dip0xnmc.js → code-language-items-oRjtO3qV.js} +2 -2
- package/dist/components/base-content.css +11 -0
- package/dist/components/components.css +2 -0
- package/dist/components/ui/collections/data-table/data-table-items-tiles.css +27 -1
- package/dist/components/ui/display/tube-cap/tube-cap.css +87 -0
- package/dist/{components-CJFHhkZv.js → components-B00kDHzJ.js} +19168 -18815
- package/dist/components.js +37 -37
- package/dist/{conversion-variant-CqrPwPjC.js → conversion-variant-wZd-G6xR.js} +3 -3
- package/dist/{currency-field-CMFvctye.js → currency-field-DizBTAat.js} +4 -4
- package/dist/{date.utils-DUvqcjan.js → date.utils-JTEIo3mM.js} +98 -98
- package/dist/{dialog-B0iU3fmh.js → dialog-B-3s-oXt.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-CPOgcajv.js → dropdown-menu-C6rcYGB9.js} +1 -1
- package/dist/editor.js +19 -19
- package/dist/{empty-state-D3Jggupu.js → empty-state-CSkghnD9.js} +1 -1
- package/dist/{financial-variant-BdyfYhnp.js → financial-variant-igpGRbGw.js} +5 -5
- package/dist/{hooks-Z7KKbv4G.js → hooks-DvIsom2p.js} +2 -2
- package/dist/hooks.js +9 -8
- package/dist/{hover-card-CFGIX6kg.js → hover-card-DuaVVKMb.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-kxGWUvcO.js → icon-badge-3ThP6EOl.js} +1 -1
- package/dist/{icon-button-BamxMwZs.js → icon-button-4PKlaI1g.js} +2 -2
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +17 -16
- package/dist/lib/components/ui/collections/day-grouped-list/day-grouped-list.d.ts +6 -1
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -0
- package/dist/lib/components/ui/collections/server-table/types-states.d.ts +5 -1
- package/dist/lib/components/ui/display/index.d.ts +1 -0
- package/dist/lib/components/ui/display/tube-cap/index.d.ts +2 -0
- package/dist/lib/components/ui/display/tube-cap/tube-cap.d.ts +27 -0
- package/dist/lib/components/ui/display/tube-cap/tube-cap.kinds.d.ts +7 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-row.d.ts +3 -1
- package/dist/lib/components/ui/fields/repeatable-group/partials/repeatable-group-rows.d.ts +2 -1
- 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 +7 -0
- package/dist/lib/components/ui/media/galleries/gallery.d.ts +1 -1
- package/dist/lib/components/ui/media/galleries/lightbox-gallery.d.ts +1 -1
- package/dist/lib/components/ui/media/galleries/mini-gallery.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/dialog-parts.d.ts +1 -1
- package/dist/lib/components/ui/overlays/sheet/sheet-parts.d.ts +5 -0
- package/dist/lib/components/ui/selection/choice-card-group/choice-card-balance.d.ts +4 -0
- package/dist/lib/components/ui/selection/choice-card-group/choice-card-group.d.ts +3 -1
- package/dist/lib/components/ui/selection/choice-card-group/choice-card-group.types.d.ts +7 -0
- package/dist/lib/components/ui/selection/sortable-list/partials/sortable-list-body.d.ts +5 -1
- package/dist/lib/components/ui/selection/sortable-list/partials/sortable-list-row-parts.d.ts +2 -1
- package/dist/lib/components/ui/selection/sortable-list/partials/sortable-list-row-props.d.ts +8 -5
- package/dist/lib/components/ui/selection/sortable-list/partials/use-owed-focus.d.ts +10 -0
- package/dist/lib/components/ui/selection/sortable-list/sortable-list-context.d.ts +2 -0
- package/dist/lib/components/ui/selection/sortable-list/sortable-list.keyboard.d.ts +1 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +3 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-shell.d.ts +15 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-template.d.ts +9 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.d.ts +7 -3
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar.template.d.ts +41 -0
- package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +1 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-date-nav.d.ts +2 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/calendar-lane-toggle.d.ts +5 -0
- package/dist/lib/components/ui/widgets/event-calendar/partials/time-grid-header-template.d.ts +7 -0
- package/dist/lib/components/ui/widgets/event-calendar/template.types.d.ts +73 -0
- package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +2 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-chip-event.d.ts +1 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-drawn-events.d.ts +4 -3
- package/dist/lib/components/ui/widgets/event-calendar/use-template-calendar.d.ts +18 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-template-lane.d.ts +17 -0
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/i18n/resources/en/en.d.ts +2 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +2 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +2 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +2 -0
- package/dist/lib/i18n/resources/resources.d.ts +4 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/main.js +53 -52
- package/dist/map.js +7 -7
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-C2LNr8NA.js → percent-field-QwU1l2Q4.js} +1 -1
- package/dist/{picker-surface-BUCFMoAZ.js → picker-surface-CiTycWgV.js} +4 -4
- package/dist/{popover-DFRwQF12.js → popover-YmbzbKQG.js} +1 -1
- package/dist/{pos-types-CXnEdjdy.js → pos-types-BFrapNmx.js} +1 -1
- package/dist/{pos-variant-DMwn_7is.js → pos-variant-CctfqieO.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-Bo4eiDFi.js → programmer-variant-Dd0YOixn.js} +2 -2
- package/dist/{public-CyQPkkSR.js → public-CshR_aW7.js} +10 -10
- package/dist/{rich-code-block-iK7UcZdc.js → rich-code-block-BuJLDoBu.js} +5 -5
- package/dist/{scientific-variant-B9ScTgfx.js → scientific-variant-CjErQxuZ.js} +2 -2
- package/dist/{sortable-provider-BZwVjSVU.js → sortable-provider-DU2nvpFc.js} +2 -2
- package/dist/{spinner-RITOxvpH.js → spinner-DH1mm8hH.js} +1 -1
- package/dist/{tabs-DSo4eCUn.js → tabs-Um0SFyf1.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-3gbzQX0x.js → theme-toggle-C-Ih4uQU.js} +1 -1
- package/dist/{toolbar-items-Bt5RK-Nx.js → toolbar-items-BoEY5bkt.js} +4 -4
- package/dist/{translate-material-CZTGqgen.js → translate-material-D4rn5UaQ.js} +1 -1
- package/dist/{translator-DTlOlIoq.js → translator-CcEgQ-H7.js} +4 -0
- package/dist/{use-chat-composer-DBY01IpX.js → use-chat-composer-BBF1BI_s.js} +46 -42
- package/dist/{use-click-lock-BZYtTmVt.js → use-click-lock-Bwg_caHO.js} +14 -14
- package/dist/{use-heading-spy-Dt48bBts.js → use-heading-spy-BgyA6SJl.js} +19 -19
- package/dist/{use-material-translation-BJucC_xe.js → use-material-translation-DYrfV_JJ.js} +1 -1
- package/dist/{use-return-focus-BS1JLcnq.js → use-return-focus-C_Qz_yTk.js} +1 -1
- package/docs/components/data-display.md +36 -8
- package/docs/components/data-table-filter-and-lists.md +7 -3
- package/docs/components/form-fields.md +1 -0
- package/docs/components/media-and-files.md +1 -0
- package/docs/components/navigation-and-layout.md +2 -1
- package/docs/components/overlays-and-menus.md +11 -5
- package/docs/components/rich-widgets.md +85 -1
- package/docs/components/selection-and-choice.md +49 -10
- package/docs/guides/forms.md +7 -0
- package/docs/guides/helpers.md +23 -0
- package/docs/guides/layouts.md +2 -2
- package/docs/guides/theming.md +7 -7
- package/docs/previews/data-display-tubecap.webp +0 -0
- package/docs/previews/selection-choice-sortablelist.webp +0 -0
- package/docs/roadmap.md +3 -1
- package/docs/troubleshooting.md +50 -2
- package/lib/components/base-content.css +11 -0
- package/lib/components/components.css +2 -0
- package/lib/components/ui/collections/data-table/data-table-items-tiles.css +27 -1
- package/lib/components/ui/display/tube-cap/tube-cap.css +87 -0
- package/lib/themes/ambre.css +1 -1
- package/lib/themes/ardoise.css +1 -1
- package/lib/themes/bleumono.css +1 -1
- package/lib/themes/bluemoon.css +1 -1
- package/lib/themes/corail.css +2 -2
- package/lib/themes/foret.css +1 -1
- package/lib/themes/lavande.css +1 -1
- package/lib/themes/menthe.css +2 -2
- package/lib/themes/ocean.css +1 -1
- package/lib/themes/pink.css +2 -2
- package/lib/themes/prune.css +1 -1
- package/lib/themes/sable.css +1 -1
- package/lib/themes/slate.css +1 -1
- package/lib/themes/teal.css +2 -2
- package/package.json +2 -2
|
@@ -12,6 +12,8 @@ export type RepeatableGroupRowProps = {
|
|
|
12
12
|
reorderable?: boolean;
|
|
13
13
|
/** `min` is not reached yet. */
|
|
14
14
|
removable: boolean;
|
|
15
|
+
/** Not rendered (`removeAtMin: 'hide'` at `min`). */
|
|
16
|
+
hideRemove?: boolean;
|
|
15
17
|
/** `removable` said this row cannot go. */
|
|
16
18
|
locked?: boolean;
|
|
17
19
|
lockedReason?: string;
|
|
@@ -20,4 +22,4 @@ export type RepeatableGroupRowProps = {
|
|
|
20
22
|
onMove: (direction: 'up' | 'down') => void;
|
|
21
23
|
};
|
|
22
24
|
/** One row: its fields, then its move buttons (when reorderable) and Remove. */
|
|
23
|
-
export declare function RepeatableGroupRow({ index, count, children, names, reorderable, removable, locked, lockedReason, disabled, onRemove, onMove, }: RepeatableGroupRowProps): import("react").JSX.Element;
|
|
25
|
+
export declare function RepeatableGroupRow({ index, count, children, names, reorderable, removable, hideRemove, locked, lockedReason, disabled, onRemove, onMove, }: RepeatableGroupRowProps): import("react").JSX.Element;
|
|
@@ -8,6 +8,7 @@ export type RepeatableGroupRowsProps<TItem> = {
|
|
|
8
8
|
names: RepeatableGroupRowProps['names'];
|
|
9
9
|
reorderable: boolean;
|
|
10
10
|
min?: number;
|
|
11
|
+
removeAtMin?: RepeatableGroupProps<TItem>['removeAtMin'];
|
|
11
12
|
removable?: RepeatableGroupProps<TItem>['removable'];
|
|
12
13
|
removeDisabledReason?: RepeatableGroupProps<TItem>['removeDisabledReason'];
|
|
13
14
|
disabled?: boolean;
|
|
@@ -20,4 +21,4 @@ export type RepeatableGroupRowsProps<TItem> = {
|
|
|
20
21
|
* The rows as a list (`ul` / `li`; the group around it carries the name),
|
|
21
22
|
* or, with no row, the empty state when it has a title.
|
|
22
23
|
*/
|
|
23
|
-
export declare function RepeatableGroupRows<TItem>({ items, getKey, renderRow, names, reorderable, min, removable, removeDisabledReason, disabled, onRemove, onMove, emptyTitle, emptyDescription, }: RepeatableGroupRowsProps<TItem>): import("react").JSX.Element | null;
|
|
24
|
+
export declare function RepeatableGroupRows<TItem>({ items, getKey, renderRow, names, reorderable, min, removeAtMin, removable, removeDisabledReason, disabled, onRemove, onMove, emptyTitle, emptyDescription, }: RepeatableGroupRowsProps<TItem>): import("react").JSX.Element | null;
|
|
@@ -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, 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, rowLabel, addLabel, onAdd, onRemove, onMove, reorderable, min, removeAtMin, max, removable, removeDisabledReason, disabled, error, emptyTitle, emptyDescription, className, ref, ...props }: RepeatableGroupProps<TItem>): import("react").JSX.Element;
|
|
@@ -34,6 +34,13 @@ export type RepeatableGroupProps<TItem> = Omit<ComponentProps<'div'>, 'children'
|
|
|
34
34
|
reorderable?: boolean;
|
|
35
35
|
/** No Remove at this many rows. */
|
|
36
36
|
min?: number;
|
|
37
|
+
/**
|
|
38
|
+
* What a row's Remove button does at `min` rows: `'disable'` (default)
|
|
39
|
+
* keeps it, disabled; `'hide'` does not render it, so a form whose only
|
|
40
|
+
* row cannot go shows no dead control. A row `removable` refuses keeps its
|
|
41
|
+
* Remove button (with its reason) either way.
|
|
42
|
+
*/
|
|
43
|
+
removeAtMin?: 'disable' | 'hide';
|
|
37
44
|
/**
|
|
38
45
|
* Whether a row can be removed. A row that cannot keeps its Remove button
|
|
39
46
|
* `aria-disabled` (still focusable; activating it does nothing). Default: every row can (`min` still
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GalleryProps } from './types.js';
|
|
2
2
|
export type { GalleryItem, GalleryProps } from './types.js';
|
|
3
|
-
export declare function Gallery(
|
|
3
|
+
export declare function Gallery(props: GalleryProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GalleryItem, GalleryProps } from './types.js';
|
|
2
2
|
export type LightboxGalleryItem = GalleryItem;
|
|
3
|
-
export type LightboxGalleryProps = Pick<GalleryProps, 'items' | 'className' | 'onDelete' | 'open' | 'onOpenChange' | 'trigger' | 'defaultIndex'> & {
|
|
3
|
+
export type LightboxGalleryProps = Pick<GalleryProps, 'items' | 'className' | 'aria-label' | 'aria-labelledby' | 'onDelete' | 'open' | 'onOpenChange' | 'trigger' | 'defaultIndex'> & {
|
|
4
4
|
startIndex?: number;
|
|
5
5
|
};
|
|
6
6
|
export declare function LightboxGallery({ startIndex, defaultIndex, ...props }: LightboxGalleryProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GalleryItem, GalleryProps } from './types.js';
|
|
2
2
|
export type MiniGalleryItem = GalleryItem;
|
|
3
|
-
export type MiniGalleryProps = Pick<GalleryProps, 'items' | 'className' | 'onDelete' | 'maxItems'>;
|
|
3
|
+
export type MiniGalleryProps = Pick<GalleryProps, 'items' | 'className' | 'aria-label' | 'aria-labelledby' | 'onDelete' | 'maxItems'>;
|
|
4
4
|
export declare function MiniGallery(props: MiniGalleryProps): import("react").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { ComponentProps } from 'react';
|
|
|
3
3
|
declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
4
4
|
declare function DialogFooter({ className, stackOnPhone, ...props }: ComponentProps<'div'> & {
|
|
5
5
|
/**
|
|
6
|
-
* Phones: the actions stack, full width, the main one
|
|
6
|
+
* Phones: the actions stack, full width, the last-written (main) one on top (the
|
|
7
7
|
* default). `false` keeps one row, the first action on the left and the
|
|
8
8
|
* last on the right, for two short actions such as Cancel and Confirm.
|
|
9
9
|
*/
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Dialog as SheetPrimitive } from 'radix-ui';
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
declare function SheetHeader({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
4
|
+
/**
|
|
5
|
+
* Full-width actions in a column, in the same phone order as `DialogFooter`:
|
|
6
|
+
* write them in reading order (secondary first, main last) and the main one
|
|
7
|
+
* is on top, the secondary below it.
|
|
8
|
+
*/
|
|
4
9
|
declare function SheetFooter({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
5
10
|
declare function SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>): import("react").JSX.Element;
|
|
6
11
|
declare function SheetDescription({ className, ...props }: ComponentProps<typeof SheetPrimitive.Description>): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The columns drawn when `fit` columns fit, for `count` cards. */
|
|
2
|
+
export declare function balancedColumns(count: number, fit: number): number;
|
|
3
|
+
/** One column below two cards' width, then the balanced count at each width that fits more. */
|
|
4
|
+
export declare function balancedGridClasses(count: number, columns: 1 | 2 | 3 | 4): string[];
|
|
@@ -7,6 +7,8 @@ export type { ChoiceCardGroupProps, ChoiceCardOption };
|
|
|
7
7
|
* Space toggles). Enter does nothing, so it never submits a form. A disabled
|
|
8
8
|
* option, or any unchosen one once `max` is reached, stays focusable and
|
|
9
9
|
* says why. The cards sit in up to `columns` columns, each at least 13.5rem wide
|
|
10
|
-
* (one on a phone)
|
|
10
|
+
* (one on a phone), and balanced: the last row is never one orphan card when a
|
|
11
|
+
* nearby count avoids it (4 cards in room for 3 sit 2+2); `balance={false}`
|
|
12
|
+
* fills every column that fits. `orientation="vertical"` makes it one. The `ref` reaches the card that holds the tab stop.
|
|
11
13
|
*/
|
|
12
14
|
export declare function ChoiceCardGroup(props: ChoiceCardGroupProps): import("react").JSX.Element;
|
|
@@ -15,5 +15,12 @@ export type ChoiceCardGroupProps = ChoiceGroupBase & ChoiceSelection & {
|
|
|
15
15
|
* Default 2. `orientation="vertical"` makes it one.
|
|
16
16
|
*/
|
|
17
17
|
columns?: 1 | 2 | 3 | 4;
|
|
18
|
+
/**
|
|
19
|
+
* Balance the rows: when the cards would leave one alone on the last row
|
|
20
|
+
* (4 cards in room for 3), draw fewer columns instead (2+2). Default
|
|
21
|
+
* `true`; `false` fills every column that fits, as before. CSS only,
|
|
22
|
+
* from the group's own width.
|
|
23
|
+
*/
|
|
24
|
+
balance?: boolean;
|
|
18
25
|
density?: 'comfortable' | 'compact';
|
|
19
26
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* The list: its keys, its rows (or the empty state). A row holds buttons of
|
|
3
|
+
* its own, so it is a list item, not an option; the focus moves from row to
|
|
4
|
+
* row (a roving tab stop) and the keys act only when a row itself has it.
|
|
5
|
+
*/
|
|
2
6
|
export declare function SortableListBody({ emptyTitle }: {
|
|
3
7
|
emptyTitle: string;
|
|
4
8
|
}): import("react").JSX.Element;
|
package/dist/lib/components/ui/selection/sortable-list/partials/sortable-list-row-parts.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SortableListLabels } from '../sortable-list-context.js';
|
|
2
2
|
import { SortableListDragActivator, SortableListItem } from '../types.js';
|
|
3
3
|
/** The row's start mark: a lock, the drag handle, or an empty slot. */
|
|
4
|
-
export declare function SortableListGrip({ locked, canDrag, activator, labels, }: {
|
|
4
|
+
export declare function SortableListGrip({ locked, canDrag, activator, labels, itemLabel, }: {
|
|
5
|
+
itemLabel?: string;
|
|
5
6
|
locked?: boolean;
|
|
6
7
|
canDrag: boolean;
|
|
7
8
|
activator: SortableListDragActivator;
|
package/dist/lib/components/ui/selection/sortable-list/partials/sortable-list-row-props.d.ts
CHANGED
|
@@ -10,19 +10,22 @@ type RowProps = {
|
|
|
10
10
|
focused: boolean;
|
|
11
11
|
grabbed: boolean;
|
|
12
12
|
setFocused: (value: string | null) => void;
|
|
13
|
+
/** The row that holds the list's one tab stop. */
|
|
14
|
+
tabbable: boolean;
|
|
13
15
|
};
|
|
14
|
-
/** The
|
|
15
|
-
export declare function sortableRowProps({ domProps, id, style, dragging, item, disabled, focused, grabbed, setFocused, }: RowProps): {
|
|
16
|
+
/** The list item semantics of a row, over the props the sortable hands it. */
|
|
17
|
+
export declare function sortableRowProps({ domProps, id, style, dragging, item, disabled, focused, grabbed, setFocused, tabbable, }: RowProps): {
|
|
16
18
|
readonly 'aria-roledescription': undefined;
|
|
17
19
|
readonly 'aria-describedby': undefined;
|
|
18
20
|
readonly 'aria-pressed': undefined;
|
|
19
21
|
readonly id: string;
|
|
20
22
|
readonly style: CSSProperties | undefined;
|
|
21
|
-
readonly role: "
|
|
22
|
-
readonly 'aria-selected':
|
|
23
|
+
readonly role: "listitem";
|
|
24
|
+
readonly 'aria-selected': undefined;
|
|
23
25
|
readonly 'aria-disabled': true | undefined;
|
|
24
26
|
readonly 'data-grabbed': true | undefined;
|
|
25
|
-
readonly
|
|
27
|
+
readonly 'data-disabled': true | undefined;
|
|
28
|
+
readonly tabIndex: 0 | -1;
|
|
26
29
|
readonly onFocus: () => void;
|
|
27
30
|
readonly ref: (node: HTMLDivElement | null) => void;
|
|
28
31
|
readonly title?: string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A key moved the cursor, the order or the rows: the focus is still owed to
|
|
3
|
+
* the list's tab stop once React has committed (a reorder re-inserts the row
|
|
4
|
+
* and the browser drops its focus to the body). `arm` records the debt for
|
|
5
|
+
* that key's commit only.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useOwedFocus(focusedValue: string | null | undefined, ids: string[]): {
|
|
8
|
+
listRef: import('react').RefObject<HTMLDivElement | null>;
|
|
9
|
+
arm: (commandType: string) => void;
|
|
10
|
+
};
|
|
@@ -28,3 +28,5 @@ export type SortableListContextValue = {
|
|
|
28
28
|
export declare const SortableListProvider: import('react').Provider<SortableListContextValue | null>;
|
|
29
29
|
export declare function useSortableListContext(): SortableListContextValue;
|
|
30
30
|
export declare function sortableOptionId(uid: string, index: number): string;
|
|
31
|
+
/** The id of the hidden "This field is required." hint that describes the list. */
|
|
32
|
+
export declare function sortableRequiredId(uid: string): string;
|
|
@@ -20,7 +20,7 @@ type KeyEventLike = {
|
|
|
20
20
|
preventDefault: () => void;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* The
|
|
23
|
+
* The list's keys. Arrows move the cursor, Home / End jump; Ctrl/⌘ +
|
|
24
24
|
* arrow moves the row at once. Space or Enter picks a row up: then arrows
|
|
25
25
|
* move it, Space or Enter drops it, Escape puts it back. Delete removes it
|
|
26
26
|
* when the list is `removable`.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { EventChipVariant } from '../../display/event-chip/event-chip.classes.js';
|
|
3
|
+
import { TemplateContext } from './template.types.js';
|
|
3
4
|
import { CalendarEvent, EventCalendarRenderEvent, EventCalendarSlot, EventCalendarView } from './types.js';
|
|
4
5
|
import { EventCalendarModel } from './use-event-calendar.js';
|
|
5
6
|
export type EventCalendarContextValue = EventCalendarModel & {
|
|
6
7
|
/** The events as stored, true instants; `events` is what is drawn (the zone's wall clock). */
|
|
7
8
|
sourceEvents?: CalendarEvent[];
|
|
9
|
+
/** Set in `mode="template"`: the lanes, and the lane of each event. */
|
|
10
|
+
template?: TemplateContext;
|
|
8
11
|
dragLabel: string;
|
|
9
12
|
searchable: boolean;
|
|
10
13
|
/** The views the switcher offers. */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TemplateContext } from './template.types.js';
|
|
2
|
+
import { CalendarEvent, EventCalendarProps } from './types.js';
|
|
3
|
+
/** What only the template mode passes down to the shared calendar. */
|
|
4
|
+
export type EventCalendarShellProps = EventCalendarProps & {
|
|
5
|
+
template?: TemplateContext;
|
|
6
|
+
/** Hides the events it rejects (the template's lane), on top of the search. */
|
|
7
|
+
visible?: (event: CalendarEvent) => boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* A month / week / workweek / day / agenda calendar: drag to move, the bottom
|
|
11
|
+
* edge to resize, click or drag across empty slots to create, a now line, a
|
|
12
|
+
* mini-month side panel and a phone layout of its own. Events are props; the
|
|
13
|
+
* chrome (search, focus, the last move's direction) lives in a slice.
|
|
14
|
+
*/
|
|
15
|
+
export declare function EventCalendarShell({ template, visible, onEventClick, onSlotClick, className, renderEvent, toolbar, searchable, views, phoneView, sidebar, eventVariant, scrollToHour, ...options }: EventCalendarShellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EventCalendarTemplateProps } from './template.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* `<EventCalendar mode="template">`: the recurring week. It runs the dated
|
|
4
|
+
* calendar on a fixed reference week and keeps the dates out of sight (see
|
|
5
|
+
* `event-calendar.template.ts`): the column headers are weekday names, the
|
|
6
|
+
* toolbar has no date navigation, nothing is today, and what comes out of
|
|
7
|
+
* `onSlotClick`, `onChange` and `onEventsChange` is weekday and time.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TemplateEventCalendar(props: EventCalendarTemplateProps): import("react").JSX.Element;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { EventCalendarTemplateProps } from './template.types.js';
|
|
1
2
|
import { EventCalendarProps } from './types.js';
|
|
2
3
|
export type { EventCalendarProps } from './types.js';
|
|
3
4
|
/**
|
|
4
5
|
* A month / week / workweek / day / agenda calendar: drag to move, the bottom
|
|
5
6
|
* edge to resize, click or drag across empty slots to create, a now line, a
|
|
6
|
-
* mini-month side panel and a phone layout of its own.
|
|
7
|
-
*
|
|
7
|
+
* mini-month side panel and a phone layout of its own.
|
|
8
|
+
*
|
|
9
|
+
* With `mode="template"` it is a recurring week instead: columns named by
|
|
10
|
+
* weekday, no dates, events keyed by weekday and time, and optional `lanes`
|
|
11
|
+
* (A / B) for two alternating weeks. See `EventCalendarTemplateProps`.
|
|
8
12
|
*/
|
|
9
|
-
export declare function EventCalendar(
|
|
13
|
+
export declare function EventCalendar(props: EventCalendarProps | EventCalendarTemplateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Locale } from 'date-fns';
|
|
2
|
+
import { EventCalendarTemplateEvent, EventCalendarTemplateSlot, TemplateContext } from './template.types.js';
|
|
3
|
+
import { CalendarEvent, EventCalendarSlot } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* The template week is drawn on a fixed reference week, Monday 2001-01-01 to
|
|
6
|
+
* Sunday 2001-01-07: the dated grid, drag and resize work on it unchanged, and
|
|
7
|
+
* only the weekday and the time ever leave the calendar.
|
|
8
|
+
*/
|
|
9
|
+
export declare const REFERENCE_MONDAY = "2001-01-01";
|
|
10
|
+
/** A moment outside the reference week: no column is "today", no now line. */
|
|
11
|
+
export declare const TEMPLATE_NOW: Date;
|
|
12
|
+
/** The reference week's days, Monday first (`count` 5: Monday to Friday). */
|
|
13
|
+
export declare function referenceDays(count?: number): Date[];
|
|
14
|
+
export declare function parseClock(time: string): number;
|
|
15
|
+
export declare function formatClock(minutes: number): string;
|
|
16
|
+
/** The template event as a dated one on the reference week. */
|
|
17
|
+
export declare function toDatedEvent(event: EventCalendarTemplateEvent): CalendarEvent;
|
|
18
|
+
/**
|
|
19
|
+
* The dated event back as the template event it came from (`base` keeps what
|
|
20
|
+
* the calendar does not edit, such as the lane).
|
|
21
|
+
*/
|
|
22
|
+
export declare function fromDatedEvent(event: CalendarEvent, base?: EventCalendarTemplateEvent): EventCalendarTemplateEvent;
|
|
23
|
+
/** A slot of the dated grid as weekday and time. */
|
|
24
|
+
export declare function toTemplateSlot(slot: EventCalendarSlot, lane: string | null): EventCalendarTemplateSlot;
|
|
25
|
+
/** Whether a lane filter keeps the event: no lane means every week. */
|
|
26
|
+
export declare function inLane(laneOfEvent: string | undefined, lane: string | null): boolean;
|
|
27
|
+
/** `Monday · 8:00 AM – 9:00 AM`: the popover's range, with no date. */
|
|
28
|
+
export declare function templateRangeLabel(event: CalendarEvent, locale?: Locale): string;
|
|
29
|
+
/**
|
|
30
|
+
* The title a chip draws: with both weeks showing, an event of a lane says
|
|
31
|
+
* which (`A · Physics`); otherwise the title as it is.
|
|
32
|
+
*/
|
|
33
|
+
export declare function laneTitle(event: CalendarEvent, template: TemplateContext | undefined): string;
|
|
34
|
+
/** A weekday moved by `days`, wrapped within the visible `count` days (5: Monday to Friday, 7: the week). */
|
|
35
|
+
export declare function wrapWeekday(weekday: number, days: number, count: number): number;
|
|
36
|
+
/**
|
|
37
|
+
* The dated event moved by `days` and `minutes` inside the template week: the
|
|
38
|
+
* weekday wraps within the visible days, and the move stops at the day's
|
|
39
|
+
* edges (00:00 and 24:00) keeping the duration.
|
|
40
|
+
*/
|
|
41
|
+
export declare function moveTemplateEvent(event: CalendarEvent, days: number, minutes: number, count: number): CalendarEvent;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { EventCalendarProps } from './event-calendar.js';
|
|
2
2
|
export { EventCalendar } from './event-calendar.js';
|
|
3
3
|
export { EventCalendarProvider, useEventCalendarContext, } from './event-calendar-context.js';
|
|
4
|
+
export type { EventCalendarLane, EventCalendarTemplateChange, EventCalendarTemplateEvent, EventCalendarTemplateProps, EventCalendarTemplateSlot, EventCalendarWeekday, } from './template.types.js';
|
|
4
5
|
export type { CalendarEvent, EventCalendarChange, EventCalendarDensity, EventCalendarRenderEvent, EventCalendarResource, EventCalendarSlot, EventCalendarView, } from './types.js';
|
|
5
6
|
export { useEventCalendar } from './use-event-calendar.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One day of a template week's header: the weekday's name and nothing else
|
|
3
|
+
* (a letter on a phone, the short name from 768px, the full name from 1024px).
|
|
4
|
+
*/
|
|
5
|
+
export declare function TemplateHeaderDay({ day }: {
|
|
6
|
+
day: Date;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { EventCalendarProps } from './types.js';
|
|
3
|
+
/** ISO weekday: 1 is Monday, 7 is Sunday. */
|
|
4
|
+
export type EventCalendarWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
5
|
+
/**
|
|
6
|
+
* An event of a template week: keyed by weekday and wall-clock time instead of
|
|
7
|
+
* a date. `start` and `end` are `HH:mm` (`end` may be `24:00`, the day's end).
|
|
8
|
+
*/
|
|
9
|
+
export type EventCalendarTemplateEvent = {
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
weekday: EventCalendarWeekday;
|
|
13
|
+
start: string;
|
|
14
|
+
end: string;
|
|
15
|
+
/** The alternating week it belongs to (an `EventCalendarLane` id); none: every week. */
|
|
16
|
+
lane?: string;
|
|
17
|
+
color?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** An alternating week of the template (`A`, `B`). */
|
|
22
|
+
export type EventCalendarLane = {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
};
|
|
26
|
+
export type EventCalendarTemplateSlot = {
|
|
27
|
+
weekday: EventCalendarWeekday;
|
|
28
|
+
start: string;
|
|
29
|
+
end: string;
|
|
30
|
+
/** The lane picked in the toolbar, when one is (none while both show). */
|
|
31
|
+
lane?: string;
|
|
32
|
+
};
|
|
33
|
+
export type EventCalendarTemplateChange = {
|
|
34
|
+
events: EventCalendarTemplateEvent[];
|
|
35
|
+
event: EventCalendarTemplateEvent;
|
|
36
|
+
previous: EventCalendarTemplateEvent;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* `mode="template"`: a recurring week. Day columns are named by weekday only,
|
|
40
|
+
* there is no date navigation, today marker or now line, and events,
|
|
41
|
+
* slots and changes are keyed by weekday and time. The month, day and agenda
|
|
42
|
+
* views do not apply: `view` is `week` (the default) or `workweek`.
|
|
43
|
+
*/
|
|
44
|
+
export type EventCalendarTemplateProps = Pick<EventCalendarProps, 'disabled' | 'className' | 'toolbar' | 'searchable' | 'density' | 'eventVariant' | 'startHour' | 'endHour' | 'hourHeight' | 'slotDurationMinutes' | 'scrollToHour'> & {
|
|
45
|
+
mode: 'template';
|
|
46
|
+
events?: EventCalendarTemplateEvent[];
|
|
47
|
+
defaultEvents?: EventCalendarTemplateEvent[];
|
|
48
|
+
onEventsChange?: (events: EventCalendarTemplateEvent[]) => void;
|
|
49
|
+
/** After a move, a resize or an edit, with the previous event. */
|
|
50
|
+
onChange?: (change: EventCalendarTemplateChange) => void;
|
|
51
|
+
onEventClick?: (event: EventCalendarTemplateEvent) => void;
|
|
52
|
+
/** A click or a drag across an empty slot: where, as weekday and time. */
|
|
53
|
+
onSlotClick?: (slot: EventCalendarTemplateSlot) => void;
|
|
54
|
+
/** `week` (7 days, the default) or `workweek` (Monday to Friday). */
|
|
55
|
+
view?: 'week' | 'workweek';
|
|
56
|
+
defaultView?: 'week' | 'workweek';
|
|
57
|
+
onViewChange?: (view: 'week' | 'workweek') => void;
|
|
58
|
+
/** The alternating weeks (`[{ id: 'A', label: 'Week A' }, …]`); a toolbar switch picks which shows. */
|
|
59
|
+
lanes?: EventCalendarLane[];
|
|
60
|
+
/** The lane shown: an id, or `null` for all. Default (uncontrolled): all. */
|
|
61
|
+
lane?: string | null;
|
|
62
|
+
defaultLane?: string | null;
|
|
63
|
+
onLaneChange?: (lane: string | null) => void;
|
|
64
|
+
/** Replaces how an event is drawn. */
|
|
65
|
+
renderEvent?: (event: EventCalendarTemplateEvent) => ReactNode;
|
|
66
|
+
};
|
|
67
|
+
/** What the template mode hands the shared internals through the context. */
|
|
68
|
+
export type TemplateContext = {
|
|
69
|
+
lanes: EventCalendarLane[];
|
|
70
|
+
lane: string | null;
|
|
71
|
+
setLane: (lane: string | null) => void;
|
|
72
|
+
laneOf: (eventId: string) => string | undefined;
|
|
73
|
+
};
|
|
@@ -58,6 +58,8 @@ export type EventCalendarChromeState = {
|
|
|
58
58
|
};
|
|
59
59
|
export type EventCalendarRenderEvent = (event: CalendarEvent) => ReactNode;
|
|
60
60
|
export type EventCalendarProps = {
|
|
61
|
+
/** `dated` (the default): real dates. See `mode="template"` for a recurring week. */
|
|
62
|
+
mode?: 'dated';
|
|
61
63
|
events?: CalendarEvent[];
|
|
62
64
|
defaultEvents?: CalendarEvent[];
|
|
63
65
|
onEventsChange?: (events: CalendarEvent[]) => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { CalendarEvent } from './types.js';
|
|
1
2
|
import { EventCalendarModel } from './use-event-calendar.js';
|
|
2
3
|
/**
|
|
3
4
|
* The events the search keeps, as stored (true instants), and as drawn: in a
|
|
4
5
|
* zone, the zone's wall clock; otherwise the same list.
|
|
5
6
|
*/
|
|
6
|
-
export declare function useDrawnEvents({ events, chrome, zone, project
|
|
7
|
-
sourceEvents:
|
|
8
|
-
visibleEvents:
|
|
7
|
+
export declare function useDrawnEvents({ events, chrome, zone, project }: EventCalendarModel, visible?: (event: CalendarEvent) => boolean): {
|
|
8
|
+
sourceEvents: CalendarEvent[];
|
|
9
|
+
visibleEvents: CalendarEvent[];
|
|
9
10
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventCalendarTemplateEvent, EventCalendarTemplateProps, TemplateContext } from './template.types.js';
|
|
2
|
+
import { CalendarEvent, EventCalendarChange, EventCalendarSlot } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The template week as the dated calendar reads it: the events (controlled or
|
|
5
|
+
* not) on the reference week, the lane filter, and the callbacks turned back
|
|
6
|
+
* into weekday and time. The dated calendar owns no copy: the list given
|
|
7
|
+
* is always the template list, mapped.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useTemplateCalendar({ events, defaultEvents, onEventsChange, onChange, onEventClick, onSlotClick, lanes, lane: laneProp, defaultLane, onLaneChange, }: EventCalendarTemplateProps): {
|
|
10
|
+
dated: CalendarEvent[];
|
|
11
|
+
back: (event: CalendarEvent) => EventCalendarTemplateEvent;
|
|
12
|
+
template: TemplateContext;
|
|
13
|
+
visible: (event: CalendarEvent) => boolean;
|
|
14
|
+
onEventsChange: (next: CalendarEvent[]) => void;
|
|
15
|
+
onChange: ((change: EventCalendarChange) => void) | undefined;
|
|
16
|
+
onEventClick: ((event: CalendarEvent) => void) | undefined;
|
|
17
|
+
onSlotClick: ((slot: EventCalendarSlot) => void) | undefined;
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventCalendarTemplateEvent } from './template.types.js';
|
|
2
|
+
import { CalendarEvent } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The template week's lane filter: the lane shown (controlled or not), its
|
|
5
|
+
* setter, and whether a dated event belongs to it (an event with no lane
|
|
6
|
+
* shows in every one).
|
|
7
|
+
*/
|
|
8
|
+
export declare function useTemplateLane({ lane: laneProp, defaultLane, onLaneChange, byId, }: {
|
|
9
|
+
lane?: string | null;
|
|
10
|
+
defaultLane?: string | null;
|
|
11
|
+
onLaneChange?: (lane: string | null) => void;
|
|
12
|
+
byId: Map<string, EventCalendarTemplateEvent>;
|
|
13
|
+
}): {
|
|
14
|
+
lane: string | null;
|
|
15
|
+
setLane: (next: string | null) => void;
|
|
16
|
+
visible: (event: CalendarEvent) => boolean;
|
|
17
|
+
};
|
|
@@ -16,6 +16,7 @@ export * from './use-options.js';
|
|
|
16
16
|
export * from './use-react-router-block.js';
|
|
17
17
|
export * from './use-scroll-away.js';
|
|
18
18
|
export * from './use-search-param.js';
|
|
19
|
+
export * from './use-ssr-media-query.js';
|
|
19
20
|
export * from './use-submit-once.js';
|
|
20
21
|
export * from './use-theme.js';
|
|
21
22
|
export * from './use-unsaved-guard/index.js';
|
|
@@ -1807,6 +1807,8 @@ declare const _default: {
|
|
|
1807
1807
|
"sidebar": "Navigation du calendrier",
|
|
1808
1808
|
"unassigned": "Non assigné",
|
|
1809
1809
|
"resource": "Ressource",
|
|
1810
|
+
"lane": "Semaine",
|
|
1811
|
+
"lane-all": "Toutes les semaines",
|
|
1810
1812
|
"time-zone": "Fuseau horaire : {zone}"
|
|
1811
1813
|
},
|
|
1812
1814
|
"dnd": {
|
|
@@ -1815,6 +1815,8 @@ export declare const resources: {
|
|
|
1815
1815
|
sidebar: string;
|
|
1816
1816
|
unassigned: string;
|
|
1817
1817
|
resource: string;
|
|
1818
|
+
lane: string;
|
|
1819
|
+
"lane-all": string;
|
|
1818
1820
|
"time-zone": string;
|
|
1819
1821
|
};
|
|
1820
1822
|
dnd: {
|
|
@@ -5329,6 +5331,8 @@ export declare const resources: {
|
|
|
5329
5331
|
sidebar: string;
|
|
5330
5332
|
unassigned: string;
|
|
5331
5333
|
resource: string;
|
|
5334
|
+
lane: string;
|
|
5335
|
+
"lane-all": string;
|
|
5332
5336
|
"time-zone": string;
|
|
5333
5337
|
};
|
|
5334
5338
|
dnd: {
|