@mpfrontend/ui 0.1.0 → 1.1.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/README.md +9 -5
- package/dist/core.d.ts +115 -0
- package/dist/core.js +103 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +1 -109
- package/dist/index.js +1 -98
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -0
- package/dist/one-time-code.js +1 -1
- package/dist/one-time-code.js.map +1 -1
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @mpfrontend/ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Part of [MP Frontend](https://github.com/panahister/mpfrontend), released to the public npm registry as one cohort: every `@mpfrontend`
|
|
4
|
+
package at the same exact version. Runtime: client. Install it through a workspace that `mpfrontend init`
|
|
5
|
+
created, which pins the cohort and binds the scope to the registry in `.npmrc`. [Versioning](https://github.com/panahister/mpfrontend#versioning)
|
|
6
|
+
states the compatibility policy and [Implementation status](https://github.com/panahister/mpfrontend/blob/main/docs/IMPLEMENTATION-STATUS.md) the
|
|
7
|
+
evidence.
|
|
6
8
|
|
|
7
9
|
Import `@mpfrontend/ui/tailwind.css` from the consumer's Tailwind v4 entry so its compiler scans the
|
|
8
10
|
published JavaScript for structural utility classes. Import `@mpfrontend/ui/styles.css` for semantic
|
|
@@ -25,7 +27,7 @@ has an error state and never logs or stores the value.
|
|
|
25
27
|
`ConfirmWithCode` confirms a sensitive action in a `Dialog`: `onConfirm(code, signal)` sends the code to
|
|
26
28
|
the server through the BFF (a same-origin request with the CSRF token and an idempotency key), the browser
|
|
27
29
|
never checks the code, and the code is cleared on close and on failure and never written to browser
|
|
28
|
-
storage, a URL or a log. DOM behaviour (keyboard, focus, names, clearing) is tested with happy-dom
|
|
30
|
+
storage, a URL or a log. DOM behaviour (keyboard, focus, names, clearing) is tested with happy-dom 21.0.4,
|
|
29
31
|
a test-only dependency chosen because the tests need focus and keyboard events without a browser.
|
|
30
32
|
|
|
31
33
|
## Tree
|
|
@@ -48,7 +50,9 @@ and `aria-expanded`, and its accessible name includes its state label.
|
|
|
48
50
|
may not be viewed is not rendered, with its label, `helpers` text and `errors` text, and leaves validation and the
|
|
49
51
|
submitted values; a field that may not be edited is disabled; a save passes `onSubmit` only the changed fields that
|
|
50
52
|
may be edited, compared with `original` (`dirtyPatch`), and a changed field that may not be edited throws
|
|
51
|
-
`FORBIDDEN_FIELD` instead of being sent.
|
|
53
|
+
`FORBIDDEN_FIELD` instead of being sent. With `access`, `ResourceForm` requires `original`, in its type and at run time
|
|
54
|
+
(`RESOURCE_FORM_ORIGINAL_REQUIRED`): without it every shown field would count as changed and be sent. A form for a new
|
|
55
|
+
record passes an empty `original`. Without `access` both components behave as before. A hidden field is a
|
|
52
56
|
presentation; the server still refuses a field the person may not write.
|
|
53
57
|
|
|
54
58
|
## Paging, sorting and filtering
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type InputHTMLAttributes, type SelectHTMLAttributes, type ReactNode, type Key } from 'react';
|
|
2
|
+
import type { AccessReader } from '@mpfrontend/access-core';
|
|
3
|
+
export type DisplayField = Readonly<{
|
|
4
|
+
key: string;
|
|
5
|
+
type: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
editable: boolean;
|
|
8
|
+
nullable: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
11
|
+
tone?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
loadingLabel?: ReactNode;
|
|
14
|
+
restricted?: boolean;
|
|
15
|
+
leadingIcon?: ReactNode;
|
|
16
|
+
trailingIcon?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export type FieldProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
19
|
+
label: string;
|
|
20
|
+
helper?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
};
|
|
23
|
+
export type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
|
|
24
|
+
label: string;
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
export declare function Button({ tone, loading, loadingLabel, restricted, leadingIcon, trailingIcon, children, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
28
|
+
export declare function Field({ label, helper, error, ...props }: FieldProps): import("react").JSX.Element;
|
|
29
|
+
export declare function Select({ label, children, icon, ...props }: SelectProps): import("react").JSX.Element;
|
|
30
|
+
export declare function Card({ children }: {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
export type TableSort = Readonly<{
|
|
34
|
+
field: string;
|
|
35
|
+
direction: 'asc' | 'desc';
|
|
36
|
+
}>;
|
|
37
|
+
/** The visible text of the table's controls, from the consumer's catalog. */
|
|
38
|
+
export type TableText = Readonly<{
|
|
39
|
+
pagination: string;
|
|
40
|
+
previous: string;
|
|
41
|
+
next: string;
|
|
42
|
+
/** The current page and the page count, when the count is known. */
|
|
43
|
+
page: (page: number, count: number | undefined) => string;
|
|
44
|
+
size?: string;
|
|
45
|
+
apply?: string;
|
|
46
|
+
filters?: string;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* The controlled state of a table and its change events. The mode is declared, never inferred: in `client` mode the
|
|
50
|
+
* table filters, sorts and pages the rows it is given; in `server` mode it shows them as the server returned them and
|
|
51
|
+
* never sorts, filters or pages them itself.
|
|
52
|
+
*/
|
|
53
|
+
export type TableControl = Readonly<{
|
|
54
|
+
mode: 'client' | 'server';
|
|
55
|
+
page: number;
|
|
56
|
+
size: number;
|
|
57
|
+
sort?: TableSort | undefined;
|
|
58
|
+
filters?: Readonly<Record<string, string>>;
|
|
59
|
+
/** The total number of rows the server reports (server mode). */
|
|
60
|
+
total?: number | undefined;
|
|
61
|
+
/** Whether a next page exists, when the server reports no total (server mode). */
|
|
62
|
+
hasMore?: boolean;
|
|
63
|
+
sortable?: readonly string[];
|
|
64
|
+
filterable?: readonly string[];
|
|
65
|
+
sizes?: readonly number[];
|
|
66
|
+
onPageChange: (page: number) => void;
|
|
67
|
+
onSizeChange?: (size: number) => void;
|
|
68
|
+
onSortChange?: (sort: TableSort | undefined) => void;
|
|
69
|
+
onFiltersChange?: (filters: Readonly<Record<string, string>>) => void;
|
|
70
|
+
text: TableText;
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* With `access`, a column whose field may not be viewed is removed with its header. Without it, every field shows.
|
|
74
|
+
* With `control`, the table has sortable headers, filters and paging bound to the controlled values; a sort or a
|
|
75
|
+
* filter on a column the person may not view is ignored. Without it, the table renders the rows as before.
|
|
76
|
+
*/
|
|
77
|
+
export declare function ResourceTable({ fields, rows, caption, format, labels, detail, rowKey, access, control }: {
|
|
78
|
+
fields: readonly DisplayField[];
|
|
79
|
+
rows: readonly Record<string, unknown>[];
|
|
80
|
+
caption: string;
|
|
81
|
+
format: (value: unknown) => string;
|
|
82
|
+
labels?: Readonly<Record<string, string>>;
|
|
83
|
+
detail?: (row: Record<string, unknown>) => ReactNode;
|
|
84
|
+
rowKey?: (row: Record<string, unknown>, index: number) => Key;
|
|
85
|
+
access?: AccessReader;
|
|
86
|
+
control?: TableControl;
|
|
87
|
+
}): import("react").JSX.Element;
|
|
88
|
+
/**
|
|
89
|
+
* With `access`, a field that may not be viewed is not rendered (its label, helper and error with it) and leaves
|
|
90
|
+
* validation and the submitted values; a field that may not be edited is disabled; a save passes `onSubmit` only the
|
|
91
|
+
* changed fields that may be edited, compared with `original` (dirtyPatch); `original` is required with `access`, in the
|
|
92
|
+
* type and at run time (`RESOURCE_FORM_ORIGINAL_REQUIRED`), because without it every shown field would count as changed
|
|
93
|
+
* and be sent; a new record passes an empty one. Without `access`, every editable field shows and `onSubmit` receives
|
|
94
|
+
* nothing, as before.
|
|
95
|
+
*/
|
|
96
|
+
export declare function ResourceForm({ fields, values, onChange, onSubmit, labels, saveLabel, disabled, access, original, helpers, errors }: {
|
|
97
|
+
fields: readonly DisplayField[];
|
|
98
|
+
values: Readonly<Record<string, unknown>>;
|
|
99
|
+
onChange: (key: string, value: unknown) => void;
|
|
100
|
+
onSubmit: (patch?: Record<string, unknown>) => void;
|
|
101
|
+
labels?: Readonly<Record<string, string>>;
|
|
102
|
+
saveLabel: string;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
helpers?: Readonly<Record<string, string>>;
|
|
105
|
+
errors?: Readonly<Record<string, string>>;
|
|
106
|
+
} & (Readonly<{
|
|
107
|
+
access?: undefined;
|
|
108
|
+
original?: Readonly<Record<string, unknown>>;
|
|
109
|
+
}> | Readonly<{
|
|
110
|
+
access: AccessReader;
|
|
111
|
+
original: Readonly<Record<string, unknown>>;
|
|
112
|
+
}>)): import("react").JSX.Element;
|
|
113
|
+
export { Dialog, nextFocus, type DialogProps } from './dialog.js';
|
|
114
|
+
export { OneTimeCodeField, ConfirmWithCode, codeDigits, type OneTimeCodeFieldProps, type ConfirmWithCodeProps } from './one-time-code.js';
|
|
115
|
+
export { Tree, visibleRows, descendantIds, treeKey, type TreeNode, type TreeRow, type TreeColumn, type TreeMove, type TreeProps } from './tree.js';
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from 'react';
|
|
4
|
+
import { buttonState, fieldState, isControlUnavailable } from '@mpfrontend/primitives/internal';
|
|
5
|
+
export function Button({ tone = 'primary', loading = false, loadingLabel, restricted = false, leadingIcon, trailingIcon, children, disabled, ...props }) {
|
|
6
|
+
const state = buttonState({ disabled: disabled ?? false, loading, restricted });
|
|
7
|
+
return _jsxs("button", { ...props, disabled: isControlUnavailable(state), "aria-busy": state === 'loading' || undefined, "aria-disabled": state === 'restricted' || undefined, "data-state": state, "data-tone": tone, className: ['mp-button', 'inline-flex h-[var(--mp-control-height)] items-center justify-center gap-2 whitespace-nowrap rounded-[var(--mp-radius-control)] border-0 px-[var(--mp-control-padding)]', props.className].filter(Boolean).join(' '), children: [loading ? _jsx("span", { className: "mp-button-spinner", "aria-hidden": "true" }) : leadingIcon, _jsx("span", { children: loading ? (loadingLabel ?? children) : children }), !loading && trailingIcon] });
|
|
8
|
+
}
|
|
9
|
+
export function Field({ label, helper, error, ...props }) {
|
|
10
|
+
const generated = useId(), id = props.id ?? generated, description = id + '-description';
|
|
11
|
+
const state = fieldState({ disabled: props.disabled ?? false, readOnly: props.readOnly ?? false, invalid: !!error });
|
|
12
|
+
return _jsxs("label", { className: "mp-field flex max-w-full flex-col gap-[var(--mp-field-gap)]", "data-state": state, htmlFor: id, children: [_jsx("span", { className: "mp-field-label text-sm font-medium", children: label }), _jsx("input", { ...props, id: id, className: ['mp-input', 'h-[var(--mp-control-height)] w-full rounded-[var(--mp-radius-control)] border px-3', props.className].filter(Boolean).join(' '), "aria-invalid": !!error, "aria-describedby": error || helper ? description : props['aria-describedby'] }), (helper || error) && _jsx("span", { id: description, className: error ? 'mp-field-helper mp-field-error text-xs' : 'mp-field-helper text-xs', children: error ?? helper })] });
|
|
13
|
+
}
|
|
14
|
+
export function Select({ label, children, icon, ...props }) {
|
|
15
|
+
const generated = useId(), id = props.id ?? generated;
|
|
16
|
+
const state = fieldState({ disabled: props.disabled ?? false });
|
|
17
|
+
return _jsxs("label", { className: "mp-field flex max-w-full flex-col gap-[var(--mp-field-gap)]", "data-state": state, htmlFor: id, children: [_jsx("span", { className: "mp-field-label text-sm font-medium", children: label }), _jsxs("span", { className: "mp-select-wrap relative w-full", "data-custom-icon": icon ? 'true' : undefined, children: [_jsx("select", { ...props, id: id, className: ['mp-select', 'h-[var(--mp-control-height)] w-full rounded-[var(--mp-radius-control)] border px-3', props.className].filter(Boolean).join(' '), children: children }), icon && _jsx("span", { className: "mp-select-icon pointer-events-none absolute end-3 top-1/2 -translate-y-1/2", "aria-hidden": "true", children: icon })] })] });
|
|
18
|
+
}
|
|
19
|
+
export function Card({ children }) { return _jsx("section", { className: "mp-card rounded-[var(--mp-radius-surface)] border p-6", children: children }); }
|
|
20
|
+
function compareValues(a, b) {
|
|
21
|
+
if (a === b)
|
|
22
|
+
return 0;
|
|
23
|
+
if (a === null || a === undefined)
|
|
24
|
+
return 1;
|
|
25
|
+
if (b === null || b === undefined)
|
|
26
|
+
return -1;
|
|
27
|
+
if (typeof a === 'number' && typeof b === 'number')
|
|
28
|
+
return a - b;
|
|
29
|
+
if (typeof a === 'boolean' && typeof b === 'boolean')
|
|
30
|
+
return a === b ? 0 : a ? 1 : -1;
|
|
31
|
+
return String(a).localeCompare(String(b));
|
|
32
|
+
}
|
|
33
|
+
const nextSort = (sort, field) => sort?.field !== field ? { field, direction: 'asc' } : sort.direction === 'asc' ? { field, direction: 'desc' } : undefined;
|
|
34
|
+
/**
|
|
35
|
+
* With `access`, a column whose field may not be viewed is removed with its header. Without it, every field shows.
|
|
36
|
+
* With `control`, the table has sortable headers, filters and paging bound to the controlled values; a sort or a
|
|
37
|
+
* filter on a column the person may not view is ignored. Without it, the table renders the rows as before.
|
|
38
|
+
*/
|
|
39
|
+
export function ResourceTable({ fields, rows, caption, format, labels = {}, detail, rowKey, access, control }) {
|
|
40
|
+
const columns = access ? fields.filter(field => access.field(field.key).view) : fields;
|
|
41
|
+
const visible = new Set(columns.map(field => field.key)), hiddenField = (key) => fields.some(field => field.key === key) && !visible.has(key);
|
|
42
|
+
let shown = rows, total;
|
|
43
|
+
if (control?.mode === 'client') {
|
|
44
|
+
const filters = Object.entries(control.filters ?? {}).filter(([key, value]) => value !== '' && visible.has(key));
|
|
45
|
+
let selected = rows.filter(row => filters.every(([key, value]) => format(row[key]).toLocaleLowerCase().includes(value.toLocaleLowerCase())));
|
|
46
|
+
const sort = control.sort && visible.has(control.sort.field) ? control.sort : undefined;
|
|
47
|
+
if (sort)
|
|
48
|
+
selected = [...selected].sort((a, b) => compareValues(a[sort.field], b[sort.field]) * (sort.direction === 'asc' ? 1 : -1));
|
|
49
|
+
total = selected.length;
|
|
50
|
+
shown = selected.slice((control.page - 1) * control.size, control.page * control.size);
|
|
51
|
+
}
|
|
52
|
+
else if (control)
|
|
53
|
+
total = control.total;
|
|
54
|
+
const count = control && total !== undefined ? Math.max(1, Math.ceil(total / control.size)) : undefined;
|
|
55
|
+
const header = (field) => {
|
|
56
|
+
const label = labels[field.key] ?? field.key;
|
|
57
|
+
if (!control?.onSortChange || !control.sortable?.includes(field.key))
|
|
58
|
+
return _jsx("th", { className: "border-b p-3 text-start", scope: "col", children: label }, field.key);
|
|
59
|
+
const direction = control.sort?.field === field.key ? control.sort.direction : undefined;
|
|
60
|
+
const onSortChange = control.onSortChange;
|
|
61
|
+
return _jsx("th", { className: "border-b p-3 text-start", scope: "col", "aria-sort": direction === 'asc' ? 'ascending' : direction === 'desc' ? 'descending' : 'none', children: _jsx("button", { type: "button", className: "mp-table-sort inline-flex items-center gap-1", onClick: () => onSortChange(nextSort(control.sort, field.key)), children: label }) }, field.key);
|
|
62
|
+
};
|
|
63
|
+
const filterable = control?.onFiltersChange ? (control.filterable ?? []).filter(name => !hiddenField(name)) : [];
|
|
64
|
+
const table = _jsx("div", { className: "mp-table-wrap overflow-auto", children: _jsxs("table", { className: "w-full border-collapse", children: [_jsx("caption", { children: caption }), _jsx("thead", { children: _jsxs("tr", { children: [columns.map(header), detail && _jsx("th", { className: "border-b p-3 text-start", scope: "col", children: labels.detail ?? 'Details' })] }) }), _jsx("tbody", { children: shown.map((row, index) => _jsxs("tr", { children: [columns.map(field => _jsx("td", { className: "border-b p-3 text-start", children: format(row[field.key]) }, field.key)), detail && _jsx("td", { className: "border-b p-3 text-start", children: detail(row) })] }, rowKey ? rowKey(row, index) : index)) })] }) });
|
|
65
|
+
if (!control)
|
|
66
|
+
return table;
|
|
67
|
+
const { page, size, sizes, onSizeChange, onFiltersChange, text } = control;
|
|
68
|
+
return _jsxs("div", { className: "mp-table grid gap-4", children: [filterable.length > 0 && onFiltersChange && _jsxs("form", { role: "search", "aria-label": text.filters, className: "flex flex-wrap items-end gap-4", onSubmit: event => { event.preventDefault(); const data = new FormData(event.currentTarget); onFiltersChange(Object.fromEntries(filterable.map(name => [name, String(data.get(name) ?? '')]))); }, children: [filterable.map(name => _jsx(Field, { name: name, label: labels[name] ?? name, defaultValue: control.filters?.[name] ?? '' }, name)), _jsx(Button, { type: "submit", tone: "secondary", children: text.apply })] }, JSON.stringify(control.filters ?? {})), table, _jsxs("nav", { "aria-label": text.pagination, className: "flex flex-wrap items-center gap-4", children: [_jsx(Button, { type: "button", tone: "ghost", disabled: page <= 1, onClick: () => control.onPageChange(page - 1), children: text.previous }), _jsx("span", { children: text.page(page, count) }), _jsx(Button, { type: "button", tone: "ghost", disabled: count !== undefined ? page >= count : control.hasMore !== true, onClick: () => control.onPageChange(page + 1), children: text.next }), sizes && onSizeChange && _jsx(Select, { label: text.size ?? '', value: String(size), onChange: event => onSizeChange(Number(event.target.value)), children: sizes.map(option => _jsx("option", { value: option, children: option }, option)) })] })] });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* With `access`, a field that may not be viewed is not rendered (its label, helper and error with it) and leaves
|
|
72
|
+
* validation and the submitted values; a field that may not be edited is disabled; a save passes `onSubmit` only the
|
|
73
|
+
* changed fields that may be edited, compared with `original` (dirtyPatch); `original` is required with `access`, in the
|
|
74
|
+
* type and at run time (`RESOURCE_FORM_ORIGINAL_REQUIRED`), because without it every shown field would count as changed
|
|
75
|
+
* and be sent; a new record passes an empty one. Without `access`, every editable field shows and `onSubmit` receives
|
|
76
|
+
* nothing, as before.
|
|
77
|
+
*/
|
|
78
|
+
export function ResourceForm({ fields, values, onChange, onSubmit, labels = {}, saveLabel, disabled = false, access, original, helpers = {}, errors = {} }) {
|
|
79
|
+
if (access && original === undefined)
|
|
80
|
+
throw new Error('RESOURCE_FORM_ORIGINAL_REQUIRED');
|
|
81
|
+
const editable = fields.filter(field => field.editable);
|
|
82
|
+
if (editable.some(field => !['string', 'boolean', 'number', 'integer'].includes(field.type)))
|
|
83
|
+
throw new Error('UNSUPPORTED_FORM_FIELD');
|
|
84
|
+
const shown = access ? editable.filter(field => access.field(field.key).view) : editable;
|
|
85
|
+
const locked = (field) => disabled || (access ? !access.field(field.key).edit : false);
|
|
86
|
+
const unavailable = disabled || shown.length === 0 || shown.every(locked);
|
|
87
|
+
const submit = () => {
|
|
88
|
+
if (unavailable)
|
|
89
|
+
return;
|
|
90
|
+
if (!access) {
|
|
91
|
+
onSubmit();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Only the fields shown are compared, so a hidden field never leaves; a changed field that may not be edited
|
|
95
|
+
// throws FORBIDDEN_FIELD instead of being sent.
|
|
96
|
+
onSubmit(access.patch(original ?? {}, Object.fromEntries(shown.filter(field => Object.hasOwn(values, field.key)).map(field => [field.key, values[field.key]]))));
|
|
97
|
+
};
|
|
98
|
+
return _jsxs("form", { className: "mp-form grid gap-4", onSubmit: event => { event.preventDefault(); submit(); }, children: [shown.map(field => _jsx(Field, { label: labels[field.key] ?? field.key, name: field.key, required: field.required && field.type !== 'boolean', disabled: locked(field), ...(helpers[field.key] !== undefined ? { helper: helpers[field.key] } : {}), ...(errors[field.key] !== undefined ? { error: errors[field.key] } : {}), type: field.type === 'boolean' ? 'checkbox' : field.type === 'number' || field.type === 'integer' ? 'number' : 'text', step: field.type === 'number' ? 'any' : field.type === 'integer' ? 1 : undefined, checked: field.type === 'boolean' ? values[field.key] === true : undefined, value: field.type === 'boolean' ? undefined : String(values[field.key] ?? ''), onChange: event => onChange(field.key, field.type === 'boolean' ? event.target.checked : field.type === 'number' || field.type === 'integer' ? event.target.valueAsNumber : event.target.value) }, field.key)), _jsx(Button, { disabled: unavailable, type: "submit", tone: "secondary", children: saveLabel })] });
|
|
99
|
+
}
|
|
100
|
+
export { Dialog, nextFocus } from './dialog.js';
|
|
101
|
+
export { OneTimeCodeField, ConfirmWithCode, codeDigits } from './one-time-code.js';
|
|
102
|
+
export { Tree, visibleRows, descendantIds, treeKey } from './tree.js';
|
|
103
|
+
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,KAAK,EAA4G,MAAM,OAAO,CAAC;AACxI,OAAO,EAAC,WAAW,EAAC,UAAU,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAC;AAe5F,MAAM,UAAU,MAAM,CAAC,EAAC,IAAI,GAAC,SAAS,EAAC,OAAO,GAAC,KAAK,EAAC,YAAY,EAAC,UAAU,GAAC,KAAK,EAAC,WAAW,EAAC,YAAY,EAAC,QAAQ,EAAC,QAAQ,EAAC,GAAG,KAAK,EAAa;IACjJ,MAAM,KAAK,GAAC,WAAW,CAAC,EAAC,QAAQ,EAAC,QAAQ,IAAE,KAAK,EAAC,OAAO,EAAC,UAAU,EAAC,CAAC,CAAC;IACvE,OAAO,qBAAY,KAAK,EAAE,QAAQ,EAAE,oBAAoB,CAAC,KAAK,CAAC,eAAa,KAAK,KAAG,SAAS,IAAE,SAAS,mBAAiB,KAAK,KAAG,YAAY,IAAE,SAAS,gBAAc,KAAK,eAAa,IAAI,EAAE,SAAS,EAAE,CAAC,WAAW,EAAC,yKAAyK,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aACva,OAAO,CAAA,CAAC,CAAA,eAAM,SAAS,EAAC,mBAAmB,iBAAa,MAAM,GAAE,CAAA,CAAC,CAAA,WAAW,EAC7E,yBAAO,OAAO,CAAA,CAAC,CAAA,CAAC,YAAY,IAAE,QAAQ,CAAC,CAAA,CAAC,CA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
-
key: string;
|
|
5
|
-
type: string;
|
|
6
|
-
required: boolean;
|
|
7
|
-
editable: boolean;
|
|
8
|
-
nullable: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
11
|
-
tone?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
12
|
-
loading?: boolean;
|
|
13
|
-
loadingLabel?: ReactNode;
|
|
14
|
-
restricted?: boolean;
|
|
15
|
-
leadingIcon?: ReactNode;
|
|
16
|
-
trailingIcon?: ReactNode;
|
|
17
|
-
};
|
|
18
|
-
export type FieldProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
19
|
-
label: string;
|
|
20
|
-
helper?: string;
|
|
21
|
-
error?: string;
|
|
22
|
-
};
|
|
23
|
-
export type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & {
|
|
24
|
-
label: string;
|
|
25
|
-
icon?: ReactNode;
|
|
26
|
-
};
|
|
27
|
-
export declare function Button({ tone, loading, loadingLabel, restricted, leadingIcon, trailingIcon, children, disabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
28
|
-
export declare function Field({ label, helper, error, ...props }: FieldProps): import("react").JSX.Element;
|
|
29
|
-
export declare function Select({ label, children, icon, ...props }: SelectProps): import("react").JSX.Element;
|
|
30
|
-
export declare function Card({ children }: {
|
|
31
|
-
children: ReactNode;
|
|
32
|
-
}): import("react").JSX.Element;
|
|
33
|
-
export type TableSort = Readonly<{
|
|
34
|
-
field: string;
|
|
35
|
-
direction: 'asc' | 'desc';
|
|
36
|
-
}>;
|
|
37
|
-
/** The visible text of the table's controls, from the consumer's catalog. */
|
|
38
|
-
export type TableText = Readonly<{
|
|
39
|
-
pagination: string;
|
|
40
|
-
previous: string;
|
|
41
|
-
next: string;
|
|
42
|
-
/** The current page and the page count, when the count is known. */
|
|
43
|
-
page: (page: number, count: number | undefined) => string;
|
|
44
|
-
size?: string;
|
|
45
|
-
apply?: string;
|
|
46
|
-
filters?: string;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* The controlled state of a table and its change events. The mode is declared, never inferred: in `client` mode the
|
|
50
|
-
* table filters, sorts and pages the rows it is given; in `server` mode it shows them as the server returned them and
|
|
51
|
-
* never sorts, filters or pages them itself.
|
|
52
|
-
*/
|
|
53
|
-
export type TableControl = Readonly<{
|
|
54
|
-
mode: 'client' | 'server';
|
|
55
|
-
page: number;
|
|
56
|
-
size: number;
|
|
57
|
-
sort?: TableSort | undefined;
|
|
58
|
-
filters?: Readonly<Record<string, string>>;
|
|
59
|
-
/** The total number of rows the server reports (server mode). */
|
|
60
|
-
total?: number | undefined;
|
|
61
|
-
/** Whether a next page exists, when the server reports no total (server mode). */
|
|
62
|
-
hasMore?: boolean;
|
|
63
|
-
sortable?: readonly string[];
|
|
64
|
-
filterable?: readonly string[];
|
|
65
|
-
sizes?: readonly number[];
|
|
66
|
-
onPageChange: (page: number) => void;
|
|
67
|
-
onSizeChange?: (size: number) => void;
|
|
68
|
-
onSortChange?: (sort: TableSort | undefined) => void;
|
|
69
|
-
onFiltersChange?: (filters: Readonly<Record<string, string>>) => void;
|
|
70
|
-
text: TableText;
|
|
71
|
-
}>;
|
|
72
|
-
/**
|
|
73
|
-
* With `access`, a column whose field may not be viewed is removed with its header. Without it, every field shows.
|
|
74
|
-
* With `control`, the table has sortable headers, filters and paging bound to the controlled values; a sort or a
|
|
75
|
-
* filter on a column the person may not view is ignored. Without it, the table renders the rows as before.
|
|
76
|
-
*/
|
|
77
|
-
export declare function ResourceTable({ fields, rows, caption, format, labels, detail, rowKey, access, control }: {
|
|
78
|
-
fields: readonly DisplayField[];
|
|
79
|
-
rows: readonly Record<string, unknown>[];
|
|
80
|
-
caption: string;
|
|
81
|
-
format: (value: unknown) => string;
|
|
82
|
-
labels?: Readonly<Record<string, string>>;
|
|
83
|
-
detail?: (row: Record<string, unknown>) => ReactNode;
|
|
84
|
-
rowKey?: (row: Record<string, unknown>, index: number) => Key;
|
|
85
|
-
access?: AccessReader;
|
|
86
|
-
control?: TableControl;
|
|
87
|
-
}): import("react").JSX.Element;
|
|
88
|
-
/**
|
|
89
|
-
* With `access`, a field that may not be viewed is not rendered (its label, helper and error with it) and leaves
|
|
90
|
-
* validation and the submitted values; a field that may not be edited is disabled; a save passes `onSubmit` only the
|
|
91
|
-
* changed fields that may be edited, compared with `original` (dirtyPatch). Without `access`, every editable field
|
|
92
|
-
* shows and `onSubmit` receives nothing, as before.
|
|
93
|
-
*/
|
|
94
|
-
export declare function ResourceForm({ fields, values, onChange, onSubmit, labels, saveLabel, disabled, access, original, helpers, errors }: {
|
|
95
|
-
fields: readonly DisplayField[];
|
|
96
|
-
values: Readonly<Record<string, unknown>>;
|
|
97
|
-
onChange: (key: string, value: unknown) => void;
|
|
98
|
-
onSubmit: (patch?: Record<string, unknown>) => void;
|
|
99
|
-
labels?: Readonly<Record<string, string>>;
|
|
100
|
-
saveLabel: string;
|
|
101
|
-
disabled?: boolean;
|
|
102
|
-
access?: AccessReader;
|
|
103
|
-
original?: Readonly<Record<string, unknown>>;
|
|
104
|
-
helpers?: Readonly<Record<string, string>>;
|
|
105
|
-
errors?: Readonly<Record<string, string>>;
|
|
106
|
-
}): import("react").JSX.Element;
|
|
107
|
-
export { Dialog, nextFocus, type DialogProps } from './dialog.js';
|
|
108
|
-
export { OneTimeCodeField, ConfirmWithCode, codeDigits, type OneTimeCodeFieldProps, type ConfirmWithCodeProps } from './one-time-code.js';
|
|
109
|
-
export { Tree, visibleRows, descendantIds, treeKey, type TreeNode, type TreeRow, type TreeColumn, type TreeMove, type TreeProps } from './tree.js';
|
|
1
|
+
export { Button, type ButtonProps, Card, codeDigits, ConfirmWithCode, type ConfirmWithCodeProps, descendantIds, Dialog, type DialogProps, type DisplayField, Field, type FieldProps, OneTimeCodeField, type OneTimeCodeFieldProps, ResourceForm, ResourceTable, Select, type SelectProps, type TableControl, type TableSort, type TableText, Tree, type TreeColumn, type TreeMove, type TreeNode, type TreeProps, type TreeRow, } from './core.js';
|
package/dist/index.js
CHANGED
|
@@ -1,99 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useId } from 'react';
|
|
4
|
-
import { buttonState, fieldState, isControlUnavailable } from '@mpfrontend/primitives';
|
|
5
|
-
export function Button({ tone = 'primary', loading = false, loadingLabel, restricted = false, leadingIcon, trailingIcon, children, disabled, ...props }) {
|
|
6
|
-
const state = buttonState({ disabled: disabled ?? false, loading, restricted });
|
|
7
|
-
return _jsxs("button", { ...props, disabled: isControlUnavailable(state), "aria-busy": state === 'loading' || undefined, "aria-disabled": state === 'restricted' || undefined, "data-state": state, "data-tone": tone, className: ['mp-button', 'inline-flex h-[var(--mp-control-height)] items-center justify-center gap-2 whitespace-nowrap rounded-[var(--mp-radius-control)] border-0 px-[var(--mp-control-padding)]', props.className].filter(Boolean).join(' '), children: [loading ? _jsx("span", { className: "mp-button-spinner", "aria-hidden": "true" }) : leadingIcon, _jsx("span", { children: loading ? (loadingLabel ?? children) : children }), !loading && trailingIcon] });
|
|
8
|
-
}
|
|
9
|
-
export function Field({ label, helper, error, ...props }) {
|
|
10
|
-
const generated = useId(), id = props.id ?? generated, description = id + '-description';
|
|
11
|
-
const state = fieldState({ disabled: props.disabled ?? false, readOnly: props.readOnly ?? false, invalid: !!error });
|
|
12
|
-
return _jsxs("label", { className: "mp-field flex max-w-full flex-col gap-[var(--mp-field-gap)]", "data-state": state, htmlFor: id, children: [_jsx("span", { className: "mp-field-label text-sm font-medium", children: label }), _jsx("input", { ...props, id: id, className: ['mp-input', 'h-[var(--mp-control-height)] w-full rounded-[var(--mp-radius-control)] border px-3', props.className].filter(Boolean).join(' '), "aria-invalid": !!error, "aria-describedby": error || helper ? description : props['aria-describedby'] }), (helper || error) && _jsx("span", { id: description, className: error ? 'mp-field-helper mp-field-error text-xs' : 'mp-field-helper text-xs', children: error ?? helper })] });
|
|
13
|
-
}
|
|
14
|
-
export function Select({ label, children, icon, ...props }) {
|
|
15
|
-
const generated = useId(), id = props.id ?? generated;
|
|
16
|
-
const state = fieldState({ disabled: props.disabled ?? false });
|
|
17
|
-
return _jsxs("label", { className: "mp-field flex max-w-full flex-col gap-[var(--mp-field-gap)]", "data-state": state, htmlFor: id, children: [_jsx("span", { className: "mp-field-label text-sm font-medium", children: label }), _jsxs("span", { className: "mp-select-wrap relative w-full", "data-custom-icon": icon ? 'true' : undefined, children: [_jsx("select", { ...props, id: id, className: ['mp-select', 'h-[var(--mp-control-height)] w-full rounded-[var(--mp-radius-control)] border px-3', props.className].filter(Boolean).join(' '), children: children }), icon && _jsx("span", { className: "mp-select-icon pointer-events-none absolute end-3 top-1/2 -translate-y-1/2", "aria-hidden": "true", children: icon })] })] });
|
|
18
|
-
}
|
|
19
|
-
export function Card({ children }) { return _jsx("section", { className: "mp-card rounded-[var(--mp-radius-surface)] border p-6", children: children }); }
|
|
20
|
-
function compareValues(a, b) {
|
|
21
|
-
if (a === b)
|
|
22
|
-
return 0;
|
|
23
|
-
if (a === null || a === undefined)
|
|
24
|
-
return 1;
|
|
25
|
-
if (b === null || b === undefined)
|
|
26
|
-
return -1;
|
|
27
|
-
if (typeof a === 'number' && typeof b === 'number')
|
|
28
|
-
return a - b;
|
|
29
|
-
if (typeof a === 'boolean' && typeof b === 'boolean')
|
|
30
|
-
return a === b ? 0 : a ? 1 : -1;
|
|
31
|
-
return String(a).localeCompare(String(b));
|
|
32
|
-
}
|
|
33
|
-
const nextSort = (sort, field) => sort?.field !== field ? { field, direction: 'asc' } : sort.direction === 'asc' ? { field, direction: 'desc' } : undefined;
|
|
34
|
-
/**
|
|
35
|
-
* With `access`, a column whose field may not be viewed is removed with its header. Without it, every field shows.
|
|
36
|
-
* With `control`, the table has sortable headers, filters and paging bound to the controlled values; a sort or a
|
|
37
|
-
* filter on a column the person may not view is ignored. Without it, the table renders the rows as before.
|
|
38
|
-
*/
|
|
39
|
-
export function ResourceTable({ fields, rows, caption, format, labels = {}, detail, rowKey, access, control }) {
|
|
40
|
-
const columns = access ? fields.filter(field => access.field(field.key).view) : fields;
|
|
41
|
-
const visible = new Set(columns.map(field => field.key)), hiddenField = (key) => fields.some(field => field.key === key) && !visible.has(key);
|
|
42
|
-
let shown = rows, total;
|
|
43
|
-
if (control?.mode === 'client') {
|
|
44
|
-
const filters = Object.entries(control.filters ?? {}).filter(([key, value]) => value !== '' && visible.has(key));
|
|
45
|
-
let selected = rows.filter(row => filters.every(([key, value]) => format(row[key]).toLocaleLowerCase().includes(value.toLocaleLowerCase())));
|
|
46
|
-
const sort = control.sort && visible.has(control.sort.field) ? control.sort : undefined;
|
|
47
|
-
if (sort)
|
|
48
|
-
selected = [...selected].sort((a, b) => compareValues(a[sort.field], b[sort.field]) * (sort.direction === 'asc' ? 1 : -1));
|
|
49
|
-
total = selected.length;
|
|
50
|
-
shown = selected.slice((control.page - 1) * control.size, control.page * control.size);
|
|
51
|
-
}
|
|
52
|
-
else if (control)
|
|
53
|
-
total = control.total;
|
|
54
|
-
const count = control && total !== undefined ? Math.max(1, Math.ceil(total / control.size)) : undefined;
|
|
55
|
-
const header = (field) => {
|
|
56
|
-
const label = labels[field.key] ?? field.key;
|
|
57
|
-
if (!control?.onSortChange || !control.sortable?.includes(field.key))
|
|
58
|
-
return _jsx("th", { className: "border-b p-3 text-start", scope: "col", children: label }, field.key);
|
|
59
|
-
const direction = control.sort?.field === field.key ? control.sort.direction : undefined;
|
|
60
|
-
const onSortChange = control.onSortChange;
|
|
61
|
-
return _jsx("th", { className: "border-b p-3 text-start", scope: "col", "aria-sort": direction === 'asc' ? 'ascending' : direction === 'desc' ? 'descending' : 'none', children: _jsx("button", { type: "button", className: "mp-table-sort inline-flex items-center gap-1", onClick: () => onSortChange(nextSort(control.sort, field.key)), children: label }) }, field.key);
|
|
62
|
-
};
|
|
63
|
-
const filterable = control?.onFiltersChange ? (control.filterable ?? []).filter(name => !hiddenField(name)) : [];
|
|
64
|
-
const table = _jsx("div", { className: "mp-table-wrap overflow-auto", children: _jsxs("table", { className: "w-full border-collapse", children: [_jsx("caption", { children: caption }), _jsx("thead", { children: _jsxs("tr", { children: [columns.map(header), detail && _jsx("th", { className: "border-b p-3 text-start", scope: "col", children: labels.detail ?? 'Details' })] }) }), _jsx("tbody", { children: shown.map((row, index) => _jsxs("tr", { children: [columns.map(field => _jsx("td", { className: "border-b p-3 text-start", children: format(row[field.key]) }, field.key)), detail && _jsx("td", { className: "border-b p-3 text-start", children: detail(row) })] }, rowKey ? rowKey(row, index) : index)) })] }) });
|
|
65
|
-
if (!control)
|
|
66
|
-
return table;
|
|
67
|
-
const { page, size, sizes, onSizeChange, onFiltersChange, text } = control;
|
|
68
|
-
return _jsxs("div", { className: "mp-table grid gap-4", children: [filterable.length > 0 && onFiltersChange && _jsxs("form", { role: "search", "aria-label": text.filters, className: "flex flex-wrap items-end gap-4", onSubmit: event => { event.preventDefault(); const data = new FormData(event.currentTarget); onFiltersChange(Object.fromEntries(filterable.map(name => [name, String(data.get(name) ?? '')]))); }, children: [filterable.map(name => _jsx(Field, { name: name, label: labels[name] ?? name, defaultValue: control.filters?.[name] ?? '' }, name)), _jsx(Button, { type: "submit", tone: "secondary", children: text.apply })] }, JSON.stringify(control.filters ?? {})), table, _jsxs("nav", { "aria-label": text.pagination, className: "flex flex-wrap items-center gap-4", children: [_jsx(Button, { type: "button", tone: "ghost", disabled: page <= 1, onClick: () => control.onPageChange(page - 1), children: text.previous }), _jsx("span", { children: text.page(page, count) }), _jsx(Button, { type: "button", tone: "ghost", disabled: count !== undefined ? page >= count : control.hasMore !== true, onClick: () => control.onPageChange(page + 1), children: text.next }), sizes && onSizeChange && _jsx(Select, { label: text.size ?? '', value: String(size), onChange: event => onSizeChange(Number(event.target.value)), children: sizes.map(option => _jsx("option", { value: option, children: option }, option)) })] })] });
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* With `access`, a field that may not be viewed is not rendered (its label, helper and error with it) and leaves
|
|
72
|
-
* validation and the submitted values; a field that may not be edited is disabled; a save passes `onSubmit` only the
|
|
73
|
-
* changed fields that may be edited, compared with `original` (dirtyPatch). Without `access`, every editable field
|
|
74
|
-
* shows and `onSubmit` receives nothing, as before.
|
|
75
|
-
*/
|
|
76
|
-
export function ResourceForm({ fields, values, onChange, onSubmit, labels = {}, saveLabel, disabled = false, access, original = {}, helpers = {}, errors = {} }) {
|
|
77
|
-
const editable = fields.filter(field => field.editable);
|
|
78
|
-
if (editable.some(field => !['string', 'boolean', 'number', 'integer'].includes(field.type)))
|
|
79
|
-
throw new Error('UNSUPPORTED_FORM_FIELD');
|
|
80
|
-
const shown = access ? editable.filter(field => access.field(field.key).view) : editable;
|
|
81
|
-
const locked = (field) => disabled || (access ? !access.field(field.key).edit : false);
|
|
82
|
-
const unavailable = disabled || shown.length === 0 || shown.every(locked);
|
|
83
|
-
const submit = () => {
|
|
84
|
-
if (unavailable)
|
|
85
|
-
return;
|
|
86
|
-
if (!access) {
|
|
87
|
-
onSubmit();
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
// Only the fields shown are compared, so a hidden field never leaves; a changed field that may not be edited
|
|
91
|
-
// throws FORBIDDEN_FIELD instead of being sent.
|
|
92
|
-
onSubmit(access.patch(original, Object.fromEntries(shown.filter(field => Object.hasOwn(values, field.key)).map(field => [field.key, values[field.key]]))));
|
|
93
|
-
};
|
|
94
|
-
return _jsxs("form", { className: "mp-form grid gap-4", onSubmit: event => { event.preventDefault(); submit(); }, children: [shown.map(field => _jsx(Field, { label: labels[field.key] ?? field.key, name: field.key, required: field.required && field.type !== 'boolean', disabled: locked(field), ...(helpers[field.key] !== undefined ? { helper: helpers[field.key] } : {}), ...(errors[field.key] !== undefined ? { error: errors[field.key] } : {}), type: field.type === 'boolean' ? 'checkbox' : field.type === 'number' || field.type === 'integer' ? 'number' : 'text', step: field.type === 'number' ? 'any' : field.type === 'integer' ? 1 : undefined, checked: field.type === 'boolean' ? values[field.key] === true : undefined, value: field.type === 'boolean' ? undefined : String(values[field.key] ?? ''), onChange: event => onChange(field.key, field.type === 'boolean' ? event.target.checked : field.type === 'number' || field.type === 'integer' ? event.target.valueAsNumber : event.target.value) }, field.key)), _jsx(Button, { disabled: unavailable, type: "submit", tone: "secondary", children: saveLabel })] });
|
|
95
|
-
}
|
|
96
|
-
export { Dialog, nextFocus } from './dialog.js';
|
|
97
|
-
export { OneTimeCodeField, ConfirmWithCode, codeDigits } from './one-time-code.js';
|
|
98
|
-
export { Tree, visibleRows, descendantIds, treeKey } from './tree.js';
|
|
1
|
+
export { Button, Card, codeDigits, ConfirmWithCode, descendantIds, Dialog, Field, OneTimeCodeField, ResourceForm, ResourceTable, Select, Tree, } from './core.js';
|
|
99
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,KAAK,EAA4G,MAAM,OAAO,CAAC;AACxI,OAAO,EAAC,WAAW,EAAC,UAAU,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAenF,MAAM,UAAU,MAAM,CAAC,EAAC,IAAI,GAAC,SAAS,EAAC,OAAO,GAAC,KAAK,EAAC,YAAY,EAAC,UAAU,GAAC,KAAK,EAAC,WAAW,EAAC,YAAY,EAAC,QAAQ,EAAC,QAAQ,EAAC,GAAG,KAAK,EAAa;IACjJ,MAAM,KAAK,GAAC,WAAW,CAAC,EAAC,QAAQ,EAAC,QAAQ,IAAE,KAAK,EAAC,OAAO,EAAC,UAAU,EAAC,CAAC,CAAC;IACvE,OAAO,qBAAY,KAAK,EAAE,QAAQ,EAAE,oBAAoB,CAAC,KAAK,CAAC,eAAa,KAAK,KAAG,SAAS,IAAE,SAAS,mBAAiB,KAAK,KAAG,YAAY,IAAE,SAAS,gBAAc,KAAK,eAAa,IAAI,EAAE,SAAS,EAAE,CAAC,WA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,WAAW,EAAC,aAAa,EAAC,OAAO,EAAyE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EAEN,IAAI,EACJ,UAAU,EACV,eAAe,EAEf,aAAa,EACb,MAAM,EAGN,KAAK,EAEL,gBAAgB,EAEhB,YAAY,EACZ,aAAa,EACb,MAAM,EAKN,IAAI,GAML,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { nextFocus, treeKey, visibleRows } from './core.js';
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,EAAC,SAAS,EAAC,OAAO,EAAC,WAAW,EAAC,MAAM,WAAW,CAAC"}
|
package/dist/one-time-code.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useId, useRef, useState } from 'react';
|
|
4
|
-
import { Button } from './
|
|
4
|
+
import { Button } from './core.js';
|
|
5
5
|
import { Dialog } from './dialog.js';
|
|
6
6
|
const decimalDigit = /^\p{Nd}$/u;
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"one-time-code.js","sourceRoot":"","sources":["../src/one-time-code.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAC,SAAS,EAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAA+B,MAAM,OAAO,CAAC;AACpF,OAAO,EAAC,MAAM,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"one-time-code.js","sourceRoot":"","sources":["../src/one-time-code.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAC,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,EAAE,IAAI,CAAC,MAAM,KAAG,MAAM,EAAE,OAAO,EAAE,MAAM,KAAG,SAAS,KAAM,CAAC,MAAM,CAAC,OAAO,CAAA,CAAC,CAAA,EAAC,YAAY,EAAC,MAAM,CAAC,OAAO,EAAC,CAAA,CAAC,CAAA,EAAE,CAAC,YAAG,MAAM,CAAC,OAAO,GAAU,IAC/J,IACD,GACA,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpfrontend/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
"import": "./dist/index.js"
|
|
17
17
|
},
|
|
18
18
|
"./styles.css": "./src/styles.css",
|
|
19
|
-
"./tailwind.css": "./src/tailwind.css"
|
|
19
|
+
"./tailwind.css": "./src/tailwind.css",
|
|
20
|
+
"./internal": {
|
|
21
|
+
"types": "./dist/internal.d.ts",
|
|
22
|
+
"import": "./dist/internal.js"
|
|
23
|
+
}
|
|
20
24
|
},
|
|
21
25
|
"files": [
|
|
22
26
|
"dist",
|
|
@@ -29,12 +33,12 @@
|
|
|
29
33
|
"provenance": true
|
|
30
34
|
},
|
|
31
35
|
"dependencies": {
|
|
32
|
-
"@mpfrontend/access-core": "
|
|
33
|
-
"@mpfrontend/primitives": "
|
|
36
|
+
"@mpfrontend/access-core": "1.1.0",
|
|
37
|
+
"@mpfrontend/primitives": "1.1.0"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
|
-
"@happy-dom/global-registrator": "
|
|
37
|
-
"happy-dom": "
|
|
40
|
+
"@happy-dom/global-registrator": "21.0.4",
|
|
41
|
+
"happy-dom": "21.0.4"
|
|
38
42
|
},
|
|
39
43
|
"peerDependencies": {
|
|
40
44
|
"react": "^19.3.0",
|