@inkra/react 0.6.0 → 0.8.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 +77 -1
- package/dist/Button.js +1 -1
- package/dist/PencilText.js +8 -0
- package/dist/form/Textarea.d.ts +4 -0
- package/dist/form/Textarea.js +14 -8
- package/dist/form/index.d.ts +1 -1
- package/dist/form/textareaSizing.d.ts +29 -0
- package/dist/form/textareaSizing.js +153 -0
- package/dist/i18n/catalog.d.ts +1 -1
- package/dist/i18n/catalog.js +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/inventory-grid/index.d.ts +35 -0
- package/dist/inventory-grid/index.js +205 -0
- package/dist/inventory-grid/model.d.ts +56 -0
- package/dist/inventory-grid/model.js +93 -0
- package/dist/layout/GridBoard.d.ts +22 -0
- package/dist/layout/GridBoard.js +113 -0
- package/dist/layout/GridResizable.d.ts +31 -0
- package/dist/layout/GridResizable.js +35 -0
- package/dist/layout/index.d.ts +19 -4
- package/dist/layout/index.js +45 -9
- package/dist/layout/swipeNavigation.d.ts +15 -0
- package/dist/layout/swipeNavigation.js +121 -0
- package/dist/pagination/index.d.ts +17 -0
- package/dist/pagination/index.js +30 -6
- package/dist/styles/base.css +9 -1
- package/dist/styles/form.css +10 -0
- package/dist/styles/inventory-grid.css +31 -0
- package/dist/styles/layout.css +85 -0
- package/dist/styles/pagination.css +10 -0
- package/dist/styles.css +146 -1
- package/package.json +8 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
const ignored = 'input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="slider"], [role="spinbutton"], [role="combobox"], [role="separator"], [role="listbox"], video, audio, [data-layout-swipe-ignore]';
|
|
2
|
+
const positive = (value, fallback) => value !== undefined && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
3
|
+
// Listen only for the lifetime of one edge/closing gesture. Vertical scroll and
|
|
4
|
+
// nested horizontal tools keep their native behavior; no global touch-action override.
|
|
5
|
+
export function createLayoutSwipeNavigation(read) {
|
|
6
|
+
let cancel = () => { };
|
|
7
|
+
let clearClick = () => { };
|
|
8
|
+
function start(event, root) {
|
|
9
|
+
clearClick();
|
|
10
|
+
cancel();
|
|
11
|
+
const options = read();
|
|
12
|
+
const view = root.ownerDocument.defaultView;
|
|
13
|
+
if (!options || options.enabled === false || !view || event.defaultPrevented || event.touches.length !== 1)
|
|
14
|
+
return;
|
|
15
|
+
const target = event.target;
|
|
16
|
+
if (!target?.closest || target.closest(ignored) || target.closest('.inkra-layout') !== root)
|
|
17
|
+
return;
|
|
18
|
+
for (let node = target; node && node !== root; node = node.parentElement) {
|
|
19
|
+
if (node.scrollWidth > node.clientWidth + 1 && /auto|scroll/.test(view.getComputedStyle(node).overflowX))
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const rect = root.getBoundingClientRect();
|
|
23
|
+
if (!rect.width || !root.clientWidth)
|
|
24
|
+
return;
|
|
25
|
+
const scale = root.clientWidth / rect.width;
|
|
26
|
+
const touch = event.touches[0];
|
|
27
|
+
const rtl = view.getComputedStyle(root).direction === 'rtl';
|
|
28
|
+
const right = (options.side === 'end') !== rtl;
|
|
29
|
+
const edge = Math.min(root.clientWidth / 2, positive(options.edgeWidth, 24));
|
|
30
|
+
const startX = (touch.clientX - rect.left) * scale;
|
|
31
|
+
if (!options.open && (right ? root.clientWidth - startX : startX) > edge)
|
|
32
|
+
return;
|
|
33
|
+
const direction = (right ? -1 : 1) * (options.open ? -1 : 1);
|
|
34
|
+
const threshold = positive(options.threshold, 48);
|
|
35
|
+
const doc = root.ownerDocument;
|
|
36
|
+
let locked = false;
|
|
37
|
+
let stopped = false;
|
|
38
|
+
let travel = 0;
|
|
39
|
+
const suppressClick = () => {
|
|
40
|
+
clearClick();
|
|
41
|
+
const block = (click) => {
|
|
42
|
+
if (!click.detail || ('pointerType' in click && click.pointerType !== 'touch'))
|
|
43
|
+
return;
|
|
44
|
+
click.preventDefault();
|
|
45
|
+
click.stopImmediatePropagation();
|
|
46
|
+
clearClick();
|
|
47
|
+
};
|
|
48
|
+
root.addEventListener('click', block, { capture: true });
|
|
49
|
+
const timer = view.setTimeout(() => clearClick(), 700);
|
|
50
|
+
clearClick = () => {
|
|
51
|
+
root.removeEventListener('click', block, { capture: true });
|
|
52
|
+
view.clearTimeout(timer);
|
|
53
|
+
clearClick = () => { };
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const cleanup = () => {
|
|
57
|
+
stopped = true;
|
|
58
|
+
doc.removeEventListener('touchstart', multi);
|
|
59
|
+
doc.removeEventListener('touchmove', move);
|
|
60
|
+
doc.removeEventListener('touchend', end);
|
|
61
|
+
doc.removeEventListener('touchcancel', abort);
|
|
62
|
+
view.removeEventListener('blur', abort);
|
|
63
|
+
if (locked)
|
|
64
|
+
suppressClick();
|
|
65
|
+
cancel = () => { };
|
|
66
|
+
};
|
|
67
|
+
const valid = () => {
|
|
68
|
+
const next = read();
|
|
69
|
+
return root.isConnected && next && next.enabled !== false && next.open === options.open
|
|
70
|
+
&& (next.side ?? 'start') === (options.side ?? 'start')
|
|
71
|
+
&& (view.getComputedStyle(root).direction === 'rtl') === rtl
|
|
72
|
+
&& Math.abs(root.getBoundingClientRect().width - rect.width) < 1;
|
|
73
|
+
};
|
|
74
|
+
const abort = () => cleanup();
|
|
75
|
+
const multi = (next) => { if (next.touches.length !== 1)
|
|
76
|
+
cleanup(); };
|
|
77
|
+
const move = (next) => {
|
|
78
|
+
if (stopped)
|
|
79
|
+
return;
|
|
80
|
+
const point = Array.from(next.touches).find(item => item.identifier === touch.identifier);
|
|
81
|
+
if (!valid() || next.defaultPrevented || next.touches.length !== 1 || !point) {
|
|
82
|
+
cleanup();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const dx = (point.clientX - touch.clientX) * scale;
|
|
86
|
+
const dy = (point.clientY - touch.clientY) * scale;
|
|
87
|
+
if (!locked) {
|
|
88
|
+
if (Math.max(Math.abs(dx), Math.abs(dy)) < 8)
|
|
89
|
+
return;
|
|
90
|
+
if (dx * direction <= 0 || Math.abs(dx) < Math.abs(dy) * 1.25) {
|
|
91
|
+
cleanup();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (!next.cancelable) {
|
|
96
|
+
cleanup();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
locked = true;
|
|
100
|
+
travel = Math.abs(dx) >= Math.abs(dy) * 1.25 ? dx * direction : 0;
|
|
101
|
+
next.preventDefault();
|
|
102
|
+
};
|
|
103
|
+
const end = (next) => {
|
|
104
|
+
const point = Array.from(next.changedTouches).find(item => item.identifier === touch.identifier);
|
|
105
|
+
const dx = point ? (point.clientX - touch.clientX) * scale : 0;
|
|
106
|
+
const dy = point ? (point.clientY - touch.clientY) * scale : 0;
|
|
107
|
+
const commit = !next.defaultPrevented && next.touches.length === 0 && valid() && locked
|
|
108
|
+
&& point && travel >= threshold && dx * direction >= threshold && Math.abs(dx) >= Math.abs(dy) * 1.25;
|
|
109
|
+
cleanup();
|
|
110
|
+
if (commit)
|
|
111
|
+
read()?.onOpenChange(!options.open);
|
|
112
|
+
};
|
|
113
|
+
doc.addEventListener('touchstart', multi, { passive: true });
|
|
114
|
+
doc.addEventListener('touchmove', move, { passive: false });
|
|
115
|
+
doc.addEventListener('touchend', end);
|
|
116
|
+
doc.addEventListener('touchcancel', abort);
|
|
117
|
+
view.addEventListener('blur', abort);
|
|
118
|
+
cancel = cleanup;
|
|
119
|
+
}
|
|
120
|
+
return { start, cancel: () => cancel(), dispose: () => { cancel(); clearClick(); } };
|
|
121
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { ButtonVariant } from '../Button.js';
|
|
2
3
|
export interface PaginationLabels {
|
|
3
4
|
nav: string;
|
|
4
5
|
first: string;
|
|
@@ -7,6 +8,8 @@ export interface PaginationLabels {
|
|
|
7
8
|
last: string;
|
|
8
9
|
page: (page: number) => string;
|
|
9
10
|
ellipsis: string;
|
|
11
|
+
pageSize?: string;
|
|
12
|
+
pageSizeOption?: (pageSize: number) => string;
|
|
10
13
|
}
|
|
11
14
|
export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'children' | 'onChange'> {
|
|
12
15
|
totalPages: number;
|
|
@@ -28,5 +31,19 @@ export interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, 'chil
|
|
|
28
31
|
disabled?: boolean;
|
|
29
32
|
size?: 'sm' | 'md' | 'lg';
|
|
30
33
|
labels?: Partial<PaginationLabels>;
|
|
34
|
+
/** Appearance of numbered and boundary buttons; defaults to ghost. */
|
|
35
|
+
variant?: ButtonVariant;
|
|
36
|
+
/** Logical alignment of the size selector and page controls. */
|
|
37
|
+
align?: 'start' | 'center' | 'end';
|
|
38
|
+
/** Wrap page controls instead of scrolling them horizontally. */
|
|
39
|
+
wrap?: boolean;
|
|
40
|
+
/** Controlled positive safe-integer page size. Does not paginate caller data. */
|
|
41
|
+
pageSize?: number;
|
|
42
|
+
/** Initial uncontrolled page size; defaults to 10. */
|
|
43
|
+
defaultPageSize?: number;
|
|
44
|
+
/** Enable the size selector with positive safe integers; invalid entries are ignored. */
|
|
45
|
+
pageSizeOptions?: readonly number[];
|
|
46
|
+
/** Requests a page size, then requests page 1 when the current page is above 1. */
|
|
47
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
31
48
|
}
|
|
32
49
|
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
package/dist/pagination/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useInkraLocale } from '../i18n/index.js';
|
|
3
3
|
import { forwardRef, useEffect, useState } from 'react';
|
|
4
4
|
import { Button } from '../Button.js';
|
|
5
|
+
import { Select } from '../select/index.js';
|
|
5
6
|
import { PencilIcon } from '../PencilIcon.js';
|
|
6
7
|
import { PencilSurface } from '../PencilSurface.js';
|
|
7
8
|
import { PencilText } from '../PencilText.js';
|
|
@@ -9,12 +10,20 @@ import { clampPage, getPaginationEntries, normalizeTotal } from './model.js';
|
|
|
9
10
|
const defaultLabels = (t) => ({
|
|
10
11
|
nav: t('pagination.nav'), first: t('pagination.first'), previous: t('common.previousPage'), next: t('common.nextPage'), last: t('pagination.last'),
|
|
11
12
|
page: page => t('pagination.page', { page }), ellipsis: t('pagination.more'),
|
|
13
|
+
pageSize: t('pagination.pageSize'), pageSizeOption: pageSize => t('pagination.pageSizeOption', { pageSize }),
|
|
12
14
|
});
|
|
13
|
-
export const Pagination = forwardRef(function Pagination({ totalPages, page, defaultPage = 1, onPageChange, siblingCount = 1, boundaryCount = 1, showFirstLast = false, showPreviousNext = true, hideOnSinglePage = false, simple = false, renderPage, renderSummary, disabled = false, size = 'md', labels, className, ...props }, ref) {
|
|
15
|
+
export const Pagination = forwardRef(function Pagination({ totalPages, page, defaultPage = 1, onPageChange, siblingCount = 1, boundaryCount = 1, showFirstLast = false, showPreviousNext = true, hideOnSinglePage = false, simple = false, renderPage, renderSummary, disabled = false, size = 'md', labels, className, variant = 'ghost', align = 'start', wrap = false, pageSize, defaultPageSize = 10, pageSizeOptions, onPageSizeChange, ...props }, ref) {
|
|
14
16
|
const { t } = useInkraLocale();
|
|
15
17
|
const total = normalizeTotal(totalPages);
|
|
16
18
|
const [internalPage, setInternalPage] = useState(() => clampPage(defaultPage, total));
|
|
17
19
|
const current = clampPage(page ?? internalPage, total);
|
|
20
|
+
const [internalPageSize, setInternalPageSize] = useState(() => normalizePageSize(defaultPageSize) ?? 10);
|
|
21
|
+
const currentPageSize = normalizePageSize(pageSize ?? internalPageSize) ?? 10;
|
|
22
|
+
const sizeOptions = [...new Set((pageSizeOptions ?? []).filter(value => normalizePageSize(value) !== undefined))];
|
|
23
|
+
if (sizeOptions.length && !sizeOptions.includes(currentPageSize))
|
|
24
|
+
sizeOptions.push(currentPageSize);
|
|
25
|
+
sizeOptions.sort((left, right) => left - right);
|
|
26
|
+
const showPages = !hideOnSinglePage || total > 1;
|
|
18
27
|
const text = { ...defaultLabels(t), ...labels };
|
|
19
28
|
useEffect(() => {
|
|
20
29
|
if (page === undefined)
|
|
@@ -28,6 +37,18 @@ export const Pagination = forwardRef(function Pagination({ totalPages, page, def
|
|
|
28
37
|
setInternalPage(target);
|
|
29
38
|
onPageChange?.(target);
|
|
30
39
|
}
|
|
40
|
+
function selectPageSize(value) {
|
|
41
|
+
const next = normalizePageSize(Number(value));
|
|
42
|
+
if (disabled || next === undefined || !sizeOptions.includes(next) || next === currentPageSize)
|
|
43
|
+
return;
|
|
44
|
+
if (pageSize === undefined)
|
|
45
|
+
setInternalPageSize(next);
|
|
46
|
+
if (page === undefined)
|
|
47
|
+
setInternalPage(clampPage(1, total));
|
|
48
|
+
onPageSizeChange?.(next);
|
|
49
|
+
if (current > 1)
|
|
50
|
+
onPageChange?.(1);
|
|
51
|
+
}
|
|
31
52
|
const arrow = (kind, target, unavailable) => {
|
|
32
53
|
const backwards = kind === 'first' || kind === 'previous';
|
|
33
54
|
const paths = [{ d: backwards ? 'm15 18-6-6 6-6' : 'm9 18 6-6-6-6' }];
|
|
@@ -35,11 +56,14 @@ export const Pagination = forwardRef(function Pagination({ totalPages, page, def
|
|
|
35
56
|
paths.push({ d: 'M5 6v12' });
|
|
36
57
|
if (kind === 'last')
|
|
37
58
|
paths.push({ d: 'M19 6v12' });
|
|
38
|
-
return _jsx("li", { children: _jsx(Button, { variant:
|
|
59
|
+
return _jsx("li", { children: _jsx(Button, { variant: variant, size: size === 'md' ? 'icon' : `icon-${size}`, "aria-label": text[kind], title: text[kind], disabled: disabled || unavailable, onClick: () => select(target), children: _jsx(PencilIcon, { className: "inkra-pagination__arrow", paths: paths, size: 20, sourceSize: 24 }) }) }, kind);
|
|
39
60
|
};
|
|
40
|
-
if (
|
|
61
|
+
if (!showPages && !sizeOptions.length)
|
|
41
62
|
return null;
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
63
|
+
return _jsxs("nav", { "aria-label": text.nav, ...props, ref: ref, className: ['inkra-pagination', className].filter(Boolean).join(' '), "data-empty": !total || undefined, "data-simple": simple || undefined, "data-align": align, "data-wrap": wrap || undefined, children: [sizeOptions.length > 0 && _jsx("div", { className: "inkra-pagination__size", children: _jsxs(Select.Root, { dir: props.dir === 'rtl' ? 'rtl' : props.dir === 'ltr' ? 'ltr' : undefined, value: String(currentPageSize), onValueChange: selectPageSize, disabled: disabled, children: [_jsx(Select.Trigger, { "aria-label": text.pageSize, size: size, fullWidth: false, children: _jsx(Select.Value, { children: _jsx(PencilText, { children: text.pageSizeOption(currentPageSize) }) }) }), _jsx(Select.Portal, { children: _jsx(Select.Content, { children: _jsx(Select.Viewport, { children: sizeOptions.map(value => _jsxs(Select.Item, { value: String(value), children: [_jsx(Select.ItemText, { children: text.pageSizeOption(value) }), _jsx(Select.ItemIndicator, {})] }, value)) }) }) })] }) }), showPages && _jsxs("ul", { className: "inkra-pagination__list", children: [showFirstLast && arrow('first', 1, current <= 1), showPreviousNext && arrow('previous', current - 1, current <= 1), simple ? _jsx("li", { className: "inkra-pagination__summary", "aria-live": "polite", "aria-atomic": "true", children: renderSummary ? renderSummary(current, total) : _jsx(PencilText, { children: `${current} / ${total}` }) }) : getPaginationEntries(total, current, siblingCount, boundaryCount).map(entry => typeof entry === 'number'
|
|
64
|
+
? _jsx("li", { className: "inkra-pagination__page-item", children: _jsxs(Button, { size: size, variant: variant, className: "inkra-pagination__page", "aria-label": text.page(entry), "aria-current": entry === current ? 'page' : undefined, disabled: disabled, onClick: () => select(entry), children: [entry === current && _jsx(PencilSurface, { as: "span", "aria-hidden": "true", variant: "selection", className: "inkra-pagination__selection", seed: `page-${entry}` }), renderPage ? renderPage(entry, { isCurrent: entry === current }) : _jsx(PencilText, { children: String(entry) })] }) }, entry)
|
|
65
|
+
: _jsxs("li", { className: "inkra-pagination__ellipsis", children: [_jsx("span", { className: "inkra-pagination__sr-only", children: text.ellipsis }), _jsx(PencilText, { "aria-hidden": "true", children: "..." })] }, entry)), showPreviousNext && arrow('next', current + 1, !total || current >= total), showFirstLast && arrow('last', total, !total || current >= total)] })] });
|
|
45
66
|
});
|
|
67
|
+
function normalizePageSize(value) {
|
|
68
|
+
return Number.isSafeInteger(value) && value > 0 ? value : undefined;
|
|
69
|
+
}
|
package/dist/styles/base.css
CHANGED
|
@@ -373,6 +373,14 @@
|
|
|
373
373
|
opacity: 0;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
.inkra-button[data-variant="ghost"] > .inkra-button__surface > .inkra-pencil-surface__border {
|
|
377
|
+
display: none;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.inkra-button[data-variant="ghost"] > .inkra-button__surface > .inkra-pencil-surface__content {
|
|
381
|
+
clip-path: none;
|
|
382
|
+
}
|
|
383
|
+
|
|
376
384
|
.inkra-button[data-variant="ghost"]:hover:not(:disabled):not([aria-disabled="true"])
|
|
377
385
|
.inkra-button__surface > .inkra-pencil-surface__ink,
|
|
378
386
|
.inkra-button[data-variant="ghost"]:focus-visible
|
|
@@ -391,7 +399,7 @@
|
|
|
391
399
|
.inkra-button[data-variant="ghost"]:focus-visible
|
|
392
400
|
.inkra-button__surface[data-pencil-fallback="true"] {
|
|
393
401
|
background: var(--inkra-surface-muted);
|
|
394
|
-
border-color:
|
|
402
|
+
border-color: transparent;
|
|
395
403
|
}
|
|
396
404
|
|
|
397
405
|
.inkra-button[data-variant="link"] .inkra-button__label {
|
package/dist/styles/form.css
CHANGED
|
@@ -228,6 +228,16 @@
|
|
|
228
228
|
resize: none;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
/* Native rows establish the initial editor height; counters remain a separate row. */
|
|
232
|
+
.inkra-field-control-hit--textarea[data-row-sizing="true"] .inkra-field-control--textarea {
|
|
233
|
+
min-height: 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.inkra-field-control-hit--textarea[data-row-sizing="true"] .inkra-textarea {
|
|
237
|
+
flex: none;
|
|
238
|
+
min-height: 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
231
241
|
.inkra-textarea__footer {
|
|
232
242
|
display: flex;
|
|
233
243
|
align-items: center;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.inkra-inventory-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; min-width: 0; max-width: 100%; color: var(--inkra-ink); }
|
|
2
|
+
.inkra-inventory-grid__container { min-width: 0; max-width: 100%; }
|
|
3
|
+
.inkra-inventory-grid__header { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 8px; padding-bottom: 8px; }
|
|
4
|
+
.inkra-inventory-grid__scroll { max-width: 100%; overflow: auto; padding: 4px; }
|
|
5
|
+
.inkra-inventory-grid__board { position: relative; isolation: isolate; direction: ltr; }
|
|
6
|
+
.inkra-inventory-grid__lines { position: absolute; inset: 0; color: var(--inkra-border); pointer-events: none; }
|
|
7
|
+
.inkra-inventory-grid__lines > canvas { position: absolute; }
|
|
8
|
+
.inkra-inventory-grid__item, .inkra-inventory-grid__preview, .inkra-inventory-grid__cell, .inkra-inventory-grid__blocked { position: absolute; }
|
|
9
|
+
.inkra-inventory-grid__item { outline: none; pointer-events: none; }
|
|
10
|
+
.inkra-inventory-grid__cell { box-sizing: border-box; display: grid; place-items: center; pointer-events: auto; touch-action: none; cursor: grab; }
|
|
11
|
+
.inkra-inventory-grid__cell-surface { position: absolute; inset: 2px; pointer-events: none; }
|
|
12
|
+
.inkra-inventory-grid__item-content { position: relative; z-index: 1; padding: 4px; max-width: 100%; max-height: 100%; overflow: hidden; pointer-events: none; font-size: 13px; overflow-wrap: anywhere; text-align: center; }
|
|
13
|
+
.inkra-inventory-grid__item[data-selected] .inkra-inventory-grid__cell-surface { color: var(--inkra-accent-strong); }
|
|
14
|
+
.inkra-inventory-grid__cell-focus { position: absolute; inset: 3px; pointer-events: none; opacity: 0; color: var(--inkra-focus); }
|
|
15
|
+
.inkra-inventory-grid__item:focus-visible .inkra-inventory-grid__cell-focus { opacity: 1; }
|
|
16
|
+
.inkra-inventory-grid__item[data-dragging] { opacity: .28; }
|
|
17
|
+
.inkra-inventory-grid__item[data-disabled] .inkra-inventory-grid__cell { cursor: default; touch-action: auto; }
|
|
18
|
+
.inkra-inventory-grid__container[data-disabled], .inkra-inventory-grid[data-disabled] { opacity: .55; }
|
|
19
|
+
.inkra-inventory-grid__preview { z-index: 2; pointer-events: none; color: var(--inkra-accent-strong); }
|
|
20
|
+
.inkra-inventory-grid__preview[data-valid="false"] { color: var(--inkra-danger); }
|
|
21
|
+
.inkra-inventory-grid__preview[data-valid="false"] .inkra-inventory-grid__cell { outline: 2px solid var(--inkra-danger); outline-offset: -4px; }
|
|
22
|
+
.inkra-inventory-grid__preview .inkra-inventory-grid__cell, .inkra-inventory-grid__overlay .inkra-inventory-grid__cell { pointer-events: none; }
|
|
23
|
+
.inkra-inventory-grid__overlay { position: relative; opacity: .8; pointer-events: none; color: var(--inkra-ink); }
|
|
24
|
+
.inkra-inventory-grid__blocked { display: grid; place-items: center; color: var(--inkra-ink-muted); pointer-events: none; }
|
|
25
|
+
.inkra-inventory-grid__announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
26
|
+
@media (forced-colors: active) {
|
|
27
|
+
.inkra-inventory-grid__board { border: 1px solid CanvasText; }
|
|
28
|
+
.inkra-inventory-grid__cell { border: 1px solid CanvasText; background: Canvas; }
|
|
29
|
+
.inkra-inventory-grid__item:focus-visible .inkra-inventory-grid__cell { outline: 2px solid Highlight; outline-offset: -3px; }
|
|
30
|
+
.inkra-inventory-grid__preview .inkra-inventory-grid__cell { border: 3px solid Highlight; }
|
|
31
|
+
}
|
package/dist/styles/layout.css
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
.inkra-layout,
|
|
5
5
|
.inkra-layout__body,
|
|
6
6
|
.inkra-layout__header,
|
|
7
|
+
.inkra-layout__header-sidebar,
|
|
8
|
+
.inkra-layout__header-content,
|
|
7
9
|
.inkra-layout__sidebar,
|
|
8
10
|
.inkra-layout__content,
|
|
9
11
|
.inkra-layout__footer {
|
|
@@ -37,6 +39,33 @@
|
|
|
37
39
|
.inkra-layout__body { display: flex; flex: 1; align-items: stretch; }
|
|
38
40
|
.inkra-layout__header,
|
|
39
41
|
.inkra-layout__footer { position: relative; flex: none; }
|
|
42
|
+
.inkra-layout__header[data-shared-sidebar] { display: flex; align-items: stretch; }
|
|
43
|
+
.inkra-layout__header-sidebar,
|
|
44
|
+
.inkra-layout__header-content {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
padding: var(--inkra-layout-header-padding, 20px);
|
|
48
|
+
overflow-wrap: anywhere;
|
|
49
|
+
}
|
|
50
|
+
.inkra-layout__header-sidebar {
|
|
51
|
+
position: relative;
|
|
52
|
+
flex: 0 0 min(var(--inkra-layout-shared-sidebar-width, 240px), 100%);
|
|
53
|
+
max-width: 100%;
|
|
54
|
+
}
|
|
55
|
+
.inkra-layout__header-content { flex: 1; }
|
|
56
|
+
.inkra-layout__header-content > * { min-width: 0; }
|
|
57
|
+
.inkra-layout__header-sidebar-divider[data-orientation="vertical"] {
|
|
58
|
+
position: absolute;
|
|
59
|
+
inset-block-start: 50%;
|
|
60
|
+
inset-inline-end: 0;
|
|
61
|
+
height: min(32px, max(0px, calc(100% - 2 * var(--inkra-layout-header-padding, 20px))));
|
|
62
|
+
color: var(--inkra-ink-muted);
|
|
63
|
+
opacity: 0.56;
|
|
64
|
+
transform: translate(50%, -50%);
|
|
65
|
+
}
|
|
66
|
+
.inkra-layout__header-sidebar-divider[data-orientation="vertical"]:dir(rtl) { transform: translate(-50%, -50%); }
|
|
67
|
+
.inkra-layout__header-sidebar[hidden],
|
|
68
|
+
.inkra-layout__sidebar[hidden] { display: none; }
|
|
40
69
|
.inkra-layout__sidebar {
|
|
41
70
|
position: relative;
|
|
42
71
|
flex: 0 0 min(var(--inkra-layout-sidebar-width, 240px), 100%);
|
|
@@ -55,6 +84,9 @@
|
|
|
55
84
|
}
|
|
56
85
|
.inkra-layout__sidebar-divider-mobile { display: none; }
|
|
57
86
|
@container inkra-layout (max-width: 639px) {
|
|
87
|
+
.inkra-layout[data-collapse-at="sm"] > .inkra-layout__header[data-shared-sidebar] { flex-direction: column; }
|
|
88
|
+
.inkra-layout[data-collapse-at="sm"] > .inkra-layout__header > .inkra-layout__header-sidebar { flex-basis: auto; width: 100%; }
|
|
89
|
+
.inkra-layout[data-collapse-at="sm"] > .inkra-layout__header > .inkra-layout__header-sidebar > .inkra-layout__header-sidebar-divider { display: none !important; }
|
|
58
90
|
.inkra-layout[data-collapse-at="sm"] > .inkra-layout__body { flex-direction: column; }
|
|
59
91
|
.inkra-layout[data-collapse-at="sm"] > .inkra-layout__body > .inkra-layout__sidebar { flex-basis: auto; width: 100%; }
|
|
60
92
|
.inkra-layout[data-collapse-at="sm"] > .inkra-layout__body > .inkra-layout__sidebar > .inkra-layout__sidebar-divider { display: none; }
|
|
@@ -63,6 +95,9 @@
|
|
|
63
95
|
}
|
|
64
96
|
}
|
|
65
97
|
@container inkra-layout (max-width: 767px) {
|
|
98
|
+
.inkra-layout[data-collapse-at="md"] > .inkra-layout__header[data-shared-sidebar] { flex-direction: column; }
|
|
99
|
+
.inkra-layout[data-collapse-at="md"] > .inkra-layout__header > .inkra-layout__header-sidebar { flex-basis: auto; width: 100%; }
|
|
100
|
+
.inkra-layout[data-collapse-at="md"] > .inkra-layout__header > .inkra-layout__header-sidebar > .inkra-layout__header-sidebar-divider { display: none !important; }
|
|
66
101
|
.inkra-layout[data-collapse-at="md"] > .inkra-layout__body { flex-direction: column; }
|
|
67
102
|
.inkra-layout[data-collapse-at="md"] > .inkra-layout__body > .inkra-layout__sidebar { flex-basis: auto; width: 100%; }
|
|
68
103
|
.inkra-layout[data-collapse-at="md"] > .inkra-layout__body > .inkra-layout__sidebar > .inkra-layout__sidebar-divider { display: none; }
|
|
@@ -70,3 +105,53 @@
|
|
|
70
105
|
display: block; position: absolute; bottom: -4px; inset-inline: 0; width: 100%;
|
|
71
106
|
}
|
|
72
107
|
}
|
|
108
|
+
@media (forced-colors: active), print {
|
|
109
|
+
.inkra-layout__header-sidebar-divider[data-orientation="vertical"] { opacity: 1; }
|
|
110
|
+
}
|
|
111
|
+
.inkra-grid-resizable,
|
|
112
|
+
.inkra-grid-resizable > .inkra-resizable,
|
|
113
|
+
.inkra-grid-resizable .inkra-resizable__panel > .inkra-resizable {
|
|
114
|
+
block-size: 100%;
|
|
115
|
+
min-inline-size: 0;
|
|
116
|
+
min-block-size: 0;
|
|
117
|
+
}
|
|
118
|
+
.inkra-grid-resizable__cell {
|
|
119
|
+
box-sizing: border-box;
|
|
120
|
+
block-size: 100%;
|
|
121
|
+
min-inline-size: 0;
|
|
122
|
+
overflow: auto;
|
|
123
|
+
}
|
|
124
|
+
.inkra-grid-board { min-inline-size: 0; inline-size: 100%; }
|
|
125
|
+
.inkra-grid-board__canvas { position: relative; min-inline-size: 0; }
|
|
126
|
+
.inkra-grid-board__item { position: absolute; transition: transform var(--inkra-motion-fast) var(--inkra-ease); }
|
|
127
|
+
.inkra-grid-board__item.resizing,
|
|
128
|
+
.inkra-grid-board__item.react-draggable-dragging { transition: none; z-index: 2; }
|
|
129
|
+
.inkra-grid-board__surface { box-sizing: border-box; display: flex; flex-direction: column; block-size: 100%; min-inline-size: 0; }
|
|
130
|
+
.inkra-grid-board__surface > .inkra-pencil-surface__content { display: flex; flex-direction: column; block-size: 100%; min-block-size: 0; }
|
|
131
|
+
.inkra-grid-board__header { display: flex; flex-shrink: 0; align-items: center; gap: 8px; min-block-size: 44px; padding-inline: 12px 4px; }
|
|
132
|
+
.inkra-grid-board__title { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
133
|
+
.inkra-grid-board__content { padding: 4px 12px 24px; min-block-size: 0; overflow: auto; flex: 1; }
|
|
134
|
+
.inkra-grid-board__move,
|
|
135
|
+
.inkra-grid-board__resize {
|
|
136
|
+
appearance: none; border: 0; background: transparent; color: var(--inkra-ink-muted);
|
|
137
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
138
|
+
inline-size: 44px; block-size: 44px; padding: 0; flex: 0 0 44px;
|
|
139
|
+
}
|
|
140
|
+
.inkra-grid-board__move { cursor: grab; touch-action: none; position: relative; }
|
|
141
|
+
.inkra-grid-board__resize { position: absolute; right: 0; bottom: 0; cursor: se-resize; touch-action: none; z-index: 1; }
|
|
142
|
+
.inkra-grid-board__move:hover,
|
|
143
|
+
.inkra-grid-board__resize:hover { color: var(--inkra-accent-strong); }
|
|
144
|
+
.inkra-grid-board__move:focus-visible,
|
|
145
|
+
.inkra-grid-board__resize:focus-visible { outline: none; }
|
|
146
|
+
.inkra-grid-board__focus { position: absolute; inset: 4px; opacity: 0; pointer-events: none; }
|
|
147
|
+
.inkra-grid-board__move:focus-visible .inkra-grid-board__focus,
|
|
148
|
+
.inkra-grid-board__resize:focus-visible .inkra-grid-board__focus { opacity: 1; }
|
|
149
|
+
.inkra-grid-board__item.react-resizable-hide > .inkra-grid-board__resize { display: none; }
|
|
150
|
+
.inkra-grid-board[data-stacked] .inkra-grid-board__canvas { display: grid; gap: var(--inkra-grid-board-gap); }
|
|
151
|
+
.inkra-grid-board[data-stacked] .inkra-grid-board__item { position: relative !important; transform: none !important; top: auto !important; left: auto !important; width: 100% !important; height: auto !important; min-block-size: 160px; }
|
|
152
|
+
.inkra-grid-board[data-stacked] .inkra-grid-board__resize { display: none; }
|
|
153
|
+
@media (prefers-reduced-motion: reduce) { .inkra-grid-board__item { transition: none; } }
|
|
154
|
+
@media (forced-colors: active) {
|
|
155
|
+
.inkra-grid-board__focus { display: none; }
|
|
156
|
+
.inkra-grid-board__move:focus-visible, .inkra-grid-board__resize:focus-visible { outline: 2px solid Highlight; outline-offset: -4px; }
|
|
157
|
+
}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
.inkra-pagination { min-inline-size: 0; max-inline-size: 100%; color: var(--inkra-ink); }
|
|
2
|
+
.inkra-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--inkra-space-2); }
|
|
3
|
+
.inkra-pagination[data-align="start"] { justify-content: flex-start; }
|
|
4
|
+
.inkra-pagination[data-align="center"] { justify-content: center; }
|
|
5
|
+
.inkra-pagination[data-align="end"] { justify-content: flex-end; }
|
|
6
|
+
.inkra-pagination__size { flex: 0 1 auto; min-inline-size: 0; max-inline-size: 100%; }
|
|
7
|
+
.inkra-pagination__size .inkra-select__trigger { max-inline-size: 100%; }
|
|
8
|
+
.inkra-pagination__list { min-inline-size: 0; }
|
|
9
|
+
.inkra-pagination[data-wrap="true"] .inkra-pagination__list { flex-wrap: wrap; }
|
|
10
|
+
.inkra-pagination[data-wrap="true"][data-align="center"] .inkra-pagination__list { justify-content: center; }
|
|
11
|
+
.inkra-pagination[data-wrap="true"][data-align="end"] .inkra-pagination__list { justify-content: flex-end; }
|
|
2
12
|
.inkra-pagination__list { box-sizing: border-box; display: flex; flex-wrap: nowrap; align-items: center; gap: var(--inkra-space-1); max-inline-size: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scroll-padding-inline: 8px; list-style: none; padding: 8px; margin: 0; }
|
|
3
13
|
.inkra-pagination__list > li { display: flex; flex: 0 0 auto; }
|
|
4
14
|
.inkra-pagination__summary { align-items: center; box-sizing: border-box; font-variant-numeric: tabular-nums; justify-content: center; max-inline-size: 100%; min-block-size: var(--inkra-touch-target); min-inline-size: 0; overflow-wrap: anywhere; padding-inline: var(--inkra-space-2); text-align: center; white-space: normal; }
|