@wirecore/wirelayer-native 0.8.2 → 0.9.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/dist/components/Drawer/Drawer.d.ts +11 -1
- package/dist/components/Drawer/Drawer.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.js +6 -5
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.d.ts +8 -2
- package/dist/components/NotificationCenter/NotificationCenter.d.ts.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.js +2 -2
- package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -1
- package/dist/utils/Sheet.d.ts +5 -1
- package/dist/utils/Sheet.d.ts.map +1 -1
- package/dist/utils/Sheet.js +2 -2
- package/dist/utils/Sheet.js.map +1 -1
- package/llms-full.txt +62 -6
- package/llms.txt +1 -0
- package/package.json +3 -3
|
@@ -4,7 +4,17 @@ export interface DrawerProps {
|
|
|
4
4
|
open: boolean;
|
|
5
5
|
onOpenChange: (open: boolean) => void;
|
|
6
6
|
title: string;
|
|
7
|
+
/**
|
|
8
|
+
* The title only for screen readers – it still names the drawer. With `header` this is the default; `false` shows
|
|
9
|
+
* the title next to the header content
|
|
10
|
+
*/
|
|
11
|
+
hideTitle?: boolean;
|
|
7
12
|
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Own content in the header row, before the close button – e.g. the logo of the app; the title then only names
|
|
15
|
+
* the drawer for screen readers (unless `hideTitle` is `false`)
|
|
16
|
+
*/
|
|
17
|
+
header?: ReactNode;
|
|
8
18
|
/** Edge it slides in from: `bottom` (default, a sheet), `left`, `right` or `top` */
|
|
9
19
|
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
10
20
|
/** Width (left/right: 280–480 px) or height (top/bottom: 30–85 %); `full` covers the screen */
|
|
@@ -22,5 +32,5 @@ export interface DrawerProps {
|
|
|
22
32
|
* navigation. A modal with a title, any content and optional buttons; the back button, Escape (web) and a press
|
|
23
33
|
* outside close it. Without animation when reduced motion is on.
|
|
24
34
|
*/
|
|
25
|
-
export declare function Drawer({ open, onOpenChange, title, description, placement, size, closable, closeLabel, footer, children, }: DrawerProps): import("react").JSX.Element;
|
|
35
|
+
export declare function Drawer({ open, onOpenChange, title, hideTitle, description, header, placement, size, closable, closeLabel, footer, children, }: DrawerProps): import("react").JSX.Element;
|
|
26
36
|
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASnF,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAChD,+FAA+F;IAC/F,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACnB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,WAAW,EACX,SAAoB,EACpB,IAAI,EACJ,QAAe,EACf,UAAU,EACV,MAAM,EACN,QAAQ,GACX,EAAE,WAAW,+
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEzF,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASnF,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;IAChD,+FAA+F;IAC/F,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACnB,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,SAAS,EACT,WAAW,EACX,MAAM,EACN,SAAoB,EACpB,IAAI,EACJ,QAAe,EACf,UAAU,EACV,MAAM,EACN,QAAQ,GACX,EAAE,WAAW,+BAsCb"}
|
|
@@ -14,13 +14,14 @@ import { useReducedMotion } from '../../utils/useReducedMotion.js';
|
|
|
14
14
|
* navigation. A modal with a title, any content and optional buttons; the back button, Escape (web) and a press
|
|
15
15
|
* outside close it. Without animation when reduced motion is on.
|
|
16
16
|
*/
|
|
17
|
-
export function Drawer({ open, onOpenChange, title, description, placement = 'bottom', size, closable = true, closeLabel, footer, children, }) {
|
|
17
|
+
export function Drawer({ open, onOpenChange, title, hideTitle, description, header, placement = 'bottom', size, closable = true, closeLabel, footer, children, }) {
|
|
18
18
|
const translations = useTranslations();
|
|
19
|
+
const titleHidden = hideTitle ?? (header !== undefined && header !== null && header !== false);
|
|
19
20
|
if (placement === 'bottom')
|
|
20
|
-
return (_jsx(Sheet, { open: open, onClose: () => onOpenChange(false), title: title, description: description, closeLabel: closeLabel ?? translations.common.close, footer: footer, closable: closable, className: size ? sheetSize({ size }) : undefined, focusClose: true, children: children }));
|
|
21
|
-
return (_jsx(SidePanel, { open: open, onClose: () => onOpenChange(false), title: title, description: description, placement: placement, size: size, closable: closable, closeLabel: closeLabel ?? translations.common.close, footer: footer, children: children }));
|
|
21
|
+
return (_jsx(Sheet, { open: open, onClose: () => onOpenChange(false), title: title, hideTitle: titleHidden, header: header, description: description, closeLabel: closeLabel ?? translations.common.close, footer: footer, closable: closable, className: size ? sheetSize({ size }) : undefined, focusClose: true, children: children }));
|
|
22
|
+
return (_jsx(SidePanel, { open: open, onClose: () => onOpenChange(false), title: title, hideTitle: titleHidden, header: header, description: description, placement: placement, size: size, closable: closable, closeLabel: closeLabel ?? translations.common.close, footer: footer, children: children }));
|
|
22
23
|
}
|
|
23
|
-
function SidePanel({ open, onClose, title, description, placement, size, closable, closeLabel, footer, children, }) {
|
|
24
|
+
function SidePanel({ open, onClose, title, hideTitle, header, description, placement, size, closable, closeLabel, footer, children, }) {
|
|
24
25
|
const styles = drawer({ placement, size });
|
|
25
26
|
const reducedMotion = useReducedMotion();
|
|
26
27
|
const id = useId();
|
|
@@ -43,6 +44,6 @@ function SidePanel({ open, onClose, title, description, placement, size, closabl
|
|
|
43
44
|
slideIn();
|
|
44
45
|
if (Platform.OS === 'web')
|
|
45
46
|
closeButton.current?.focus();
|
|
46
|
-
}, statusBarTranslucent: true, children: _jsxs(View, { className: styles.backdrop(), children: [_jsx(Pressable, { className: styles.dismissArea(), onPress: onClose, "aria-hidden": true, tabIndex: -1 }), _jsxs(Animated.View, { role: "dialog", "aria-modal": true,
|
|
47
|
+
}, statusBarTranslucent: true, children: _jsxs(View, { className: styles.backdrop(), children: [_jsx(Pressable, { className: styles.dismissArea(), onPress: onClose, "aria-hidden": true, tabIndex: -1 }), _jsxs(Animated.View, { role: "dialog", "aria-modal": true, ...(hideTitle ? { 'aria-label': title } : { 'aria-labelledby': `${id}title` }), ...{ 'aria-describedby': description ? `${id}description` : undefined }, accessibilityViewIsModal: true, className: styles.panel(), style: { transform }, children: [_jsxs(View, { className: styles.header(), children: [header !== undefined && header !== null && header !== false && (_jsx(View, { className: styles.headerContent(), children: header })), !hideTitle && (_jsx(Text, { nativeID: `${id}title`, role: "heading", className: styles.title(), children: title })), closable && (_jsx(Pressable, { ref: closeButton, role: "button", className: styles.close(), "aria-label": closeLabel, onPress: onClose, children: _jsx(Icon, { icon: X, className: styles.closeIcon() }) }))] }), description && (_jsx(Text, { nativeID: `${id}description`, className: styles.description(), children: description })), _jsx(ScrollView, { contentContainerClassName: styles.body(), keyboardShouldPersistTaps: "handled", children: children }), footer && _jsx(View, { className: styles.footer(), children: footer })] })] }) }));
|
|
47
48
|
}
|
|
48
49
|
//# sourceMappingURL=Drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAoB,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAqC,MAAM,OAAO,CAAC;AACnF,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAi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AC,SAAS,IACN,GAAG,EAAE,WAAW,EAChB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,gBACb,UAAU,EACtB,OAAO,EAAE,OAAO,YAEhB,KAAC,IAAI,IAAC,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,GAAI,GACxC,CACf,IACE,EACN,WAAW,IAAI,CACZ,KAAC,IAAI,IAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE,YAC9D,WAAW,GACT,CACV,EACD,KAAC,UAAU,IAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,yBAAyB,EAAC,SAAS,YACpF,QAAQ,GACA,EACZ,MAAM,IAAI,KAAC,IAAI,IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,YAAG,MAAM,GAAQ,IAChD,IACb,GACH,CACX,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DataSource } from '@wirecore/wirelayer-recipes/native';
|
|
1
|
+
import { type ButtonColor, type DataSource, type IconButtonVariant, type Size } from '@wirecore/wirelayer-recipes/native';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
3
|
import { type IconComponent } from '../../utils/Icon.js';
|
|
4
4
|
export interface NotificationItem {
|
|
@@ -28,6 +28,12 @@ export interface NotificationCenterProps {
|
|
|
28
28
|
onOpenChange?: (open: boolean) => void;
|
|
29
29
|
/** Name of the bell and title of the sheet (default "Notifications") */
|
|
30
30
|
label?: string;
|
|
31
|
+
/** Look of the bell (IconButton `variant`), e.g. `outline` next to other outlined buttons in a header */
|
|
32
|
+
variant?: IconButtonVariant;
|
|
33
|
+
/** Colour of the bell, combined with the variant (IconButton `color`) */
|
|
34
|
+
color?: ButtonColor;
|
|
35
|
+
/** Size of the bell (IconButton `size`) */
|
|
36
|
+
size?: Size;
|
|
31
37
|
/** Reference time for "Today"/"Yesterday" (default now) */
|
|
32
38
|
now?: Date | string;
|
|
33
39
|
/** Text without notifications */
|
|
@@ -46,5 +52,5 @@ export interface NotificationCenterProps {
|
|
|
46
52
|
* Bell with the unread count that opens the notifications in a sheet: grouped by day, unread marked (also as text),
|
|
47
53
|
* "Mark as read" per entry and for all, "Load more". Newly arrived unread ones are announced.
|
|
48
54
|
*/
|
|
49
|
-
export declare function NotificationCenter({ items, dataSource, pageSize, unreadCount, hasMore: hasMoreProp, loading: loadingProp, open: openProp, onOpenChange, label, now, emptyText, onMarkRead, onMarkAllRead, onLoadMore, onSelect, renderActions, }: NotificationCenterProps): import("react").JSX.Element;
|
|
55
|
+
export declare function NotificationCenter({ items, dataSource, pageSize, unreadCount, hasMore: hasMoreProp, loading: loadingProp, open: openProp, onOpenChange, label, variant, color, size, now, emptyText, onMarkRead, onMarkAllRead, onLoadMore, onSelect, renderActions, }: NotificationCenterProps): import("react").JSX.Element;
|
|
50
56
|
//# sourceMappingURL=NotificationCenter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCenter.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationCenter/NotificationCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"NotificationCenter.d.ts","sourceRoot":"","sources":["../../../src/components/NotificationCenter/NotificationCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUH,KAAK,WAAW,EAGhB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAO/D,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IA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AgB,KAAK,IAAI,CAAC;IAC5C,oCAAoC;IACpC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,SAAS,CAAC;CACzD;AAWD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAC/B,KAAU,EACV,UAAU,EACV,QAAa,EACb,WAAW,EACX,OAAO,EAAE,WAAmB,EAC5B,OAAO,EAAE,WAAmB,EAC5B,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,KAAK,EACL,OAAO,EACP,KAAK,EACL,IAAI,EACJ,GAAG,EACH,SAAS,EACT,UAAU,EACV,aAAa,EACb,UAAU,EACV,QAAQ,EACR,aAAa,GAChB,EAAE,uBAAuB,+BAwKzB"}
|
|
@@ -22,7 +22,7 @@ const idle = {
|
|
|
22
22
|
* Bell with the unread count that opens the notifications in a sheet: grouped by day, unread marked (also as text),
|
|
23
23
|
* "Mark as read" per entry and for all, "Load more". Newly arrived unread ones are announced.
|
|
24
24
|
*/
|
|
25
|
-
export function NotificationCenter({ items = [], dataSource, pageSize = 20, unreadCount, hasMore: hasMoreProp = false, loading: loadingProp = false, open: openProp, onOpenChange, label, now, emptyText, onMarkRead, onMarkAllRead, onLoadMore, onSelect, renderActions, }) {
|
|
25
|
+
export function NotificationCenter({ items = [], dataSource, pageSize = 20, unreadCount, hasMore: hasMoreProp = false, loading: loadingProp = false, open: openProp, onOpenChange, label, variant, color, size, now, emptyText, onMarkRead, onMarkAllRead, onLoadMore, onSelect, renderActions, }) {
|
|
26
26
|
const { translations, locale } = useLocale();
|
|
27
27
|
const t = translations.notificationCenter;
|
|
28
28
|
const styles = notificationCenter();
|
|
@@ -77,7 +77,7 @@ export function NotificationCenter({ items = [], dataSource, pageSize = 20, unre
|
|
|
77
77
|
};
|
|
78
78
|
const reference = now ? toDate(now) : new Date();
|
|
79
79
|
const name = label ?? t.label;
|
|
80
|
-
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: Bell, label: name, badge: unread, badgeLabel: (count) => (count ? t.unreadCount(count) : ''), "aria-expanded": open, ...{ 'aria-haspopup': 'dialog' }, className: styles.trigger(), onPress: () => setOpen(true) }), _jsxs(Sheet, { open: open, onClose: () => setOpen(false), title: name, closeLabel: translations.common.close, focusClose: true, before: _jsxs(View, { className: styles.toolbar(), children: [_jsx(Text, { className: styles.count(), children: t.unreadCount(unread) }), unread > 0 && (_jsx(Pressable, { role: "button", className: styles.markAll(), onPress: markAll, children: _jsx(Text, { className: styles.markAllLabel(), children: t.markAllRead }) }))] }), children: [all.length === 0 && !loading && _jsx(Text, { className: styles.empty(), children: emptyText ?? t.empty }), groupByDay(all, reference).map((group) => (_jsxs(View, { children: [_jsx(Text, { role: "heading", "aria-level": 3, className: styles.day(), children: dayLabel(group.day, locale, t.older) }), _jsx(View, { role: "list", children: group.items.map((item) => {
|
|
80
|
+
return (_jsxs(_Fragment, { children: [_jsx(IconButton, { icon: Bell, label: name, variant: variant, color: color, size: size, badge: unread, badgeLabel: (count) => (count ? t.unreadCount(count) : ''), "aria-expanded": open, ...{ 'aria-haspopup': 'dialog' }, className: styles.trigger(), onPress: () => setOpen(true) }), _jsxs(Sheet, { open: open, onClose: () => setOpen(false), title: name, closeLabel: translations.common.close, focusClose: true, before: _jsxs(View, { className: styles.toolbar(), children: [_jsx(Text, { className: styles.count(), children: t.unreadCount(unread) }), unread > 0 && (_jsx(Pressable, { role: "button", className: styles.markAll(), onPress: markAll, children: _jsx(Text, { className: styles.markAllLabel(), children: t.markAllRead }) }))] }), children: [all.length === 0 && !loading && _jsx(Text, { className: styles.empty(), children: emptyText ?? t.empty }), groupByDay(all, reference).map((group) => (_jsxs(View, { children: [_jsx(Text, { role: "heading", "aria-level": 3, className: styles.day(), children: dayLabel(group.day, locale, t.older) }), _jsx(View, { role: "list", children: group.items.map((item) => {
|
|
81
81
|
const itemStyles = notificationCenter({ unread: !item.read });
|
|
82
82
|
const body = (_jsxs(_Fragment, { children: [item.icon && (_jsx(View, { className: itemStyles.iconBox(), "aria-hidden": true, children: _jsx(Icon, { icon: item.icon, className: itemStyles.icon() }) })), _jsxs(View, { className: itemStyles.body(), children: [_jsxs(Text, { className: itemStyles.title(), children: [!item.read && _jsxs(Text, { className: visuallyHidden(), children: [t.unread, ": "] }), item.title] }), !!item.description && (_jsx(Text, { className: itemStyles.description(), children: item.description })), _jsx(Text, { className: itemStyles.time(), children: notificationTime(item.date, group.day, locale) })] })] }));
|
|
83
83
|
return (_jsxs(View, { role: "listitem", className: itemStyles.item(), children: [onSelect ? (_jsx(Pressable, { role: "button", className: itemStyles.itemButton(), onPress: () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCenter.js","sourceRoot":"","sources":["../../../src/components/NotificationCenter/NotificationCenter.tsx"],"names":[],"mappings":";AAAA,OAAO,EACH,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,EACN,cAAc,
|
|
1
|
+
{"version":3,"file":"NotificationCenter.js","sourceRoot":"","sources":["../../../src/components/NotificationCenter/NotificationCenter.tsx"],"names":[],"mappings":";AAAA,OAAO,EACH,cAAc,EACd,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,MAAM,EACN,cAAc,GAOjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAsB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAA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: string;
|
|
6
|
+
/** Names the sheet without showing the title (`aria-label`) */
|
|
7
|
+
hideTitle?: boolean;
|
|
8
|
+
/** Own content in the header row, before the close button */
|
|
9
|
+
header?: ReactNode;
|
|
6
10
|
closeLabel: string;
|
|
7
11
|
/** Role of the list: radiogroup (Select), menu (Menu), group (checkboxes) – none for other content */
|
|
8
12
|
listRole?: 'radiogroup' | 'menu' | 'group';
|
|
@@ -33,5 +37,5 @@ export interface SheetProps {
|
|
|
33
37
|
* Bottom sheet for the pickers, Menu and Drawer: a modal (the system keeps focus inside, back button closes it) that slides
|
|
34
38
|
* up, without animation when reduced motion is on. Pressing outside and Escape (web) close it.
|
|
35
39
|
*/
|
|
36
|
-
export declare function Sheet({ open, onClose, title, closeLabel, listRole, before, description, footer, focusClose, onShow, onHidden, scroll, closable, className, children, }: SheetProps): import("react").JSX.Element;
|
|
40
|
+
export declare function Sheet({ open, onClose, title, hideTitle, header, closeLabel, listRole, before, description, footer, focusClose, onShow, onHidden, scroll, closable, className, children, }: SheetProps): import("react").JSX.Element;
|
|
37
41
|
//# sourceMappingURL=Sheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../../src/utils/Sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQzE,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,4DAA4D;IAC5D,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,SAAS,CAAC;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AU,CAAC,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAClB,IAAI,EACJ,OAAO,EACP,KAAK,EACL,SAAiB,EACjB,MAAM,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAkB,EAClB,MAAM,EACN,QAAQ,EACR,MAAa,EACb,QAAe,EACf,SAAS,EACT,QAAQ,GACX,EAAE,UAAU,+BA8EZ"}
|
package/dist/utils/Sheet.js
CHANGED
|
@@ -11,7 +11,7 @@ const styles = select();
|
|
|
11
11
|
* Bottom sheet for the pickers, Menu and Drawer: a modal (the system keeps focus inside, back button closes it) that slides
|
|
12
12
|
* up, without animation when reduced motion is on. Pressing outside and Escape (web) close it.
|
|
13
13
|
*/
|
|
14
|
-
export function Sheet({ open, onClose, title, closeLabel, listRole, before, description, footer, focusClose = false, onShow, onHidden, scroll = true, closable = true, className, children, }) {
|
|
14
|
+
export function Sheet({ open, onClose, title, hideTitle = false, header, closeLabel, listRole, before, description, footer, focusClose = false, onShow, onHidden, scroll = true, closable = true, className, children, }) {
|
|
15
15
|
const reducedMotion = useReducedMotion();
|
|
16
16
|
const id = useId();
|
|
17
17
|
const titleId = `${id}title`;
|
|
@@ -21,6 +21,6 @@ export function Sheet({ open, onClose, title, closeLabel, listRole, before, desc
|
|
|
21
21
|
if (focusClose && Platform.OS === 'web')
|
|
22
22
|
closeButton.current?.focus();
|
|
23
23
|
onShow?.();
|
|
24
|
-
}, statusBarTranslucent: true, children: _jsxs(View, { className: styles.backdrop(), children: [_jsx(Pressable, { className: styles.dismissArea(), onPress: onClose, "aria-hidden": true, tabIndex: -1 }), _jsxs(View, { role: "dialog", "aria-modal": true,
|
|
24
|
+
}, statusBarTranslucent: true, children: _jsxs(View, { className: styles.backdrop(), children: [_jsx(Pressable, { className: styles.dismissArea(), onPress: onClose, "aria-hidden": true, tabIndex: -1 }), _jsxs(View, { role: "dialog", "aria-modal": true, ...(hideTitle ? { 'aria-label': title } : { 'aria-labelledby': titleId }), ...{ 'aria-describedby': description ? `${id}description` : undefined }, className: styles.sheet({ class: className }), children: [_jsxs(View, { className: styles.sheetHeader(), children: [header !== undefined && header !== null && header !== false && (_jsx(View, { className: styles.sheetHeaderContent(), children: header })), !hideTitle && (_jsx(Text, { nativeID: titleId, role: "heading", className: styles.sheetTitle(), children: title })), closable && (_jsx(Pressable, { ref: closeButton, role: "button", hitSlop: 6, className: styles.close(), "aria-label": closeLabel, onPress: onClose, children: _jsx(Icon, { icon: X, className: styles.closeIcon() }) }))] }), description && (_jsx(Text, { nativeID: `${id}description`, className: styles.description(), children: description })), before, scroll ? (_jsx(ScrollView, { contentContainerClassName: styles.list(), keyboardShouldPersistTaps: "handled", children: listRole ? (_jsx(View, { role: listRole, ...(hideTitle ? { 'aria-label': title } : { 'aria-labelledby': titleId }), children: children })) : (children) })) : (children), footer && _jsx(View, { className: styles.footer(), children: footer })] })] }) }));
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=Sheet.js.map
|
package/dist/utils/Sheet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","sourceRoot":"","sources":["../../src/utils/Sheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAqC,MAAM,OAAO,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,7 +1308,9 @@ Panel that slides in from an edge of the screen: from the bottom a sheet (defaul
|
|
|
1308
1308
|
| open | `boolean` | |
|
|
1309
1309
|
| onOpenChange | `(open: boolean) => void` | |
|
|
1310
1310
|
| title | `string` | |
|
|
1311
|
+
| hideTitle? | `boolean` | The title only for screen readers – it still names the drawer. With `header` this is the default; `false` shows the title next to the header content |
|
|
1311
1312
|
| description? | `string` | |
|
|
1313
|
+
| header? | `ReactNode` | Own content in the header row, before the close button – e.g. the logo of the app; the title then only names the drawer for screen readers (unless `hideTitle` is `false`) |
|
|
1312
1314
|
| placement? | `'left' \| 'right' \| 'top' \| 'bottom'` | Edge it slides in from: `bottom` (default, a sheet), `left`, `right` or `top` |
|
|
1313
1315
|
| size? | `OverlaySize` | Width (left/right: 280–480 px) or height (top/bottom: 30–85 %); `full` covers the screen |
|
|
1314
1316
|
| closable? | `boolean` | Shows the close button (default true) |
|
|
@@ -2318,6 +2320,9 @@ Bell with the unread count that opens the notifications in a sheet: grouped by d
|
|
|
2318
2320
|
| open? | `boolean` | |
|
|
2319
2321
|
| onOpenChange? | `(open: boolean) => void` | |
|
|
2320
2322
|
| label? | `string` | Name of the bell and title of the sheet (default "Notifications") |
|
|
2323
|
+
| variant? | `IconButtonVariant` | Look of the bell (IconButton `variant`), e.g. `outline` next to other outlined buttons in a header |
|
|
2324
|
+
| color? | `ButtonColor` | Colour of the bell, combined with the variant (IconButton `color`) |
|
|
2325
|
+
| size? | `Size` | Size of the bell (IconButton `size`) |
|
|
2321
2326
|
| now? | `Date \| string` | Reference time for "Today"/"Yesterday" (default now) |
|
|
2322
2327
|
| emptyText? | `string` | Text without notifications |
|
|
2323
2328
|
| onMarkRead? | `(id: string) => void` | |
|
|
@@ -4317,6 +4322,23 @@ const recipes: RecipeConfig = {
|
|
|
4317
4322
|
};
|
|
4318
4323
|
```
|
|
4319
4324
|
|
|
4325
|
+
Some defaults change more than classes – where the title of a dialog sits, for example. They are variants of the recipe
|
|
4326
|
+
as well, so the same `defaultVariants` set them once for the whole app; a prop on the single component still wins:
|
|
4327
|
+
|
|
4328
|
+
| Recipe default | Instead of on every component |
|
|
4329
|
+
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
4330
|
+
| `dialog: { defaultVariants: { titleInHeader: true } }` | `DialogContent title-position="header"`, also `confirm()`, `prompt()` and `openDialog()` (option `titlePosition`) |
|
|
4331
|
+
| `dataTable: { defaultVariants: { showFilters: false } }` | `DataTable :show-filters="false"` – filters closed at the start (a saved `stateKey` state still wins) |
|
|
4332
|
+
| `dataTable: { defaultVariants: { searchCentered: true } }` | `DataTable search-align="center"` – the search between the actions at the start and the tools at the end |
|
|
4333
|
+
| `dataTable: { defaultVariants: { sortable: true } }` | `DataTable sortable` – every column with a value sorts (not `sortable: false`, not a slot-only column) |
|
|
4334
|
+
| `dataTable: { defaultVariants: { striped: true } }` | `DataTable striped` – the same for `gridlines`, `bordered`, `wrapHeaders`, `verticalHeaders` |
|
|
4335
|
+
|
|
4336
|
+
Own buttons, fields and menus in the toolbar slots of a DataTable (`#toolbar`, `#toolbarStart`, `#toolbarEnd`) default
|
|
4337
|
+
to the size of the built-in toolbar controls (`sm`); a `size` on them still wins. A text filter shows the placeholder
|
|
4338
|
+
“Filter …” (translations `dataTable.filterText`) unless the column's `filterInputProps` has one.
|
|
4339
|
+
|
|
4340
|
+
React Native has no `RecipesProvider`; there the props stay on the single component.
|
|
4341
|
+
|
|
4320
4342
|
Per part the classes come in this order: `classes`, the matching `variants` and `compoundVariants`, the states of the
|
|
4321
4343
|
recipe, the overrides of states (`invalid: { true: … }`), and last the class passed to the component. Inner providers
|
|
4322
4344
|
extend outer ones (classes of the same value are joined, the inner ones win).
|
|
@@ -4383,11 +4405,12 @@ import { DataTable } from '@wirecore/wirelayer-react/data-table';
|
|
|
4383
4405
|
Parts of the DataTable that bring a lot of code along are imported on their own – an app only bundles the ones it passes
|
|
4384
4406
|
in `features` (fixed for the life of a table). The DatePicker alone is about 40 KB (gzip).
|
|
4385
4407
|
|
|
4386
|
-
| Feature
|
|
4387
|
-
|
|
|
4388
|
-
| `virtualRows`
|
|
4389
|
-
| `dateInput`
|
|
4390
|
-
| `numberInput`
|
|
4408
|
+
| Feature | Import | Adds | Without it |
|
|
4409
|
+
| ---------------- | ---------------------------------------------------------------------- | ---------------------------------------------------- | -------------------------------------------- |
|
|
4410
|
+
| `virtualRows` | `@wirecore/wirelayer-react/virtual` (peer dependency TanStack Virtual) | only the visible rows are rendered with `virtual` | all rows are rendered, a hint in development |
|
|
4411
|
+
| `dateInput` | `@wirecore/wirelayer-react/data-table` | DatePicker for `date` and `datetime` filters/editors | the browser's date input |
|
|
4412
|
+
| `numberInput` | `@wirecore/wirelayer-react/data-table` | NumberInput for `number` filters and editors | the browser's number input |
|
|
4413
|
+
| `dateRangeInput` | `@wirecore/wirelayer-react/data-table` | one DateRangePicker for `between` filters of dates | two fields (from, to) |
|
|
4391
4414
|
|
|
4392
4415
|
```tsx
|
|
4393
4416
|
import { DataTable, dateInput, numberInput } from '@wirecore/wirelayer-react/data-table';
|
|
@@ -4405,6 +4428,18 @@ const features = [virtualRows, dateInput, numberInput];
|
|
|
4405
4428
|
|
|
4406
4429
|
Vue: the same imports from `@wirecore/wirelayer-vue/data-table` and `@wirecore/wirelayer-vue/virtual`.
|
|
4407
4430
|
|
|
4431
|
+
`scrollHeight` takes a CSS length – the maximum height, the rows scroll inside – or `fill`: the table takes the rest of a
|
|
4432
|
+
flex column and the rows scroll in the room left down to its bottom, whatever is above it (headings, figures that wrap on
|
|
4433
|
+
narrow screens). `minScrollHeight` keeps it from collapsing; below that the page scrolls.
|
|
4434
|
+
|
|
4435
|
+
```vue
|
|
4436
|
+
<main class="flex min-h-screen flex-col gap-4 p-6">
|
|
4437
|
+
<PageHeader title="Machines" />
|
|
4438
|
+
<StatsRow />
|
|
4439
|
+
<DataTable :data="rows" :columns="columns" :features="features" scroll-height="fill" min-scroll-height="60vh" virtual />
|
|
4440
|
+
</main>
|
|
4441
|
+
```
|
|
4442
|
+
|
|
4408
4443
|
### AI assistants (MCP, llms.txt)
|
|
4409
4444
|
|
|
4410
4445
|
So that Claude, Cursor and others use the components correctly, the API is available as text and as an MCP server:
|
|
@@ -4725,6 +4760,7 @@ as `pdfjs-dist` (Apache-2.0), Chart.js, Tiptap and Shiki are installed by the ap
|
|
|
4725
4760
|
| `useToast().add({ severity, summary, detail, life })` | `toast({ type, title, description, duration })`, `<Toaster />` once in the app |
|
|
4726
4761
|
| `useConfirm().require({ … })` | `await confirm({ title, description, … })`, `<ConfirmDialog />` once in the app |
|
|
4727
4762
|
| `DataTable` + `Column` | `DataTable :columns` (column objects), `#cell-<id>`, `#expansion`, `v-model:page-size` |
|
|
4763
|
+
| `DataTable scrollHeight="flex"` | `DataTable scroll-height="fill"` (with `min-scroll-height`) in a flex column |
|
|
4728
4764
|
| `expandedRows` with a row toggler on some rows | `#expansion` + `row-expandable` |
|
|
4729
4765
|
| `paginatorTemplate` (first/last page) | `paginator-edges`, `paginator-align` |
|
|
4730
4766
|
| `showGridlines` (with the outer border) | `gridlines` + `bordered` |
|
|
@@ -4782,7 +4818,9 @@ as `pdfjs-dist` (Apache-2.0), Chart.js, Tiptap and Shiki are installed by the ap
|
|
|
4782
4818
|
- **Typed values:** `RadioGroup`, `SegmentedControl` and `NativeSelect` keep the type of the bound value (unions,
|
|
4783
4819
|
numbers); `Checkbox` with a boolean model gives booleans.
|
|
4784
4820
|
- **Compact parts:** `Progress size="xs"` with `hide-label`, `bar-text` and `status`; `Alert #actions`; `mono` on text
|
|
4785
|
-
fields; `DialogContent title-position="header"` puts the title next to the close button
|
|
4821
|
+
fields; `DialogContent title-position="header"` puts the title next to the close button – for all dialogs of the
|
|
4822
|
+
app once centrally instead of on every dialog: `RecipesProvider` with
|
|
4823
|
+
`{ dialog: { defaultVariants: { titleInHeader: true } } }` (also for `confirm()`, `prompt()` and `openDialog()`).
|
|
4786
4824
|
- **Values that are never empty:** with `required`, `RadioGroup` and `SegmentedControl` give v-model `V` instead of
|
|
4787
4825
|
`V | null`; `NativeSelect` without `placeholder` gives `V` instead of `V | ''`; `NumberInput empty-fallback="min"` or
|
|
4788
4826
|
`"previous"` refills an emptied field when it is left (typed `number`). `Select empty-value=""` treats an empty string
|
|
@@ -4962,3 +5000,21 @@ Not part of it:
|
|
|
4962
5000
|
- Shapes stay round: everything with `rounded-full` (Button and IconButton with the default `shape="pill"` – use
|
|
4963
5001
|
`shape="rounded"` or `"square"` –, Switch, Badge, Radio, Avatar with `shape="circle"`), the thin bars of Progress, the
|
|
4964
5002
|
marks of Highlight and the diamond of a Gantt milestone.
|
|
5003
|
+
|
|
5004
|
+
### Scrollbars
|
|
5005
|
+
|
|
5006
|
+
The page and every scrolling area (DataTable with `scrollHeight`, Dialog and Drawer with long content, lists of Select
|
|
5007
|
+
and Menu, Textarea …) get thin scrollbars in the look of `ScrollPanel`: the thumb in `line-strong` (at least 3:1 against
|
|
5008
|
+
the surfaces, in every theme and mode), the track transparent. They follow the mode and theme of the part they are in.
|
|
5009
|
+
Browsers without `scrollbar-color` (Safari) get the same look through `::-webkit-scrollbar`; with forced colors (Windows
|
|
5010
|
+
contrast themes) the system scrollbars stay.
|
|
5011
|
+
|
|
5012
|
+
| Variable | Default | Applies to |
|
|
5013
|
+
| ---------------------------- | ----------------------- | --------------------------------------------------------------------- |
|
|
5014
|
+
| `--wc-scrollbar-thumb` | `var(--wc-line-strong)` | Thumb |
|
|
5015
|
+
| `--wc-scrollbar-thumb-hover` | `var(--wc-muted)` | Thumb under the pointer (Safari; other browsers darken it themselves) |
|
|
5016
|
+
| `--wc-scrollbar-track` | `transparent` | Track |
|
|
5017
|
+
| `--wc-scrollbar-width` | `thin` | `scrollbar-width` (`auto` for the wide ones) |
|
|
5018
|
+
|
|
5019
|
+
`<html data-scrollbars="native">` keeps the browser's own scrollbars on the whole page. The rules sit in the base layer,
|
|
5020
|
+
so a utility on a single element still wins (e.g. `[scrollbar-width:none]`).
|
package/llms.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecore/wirelayer-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "WireLayer components for React Native (Expo) with Uniwind",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"@expo-google-fonts/jetbrains-mono": "^0.4.1",
|
|
120
120
|
"@expo-google-fonts/schibsted-grotesk": "^0.4.2",
|
|
121
|
-
"@wirecore/wirelayer-recipes": "^0.
|
|
122
|
-
"@wirecore/wirelayer-tokens": "^0.
|
|
121
|
+
"@wirecore/wirelayer-recipes": "^0.12.0",
|
|
122
|
+
"@wirecore/wirelayer-tokens": "^0.8.0",
|
|
123
123
|
"uqr": "^0.1.3"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|