@wallarm-org/design-system 4.10.0-rc-feat-parser.1 → 4.10.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 (150) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Badge/generateBadgeVariants.js +9 -28
  3. package/dist/components/Checkbox/CheckboxGroup.d.ts +2 -1
  4. package/dist/components/Checkbox/CheckboxGroup.js +16 -13
  5. package/dist/components/CodeSnippet/internal/FoldToggle.js +1 -1
  6. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
  7. package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
  8. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  9. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  10. package/dist/components/Radio/RadioGroup.d.ts +2 -1
  11. package/dist/components/Radio/RadioGroup.js +16 -13
  12. package/dist/components/SimpleCharts/Chart/classes.js +1 -1
  13. package/dist/components/SimpleCharts/HorizontalBarStack/classes.js +1 -1
  14. package/dist/components/SimpleCharts/Metric/classes.d.ts +2 -2
  15. package/dist/components/SimpleCharts/Metric/classes.js +2 -2
  16. package/dist/components/Table/TableBody/TableBodyCell.js +4 -1
  17. package/dist/guidelines/patterns/complex-drawer.md +1084 -0
  18. package/dist/guidelines/patterns/confirmation-dialogs.md +3 -11
  19. package/dist/guidelines/patterns/detail-drawer.md +31 -13
  20. package/dist/guidelines/patterns/empty-states.md +6 -5
  21. package/dist/guidelines/patterns/entity-table.md +25 -29
  22. package/dist/guidelines/patterns/feedback-toasts.md +3 -11
  23. package/dist/guidelines/patterns/resource-list-page.md +14 -16
  24. package/dist/guidelines/rules.md +6 -5
  25. package/dist/guidelines/templates/ai-assistant.md +1133 -0
  26. package/dist/guidelines/templates/api-inventory.md +905 -0
  27. package/dist/guidelines/templates/attack-events.md +2722 -0
  28. package/dist/guidelines/templates/incident-detail.md +2085 -0
  29. package/dist/guidelines/templates/integrations-settings.md +836 -0
  30. package/dist/guidelines/templates/page-states.md +798 -0
  31. package/dist/guidelines/templates/rule-editor.md +886 -0
  32. package/dist/guidelines/templates/security-dashboard.md +681 -0
  33. package/dist/index.d.ts +0 -2
  34. package/dist/index.js +0 -2
  35. package/dist/metadata/components.json +20 -108
  36. package/dist/metadata/guidelines.json +1204 -37
  37. package/dist/theme/tokens.test.ts +52 -0
  38. package/package.json +1 -4
  39. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
  40. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
  41. package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
  42. package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
  43. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
  44. package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
  45. package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
  46. package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
  47. package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
  48. package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
  49. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
  50. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
  51. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
  52. package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
  53. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
  54. package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
  55. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
  56. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
  57. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
  58. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
  59. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
  60. package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
  61. package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
  62. package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
  63. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
  64. package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
  65. package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
  66. package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
  67. package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
  68. package/dist/components/Rules/PointSelector/classes.js +0 -22
  69. package/dist/components/Rules/PointSelector/index.d.ts +0 -20
  70. package/dist/components/Rules/PointSelector/index.js +0 -18
  71. package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
  72. package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
  73. package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
  74. package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
  75. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
  76. package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
  77. package/dist/components/Rules/PointSelector/types.d.ts +0 -304
  78. package/dist/components/Rules/PointSelector/types.js +0 -0
  79. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
  80. package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
  81. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
  82. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
  83. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
  84. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
  85. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
  86. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
  87. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
  88. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
  89. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
  90. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
  91. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
  92. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
  93. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
  94. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
  95. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
  96. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
  97. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
  98. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
  99. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
  100. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
  101. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
  102. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
  103. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
  104. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
  105. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
  106. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
  107. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
  108. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
  109. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
  110. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
  111. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
  112. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
  113. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
  114. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
  115. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
  116. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
  117. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
  118. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
  119. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
  120. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
  121. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
  122. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
  123. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
  124. package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
  125. package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
  126. package/dist/components/Rules/RuleBuilder/classes.js +0 -18
  127. package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
  128. package/dist/components/Rules/RuleBuilder/index.js +0 -11
  129. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
  130. package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
  131. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
  132. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
  133. package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
  134. package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
  135. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
  136. package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
  137. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
  138. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
  139. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
  140. package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
  141. package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
  142. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  143. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
  144. package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
  145. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
  146. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
  147. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
  148. package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
  149. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
  150. package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
@@ -1,269 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { Field, FieldDescription, FieldLabel } from "../../../Field/index.js";
4
- import { Input } from "../../../Input/index.js";
5
- import { SegmentedControl, SegmentedControlItem } from "../../../SegmentedControl/index.js";
6
- import { PointSelector } from "../../PointSelector/index.js";
7
- import { newField } from "../models/conditionModel.js";
8
- import { ConditionCard } from "./ConditionCard.js";
9
- const FieldCondition = (t0)=>{
10
- const $ = c(55);
11
- const { condition, onChange, onRemove } = t0;
12
- let t1;
13
- if ($[0] !== condition.id || $[1] !== onChange) {
14
- t1 = (context)=>{
15
- const newContext = "http_response" === context ? "http_response" : "http_request";
16
- onChange({
17
- ...newField(newContext),
18
- id: condition.id
19
- });
20
- };
21
- $[0] = condition.id;
22
- $[1] = onChange;
23
- $[2] = t1;
24
- } else t1 = $[2];
25
- const handleContextChange = t1;
26
- let t2;
27
- if ($[3] !== condition || $[4] !== onChange) {
28
- t2 = (value)=>{
29
- onChange({
30
- ...condition,
31
- value
32
- });
33
- };
34
- $[3] = condition;
35
- $[4] = onChange;
36
- $[5] = t2;
37
- } else t2 = $[5];
38
- const handleValueChange = t2;
39
- let t3;
40
- let t4;
41
- if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
42
- t3 = /*#__PURE__*/ jsx(SegmentedControlItem, {
43
- value: "http_request",
44
- children: "Request"
45
- });
46
- t4 = /*#__PURE__*/ jsx(SegmentedControlItem, {
47
- value: "http_response",
48
- children: "Response"
49
- });
50
- $[6] = t3;
51
- $[7] = t4;
52
- } else {
53
- t3 = $[6];
54
- t4 = $[7];
55
- }
56
- let t5;
57
- if ($[8] !== condition.context || $[9] !== handleContextChange) {
58
- t5 = /*#__PURE__*/ jsx("div", {
59
- className: "flex",
60
- children: /*#__PURE__*/ jsxs(SegmentedControl, {
61
- value: condition.context,
62
- onChange: handleContextChange,
63
- children: [
64
- t3,
65
- t4
66
- ]
67
- })
68
- });
69
- $[8] = condition.context;
70
- $[9] = handleContextChange;
71
- $[10] = t5;
72
- } else t5 = $[10];
73
- const t6 = `${condition.id}:${condition.context}`;
74
- let t7;
75
- if ($[11] !== condition.context || $[12] !== condition.value || $[13] !== handleValueChange || $[14] !== t6) {
76
- t7 = /*#__PURE__*/ jsx(PointSelector, {
77
- context: condition.context,
78
- value: condition.value,
79
- onChange: handleValueChange
80
- }, t6);
81
- $[11] = condition.context;
82
- $[12] = condition.value;
83
- $[13] = handleValueChange;
84
- $[14] = t6;
85
- $[15] = t7;
86
- } else t7 = $[15];
87
- let t8;
88
- if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
89
- t8 = /*#__PURE__*/ jsx(FieldLabel, {
90
- children: "Bind point (optional)"
91
- });
92
- $[16] = t8;
93
- } else t8 = $[16];
94
- const t9 = condition.bindPoint ?? "";
95
- let t10;
96
- if ($[17] !== condition || $[18] !== onChange) {
97
- t10 = (e)=>onChange({
98
- ...condition,
99
- bindPoint: e.target.value || void 0
100
- });
101
- $[17] = condition;
102
- $[18] = onChange;
103
- $[19] = t10;
104
- } else t10 = $[19];
105
- let t11;
106
- if ($[20] !== t10 || $[21] !== t9) {
107
- t11 = /*#__PURE__*/ jsx(Input, {
108
- value: t9,
109
- onChange: t10,
110
- placeholder: 'e.g., "n"',
111
- className: "font-mono text-sm w-120"
112
- });
113
- $[20] = t10;
114
- $[21] = t9;
115
- $[22] = t11;
116
- } else t11 = $[22];
117
- let t12;
118
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
119
- t12 = /*#__PURE__*/ jsx(FieldDescription, {
120
- children: "Bind matched nodes for use in actions (bind_point)"
121
- });
122
- $[23] = t12;
123
- } else t12 = $[23];
124
- let t13;
125
- if ($[24] !== t11) {
126
- t13 = /*#__PURE__*/ jsxs(Field, {
127
- children: [
128
- t8,
129
- t11,
130
- t12
131
- ]
132
- });
133
- $[24] = t11;
134
- $[25] = t13;
135
- } else t13 = $[25];
136
- let t14;
137
- if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
138
- t14 = /*#__PURE__*/ jsx(FieldLabel, {
139
- children: "Point ref (optional)"
140
- });
141
- $[26] = t14;
142
- } else t14 = $[26];
143
- const t15 = condition.pointRef ?? "";
144
- let t16;
145
- if ($[27] !== condition || $[28] !== onChange) {
146
- t16 = (e_0)=>onChange({
147
- ...condition,
148
- pointRef: e_0.target.value || void 0
149
- });
150
- $[27] = condition;
151
- $[28] = onChange;
152
- $[29] = t16;
153
- } else t16 = $[29];
154
- let t17;
155
- if ($[30] !== t15 || $[31] !== t16) {
156
- t17 = /*#__PURE__*/ jsx(Input, {
157
- value: t15,
158
- onChange: t16,
159
- placeholder: 'e.g., "p1"',
160
- className: "font-mono text-sm w-120"
161
- });
162
- $[30] = t15;
163
- $[31] = t16;
164
- $[32] = t17;
165
- } else t17 = $[32];
166
- let t18;
167
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
168
- t18 = /*#__PURE__*/ jsx(FieldDescription, {
169
- children: "Point reference name (point_ref)"
170
- });
171
- $[33] = t18;
172
- } else t18 = $[33];
173
- let t19;
174
- if ($[34] !== t17) {
175
- t19 = /*#__PURE__*/ jsxs(Field, {
176
- children: [
177
- t14,
178
- t17,
179
- t18
180
- ]
181
- });
182
- $[34] = t17;
183
- $[35] = t19;
184
- } else t19 = $[35];
185
- let t20;
186
- if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
187
- t20 = /*#__PURE__*/ jsx(FieldLabel, {
188
- children: "Point role (optional)"
189
- });
190
- $[36] = t20;
191
- } else t20 = $[36];
192
- const t21 = condition.pointRole ?? "";
193
- let t22;
194
- if ($[37] !== condition || $[38] !== onChange) {
195
- t22 = (e_1)=>onChange({
196
- ...condition,
197
- pointRole: e_1.target.value || void 0
198
- });
199
- $[37] = condition;
200
- $[38] = onChange;
201
- $[39] = t22;
202
- } else t22 = $[39];
203
- let t23;
204
- if ($[40] !== t21 || $[41] !== t22) {
205
- t23 = /*#__PURE__*/ jsx(Input, {
206
- value: t21,
207
- onChange: t22,
208
- placeholder: 'e.g., "before"',
209
- className: "font-mono text-sm w-120"
210
- });
211
- $[40] = t21;
212
- $[41] = t22;
213
- $[42] = t23;
214
- } else t23 = $[42];
215
- let t24;
216
- if ($[43] === Symbol.for("react.memo_cache_sentinel")) {
217
- t24 = /*#__PURE__*/ jsx(FieldDescription, {
218
- children: "Point role modifier (point_role)"
219
- });
220
- $[43] = t24;
221
- } else t24 = $[43];
222
- let t25;
223
- if ($[44] !== t23) {
224
- t25 = /*#__PURE__*/ jsxs(Field, {
225
- children: [
226
- t20,
227
- t23,
228
- t24
229
- ]
230
- });
231
- $[44] = t23;
232
- $[45] = t25;
233
- } else t25 = $[45];
234
- let t26;
235
- if ($[46] !== t13 || $[47] !== t19 || $[48] !== t25) {
236
- t26 = /*#__PURE__*/ jsxs("div", {
237
- className: "flex flex-wrap gap-12",
238
- children: [
239
- t13,
240
- t19,
241
- t25
242
- ]
243
- });
244
- $[46] = t13;
245
- $[47] = t19;
246
- $[48] = t25;
247
- $[49] = t26;
248
- } else t26 = $[49];
249
- let t27;
250
- if ($[50] !== onRemove || $[51] !== t26 || $[52] !== t5 || $[53] !== t7) {
251
- t27 = /*#__PURE__*/ jsxs(ConditionCard, {
252
- onRemove: onRemove,
253
- removeLabel: "Remove condition",
254
- children: [
255
- t5,
256
- t7,
257
- t26
258
- ]
259
- });
260
- $[50] = onRemove;
261
- $[51] = t26;
262
- $[52] = t5;
263
- $[53] = t7;
264
- $[54] = t27;
265
- } else t27 = $[54];
266
- return t27;
267
- };
268
- FieldCondition.displayName = "FieldCondition";
269
- export { FieldCondition };
@@ -1,25 +0,0 @@
1
- /**
2
- * GroupCondition
3
- *
4
- * Nested group of conditions with its own operator.
5
- * Renders recursively via ConditionTree.
6
- */
7
- import type { FC } from 'react';
8
- import type { Choice, GroupCondition as GroupConditionType } from '../types.js';
9
- declare let ConditionTreeComponent: FC<{
10
- condition: GroupConditionType;
11
- onChange: (condition: GroupConditionType) => void;
12
- isRoot?: boolean;
13
- insideNone?: boolean;
14
- attackTypes: Choice[];
15
- }>;
16
- export declare function setConditionTreeComponent(component: typeof ConditionTreeComponent): void;
17
- export interface GroupConditionProps {
18
- condition: GroupConditionType;
19
- onChange: (condition: GroupConditionType) => void;
20
- onRemove: () => void;
21
- insideNone?: boolean;
22
- attackTypes: Choice[];
23
- }
24
- export declare const GroupCondition: FC<GroupConditionProps>;
25
- export {};
@@ -1,99 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { Trash2 } from "../../../../icons/index.js";
4
- import { cn } from "../../../../utils/cn.js";
5
- import { Button } from "../../../Button/index.js";
6
- import { conditionTreeVariants, groupBorderVariants } from "./classes.js";
7
- let ConditionTreeComponent;
8
- function setConditionTreeComponent(component) {
9
- ConditionTreeComponent = component;
10
- }
11
- const GroupCondition = (t0)=>{
12
- const $ = c(15);
13
- const { condition, onChange, onRemove, insideNone, attackTypes } = t0;
14
- let t1;
15
- let t2;
16
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
17
- t1 = cn(conditionTreeVariants({
18
- variant: "nested"
19
- }));
20
- t2 = /*#__PURE__*/ jsx("div", {
21
- className: cn(groupBorderVariants({
22
- color: "primary"
23
- }))
24
- });
25
- $[0] = t1;
26
- $[1] = t2;
27
- } else {
28
- t1 = $[0];
29
- t2 = $[1];
30
- }
31
- let t3;
32
- if ($[2] !== attackTypes || $[3] !== condition || $[4] !== insideNone || $[5] !== onChange) {
33
- t3 = ConditionTreeComponent && /*#__PURE__*/ jsx(ConditionTreeComponent, {
34
- condition: condition,
35
- onChange: onChange,
36
- isRoot: false,
37
- insideNone: insideNone,
38
- attackTypes: attackTypes
39
- });
40
- $[2] = attackTypes;
41
- $[3] = condition;
42
- $[4] = insideNone;
43
- $[5] = onChange;
44
- $[6] = t3;
45
- } else t3 = $[6];
46
- let t4;
47
- if ($[7] !== t3) {
48
- t4 = /*#__PURE__*/ jsx("div", {
49
- className: "flex-1",
50
- children: t3
51
- });
52
- $[7] = t3;
53
- $[8] = t4;
54
- } else t4 = $[8];
55
- let t5;
56
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
57
- t5 = /*#__PURE__*/ jsx(Trash2, {});
58
- $[9] = t5;
59
- } else t5 = $[9];
60
- let t6;
61
- if ($[10] !== onRemove) {
62
- t6 = /*#__PURE__*/ jsxs(Button, {
63
- variant: "ghost",
64
- color: "neutral",
65
- size: "small",
66
- "aria-label": "Remove group",
67
- onClick: onRemove,
68
- className: "self-start",
69
- children: [
70
- t5,
71
- "Remove group"
72
- ]
73
- });
74
- $[10] = onRemove;
75
- $[11] = t6;
76
- } else t6 = $[11];
77
- let t7;
78
- if ($[12] !== t4 || $[13] !== t6) {
79
- t7 = /*#__PURE__*/ jsxs("div", {
80
- className: t1,
81
- children: [
82
- t2,
83
- /*#__PURE__*/ jsxs("div", {
84
- className: "flex items-center justify-between gap-8",
85
- children: [
86
- t4,
87
- t6
88
- ]
89
- })
90
- ]
91
- });
92
- $[12] = t4;
93
- $[13] = t6;
94
- $[14] = t7;
95
- } else t7 = $[14];
96
- return t7;
97
- };
98
- GroupCondition.displayName = "GroupCondition";
99
- export { GroupCondition, setConditionTreeComponent };
@@ -1,14 +0,0 @@
1
- /**
2
- * SampleCondition
3
- *
4
- * "Sample a percentage of flows" condition.
5
- * Takes a percent value (0-100), no context or point.
6
- */
7
- import type { FC } from 'react';
8
- import type { SampleCondition as SampleConditionType } from '../types.js';
9
- export interface SampleConditionProps {
10
- condition: SampleConditionType;
11
- onChange: (condition: SampleConditionType) => void;
12
- onRemove: () => void;
13
- }
14
- export declare const SampleCondition: FC<SampleConditionProps>;
@@ -1,118 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { Field, FieldDescription, FieldLabel } from "../../../Field/index.js";
4
- import { Input } from "../../../Input/index.js";
5
- import { Text } from "../../../Text/index.js";
6
- import { ConditionCard } from "./ConditionCard.js";
7
- const SampleCondition = (t0)=>{
8
- const $ = c(17);
9
- const { condition, onChange, onRemove } = t0;
10
- let t1;
11
- let t2;
12
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
13
- t1 = /*#__PURE__*/ jsx(Text, {
14
- size: "sm",
15
- children: "Sample"
16
- });
17
- t2 = {
18
- width: 100
19
- };
20
- $[0] = t1;
21
- $[1] = t2;
22
- } else {
23
- t1 = $[0];
24
- t2 = $[1];
25
- }
26
- let t3;
27
- if ($[2] !== condition || $[3] !== onChange) {
28
- t3 = (e)=>{
29
- const val = Number(e.target.value);
30
- onChange({
31
- ...condition,
32
- percent: Number.isNaN(val) ? 0 : Math.max(0, Math.min(100, val))
33
- });
34
- };
35
- $[2] = condition;
36
- $[3] = onChange;
37
- $[4] = t3;
38
- } else t3 = $[4];
39
- let t4;
40
- if ($[5] !== condition.percent || $[6] !== t3) {
41
- t4 = /*#__PURE__*/ jsx("div", {
42
- style: t2,
43
- children: /*#__PURE__*/ jsx(Input, {
44
- type: "number",
45
- inputMode: "numeric",
46
- min: 0,
47
- max: 100,
48
- value: condition.percent,
49
- onChange: t3,
50
- className: "text-center"
51
- })
52
- });
53
- $[5] = condition.percent;
54
- $[6] = t3;
55
- $[7] = t4;
56
- } else t4 = $[7];
57
- let t5;
58
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
59
- t5 = /*#__PURE__*/ jsx(Text, {
60
- size: "sm",
61
- children: "% of flows"
62
- });
63
- $[8] = t5;
64
- } else t5 = $[8];
65
- let t6;
66
- if ($[9] !== t4) {
67
- t6 = /*#__PURE__*/ jsxs("div", {
68
- className: "flex flex-wrap items-center gap-8",
69
- children: [
70
- t1,
71
- t4,
72
- t5
73
- ]
74
- });
75
- $[9] = t4;
76
- $[10] = t6;
77
- } else t6 = $[10];
78
- let t7;
79
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
80
- t7 = /*#__PURE__*/ jsxs(Field, {
81
- children: [
82
- /*#__PURE__*/ jsx(FieldLabel, {
83
- children: "Sample percent"
84
- }),
85
- /*#__PURE__*/ jsx(FieldDescription, {
86
- children: "Percentage of flows to sample (0-100). The rule will fire for approximately this percentage of requests, selected by flow ID hash."
87
- })
88
- ]
89
- });
90
- $[11] = t7;
91
- } else t7 = $[11];
92
- let t8;
93
- if ($[12] !== t6) {
94
- t8 = /*#__PURE__*/ jsxs("div", {
95
- className: "flex flex-col gap-12",
96
- children: [
97
- t6,
98
- t7
99
- ]
100
- });
101
- $[12] = t6;
102
- $[13] = t8;
103
- } else t8 = $[13];
104
- let t9;
105
- if ($[14] !== onRemove || $[15] !== t8) {
106
- t9 = /*#__PURE__*/ jsx(ConditionCard, {
107
- onRemove: onRemove,
108
- removeLabel: "Remove sample condition",
109
- children: t8
110
- });
111
- $[14] = onRemove;
112
- $[15] = t8;
113
- $[16] = t9;
114
- } else t9 = $[16];
115
- return t9;
116
- };
117
- SampleCondition.displayName = "SampleCondition";
118
- export { SampleCondition };
@@ -1,14 +0,0 @@
1
- /**
2
- * SignalCondition
3
- *
4
- * "A request anomaly was detected" condition.
5
- * Supports key_duplicate and resource_overlimit signal types.
6
- */
7
- import type { FC } from 'react';
8
- import type { SignalCondition as SignalConditionType } from '../types.js';
9
- export interface SignalConditionProps {
10
- condition: SignalConditionType;
11
- onChange: (condition: SignalConditionType) => void;
12
- onRemove: () => void;
13
- }
14
- export declare const SignalCondition: FC<SignalConditionProps>;