@wallarm-org/design-system 4.11.0 → 4.12.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/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +84 -71
- package/dist/components/DropdownMenu/DropdownMenuContent.js +1 -0
- package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/metadata/components.json +14 -2
- package/dist/metadata/guidelines.json +1 -1
- package/package.json +1 -1
|
@@ -20,6 +20,8 @@ interface DropdownMenuProps extends TestableProps {
|
|
|
20
20
|
onHighlightChange?: (details: Menu.HighlightChangeDetails) => void;
|
|
21
21
|
/** Whether selecting an item closes the menu (default true) */
|
|
22
22
|
closeOnSelect?: boolean;
|
|
23
|
+
/** Whether to close the menu when clicking/interacting outside (default true) */
|
|
24
|
+
closeOnInteractOutside?: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Called when another layer asks this menu to dismiss — e.g. a layer below it in the stack is
|
|
25
27
|
* removed. Call `event.preventDefault()` to keep the menu open.
|
|
@@ -16,9 +16,10 @@ const SUB_POSITIONING = {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
const DropdownMenu = (t0)=>{
|
|
19
|
-
const $ = c(
|
|
19
|
+
const $ = c(43);
|
|
20
20
|
let anchorPoint;
|
|
21
21
|
let children;
|
|
22
|
+
let closeOnInteractOutside;
|
|
22
23
|
let closeOnSelect;
|
|
23
24
|
let defaultOpen;
|
|
24
25
|
let highlightedValue;
|
|
@@ -30,33 +31,35 @@ const DropdownMenu = (t0)=>{
|
|
|
30
31
|
let props;
|
|
31
32
|
let testIdProp;
|
|
32
33
|
if ($[0] !== t0) {
|
|
33
|
-
({ children, open, defaultOpen, onOpenChange, anchorPoint, positioning, highlightedValue, onHighlightChange, closeOnSelect, ids, "data-testid": testIdProp, ...props } = t0);
|
|
34
|
+
({ children, open, defaultOpen, onOpenChange, anchorPoint, positioning, highlightedValue, onHighlightChange, closeOnSelect, closeOnInteractOutside, ids, "data-testid": testIdProp, ...props } = t0);
|
|
34
35
|
$[0] = t0;
|
|
35
36
|
$[1] = anchorPoint;
|
|
36
37
|
$[2] = children;
|
|
37
|
-
$[3] =
|
|
38
|
-
$[4] =
|
|
39
|
-
$[5] =
|
|
40
|
-
$[6] =
|
|
41
|
-
$[7] =
|
|
42
|
-
$[8] =
|
|
43
|
-
$[9] =
|
|
44
|
-
$[10] =
|
|
45
|
-
$[11] =
|
|
46
|
-
$[12] =
|
|
38
|
+
$[3] = closeOnInteractOutside;
|
|
39
|
+
$[4] = closeOnSelect;
|
|
40
|
+
$[5] = defaultOpen;
|
|
41
|
+
$[6] = highlightedValue;
|
|
42
|
+
$[7] = ids;
|
|
43
|
+
$[8] = onHighlightChange;
|
|
44
|
+
$[9] = onOpenChange;
|
|
45
|
+
$[10] = open;
|
|
46
|
+
$[11] = positioning;
|
|
47
|
+
$[12] = props;
|
|
48
|
+
$[13] = testIdProp;
|
|
47
49
|
} else {
|
|
48
50
|
anchorPoint = $[1];
|
|
49
51
|
children = $[2];
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
closeOnInteractOutside = $[3];
|
|
53
|
+
closeOnSelect = $[4];
|
|
54
|
+
defaultOpen = $[5];
|
|
55
|
+
highlightedValue = $[6];
|
|
56
|
+
ids = $[7];
|
|
57
|
+
onHighlightChange = $[8];
|
|
58
|
+
onOpenChange = $[9];
|
|
59
|
+
open = $[10];
|
|
60
|
+
positioning = $[11];
|
|
61
|
+
props = $[12];
|
|
62
|
+
testIdProp = $[13];
|
|
60
63
|
}
|
|
61
64
|
const inheritedTestId = useTestId();
|
|
62
65
|
const testId = testIdProp ?? inheritedTestId;
|
|
@@ -64,64 +67,73 @@ const DropdownMenu = (t0)=>{
|
|
|
64
67
|
const isNested = null !== parent;
|
|
65
68
|
const defaultPositioning = isNested ? SUB_POSITIONING : ROOT_POSITIONING;
|
|
66
69
|
let t1;
|
|
67
|
-
if ($[
|
|
70
|
+
if ($[14] !== onOpenChange) {
|
|
68
71
|
t1 = (details)=>{
|
|
69
72
|
onOpenChange?.(details.open);
|
|
70
73
|
};
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
} else t1 = $[
|
|
74
|
+
$[14] = onOpenChange;
|
|
75
|
+
$[15] = t1;
|
|
76
|
+
} else t1 = $[15];
|
|
74
77
|
const handleOpenChange = t1;
|
|
75
78
|
let t2;
|
|
76
|
-
if ($[
|
|
79
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
77
80
|
t2 = {
|
|
78
81
|
isNested: true
|
|
79
82
|
};
|
|
80
|
-
$[
|
|
81
|
-
} else t2 = $[
|
|
83
|
+
$[16] = t2;
|
|
84
|
+
} else t2 = $[16];
|
|
82
85
|
const ctx = t2;
|
|
83
86
|
const t3 = positioning ?? defaultPositioning;
|
|
84
87
|
let t4;
|
|
85
|
-
if ($[
|
|
88
|
+
if ($[17] !== anchorPoint) {
|
|
86
89
|
t4 = null != anchorPoint && {
|
|
87
90
|
anchorPoint
|
|
88
91
|
};
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
} else t4 = $[
|
|
92
|
+
$[17] = anchorPoint;
|
|
93
|
+
$[18] = t4;
|
|
94
|
+
} else t4 = $[18];
|
|
92
95
|
let t5;
|
|
93
|
-
if ($[
|
|
96
|
+
if ($[19] !== highlightedValue) {
|
|
94
97
|
t5 = null != highlightedValue && {
|
|
95
98
|
highlightedValue
|
|
96
99
|
};
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
} else t5 = $[
|
|
100
|
+
$[19] = highlightedValue;
|
|
101
|
+
$[20] = t5;
|
|
102
|
+
} else t5 = $[20];
|
|
100
103
|
let t6;
|
|
101
|
-
if ($[
|
|
104
|
+
if ($[21] !== closeOnSelect) {
|
|
102
105
|
t6 = null != closeOnSelect && {
|
|
103
106
|
closeOnSelect
|
|
104
107
|
};
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
} else t6 = $[
|
|
108
|
+
$[21] = closeOnSelect;
|
|
109
|
+
$[22] = t6;
|
|
110
|
+
} else t6 = $[22];
|
|
108
111
|
let t7;
|
|
109
|
-
if ($[
|
|
110
|
-
t7 = null !=
|
|
111
|
-
|
|
112
|
+
if ($[23] !== closeOnInteractOutside) {
|
|
113
|
+
t7 = null != closeOnInteractOutside && {
|
|
114
|
+
closeOnInteractOutside
|
|
112
115
|
};
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
} else t7 = $[
|
|
116
|
+
$[23] = closeOnInteractOutside;
|
|
117
|
+
$[24] = t7;
|
|
118
|
+
} else t7 = $[24];
|
|
116
119
|
let t8;
|
|
117
|
-
if ($[
|
|
118
|
-
t8 =
|
|
120
|
+
if ($[25] !== onHighlightChange) {
|
|
121
|
+
t8 = null != onHighlightChange && {
|
|
122
|
+
onHighlightChange
|
|
123
|
+
};
|
|
124
|
+
$[25] = onHighlightChange;
|
|
125
|
+
$[26] = t8;
|
|
126
|
+
} else t8 = $[26];
|
|
127
|
+
let t9;
|
|
128
|
+
if ($[27] !== children || $[28] !== defaultOpen || $[29] !== handleOpenChange || $[30] !== ids || $[31] !== open || $[32] !== props || $[33] !== t3 || $[34] !== t4 || $[35] !== t5 || $[36] !== t6 || $[37] !== t7 || $[38] !== t8) {
|
|
129
|
+
t9 = /*#__PURE__*/ jsx(Menu.Root, {
|
|
119
130
|
...props,
|
|
120
131
|
positioning: t3,
|
|
121
132
|
...t4,
|
|
122
133
|
...t5,
|
|
123
134
|
...t6,
|
|
124
135
|
...t7,
|
|
136
|
+
...t8,
|
|
125
137
|
open: open,
|
|
126
138
|
defaultOpen: defaultOpen,
|
|
127
139
|
onOpenChange: handleOpenChange,
|
|
@@ -130,34 +142,35 @@ const DropdownMenu = (t0)=>{
|
|
|
130
142
|
unmountOnExit: true,
|
|
131
143
|
children: children
|
|
132
144
|
});
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
$[27] = children;
|
|
146
|
+
$[28] = defaultOpen;
|
|
147
|
+
$[29] = handleOpenChange;
|
|
148
|
+
$[30] = ids;
|
|
149
|
+
$[31] = open;
|
|
150
|
+
$[32] = props;
|
|
151
|
+
$[33] = t3;
|
|
152
|
+
$[34] = t4;
|
|
153
|
+
$[35] = t5;
|
|
154
|
+
$[36] = t6;
|
|
155
|
+
$[37] = t7;
|
|
156
|
+
$[38] = t8;
|
|
157
|
+
$[39] = t9;
|
|
158
|
+
} else t9 = $[39];
|
|
159
|
+
const root = t9;
|
|
160
|
+
let t10;
|
|
161
|
+
if ($[40] !== root || $[41] !== testId) {
|
|
162
|
+
t10 = /*#__PURE__*/ jsx(DropdownMenuContext.Provider, {
|
|
150
163
|
value: ctx,
|
|
151
164
|
children: /*#__PURE__*/ jsx(TestIdProvider, {
|
|
152
165
|
value: testId,
|
|
153
166
|
children: root
|
|
154
167
|
})
|
|
155
168
|
});
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
} else
|
|
160
|
-
return
|
|
169
|
+
$[40] = root;
|
|
170
|
+
$[41] = testId;
|
|
171
|
+
$[42] = t10;
|
|
172
|
+
} else t10 = $[42];
|
|
173
|
+
return t10;
|
|
161
174
|
};
|
|
162
175
|
DropdownMenu.displayName = "DropdownMenu";
|
|
163
176
|
export { DropdownMenu };
|
|
@@ -83,6 +83,7 @@ const DropdownMenuContent = (t0)=>{
|
|
|
83
83
|
let t6;
|
|
84
84
|
if ($[15] !== cascadeBase || $[16] !== menuChildren) {
|
|
85
85
|
t6 = /*#__PURE__*/ jsx(ScrollAreaViewport, {
|
|
86
|
+
"data-no-autofocus": "",
|
|
86
87
|
children: /*#__PURE__*/ jsx(ScrollAreaContent, {
|
|
87
88
|
className: t5,
|
|
88
89
|
children: /*#__PURE__*/ jsx(TestIdProvider, {
|
|
@@ -9,7 +9,7 @@ const DropdownMenuItemDescription = (t0)=>{
|
|
|
9
9
|
let t1;
|
|
10
10
|
if ($[0] !== children || $[1] !== testId) {
|
|
11
11
|
t1 = /*#__PURE__*/ jsx(Text, {
|
|
12
|
-
size: "
|
|
12
|
+
size: "xs",
|
|
13
13
|
color: "secondary",
|
|
14
14
|
"data-slot": "dropdown-menu-item-description",
|
|
15
15
|
"data-testid": testId,
|
package/dist/index.d.ts
CHANGED
|
@@ -118,4 +118,5 @@ export { UtilityPage, type UtilityPageProps } from './components/UtilityPage/ind
|
|
|
118
118
|
export { ApprovalCardView, type ApprovalCardViewProps, ChainOfThoughtView, type ChainOfThoughtViewProps, type ChatApprovalOption, type ChatApprovalOptionKind, type ChatApprovalPart, type ChatApprovalResponse, type ChatApprovalStatus, type ChatAssistantMessage, type ChatAssistantPart, type ChatChainOfThoughtPart, type ChatContextItem, type ChatCustomPart, type ChatErrorPart, type ChatFeedback, type ChatIconKey, type ChatId, type ChatLabels, type ChatMarkdownProps, type ChatMessage, type ChatMessageActionNodes, ChatMessageView, type ChatMessageViewProps, type ChatMeta, type ChatOpen, type ChatPart, type ChatPartRenderContext, ChatPartView, type ChatPartViewProps, type ChatSnapshot, type ChatStatus, type ChatStep, type ChatStepKind, type ChatStepRenderContext, type ChatStepStatus, type ChatSuggestionItem, type ChatTextPart, type ChatToolPermission, type ChatUserMessage, type ChatUserPart, type ChatViewConfig, ChatViewProvider, type ChatViewProviderProps, type ChatViewState, copyTextOf, DEFAULT_CHAT_LABELS, deriveChatState, WallyAssistant, type WallyAssistantProps, } from './components/WallyAssistant/index.js';
|
|
119
119
|
export { WallyIcon, type WallyIconProps, type WallyIconSize, type WallyIconStyle, } from './components/WallyIcon/index.js';
|
|
120
120
|
export { WallySkeleton, type WallySkeletonProps } from './components/WallySkeleton/index.js';
|
|
121
|
+
export { cn } from './utils/cn.js';
|
|
121
122
|
export { type TestableProps, TestIdProvider, useTestId } from './utils/testId.js';
|
package/dist/index.js
CHANGED
|
@@ -107,4 +107,5 @@ export { UtilityPage } from "./components/UtilityPage/index.js";
|
|
|
107
107
|
export { ApprovalCardView, ChainOfThoughtView, ChatMessageView, ChatPartView, ChatViewProvider, DEFAULT_CHAT_LABELS, WallyAssistant, copyTextOf, deriveChatState } from "./components/WallyAssistant/index.js";
|
|
108
108
|
export { WallyIcon } from "./components/WallyIcon/index.js";
|
|
109
109
|
export { WallySkeleton } from "./components/WallySkeleton/index.js";
|
|
110
|
+
export { cn } from "./utils/cn.js";
|
|
110
111
|
export { TestIdProvider, useTestId } from "./utils/testId.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
3
|
-
"generatedAt": "2026-11-
|
|
2
|
+
"version": "4.12.0",
|
|
3
|
+
"generatedAt": "2026-11-10T08:02:37.225Z",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"name": "Accordion",
|
|
@@ -2758,6 +2758,12 @@
|
|
|
2758
2758
|
"required": false,
|
|
2759
2759
|
"description": "Whether selecting an item closes the menu (default true)"
|
|
2760
2760
|
},
|
|
2761
|
+
{
|
|
2762
|
+
"name": "closeOnInteractOutside",
|
|
2763
|
+
"type": "boolean | undefined",
|
|
2764
|
+
"required": false,
|
|
2765
|
+
"description": "Whether to close the menu when clicking/interacting outside (default true)"
|
|
2766
|
+
},
|
|
2761
2767
|
{
|
|
2762
2768
|
"name": "onRequestDismiss",
|
|
2763
2769
|
"type": "((event: LayerDismissEvent) => void) | undefined",
|
|
@@ -12683,6 +12689,12 @@
|
|
|
12683
12689
|
"required": false,
|
|
12684
12690
|
"description": "Whether selecting an item closes the menu (default true)"
|
|
12685
12691
|
},
|
|
12692
|
+
{
|
|
12693
|
+
"name": "closeOnInteractOutside",
|
|
12694
|
+
"type": "boolean | undefined",
|
|
12695
|
+
"required": false,
|
|
12696
|
+
"description": "Whether to close the menu when clicking/interacting outside (default true)"
|
|
12697
|
+
},
|
|
12686
12698
|
{
|
|
12687
12699
|
"name": "onRequestDismiss",
|
|
12688
12700
|
"type": "((event: LayerDismissEvent) => void) | undefined",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.
|
|
2
|
+
"version": "4.12.0",
|
|
3
3
|
"rules": "Every numeric utility is in px, not 4px steps: p-16 is 16px, p-4 is 4px. Translate Tailwind habits (p-4 → p-16, gap-6 → gap-24, w-64 → w-256).\n\nBefore composing a screen, call get_guideline for the pattern (app shell, list page, table, drawer, form, dialog, filters, empty state, settings, auth). Wrong → right:\n\n- p-5, gap-3, p-10 → stay on the scale: 1, 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 64…\n- space-y-4, margins per child → <VStack gap={16}>, <HStack gap={8}>\n- Padded page wrapper → PageHeader / PageToolbar / PageContent own the 24px gutter\n- p-* on Card, DrawerBody, DialogBody, PageToolbar, Table → none; they own their padding\n- className on Text, Heading, Field, Drawer/Dialog Header/Body/Footer → wrap in your own element\n- Raw <h1>, <p>, <label> → <Heading as=\"h2\" size=\"lg\">, <Text size=\"sm\">, Field\n- <Text> default (16px) for body → size=\"sm\"\n- leading-none (0px), leading-5 (5px) → leading-sm, leading-20\n- weight=\"semibold\" → weight is light|regular|medium|bold (medium = 450)\n- bg-primary, text-muted, bg-card, bg-white → bg-bg-primary, text-text-secondary, bg-bg-surface-1\n- text-error, bg-red-500 → danger tokens; categorical color → Badge color\n- dark: variant, setting data-theme → semantic tokens, useTheme().setTheme()\n- rounded-lg, rounded, rounded-[15px] → rounded-8 (controls), rounded-12 (panels)\n- shadow-* on DS components, z-* on overlays → never; they own both\n- focus:ring → focus-visible:ring-3 ring-focus-primary outline-none\n- size, DIALOG/DRAWER_SIZES → width: Dialog 400 confirm, 560 default, 960 picker; Drawer 640 default, 700 Timeline form\n- Dialog, useToast from the root → @wallarm-org/design-system/Dialog, /Toast\n- Field invalid → error on the control + FieldError\n- Table actions column → meta.renderMenuAction on the master column\n- Hand-built side menu → RemoteShell config={NavConfig}\n- ConfirmDialog, FilterBar, Combobox → compose Dialog parts, PageToolbar + FilterDropdown, Select + useSelectSearch\n- data-slot in tests → data-testid\n",
|
|
4
4
|
"guidelines": [
|
|
5
5
|
{
|