@wallarm-org/design-system 4.8.0-rc-fix-claude-code.1 → 4.8.0-rc-feat-parser.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.
Files changed (176) hide show
  1. package/README.md +2 -4
  2. package/dist/components/BulkBar/index.d.ts +0 -5
  3. package/dist/components/Drawer/classes.js +1 -1
  4. package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
  5. package/dist/components/DropdownMenu/DropdownMenu.js +84 -71
  6. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  7. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  8. package/dist/components/Overlay/Overlay.js +1 -1
  9. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +14 -0
  10. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +209 -0
  11. package/dist/components/Rules/PointSelector/MatchStep.d.ts +15 -0
  12. package/dist/components/Rules/PointSelector/MatchStep.js +186 -0
  13. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +16 -0
  14. package/dist/components/Rules/PointSelector/MenuFooterHints.js +177 -0
  15. package/dist/components/Rules/PointSelector/PointPreview.d.ts +10 -0
  16. package/dist/components/Rules/PointSelector/PointPreview.js +88 -0
  17. package/dist/components/Rules/PointSelector/PointSelector.d.ts +17 -0
  18. package/dist/components/Rules/PointSelector/PointSelector.js +937 -0
  19. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +12 -0
  20. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +173 -0
  21. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +31 -0
  22. package/dist/components/Rules/PointSelector/PointSelectorError.js +275 -0
  23. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +20 -0
  24. package/dist/components/Rules/PointSelector/PointSelectorInput.js +130 -0
  25. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +31 -0
  26. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +317 -0
  27. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +8 -0
  28. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +73 -0
  29. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +14 -0
  30. package/dist/components/Rules/PointSelector/SampleRequest.js +116 -0
  31. package/dist/components/Rules/PointSelector/StepMenu.d.ts +40 -0
  32. package/dist/components/Rules/PointSelector/StepMenu.js +210 -0
  33. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +26 -0
  34. package/dist/components/Rules/PointSelector/VersionWarning.js +231 -0
  35. package/dist/components/Rules/PointSelector/WhereBar.d.ts +48 -0
  36. package/dist/components/Rules/PointSelector/WhereBar.js +263 -0
  37. package/dist/components/Rules/PointSelector/classes.d.ts +28 -0
  38. package/dist/components/Rules/PointSelector/classes.js +22 -0
  39. package/dist/components/Rules/PointSelector/index.d.ts +20 -0
  40. package/dist/components/Rules/PointSelector/index.js +18 -0
  41. package/dist/components/Rules/PointSelector/liftLayer.d.ts +8 -0
  42. package/dist/components/Rules/PointSelector/liftLayer.js +4 -0
  43. package/dist/components/Rules/PointSelector/sampleValue.d.ts +6 -0
  44. package/dist/components/Rules/PointSelector/sampleValue.js +51 -0
  45. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +508 -0
  46. package/dist/components/Rules/PointSelector/sdkBridge.js +339 -0
  47. package/dist/components/Rules/PointSelector/types.d.ts +304 -0
  48. package/dist/components/Rules/PointSelector/types.js +0 -0
  49. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +161 -0
  50. package/dist/components/Rules/PointSelector/usePointSelector.js +1088 -0
  51. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +28 -0
  52. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +208 -0
  53. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +23 -0
  54. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +950 -0
  55. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +21 -0
  56. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +110 -0
  57. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +20 -0
  58. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +31 -0
  59. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +23 -0
  60. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +131 -0
  61. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +17 -0
  62. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +14 -0
  63. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +6 -0
  64. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +6 -0
  65. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +24 -0
  66. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +245 -0
  67. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +15 -0
  68. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +691 -0
  69. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +19 -0
  70. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +72 -0
  71. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +27 -0
  72. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +407 -0
  73. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +14 -0
  74. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +269 -0
  75. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +25 -0
  76. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +99 -0
  77. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +14 -0
  78. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +118 -0
  79. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +14 -0
  80. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +446 -0
  81. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +14 -0
  82. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +266 -0
  83. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +35 -0
  84. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +57 -0
  85. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +15 -0
  86. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +10 -0
  87. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +67 -0
  88. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +366 -0
  89. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +32 -0
  90. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +420 -0
  91. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +27 -0
  92. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +446 -0
  93. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +7 -0
  94. package/dist/components/Rules/RuleBuilder/Summary/index.js +2 -0
  95. package/dist/components/Rules/RuleBuilder/classes.d.ts +19 -0
  96. package/dist/components/Rules/RuleBuilder/classes.js +18 -0
  97. package/dist/components/Rules/RuleBuilder/index.d.ts +55 -0
  98. package/dist/components/Rules/RuleBuilder/index.js +11 -0
  99. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +31 -0
  100. package/dist/components/Rules/RuleBuilder/models/actionModel.js +276 -0
  101. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +95 -0
  102. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +418 -0
  103. package/dist/components/Rules/RuleBuilder/models/index.d.ts +3 -0
  104. package/dist/components/Rules/RuleBuilder/models/index.js +3 -0
  105. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +176 -0
  106. package/dist/components/Rules/RuleBuilder/models/validation.js +242 -0
  107. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +27 -0
  108. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +92 -0
  109. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +1 -0
  110. package/dist/components/Rules/RuleBuilder/shared/index.js +1 -0
  111. package/dist/components/Rules/RuleBuilder/types.d.ts +384 -0
  112. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  113. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +65 -0
  114. package/dist/components/Rules/RuleBuilder/utils/constants.js +356 -0
  115. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +48 -0
  116. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +42 -0
  117. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +92 -0
  118. package/dist/components/Rules/RuleBuilder/utils/helpers.js +54 -0
  119. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +2 -0
  120. package/dist/components/Rules/RuleBuilder/utils/index.js +2 -0
  121. package/dist/components/SearchInput/SearchInput.d.ts +5 -7
  122. package/dist/components/SearchInput/SearchInput.js +101 -119
  123. package/dist/components/Select/SelectSearchInput.d.ts +1 -1
  124. package/dist/components/Table/types.d.ts +1 -1
  125. package/dist/components/Tabs/Tabs.d.ts +0 -1
  126. package/dist/components/Tabs/Tabs.js +28 -30
  127. package/dist/components/Tabs/TabsList/index.d.ts +1 -1
  128. package/dist/components/Tabs/index.d.ts +2 -2
  129. package/dist/components/Tour/TourPositioner.d.ts +0 -3
  130. package/dist/components/Tour/TourPositioner.js +4 -4
  131. package/dist/index.d.ts +3 -2
  132. package/dist/index.js +2 -1
  133. package/dist/metadata/components.json +9077 -12300
  134. package/dist/theme/typography.css +0 -5
  135. package/dist/utils/formatDateTime.d.ts +0 -6
  136. package/dist/utils/formatDateTime.js +1 -13
  137. package/package.json +4 -6
  138. package/dist/components/NotificationCenter/NotificationCenter.d.ts +0 -20
  139. package/dist/components/NotificationCenter/NotificationCenter.js +0 -65
  140. package/dist/components/NotificationCenter/NotificationCenterBody.d.ts +0 -18
  141. package/dist/components/NotificationCenter/NotificationCenterBody.js +0 -202
  142. package/dist/components/NotificationCenter/NotificationCenterContent.d.ts +0 -5
  143. package/dist/components/NotificationCenter/NotificationCenterContent.js +0 -42
  144. package/dist/components/NotificationCenter/NotificationCenterHeader.d.ts +0 -20
  145. package/dist/components/NotificationCenter/NotificationCenterHeader.js +0 -202
  146. package/dist/components/NotificationCenter/NotificationCenterItem.d.ts +0 -26
  147. package/dist/components/NotificationCenter/NotificationCenterItem.js +0 -211
  148. package/dist/components/NotificationCenter/NotificationCenterItemTime.d.ts +0 -9
  149. package/dist/components/NotificationCenter/NotificationCenterItemTime.js +0 -148
  150. package/dist/components/NotificationCenter/NotificationCenterItemTitle.d.ts +0 -14
  151. package/dist/components/NotificationCenter/NotificationCenterItemTitle.js +0 -115
  152. package/dist/components/NotificationCenter/NotificationCenterTabs.d.ts +0 -10
  153. package/dist/components/NotificationCenter/NotificationCenterTabs.js +0 -77
  154. package/dist/components/NotificationCenter/NotificationCenterTrigger.d.ts +0 -13
  155. package/dist/components/NotificationCenter/NotificationCenterTrigger.js +0 -138
  156. package/dist/components/NotificationCenter/index.d.ts +0 -9
  157. package/dist/components/NotificationCenter/index.js +0 -9
  158. package/dist/guidelines/foundations/color.md +0 -157
  159. package/dist/guidelines/foundations/focus.md +0 -122
  160. package/dist/guidelines/foundations/layering.md +0 -131
  161. package/dist/guidelines/foundations/radius-elevation.md +0 -111
  162. package/dist/guidelines/foundations/spacing.md +0 -117
  163. package/dist/guidelines/foundations/typography.md +0 -114
  164. package/dist/guidelines/patterns/app-layout.md +0 -1567
  165. package/dist/guidelines/patterns/auth-page.md +0 -668
  166. package/dist/guidelines/patterns/confirmation-dialogs.md +0 -605
  167. package/dist/guidelines/patterns/create-edit-forms.md +0 -768
  168. package/dist/guidelines/patterns/detail-drawer.md +0 -868
  169. package/dist/guidelines/patterns/empty-states.md +0 -461
  170. package/dist/guidelines/patterns/entity-table.md +0 -533
  171. package/dist/guidelines/patterns/feedback-toasts.md +0 -493
  172. package/dist/guidelines/patterns/filtering.md +0 -630
  173. package/dist/guidelines/patterns/resource-list-page.md +0 -558
  174. package/dist/guidelines/patterns/settings-page.md +0 -752
  175. package/dist/guidelines/rules.md +0 -25
  176. package/dist/metadata/guidelines.json +0 -1705
@@ -0,0 +1,446 @@
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as compiler_runtime_c } from "react/compiler-runtime";
3
+ import { cn } from "../../../../utils/cn.js";
4
+ import { useTestId } from "../../../../utils/testId.js";
5
+ import { Code } from "../../../Code/index.js";
6
+ import { Tag } from "../../../Tag/index.js";
7
+ import { Text } from "../../../Text/index.js";
8
+ import { summaryCardVariants, summaryNestedVariants, summaryVariants } from "../classes.js";
9
+ import { OPERATOR_CHOICES } from "../utils/constants.js";
10
+ function getOperatorLabel(operator) {
11
+ return OPERATOR_CHOICES.find((c)=>c.value === operator)?.label ?? operator;
12
+ }
13
+ const ConditionNodeSummary = (t0)=>{
14
+ const $ = compiler_runtime_c(67);
15
+ const { node } = t0;
16
+ switch(node.kind){
17
+ case "field":
18
+ {
19
+ const { segments, condition: conditionType, value, ignoreCase } = node.value;
20
+ segments.map(_temp).join(" → ");
21
+ let t1;
22
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
23
+ t1 = cn(summaryCardVariants());
24
+ $[0] = t1;
25
+ } else t1 = $[0];
26
+ let t2;
27
+ if ($[1] !== segments) {
28
+ t2 = segments.map(_temp2);
29
+ $[1] = segments;
30
+ $[2] = t2;
31
+ } else t2 = $[2];
32
+ let t3;
33
+ if ($[3] !== t2) {
34
+ t3 = /*#__PURE__*/ jsx("div", {
35
+ className: "flex flex-wrap items-center gap-4",
36
+ children: t2
37
+ });
38
+ $[3] = t2;
39
+ $[4] = t3;
40
+ } else t3 = $[4];
41
+ const t4 = conditionType || "condition not set";
42
+ let t5;
43
+ if ($[5] !== t4) {
44
+ t5 = /*#__PURE__*/ jsx("span", {
45
+ className: "text-text-secondary",
46
+ children: t4
47
+ });
48
+ $[5] = t4;
49
+ $[6] = t5;
50
+ } else t5 = $[6];
51
+ let t6;
52
+ if ($[7] !== value) {
53
+ t6 = value && /*#__PURE__*/ jsxs(Fragment, {
54
+ children: [
55
+ " ",
56
+ /*#__PURE__*/ jsxs("span", {
57
+ className: "font-mono text-text-primary",
58
+ children: [
59
+ '"',
60
+ value,
61
+ '"'
62
+ ]
63
+ })
64
+ ]
65
+ });
66
+ $[7] = value;
67
+ $[8] = t6;
68
+ } else t6 = $[8];
69
+ let t7;
70
+ if ($[9] !== ignoreCase) {
71
+ t7 = ignoreCase && /*#__PURE__*/ jsx("span", {
72
+ className: "text-text-secondary",
73
+ children: " (case-insensitive)"
74
+ });
75
+ $[9] = ignoreCase;
76
+ $[10] = t7;
77
+ } else t7 = $[10];
78
+ let t8;
79
+ if ($[11] !== t5 || $[12] !== t6 || $[13] !== t7) {
80
+ t8 = /*#__PURE__*/ jsxs(Text, {
81
+ size: "sm",
82
+ children: [
83
+ t5,
84
+ t6,
85
+ t7
86
+ ]
87
+ });
88
+ $[11] = t5;
89
+ $[12] = t6;
90
+ $[13] = t7;
91
+ $[14] = t8;
92
+ } else t8 = $[14];
93
+ let t9;
94
+ if ($[15] !== conditionType) {
95
+ t9 = !conditionType && /*#__PURE__*/ jsx(Text, {
96
+ size: "xs",
97
+ color: "secondary",
98
+ children: "Incomplete condition"
99
+ });
100
+ $[15] = conditionType;
101
+ $[16] = t9;
102
+ } else t9 = $[16];
103
+ let t10;
104
+ if ($[17] !== t1 || $[18] !== t3 || $[19] !== t8 || $[20] !== t9) {
105
+ t10 = /*#__PURE__*/ jsxs("div", {
106
+ className: t1,
107
+ children: [
108
+ t3,
109
+ t8,
110
+ t9
111
+ ]
112
+ });
113
+ $[17] = t1;
114
+ $[18] = t3;
115
+ $[19] = t8;
116
+ $[20] = t9;
117
+ $[21] = t10;
118
+ } else t10 = $[21];
119
+ return t10;
120
+ }
121
+ case "attack":
122
+ {
123
+ let t1;
124
+ let t2;
125
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
126
+ t1 = cn(summaryCardVariants());
127
+ t2 = /*#__PURE__*/ jsx(Text, {
128
+ size: "sm",
129
+ weight: "medium",
130
+ children: "An attack was detected"
131
+ });
132
+ $[22] = t1;
133
+ $[23] = t2;
134
+ } else {
135
+ t1 = $[22];
136
+ t2 = $[23];
137
+ }
138
+ let t3;
139
+ if ($[24] !== node.attackType) {
140
+ t3 = node.attackType && /*#__PURE__*/ jsxs(Text, {
141
+ size: "sm",
142
+ color: "secondary",
143
+ children: [
144
+ "Attack type: ",
145
+ node.attackType
146
+ ]
147
+ });
148
+ $[24] = node.attackType;
149
+ $[25] = t3;
150
+ } else t3 = $[25];
151
+ let t4;
152
+ if ($[26] !== node.point) {
153
+ t4 = node.point && "flow" !== node.point && /*#__PURE__*/ jsxs(Text, {
154
+ size: "sm",
155
+ color: "secondary",
156
+ children: [
157
+ "At: ",
158
+ node.point
159
+ ]
160
+ });
161
+ $[26] = node.point;
162
+ $[27] = t4;
163
+ } else t4 = $[27];
164
+ let t5;
165
+ if ($[28] !== t1 || $[29] !== t3 || $[30] !== t4) {
166
+ t5 = /*#__PURE__*/ jsxs("div", {
167
+ className: t1,
168
+ children: [
169
+ t2,
170
+ t3,
171
+ t4
172
+ ]
173
+ });
174
+ $[28] = t1;
175
+ $[29] = t3;
176
+ $[30] = t4;
177
+ $[31] = t5;
178
+ } else t5 = $[31];
179
+ return t5;
180
+ }
181
+ case "signal":
182
+ {
183
+ let t1;
184
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
185
+ t1 = {
186
+ key_duplicate: "Duplicate keys detected",
187
+ resource_overlimit: "Resource limit exceeded"
188
+ };
189
+ $[32] = t1;
190
+ } else t1 = $[32];
191
+ const signalLabels = t1;
192
+ let t2;
193
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
194
+ t2 = cn(summaryCardVariants());
195
+ $[33] = t2;
196
+ } else t2 = $[33];
197
+ const t3 = signalLabels[node.signalType] || "A request anomaly was detected";
198
+ let t4;
199
+ if ($[34] !== t3) {
200
+ t4 = /*#__PURE__*/ jsx(Text, {
201
+ size: "sm",
202
+ weight: "medium",
203
+ children: t3
204
+ });
205
+ $[34] = t3;
206
+ $[35] = t4;
207
+ } else t4 = $[35];
208
+ let t5;
209
+ if ($[36] !== node.point || $[37] !== node.signalType) {
210
+ t5 = "key_duplicate" === node.signalType && /*#__PURE__*/ jsxs(Text, {
211
+ size: "sm",
212
+ color: "secondary",
213
+ children: [
214
+ "In: ",
215
+ node.point
216
+ ]
217
+ });
218
+ $[36] = node.point;
219
+ $[37] = node.signalType;
220
+ $[38] = t5;
221
+ } else t5 = $[38];
222
+ let t6;
223
+ if ($[39] !== node.limit || $[40] !== node.signalType) {
224
+ t6 = "resource_overlimit" === node.signalType && node.limit && /*#__PURE__*/ jsxs(Text, {
225
+ size: "sm",
226
+ color: "secondary",
227
+ children: [
228
+ "Limit: ",
229
+ node.limit
230
+ ]
231
+ });
232
+ $[39] = node.limit;
233
+ $[40] = node.signalType;
234
+ $[41] = t6;
235
+ } else t6 = $[41];
236
+ let t7;
237
+ if ($[42] !== t2 || $[43] !== t4 || $[44] !== t5 || $[45] !== t6) {
238
+ t7 = /*#__PURE__*/ jsxs("div", {
239
+ className: t2,
240
+ children: [
241
+ t4,
242
+ t5,
243
+ t6
244
+ ]
245
+ });
246
+ $[42] = t2;
247
+ $[43] = t4;
248
+ $[44] = t5;
249
+ $[45] = t6;
250
+ $[46] = t7;
251
+ } else t7 = $[46];
252
+ return t7;
253
+ }
254
+ case "group":
255
+ {
256
+ let t1;
257
+ if ($[47] === Symbol.for("react.memo_cache_sentinel")) {
258
+ t1 = cn(summaryNestedVariants());
259
+ $[47] = t1;
260
+ } else t1 = $[47];
261
+ let t2;
262
+ if ($[48] !== node.operator) {
263
+ t2 = getOperatorLabel(node.operator);
264
+ $[48] = node.operator;
265
+ $[49] = t2;
266
+ } else t2 = $[49];
267
+ let t3;
268
+ if ($[50] !== t2) {
269
+ t3 = /*#__PURE__*/ jsxs(Text, {
270
+ size: "sm",
271
+ weight: "medium",
272
+ children: [
273
+ t2,
274
+ " of:"
275
+ ]
276
+ });
277
+ $[50] = t2;
278
+ $[51] = t3;
279
+ } else t3 = $[51];
280
+ let t4;
281
+ if ($[52] !== node.children) {
282
+ t4 = 0 === node.children.length ? /*#__PURE__*/ jsx(Text, {
283
+ size: "sm",
284
+ color: "secondary",
285
+ children: "(empty group)"
286
+ }) : node.children.map(_temp3);
287
+ $[52] = node.children;
288
+ $[53] = t4;
289
+ } else t4 = $[53];
290
+ let t5;
291
+ if ($[54] !== t1 || $[55] !== t3 || $[56] !== t4) {
292
+ t5 = /*#__PURE__*/ jsxs("div", {
293
+ className: t1,
294
+ children: [
295
+ t3,
296
+ t4
297
+ ]
298
+ });
299
+ $[54] = t1;
300
+ $[55] = t3;
301
+ $[56] = t4;
302
+ $[57] = t5;
303
+ } else t5 = $[57];
304
+ return t5;
305
+ }
306
+ case "raw":
307
+ {
308
+ let t1;
309
+ let t2;
310
+ if ($[58] === Symbol.for("react.memo_cache_sentinel")) {
311
+ t1 = cn(summaryCardVariants());
312
+ t2 = /*#__PURE__*/ jsx(Text, {
313
+ size: "xs",
314
+ color: "secondary",
315
+ children: "Raw condition (cannot be edited):"
316
+ });
317
+ $[58] = t1;
318
+ $[59] = t2;
319
+ } else {
320
+ t1 = $[58];
321
+ t2 = $[59];
322
+ }
323
+ let t3;
324
+ if ($[60] !== node.check) {
325
+ t3 = JSON.stringify(node.check, null, 2);
326
+ $[60] = node.check;
327
+ $[61] = t3;
328
+ } else t3 = $[61];
329
+ let t4;
330
+ if ($[62] !== t3) {
331
+ t4 = /*#__PURE__*/ jsx(Code, {
332
+ size: "s",
333
+ className: "break-all",
334
+ children: t3
335
+ });
336
+ $[62] = t3;
337
+ $[63] = t4;
338
+ } else t4 = $[63];
339
+ let t5;
340
+ if ($[64] !== t1 || $[65] !== t4) {
341
+ t5 = /*#__PURE__*/ jsxs("div", {
342
+ className: t1,
343
+ children: [
344
+ t2,
345
+ t4
346
+ ]
347
+ });
348
+ $[64] = t1;
349
+ $[65] = t4;
350
+ $[66] = t5;
351
+ } else t5 = $[66];
352
+ return t5;
353
+ }
354
+ default:
355
+ return null;
356
+ }
357
+ };
358
+ const ConditionSummary = (t0)=>{
359
+ const $ = compiler_runtime_c(14);
360
+ const { ref, "data-testid": testIdProp, condition, className } = t0;
361
+ const testId = useTestId("condition-summary");
362
+ const finalTestId = testIdProp ?? testId;
363
+ let t1;
364
+ if ($[0] !== className) {
365
+ t1 = cn(summaryVariants(), className);
366
+ $[0] = className;
367
+ $[1] = t1;
368
+ } else t1 = $[1];
369
+ let t2;
370
+ if ($[2] !== condition.operator) {
371
+ t2 = getOperatorLabel(condition.operator).toLowerCase();
372
+ $[2] = condition.operator;
373
+ $[3] = t2;
374
+ } else t2 = $[3];
375
+ let t3;
376
+ if ($[4] !== t2) {
377
+ t3 = /*#__PURE__*/ jsx("div", {
378
+ className: "flex items-center gap-8",
379
+ children: /*#__PURE__*/ jsxs(Text, {
380
+ size: "sm",
381
+ weight: "medium",
382
+ children: [
383
+ "If a request matches ",
384
+ t2,
385
+ ":"
386
+ ]
387
+ })
388
+ });
389
+ $[4] = t2;
390
+ $[5] = t3;
391
+ } else t3 = $[5];
392
+ let t4;
393
+ if ($[6] !== condition.children) {
394
+ t4 = 0 === condition.children.length ? /*#__PURE__*/ jsx(Text, {
395
+ size: "sm",
396
+ color: "secondary",
397
+ children: "No conditions — the rule applies to every request."
398
+ }) : /*#__PURE__*/ jsx("div", {
399
+ className: "flex flex-col gap-8",
400
+ children: condition.children.map(_temp4)
401
+ });
402
+ $[6] = condition.children;
403
+ $[7] = t4;
404
+ } else t4 = $[7];
405
+ let t5;
406
+ if ($[8] !== finalTestId || $[9] !== ref || $[10] !== t1 || $[11] !== t3 || $[12] !== t4) {
407
+ t5 = /*#__PURE__*/ jsxs("div", {
408
+ ref: ref,
409
+ "data-slot": "condition-summary",
410
+ "data-testid": finalTestId,
411
+ className: t1,
412
+ children: [
413
+ t3,
414
+ t4
415
+ ]
416
+ });
417
+ $[8] = finalTestId;
418
+ $[9] = ref;
419
+ $[10] = t1;
420
+ $[11] = t3;
421
+ $[12] = t4;
422
+ $[13] = t5;
423
+ } else t5 = $[13];
424
+ return t5;
425
+ };
426
+ ConditionSummary.displayName = "ConditionSummary";
427
+ function _temp(seg) {
428
+ return seg.label || seg.text;
429
+ }
430
+ function _temp2(seg_0, i) {
431
+ return /*#__PURE__*/ jsx(Tag, {
432
+ size: "medium",
433
+ children: seg_0.label || seg_0.text
434
+ }, i);
435
+ }
436
+ function _temp3(child) {
437
+ return /*#__PURE__*/ jsx(ConditionNodeSummary, {
438
+ node: child
439
+ }, child.id);
440
+ }
441
+ function _temp4(child) {
442
+ return /*#__PURE__*/ jsx(ConditionNodeSummary, {
443
+ node: child
444
+ }, child.id);
445
+ }
446
+ export { ConditionSummary };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Summary Components
3
+ *
4
+ * Read-only display components for conditions and actions.
5
+ */
6
+ export { ActionSummary, type ActionSummaryProps } from './ActionSummary.js';
7
+ export { ConditionSummary, type ConditionSummaryProps } from './ConditionSummary.js';
@@ -0,0 +1,2 @@
1
+ export { ActionSummary } from "./ActionSummary.js";
2
+ export { ConditionSummary } from "./ConditionSummary.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * RuleBuilder CVA variants
3
+ */
4
+ /**
5
+ * Main RuleBuilder container variants
6
+ */
7
+ export declare const ruleBuilderVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ /**
9
+ * Summary container variants (for read-only views)
10
+ */
11
+ export declare const summaryVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
12
+ /**
13
+ * Summary card variants (for individual condition/action display)
14
+ */
15
+ export declare const summaryCardVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ /**
17
+ * Summary nested group variants (for nested condition groups)
18
+ */
19
+ export declare const summaryNestedVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,18 @@
1
+ import { cva } from "class-variance-authority";
2
+ const ruleBuilderVariants = cva('flex flex-col gap-20', {
3
+ variants: {},
4
+ defaultVariants: {}
5
+ });
6
+ const summaryVariants = cva('flex flex-col gap-12', {
7
+ variants: {},
8
+ defaultVariants: {}
9
+ });
10
+ const summaryCardVariants = cva('rounded-8 border border-border-primary-light p-12 flex flex-col gap-8', {
11
+ variants: {},
12
+ defaultVariants: {}
13
+ });
14
+ const summaryNestedVariants = cva('border-l-2 border-border-primary-light pl-12 ml-8 flex flex-col gap-8', {
15
+ variants: {},
16
+ defaultVariants: {}
17
+ });
18
+ export { ruleBuilderVariants, summaryCardVariants, summaryNestedVariants, summaryVariants };
@@ -0,0 +1,55 @@
1
+ /**
2
+ * RuleBuilder - Rule authoring component for Wallarm WAF rules
3
+ *
4
+ * A compound component system for building and editing Wallarm WAF rules.
5
+ * Integrates with PointSelector for point selection and provides full CRUD
6
+ * operations for condition trees and action configuration.
7
+ *
8
+ * ## Foundational Layer (Phase 1)
9
+ *
10
+ * This file exports the foundational types, models, and utilities.
11
+ * UI components (RuleBuilder, ConditionTree, ActionEditor, etc.) will be
12
+ * added in Phase 2.
13
+ *
14
+ * ## Usage
15
+ *
16
+ * ```typescript
17
+ * import {
18
+ * type GroupCondition,
19
+ * type ActionDraft,
20
+ * newGroup,
21
+ * newAction,
22
+ * toProtonCondition,
23
+ * toProtonAction,
24
+ * fromProtonCondition,
25
+ * fromProtonAction,
26
+ * conditionProblems,
27
+ * actionProblems,
28
+ * } from '@wallarm-org/design-system';
29
+ *
30
+ * // Create new condition tree
31
+ * const condition = newGroup('and');
32
+ *
33
+ * // Create new action
34
+ * const action = newAction('add_attack');
35
+ *
36
+ * // Validate
37
+ * const errors = conditionProblems(condition);
38
+ *
39
+ * // Convert to API format
40
+ * const protonCondition = toProtonCondition(condition);
41
+ * const protonAction = toProtonAction(action);
42
+ * ```
43
+ */
44
+ export { ActionEditor, type ActionEditorProps, ActionFields, type ActionFieldsProps, ActionTargetPicker, type ActionTargetPickerProps, ActionTypeSelect, type ActionTypeSelectProps, AttackTypeField, type AttackTypeFieldProps, actionEditorVariants, actionFieldsVariants, actionTargetPickerVariants, } from './ActionEditor/index.js';
45
+ export { AddConditionMenu, type AddConditionMenuProps, AttackCondition as AttackConditionComponent, type AttackConditionProps, addConditionButtonVariants, ConditionCard, type ConditionCardProps, ConditionTree, type ConditionTreeProps, conditionCardVariants, conditionTreeVariants, FieldCondition as FieldConditionComponent, type FieldConditionProps, GroupCondition as GroupConditionComponent, type GroupConditionProps, groupBorderVariants, operatorSelectVariants, SampleCondition as SampleConditionComponent, type SampleConditionProps, SignalCondition as SignalConditionComponent, type SignalConditionProps, TagCondition as TagConditionComponent, type TagConditionProps, } from './ConditionTree/index.js';
46
+ export { ruleBuilderVariants, summaryCardVariants, summaryNestedVariants, summaryVariants, } from './classes.js';
47
+ export { fromProtonAction, newAction, toProtonAction, } from './models/actionModel.js';
48
+ export { conditionProblems, EMPTY_FIELD_VALUE, fieldComplete, fromProtonCondition, newAttack, newField, newGroup, newSample, newSignal, newTag, nodeId, toProtonCondition, } from './models/conditionModel.js';
49
+ export { actionProblems, isActionValid, isValidDuration, isValidInteger, isValidQuantity, validators, } from './models/validation.js';
50
+ export { RuleBuilder, type RuleBuilderProps, type RuleBuilderSection } from './RuleBuilder.js';
51
+ export { ActionSummary, type ActionSummaryProps, ConditionSummary, type ConditionSummaryProps, } from './Summary/index.js';
52
+ export { ChoiceSelect, type ChoiceSelectProps } from './shared/index.js';
53
+ export type { ActionDraft, ActionKind, ActionTarget, AttackCondition, Choice, ConditionNode, FieldCondition, GroupCondition, GroupOperator, ProtonAction, ProtonCheck, ProtonCondition, RawCondition, SampleCondition, SignalCondition, SignalType, TagCondition, } from './types.js';
54
+ export { ACTION_KIND_CHOICES, ADDABLE_NODE_KINDS, CHECK_TYPE_CHOICES, CONTEXT_CHOICES, DEFAULT_PRIORITY, DEFAULT_SEPARATOR, DUPLICATE_CONTAINERS, OPERATOR_CHOICES, RESOURCE_LIMITS, SIGNAL_TYPE_CHOICES, TARGET_REQUIREMENT, } from './utils/constants.js';
55
+ export { countChecks, countNodesOfKind, findNodeById, getLeafNodes, hasDescendantOfKind, isLeafNode, mapNode, maxDepth, removeNode, } from './utils/helpers.js';
@@ -0,0 +1,11 @@
1
+ export { ActionEditor, ActionFields, ActionTargetPicker, ActionTypeSelect, AttackTypeField, actionEditorVariants, actionFieldsVariants, actionTargetPickerVariants } from "./ActionEditor/index.js";
2
+ export { AddConditionMenu, AttackCondition as AttackConditionComponent, ConditionCard, ConditionTree, FieldCondition as FieldConditionComponent, GroupCondition as GroupConditionComponent, SampleCondition as SampleConditionComponent, SignalCondition as SignalConditionComponent, TagCondition as TagConditionComponent, addConditionButtonVariants, conditionCardVariants, conditionTreeVariants, groupBorderVariants, operatorSelectVariants } from "./ConditionTree/index.js";
3
+ export { ruleBuilderVariants, summaryCardVariants, summaryNestedVariants, summaryVariants } from "./classes.js";
4
+ export { fromProtonAction, newAction, toProtonAction } from "./models/actionModel.js";
5
+ export { EMPTY_FIELD_VALUE, conditionProblems, fieldComplete, fromProtonCondition, newAttack, newField, newGroup, newSample, newSignal, newTag, nodeId, toProtonCondition } from "./models/conditionModel.js";
6
+ export { actionProblems, isActionValid, isValidDuration, isValidInteger, isValidQuantity, validators } from "./models/validation.js";
7
+ export { RuleBuilder } from "./RuleBuilder.js";
8
+ export { ActionSummary, ConditionSummary } from "./Summary/index.js";
9
+ export { ChoiceSelect } from "./shared/index.js";
10
+ export { ACTION_KIND_CHOICES, ADDABLE_NODE_KINDS, CHECK_TYPE_CHOICES, CONTEXT_CHOICES, DEFAULT_PRIORITY, DEFAULT_SEPARATOR, DUPLICATE_CONTAINERS, OPERATOR_CHOICES, RESOURCE_LIMITS, SIGNAL_TYPE_CHOICES, TARGET_REQUIREMENT } from "./utils/constants.js";
11
+ export { countChecks, countNodesOfKind, findNodeById, getLeafNodes, hasDescendantOfKind, isLeafNode, mapNode, maxDepth, removeNode } from "./utils/helpers.js";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Action Model
3
+ *
4
+ * Converts between UI action draft and Proton API format.
5
+ * Handles action transformations, factory functions, and validation.
6
+ */
7
+ import type { Proton } from '@wallarm-org/rules-lib';
8
+ import type { ActionDraft, ActionKind, ProtonAction } from '../types.js';
9
+ /**
10
+ * Create a new action draft with default values.
11
+ *
12
+ * @param kind - Action kind (default: 'add_attack')
13
+ * @returns New ActionDraft
14
+ */
15
+ export declare function newAction(kind?: ActionKind): ActionDraft;
16
+ /**
17
+ * Convert UI action draft to Proton API format.
18
+ *
19
+ * @param draft - Action draft
20
+ * @param proton - Optional Proton SDK instance for canonical point rendering
21
+ * @returns Proton action object
22
+ */
23
+ export declare function toProtonAction(draft: ActionDraft, proton?: Proton | null): ProtonAction;
24
+ /**
25
+ * Convert Proton API format to UI action draft.
26
+ *
27
+ * @param action - Proton action (may be array or object)
28
+ * @param proton - SDK instance for parsing point strings (optional)
29
+ * @returns ActionDraft
30
+ */
31
+ export declare function fromProtonAction(action: unknown, proton?: Proton | null): ActionDraft;