@wallarm-org/design-system 4.9.0 → 4.10.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 (121) hide show
  1. package/dist/components/DropdownMenu/DropdownMenu.d.ts +2 -0
  2. package/dist/components/DropdownMenu/DropdownMenu.js +84 -71
  3. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  4. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  5. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +14 -0
  6. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +209 -0
  7. package/dist/components/Rules/PointSelector/MatchStep.d.ts +15 -0
  8. package/dist/components/Rules/PointSelector/MatchStep.js +186 -0
  9. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +16 -0
  10. package/dist/components/Rules/PointSelector/MenuFooterHints.js +177 -0
  11. package/dist/components/Rules/PointSelector/PointPreview.d.ts +10 -0
  12. package/dist/components/Rules/PointSelector/PointPreview.js +88 -0
  13. package/dist/components/Rules/PointSelector/PointSelector.d.ts +17 -0
  14. package/dist/components/Rules/PointSelector/PointSelector.js +937 -0
  15. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +12 -0
  16. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +173 -0
  17. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +31 -0
  18. package/dist/components/Rules/PointSelector/PointSelectorError.js +275 -0
  19. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +20 -0
  20. package/dist/components/Rules/PointSelector/PointSelectorInput.js +130 -0
  21. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +31 -0
  22. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +317 -0
  23. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +8 -0
  24. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +73 -0
  25. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +14 -0
  26. package/dist/components/Rules/PointSelector/SampleRequest.js +116 -0
  27. package/dist/components/Rules/PointSelector/StepMenu.d.ts +40 -0
  28. package/dist/components/Rules/PointSelector/StepMenu.js +210 -0
  29. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +26 -0
  30. package/dist/components/Rules/PointSelector/VersionWarning.js +231 -0
  31. package/dist/components/Rules/PointSelector/WhereBar.d.ts +48 -0
  32. package/dist/components/Rules/PointSelector/WhereBar.js +263 -0
  33. package/dist/components/Rules/PointSelector/classes.d.ts +28 -0
  34. package/dist/components/Rules/PointSelector/classes.js +22 -0
  35. package/dist/components/Rules/PointSelector/index.d.ts +20 -0
  36. package/dist/components/Rules/PointSelector/index.js +18 -0
  37. package/dist/components/Rules/PointSelector/liftLayer.d.ts +8 -0
  38. package/dist/components/Rules/PointSelector/liftLayer.js +4 -0
  39. package/dist/components/Rules/PointSelector/sampleValue.d.ts +6 -0
  40. package/dist/components/Rules/PointSelector/sampleValue.js +51 -0
  41. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +508 -0
  42. package/dist/components/Rules/PointSelector/sdkBridge.js +339 -0
  43. package/dist/components/Rules/PointSelector/types.d.ts +304 -0
  44. package/dist/components/Rules/PointSelector/types.js +0 -0
  45. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +161 -0
  46. package/dist/components/Rules/PointSelector/usePointSelector.js +1088 -0
  47. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +28 -0
  48. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +208 -0
  49. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +23 -0
  50. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +950 -0
  51. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +21 -0
  52. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +110 -0
  53. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +20 -0
  54. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +31 -0
  55. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +23 -0
  56. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +131 -0
  57. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +17 -0
  58. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +14 -0
  59. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +6 -0
  60. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +6 -0
  61. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +24 -0
  62. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +245 -0
  63. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +15 -0
  64. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +691 -0
  65. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +19 -0
  66. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +72 -0
  67. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +27 -0
  68. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +407 -0
  69. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +14 -0
  70. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +269 -0
  71. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +25 -0
  72. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +99 -0
  73. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +14 -0
  74. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +118 -0
  75. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +14 -0
  76. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +446 -0
  77. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +14 -0
  78. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +266 -0
  79. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +35 -0
  80. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +57 -0
  81. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +15 -0
  82. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +10 -0
  83. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +67 -0
  84. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +366 -0
  85. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +32 -0
  86. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +420 -0
  87. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +27 -0
  88. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +446 -0
  89. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +7 -0
  90. package/dist/components/Rules/RuleBuilder/Summary/index.js +2 -0
  91. package/dist/components/Rules/RuleBuilder/classes.d.ts +19 -0
  92. package/dist/components/Rules/RuleBuilder/classes.js +18 -0
  93. package/dist/components/Rules/RuleBuilder/index.d.ts +55 -0
  94. package/dist/components/Rules/RuleBuilder/index.js +11 -0
  95. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +31 -0
  96. package/dist/components/Rules/RuleBuilder/models/actionModel.js +276 -0
  97. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +95 -0
  98. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +418 -0
  99. package/dist/components/Rules/RuleBuilder/models/index.d.ts +3 -0
  100. package/dist/components/Rules/RuleBuilder/models/index.js +3 -0
  101. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +176 -0
  102. package/dist/components/Rules/RuleBuilder/models/validation.js +242 -0
  103. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +27 -0
  104. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +92 -0
  105. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +1 -0
  106. package/dist/components/Rules/RuleBuilder/shared/index.js +1 -0
  107. package/dist/components/Rules/RuleBuilder/types.d.ts +384 -0
  108. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  109. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +65 -0
  110. package/dist/components/Rules/RuleBuilder/utils/constants.js +356 -0
  111. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +48 -0
  112. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +42 -0
  113. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +92 -0
  114. package/dist/components/Rules/RuleBuilder/utils/helpers.js +54 -0
  115. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +2 -0
  116. package/dist/components/Rules/RuleBuilder/utils/index.js +2 -0
  117. package/dist/index.d.ts +2 -0
  118. package/dist/index.js +2 -0
  119. package/dist/metadata/components.json +100 -2
  120. package/dist/metadata/guidelines.json +1 -1
  121. package/package.json +4 -1
@@ -0,0 +1,269 @@
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 };
@@ -0,0 +1,25 @@
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 {};
@@ -0,0 +1,99 @@
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 };
@@ -0,0 +1,14 @@
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>;
@@ -0,0 +1,118 @@
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 };
@@ -0,0 +1,14 @@
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>;