@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,210 @@
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 };
@@ -0,0 +1,26 @@
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>;
@@ -0,0 +1,231 @@
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 };
@@ -0,0 +1,48 @@
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>;