@eschoolbase/client-ui 0.1.0 → 0.2.1

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 (105) hide show
  1. package/README.md +124 -11
  2. package/dist/components/Badge/Badge.d.ts +3 -0
  3. package/dist/components/Badge/Badge.types.d.ts +8 -0
  4. package/dist/components/Badge/index.d.ts +2 -0
  5. package/dist/components/Checkbox/Checkbox.d.ts +3 -0
  6. package/dist/components/Checkbox/Checkbox.types.d.ts +10 -0
  7. package/dist/components/Checkbox/index.d.ts +2 -0
  8. package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +3 -0
  9. package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +21 -0
  10. package/dist/components/ConfirmDialog/index.d.ts +2 -0
  11. package/dist/components/DataTable/DataTable.d.ts +10 -0
  12. package/dist/components/DataTable/DataTable.types.d.ts +154 -0
  13. package/dist/components/DataTable/SelectionBar.d.ts +18 -0
  14. package/dist/components/DataTable/dataTableUtils.d.ts +13 -0
  15. package/dist/components/DataTable/dataTableUtils.test.d.ts +1 -0
  16. package/dist/components/DataTable/index.d.ts +6 -0
  17. package/dist/components/DataTable/remote.d.ts +36 -0
  18. package/dist/components/DataTable/remote.test.d.ts +1 -0
  19. package/dist/components/DataTable/useDebouncedValue.d.ts +2 -0
  20. package/dist/components/DatePicker/Calendar.d.ts +15 -0
  21. package/dist/components/DatePicker/DatePicker.d.ts +3 -0
  22. package/dist/components/DatePicker/DatePicker.types.d.ts +45 -0
  23. package/dist/components/DatePicker/MonthCalendar.d.ts +12 -0
  24. package/dist/components/DatePicker/PickerField.d.ts +40 -0
  25. package/dist/components/DatePicker/TimeColumns.d.ts +12 -0
  26. package/dist/components/DatePicker/createDisabledPredicate.test.d.ts +1 -0
  27. package/dist/components/DatePicker/dateUtils.d.ts +70 -0
  28. package/dist/components/DatePicker/dateUtils.test.d.ts +1 -0
  29. package/dist/components/DatePicker/index.d.ts +2 -0
  30. package/dist/components/DatePicker/monthDateTimeUtils.test.d.ts +1 -0
  31. package/dist/components/DateTimePicker/DateTimePicker.d.ts +3 -0
  32. package/dist/components/DateTimePicker/DateTimePicker.types.d.ts +50 -0
  33. package/dist/components/DateTimePicker/index.d.ts +2 -0
  34. package/dist/components/Drawer/Drawer.d.ts +3 -0
  35. package/dist/components/Drawer/Drawer.types.d.ts +10 -0
  36. package/dist/components/Drawer/index.d.ts +2 -0
  37. package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -0
  38. package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +21 -0
  39. package/dist/components/DropdownMenu/index.d.ts +2 -0
  40. package/dist/components/FileInput/FileInput.d.ts +6 -0
  41. package/dist/components/FileInput/FileInput.types.d.ts +55 -0
  42. package/dist/components/FileInput/ImageCropper.d.ts +21 -0
  43. package/dist/components/FileInput/fileUtils.d.ts +8 -0
  44. package/dist/components/FileInput/index.d.ts +3 -0
  45. package/dist/components/Input/Input.types.d.ts +16 -0
  46. package/dist/components/Input/PickerTypeInput.d.ts +14 -0
  47. package/dist/components/Input/index.d.ts +1 -1
  48. package/dist/components/Modal/Modal.d.ts +6 -0
  49. package/dist/components/Modal/Modal.types.d.ts +39 -0
  50. package/dist/components/Modal/index.d.ts +2 -0
  51. package/dist/components/MonthPicker/MonthPicker.d.ts +3 -0
  52. package/dist/components/MonthPicker/MonthPicker.types.d.ts +37 -0
  53. package/dist/components/MonthPicker/index.d.ts +2 -0
  54. package/dist/components/Overlay/Overlay.d.ts +25 -0
  55. package/dist/components/Overlay/OverlayContent.d.ts +14 -0
  56. package/dist/components/PageHeader/PageHeader.d.ts +12 -0
  57. package/dist/components/PageHeader/index.d.ts +2 -0
  58. package/dist/components/Pagination/Pagination.d.ts +6 -0
  59. package/dist/components/Pagination/Pagination.types.d.ts +29 -0
  60. package/dist/components/Pagination/index.d.ts +4 -0
  61. package/dist/components/Pagination/paginationUtils.d.ts +7 -0
  62. package/dist/components/Pagination/paginationUtils.test.d.ts +1 -0
  63. package/dist/components/PasswordInput/PasswordInput.d.ts +3 -0
  64. package/dist/components/PasswordInput/PasswordInput.types.d.ts +7 -0
  65. package/dist/components/PasswordInput/index.d.ts +2 -0
  66. package/dist/components/SearchInput/SearchInput.d.ts +3 -0
  67. package/dist/components/SearchInput/SearchInput.types.d.ts +7 -0
  68. package/dist/components/SearchInput/index.d.ts +2 -0
  69. package/dist/components/Skeleton/Skeleton.d.ts +3 -0
  70. package/dist/components/Skeleton/Skeleton.types.d.ts +10 -0
  71. package/dist/components/Skeleton/index.d.ts +2 -0
  72. package/dist/components/StatusPill/StatusPill.d.ts +10 -0
  73. package/dist/components/StatusPill/index.d.ts +2 -0
  74. package/dist/components/Switch/Switch.d.ts +3 -0
  75. package/dist/components/Switch/Switch.types.d.ts +8 -0
  76. package/dist/components/Switch/index.d.ts +2 -0
  77. package/dist/components/Table/Table.d.ts +16 -0
  78. package/dist/components/Table/Table.types.d.ts +31 -0
  79. package/dist/components/Table/index.d.ts +2 -0
  80. package/dist/components/TableFilters/DynamicFilterRows.d.ts +24 -0
  81. package/dist/components/TableFilters/FilterValueControl.d.ts +14 -0
  82. package/dist/components/TableFilters/TableFilters.d.ts +6 -0
  83. package/dist/components/TableFilters/TableFilters.types.d.ts +32 -0
  84. package/dist/components/TableFilters/filterUtils.d.ts +5 -0
  85. package/dist/components/TableFilters/index.d.ts +2 -0
  86. package/dist/components/Tabs/Tabs.d.ts +6 -0
  87. package/dist/components/Tabs/Tabs.types.d.ts +20 -0
  88. package/dist/components/Tabs/index.d.ts +2 -0
  89. package/dist/components/Textarea/Textarea.d.ts +3 -0
  90. package/dist/components/Textarea/Textarea.types.d.ts +12 -0
  91. package/dist/components/Textarea/index.d.ts +2 -0
  92. package/dist/components/ThemeToggle/ThemeToggle.d.ts +6 -0
  93. package/dist/components/ThemeToggle/ThemeToggle.types.d.ts +13 -0
  94. package/dist/components/ThemeToggle/index.d.ts +2 -0
  95. package/dist/index.cjs +1 -1
  96. package/dist/index.cjs.map +1 -1
  97. package/dist/index.d.ts +47 -1
  98. package/dist/index.js +4051 -495
  99. package/dist/index.js.map +1 -1
  100. package/dist/styles.css +1 -1
  101. package/dist/theme/ThemeProvider.d.ts +3 -1
  102. package/dist/theme/ThemeProvider.types.d.ts +13 -2
  103. package/dist/theme/index.d.ts +1 -1
  104. package/dist/theme/themeStore.d.ts +5 -0
  105. package/package.json +1 -1
@@ -0,0 +1,40 @@
1
+ import { type ButtonHTMLAttributes, type ReactNode } from 'react';
2
+ import type { ComponentSize } from '../../types';
3
+ export interface PickerPanelContext {
4
+ /** Close the popover. Focus returns to the field unless `restoreFocus` is false. */
5
+ close: (restoreFocus?: boolean) => void;
6
+ }
7
+ export interface PickerFieldProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'placeholder' | 'value' | 'defaultValue' | 'onChange'> {
8
+ required?: boolean;
9
+ error?: ReactNode;
10
+ size?: ComponentSize;
11
+ /** Text for the chosen value, or null to show the placeholder. */
12
+ displayText: string | null;
13
+ placeholder: string;
14
+ /** Submitted with a surrounding form under `name`. */
15
+ name?: string;
16
+ hiddenValue: string;
17
+ /** Show the clear button (only while a value is chosen). */
18
+ clearable: boolean;
19
+ onClear: () => void;
20
+ clearLabel: string;
21
+ /** Accessible name of the popover. */
22
+ panelLabel: string;
23
+ /** Approximate width of the popover in px, used to keep it on screen. */
24
+ panelWidth?: number;
25
+ icon?: 'calendar' | 'clock';
26
+ /** The popover content. */
27
+ children: (context: PickerPanelContext) => ReactNode;
28
+ }
29
+ export interface PickerShellProps {
30
+ label?: ReactNode;
31
+ helperText?: ReactNode;
32
+ error?: ReactNode;
33
+ required?: boolean;
34
+ disabled?: boolean;
35
+ id?: string;
36
+ children: ReactNode;
37
+ }
38
+ /** Adds the label, helper text and error around a picker, unless an enclosing FormField provides them. */
39
+ export declare function PickerShell({ label, helperText, error, required, disabled, id, children, }: PickerShellProps): import("react").JSX.Element;
40
+ export declare const PickerField: import("react").ForwardRefExoticComponent<PickerFieldProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,12 @@
1
+ export interface TimeColumnsProps {
2
+ /** Hour 0-23, or null while no time is chosen. */
3
+ hours: number | null;
4
+ minutes: number | null;
5
+ onChange: (hours: number, minutes: number) => void;
6
+ minuteStep: number;
7
+ use12Hours: boolean;
8
+ /** True for times that cannot be chosen. */
9
+ isTimeDisabled: (hours: number, minutes: number) => boolean;
10
+ }
11
+ /** Hour, minute (and AM/PM) lists used inside the DateTimePicker popover. */
12
+ export declare function TimeColumns({ hours, minutes, onChange, minuteStep, use12Hours, isTimeDisabled, }: TimeColumnsProps): import("react").JSX.Element;
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Date helpers for the picker. Dates are handled as local calendar days and kept at
3
+ * noon so daylight-saving shifts never move them to a neighbouring day.
4
+ */
5
+ /** `2026-10-08` for a date, using its local year, month and day. */
6
+ export declare const toISO: (date: Date) => string;
7
+ /** Parses `YYYY-MM-DD`. Returns null for anything else, including impossible dates like `2026-02-31`. */
8
+ export declare function parseISO(value: string | null | undefined): Date | null;
9
+ export declare const today: () => Date;
10
+ export declare const addDays: (date: Date, days: number) => Date;
11
+ /** Moves by whole months, keeping the day of month when it exists (Jan 31 + 1 month = Feb 28/29). */
12
+ export declare function addMonths(date: Date, months: number): Date;
13
+ export declare const isSameDay: (a: Date | null, b: Date | null) => boolean;
14
+ export declare function clampDate(date: Date, min: Date | null, max: Date | null): Date;
15
+ /** The 42 days (6 weeks) shown for the month containing `month`, starting on `weekStartsOn` (0 = Sunday). */
16
+ export declare function buildMonthGrid(month: Date, weekStartsOn: 0 | 1): Date[];
17
+ export interface DateRange {
18
+ /** First disabled day, `YYYY-MM-DD`. */
19
+ from: string;
20
+ /** Last disabled day, `YYYY-MM-DD`. */
21
+ to: string;
22
+ }
23
+ export interface DisabledDateOptions {
24
+ /** Earliest selectable day, `YYYY-MM-DD`. Earlier days are disabled. */
25
+ min?: string;
26
+ /** Latest selectable day, `YYYY-MM-DD`. Later days are disabled. */
27
+ max?: string;
28
+ /** Disable every day before today. Today stays selectable. */
29
+ disablePast?: boolean;
30
+ /** Disable every day after today. Today stays selectable. */
31
+ disableFuture?: boolean;
32
+ /** Individual days to disable, as `YYYY-MM-DD` strings or Date objects (holidays, booked days). */
33
+ disabledDates?: (string | Date)[];
34
+ /** Ranges to disable, both ends included (e.g. a term break). */
35
+ disabledRanges?: DateRange[];
36
+ /** Weekdays to disable: 0 = Sunday ... 6 = Saturday (e.g. `[0, 6]` for weekends). */
37
+ disabledDaysOfWeek?: number[];
38
+ /** Your own rule. Return true to disable the day. Runs in addition to the options above. */
39
+ isDateDisabled?: (date: Date) => boolean;
40
+ }
41
+ /** Combines every disabling option into one `(date) => boolean`. Invalid dates in the options are ignored. */
42
+ export declare function createDisabledPredicate(options: DisabledDateOptions, now?: Date): (date: Date) => boolean;
43
+ /** `date` itself if it is enabled, otherwise the closest enabled day (searching up to a year either way). */
44
+ export declare function nearestEnabled(date: Date, isDisabled: (date: Date) => boolean): Date;
45
+ /** `2026-10` for a date. */
46
+ export declare const toMonthISO: (date: Date) => string;
47
+ /** Parses `YYYY-MM` to the first day of that month. Returns null for anything else. */
48
+ export declare function parseMonth(value: string | null | undefined): Date | null;
49
+ export interface DisabledMonthOptions {
50
+ /** Earliest selectable month, `YYYY-MM`. */
51
+ min?: string;
52
+ /** Latest selectable month, `YYYY-MM`. */
53
+ max?: string;
54
+ /** Disable months before the current month. The current month stays selectable. */
55
+ disablePast?: boolean;
56
+ /** Disable months after the current month. The current month stays selectable. */
57
+ disableFuture?: boolean;
58
+ /** Individual months to disable, `YYYY-MM`. */
59
+ disabledMonths?: string[];
60
+ /** Your own rule, called with the first day of the month. Return true to disable it. */
61
+ isMonthDisabled?: (month: Date) => boolean;
62
+ }
63
+ /** Combines every month-disabling option into one `(firstDayOfMonth) => boolean`. */
64
+ export declare function createMonthDisabledPredicate(options: DisabledMonthOptions, now?: Date): (month: Date) => boolean;
65
+ /** `2026-10-08T14:30` for a date, in local time. */
66
+ export declare const toDateTimeISO: (date: Date) => string;
67
+ /** Parses `YYYY-MM-DDTHH:mm` (seconds are ignored) to a local Date. Returns null for anything else. */
68
+ export declare function parseDateTime(value: string | null | undefined): Date | null;
69
+ /** A date with its time replaced. */
70
+ export declare const withTime: (date: Date, hours: number, minutes: number) => Date;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { DatePicker } from './DatePicker';
2
+ export type { DatePickerProps, DateRange } from './DatePicker.types';
@@ -0,0 +1,3 @@
1
+ import type { DateTimePickerProps } from './DateTimePicker.types';
2
+ /** Date and time field: a calendar plus hour and minute lists (value as `YYYY-MM-DDTHH:mm`). */
3
+ export declare const DateTimePicker: import("react").ForwardRefExoticComponent<DateTimePickerProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,50 @@
1
+ import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ import type { ComponentSize } from '../../types';
3
+ import type { DateRange } from '../DatePicker/dateUtils';
4
+ export interface DateTimePickerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onChange' | 'children' | 'placeholder' | 'min' | 'max'> {
5
+ label?: ReactNode;
6
+ helperText?: ReactNode;
7
+ /** Error message. When set, the picker is marked invalid. */
8
+ error?: ReactNode;
9
+ required?: boolean;
10
+ /** Selected date and time as `YYYY-MM-DDTHH:mm`, the format of `datetime-local` inputs (controlled). */
11
+ value?: string;
12
+ /** Initial value, `YYYY-MM-DDTHH:mm` (uncontrolled). */
13
+ defaultValue?: string;
14
+ /** Called with `YYYY-MM-DDTHH:mm`, or `""` when cleared. Fires on every change of the day or time. */
15
+ onChange?: (value: string) => void;
16
+ /** Earliest selectable moment, `YYYY-MM-DDTHH:mm` (or just `YYYY-MM-DD` for the start of that day). */
17
+ min?: string;
18
+ /** Latest selectable moment, `YYYY-MM-DDTHH:mm` (or just `YYYY-MM-DD` for the end of that day). */
19
+ max?: string;
20
+ /** Disable everything before now (earlier hours today are disabled too). */
21
+ disablePast?: boolean;
22
+ /** Disable everything after now (later hours today are disabled too). */
23
+ disableFuture?: boolean;
24
+ /** Individual days to disable, as `YYYY-MM-DD` strings or Date objects. */
25
+ disabledDates?: (string | Date)[];
26
+ /** Day ranges to disable, both ends included. */
27
+ disabledRanges?: DateRange[];
28
+ /** Weekdays to disable: 0 = Sunday ... 6 = Saturday. */
29
+ disabledDaysOfWeek?: number[];
30
+ /** Your own day rule. Return true to disable the day. */
31
+ isDateDisabled?: (date: Date) => boolean;
32
+ /** Minutes between the choices in the minute list. Defaults to 5. */
33
+ minuteStep?: number;
34
+ /** Use a 12 hour clock with AM/PM. Defaults to false (24 hour). */
35
+ use12Hours?: boolean;
36
+ /** Time given to a day picked before any time was chosen, `HH:mm`. Defaults to `00:00`. */
37
+ defaultTime?: string;
38
+ /** Text shown while nothing is chosen. Defaults to "Select date and time". */
39
+ placeholder?: string;
40
+ /** Defaults to `md`. */
41
+ size?: ComponentSize;
42
+ /** Submitted with a surrounding `<form>` as `YYYY-MM-DDTHH:mm`. */
43
+ name?: string;
44
+ /** Show a button to clear the value. Defaults to `true`. */
45
+ clearable?: boolean;
46
+ /** First day of the week: 0 = Sunday (default), 1 = Monday. */
47
+ weekStartsOn?: 0 | 1;
48
+ /** BCP 47 locale for names and the shown value, e.g. `en-GB`. Defaults to the browser's. */
49
+ locale?: string;
50
+ }
@@ -0,0 +1,2 @@
1
+ export { DateTimePicker } from './DateTimePicker';
2
+ export type { DateTimePickerProps } from './DateTimePicker.types';
@@ -0,0 +1,3 @@
1
+ import type { DrawerProps } from './Drawer.types';
2
+ /** Panel that slides in from the side, for forms and filters. Behaves like `Modal`. */
3
+ export declare function Drawer({ open, onClose, title, description, children, footer, placement, size, closeOnBackdrop, closeOnEscape, hideCloseButton, role, 'aria-label': ariaLabel, className, }: DrawerProps): import("react").JSX.Element | null;
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { ModalProps } from '../Modal';
3
+ export type DrawerSize = 'sm' | 'md' | 'lg';
4
+ export interface DrawerProps extends Omit<ModalProps, 'size' | 'bare' | 'children'> {
5
+ children?: ReactNode;
6
+ /** Which edge the panel slides in from. Defaults to `right`. */
7
+ placement?: 'right' | 'left';
8
+ /** Width of the panel. Defaults to `md`. */
9
+ size?: DrawerSize;
10
+ }
@@ -0,0 +1,2 @@
1
+ export { Drawer } from './Drawer';
2
+ export type { DrawerProps, DrawerSize } from './Drawer.types';
@@ -0,0 +1,7 @@
1
+ import type { DropdownMenuProps } from './DropdownMenu.types';
2
+ /**
3
+ * A "more actions" button that opens a menu of actions. Arrow keys, Home and End move between items,
4
+ * Enter or Space chooses one, Escape closes and returns focus to the button. The menu is rendered in
5
+ * <body>, so tables and scroll areas can't clip it, and it keeps the surrounding theme.
6
+ */
7
+ export declare function DropdownMenu({ items, position, label, children, onOpenChange, disabled, className, }: DropdownMenuProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface DropdownMenuItem {
3
+ label: string;
4
+ icon?: ReactNode;
5
+ onClick: () => void;
6
+ /** `danger` styles the item red, e.g. for Delete. */
7
+ variant?: 'default' | 'danger';
8
+ disabled?: boolean;
9
+ }
10
+ export interface DropdownMenuProps {
11
+ items: DropdownMenuItem[];
12
+ /** Which edge of the button the menu lines up with. `right` (default) opens toward the right. */
13
+ position?: 'left' | 'right';
14
+ /** Accessible name and tooltip of the default "more" button. Defaults to "More actions". */
15
+ label?: string;
16
+ /** Replace the default kebab button's content (e.g. an icon or text). */
17
+ children?: ReactNode;
18
+ onOpenChange?: (open: boolean) => void;
19
+ disabled?: boolean;
20
+ className?: string;
21
+ }
@@ -0,0 +1,2 @@
1
+ export { DropdownMenu } from './DropdownMenu';
2
+ export type { DropdownMenuItem, DropdownMenuProps } from './DropdownMenu.types';
@@ -0,0 +1,6 @@
1
+ import type { FileInputProps } from './FileInput.types';
2
+ /**
3
+ * File picker in five looks (`variant`): drag-and-drop zone, button, input-like field, single image
4
+ * tile and image gallery. Files are checked against `accept`, `maxSize` and `maxFiles`.
5
+ */
6
+ export declare const FileInput: import("react").ForwardRefExoticComponent<FileInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,55 @@
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * - `dropzone`: a dashed drag-and-drop area with the list of chosen files below (default).
4
+ * - `button`: an "Upload" button with the file name beside it. Compact, for toolbars and forms.
5
+ * - `field`: looks like a text input, showing the file name with a "Browse" button on the right.
6
+ * - `image`: one image shown as a tile (square or round) with a live preview. For photos and logos.
7
+ * - `gallery`: several images as a grid of thumbnails with an "add" tile.
8
+ */
9
+ export type FileInputVariant = 'dropzone' | 'button' | 'field' | 'image' | 'gallery';
10
+ export interface FileInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange' | 'size' | 'placeholder'> {
11
+ label?: ReactNode;
12
+ helperText?: ReactNode;
13
+ /** Error message from your own validation. Files rejected by `accept`, `maxSize` or `maxFiles` show their own message. */
14
+ error?: ReactNode;
15
+ /** How the picker looks. Defaults to `dropzone`. */
16
+ variant?: FileInputVariant;
17
+ /** Allow several files. Picking or dropping more files adds to the list. Always on for `gallery`, off for `image`. */
18
+ multiple?: boolean;
19
+ /** Accepted types, as for the native input: `.pdf`, `image/*`, `application/pdf`, comma separated. Also applied to dropped files. `image` and `gallery` default to `image/*`. */
20
+ accept?: string;
21
+ /** Largest allowed size of one file, in bytes. */
22
+ maxSize?: number;
23
+ /** Largest number of files when several are allowed. */
24
+ maxFiles?: number;
25
+ /** Show small thumbnails for image files in the list (`dropzone`, `button`, `field`). Defaults to true. */
26
+ preview?: boolean;
27
+ /**
28
+ * `image` variant only: the shape of the tile and of the crop frame. `circle` for profile photos,
29
+ * `square` (default) for logos, `rectangle` for banners and covers (see `aspectRatio`).
30
+ */
31
+ shape?: 'circle' | 'square' | 'rectangle';
32
+ /** `image` variant, `shape="rectangle"` only: width divided by height. Defaults to 4 / 3 (use `16 / 9` for banners). */
33
+ aspectRatio?: number;
34
+ /** `image` variant only: width of the tile in px (its height follows from the shape). Defaults to 128. */
35
+ tileSize?: number;
36
+ /**
37
+ * `image` variant only: after a picture is picked, open a cropper to move and zoom it inside the frame
38
+ * before it is used. Defaults to true. Set `false` to use the picked file as it is. SVG files are never cropped.
39
+ */
40
+ crop?: boolean;
41
+ /** Width in px of the cropped image; its height follows from the shape. Defaults to 512 (800 for `rectangle`). */
42
+ cropOutputWidth?: number;
43
+ /** Format of the cropped image. Defaults to the original's (PNG, JPEG or WebP), otherwise PNG. */
44
+ cropOutputType?: 'image/png' | 'image/jpeg' | 'image/webp';
45
+ /** JPEG/WebP quality of the cropped image, 0 to 1. */
46
+ cropOutputQuality?: number;
47
+ /** Title of the cropper. Defaults to "Crop photo". */
48
+ cropTitle?: string;
49
+ /** Text on the button of the `button` variant. Defaults to "Choose file(s)". */
50
+ buttonLabel?: string;
51
+ /** Text shown while nothing is chosen in the `button` and `field` variants. Defaults to "No file chosen". */
52
+ placeholder?: string;
53
+ /** Called with the current list whenever it changes. */
54
+ onFilesChange?: (files: File[]) => void;
55
+ }
@@ -0,0 +1,21 @@
1
+ export interface ImageCropperProps {
2
+ file: File;
3
+ /** Width divided by height of the crop frame. */
4
+ aspect: number;
5
+ /** `circle` shows a round frame; the saved image is still the full rectangle around it. */
6
+ shape: 'circle' | 'rect';
7
+ /** Width in px of the saved image. The height follows from `aspect`. */
8
+ outputWidth: number;
9
+ outputType: 'image/png' | 'image/jpeg' | 'image/webp';
10
+ outputQuality?: number;
11
+ title?: string;
12
+ /** `data-theme` to apply to the dialog (it is rendered in <body>). */
13
+ theme?: string;
14
+ onApply: (file: File) => void;
15
+ onCancel: () => void;
16
+ }
17
+ /**
18
+ * Modal that lets the user move and zoom a picked image inside a fixed-ratio frame and saves the visible
19
+ * part as a new file. Drag, arrow keys, the slider, or +/- keys adjust it; Enter applies, Escape cancels.
20
+ */
21
+ export declare function ImageCropper({ file, aspect, shape, outputWidth, outputType, outputQuality, title, theme, onApply, onCancel, }: ImageCropperProps): import("react").ReactPortal;
@@ -0,0 +1,8 @@
1
+ /** "1.5 MB", "820 KB", "12 B". */
2
+ export declare function formatFileSize(bytes: number): string;
3
+ /** Whether `file` matches a native `accept` string (`.pdf, image/*, application/pdf`). Empty accepts everything. */
4
+ export declare function matchesAccept(file: Pick<File, 'name' | 'type'>, accept?: string): boolean;
5
+ export declare const sameFile: (a: File, b: File) => boolean;
6
+ /** Stable key for a file: name, size and modified time. */
7
+ export declare const fileKey: (file: File) => string;
8
+ export declare const isImage: (file: Pick<File, "type">) => boolean;
@@ -0,0 +1,3 @@
1
+ export { FileInput } from './FileInput';
2
+ export { formatFileSize } from './fileUtils';
3
+ export type { FileInputProps, FileInputVariant } from './FileInput.types';
@@ -1,6 +1,15 @@
1
1
  import type { InputHTMLAttributes, ReactNode } from 'react';
2
2
  import type { ComponentSize } from '../../types';
3
+ import type { DatePickerProps } from '../DatePicker';
4
+ import type { DateTimePickerProps } from '../DateTimePicker';
5
+ import type { MonthPickerProps } from '../MonthPicker';
3
6
  export type InputSize = ComponentSize;
7
+ /**
8
+ * Options for the pickers behind `type="date"`, `"datetime-local"` and `"month"`: which days or months
9
+ * are disabled, week start, locale and, for date-time, the time list. Options that do not apply to the
10
+ * input's type are ignored.
11
+ */
12
+ export type DateInputOptions = Pick<DatePickerProps, 'disablePast' | 'disableFuture' | 'disabledDates' | 'disabledRanges' | 'disabledDaysOfWeek' | 'isDateDisabled' | 'weekStartsOn' | 'locale' | 'clearable'> & Pick<DateTimePickerProps, 'minuteStep' | 'use12Hours' | 'defaultTime'> & Pick<MonthPickerProps, 'disabledMonths' | 'isMonthDisabled'>;
4
13
  export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'prefix' | 'size'> {
5
14
  label?: ReactNode;
6
15
  helperText?: ReactNode;
@@ -12,4 +21,11 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
12
21
  suffix?: ReactNode;
13
22
  /** Defaults to `md`. */
14
23
  size?: InputSize;
24
+ /**
25
+ * For `type="date"`, `"datetime-local"` and `"month"`, which show the package's pickers instead of the
26
+ * browser's. `value`, `defaultValue`, `min` and `max` use the native formats (`YYYY-MM-DD`,
27
+ * `YYYY-MM-DDTHH:mm`, `YYYY-MM`); `onChange` receives an event whose `target.value` is in that format
28
+ * (or `""` when cleared).
29
+ */
30
+ dateOptions?: DateInputOptions;
15
31
  }
@@ -0,0 +1,14 @@
1
+ import type { InputProps } from './Input.types';
2
+ /** Input types that use the package's own pickers instead of the browser's. */
3
+ export declare const PICKER_TYPES: readonly ["date", "datetime-local", "month"];
4
+ export type PickerType = (typeof PICKER_TYPES)[number];
5
+ export declare const isPickerType: (type: string | undefined) => type is PickerType;
6
+ /**
7
+ * `Input type="date" | "datetime-local" | "month"`: a themed picker behind the regular Input API.
8
+ *
9
+ * A hidden text input holds the value and receives a real `input` event when something is picked, so
10
+ * `onChange` handlers, form libraries and the forwarded ref behave as they do with a native input.
11
+ */
12
+ export declare const PickerTypeInput: import("react").ForwardRefExoticComponent<InputProps & {
13
+ type: PickerType;
14
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,2 +1,2 @@
1
1
  export { Input } from './Input';
2
- export type { InputProps, InputSize } from './Input.types';
2
+ export type { DateInputOptions, InputProps, InputSize } from './Input.types';
@@ -0,0 +1,6 @@
1
+ import type { ModalProps } from './Modal.types';
2
+ /**
3
+ * Dialog in the middle of the screen. Traps focus, locks page scroll, closes on Escape / backdrop /
4
+ * the close button, and returns focus to what opened it. Put `data-autofocus` on an element to focus it first.
5
+ */
6
+ export declare function Modal({ open, onClose, title, description, children, footer, size, closeOnBackdrop, closeOnEscape, hideCloseButton, bare, role, 'aria-label': ariaLabel, className, }: ModalProps): import("react").JSX.Element | null;
@@ -0,0 +1,39 @@
1
+ import type { ReactNode } from 'react';
2
+ export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
3
+ export interface ModalBareApi {
4
+ titleId: string;
5
+ descriptionId: string;
6
+ onClose: () => void;
7
+ }
8
+ export interface ModalProps {
9
+ /** Whether the modal is shown. You control it: set it to false in `onClose`. */
10
+ open: boolean;
11
+ /** Called when the user closes the modal: Escape, the close button or a click on the backdrop. */
12
+ onClose: () => void;
13
+ title?: ReactNode;
14
+ /** Short text under the title; also used as the dialog's description for assistive tech. */
15
+ description?: ReactNode;
16
+ /**
17
+ * Without a header or footer of its own: the modal is only the dialog frame and your `children` (usually a
18
+ * form with its own header and bottom buttons) fill it. Pass a function to get the ids for
19
+ * `aria-labelledby` / `aria-describedby` and `onClose`. `title`, `description`, `footer` and
20
+ * `hideCloseButton` are ignored; give a `title` id to your own heading, or an `aria-label`.
21
+ */
22
+ bare?: boolean;
23
+ children?: ReactNode | ((api: ModalBareApi) => ReactNode);
24
+ /** Buttons at the bottom, e.g. Cancel and Save. */
25
+ footer?: ReactNode;
26
+ /** Width of the modal. Defaults to `md`. */
27
+ size?: ModalSize;
28
+ /** Close when the backdrop is clicked. Defaults to true. */
29
+ closeOnBackdrop?: boolean;
30
+ /** Close on Escape. Defaults to true. */
31
+ closeOnEscape?: boolean;
32
+ /** Hide the close button in the corner. */
33
+ hideCloseButton?: boolean;
34
+ /** `alertdialog` for urgent confirmations. Defaults to `dialog`. */
35
+ role?: 'dialog' | 'alertdialog';
36
+ /** Accessible name when there is no visible `title`. */
37
+ 'aria-label'?: string;
38
+ className?: string;
39
+ }
@@ -0,0 +1,2 @@
1
+ export { Modal } from './Modal';
2
+ export type { ModalBareApi, ModalProps, ModalSize } from './Modal.types';
@@ -0,0 +1,3 @@
1
+ import type { MonthPickerProps } from './MonthPicker.types';
2
+ /** Month and year field with a custom chooser (value as `YYYY-MM`). */
3
+ export declare const MonthPicker: import("react").ForwardRefExoticComponent<MonthPickerProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,37 @@
1
+ import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ import type { ComponentSize } from '../../types';
3
+ export interface MonthPickerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'defaultValue' | 'onChange' | 'children' | 'placeholder' | 'min' | 'max'> {
4
+ label?: ReactNode;
5
+ helperText?: ReactNode;
6
+ /** Error message. When set, the picker is marked invalid. */
7
+ error?: ReactNode;
8
+ required?: boolean;
9
+ /** Selected month as `YYYY-MM` (controlled). Use `""` for none. */
10
+ value?: string;
11
+ /** Initial month as `YYYY-MM` (uncontrolled). */
12
+ defaultValue?: string;
13
+ /** Called with `YYYY-MM`, or `""` when cleared. */
14
+ onChange?: (value: string) => void;
15
+ /** Earliest selectable month, `YYYY-MM`. */
16
+ min?: string;
17
+ /** Latest selectable month, `YYYY-MM`. */
18
+ max?: string;
19
+ /** Disable months before the current month. The current month stays selectable. */
20
+ disablePast?: boolean;
21
+ /** Disable months after the current month. The current month stays selectable. */
22
+ disableFuture?: boolean;
23
+ /** Individual months to disable, `YYYY-MM`. */
24
+ disabledMonths?: string[];
25
+ /** Your own rule, called with the first day of the month. Return true to disable it. */
26
+ isMonthDisabled?: (month: Date) => boolean;
27
+ /** Text shown while no month is chosen. Defaults to "Select a month". */
28
+ placeholder?: string;
29
+ /** Defaults to `md`. */
30
+ size?: ComponentSize;
31
+ /** Submitted with a surrounding `<form>` as `YYYY-MM`. */
32
+ name?: string;
33
+ /** Show a button to clear the month. Defaults to `true`. */
34
+ clearable?: boolean;
35
+ /** BCP 47 locale for month names and the shown value, e.g. `en-GB`. Defaults to the browser's. */
36
+ locale?: string;
37
+ }
@@ -0,0 +1,2 @@
1
+ export { MonthPicker } from './MonthPicker';
2
+ export type { MonthPickerProps } from './MonthPicker.types';
@@ -0,0 +1,25 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface OverlayProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ /** Where the panel sits: centered (modal) or sliding in from a side (drawer). */
6
+ placement: 'center' | 'right' | 'left';
7
+ /** Width class of the panel, set by the caller's own CSS module. */
8
+ panelClassName?: string;
9
+ closeOnBackdrop?: boolean;
10
+ closeOnEscape?: boolean;
11
+ role?: 'dialog' | 'alertdialog';
12
+ 'aria-label'?: string;
13
+ /** Called with the ids to use for `aria-labelledby` / `aria-describedby`. */
14
+ children: (ids: {
15
+ titleId: string;
16
+ descriptionId: string;
17
+ }) => ReactNode;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * Shared base for Modal and Drawer: a backdrop and panel rendered in <body> that keeps the surrounding
22
+ * theme, locks page scroll, traps focus, closes on Escape or a backdrop click, and gives focus back to
23
+ * whatever had it before. Put `data-autofocus` on an element to focus it first; otherwise the panel gets focus.
24
+ */
25
+ export declare function Overlay({ open, onClose, placement, panelClassName, closeOnBackdrop, closeOnEscape, role, 'aria-label': ariaLabel, children, className, }: OverlayProps): import("react").ReactPortal | null;
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface OverlayContentProps {
3
+ titleId: string;
4
+ descriptionId: string;
5
+ title?: ReactNode;
6
+ description?: ReactNode;
7
+ footer?: ReactNode;
8
+ hideCloseButton?: boolean;
9
+ closeLabel?: string;
10
+ onClose: () => void;
11
+ children?: ReactNode;
12
+ }
13
+ /** Header (title, description, close button), scrolling body and footer shared by Modal and Drawer. */
14
+ export declare function OverlayContent({ titleId, descriptionId, title, description, footer, hideCloseButton, closeLabel, onClose, children, }: OverlayContentProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
+ export interface PageHeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
3
+ title: ReactNode;
4
+ subtitle?: ReactNode;
5
+ /** Shows the circular back button; it calls `onBack`. */
6
+ onBack?: () => void;
7
+ backLabel?: string;
8
+ /** Buttons and other controls on the right. */
9
+ actions?: ReactNode;
10
+ }
11
+ /** Page title bar like the school app's: optional circular back button, title, subtitle and actions. */
12
+ export declare function PageHeader({ title, subtitle, onBack, backLabel, actions, className, ...rest }: PageHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { PageHeader } from './PageHeader';
2
+ export type { PageHeaderProps } from './PageHeader';
@@ -0,0 +1,6 @@
1
+ import type { PaginationProps } from './Pagination.types';
2
+ /**
3
+ * Page navigation: previous / next, numbered pages with ellipses, optional first / last, a
4
+ * "Showing 1-10 of 120" summary and a rows-per-page select. Pages start at 1.
5
+ */
6
+ export declare function Pagination({ page, pageCount, onPageChange, siblingCount, boundaryCount, showFirstLast: showFirstLastProp, layout, pageSize, totalItems, pageSizeOptions, onPageSizeChange, disabled, 'aria-label': ariaLabel, className, ...rest }: PaginationProps): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'onChange'> {
3
+ /** Current page, starting at 1. */
4
+ page: number;
5
+ /** Total number of pages. */
6
+ pageCount: number;
7
+ onPageChange: (page: number) => void;
8
+ /** Pages shown either side of the current one. Defaults to 1. */
9
+ siblingCount?: number;
10
+ /** Pages always shown at the start and the end. Defaults to 1. */
11
+ boundaryCount?: number;
12
+ /**
13
+ * `default`: summary and rows-per-page on the left, pages on the right. `split`: three columns (rows per
14
+ * page, joined page buttons with first / last, "Showing 1-10 of 120 Rows"), as used in the school app tables.
15
+ */
16
+ layout?: 'default' | 'split';
17
+ /** Show "first" and "last" buttons. */
18
+ showFirstLast?: boolean;
19
+ /** Items per page. With `totalItems`, it makes the "Showing 1-10 of 120" text. */
20
+ pageSize?: number;
21
+ /** Total number of items. */
22
+ totalItems?: number;
23
+ /** When given with `onPageSizeChange`, shows a "Rows per page" select. */
24
+ pageSizeOptions?: number[];
25
+ onPageSizeChange?: (pageSize: number) => void;
26
+ disabled?: boolean;
27
+ /** Accessible name of the navigation. Defaults to "Pagination". */
28
+ 'aria-label'?: string;
29
+ }
@@ -0,0 +1,4 @@
1
+ export { Pagination } from './Pagination';
2
+ export { getPageItems } from './paginationUtils';
3
+ export type { PageItem } from './paginationUtils';
4
+ export type { PaginationProps } from './Pagination.types';
@@ -0,0 +1,7 @@
1
+ export type PageItem = number | 'ellipsis-start' | 'ellipsis-end';
2
+ /**
3
+ * Which page buttons to show: the first and last `boundaryCount` pages, `siblingCount` pages either side of
4
+ * the current one, and an ellipsis wherever pages are skipped. A gap of a single page is shown as that page
5
+ * instead of an ellipsis, so the list never hides just one number.
6
+ */
7
+ export declare function getPageItems(page: number, pageCount: number, siblingCount?: number, boundaryCount?: number): PageItem[];