@lumx/core 4.25.0 → 4.25.1-next.1
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/components-and-utils.css +11 -1
- package/js/components/Combobox/Stories.d.ts +10 -0
- package/js/components/Combobox/constants.d.ts +4 -0
- package/js/components/Combobox/types.d.ts +11 -1
- package/js/components/List/ListItemTestStories.d.ts +45 -0
- package/lumx.css +11 -1
- package/package.json +4 -3
- package/scss/_core.scss +1 -0
- package/scss/components/list/_index.scss +3 -5
- package/scss/core/action-area/_index.scss +1 -1
- package/scss/core/action-area/_mixins.scss +18 -0
package/components-and-utils.css
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
* Do not edit directly
|
|
5
5
|
* Generated on Mon, 13 Jan 2025 09:24:38 GMT
|
|
6
6
|
*/
|
|
7
|
+
/* ==========================================================================
|
|
8
|
+
Action area
|
|
9
|
+
========================================================================== */
|
|
7
10
|
/* stylelint-disable custom-property-pattern */
|
|
8
11
|
/** @deprecated: replaced with $lumx-progress-circular-size-map */
|
|
9
12
|
/**
|
|
@@ -418,6 +421,10 @@ table {
|
|
|
418
421
|
.lumx-action-area {
|
|
419
422
|
position: relative;
|
|
420
423
|
}
|
|
424
|
+
:where(.lumx-action-area) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
|
|
425
|
+
position: relative;
|
|
426
|
+
z-index: 1;
|
|
427
|
+
}
|
|
421
428
|
|
|
422
429
|
/* Action element
|
|
423
430
|
========================================================================== */
|
|
@@ -8252,7 +8259,10 @@ table {
|
|
|
8252
8259
|
opacity: 0.5;
|
|
8253
8260
|
cursor: default;
|
|
8254
8261
|
}
|
|
8255
|
-
.lumx-list-
|
|
8262
|
+
.lumx-list-item:has(.lumx-action-area__action) {
|
|
8263
|
+
position: relative;
|
|
8264
|
+
}
|
|
8265
|
+
:where(.lumx-list-item:has(.lumx-action-area__action)) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
|
|
8256
8266
|
position: relative;
|
|
8257
8267
|
z-index: 1;
|
|
8258
8268
|
}
|
|
@@ -164,4 +164,14 @@ export declare function setup({ components: { Combobox, IconButton, Avatar, Skel
|
|
|
164
164
|
onChange: (v: string) => void;
|
|
165
165
|
}) => import("react").JSX.Element;
|
|
166
166
|
};
|
|
167
|
+
ComboboxWithOptionTooltips: {
|
|
168
|
+
args: {
|
|
169
|
+
value: string;
|
|
170
|
+
};
|
|
171
|
+
decorators: ((story: any, context: any) => any)[];
|
|
172
|
+
render: ({ value, onChange }: {
|
|
173
|
+
value: string;
|
|
174
|
+
onChange: (v: string) => void;
|
|
175
|
+
}) => import("react").JSX.Element;
|
|
176
|
+
};
|
|
167
177
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { VHSize } from '../../utils/browser/css/types';
|
|
2
|
+
import { OptionActiveEvent } from './types';
|
|
2
3
|
export declare const DEFAULT_COMBOBOX_POPOVER_MAX_HEIGHT: VHSize;
|
|
3
4
|
export declare const COMBOBOX_PROVIDER_COMPONENT_NAME = "ComboboxProvider";
|
|
5
|
+
export declare const OPTION_ACTIVE_EVENT_PREFIX: "optionActive:";
|
|
6
|
+
export declare const optionActiveEvent: (optionId: string) => OptionActiveEvent;
|
|
7
|
+
export declare const isOptionActiveEvent: (event: string) => event is OptionActiveEvent;
|
|
@@ -14,6 +14,8 @@ export interface OptionRegistration {
|
|
|
14
14
|
callback: (isFiltered: boolean) => void;
|
|
15
15
|
lastFiltered: boolean;
|
|
16
16
|
}
|
|
17
|
+
/** Event name for the active state of one option. */
|
|
18
|
+
export type OptionActiveEvent = `optionActive:${string}`;
|
|
17
19
|
/** Map of combobox event names to their payload types. */
|
|
18
20
|
export interface ComboboxEventMap {
|
|
19
21
|
/** Fired when the combobox open state changes. Payload: whether the combobox is open. */
|
|
@@ -38,7 +40,15 @@ export interface ComboboxEventMap {
|
|
|
38
40
|
* Used to control the loading message text in the live region (ComboboxState).
|
|
39
41
|
*/
|
|
40
42
|
loadingAnnouncement: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Fired only when this option becomes the active descendant (true)
|
|
45
|
+
* or stops being the active descendant (false).
|
|
46
|
+
* Build the key with optionActiveEvent(optionId).
|
|
47
|
+
*/
|
|
48
|
+
[event: OptionActiveEvent]: boolean;
|
|
41
49
|
}
|
|
50
|
+
/** Callback provided in events subscriptions */
|
|
51
|
+
export type SubscriptionCallback<T extends keyof ComboboxEventMap = keyof ComboboxEventMap> = (value: ComboboxEventMap[T]) => void;
|
|
42
52
|
/** Callbacks provided by the consumer (React/Vue) to react to combobox state changes. */
|
|
43
53
|
export interface ComboboxCallbacks {
|
|
44
54
|
/** Called when an option is selected (click or keyboard). */
|
|
@@ -92,7 +102,7 @@ export interface ComboboxHandle {
|
|
|
92
102
|
/** Tear down all listeners and state. */
|
|
93
103
|
destroy(): void;
|
|
94
104
|
/** Subscribe to a combobox event. Returns an unsubscribe function. */
|
|
95
|
-
subscribe<K extends keyof ComboboxEventMap>(event: K, callback:
|
|
105
|
+
subscribe<K extends keyof ComboboxEventMap>(event: K, callback: SubscriptionCallback<K>): () => void;
|
|
96
106
|
/**
|
|
97
107
|
* Read the last dispatched value of an event synchronously, for pull-based subscribers such as
|
|
98
108
|
* React's `useSyncExternalStore`. Returns `undefined` until the event has fired at least once.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup ListItem test stories for a specific framework (React or Vue).
|
|
4
|
+
*/
|
|
5
|
+
export declare function setup({ component, render: ListItem, components: { List, ListItemAction, Button }, }: SetupStoriesOptions<{
|
|
6
|
+
components: {
|
|
7
|
+
List: any;
|
|
8
|
+
ListItemAction: any;
|
|
9
|
+
Button: any;
|
|
10
|
+
};
|
|
11
|
+
}>): {
|
|
12
|
+
meta: {
|
|
13
|
+
component: any;
|
|
14
|
+
tags: string[];
|
|
15
|
+
parameters: {
|
|
16
|
+
chromatic: {
|
|
17
|
+
disable: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
ClickOnBeforeSlotTriggersAction: {
|
|
22
|
+
play: ({ args }: any) => Promise<void>;
|
|
23
|
+
args: {
|
|
24
|
+
onActionClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
25
|
+
onSecondaryClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
26
|
+
};
|
|
27
|
+
render: ({ onActionClick, onSecondaryClick }: any) => import("react").JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
ClickOnAfterSlotTriggersAction: {
|
|
30
|
+
play: ({ args }: any) => Promise<void>;
|
|
31
|
+
args: {
|
|
32
|
+
onActionClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
33
|
+
onSecondaryClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
34
|
+
};
|
|
35
|
+
render: ({ onActionClick, onSecondaryClick }: any) => import("react").JSX.Element;
|
|
36
|
+
};
|
|
37
|
+
ClickOnSlotButtonTriggersButton: {
|
|
38
|
+
play: ({ args }: any) => Promise<void>;
|
|
39
|
+
args: {
|
|
40
|
+
onActionClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
41
|
+
onSecondaryClick: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
42
|
+
};
|
|
43
|
+
render: ({ onActionClick, onSecondaryClick }: any) => import("react").JSX.Element;
|
|
44
|
+
};
|
|
45
|
+
};
|
package/lumx.css
CHANGED
|
@@ -685,6 +685,9 @@
|
|
|
685
685
|
* List of deprecated v2 variables that have been removed or renamed.
|
|
686
686
|
* Warning: These will be removed in the next major version.
|
|
687
687
|
*/
|
|
688
|
+
/* ==========================================================================
|
|
689
|
+
Action area
|
|
690
|
+
========================================================================== */
|
|
688
691
|
/* stylelint-disable custom-property-pattern */
|
|
689
692
|
/** @deprecated: replaced with $lumx-progress-circular-size-map */
|
|
690
693
|
/**
|
|
@@ -1099,6 +1102,10 @@ table {
|
|
|
1099
1102
|
.lumx-action-area {
|
|
1100
1103
|
position: relative;
|
|
1101
1104
|
}
|
|
1105
|
+
:where(.lumx-action-area) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
|
|
1106
|
+
position: relative;
|
|
1107
|
+
z-index: 1;
|
|
1108
|
+
}
|
|
1102
1109
|
|
|
1103
1110
|
/* Action element
|
|
1104
1111
|
========================================================================== */
|
|
@@ -8933,7 +8940,10 @@ table {
|
|
|
8933
8940
|
opacity: 0.5;
|
|
8934
8941
|
cursor: default;
|
|
8935
8942
|
}
|
|
8936
|
-
.lumx-list-
|
|
8943
|
+
.lumx-list-item:has(.lumx-action-area__action) {
|
|
8944
|
+
position: relative;
|
|
8945
|
+
}
|
|
8946
|
+
:where(.lumx-list-item:has(.lumx-action-area__action)) :where(a, button, input, select, textarea, label, [tabindex]):not(:where(.lumx-action-area__action)) {
|
|
8937
8947
|
position: relative;
|
|
8938
8948
|
z-index: 1;
|
|
8939
8949
|
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.25.
|
|
10
|
+
"@lumx/icons": "^4.25.1-next.1",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "4.25.
|
|
69
|
+
"version": "4.25.1-next.1",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -89,5 +89,6 @@
|
|
|
89
89
|
"vite": "^7.3.5",
|
|
90
90
|
"vite-tsconfig-paths": "^5.1.4",
|
|
91
91
|
"vitest": "^4.1.11"
|
|
92
|
-
}
|
|
92
|
+
},
|
|
93
|
+
"stableVersion": "4.25.0"
|
|
93
94
|
}
|
package/scss/_core.scss
CHANGED
|
@@ -52,11 +52,9 @@
|
|
|
52
52
|
@include lumx-state-disabled-input;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
position: relative;
|
|
59
|
-
z-index: 1;
|
|
55
|
+
// With an action, the list item is an action area container.
|
|
56
|
+
&:has(.lumx-action-area__action) {
|
|
57
|
+
@include lumx-action-area;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
60
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
$interactive: 'a, button, input, select, textarea, label, [tabindex]';
|
|
2
|
+
|
|
3
|
+
/* ==========================================================================
|
|
4
|
+
Action area
|
|
5
|
+
========================================================================== */
|
|
6
|
+
|
|
7
|
+
// Action area container: positioning context for the action overlay.
|
|
8
|
+
// Nested interactive elements are elevated above the overlay so they stay independently clickable,
|
|
9
|
+
// while clicks on any other content fall through to the action.
|
|
10
|
+
// (zero specificity so that components can still set their own `position` and `z-index`)
|
|
11
|
+
@mixin lumx-action-area {
|
|
12
|
+
position: relative;
|
|
13
|
+
|
|
14
|
+
@at-root :where(#{&}) :where(#{$interactive}):not(:where(.lumx-action-area__action)) {
|
|
15
|
+
position: relative;
|
|
16
|
+
z-index: 1;
|
|
17
|
+
}
|
|
18
|
+
}
|