@wallarm-org/design-system 1.15.0 → 1.16.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/FilterInput/FilterInputMenu/FilterInputMenu.js +3 -2
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.d.ts +2 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FlatValueMenu.js +4 -2
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenu.js +4 -2
- package/dist/components/FilterInput/FilterInputMenu/MenuEmptyState.d.ts +6 -1
- package/dist/components/FilterInput/FilterInputMenu/MenuEmptyState.js +2 -2
- package/dist/components/FilterInput/types.d.ts +9 -0
- package/dist/components/SplashScreen/SplashScreen.js +6 -4
- package/dist/components/SplashScreen/lib.js +6 -1
- package/dist/components/SplashScreen/useSplashPhase.js +16 -13
- package/dist/metadata/components.json +8 -2
- package/package.json +1 -1
|
@@ -70,7 +70,7 @@ const FilterInputMenu = ({ fields, fieldGroups, autocomplete })=>{
|
|
|
70
70
|
const showOperatorMenu = !!selectedField;
|
|
71
71
|
const showValueMenu = !!selectedField && !!selectedOperator;
|
|
72
72
|
const isDateField = selectedField?.type === 'date';
|
|
73
|
-
const hasValueOptions = selectedFieldValues.length > 0;
|
|
73
|
+
const hasValueOptions = selectedFieldValues.length > 0 || !!liveSelectedField?.loadingOptions || !!liveSelectedField?.emptyOptionsLabel;
|
|
74
74
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
75
75
|
children: [
|
|
76
76
|
/*#__PURE__*/ jsx(FilterInputFieldMenu, {
|
|
@@ -126,7 +126,8 @@ const FilterInputMenu = ({ fields, fieldGroups, autocomplete })=>{
|
|
|
126
126
|
menuRef: menuRef,
|
|
127
127
|
filterText: valueFilterText,
|
|
128
128
|
blurCommitRef: blurCommitRef,
|
|
129
|
-
loading: liveSelectedField?.loadingOptions ?? false
|
|
129
|
+
loading: liveSelectedField?.loadingOptions ?? false,
|
|
130
|
+
emptyLabel: liveSelectedField?.emptyOptionsLabel
|
|
130
131
|
}))
|
|
131
132
|
]
|
|
132
133
|
});
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export interface FilterInputValueMenuProps {
|
|
|
45
45
|
filterText?: string;
|
|
46
46
|
/** Options are still loading — show a loading indicator instead of the list. */
|
|
47
47
|
loading?: boolean;
|
|
48
|
+
/** Replaces the empty-state's default "No results" text. */
|
|
49
|
+
emptyLabel?: string;
|
|
48
50
|
/** Menu content ref (shared across menus for focus management). */
|
|
49
51
|
menuRef?: RefObject<HTMLDivElement | null>;
|
|
50
52
|
/** Set here so blur handler can commit multi-select values. */
|
|
@@ -10,7 +10,7 @@ import { useValueMenuState } from "./useValueMenuState.js";
|
|
|
10
10
|
import { ValueMenuFooterHints } from "./ValueMenuFooterHints.js";
|
|
11
11
|
import { ValueMenuItem } from "./ValueMenuItem.js";
|
|
12
12
|
import { valueOptionSearchText } from "./valueOptionSearchText.js";
|
|
13
|
-
const FlatValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange, onEscape, multiSelect = false, initialValues = [], highlightValue, width = 'standard', positioning, onBuildingValueChange, onItemToggle, inputRef, filterText = '', menuRef, blurCommitRef, className, loading = false })=>{
|
|
13
|
+
const FlatValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange, onEscape, multiSelect = false, initialValues = [], highlightValue, width = 'standard', positioning, onBuildingValueChange, onItemToggle, inputRef, filterText = '', menuRef, blurCommitRef, className, loading = false, emptyLabel })=>{
|
|
14
14
|
const filteredValues = useMemo(()=>filterAndSort(values, filterText, valueOptionSearchText), [
|
|
15
15
|
values,
|
|
16
16
|
filterText
|
|
@@ -77,7 +77,9 @@ const FlatValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange,
|
|
|
77
77
|
value: option.value
|
|
78
78
|
})
|
|
79
79
|
}, String(option.value)))
|
|
80
|
-
}) : /*#__PURE__*/ jsx(MenuEmptyState, {
|
|
80
|
+
}) : /*#__PURE__*/ jsx(MenuEmptyState, {
|
|
81
|
+
label: emptyLabel
|
|
82
|
+
}),
|
|
81
83
|
/*#__PURE__*/ jsx(DropdownMenuFooter, {
|
|
82
84
|
className: "justify-start",
|
|
83
85
|
children: /*#__PURE__*/ jsx(ValueMenuFooterHints, {
|
|
@@ -8,7 +8,7 @@ import { MenuEmptyState } from "../MenuEmptyState.js";
|
|
|
8
8
|
import { NestedValueMenuItem } from "./NestedValueMenuItem.js";
|
|
9
9
|
import { SELECT_ALL_ID, useNestedValueMenuState } from "./useNestedValueMenuState.js";
|
|
10
10
|
import { ValueMenuFooterHints } from "./ValueMenuFooterHints.js";
|
|
11
|
-
const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange, onEscape, multiSelect = false, initialValues = [], width = 'standard', positioning, onBuildingValueChange, onItemToggle, inputRef, filterText = '', menuRef, blurCommitRef, className })=>{
|
|
11
|
+
const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange, onEscape, multiSelect = false, initialValues = [], width = 'standard', positioning, onBuildingValueChange, onItemToggle, inputRef, filterText = '', menuRef, blurCommitRef, className, emptyLabel })=>{
|
|
12
12
|
const submenuRef = useRef(null);
|
|
13
13
|
const rowElsRef = useRef(new Map());
|
|
14
14
|
const sections = useMemo(()=>buildValueMenuSections(values, filterText, multiSelect), [
|
|
@@ -116,7 +116,9 @@ const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChang
|
|
|
116
116
|
}) : rows
|
|
117
117
|
]
|
|
118
118
|
}, section.label ?? `section-${index}`);
|
|
119
|
-
}) : /*#__PURE__*/ jsx(MenuEmptyState, {
|
|
119
|
+
}) : /*#__PURE__*/ jsx(MenuEmptyState, {
|
|
120
|
+
label: emptyLabel
|
|
121
|
+
}),
|
|
120
122
|
/*#__PURE__*/ jsx(DropdownMenuFooter, {
|
|
121
123
|
className: "justify-start",
|
|
122
124
|
children: /*#__PURE__*/ jsx(ValueMenuFooterHints, {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { FC } from 'react';
|
|
2
|
-
|
|
2
|
+
interface MenuEmptyStateProps {
|
|
3
|
+
/** Overrides the default text when the emptiness has a specific meaning. */
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const MenuEmptyState: FC<MenuEmptyStateProps>;
|
|
7
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
const MenuEmptyState = ()=>/*#__PURE__*/ jsx("div", {
|
|
2
|
+
const MenuEmptyState = ({ label = 'No results' })=>/*#__PURE__*/ jsx("div", {
|
|
3
3
|
className: "flex items-center justify-center pt-2 pb-4 text-sm text-text-secondary",
|
|
4
4
|
role: "status",
|
|
5
|
-
children:
|
|
5
|
+
children: label
|
|
6
6
|
});
|
|
7
7
|
MenuEmptyState.displayName = 'MenuEmptyState';
|
|
8
8
|
export { MenuEmptyState };
|
|
@@ -203,6 +203,15 @@ export interface FieldMetadata {
|
|
|
203
203
|
* set it while an async options fetch is in flight.
|
|
204
204
|
*/
|
|
205
205
|
loadingOptions?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Replaces the value dropdown's default "No results" text when this field has
|
|
208
|
+
* no options to show. For a field whose options are fetched per some scope,
|
|
209
|
+
* an empty list means something more specific than "nothing matched" — e.g.
|
|
210
|
+
* "No values recorded in this period" for a time-scoped list. Consumer-owned:
|
|
211
|
+
* set it only while the emptiness is the meaningful kind (a failed fetch
|
|
212
|
+
* should keep the default).
|
|
213
|
+
*/
|
|
214
|
+
emptyOptionsLabel?: string;
|
|
206
215
|
/**
|
|
207
216
|
* Caps the applied value segment at this width in px: a longer value truncates
|
|
208
217
|
* with a trailing ellipsis while the full value is preserved for matching. When
|
|
@@ -10,6 +10,8 @@ const SplashScreen = ({ ref, visible = true, shrinkTarget, className, children,
|
|
|
10
10
|
if ('exited' === phase) return null;
|
|
11
11
|
const containerPhase = phase;
|
|
12
12
|
const contentPhase = phase;
|
|
13
|
+
const showContent = SPLASH_PHASES[contentPhase] || 'shrinking' === phase;
|
|
14
|
+
const effectiveContentPhase = 'shrinking' === phase ? 'content-fading' : contentPhase;
|
|
13
15
|
return /*#__PURE__*/ jsxs("div", {
|
|
14
16
|
...props,
|
|
15
17
|
"data-slot": "splash-screen",
|
|
@@ -20,21 +22,21 @@ const SplashScreen = ({ ref, visible = true, shrinkTarget, className, children,
|
|
|
20
22
|
style: getContainerStyle(phase, shrinkTarget),
|
|
21
23
|
onTransitionEnd: handleContainerTransitionEnd,
|
|
22
24
|
children: [
|
|
23
|
-
|
|
25
|
+
showContent && /*#__PURE__*/ jsxs("div", {
|
|
24
26
|
className: splashContentVariants({
|
|
25
|
-
phase:
|
|
27
|
+
phase: effectiveContentPhase
|
|
26
28
|
}),
|
|
27
29
|
onTransitionEnd: handleContentTransitionEnd,
|
|
28
30
|
children: [
|
|
29
31
|
/*#__PURE__*/ jsx(Logo, {
|
|
30
32
|
className: splashLogoVariants({
|
|
31
|
-
phase:
|
|
33
|
+
phase: effectiveContentPhase
|
|
32
34
|
})
|
|
33
35
|
}),
|
|
34
36
|
/*#__PURE__*/ jsx(Progress, {
|
|
35
37
|
value: null,
|
|
36
38
|
className: splashProgressVariants({
|
|
37
|
-
phase:
|
|
39
|
+
phase: effectiveContentPhase
|
|
38
40
|
})
|
|
39
41
|
})
|
|
40
42
|
]
|
|
@@ -8,9 +8,14 @@ function getContainerStyle(phase, shrinkTarget) {
|
|
|
8
8
|
if (!shrinkTarget) return;
|
|
9
9
|
const { width, height, borderRadius = 0 } = shrinkTarget;
|
|
10
10
|
switch(phase){
|
|
11
|
+
case 'enter-start':
|
|
12
|
+
case 'entered':
|
|
13
|
+
return {
|
|
14
|
+
clipPath: `inset(0 0 round ${borderRadius}px)`
|
|
15
|
+
};
|
|
11
16
|
case 'content-fading':
|
|
12
17
|
return {
|
|
13
|
-
clipPath:
|
|
18
|
+
clipPath: `inset(0 0 round ${borderRadius}px)`,
|
|
14
19
|
transition: 'clip-path 500ms ease-in-out'
|
|
15
20
|
};
|
|
16
21
|
case 'shrinking':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
2
|
const doubleRaf = (callback)=>{
|
|
3
3
|
let id2;
|
|
4
4
|
const id1 = requestAnimationFrame(()=>{
|
|
@@ -10,29 +10,32 @@ const doubleRaf = (callback)=>{
|
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
const useSplashPhase = (visible, shrinkTarget)=>{
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return 'exited';
|
|
17
|
-
});
|
|
13
|
+
const shrinkTargetRef = useRef(shrinkTarget);
|
|
14
|
+
shrinkTargetRef.current = shrinkTarget;
|
|
15
|
+
const [phase, setPhase] = useState(()=>visible ? 'enter-start' : shrinkTarget ? 'settled' : 'exited');
|
|
18
16
|
const [childrenRevealed, setChildrenRevealed] = useState(!visible && !!shrinkTarget);
|
|
17
|
+
const contentShownRef = useRef(false);
|
|
19
18
|
useEffect(()=>{
|
|
20
19
|
if (visible) {
|
|
20
|
+
contentShownRef.current = false;
|
|
21
21
|
setPhase('enter-start');
|
|
22
22
|
setChildrenRevealed(false);
|
|
23
|
-
return doubleRaf(()=>
|
|
23
|
+
return doubleRaf(()=>{
|
|
24
|
+
contentShownRef.current = true;
|
|
25
|
+
setPhase('entered');
|
|
26
|
+
});
|
|
24
27
|
}
|
|
25
28
|
setPhase((prev)=>{
|
|
26
|
-
if ('exited' === prev
|
|
27
|
-
|
|
29
|
+
if ('exited' === prev) return shrinkTargetRef.current ? 'settled' : 'exited';
|
|
30
|
+
if ('enter-start' === prev && !shrinkTargetRef.current) return 'exited';
|
|
31
|
+
return shrinkTargetRef.current ? 'content-fading' : 'exiting';
|
|
28
32
|
});
|
|
29
33
|
}, [
|
|
30
|
-
visible
|
|
31
|
-
shrinkTarget
|
|
34
|
+
visible
|
|
32
35
|
]);
|
|
33
36
|
useEffect(()=>{
|
|
34
|
-
if ('
|
|
35
|
-
return doubleRaf(()=>setChildrenRevealed(true));
|
|
37
|
+
if ('content-fading' === phase && !contentShownRef.current) return doubleRaf(()=>setPhase('shrinking'));
|
|
38
|
+
if ('settled' === phase) return doubleRaf(()=>setChildrenRevealed(true));
|
|
36
39
|
}, [
|
|
37
40
|
phase
|
|
38
41
|
]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
3
|
-
"generatedAt": "2026-09-
|
|
2
|
+
"version": "1.15.0",
|
|
3
|
+
"generatedAt": "2026-09-04T14:16:11.782Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -31253,6 +31253,12 @@
|
|
|
31253
31253
|
"required": false,
|
|
31254
31254
|
"description": "Options are still loading — show a loading indicator instead of the list."
|
|
31255
31255
|
},
|
|
31256
|
+
{
|
|
31257
|
+
"name": "emptyLabel",
|
|
31258
|
+
"type": "string | undefined",
|
|
31259
|
+
"required": false,
|
|
31260
|
+
"description": "Replaces the empty-state's default \"No results\" text."
|
|
31261
|
+
},
|
|
31256
31262
|
{
|
|
31257
31263
|
"name": "menuRef",
|
|
31258
31264
|
"type": "RefObject<HTMLDivElement | null> | undefined",
|