@wallarm-org/design-system 4.10.0-rc-feat-parser.1 → 4.10.0

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 (146) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Badge/generateBadgeVariants.js +9 -28
  3. package/dist/components/CodeSnippet/internal/FoldToggle.js +1 -1
  4. package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -2
  5. package/dist/components/DropdownMenu/DropdownMenu.js +71 -84
  6. package/dist/components/DropdownMenu/DropdownMenuItemDescription.js +1 -1
  7. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js +1 -1
  8. package/dist/components/SimpleCharts/Chart/classes.js +1 -1
  9. package/dist/components/SimpleCharts/HorizontalBarStack/classes.js +1 -1
  10. package/dist/components/SimpleCharts/Metric/classes.d.ts +2 -2
  11. package/dist/components/SimpleCharts/Metric/classes.js +2 -2
  12. package/dist/components/Table/TableBody/TableBodyCell.js +4 -1
  13. package/dist/guidelines/patterns/complex-drawer.md +1084 -0
  14. package/dist/guidelines/patterns/confirmation-dialogs.md +3 -11
  15. package/dist/guidelines/patterns/detail-drawer.md +31 -13
  16. package/dist/guidelines/patterns/empty-states.md +6 -5
  17. package/dist/guidelines/patterns/entity-table.md +25 -29
  18. package/dist/guidelines/patterns/feedback-toasts.md +3 -11
  19. package/dist/guidelines/patterns/resource-list-page.md +14 -16
  20. package/dist/guidelines/rules.md +6 -5
  21. package/dist/guidelines/templates/ai-assistant.md +1133 -0
  22. package/dist/guidelines/templates/api-inventory.md +905 -0
  23. package/dist/guidelines/templates/attack-events.md +2722 -0
  24. package/dist/guidelines/templates/incident-detail.md +2085 -0
  25. package/dist/guidelines/templates/integrations-settings.md +836 -0
  26. package/dist/guidelines/templates/page-states.md +798 -0
  27. package/dist/guidelines/templates/rule-editor.md +886 -0
  28. package/dist/guidelines/templates/security-dashboard.md +681 -0
  29. package/dist/index.d.ts +0 -2
  30. package/dist/index.js +0 -2
  31. package/dist/metadata/components.json +9 -107
  32. package/dist/metadata/guidelines.json +1203 -36
  33. package/dist/theme/tokens.test.ts +52 -0
  34. package/package.json +1 -4
  35. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.d.ts +0 -14
  36. package/dist/components/Rules/PointSelector/KeyboardShortcutsDialog.js +0 -209
  37. package/dist/components/Rules/PointSelector/MatchStep.d.ts +0 -15
  38. package/dist/components/Rules/PointSelector/MatchStep.js +0 -186
  39. package/dist/components/Rules/PointSelector/MenuFooterHints.d.ts +0 -16
  40. package/dist/components/Rules/PointSelector/MenuFooterHints.js +0 -177
  41. package/dist/components/Rules/PointSelector/PointPreview.d.ts +0 -10
  42. package/dist/components/Rules/PointSelector/PointPreview.js +0 -88
  43. package/dist/components/Rules/PointSelector/PointSelector.d.ts +0 -17
  44. package/dist/components/Rules/PointSelector/PointSelector.js +0 -937
  45. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.d.ts +0 -12
  46. package/dist/components/Rules/PointSelector/PointSelectorEmptyState.js +0 -173
  47. package/dist/components/Rules/PointSelector/PointSelectorError.d.ts +0 -31
  48. package/dist/components/Rules/PointSelector/PointSelectorError.js +0 -275
  49. package/dist/components/Rules/PointSelector/PointSelectorInput.d.ts +0 -20
  50. package/dist/components/Rules/PointSelector/PointSelectorInput.js +0 -130
  51. package/dist/components/Rules/PointSelector/PointSelectorMenu.d.ts +0 -31
  52. package/dist/components/Rules/PointSelector/PointSelectorMenu.js +0 -317
  53. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.d.ts +0 -8
  54. package/dist/components/Rules/PointSelector/PointSelectorSkeleton.js +0 -73
  55. package/dist/components/Rules/PointSelector/SampleRequest.d.ts +0 -14
  56. package/dist/components/Rules/PointSelector/SampleRequest.js +0 -116
  57. package/dist/components/Rules/PointSelector/StepMenu.d.ts +0 -40
  58. package/dist/components/Rules/PointSelector/StepMenu.js +0 -210
  59. package/dist/components/Rules/PointSelector/VersionWarning.d.ts +0 -26
  60. package/dist/components/Rules/PointSelector/VersionWarning.js +0 -231
  61. package/dist/components/Rules/PointSelector/WhereBar.d.ts +0 -48
  62. package/dist/components/Rules/PointSelector/WhereBar.js +0 -263
  63. package/dist/components/Rules/PointSelector/classes.d.ts +0 -28
  64. package/dist/components/Rules/PointSelector/classes.js +0 -22
  65. package/dist/components/Rules/PointSelector/index.d.ts +0 -20
  66. package/dist/components/Rules/PointSelector/index.js +0 -18
  67. package/dist/components/Rules/PointSelector/liftLayer.d.ts +0 -8
  68. package/dist/components/Rules/PointSelector/liftLayer.js +0 -4
  69. package/dist/components/Rules/PointSelector/sampleValue.d.ts +0 -6
  70. package/dist/components/Rules/PointSelector/sampleValue.js +0 -51
  71. package/dist/components/Rules/PointSelector/sdkBridge.d.ts +0 -508
  72. package/dist/components/Rules/PointSelector/sdkBridge.js +0 -339
  73. package/dist/components/Rules/PointSelector/types.d.ts +0 -304
  74. package/dist/components/Rules/PointSelector/types.js +0 -0
  75. package/dist/components/Rules/PointSelector/usePointSelector.d.ts +0 -161
  76. package/dist/components/Rules/PointSelector/usePointSelector.js +0 -1088
  77. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.d.ts +0 -28
  78. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionEditor.js +0 -208
  79. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.d.ts +0 -23
  80. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionFields.js +0 -950
  81. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.d.ts +0 -21
  82. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTargetPicker.js +0 -110
  83. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.d.ts +0 -20
  84. package/dist/components/Rules/RuleBuilder/ActionEditor/ActionTypeSelect.js +0 -31
  85. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.d.ts +0 -23
  86. package/dist/components/Rules/RuleBuilder/ActionEditor/AttackTypeField.js +0 -131
  87. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.d.ts +0 -17
  88. package/dist/components/Rules/RuleBuilder/ActionEditor/classes.js +0 -14
  89. package/dist/components/Rules/RuleBuilder/ActionEditor/index.d.ts +0 -6
  90. package/dist/components/Rules/RuleBuilder/ActionEditor/index.js +0 -6
  91. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.d.ts +0 -24
  92. package/dist/components/Rules/RuleBuilder/ConditionTree/AddConditionMenu.js +0 -245
  93. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.d.ts +0 -15
  94. package/dist/components/Rules/RuleBuilder/ConditionTree/AttackCondition.js +0 -691
  95. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.d.ts +0 -19
  96. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionCard.js +0 -72
  97. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.d.ts +0 -27
  98. package/dist/components/Rules/RuleBuilder/ConditionTree/ConditionTree.js +0 -407
  99. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.d.ts +0 -14
  100. package/dist/components/Rules/RuleBuilder/ConditionTree/FieldCondition.js +0 -269
  101. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.d.ts +0 -25
  102. package/dist/components/Rules/RuleBuilder/ConditionTree/GroupCondition.js +0 -99
  103. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.d.ts +0 -14
  104. package/dist/components/Rules/RuleBuilder/ConditionTree/SampleCondition.js +0 -118
  105. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.d.ts +0 -14
  106. package/dist/components/Rules/RuleBuilder/ConditionTree/SignalCondition.js +0 -446
  107. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.d.ts +0 -14
  108. package/dist/components/Rules/RuleBuilder/ConditionTree/TagCondition.js +0 -266
  109. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.d.ts +0 -35
  110. package/dist/components/Rules/RuleBuilder/ConditionTree/classes.js +0 -57
  111. package/dist/components/Rules/RuleBuilder/ConditionTree/index.d.ts +0 -15
  112. package/dist/components/Rules/RuleBuilder/ConditionTree/index.js +0 -10
  113. package/dist/components/Rules/RuleBuilder/RuleBuilder.d.ts +0 -67
  114. package/dist/components/Rules/RuleBuilder/RuleBuilder.js +0 -366
  115. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.d.ts +0 -32
  116. package/dist/components/Rules/RuleBuilder/Summary/ActionSummary.js +0 -420
  117. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.d.ts +0 -27
  118. package/dist/components/Rules/RuleBuilder/Summary/ConditionSummary.js +0 -446
  119. package/dist/components/Rules/RuleBuilder/Summary/index.d.ts +0 -7
  120. package/dist/components/Rules/RuleBuilder/Summary/index.js +0 -2
  121. package/dist/components/Rules/RuleBuilder/classes.d.ts +0 -19
  122. package/dist/components/Rules/RuleBuilder/classes.js +0 -18
  123. package/dist/components/Rules/RuleBuilder/index.d.ts +0 -55
  124. package/dist/components/Rules/RuleBuilder/index.js +0 -11
  125. package/dist/components/Rules/RuleBuilder/models/actionModel.d.ts +0 -31
  126. package/dist/components/Rules/RuleBuilder/models/actionModel.js +0 -276
  127. package/dist/components/Rules/RuleBuilder/models/conditionModel.d.ts +0 -95
  128. package/dist/components/Rules/RuleBuilder/models/conditionModel.js +0 -418
  129. package/dist/components/Rules/RuleBuilder/models/index.d.ts +0 -3
  130. package/dist/components/Rules/RuleBuilder/models/index.js +0 -3
  131. package/dist/components/Rules/RuleBuilder/models/validation.d.ts +0 -176
  132. package/dist/components/Rules/RuleBuilder/models/validation.js +0 -242
  133. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.d.ts +0 -27
  134. package/dist/components/Rules/RuleBuilder/shared/ChoiceSelect.js +0 -92
  135. package/dist/components/Rules/RuleBuilder/shared/index.d.ts +0 -1
  136. package/dist/components/Rules/RuleBuilder/shared/index.js +0 -1
  137. package/dist/components/Rules/RuleBuilder/types.d.ts +0 -384
  138. package/dist/components/Rules/RuleBuilder/types.js +0 -0
  139. package/dist/components/Rules/RuleBuilder/utils/constants.d.ts +0 -65
  140. package/dist/components/Rules/RuleBuilder/utils/constants.js +0 -356
  141. package/dist/components/Rules/RuleBuilder/utils/extractBindings.d.ts +0 -48
  142. package/dist/components/Rules/RuleBuilder/utils/extractBindings.js +0 -42
  143. package/dist/components/Rules/RuleBuilder/utils/helpers.d.ts +0 -92
  144. package/dist/components/Rules/RuleBuilder/utils/helpers.js +0 -54
  145. package/dist/components/Rules/RuleBuilder/utils/index.d.ts +0 -2
  146. package/dist/components/Rules/RuleBuilder/utils/index.js +0 -2
@@ -1,210 +0,0 @@
1
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { useTestId } from "../../../utils/testId.js";
4
- import { Button } from "../../Button/index.js";
5
- import { Checkmark } from "../../Checkmark/index.js";
6
- import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDescription, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuShortcut } from "../../DropdownMenu/index.js";
7
- import { Kbd } from "../../Kbd/index.js";
8
- import { Text } from "../../Text/index.js";
9
- import { liftLayer } from "./liftLayer.js";
10
- import { MenuFooterHints } from "./MenuFooterHints.js";
11
- import { PointSelectorEmptyState } from "./PointSelectorEmptyState.js";
12
- const StepMenu = (t0)=>{
13
- const $ = c(42);
14
- const { open, contentId, anchorRef, focusRef, title, rows, highlightedId, status, footer, escLabel, header, applyLabel, applyDisabled, onApply, onHighlight, onChoose, onClose, showExamples, onSelectExample } = t0;
15
- const testId = useTestId("menu");
16
- let t1;
17
- if ($[0] !== contentId) {
18
- t1 = {
19
- content: contentId
20
- };
21
- $[0] = contentId;
22
- $[1] = t1;
23
- } else t1 = $[1];
24
- let t2;
25
- if ($[2] !== onClose) {
26
- t2 = (next)=>!next && onClose();
27
- $[2] = onClose;
28
- $[3] = t2;
29
- } else t2 = $[3];
30
- let t3;
31
- if ($[4] !== onHighlight) {
32
- t3 = (d)=>d.highlightedValue && onHighlight(d.highlightedValue);
33
- $[4] = onHighlight;
34
- $[5] = t3;
35
- } else t3 = $[5];
36
- let t4;
37
- if ($[6] !== anchorRef) {
38
- t4 = {
39
- placement: "bottom-start",
40
- flip: false,
41
- gutter: 6,
42
- getAnchorRect: ()=>anchorRef.current?.getBoundingClientRect() ?? null
43
- };
44
- $[6] = anchorRef;
45
- $[7] = t4;
46
- } else t4 = $[7];
47
- let t5;
48
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
49
- t5 = {
50
- maxHeight: "min(460px, var(--available-height))"
51
- };
52
- $[8] = t5;
53
- } else t5 = $[8];
54
- let t6;
55
- if ($[9] !== focusRef) {
56
- t6 = (e)=>{
57
- if (e.target !== focusRef.current) focusRef.current?.focus();
58
- };
59
- $[9] = focusRef;
60
- $[10] = t6;
61
- } else t6 = $[10];
62
- let t7;
63
- if ($[11] !== highlightedId || $[12] !== onChoose || $[13] !== onSelectExample || $[14] !== rows || $[15] !== showExamples || $[16] !== status || $[17] !== title) {
64
- t7 = showExamples && 0 === rows.length ? /*#__PURE__*/ jsx(PointSelectorEmptyState, {
65
- onSelectExample: onSelectExample
66
- }) : /*#__PURE__*/ jsxs(Fragment, {
67
- children: [
68
- /*#__PURE__*/ jsx(DropdownMenuLabel, {
69
- children: title
70
- }),
71
- /*#__PURE__*/ jsx(DropdownMenuGroup, {
72
- className: "flex flex-col gap-1",
73
- children: rows.map((row)=>/*#__PURE__*/ jsxs(DropdownMenuItem, {
74
- value: row.id,
75
- role: "option",
76
- "aria-selected": row.id === highlightedId,
77
- onClick: ()=>onChoose(row.id),
78
- children: [
79
- void 0 !== row.checked && /*#__PURE__*/ jsx(Checkmark, {
80
- checkedState: row.checked
81
- }),
82
- /*#__PURE__*/ jsxs(DropdownMenuItemContent, {
83
- children: [
84
- /*#__PURE__*/ jsx(DropdownMenuItemText, {
85
- children: row.label
86
- }),
87
- row.desc && /*#__PURE__*/ jsx(DropdownMenuItemDescription, {
88
- children: /*#__PURE__*/ jsx("span", {
89
- className: row.custom ? "text-text-brand" : void 0,
90
- children: row.desc
91
- })
92
- })
93
- ]
94
- }),
95
- void 0 !== row.number && /*#__PURE__*/ jsx(DropdownMenuShortcut, {
96
- children: /*#__PURE__*/ jsx(Kbd, {
97
- size: "small",
98
- children: row.number
99
- })
100
- })
101
- ]
102
- }, row.id))
103
- }),
104
- status && /*#__PURE__*/ jsx("div", {
105
- className: "px-8 py-6",
106
- role: "status",
107
- "aria-live": "polite",
108
- "aria-atomic": "true",
109
- children: /*#__PURE__*/ jsx(Text, {
110
- size: "sm",
111
- color: "secondary",
112
- children: status
113
- })
114
- })
115
- ]
116
- });
117
- $[11] = highlightedId;
118
- $[12] = onChoose;
119
- $[13] = onSelectExample;
120
- $[14] = rows;
121
- $[15] = showExamples;
122
- $[16] = status;
123
- $[17] = title;
124
- $[18] = t7;
125
- } else t7 = $[18];
126
- let t8;
127
- if ($[19] !== applyDisabled || $[20] !== applyLabel || $[21] !== onApply) {
128
- t8 = onApply && /*#__PURE__*/ jsx("div", {
129
- className: "flex justify-end px-4 pt-4",
130
- children: /*#__PURE__*/ jsx(Button, {
131
- variant: "primary",
132
- color: "brand",
133
- size: "small",
134
- disabled: applyDisabled,
135
- onClick: onApply,
136
- children: applyLabel
137
- })
138
- });
139
- $[19] = applyDisabled;
140
- $[20] = applyLabel;
141
- $[21] = onApply;
142
- $[22] = t8;
143
- } else t8 = $[22];
144
- let t9;
145
- if ($[23] !== escLabel || $[24] !== footer) {
146
- t9 = /*#__PURE__*/ jsx(DropdownMenuFooter, {
147
- className: "justify-start",
148
- children: /*#__PURE__*/ jsx(MenuFooterHints, {
149
- variant: footer,
150
- escLabel: escLabel
151
- })
152
- });
153
- $[23] = escLabel;
154
- $[24] = footer;
155
- $[25] = t9;
156
- } else t9 = $[25];
157
- let t10;
158
- if ($[26] !== contentId || $[27] !== header || $[28] !== t6 || $[29] !== t7 || $[30] !== t8 || $[31] !== t9 || $[32] !== testId) {
159
- t10 = /*#__PURE__*/ jsxs(DropdownMenuContent, {
160
- ref: liftLayer,
161
- "data-slot": "step-menu",
162
- "data-testid": testId,
163
- role: "listbox",
164
- id: contentId,
165
- className: "w-[460px]",
166
- style: t5,
167
- "data-point-selector-menu": "true",
168
- "data-rules-layer": "true",
169
- onFocus: t6,
170
- children: [
171
- header,
172
- t7,
173
- t8,
174
- t9
175
- ]
176
- });
177
- $[26] = contentId;
178
- $[27] = header;
179
- $[28] = t6;
180
- $[29] = t7;
181
- $[30] = t8;
182
- $[31] = t9;
183
- $[32] = testId;
184
- $[33] = t10;
185
- } else t10 = $[33];
186
- let t11;
187
- if ($[34] !== highlightedId || $[35] !== open || $[36] !== t1 || $[37] !== t10 || $[38] !== t2 || $[39] !== t3 || $[40] !== t4) {
188
- t11 = /*#__PURE__*/ jsx(DropdownMenu, {
189
- open: open,
190
- ids: t1,
191
- onOpenChange: t2,
192
- closeOnSelect: false,
193
- highlightedValue: highlightedId,
194
- onHighlightChange: t3,
195
- positioning: t4,
196
- children: t10
197
- });
198
- $[34] = highlightedId;
199
- $[35] = open;
200
- $[36] = t1;
201
- $[37] = t10;
202
- $[38] = t2;
203
- $[39] = t3;
204
- $[40] = t4;
205
- $[41] = t11;
206
- } else t11 = $[41];
207
- return t11;
208
- };
209
- StepMenu.displayName = "StepMenu";
210
- export { StepMenu };
@@ -1,26 +0,0 @@
1
- import type { FC } from 'react';
2
- import type { VersionInfo } from '@wallarm-org/rules-lib';
3
- export interface VersionWarningProps {
4
- /** Current SDK version */
5
- version: VersionInfo | null;
6
- /** Expected SDK version (from component build time) */
7
- expectedVersion?: string;
8
- /** Minimum required SDK version */
9
- minVersion?: string;
10
- /** Show version in dev mode (default: true) */
11
- showInDev?: boolean;
12
- /** Show migration notice when canonical version changed */
13
- showMigrationNotice?: boolean;
14
- /** Called when migration notice is dismissed */
15
- onDismissMigration?: () => void;
16
- }
17
- /**
18
- * Shows SDK version info and warns if version is incompatible.
19
- *
20
- * Displays:
21
- * - Migration notice when canonical version changed (info, dismissible)
22
- * - Blocking error if SDK too old (critical)
23
- * - Version mismatch warning (warning)
24
- * - SDK version info in dev mode (informational)
25
- */
26
- export declare const VersionWarning: FC<VersionWarningProps>;
@@ -1,231 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { c } from "react/compiler-runtime";
3
- import { useState } from "react";
4
- import { Alert, AlertContent, AlertDescription, AlertIcon, AlertTitle } from "../../Alert/index.js";
5
- import { Button } from "../../Button/index.js";
6
- const VersionWarning = (t0)=>{
7
- const $ = c(27);
8
- const { version, expectedVersion, minVersion: t1, showInDev: t2, showMigrationNotice: t3, onDismissMigration } = t0;
9
- const minVersion = void 0 === t1 ? "0.10.3" : t1;
10
- const showInDev = void 0 === t2 ? true : t2;
11
- const showMigrationNotice = void 0 === t3 ? false : t3;
12
- const [migrationDismissed, setMigrationDismissed] = useState(false);
13
- if (!version) return null;
14
- const isDev = "development" === process.env.NODE_ENV;
15
- const versionMismatch = expectedVersion && version.ruleset_format !== expectedVersion;
16
- if (showMigrationNotice && !migrationDismissed) {
17
- let t4;
18
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
19
- t4 = /*#__PURE__*/ jsx(AlertIcon, {});
20
- $[0] = t4;
21
- } else t4 = $[0];
22
- let t5;
23
- if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
24
- t5 = /*#__PURE__*/ jsx(AlertTitle, {
25
- children: "Points Auto-Updated"
26
- });
27
- $[1] = t5;
28
- } else t5 = $[1];
29
- let t6;
30
- if ($[2] !== version.canonical) {
31
- t6 = /*#__PURE__*/ jsxs(AlertContent, {
32
- children: [
33
- t5,
34
- /*#__PURE__*/ jsxs(AlertDescription, {
35
- children: [
36
- "Point format updated to SDK version ",
37
- version.canonical,
38
- ". All points have been automatically re-canonicalized to the new format."
39
- ]
40
- })
41
- ]
42
- });
43
- $[2] = version.canonical;
44
- $[3] = t6;
45
- } else t6 = $[3];
46
- let t7;
47
- if ($[4] !== onDismissMigration) {
48
- t7 = /*#__PURE__*/ jsx(Button, {
49
- variant: "ghost",
50
- size: "small",
51
- onClick: ()=>{
52
- setMigrationDismissed(true);
53
- onDismissMigration?.();
54
- },
55
- children: "Dismiss"
56
- });
57
- $[4] = onDismissMigration;
58
- $[5] = t7;
59
- } else t7 = $[5];
60
- let t8;
61
- if ($[6] !== t6 || $[7] !== t7) {
62
- t8 = /*#__PURE__*/ jsxs(Alert, {
63
- color: "info",
64
- "data-testid": "sdk-migration-notice",
65
- children: [
66
- t4,
67
- t6,
68
- t7
69
- ]
70
- });
71
- $[6] = t6;
72
- $[7] = t7;
73
- $[8] = t8;
74
- } else t8 = $[8];
75
- return t8;
76
- }
77
- const isTooOld = minVersion && compareVersions(version.ruleset_format, minVersion) < 0;
78
- if (isTooOld) {
79
- let t4;
80
- if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
81
- t4 = /*#__PURE__*/ jsx(AlertIcon, {});
82
- $[9] = t4;
83
- } else t4 = $[9];
84
- let t5;
85
- if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
86
- t5 = /*#__PURE__*/ jsx(AlertTitle, {
87
- children: "Incompatible SDK Version"
88
- });
89
- $[10] = t5;
90
- } else t5 = $[10];
91
- let t6;
92
- if ($[11] !== minVersion || $[12] !== version.ruleset_format) {
93
- t6 = /*#__PURE__*/ jsxs(Alert, {
94
- color: "destructive",
95
- "data-testid": "sdk-version-error",
96
- children: [
97
- t4,
98
- /*#__PURE__*/ jsxs(AlertContent, {
99
- children: [
100
- t5,
101
- /*#__PURE__*/ jsxs(AlertDescription, {
102
- children: [
103
- "This component requires SDK version ",
104
- minVersion,
105
- " or higher, but got",
106
- " ",
107
- version.ruleset_format,
108
- ". Please update the Proton SDK."
109
- ]
110
- })
111
- ]
112
- })
113
- ]
114
- });
115
- $[11] = minVersion;
116
- $[12] = version.ruleset_format;
117
- $[13] = t6;
118
- } else t6 = $[13];
119
- return t6;
120
- }
121
- if (versionMismatch) {
122
- let t4;
123
- if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
124
- t4 = /*#__PURE__*/ jsx(AlertIcon, {});
125
- $[14] = t4;
126
- } else t4 = $[14];
127
- let t5;
128
- if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
129
- t5 = /*#__PURE__*/ jsx(AlertTitle, {
130
- children: "SDK Version Mismatch"
131
- });
132
- $[15] = t5;
133
- } else t5 = $[15];
134
- let t6;
135
- if ($[16] !== expectedVersion || $[17] !== version.ruleset_format) {
136
- t6 = /*#__PURE__*/ jsxs(Alert, {
137
- color: "warning",
138
- "data-testid": "sdk-version-warning",
139
- children: [
140
- t4,
141
- /*#__PURE__*/ jsxs(AlertContent, {
142
- children: [
143
- t5,
144
- /*#__PURE__*/ jsxs(AlertDescription, {
145
- children: [
146
- "Expected SDK version ",
147
- expectedVersion,
148
- ", but got ",
149
- version.ruleset_format,
150
- ". Some features may not work correctly."
151
- ]
152
- })
153
- ]
154
- })
155
- ]
156
- });
157
- $[16] = expectedVersion;
158
- $[17] = version.ruleset_format;
159
- $[18] = t6;
160
- } else t6 = $[18];
161
- return t6;
162
- }
163
- if (isDev && showInDev) {
164
- let t4;
165
- if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
166
- t4 = /*#__PURE__*/ jsx(AlertIcon, {});
167
- $[19] = t4;
168
- } else t4 = $[19];
169
- let t5;
170
- if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
171
- t5 = /*#__PURE__*/ jsx(AlertTitle, {
172
- children: "SDK Version"
173
- });
174
- $[20] = t5;
175
- } else t5 = $[20];
176
- const t6 = version.canonical;
177
- const t7 = version.ruleset_format;
178
- let t8;
179
- if ($[21] !== version.commit) {
180
- t8 = version.commit.slice(0, 7);
181
- $[21] = version.commit;
182
- $[22] = t8;
183
- } else t8 = $[22];
184
- let t9;
185
- if ($[23] !== t8 || $[24] !== version.canonical || $[25] !== version.ruleset_format) {
186
- t9 = /*#__PURE__*/ jsxs(Alert, {
187
- color: "info",
188
- "data-testid": "sdk-version-info",
189
- children: [
190
- t4,
191
- /*#__PURE__*/ jsxs(AlertContent, {
192
- children: [
193
- t5,
194
- /*#__PURE__*/ jsxs(AlertDescription, {
195
- children: [
196
- "Proton SDK ",
197
- t6,
198
- " (ruleset format: ",
199
- t7,
200
- ", commit:",
201
- " ",
202
- t8,
203
- ")"
204
- ]
205
- })
206
- ]
207
- })
208
- ]
209
- });
210
- $[23] = t8;
211
- $[24] = version.canonical;
212
- $[25] = version.ruleset_format;
213
- $[26] = t9;
214
- } else t9 = $[26];
215
- return t9;
216
- }
217
- return null;
218
- };
219
- function compareVersions(a, b) {
220
- const partsA = a.split(".").map(Number);
221
- const partsB = b.split(".").map(Number);
222
- for(let i = 0; i < Math.max(partsA.length, partsB.length); i++){
223
- const numA = partsA[i] || 0;
224
- const numB = partsB[i] || 0;
225
- if (numA < numB) return -1;
226
- if (numA > numB) return 1;
227
- }
228
- return 0;
229
- }
230
- VersionWarning.displayName = "VersionWarning";
231
- export { VersionWarning };
@@ -1,48 +0,0 @@
1
- import type { FC, HTMLAttributes, KeyboardEvent, Ref, RefObject } from 'react';
2
- import type { Proton, Segment } from '@wallarm-org/rules-lib';
3
- export interface WhereBarProps extends HTMLAttributes<HTMLDivElement> {
4
- /** Ref forwarding to root element */
5
- ref?: Ref<HTMLDivElement>;
6
- /** Container ref for menu positioning */
7
- barRef?: RefObject<HTMLDivElement | null>;
8
- /** Input ref for focus management */
9
- inputRef?: RefObject<HTMLInputElement | null>;
10
- /** Parsed segments to display as chips */
11
- segments: Segment[];
12
- /** Proton SDK instance for rendering segment labels */
13
- proton?: Proton | null;
14
- /** Rendered point string (for keys and error span calculation) */
15
- pointString?: string;
16
- /** Placeholder chip while a name or a multi-select is being answered. */
17
- pendingLabel?: string;
18
- /** Whether to show the input field */
19
- showInput: boolean;
20
- /** Whether the bar is editable */
21
- editable: boolean;
22
- /** Current query/search text */
23
- query: string;
24
- /** Placeholder text for input */
25
- placeholder?: string;
26
- /** Whether menu is open */
27
- open?: boolean;
28
- /** The step menu's id (see StepMenu `contentId`). */
29
- menuId?: string;
30
- /** Error span to highlight (character range in point string) */
31
- errorSpan?: [number, number];
32
- /** Error message to show in tooltip on hover */
33
- errorMessage?: string;
34
- /** Called when query changes */
35
- onQueryChange: (query: string) => void;
36
- /** Called on keyboard input */
37
- onKeyDown: (e: KeyboardEvent<HTMLInputElement>) => void;
38
- /** Called when input is focused */
39
- onFocus: () => void;
40
- /** Called when chip is clicked */
41
- onChipClick: (index: number) => void;
42
- }
43
- /**
44
- * The query bar: one chip per chosen step, then the input. Styled with the
45
- * design system's input tokens, like the FilterInput field. A chip click
46
- * re-opens the point from that step.
47
- */
48
- export declare const WhereBar: FC<WhereBarProps>;