@duro-app/ui 5.6.0 → 5.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/dist/{Table-B1sWL3GA.js → Table-CAjPFgTX.js} +398 -394
- package/dist/Table-CAjPFgTX.js.map +1 -0
- package/dist/{compiler-runtime-B2IcI8_O.js → compiler-runtime-BuugS4D0.js} +67 -59
- package/dist/{compiler-runtime-B2IcI8_O.js.map → compiler-runtime-BuugS4D0.js.map} +1 -1
- package/dist/components/AppShell/AppShell.d.ts +74 -0
- package/dist/components/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/AppShell/AppShell.meta.d.ts +3 -0
- package/dist/components/AppShell/AppShell.meta.d.ts.map +1 -0
- package/dist/components/AppShell/AppShell.stories.d.ts +186 -0
- package/dist/components/AppShell/AppShell.stories.d.ts.map +1 -0
- package/dist/components/AppShell/styles.css.d.ts +187 -0
- package/dist/components/AppShell/styles.css.d.ts.map +1 -0
- package/dist/components/Aside/Aside.d.ts +23 -0
- package/dist/components/Aside/Aside.d.ts.map +1 -0
- package/dist/components/Aside/Aside.meta.d.ts +3 -0
- package/dist/components/Aside/Aside.meta.d.ts.map +1 -0
- package/dist/components/Aside/Aside.stories.d.ts +45 -0
- package/dist/components/Aside/Aside.stories.d.ts.map +1 -0
- package/dist/components/Aside/styles.css.d.ts +44 -0
- package/dist/components/Aside/styles.css.d.ts.map +1 -0
- package/dist/components/Button/styles.css.d.ts +2 -0
- package/dist/components/Button/styles.css.d.ts.map +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts +3 -3
- package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts.map +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.ts +29 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/dist/components/CodeBlock/CodeBlock.meta.d.ts +3 -0
- package/dist/components/CodeBlock/CodeBlock.meta.d.ts.map +1 -0
- package/dist/components/CodeBlock/CodeBlock.stories.d.ts +67 -0
- package/dist/components/CodeBlock/CodeBlock.stories.d.ts.map +1 -0
- package/dist/components/CodeBlock/styles.css.d.ts +32 -0
- package/dist/components/CodeBlock/styles.css.d.ts.map +1 -0
- package/dist/components/DragDrop/DragDrop.d.ts +95 -14
- package/dist/components/DragDrop/DragDrop.d.ts.map +1 -1
- package/dist/components/DragDrop/DragDrop.meta.d.ts.map +1 -1
- package/dist/components/DragDrop/DragDropBoard.stories.d.ts +69 -0
- package/dist/components/DragDrop/DragDropBoard.stories.d.ts.map +1 -0
- package/dist/components/DragDrop/styles.css.d.ts +80 -3
- package/dist/components/DragDrop/styles.css.d.ts.map +1 -1
- package/dist/components/Grid/Grid.d.ts +13 -4
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/Grid.meta.d.ts.map +1 -1
- package/dist/components/Grid/Grid.stories.d.ts +28 -0
- package/dist/components/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/components/Grid/styles.css.d.ts +3 -0
- package/dist/components/Grid/styles.css.d.ts.map +1 -1
- package/dist/components/Heading/Heading.d.ts +3 -1
- package/dist/components/Heading/Heading.d.ts.map +1 -1
- package/dist/components/Heading/Heading.stories.d.ts +9 -0
- package/dist/components/Heading/Heading.stories.d.ts.map +1 -0
- package/dist/components/LinkButton/LinkButton.stories.d.ts +7 -0
- package/dist/components/LinkButton/LinkButton.stories.d.ts.map +1 -1
- package/dist/components/LinkButton/styles.css.d.ts +2 -0
- package/dist/components/LinkButton/styles.css.d.ts.map +1 -1
- package/dist/components/LiveRegion/LiveRegion.d.ts +28 -0
- package/dist/components/LiveRegion/LiveRegion.d.ts.map +1 -0
- package/dist/components/LiveRegion/LiveRegion.meta.d.ts +3 -0
- package/dist/components/LiveRegion/LiveRegion.meta.d.ts.map +1 -0
- package/dist/components/LiveRegion/LiveRegion.stories.d.ts +66 -0
- package/dist/components/LiveRegion/LiveRegion.stories.d.ts.map +1 -0
- package/dist/components/Menu/Menu.stories.d.ts +7 -0
- package/dist/components/Menu/Menu.stories.d.ts.map +1 -1
- package/dist/components/Menu/styles.css.d.ts +2 -0
- package/dist/components/Menu/styles.css.d.ts.map +1 -1
- package/dist/components/Meter/Meter.d.ts +17 -0
- package/dist/components/Meter/Meter.d.ts.map +1 -0
- package/dist/components/Meter/Meter.meta.d.ts +3 -0
- package/dist/components/Meter/Meter.meta.d.ts.map +1 -0
- package/dist/components/Meter/Meter.stories.d.ts +12 -0
- package/dist/components/Meter/Meter.stories.d.ts.map +1 -0
- package/dist/components/Meter/styles.css.d.ts +34 -0
- package/dist/components/Meter/styles.css.d.ts.map +1 -0
- package/dist/components/PageNav/styles.css.d.ts +1 -1
- package/dist/components/Prose/Prose.d.ts +17 -0
- package/dist/components/Prose/Prose.d.ts.map +1 -0
- package/dist/components/Prose/Prose.meta.d.ts +3 -0
- package/dist/components/Prose/Prose.meta.d.ts.map +1 -0
- package/dist/components/Prose/Prose.stories.d.ts +63 -0
- package/dist/components/Prose/Prose.stories.d.ts.map +1 -0
- package/dist/components/SideNav/SideNav.d.ts +7 -1
- package/dist/components/SideNav/SideNav.d.ts.map +1 -1
- package/dist/components/SideNav/SideNav.stories.d.ts +3 -0
- package/dist/components/SideNav/SideNav.stories.d.ts.map +1 -1
- package/dist/components/Time/Time.d.ts +26 -0
- package/dist/components/Time/Time.d.ts.map +1 -0
- package/dist/components/Time/Time.meta.d.ts +3 -0
- package/dist/components/Time/Time.meta.d.ts.map +1 -0
- package/dist/components/Time/Time.stories.d.ts +77 -0
- package/dist/components/Time/Time.stories.d.ts.map +1 -0
- package/dist/components/Time/relative.d.ts +27 -0
- package/dist/components/Time/relative.d.ts.map +1 -0
- package/dist/components/Timeline/Timeline.d.ts +71 -0
- package/dist/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/components/Timeline/Timeline.meta.d.ts +3 -0
- package/dist/components/Timeline/Timeline.meta.d.ts.map +1 -0
- package/dist/components/Timeline/Timeline.stories.d.ts +26 -0
- package/dist/components/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/components/Timeline/styles.css.d.ts +158 -0
- package/dist/components/Timeline/styles.css.d.ts.map +1 -0
- package/dist/components/Toast/Toast.meta.d.ts.map +1 -1
- package/dist/components/Toast/Toast.stories.d.ts +9 -0
- package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/components/Toast/ToastProvider.d.ts +11 -5
- package/dist/components/Toast/ToastProvider.d.ts.map +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/styles.css.d.ts +6 -0
- package/dist/components/Toast/styles.css.d.ts.map +1 -1
- package/dist/form.js +1 -1
- package/dist/hooks/useContainerBelow.d.ts +18 -0
- package/dist/hooks/useContainerBelow.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7316 -5536
- package/dist/index.js.map +1 -1
- package/dist/table.js +2 -2
- package/package.json +2 -2
- package/src/components/AppShell/AppShell.meta.ts +62 -0
- package/src/components/AppShell/AppShell.stories.tsx +770 -0
- package/src/components/AppShell/AppShell.tsx +346 -0
- package/src/components/AppShell/styles.css.ts +219 -0
- package/src/components/Aside/Aside.meta.ts +33 -0
- package/src/components/Aside/Aside.stories.tsx +106 -0
- package/src/components/Aside/Aside.tsx +42 -0
- package/src/components/Aside/styles.css.ts +60 -0
- package/src/components/Button/styles.css.ts +7 -2
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +4 -5
- package/src/components/CodeBlock/CodeBlock.meta.ts +29 -0
- package/src/components/CodeBlock/CodeBlock.stories.tsx +162 -0
- package/src/components/CodeBlock/CodeBlock.tsx +99 -0
- package/src/components/CodeBlock/styles.css.ts +36 -0
- package/src/components/DragDrop/DragDrop.meta.ts +22 -21
- package/src/components/DragDrop/DragDrop.tsx +1147 -246
- package/src/components/DragDrop/DragDropBoard.stories.tsx +668 -0
- package/src/components/DragDrop/styles.css.ts +74 -4
- package/src/components/Grid/Grid.meta.ts +2 -1
- package/src/components/Grid/Grid.stories.tsx +202 -3
- package/src/components/Grid/Grid.tsx +35 -6
- package/src/components/Grid/styles.css.ts +11 -0
- package/src/components/Heading/Heading.stories.tsx +51 -0
- package/src/components/Heading/Heading.tsx +38 -7
- package/src/components/LinkButton/LinkButton.stories.tsx +41 -1
- package/src/components/LinkButton/styles.css.ts +6 -2
- package/src/components/LiveRegion/LiveRegion.meta.ts +29 -0
- package/src/components/LiveRegion/LiveRegion.stories.tsx +139 -0
- package/src/components/LiveRegion/LiveRegion.tsx +48 -0
- package/src/components/Menu/Menu.stories.tsx +62 -0
- package/src/components/Menu/styles.css.ts +6 -3
- package/src/components/Meter/Meter.meta.ts +24 -0
- package/src/components/Meter/Meter.stories.tsx +64 -0
- package/src/components/Meter/Meter.tsx +55 -0
- package/src/components/Meter/styles.css.ts +30 -0
- package/src/components/Prose/Prose.meta.ts +32 -0
- package/src/components/Prose/Prose.stories.tsx +233 -0
- package/src/components/Prose/Prose.tsx +25 -0
- package/src/components/Prose/prose.css +177 -0
- package/src/components/SideNav/SideNav.stories.tsx +29 -0
- package/src/components/SideNav/SideNav.tsx +14 -2
- package/src/components/Time/Time.meta.ts +17 -0
- package/src/components/Time/Time.stories.tsx +173 -0
- package/src/components/Time/Time.tsx +33 -0
- package/src/components/Time/relative.ts +89 -0
- package/src/components/Timeline/Timeline.meta.ts +46 -0
- package/src/components/Timeline/Timeline.stories.tsx +238 -0
- package/src/components/Timeline/Timeline.tsx +332 -0
- package/src/components/Timeline/styles.css.ts +162 -0
- package/src/components/Toast/Toast.meta.ts +2 -1
- package/src/components/Toast/Toast.stories.tsx +84 -0
- package/src/components/Toast/ToastProvider.tsx +49 -11
- package/src/components/Toast/index.ts +7 -1
- package/src/components/Toast/styles.css.ts +2 -0
- package/src/hooks/useContainerBelow.ts +39 -0
- package/src/index.ts +29 -1
- package/src/strict.css +4 -1
- package/dist/Table-B1sWL3GA.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { SpacingToken } from '@duro-app/tokens/keys';
|
|
2
3
|
export interface DragDropItemData<T = unknown> {
|
|
3
4
|
readonly id: string;
|
|
4
5
|
readonly zone: string;
|
|
@@ -14,36 +15,100 @@ export interface DragDropEvent<T = unknown> {
|
|
|
14
15
|
readonly item: DragDropItemData<T>;
|
|
15
16
|
readonly target: DragDropTarget;
|
|
16
17
|
}
|
|
18
|
+
/** What a zone's `accepts` answers: `true` takes the item, `false` lets it
|
|
19
|
+
* pass silently (an outer zone may take it), and `{ok: false, reason}`
|
|
20
|
+
* refuses it out loud — the reason is shown on the ghost and announced. */
|
|
21
|
+
export type DragDropVerdict = boolean | {
|
|
22
|
+
readonly ok: false;
|
|
23
|
+
readonly reason: string;
|
|
24
|
+
};
|
|
25
|
+
export interface DragDropRefusal {
|
|
26
|
+
readonly zone: string;
|
|
27
|
+
readonly reason: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DragDropOverEvent<T = unknown> {
|
|
30
|
+
readonly item: DragDropItemData<T>;
|
|
31
|
+
/** Where the item would land now; null over nothing that accepts it. */
|
|
32
|
+
readonly target: DragDropTarget | null;
|
|
33
|
+
/** The innermost zone that refused with a reason, when nothing accepted. */
|
|
34
|
+
readonly refused: DragDropRefusal | null;
|
|
35
|
+
readonly keyboard: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface DragDropAnnouncement {
|
|
38
|
+
readonly kind: 'pick' | 'move' | 'drop' | 'cancel' | 'refuse';
|
|
39
|
+
/** The item's label. */
|
|
40
|
+
readonly item: string;
|
|
41
|
+
/** The zone's label (pick, move, drop, refuse). */
|
|
42
|
+
readonly zone?: string;
|
|
43
|
+
/** 1-based position in the zone, counting the item itself. */
|
|
44
|
+
readonly position?: number;
|
|
45
|
+
/** How many items the zone holds with the item in it. */
|
|
46
|
+
readonly count?: number;
|
|
47
|
+
/** The zone's refusal (refuse). */
|
|
48
|
+
readonly reason?: string;
|
|
49
|
+
/** Whether the drag is a keyboard one. */
|
|
50
|
+
readonly keyboard: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface DragDropPlaceholderInfo {
|
|
53
|
+
readonly zone: string;
|
|
54
|
+
readonly index: number;
|
|
55
|
+
/** The zone's label, e.g. for "→ In progress". */
|
|
56
|
+
readonly label: string;
|
|
57
|
+
}
|
|
58
|
+
export type DragDropRenderPlaceholder = (info: DragDropPlaceholderInfo) => ReactNode;
|
|
17
59
|
export interface DragDropRootProps<T = unknown> {
|
|
18
|
-
/** Called when an item is released over a zone that accepts it
|
|
19
|
-
* inside the item's own zone arrives here
|
|
60
|
+
/** Called when an item is released over a zone that accepts it (or dropped
|
|
61
|
+
* with Space/Enter). Reordering inside the item's own zone arrives here
|
|
62
|
+
* too, with the new index. */
|
|
20
63
|
onDrop: (event: DragDropEvent<T>) => void;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
64
|
+
/** Called whenever the target under the drag changes — a new zone or
|
|
65
|
+
* index, nothing, or a refusal. */
|
|
66
|
+
onDragOver?: (event: DragDropOverEvent<T>) => void;
|
|
67
|
+
/** Supplies every live-region string (pick, move, drop, cancel, refuse),
|
|
68
|
+
* e.g. from the app's message catalog. Defaults to English. */
|
|
69
|
+
announce?: (event: DragDropAnnouncement) => string;
|
|
70
|
+
/** What marks the insertion point in a zone while dragging; a Zone's own
|
|
71
|
+
* renderPlaceholder wins. Without one, only the zone lights up. */
|
|
72
|
+
renderPlaceholder?: DragDropRenderPlaceholder;
|
|
73
|
+
/** Read by screen readers on a focused Handle. */
|
|
74
|
+
instructions?: string;
|
|
27
75
|
children: ReactNode;
|
|
28
76
|
}
|
|
29
|
-
declare function Root<T = unknown>({ onDrop, announce, children }: DragDropRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
declare function Root<T = unknown>({ onDrop, onDragOver, announce, renderPlaceholder, instructions, children, }: DragDropRootProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
30
78
|
export interface DragDropZoneProps<T = unknown> {
|
|
31
79
|
id: string;
|
|
32
|
-
/** Read to screen readers when an item
|
|
80
|
+
/** Read to screen readers when an item moves or drops here; the list's
|
|
81
|
+
* accessible name with `list`. */
|
|
33
82
|
label: string;
|
|
34
83
|
/** Which axis items flow along; decides how the insertion index is read
|
|
35
84
|
* from the pointer. */
|
|
36
85
|
orientation?: 'horizontal' | 'vertical';
|
|
37
|
-
/**
|
|
38
|
-
|
|
86
|
+
/** Take the item (`true`), let it pass to an outer zone (`false`), or
|
|
87
|
+
* refuse it with a reason that is shown and announced
|
|
88
|
+
* (`{ok: false, reason}`). Omitted: every item is taken. */
|
|
89
|
+
accepts?: (item: DragDropItemData<T>) => DragDropVerdict;
|
|
90
|
+
/** Keyboard order across zones (Left/Right); zones without one follow, in
|
|
91
|
+
* DOM order. */
|
|
92
|
+
order?: number;
|
|
93
|
+
/** Marks the insertion point in this zone; overrides the Root's. */
|
|
94
|
+
renderPlaceholder?: DragDropRenderPlaceholder;
|
|
95
|
+
/** Render the zone as a labelled list (`role="list"`) laid out along
|
|
96
|
+
* `orientation`, its Items as list items. Put the Items directly in it. */
|
|
97
|
+
list?: boolean;
|
|
98
|
+
/** Gap between the Items of a `list` zone. */
|
|
99
|
+
gap?: SpacingToken;
|
|
100
|
+
/** Stretch to fill the parent (a Timeline bar, a card) instead of sizing
|
|
101
|
+
* to the content. */
|
|
102
|
+
fill?: boolean;
|
|
39
103
|
children: ReactNode;
|
|
40
104
|
}
|
|
41
|
-
declare function Zone<T = unknown>({ id, label, orientation, accepts, children, }: DragDropZoneProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
declare function Zone<T = unknown>({ id, label, orientation, accepts, order, renderPlaceholder, list, gap, fill, children, }: DragDropZoneProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
42
106
|
export interface DragDropItemProps<T = unknown> {
|
|
43
107
|
id: string;
|
|
44
108
|
/** The zone this item currently lives in. */
|
|
45
109
|
zone: string;
|
|
46
|
-
/** Read to screen readers when picked up or dropped
|
|
110
|
+
/** Read to screen readers when picked up or dropped; a Handle's default
|
|
111
|
+
* accessible name. */
|
|
47
112
|
label: string;
|
|
48
113
|
/** Carried to onDrop untouched. */
|
|
49
114
|
data?: T;
|
|
@@ -53,15 +118,31 @@ export interface DragDropItemProps<T = unknown> {
|
|
|
53
118
|
children: ReactNode;
|
|
54
119
|
}
|
|
55
120
|
declare function Item<T = unknown>({ id, zone, label, data, preview, disabled, children, }: DragDropItemProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
121
|
+
export interface DragDropHandleProps {
|
|
122
|
+
/** Defaults to the Item's label. */
|
|
123
|
+
'aria-label'?: string;
|
|
124
|
+
/** What the handle shows: a grip, or the item's whole face. Keep other
|
|
125
|
+
* controls out of it — a handle is one widget. */
|
|
126
|
+
children: ReactNode;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The keyboard path into an Item: one focusable widget (`role="button"`) per
|
|
130
|
+
* item, a roving tab stop per zone. Space picks the item up, the arrow keys
|
|
131
|
+
* move it, Space or Enter drops it, Escape cancels.
|
|
132
|
+
*/
|
|
133
|
+
declare function Handle({ 'aria-label': ariaLabel, children }: DragDropHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
56
134
|
/** Current drag, for consumers that render their own placeholder or ghost. */
|
|
57
135
|
export declare function useDragDrop(): {
|
|
58
136
|
readonly dragging: string | null;
|
|
59
137
|
readonly over: DragDropTarget | null;
|
|
138
|
+
readonly refused: DragDropRefusal | null;
|
|
139
|
+
readonly keyboard: boolean;
|
|
60
140
|
};
|
|
61
141
|
export declare const DragDrop: {
|
|
62
142
|
Root: typeof Root;
|
|
63
143
|
Zone: typeof Zone;
|
|
64
144
|
Item: typeof Item;
|
|
145
|
+
Handle: typeof Handle;
|
|
65
146
|
};
|
|
66
147
|
export {};
|
|
67
148
|
//# sourceMappingURL=DragDrop.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragDrop.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/DragDrop.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"DragDrop.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/DragDrop.tsx"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AA6CvD,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IAC3C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;4EACwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO;IACxC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAChC;AAED;;4EAE4E;AAC5E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAAA;AAErF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,OAAO;IAC5C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAClC,wEAAwE;IACxE,QAAQ,CAAC,M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,EAAE,MAAM,CAAA;IACZ;2BACuB;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,0DAA0D;IAC1D,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,iBAAS,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,EACzB,EAAE,EACF,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,QAAgB,EAChB,QAAQ,GACT,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiFtB;AAMD,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;uDACmD;IACnD,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;GAIG;AACH,iBAAS,MAAM,CAAC,EAAC,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAC,EAAE,mBAAmB,2CA2CvE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,IAAI;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAAA;IACpC,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;CAC3B,CAOA;AAED,eAAO,MAAM,QAAQ;;;;;CAA6B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragDrop.meta.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/DragDrop.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"DragDrop.meta.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/DragDrop.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,aA+ClB,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DragDropEvent, DragDropOverEvent } from './DragDrop';
|
|
3
|
+
/**
|
|
4
|
+
* The board shapes DragDrop 5.x is for: columns that are labelled lists,
|
|
5
|
+
* cards with a keyboard handle, a card zone nested in a column zone (attach),
|
|
6
|
+
* a refusal with a reason, edge auto-scroll, and a 300-card board for the
|
|
7
|
+
* render budget.
|
|
8
|
+
*/
|
|
9
|
+
interface Args {
|
|
10
|
+
onDrop?: (e: DragDropEvent<Card>) => void;
|
|
11
|
+
onDragOver?: (e: DragDropOverEvent<Card>) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const meta: Meta<Args>;
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<Args>;
|
|
16
|
+
interface Card {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly title: string;
|
|
19
|
+
readonly kind: 'task' | 'activity';
|
|
20
|
+
}
|
|
21
|
+
/** Three labelled list columns. Tab reaches one card per column; arrows walk
|
|
22
|
+
* the cards; Space picks a card up, arrows move it, Space drops, Escape
|
|
23
|
+
* cancels. Mouse drags show the same placeholder. */
|
|
24
|
+
export declare const Kanban3: Story;
|
|
25
|
+
/** Space, arrows, Space: the card moves; announcements are list-style and
|
|
26
|
+
* focus comes back to the card. */
|
|
27
|
+
export declare const KeyboardMove: Story;
|
|
28
|
+
/** Escape puts the card back, focused, and nothing is dropped. */
|
|
29
|
+
export declare const KeyboardCancel: Story;
|
|
30
|
+
/** Arrow keys walk the handles without picking: Up/Down in a column,
|
|
31
|
+
* Left/Right across columns. */
|
|
32
|
+
export declare const KeyboardRoving: Story;
|
|
33
|
+
/** `order` decides Left/Right, not the DOM: here Done comes before In
|
|
34
|
+
* progress. */
|
|
35
|
+
export declare const ExplicitZoneOrder: Story;
|
|
36
|
+
/** A mouse drag shows the placeholder where the card would land, calls
|
|
37
|
+
* onDragOver as the target changes, and drops there. */
|
|
38
|
+
export declare const PointerReorder: Story;
|
|
39
|
+
/** An inbox of activities beside two columns of tasks. Drop an activity on a
|
|
40
|
+
* task card to attach it (the card's zone sits inside the column's); drop
|
|
41
|
+
* it on a column and the column refuses, with its reason. */
|
|
42
|
+
export declare const NestedZones: Story;
|
|
43
|
+
/** The card's own zone wins over its column (innermost zone): an activity
|
|
44
|
+
* dropped on a card attaches to it. */
|
|
45
|
+
export declare const NestedAttach: Story;
|
|
46
|
+
/** A task dragged over another task passes through the card's zone (it
|
|
47
|
+
* only takes activities) to the column, which reorders. */
|
|
48
|
+
export declare const NestedFallsThrough: Story;
|
|
49
|
+
/** A column refuses an activity with a reason: the ghost shows it, it is
|
|
50
|
+
* announced, and releasing there drops nothing. */
|
|
51
|
+
export declare const RefusalWithReason: Story;
|
|
52
|
+
/** A 30-card column that scrolls: hold a dragged card near its edge. */
|
|
53
|
+
export declare const ScrollingColumn: Story;
|
|
54
|
+
/** Holding a card near the bottom edge of a scrolling column scrolls it, and
|
|
55
|
+
* the drop lands among the cards scrolled into view. */
|
|
56
|
+
export declare const EdgeAutoScroll: Story;
|
|
57
|
+
declare global {
|
|
58
|
+
interface Window {
|
|
59
|
+
__dragDropRenders?: number;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 300 cards. A pointer drag across a column re-renders at most a handful of
|
|
64
|
+
* zones and items per frame (the two around the moving placeholder); the
|
|
65
|
+
* ghost moves without rendering. The play function counts Profiler commits
|
|
66
|
+
* per frame and asserts fewer than 5.
|
|
67
|
+
*/
|
|
68
|
+
export declare const Perf300: Story;
|
|
69
|
+
//# sourceMappingURL=DragDropBoard.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drag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AM,kBAAkB,EAAE,KAYhC,CAAA;AAED;oDACoD;AACpD,eAAO,MAAM,iBAAiB,EAAE,KAmB/B,CAAA;AAqBD,wEAAwE;AACxE,eAAO,MAAM,eAAe,EAAE,KAE7B,CAAA;AAED;yDACyD;AACzD,eAAO,MAAM,cAAc,EAAE,KAkB5B,CAAA;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAC3B;CACF;AAyCD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,KAwCrB,CAAA"}
|
|
@@ -15,12 +15,59 @@ export declare const styles: Readonly<{
|
|
|
15
15
|
readonly opacity: css.StyleXClassNameFor<"opacity", 0.4>;
|
|
16
16
|
readonly cursor: css.StyleXClassNameFor<"cursor", "grabbing">;
|
|
17
17
|
}>;
|
|
18
|
+
readonly handle: Readonly<{
|
|
19
|
+
readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
|
|
20
|
+
readonly outlineStyle: css.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
|
|
21
|
+
readonly outlineWidth: css.StyleXClassNameFor<"outlineWidth", string>;
|
|
22
|
+
readonly outlineColor: css.StyleXClassNameFor<"outlineColor", string>;
|
|
23
|
+
readonly outlineOffset: css.StyleXClassNameFor<"outlineOffset", string>;
|
|
24
|
+
}>;
|
|
25
|
+
readonly handlePicked: Readonly<{
|
|
26
|
+
readonly outlineStyle: css.StyleXClassNameFor<"outlineStyle", "dashed">;
|
|
27
|
+
}>;
|
|
18
28
|
readonly zone: Readonly<{
|
|
19
29
|
readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
|
|
20
30
|
readonly transitionProperty: css.StyleXClassNameFor<"transitionProperty", "box-shadow, background-color">;
|
|
21
31
|
readonly transitionDuration: css.StyleXClassNameFor<"transitionDuration", string>;
|
|
22
32
|
readonly transitionTimingFunction: css.StyleXClassNameFor<"transitionTimingFunction", string>;
|
|
23
33
|
}>;
|
|
34
|
+
readonly listVertical: Readonly<{
|
|
35
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
36
|
+
readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "column">;
|
|
37
|
+
}>;
|
|
38
|
+
readonly listHorizontal: Readonly<{
|
|
39
|
+
readonly display: css.StyleXClassNameFor<"display", "flex">;
|
|
40
|
+
readonly flexDirection: css.StyleXClassNameFor<"flexDirection", "row">;
|
|
41
|
+
}>;
|
|
42
|
+
readonly gapXs: Readonly<{
|
|
43
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
44
|
+
}>;
|
|
45
|
+
readonly gapSm: Readonly<{
|
|
46
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
47
|
+
}>;
|
|
48
|
+
readonly gapMs: Readonly<{
|
|
49
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
50
|
+
}>;
|
|
51
|
+
readonly gapMd: Readonly<{
|
|
52
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
53
|
+
}>;
|
|
54
|
+
readonly gapLg: Readonly<{
|
|
55
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
56
|
+
}>;
|
|
57
|
+
readonly gapXl: Readonly<{
|
|
58
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
59
|
+
}>;
|
|
60
|
+
readonly gapXxl: Readonly<{
|
|
61
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
62
|
+
}>;
|
|
63
|
+
readonly gapXxxl: Readonly<{
|
|
64
|
+
readonly gap: css.StyleXClassNameFor<"gap", string>;
|
|
65
|
+
}>;
|
|
66
|
+
readonly fill: Readonly<{
|
|
67
|
+
readonly boxSizing: css.StyleXClassNameFor<"boxSizing", "border-box">;
|
|
68
|
+
readonly width: css.StyleXClassNameFor<"width", "100%">;
|
|
69
|
+
readonly height: css.StyleXClassNameFor<"height", "100%">;
|
|
70
|
+
}>;
|
|
24
71
|
readonly zoneReady: Readonly<{
|
|
25
72
|
readonly boxShadow: css.StyleXClassNameFor<"boxShadow", string>;
|
|
26
73
|
readonly outlineStyle: css.StyleXClassNameFor<"outlineStyle", "solid">;
|
|
@@ -36,6 +83,16 @@ export declare const styles: Readonly<{
|
|
|
36
83
|
readonly outlineColor: css.StyleXClassNameFor<"outlineColor", "transparent">;
|
|
37
84
|
readonly outlineOffset: css.StyleXClassNameFor<"outlineOffset", `calc(-1 * ${css.StyleXVar<string>})`>;
|
|
38
85
|
}>;
|
|
86
|
+
readonly zoneRefused: Readonly<{
|
|
87
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
88
|
+
readonly outlineStyle: css.StyleXClassNameFor<"outlineStyle", "dashed">;
|
|
89
|
+
readonly outlineWidth: css.StyleXClassNameFor<"outlineWidth", string>;
|
|
90
|
+
readonly outlineColor: css.StyleXClassNameFor<"outlineColor", string>;
|
|
91
|
+
readonly outlineOffset: css.StyleXClassNameFor<"outlineOffset", `calc(-1 * ${css.StyleXVar<string>})`>;
|
|
92
|
+
}>;
|
|
93
|
+
readonly placeholder: Readonly<{
|
|
94
|
+
readonly flexShrink: css.StyleXClassNameFor<"flexShrink", 0>;
|
|
95
|
+
}>;
|
|
39
96
|
readonly ghost: Readonly<{
|
|
40
97
|
readonly position: css.StyleXClassNameFor<"position", "fixed">;
|
|
41
98
|
readonly top: css.StyleXClassNameFor<"top", 0>;
|
|
@@ -45,10 +102,30 @@ export declare const styles: Readonly<{
|
|
|
45
102
|
readonly opacity: css.StyleXClassNameFor<"opacity", 0.9>;
|
|
46
103
|
readonly cursor: css.StyleXClassNameFor<"cursor", "grabbing">;
|
|
47
104
|
}>;
|
|
48
|
-
readonly
|
|
105
|
+
readonly ghostTilt: Readonly<{
|
|
106
|
+
readonly transform: css.StyleXClassNameFor<"transform", "none" | "rotate(2deg)">;
|
|
107
|
+
}>;
|
|
108
|
+
readonly refusal: Readonly<{
|
|
109
|
+
readonly marginTop: css.StyleXClassNameFor<"marginTop", string>;
|
|
110
|
+
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
111
|
+
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
112
|
+
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
113
|
+
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
114
|
+
readonly borderRadius: css.StyleXClassNameFor<"borderRadius", string>;
|
|
115
|
+
readonly borderWidth: css.StyleXClassNameFor<"borderWidth", string>;
|
|
116
|
+
readonly borderStyle: css.StyleXClassNameFor<"borderStyle", "solid">;
|
|
117
|
+
readonly borderColor: css.StyleXClassNameFor<"borderColor", string>;
|
|
118
|
+
readonly backgroundColor: css.StyleXClassNameFor<"backgroundColor", string>;
|
|
119
|
+
readonly color: css.StyleXClassNameFor<"color", string>;
|
|
120
|
+
readonly fontSize: css.StyleXClassNameFor<"fontSize", string>;
|
|
121
|
+
readonly lineHeight: css.StyleXClassNameFor<"lineHeight", string>;
|
|
122
|
+
readonly boxShadow: css.StyleXClassNameFor<"boxShadow", string>;
|
|
123
|
+
readonly width: css.StyleXClassNameFor<"width", "max-content">;
|
|
124
|
+
readonly maxWidth: css.StyleXClassNameFor<"maxWidth", "100%">;
|
|
125
|
+
}>;
|
|
126
|
+
readonly ghostSize: (width: number, height: number) => readonly [Readonly<{
|
|
49
127
|
width: css.StyleXClassNameFor<"width", number>;
|
|
50
|
-
|
|
51
|
-
transform: css.StyleXClassNameFor<"transform", string>;
|
|
128
|
+
minHeight: css.StyleXClassNameFor<"minHeight", number>;
|
|
52
129
|
}>, css.InlineStyles];
|
|
53
130
|
}>;
|
|
54
131
|
//# sourceMappingURL=styles.css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/DragDrop/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AASpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmIjB,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
2
|
import { GridColumns } from './columns';
|
|
3
3
|
import { SpacingToken } from '@duro-app/tokens/keys';
|
|
4
4
|
import { GridTrack, Length } from '../../shared/length';
|
|
5
|
-
export type GridLayout = 'split' | 'split-wide';
|
|
5
|
+
export type GridLayout = 'split' | 'split-wide' | 'content-aside';
|
|
6
6
|
interface GridProps {
|
|
7
7
|
gap?: SpacingToken;
|
|
8
8
|
/** A column count (equal columns) or weights: `[1, 2]` gives a one-third /
|
|
@@ -20,7 +20,9 @@ interface GridProps {
|
|
|
20
20
|
* column on the width of its OWN container — `split` below `sm` (640px),
|
|
21
21
|
* `split-wide` below `md` (768px) — so a split nested inside another
|
|
22
22
|
* split, or beside an open DetailPanel, collapses when it runs out of room
|
|
23
|
-
* rather than when the window does.
|
|
23
|
+
* rather than when the window does. `content-aside` is a reading column
|
|
24
|
+
* beside an `Aside` (`asideW`, 320px), one column below `md`. Wins over
|
|
25
|
+
* `columns` / `minColumnWidth`.
|
|
24
26
|
*/
|
|
25
27
|
layout?: GridLayout;
|
|
26
28
|
/**
|
|
@@ -32,8 +34,15 @@ interface GridProps {
|
|
|
32
34
|
* wins over it.
|
|
33
35
|
*/
|
|
34
36
|
tracks?: readonly GridTrack[];
|
|
37
|
+
/**
|
|
38
|
+
* The Grid's outer element: with a `layout`, the wrapper its container
|
|
39
|
+
* query measures (hand it to `useContainerBelow` to follow the same
|
|
40
|
+
* collapse); otherwise the grid itself. Web only: on native the ref is not
|
|
41
|
+
* attached.
|
|
42
|
+
*/
|
|
43
|
+
ref?: Ref<HTMLDivElement>;
|
|
35
44
|
children: ReactNode;
|
|
36
45
|
}
|
|
37
|
-
export declare function Grid({ gap, columns, minColumnWidth, layout, tracks, children }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function Grid({ gap, columns, minColumnWidth, layout, tracks, ref, children, }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
38
47
|
export {};
|
|
39
48
|
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,SAAS,EAAE,KAAK,GAAG,EAAC,MAAM,OAAO,CAAA;AAIxD,OAAO,EAAuD,KAAK,WAAW,EAAC,MAAM,WAAW,CAAA;AAChG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAA8B,KAAK,SAAS,EAAE,KAAK,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE5F,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,eAAe,CAAA;AAEjE,UAAU,SAAS;IACjB,GAAG,CAAC,EAAE,YAAY,CAAA;IAClB;;+DAE2D;IAC3D,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB;;;oCAGgC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IAC7B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;IACzB,QAAQ,EAAE,SAAS,CAAA;CACpB;AA4DD,wBAAgB,IAAI,CAAC,EACnB,GAAU,EACV,OAAO,EACP,cAAc,EACd,MAAM,EACN,MAAM,EACN,GAAG,EACH,QAAQ,GACT,EAAE,SAAS,2CAwCX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.meta.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Grid.meta.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,aAkDlB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Grid } from './Grid';
|
|
3
|
+
import { SpacingToken } from '@duro-app/tokens/keys';
|
|
3
4
|
declare const meta: Meta<typeof Grid>;
|
|
4
5
|
export default meta;
|
|
5
6
|
type Story = StoryObj<typeof Grid>;
|
|
@@ -25,4 +26,31 @@ export declare const WeightedColumns: Story;
|
|
|
25
26
|
export declare const WithContainerQuery: Story;
|
|
26
27
|
export declare const TracksWithAside: Story;
|
|
27
28
|
export declare const TracksWithMinmax: Story;
|
|
29
|
+
interface ContentAsideArgs {
|
|
30
|
+
/** The gap between the reading column and the Aside. */
|
|
31
|
+
gap: SpacingToken;
|
|
32
|
+
/** The frame's width in px: the container the Grid measures. */
|
|
33
|
+
width: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A reading column beside an Aside (asideW); one column below md (768px),
|
|
37
|
+
* measured on the Grid's own container. Drag `width` across 768 to see it
|
|
38
|
+
* collapse: the column reports what `useContainerBelow` sees.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ContentAside: StoryObj<ContentAsideArgs>;
|
|
41
|
+
/** ContentAside's checks, kept off the visible story so a Control change cannot fail them. */
|
|
42
|
+
export declare const ContentAsideChecks: StoryObj<ContentAsideArgs>;
|
|
43
|
+
/** ContentAside's checks below md (pageSm, 600px): the Aside stacks under the column. */
|
|
44
|
+
export declare const ContentAsideStackedChecks: StoryObj<ContentAsideArgs>;
|
|
45
|
+
/** A wide page and a narrow one, side by side: beside, then stacked. */
|
|
46
|
+
export declare const ContentAsideWideAndNarrow: Story;
|
|
47
|
+
/**
|
|
48
|
+
* The collapse and `useContainerBelow` follow the Grid's container, not the
|
|
49
|
+
* window: in a 1440px viewport the 600px page stacks and reports "below md",
|
|
50
|
+
* the 1200px one does not. The forwarded ref is the container the query
|
|
51
|
+
* measures. Sizes the browser through Vitest, so it runs as a test only.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ContentAsideFollowsItsContainer: Story;
|
|
54
|
+
/** `ref` reaches the grid element itself when there is no named layout. */
|
|
55
|
+
export declare const RefWithoutLayout: Story;
|
|
28
56
|
//# sourceMappingURL=Grid.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Grid.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAGpD,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAA;AAI3B,OAAO,EAAyB,KAAK,YAAY,EAAC,MAAM,uB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ns: css.StyleXClassNameFor<"gridTemplateColumns", "1fr" | `minmax(${css.StyleXVar<string>}, 1fr) minmax(0, 3fr)`>;
|
|
35
35
|
}>;
|
|
36
|
+
readonly contentAside: Readonly<{
|
|
37
|
+
readonly gridTemplateColumns: css.StyleXClassNameFor<"gridTemplateColumns", "minmax(0, 1fr)" | `minmax(0, 1fr) ${css.StyleXVar<string>}`>;
|
|
38
|
+
}>;
|
|
36
39
|
readonly template: (tracks: string) => readonly [Readonly<{
|
|
37
40
|
gridTemplateColumns: css.StyleXClassNameFor<"gridTemplateColumns", string>;
|
|
38
41
|
}>, css.InlineStyles];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAgBpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyGjB,CAAA"}
|
|
@@ -5,8 +5,10 @@ interface HeadingProps {
|
|
|
5
5
|
variant?: HeadingVariant;
|
|
6
6
|
color?: 'default' | 'muted' | 'accent';
|
|
7
7
|
align?: 'start' | 'center' | 'end';
|
|
8
|
+
/** The heading's id: an in-page link's target (`href="#id"`), an `aria-labelledby` reference. */
|
|
9
|
+
id?: string;
|
|
8
10
|
children: ReactNode;
|
|
9
11
|
}
|
|
10
|
-
export declare function Heading({ level, variant, color, align, children }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Heading({ level, variant, color, align, id, children }: HeadingProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AAKpC,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAA;AAEf,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IACtC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,QAAQ,EAAE,SAAS,CAAA;CACpB;AAiBD,wBAAgB,OAAO,CAAC,EAAC,KAAK,EAAE,OAAO,EAAE,KAAiB,EAAE,KAAK,EAAE,QAAQ,EAAC,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../src/components/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AAKpC,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,GACX,WAAW,CAAA;AAEf,UAAU,YAAY;IACpB,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC5B,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAA;IACtC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,iGAAiG;IACjG,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,SAAS,CAAA;CACpB;AAiBD,wBAAgB,OAAO,CAAC,EAAC,KAAK,EAAE,OAAO,EAAE,KAAiB,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAC,EAAE,YAAY,2CAuC7F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Levels: Story;
|
|
6
|
+
/** `id` makes a heading the target of an in-page link (a table of contents)
|
|
7
|
+
* or of `aria-labelledby`. */
|
|
8
|
+
export declare const WithId: Story;
|
|
9
|
+
//# sourceMappingURL=Heading.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Heading.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Heading/Heading.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAOpD,QAAA,MAAM,IAAI,EAAE,IAIX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAA;AAErB,eAAO,MAAM,MAAM,EAAE,KAepB,CAAA;AAED;+BAC+B;AAC/B,eAAO,MAAM,MAAM,EAAE,KAepB,CAAA"}
|
|
@@ -18,4 +18,11 @@ export declare const AllVariants: Story;
|
|
|
18
18
|
export declare const ClientNavigation: StoryObj<{
|
|
19
19
|
onNavigate: OnNavigate;
|
|
20
20
|
}>;
|
|
21
|
+
/**
|
|
22
|
+
* A touch screen gets 44px links, default and small alike (5.6, as Button);
|
|
23
|
+
* a mouse keeps the compact control.
|
|
24
|
+
* It drives Chrome's touch emulation through Vitest's CDP session, so it runs
|
|
25
|
+
* as a test and stays out of the dev sidebar (there is no Vitest there).
|
|
26
|
+
*/
|
|
27
|
+
export declare const TouchTargets: Story;
|
|
21
28
|
//# sourceMappingURL=LinkButton.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/LinkButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAGpD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAGvC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"LinkButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/LinkButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAA;AAGpD,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AAGvC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,uBAAuB,CAAA;AAKrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAcjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAExC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAY1B,CAAA;AAOD,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAC,CA+B/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,KA8B1B,CAAA"}
|
|
@@ -15,12 +15,14 @@ export declare const styles: Readonly<{
|
|
|
15
15
|
readonly transitionProperty: css.StyleXClassNameFor<"transitionProperty", "background-color, border-color, color">;
|
|
16
16
|
readonly transitionDuration: css.StyleXClassNameFor<"transitionDuration", string>;
|
|
17
17
|
readonly transitionTimingFunction: css.StyleXClassNameFor<"transitionTimingFunction", string>;
|
|
18
|
+
readonly minWidth: css.StyleXClassNameFor<"minWidth", string | null>;
|
|
18
19
|
}>;
|
|
19
20
|
readonly sizeDefault: Readonly<{
|
|
20
21
|
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
21
22
|
readonly paddingBottom: css.StyleXClassNameFor<"paddingBottom", string>;
|
|
22
23
|
readonly paddingLeft: css.StyleXClassNameFor<"paddingLeft", string>;
|
|
23
24
|
readonly paddingRight: css.StyleXClassNameFor<"paddingRight", string>;
|
|
25
|
+
readonly minHeight: css.StyleXClassNameFor<"minHeight", string | null>;
|
|
24
26
|
}>;
|
|
25
27
|
readonly sizeSmall: Readonly<{
|
|
26
28
|
readonly paddingTop: css.StyleXClassNameFor<"paddingTop", string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAQpC,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../../../src/components/LinkButton/styles.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,kBAAkB,CAAA;AAQpC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyDjB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type LiveRegionPoliteness = 'polite' | 'assertive';
|
|
3
|
+
interface LiveRegionProps {
|
|
4
|
+
/**
|
|
5
|
+
* What to announce. Change it to announce; leave it empty when there is
|
|
6
|
+
* nothing to say — never unmount the region to clear it.
|
|
7
|
+
*/
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* `polite` (default) waits for the screen reader to finish (`role="status"`):
|
|
11
|
+
* "Copied", "3 results". `assertive` interrupts (`role="alert"`): only for
|
|
12
|
+
* what the person must hear now, such as an error that blocks them.
|
|
13
|
+
*/
|
|
14
|
+
politeness?: LiveRegionPoliteness;
|
|
15
|
+
/** Keeps the region off screen and in the accessibility tree. Default false. */
|
|
16
|
+
visuallyHidden?: boolean;
|
|
17
|
+
id?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* LiveRegion — tells assistive tech about a change that has no focus move to
|
|
21
|
+
* go with it ("Link copied", "Answer ready"). A screen reader only announces
|
|
22
|
+
* a change to a region that was already in the page, so render it from the
|
|
23
|
+
* start (empty) and change its content; a region mounted together with its
|
|
24
|
+
* message is often not read at all.
|
|
25
|
+
*/
|
|
26
|
+
export declare function LiveRegion({ children, politeness, visuallyHidden, id, }: LiveRegionProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=LiveRegion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveRegion.d.ts","sourceRoot":"","sources":["../../../src/components/LiveRegion/LiveRegion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAA;AAIpC,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,WAAW,CAAA;AAEzD,UAAU,eAAe;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,oBAAoB,CAAA;IACjC,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,UAAqB,EACrB,cAAsB,EACtB,EAAE,GACH,EAAE,eAAe,2CAYjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveRegion.meta.d.ts","sourceRoot":"","sources":["../../../src/components/LiveRegion/LiveRegion.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAA;AAEpD,eAAO,MAAM,IAAI,EAAE,aA0BlB,CAAA"}
|