@webority/ui-react 0.102.3 → 0.104.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/canvas-kit/kit.js +18917 -18623
- package/dist/canvas-kit/manifest.json +148 -3
- package/dist/canvas-kit/release.json +6 -6
- package/dist/components/AppActionIcon.js +1 -1
- package/dist/components/AppCheckbox.js +1 -1
- package/dist/components/AppChoiceCard.js +1 -1
- package/dist/components/AppChoiceChip.js +1 -1
- package/dist/components/AppCommentThread.js +1 -1
- package/dist/components/AppDropdown.js +1 -1
- package/dist/components/AppModal.js +1 -1
- package/dist/components/AppSelect.js +1 -1
- package/dist/components/AppShell.js +1 -1
- package/dist/guidance.json +1 -1
- package/dist/lib/shellCookie.js +1 -1
- package/dist/types/components/AppActionIcon.d.ts +12 -0
- package/dist/types/components/AppCheckbox.d.ts +2 -0
- package/dist/types/components/AppChoiceCard.d.ts +3 -0
- package/dist/types/components/AppChoiceChip.d.ts +6 -0
- package/dist/types/components/AppCommentThread.d.ts +15 -0
- package/dist/types/components/AppDropdown.d.ts +11 -1
- package/dist/types/components/AppModal.d.ts +8 -0
- package/dist/types/components/AppSelect.d.ts +5 -0
- package/dist/types/components/AppShell.d.ts +22 -2
- package/dist/types/lib/shellCookie.d.ts +6 -0
- package/package.json +5 -5
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* @param {boolean} [props.disabled]
|
|
22
22
|
* @param {'sm'|'md'|'lg'} [props.size]
|
|
23
23
|
* @param {'inline'|'stacked'} [props.layout]
|
|
24
|
+
* @param {'filled'} [props.selectedStyle] `filled` fills the checked card's icon disc with primary.
|
|
24
25
|
* @param {string} [props.className]
|
|
25
26
|
*/
|
|
26
27
|
export default function AppChoiceCard(props: {
|
|
@@ -84,6 +85,8 @@ export default function AppChoiceCard(props: {
|
|
|
84
85
|
* @default "inline"
|
|
85
86
|
*/
|
|
86
87
|
layout?: 'inline' | 'stacked';
|
|
88
|
+
/** `filled` fills the checked card's icon disc with the primary colour and draws the glyph in the on-primary colour. Unset keeps the soft selected look. */
|
|
89
|
+
selectedStyle?: 'filled';
|
|
87
90
|
/**
|
|
88
91
|
* Extra class names added to the card.
|
|
89
92
|
* @default ""
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* @param {import('react').ReactNode} props.children
|
|
12
12
|
* @param {import('react').ReactNode} [props.count]
|
|
13
13
|
* @param {'sm'|'md'|'lg'} [props.size]
|
|
14
|
+
* @param {'soft'|'solid'} [props.variant]
|
|
14
15
|
* @param {boolean} [props.disabled]
|
|
15
16
|
* @param {string} [props.className]
|
|
16
17
|
*/
|
|
@@ -37,6 +38,11 @@ export default function AppChoiceChip(props: {
|
|
|
37
38
|
* @default "md"
|
|
38
39
|
*/
|
|
39
40
|
size?: 'sm' | 'md' | 'lg';
|
|
41
|
+
/**
|
|
42
|
+
* Checked look: a soft primary tint (soft) or a primary fill with a translucent count (solid).
|
|
43
|
+
* @default "soft"
|
|
44
|
+
*/
|
|
45
|
+
variant?: 'soft' | 'solid';
|
|
40
46
|
/**
|
|
41
47
|
* The chip dims and cannot be picked.
|
|
42
48
|
* @default false
|
|
@@ -82,6 +82,9 @@ export type CommentThreadItem = {
|
|
|
82
82
|
* @param {(query: string) => Promise<{ value: string, label: string, description?: string, src?: string }[]>} [props.loadPeople]
|
|
83
83
|
* Look people up instead of `people`.
|
|
84
84
|
* @param {string[]} [props.reactionChoices]
|
|
85
|
+
* @param {boolean} [props.allowReplies] False leaves out the Reply action and the reply box; existing replies still show.
|
|
86
|
+
* @param {boolean} [props.allowReactions] False leaves out the reaction panel and the reaction chips.
|
|
87
|
+
* @param {string} [props.composerPlaceholder] The composer box's placeholder; without it the standard one.
|
|
85
88
|
* @param {boolean} [props.readOnly]
|
|
86
89
|
* @param {string} [props.label]
|
|
87
90
|
* @param {string} [props.id]
|
|
@@ -113,6 +116,18 @@ export default function AppCommentThread(props: {
|
|
|
113
116
|
}[]>;
|
|
114
117
|
/** The reactions the panel offers. Without it the panel offers a thumbs up, heart, party, smile, eyes and folded hands. */
|
|
115
118
|
reactionChoices?: string[];
|
|
119
|
+
/**
|
|
120
|
+
* False leaves out the Reply action and the reply box; existing replies still show.
|
|
121
|
+
* @default true
|
|
122
|
+
*/
|
|
123
|
+
allowReplies?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* False leaves out the reaction panel and the reaction chips.
|
|
126
|
+
* @default true
|
|
127
|
+
*/
|
|
128
|
+
allowReactions?: boolean;
|
|
129
|
+
/** The composer box's placeholder. Without it the standard placeholder asks for a comment and names @ mentions. */
|
|
130
|
+
composerPlaceholder?: string;
|
|
116
131
|
/**
|
|
117
132
|
* Show the thread without the box, actions or reacting.
|
|
118
133
|
* @default false
|
|
@@ -12,10 +12,14 @@
|
|
|
12
12
|
* @param {string} [props.icon]
|
|
13
13
|
* @param {number} [props.iconSize]
|
|
14
14
|
* @param {string} [props.toggleClassName]
|
|
15
|
+
* @param {"neutral"} [props.toggleVariant] A custom trigger that keeps the surrounding font and colour, with a
|
|
16
|
+
* muted fill on hover and while open. Needs `trigger`.
|
|
17
|
+
* @param {"sm"|"md"|"lg"} [props.menuWidth] A fixed menu width (15, 20 or 25rem); long rows wrap instead of
|
|
18
|
+
* widening the menu. Unset, the menu fits its rows.
|
|
15
19
|
* @param {string} [props.label]
|
|
16
20
|
* @param {"start"|"end"} [props.align]
|
|
17
21
|
* @param {string} [props.ariaLabel]
|
|
18
|
-
* @param {{ key: string, label?: string, icon?: string|import('react').ReactNode, image?: string, to?: string, onClick?: () => void, danger?: boolean, shortcut?: string, divider?: boolean, header?: string, hiddenFrom?: 'sm'|'md'|'lg'|'xl' }[]} [props.items]
|
|
22
|
+
* @param {{ key: string, label?: string, icon?: string|import('react').ReactNode, image?: string, to?: string, onClick?: () => void, danger?: boolean, disabled?: boolean, disabledReason?: string, shortcut?: string, divider?: boolean, header?: string, hiddenFrom?: 'sm'|'md'|'lg'|'xl' }[]} [props.items]
|
|
19
23
|
* @param {string} [props.menuClassName]
|
|
20
24
|
* @param {import('react').ElementType} [props.linkComponent] Component for `to` items (e.g. Link).
|
|
21
25
|
* @param {import('react').ReactNode} [props.children] Rich menu content — renders inside the
|
|
@@ -37,6 +41,10 @@ export default function AppDropdown(props: {
|
|
|
37
41
|
iconSize?: number;
|
|
38
42
|
/** Class for the toggle button, replacing the default toggle look. */
|
|
39
43
|
toggleClassName?: string;
|
|
44
|
+
/** neutral: a custom trigger that keeps the surrounding font and colour, with a muted fill on hover and while open. Needs trigger. */
|
|
45
|
+
toggleVariant?: "neutral";
|
|
46
|
+
/** A fixed menu width (15, 20 or 25rem); long rows wrap instead of widening the menu. Unset, the menu fits its rows. */
|
|
47
|
+
menuWidth?: "sm" | "md" | "lg";
|
|
40
48
|
/** Tooltip and accessible name fallback for the toggle. */
|
|
41
49
|
label?: string;
|
|
42
50
|
/**
|
|
@@ -58,6 +66,8 @@ export default function AppDropdown(props: {
|
|
|
58
66
|
to?: string;
|
|
59
67
|
onClick?: () => void;
|
|
60
68
|
danger?: boolean;
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
disabledReason?: string;
|
|
61
71
|
shortcut?: string;
|
|
62
72
|
divider?: boolean;
|
|
63
73
|
header?: string;
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @param {'default'|'danger'|'success'|'warning'} [props.tone]
|
|
11
11
|
* @param {boolean} [props.dismissible]
|
|
12
12
|
* @param {() => void} props.onClose
|
|
13
|
+
* @param {() => void} [props.onBack] Shows a back arrow before the title and runs this when it is pressed.
|
|
14
|
+
* @param {string} [props.backLabel] The back arrow's accessible name.
|
|
13
15
|
* @param {import('react').ReactNode} [props.footer]
|
|
14
16
|
* @param {'sm'|'md'|'lg'|'xl'|'fullscreen'|number} [props.size]
|
|
15
17
|
* @param {'center'|'top'} [props.placement]
|
|
@@ -43,6 +45,12 @@ export default function AppModal(props: {
|
|
|
43
45
|
*/
|
|
44
46
|
dismissible?: boolean;
|
|
45
47
|
onClose: () => void;
|
|
48
|
+
onBack?: () => void;
|
|
49
|
+
/**
|
|
50
|
+
* The accessible name of the back arrow shown when onBack is set.
|
|
51
|
+
* @default "Back"
|
|
52
|
+
*/
|
|
53
|
+
backLabel?: string;
|
|
46
54
|
/** Content pinned at the bottom, usually the action buttons. */
|
|
47
55
|
footer?: import('react').ReactNode;
|
|
48
56
|
/**
|
|
@@ -37,6 +37,11 @@ declare const AppSelect: import("react").ForwardRefExoticComponent<{
|
|
|
37
37
|
* @default "Search..."
|
|
38
38
|
*/
|
|
39
39
|
searchPlaceholder?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Text shown in the menu when a search matches nothing.
|
|
42
|
+
* @default "No matches"
|
|
43
|
+
*/
|
|
44
|
+
emptyText?: string;
|
|
40
45
|
/**
|
|
41
46
|
* Show the search box in the menu.
|
|
42
47
|
* @default false
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type NavItemShape = {
|
|
2
2
|
key?: string;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Every row but a header row has one.
|
|
5
|
+
*/
|
|
6
|
+
label?: string;
|
|
4
7
|
/**
|
|
5
8
|
* library icon name, or a node, so a
|
|
6
9
|
* product with its own content-icon set (iconsax behind a product `Icon` seam) can use it.
|
|
@@ -31,6 +34,10 @@ export type NavItemShape = {
|
|
|
31
34
|
* The badge's hover text, e.g. 3 invoices overdue.
|
|
32
35
|
*/
|
|
33
36
|
badgeTitle?: string;
|
|
37
|
+
/**
|
|
38
|
+
* An ISO date (yyyy-MM-dd, India time). A green "New" pill shows after the label through that day, and none after it.
|
|
39
|
+
*/
|
|
40
|
+
newUntil?: string;
|
|
34
41
|
/**
|
|
35
42
|
* A right-aligned secondary glyph (lock, external arrow, new dot).
|
|
36
43
|
*/
|
|
@@ -59,6 +66,10 @@ export type NavItemShape = {
|
|
|
59
66
|
* Sub-items — the row becomes an expandable parent.
|
|
60
67
|
*/
|
|
61
68
|
children?: NavItemShape[];
|
|
69
|
+
/**
|
|
70
|
+
* A sub-heading row in a group, drawn with no link. Shown only while a link follows it.
|
|
71
|
+
*/
|
|
72
|
+
header?: string;
|
|
62
73
|
};
|
|
63
74
|
export type UserMenuShape = {
|
|
64
75
|
/**
|
|
@@ -186,7 +197,8 @@ export type SearchShape = {
|
|
|
186
197
|
* each item's `active` decides, as before.
|
|
187
198
|
*
|
|
188
199
|
* @param {object} props
|
|
189
|
-
* @param {{ label?: string, items: NavItemShape[], after?: import('react').ReactNode }[]} [props.groups]
|
|
200
|
+
* @param {{ key?: string, label?: string, collapsible?: boolean, items: NavItemShape[], after?: import('react').ReactNode }[]} [props.groups]
|
|
201
|
+
* A `collapsible` group with a `key` folds from its heading; its folded state is remembered in `foldedCookie`.
|
|
190
202
|
* @param {import('react').ReactNode} [props.brand]
|
|
191
203
|
* @param {import('react').ReactNode} [props.sidebarStart]
|
|
192
204
|
* @param {import('react').ReactNode} [props.sidebarStartCompact]
|
|
@@ -207,6 +219,7 @@ export type SearchShape = {
|
|
|
207
219
|
* @param {string} [props.currentPath]
|
|
208
220
|
* @param {boolean} [props.rememberCollapsed]
|
|
209
221
|
* @param {string} [props.collapsedCookie]
|
|
222
|
+
* @param {string} [props.foldedCookie]
|
|
210
223
|
* @param {string} [props.tabBarLabel]
|
|
211
224
|
* @param {string} [props.moreLabel]
|
|
212
225
|
* @param {UserMenuShape} [props.userMenu]
|
|
@@ -220,7 +233,9 @@ export default function AppShell(props: {
|
|
|
220
233
|
* @default []
|
|
221
234
|
*/
|
|
222
235
|
groups?: {
|
|
236
|
+
key?: string;
|
|
223
237
|
label?: string;
|
|
238
|
+
collapsible?: boolean;
|
|
224
239
|
items: NavItemShape[];
|
|
225
240
|
after?: import('react').ReactNode;
|
|
226
241
|
}[];
|
|
@@ -280,6 +295,11 @@ export default function AppShell(props: {
|
|
|
280
295
|
* @default "wui-shell-collapsed"
|
|
281
296
|
*/
|
|
282
297
|
collapsedCookie?: string;
|
|
298
|
+
/**
|
|
299
|
+
* The cookie that remembers the folded collapsible groups, as their keys joined by dots.
|
|
300
|
+
* @default "wui-nav-folded"
|
|
301
|
+
*/
|
|
302
|
+
foldedCookie?: string;
|
|
283
303
|
/**
|
|
284
304
|
* Accessible name of the phone tab bar.
|
|
285
305
|
* @default "Quick navigation"
|
|
@@ -4,3 +4,9 @@ export declare const SHELL_COLLAPSED_COOKIE = "wui-shell-collapsed";
|
|
|
4
4
|
export declare function readShellCollapsed(name?: string, doc?: Document): boolean | null;
|
|
5
5
|
/** Remember the rail state for a year, site-wide; a frame without cookie access remembers nothing. */
|
|
6
6
|
export declare function writeShellCollapsed(collapsed: any, name?: string, doc?: Document): void;
|
|
7
|
+
/** Default cookie name for the folded foldable nav groups (AppShellTagHelper.FoldedCookie). */
|
|
8
|
+
export declare const SHELL_FOLDED_COOKIE = "wui-nav-folded";
|
|
9
|
+
/** The folded group keys from the cookie (joined by "."), or an empty set when absent or unreadable. */
|
|
10
|
+
export declare function readNavFolded(name?: string, doc?: Document): Set<any>;
|
|
11
|
+
/** Remember the folded group keys for a year, site-wide; a frame without cookie access remembers nothing. */
|
|
12
|
+
export declare function writeNavFolded(keys: any, name?: string, doc?: Document): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webority/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.104.0",
|
|
4
4
|
"description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@webority/theme": "0.
|
|
33
|
-
"@webority/ui-elements": "0.
|
|
32
|
+
"@webority/theme": "0.104.0",
|
|
33
|
+
"@webority/ui-elements": "0.104.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@webority/analytics": "^0.28.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"typescript": "^7.0.2",
|
|
57
57
|
"vite": "^8.0.12",
|
|
58
58
|
"vitest": "5.0.1",
|
|
59
|
-
"@webority/canvas-kit": "0.
|
|
60
|
-
"@webority/tokens": "0.
|
|
59
|
+
"@webority/canvas-kit": "0.104.0",
|
|
60
|
+
"@webority/tokens": "0.104.0"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build": "vite build && tsc -p tsconfig.json && node ../../scripts/inject-meta-docs.mjs && node ../canvas-kit/dist/cli.js build --config canvas-kit.json --out dist/canvas-kit && node ../canvas-kit/dist/cli.js guidance --config canvas-kit.json --out dist/guidance.json && node ../../scripts/sync-rcl-assets.mjs analytics",
|