@patternfly/context-for-ai 1.2.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 (99) hide show
  1. package/README.md +615 -0
  2. package/codemod/ALL_COMPONENTS_REFERENCE.md +815 -0
  3. package/codemod/ATTRIBUTE_DECISION_LOGIC.md +320 -0
  4. package/codemod/README.md +400 -0
  5. package/codemod/add-semantic-attributes.sh +69 -0
  6. package/codemod/component-attributes-reference.json +129 -0
  7. package/codemod/example-after.tsx +51 -0
  8. package/codemod/example-before.tsx +19 -0
  9. package/codemod/static-inference.js +5015 -0
  10. package/codemod/transform.js +1108 -0
  11. package/dist/components/advanced/index.d.ts +2 -0
  12. package/dist/components/advanced/index.d.ts.map +1 -0
  13. package/dist/components/core/Button.d.ts +14 -0
  14. package/dist/components/core/Button.d.ts.map +1 -0
  15. package/dist/components/core/Link.d.ts +15 -0
  16. package/dist/components/core/Link.d.ts.map +1 -0
  17. package/dist/components/core/StarIcon.d.ts +15 -0
  18. package/dist/components/core/StarIcon.d.ts.map +1 -0
  19. package/dist/components/core/index.d.ts +4 -0
  20. package/dist/components/core/index.d.ts.map +1 -0
  21. package/dist/components/data-display/Card.d.ts +14 -0
  22. package/dist/components/data-display/Card.d.ts.map +1 -0
  23. package/dist/components/data-display/StatusBadge.d.ts +13 -0
  24. package/dist/components/data-display/StatusBadge.d.ts.map +1 -0
  25. package/dist/components/data-display/Tbody.d.ts +12 -0
  26. package/dist/components/data-display/Tbody.d.ts.map +1 -0
  27. package/dist/components/data-display/Td.d.ts +14 -0
  28. package/dist/components/data-display/Td.d.ts.map +1 -0
  29. package/dist/components/data-display/Th.d.ts +14 -0
  30. package/dist/components/data-display/Th.d.ts.map +1 -0
  31. package/dist/components/data-display/Thead.d.ts +12 -0
  32. package/dist/components/data-display/Thead.d.ts.map +1 -0
  33. package/dist/components/data-display/Tr.d.ts +16 -0
  34. package/dist/components/data-display/Tr.d.ts.map +1 -0
  35. package/dist/components/data-display/index.d.ts +8 -0
  36. package/dist/components/data-display/index.d.ts.map +1 -0
  37. package/dist/components/feedback/index.d.ts +2 -0
  38. package/dist/components/feedback/index.d.ts.map +1 -0
  39. package/dist/components/forms/Checkbox.d.ts +16 -0
  40. package/dist/components/forms/Checkbox.d.ts.map +1 -0
  41. package/dist/components/forms/Form.d.ts +12 -0
  42. package/dist/components/forms/Form.d.ts.map +1 -0
  43. package/dist/components/forms/Radio.d.ts +32 -0
  44. package/dist/components/forms/Radio.d.ts.map +1 -0
  45. package/dist/components/forms/Select.d.ts +33 -0
  46. package/dist/components/forms/Select.d.ts.map +1 -0
  47. package/dist/components/forms/Switch.d.ts +31 -0
  48. package/dist/components/forms/Switch.d.ts.map +1 -0
  49. package/dist/components/forms/TextArea.d.ts +29 -0
  50. package/dist/components/forms/TextArea.d.ts.map +1 -0
  51. package/dist/components/forms/TextInput.d.ts +29 -0
  52. package/dist/components/forms/TextInput.d.ts.map +1 -0
  53. package/dist/components/forms/index.d.ts +8 -0
  54. package/dist/components/forms/index.d.ts.map +1 -0
  55. package/dist/components/index.d.ts +9 -0
  56. package/dist/components/index.d.ts.map +1 -0
  57. package/dist/components/layout/Flex.d.ts +16 -0
  58. package/dist/components/layout/Flex.d.ts.map +1 -0
  59. package/dist/components/layout/FlexItem.d.ts +16 -0
  60. package/dist/components/layout/FlexItem.d.ts.map +1 -0
  61. package/dist/components/layout/index.d.ts +3 -0
  62. package/dist/components/layout/index.d.ts.map +1 -0
  63. package/dist/components/navigation/DropdownItem.d.ts +8 -0
  64. package/dist/components/navigation/DropdownItem.d.ts.map +1 -0
  65. package/dist/components/navigation/MenuToggle.d.ts +8 -0
  66. package/dist/components/navigation/MenuToggle.d.ts.map +1 -0
  67. package/dist/components/navigation/index.d.ts +3 -0
  68. package/dist/components/navigation/index.d.ts.map +1 -0
  69. package/dist/components/overlay/Drawer.d.ts +12 -0
  70. package/dist/components/overlay/Drawer.d.ts.map +1 -0
  71. package/dist/components/overlay/Modal.d.ts +16 -0
  72. package/dist/components/overlay/Modal.d.ts.map +1 -0
  73. package/dist/components/overlay/index.d.ts +3 -0
  74. package/dist/components/overlay/index.d.ts.map +1 -0
  75. package/dist/context/SemanticContext.d.ts +28 -0
  76. package/dist/context/SemanticContext.d.ts.map +1 -0
  77. package/dist/hooks/index.d.ts +3 -0
  78. package/dist/hooks/index.d.ts.map +1 -0
  79. package/dist/hooks/useAccessibility.d.ts +13 -0
  80. package/dist/hooks/useAccessibility.d.ts.map +1 -0
  81. package/dist/hooks/useSemanticMetadata.d.ts +9 -0
  82. package/dist/hooks/useSemanticMetadata.d.ts.map +1 -0
  83. package/dist/index.d.ts +574 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.esm.js +1362 -0
  86. package/dist/index.esm.js.map +1 -0
  87. package/dist/index.js +1426 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/types/index.d.ts +47 -0
  90. package/dist/types/index.d.ts.map +1 -0
  91. package/dist/utils/accessibility.d.ts +16 -0
  92. package/dist/utils/accessibility.d.ts.map +1 -0
  93. package/dist/utils/index.d.ts +4 -0
  94. package/dist/utils/index.d.ts.map +1 -0
  95. package/dist/utils/inference.d.ts +136 -0
  96. package/dist/utils/inference.d.ts.map +1 -0
  97. package/dist/utils/metadata.d.ts +17 -0
  98. package/dist/utils/metadata.d.ts.map +1 -0
  99. package/package.json +104 -0
@@ -0,0 +1,574 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Button as Button$1, Form as Form$1, Checkbox as Checkbox$1, TextInput as TextInput$1, TextArea as TextArea$1, Select as Select$1, Radio as Radio$1, Switch as Switch$1, Card as Card$1, Flex as Flex$1, FlexItem as FlexItem$1, Modal as Modal$1, Drawer as Drawer$1, MenuToggle as MenuToggle$1, DropdownItem as DropdownItem$1 } from '@patternfly/react-core';
3
+ import { Tbody as Tbody$1, Td as Td$1, Th as Th$1, Thead as Thead$1, Tr as Tr$1 } from '@patternfly/react-table';
4
+
5
+ interface HierarchyMetadata {
6
+ parents: string[];
7
+ depth: number;
8
+ path: string;
9
+ }
10
+ interface ActionMetadata {
11
+ type: string;
12
+ target?: string;
13
+ consequence?: string;
14
+ affectsParent?: boolean;
15
+ }
16
+ interface SemanticComponentProps {
17
+ /** Human-readable semantic name for the component instance */
18
+ semanticName?: string;
19
+ /** Semantic role or purpose of the component */
20
+ semanticRole?: string;
21
+ /** What this component acts upon */
22
+ target?: string;
23
+ /** Additional metadata for AI tooling */
24
+ aiMetadata?: {
25
+ description?: string;
26
+ category?: string;
27
+ accessibility?: string[];
28
+ usage?: string[];
29
+ hierarchy?: HierarchyMetadata;
30
+ action?: ActionMetadata;
31
+ };
32
+ /** Accessibility enhancements */
33
+ accessibility?: {
34
+ ariaLabel?: string;
35
+ ariaDescription?: string;
36
+ keyboardShortcuts?: string[];
37
+ };
38
+ }
39
+ interface ComponentMetadata {
40
+ name: string;
41
+ description: string;
42
+ category: 'layout' | 'navigation' | 'forms' | 'data-display' | 'feedback' | 'overlay';
43
+ accessibility: string[];
44
+ usage: string[];
45
+ props: Record<string, unknown>;
46
+ hierarchy?: HierarchyMetadata;
47
+ action?: ActionMetadata;
48
+ }
49
+ type SemanticComponent<T = Record<string, unknown>> = React.ComponentType<T & SemanticComponentProps>;
50
+
51
+ interface ButtonProps extends Omit<React.ComponentProps<typeof Button$1>, 'children'>, SemanticComponentProps {
52
+ children?: React.ReactNode;
53
+ /** The semantic action this button performs (auto-inferred from variant if not provided) */
54
+ action?: 'primary' | 'secondary' | 'destructive' | 'navigation' | 'toggle';
55
+ /** Context of where this button is used (auto-inferred from props if not provided) */
56
+ context?: 'form' | 'toolbar' | 'modal' | 'card' | 'navigation' | 'table' | 'alert';
57
+ }
58
+ /** Button - PatternFly Button wrapper with semantic metadata for AI tooling */
59
+ declare const Button: React.FC<ButtonProps>;
60
+
61
+ interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'target'>, SemanticComponentProps {
62
+ children?: React.ReactNode;
63
+ /** The semantic purpose of this link (auto-inferred from props if not provided) */
64
+ purpose?: 'navigation' | 'action' | 'download' | 'external' | 'launch';
65
+ /** The context where this link is used (auto-inferred from props if not provided) */
66
+ context?: 'table' | 'card' | 'navigation' | 'content';
67
+ /** HTML target attribute (_blank, _self, etc) */
68
+ htmlTarget?: string;
69
+ }
70
+ /** Link - HTML anchor wrapper with semantic metadata for AI tooling */
71
+ declare const Link: React.FC<LinkProps>;
72
+
73
+ interface StarIconProps extends React.HTMLAttributes<HTMLSpanElement>, SemanticComponentProps {
74
+ children?: React.ReactNode;
75
+ /** Whether this star is favorited/active */
76
+ isFavorited?: boolean;
77
+ /** The semantic purpose of this star icon (auto-inferred from props if not provided) */
78
+ purpose?: 'favorite-toggle' | 'rating' | 'bookmark' | 'highlight';
79
+ /** The context where this star is used (auto-inferred from props if not provided) */
80
+ context?: 'table' | 'card' | 'list' | 'content';
81
+ }
82
+ /** StarIcon - HTML span wrapper with semantic metadata for AI tooling */
83
+ declare const StarIcon: React.FC<StarIconProps>;
84
+
85
+ interface FormProps extends Omit<React.ComponentProps<typeof Form$1>, 'children'>, SemanticComponentProps {
86
+ children?: React.ReactNode;
87
+ /** The semantic purpose of this form */
88
+ purpose?: 'create' | 'edit' | 'search' | 'filter' | 'settings';
89
+ }
90
+ /** Form - PatternFly Form wrapper with semantic metadata for AI tooling */
91
+ declare const Form: React.FC<FormProps>;
92
+
93
+ interface CheckboxProps extends Omit<React.ComponentProps<typeof Checkbox$1>, 'children'>, SemanticComponentProps {
94
+ children?: React.ReactNode;
95
+ /** The semantic purpose of this checkbox (auto-inferred from props if not provided) */
96
+ purpose?: 'selection' | 'toggle' | 'form-input' | 'filter';
97
+ /** The context where this checkbox is used (auto-inferred from props if not provided) */
98
+ context?: 'table' | 'form' | 'filter' | 'settings';
99
+ /** Required id for PatternFly Checkbox */
100
+ id: string;
101
+ }
102
+ /** Checkbox - PatternFly Checkbox wrapper with semantic metadata for AI tooling */
103
+ declare const Checkbox: React.FC<CheckboxProps>;
104
+
105
+ interface TextInputProps extends Omit<React.ComponentProps<typeof TextInput$1>, 'children'>, SemanticComponentProps {
106
+ /** The semantic purpose of this input field */
107
+ purpose?: 'text-input' | 'email-input' | 'password-input' | 'search-input' | 'phone-input' | 'url-input' | 'numeric-input';
108
+ /** The context where this input is used */
109
+ context?: 'form' | 'search' | 'filter' | 'inline-edit' | 'settings';
110
+ /** Validation context for semantic understanding */
111
+ validationContext?: 'required' | 'optional' | 'conditional';
112
+ }
113
+ /**
114
+ * TextInput - PatternFly TextInput wrapper with semantic metadata for AI tooling
115
+ *
116
+ * @example
117
+ * ```tsx
118
+ * <TextInput
119
+ * type="email"
120
+ * purpose="email-input"
121
+ * context="form"
122
+ * placeholder="Enter your email"
123
+ * value={email}
124
+ * onChange={handleChange}
125
+ * />
126
+ * ```
127
+ */
128
+ declare const TextInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
129
+
130
+ interface TextAreaProps extends Omit<React.ComponentProps<typeof TextArea$1>, 'children'>, SemanticComponentProps {
131
+ /** The semantic purpose of this textarea */
132
+ purpose?: 'comment' | 'description' | 'note' | 'message' | 'feedback' | 'content';
133
+ /** The context where this textarea is used */
134
+ context?: 'form' | 'comment-section' | 'message-box' | 'editor' | 'settings';
135
+ /** Expected content type */
136
+ contentType?: 'plain-text' | 'formatted-text' | 'code' | 'markdown';
137
+ }
138
+ /**
139
+ * TextArea - PatternFly TextArea wrapper with semantic metadata for AI tooling
140
+ *
141
+ * @example
142
+ * ```tsx
143
+ * <TextArea
144
+ * purpose="comment"
145
+ * context="comment-section"
146
+ * placeholder="Add your comment..."
147
+ * value={comment}
148
+ * onChange={handleChange}
149
+ * resizeOrientation="vertical"
150
+ * />
151
+ * ```
152
+ */
153
+ declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
154
+
155
+ interface SelectProps extends Omit<React.ComponentProps<typeof Select$1>, 'children'>, SemanticComponentProps {
156
+ children?: React.ReactNode;
157
+ /** The semantic purpose of this select */
158
+ purpose?: 'category-selection' | 'filter' | 'setting' | 'navigation' | 'data-entry';
159
+ /** The context where this select is used */
160
+ context?: 'form' | 'toolbar' | 'filter-bar' | 'settings' | 'navigation';
161
+ /** Selection behavior */
162
+ selectionType?: 'single' | 'multiple' | 'typeahead';
163
+ }
164
+ /**
165
+ * Select - PatternFly Select wrapper with semantic metadata for AI tooling
166
+ *
167
+ * @example
168
+ * ```tsx
169
+ * <Select
170
+ * purpose="category-selection"
171
+ * context="form"
172
+ * isOpen={isOpen}
173
+ * onToggle={handleToggle}
174
+ * selections={selected}
175
+ * onSelect={handleSelect}
176
+ * >
177
+ * <SelectOption value="option1" />
178
+ * <SelectOption value="option2" />
179
+ * </Select>
180
+ * ```
181
+ */
182
+ declare const Select: React.FC<SelectProps>;
183
+
184
+ interface RadioProps extends Omit<React.ComponentProps<typeof Radio$1>, 'children' | 'ref'>, SemanticComponentProps {
185
+ children?: React.ReactNode;
186
+ /** The semantic purpose of this radio button */
187
+ purpose?: 'option-selection' | 'preference' | 'setting' | 'filter' | 'answer';
188
+ /** The context where this radio is used */
189
+ context?: 'form' | 'settings' | 'filter' | 'survey' | 'quiz';
190
+ /** The group this radio belongs to */
191
+ groupContext?: string;
192
+ }
193
+ /**
194
+ * Radio - PatternFly Radio wrapper with semantic metadata for AI tooling
195
+ *
196
+ * @example
197
+ * ```tsx
198
+ * <Radio
199
+ * purpose="preference"
200
+ * context="settings"
201
+ * groupContext="theme-selection"
202
+ * name="theme"
203
+ * id="theme-light"
204
+ * label="Light Theme"
205
+ * isChecked={theme === 'light'}
206
+ * onChange={handleChange}
207
+ * />
208
+ * ```
209
+ */
210
+ declare const Radio: React.FC<RadioProps>;
211
+
212
+ interface SwitchProps extends Omit<React.ComponentProps<typeof Switch$1>, 'children' | 'ref'>, SemanticComponentProps {
213
+ children?: React.ReactNode;
214
+ /** The semantic purpose of this switch */
215
+ purpose?: 'feature-toggle' | 'setting' | 'preference' | 'filter' | 'mode-switch';
216
+ /** The context where this switch is used */
217
+ context?: 'settings' | 'toolbar' | 'card' | 'table-row' | 'form';
218
+ /** What is being toggled */
219
+ toggleTarget?: 'feature' | 'visibility' | 'mode' | 'status' | 'permission';
220
+ }
221
+ /**
222
+ * Switch - PatternFly Switch wrapper with semantic metadata for AI tooling
223
+ *
224
+ * @example
225
+ * ```tsx
226
+ * <Switch
227
+ * purpose="feature-toggle"
228
+ * context="settings"
229
+ * toggleTarget="feature"
230
+ * id="notifications"
231
+ * label="Enable notifications"
232
+ * isChecked={notificationsEnabled}
233
+ * onChange={handleToggle}
234
+ * />
235
+ * ```
236
+ */
237
+ declare const Switch: React.FC<SwitchProps>;
238
+
239
+ interface CardProps extends Omit<React.ComponentProps<typeof Card$1>, 'children'>, SemanticComponentProps {
240
+ children?: React.ReactNode;
241
+ /** The semantic purpose of this card (auto-inferred from props if not provided) */
242
+ purpose?: 'content-display' | 'data-summary' | 'action-panel' | 'information' | 'navigation';
243
+ /** The type of content this card contains (auto-inferred from children if not provided) */
244
+ contentType?: 'text' | 'data' | 'media' | 'mixed' | 'interactive';
245
+ }
246
+ /** Card - PatternFly Card wrapper with semantic metadata for AI tooling */
247
+ declare const Card: React.FC<CardProps>;
248
+
249
+ interface StatusBadgeProps extends React.HTMLAttributes<HTMLSpanElement>, SemanticComponentProps {
250
+ children?: React.ReactNode;
251
+ /** The semantic purpose of this status badge (auto-inferred from content if not provided) */
252
+ purpose?: 'status-indicator' | 'progress-indicator' | 'state-display' | 'alert-indicator';
253
+ /** The status type (auto-inferred from content if not provided) */
254
+ statusType?: 'success' | 'warning' | 'error' | 'info' | 'pending' | 'ready';
255
+ }
256
+ /** StatusBadge - HTML span wrapper with semantic metadata for AI tooling */
257
+ declare const StatusBadge: React.FC<StatusBadgeProps>;
258
+
259
+ interface TbodyProps extends Omit<React.ComponentProps<typeof Tbody$1>, 'children'>, SemanticComponentProps {
260
+ children?: React.ReactNode;
261
+ /** The semantic purpose of this table body section (auto-inferred from props if not provided) */
262
+ purpose?: 'data-rows' | 'selectable-rows' | 'action-rows' | 'mixed-content';
263
+ }
264
+ /** Tbody - PatternFly Table Body wrapper with semantic metadata for AI tooling */
265
+ declare const Tbody: React.FC<TbodyProps>;
266
+
267
+ interface TdProps extends Omit<React.ComponentProps<typeof Td$1>, 'children'>, SemanticComponentProps {
268
+ children?: React.ReactNode;
269
+ /** The semantic purpose of this table cell (auto-inferred from props if not provided) */
270
+ purpose?: 'data-cell' | 'action-cell' | 'selectable-cell' | 'status-cell';
271
+ /** The data type this cell contains (auto-inferred from content if not provided) */
272
+ dataType?: 'text' | 'number' | 'date' | 'boolean' | 'action' | 'mixed';
273
+ }
274
+ /** Td - PatternFly Table Data wrapper with semantic metadata for AI tooling */
275
+ declare const Td: React.FC<TdProps>;
276
+
277
+ interface ThProps extends Omit<React.ComponentProps<typeof Th$1>, 'children'>, SemanticComponentProps {
278
+ children?: React.ReactNode;
279
+ /** The semantic purpose of this table header (auto-inferred from props if not provided) */
280
+ purpose?: 'column-header' | 'sortable-header' | 'selectable-header' | 'action-header';
281
+ /** The data type this header represents (auto-inferred from content if not provided) */
282
+ dataType?: 'text' | 'number' | 'date' | 'boolean' | 'action' | 'mixed';
283
+ }
284
+ /** Th - PatternFly Table Header wrapper with semantic metadata for AI tooling */
285
+ declare const Th: React.FC<ThProps>;
286
+
287
+ interface TheadProps extends Omit<React.ComponentProps<typeof Thead$1>, 'children'>, SemanticComponentProps {
288
+ children?: React.ReactNode;
289
+ /** The semantic purpose of this table header section (auto-inferred from props if not provided) */
290
+ purpose?: 'column-definition' | 'sortable-headers' | 'selectable-headers' | 'action-headers';
291
+ }
292
+ /** Thead - PatternFly Table Header wrapper with semantic metadata for AI tooling */
293
+ declare const Thead: React.FC<TheadProps>;
294
+
295
+ interface TrProps extends Omit<React.ComponentProps<typeof Tr$1>, 'children'>, SemanticComponentProps {
296
+ children?: React.ReactNode;
297
+ /** The semantic purpose of this table row (auto-inferred from props if not provided) */
298
+ purpose?: 'data-row' | 'header-row' | 'selectable-row' | 'expandable-row' | 'action-row';
299
+ /** The interaction type for this row (auto-inferred from props if not provided) */
300
+ interactionType?: 'clickable' | 'selectable' | 'expandable' | 'static';
301
+ /** The row state (auto-inferred from props if not provided) */
302
+ rowState?: 'normal' | 'selected' | 'expanded' | 'disabled' | 'highlighted';
303
+ }
304
+ /** Tr - PatternFly Table Row wrapper with semantic metadata for AI tooling */
305
+ declare const Tr: React.FC<TrProps>;
306
+
307
+ interface FlexProps extends Omit<React.ComponentProps<typeof Flex$1>, 'children'>, SemanticComponentProps {
308
+ children?: React.ReactNode;
309
+ /** The layout purpose of this flex container (auto-inferred from props if not provided) */
310
+ purpose?: 'layout' | 'navigation' | 'toolbar' | 'form' | 'content' | 'action-group';
311
+ /** The layout type (auto-inferred from direction if not provided) */
312
+ layoutType?: 'row' | 'column' | 'responsive';
313
+ /** The alignment context (auto-inferred from props if not provided) */
314
+ alignmentContext?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';
315
+ }
316
+ /** Flex - PatternFly Flex wrapper with semantic metadata for AI tooling */
317
+ declare const Flex: React.FC<FlexProps>;
318
+
319
+ interface FlexItemProps extends Omit<React.ComponentProps<typeof FlexItem$1>, 'children'>, SemanticComponentProps {
320
+ children?: React.ReactNode;
321
+ /** The content type of this flex item (auto-inferred from props if not provided) */
322
+ contentType?: 'text' | 'button' | 'icon' | 'form-control' | 'media' | 'navigation' | 'action';
323
+ /** The positioning context (auto-inferred from props if not provided) */
324
+ positioningContext?: 'start' | 'center' | 'end' | 'stretch' | 'baseline' | 'auto';
325
+ /** The sizing behavior (auto-inferred from flex prop if not provided) */
326
+ sizingBehavior?: 'fixed' | 'flexible' | 'grow' | 'shrink' | 'auto';
327
+ }
328
+ /** FlexItem - PatternFly FlexItem wrapper with semantic metadata for AI tooling */
329
+ declare const FlexItem: React.FC<FlexItemProps>;
330
+
331
+ interface ModalProps extends Omit<React.ComponentProps<typeof Modal$1>, 'children'>, SemanticComponentProps {
332
+ children?: React.ReactNode;
333
+ /** The semantic purpose of this modal (auto-inferred from variant if not provided) */
334
+ purpose?: 'confirmation' | 'form' | 'information' | 'selection' | 'workflow';
335
+ /** The type of interaction this modal facilitates (auto-inferred from props if not provided) */
336
+ interactionType?: 'blocking' | 'non-blocking' | 'progressive' | 'multi-step';
337
+ /** The component that triggered this modal to open (auto-inferred from context if not provided) */
338
+ triggeredBy?: string;
339
+ }
340
+ /** Modal - PatternFly Modal wrapper with semantic metadata for AI tooling */
341
+ declare const Modal: React.ForwardRefExoticComponent<Omit<ModalProps, "ref"> & React.RefAttributes<any>>;
342
+
343
+ interface DrawerProps extends Omit<React.ComponentProps<typeof Drawer$1>, 'children'>, SemanticComponentProps {
344
+ children?: React.ReactNode;
345
+ /** The semantic purpose of this drawer */
346
+ purpose?: 'navigation' | 'filter' | 'details' | 'form' | 'settings';
347
+ }
348
+ /** Drawer - PatternFly Drawer wrapper with semantic metadata for AI tooling */
349
+ declare const Drawer: React.FC<DrawerProps>;
350
+
351
+ interface MenuToggleProps extends SemanticComponentProps, React.ComponentProps<typeof MenuToggle$1> {
352
+ }
353
+ declare const MenuToggle: React.FC<MenuToggleProps>;
354
+
355
+ interface DropdownItemProps extends SemanticComponentProps, React.ComponentProps<typeof DropdownItem$1> {
356
+ }
357
+ declare const DropdownItem: React.FC<DropdownItemProps>;
358
+
359
+ /**
360
+ * Utility functions for managing component metadata
361
+ */
362
+ /**
363
+ * Generates default metadata for a component based on its type and props
364
+ */
365
+ declare const generateComponentMetadata: (componentName: string, props?: Record<string, unknown>) => ComponentMetadata;
366
+ /**
367
+ * Validates component metadata
368
+ */
369
+ declare const validateMetadata: (metadata: ComponentMetadata) => boolean;
370
+ /**
371
+ * Merges user-provided metadata with defaults
372
+ */
373
+ declare const mergeMetadata: (userMetadata: Partial<ComponentMetadata>, defaultMetadata: ComponentMetadata) => ComponentMetadata;
374
+
375
+ /**
376
+ * Accessibility utility functions
377
+ */
378
+ /**
379
+ * Generates ARIA attributes based on component context
380
+ */
381
+ declare const generateAriaAttributes: (componentType: string) => Record<string, string>;
382
+ /**
383
+ * Validates accessibility requirements
384
+ */
385
+ declare const validateAccessibility: (componentType: string, props: Record<string, unknown>) => string[];
386
+ /**
387
+ * Generates keyboard shortcuts metadata
388
+ */
389
+ declare const generateKeyboardShortcuts: (componentType: string, context?: Record<string, unknown>) => string[];
390
+
391
+ /**
392
+ * Inference utilities for automatically determining semantic properties
393
+ * from PatternFly component props
394
+ */
395
+ /**
396
+ * Determine if a component is a visual parent (requires user action to see contents)
397
+ * vs a wrapper/structure (always visible)
398
+ */
399
+ declare const isVisualParent: (componentName: string) => boolean;
400
+ /**
401
+ * Infer button action from PatternFly variant and props
402
+ * Returns both behavior (what it does) and styling (how it looks)
403
+ */
404
+ declare const inferButtonAction: (variant?: string, href?: string, onClick?: unknown, target?: string) => {
405
+ type: string;
406
+ variant: string;
407
+ };
408
+ /**
409
+ * Infer input purpose from type
410
+ */
411
+ declare const inferInputPurpose: (type?: string) => string;
412
+ /**
413
+ * Infer alert severity
414
+ */
415
+ declare const inferAlertSeverity: (variant?: string) => string;
416
+ /**
417
+ * Infer context from parent or usage
418
+ */
419
+ declare const inferContext: (props: Record<string, unknown>) => string;
420
+ /**
421
+ * Infer card purpose from PatternFly props
422
+ */
423
+ declare const inferCardPurpose: (props: Record<string, unknown>) => string;
424
+ /**
425
+ * Infer modal purpose from props
426
+ */
427
+ declare const inferModalPurpose: (props: Record<string, unknown>) => string;
428
+ /**
429
+ * Infer accessibility features from props
430
+ */
431
+ declare const inferAccessibilityFeatures: (props: Record<string, unknown>) => string[];
432
+ /**
433
+ * Infer usage patterns from component type and props
434
+ */
435
+ declare const inferUsagePatterns: (componentType: string, props: Record<string, unknown>) => string[];
436
+ /**
437
+ * Generate comprehensive metadata from props
438
+ */
439
+ declare const generateMetadataFromProps: (componentName: string, props: Record<string, unknown>) => {
440
+ description: string;
441
+ category: string;
442
+ accessibility: string[];
443
+ usage: string[];
444
+ };
445
+ /**
446
+ * Infer card content type from PatternFly props and children
447
+ */
448
+ declare const inferCardContentType: (props: Record<string, unknown>) => string;
449
+ /**
450
+ * Infer card interactive state from PatternFly props
451
+ */
452
+ declare const inferCardInteractiveState: (props: Record<string, unknown>) => string;
453
+ /**
454
+ * Infer modal interaction type
455
+ */
456
+ declare const inferModalInteractionType: (isOpen?: boolean) => string;
457
+ /**
458
+ * Infer select purpose
459
+ */
460
+ declare const inferSelectPurpose: () => string;
461
+ /**
462
+ * Infer select selection type
463
+ */
464
+ declare const inferSelectSelectionType: (variant?: string) => string;
465
+ /**
466
+ * Infer radio purpose
467
+ */
468
+ declare const inferRadioPurpose: () => string;
469
+ /**
470
+ * Infer radio group context
471
+ */
472
+ declare const inferRadioGroupContext: (name?: string) => string;
473
+ /**
474
+ * Infer switch purpose
475
+ */
476
+ declare const inferSwitchPurpose: () => string;
477
+ /**
478
+ * Infer switch toggle target
479
+ */
480
+ declare const inferSwitchToggleTarget: () => string;
481
+ /**
482
+ * Infer textarea purpose
483
+ */
484
+ declare const inferTextAreaPurpose: () => string;
485
+ /**
486
+ * Infer textarea content type
487
+ */
488
+ declare const inferTextAreaContentType: () => string;
489
+ /**
490
+ * Infer checkbox purpose
491
+ */
492
+ declare const inferCheckboxPurpose: (isChecked?: boolean) => string;
493
+ /**
494
+ * Infer link purpose
495
+ */
496
+ declare const inferLinkPurpose: (href?: string, children?: unknown) => string;
497
+ /**
498
+ * Infer star icon purpose
499
+ */
500
+ declare const inferStarIconPurpose: (isFavorited?: boolean) => string;
501
+ /**
502
+ * Infer validation context
503
+ */
504
+ declare const inferValidationContext: (isRequired?: boolean) => string;
505
+ /**
506
+ * Infer form context (default for most form components)
507
+ */
508
+ declare const inferFormContext: () => string;
509
+ /**
510
+ * Infer settings context (default for switches)
511
+ */
512
+ declare const inferSettingsContext: () => string;
513
+ /**
514
+ * Infer status badge type from content
515
+ */
516
+ declare const inferStatusBadgeType: (content?: string) => string;
517
+ /**
518
+ * Infer status badge purpose
519
+ */
520
+ declare const inferStatusBadgePurpose: () => string;
521
+ /**
522
+ * Infer category from component name
523
+ * Category describes WHAT the component IS, not what it DOES (that's the action)
524
+ */
525
+ declare const inferCategory: (componentName: string) => string;
526
+
527
+ /**
528
+ * Hook for managing semantic metadata for components
529
+ */
530
+ declare const useSemanticMetadata: (componentName: string, userMetadata?: Partial<ComponentMetadata>, props?: Record<string, unknown>) => {
531
+ metadata: ComponentMetadata;
532
+ updateMetadata: (updates: Partial<ComponentMetadata>) => void;
533
+ };
534
+
535
+ /**
536
+ * Hook for managing accessibility features
537
+ */
538
+ declare const useAccessibility: (componentType: string, props?: Record<string, unknown>, context?: Record<string, unknown>) => {
539
+ ariaAttributes: Record<string, string>;
540
+ keyboardShortcuts: string[];
541
+ accessibilityIssues: string[];
542
+ enhancedProps: {
543
+ 'data-keyboard-shortcuts': string;
544
+ 'data-accessibility-issues': string;
545
+ };
546
+ };
547
+
548
+ interface HierarchyData {
549
+ fullPath: string;
550
+ qualifiedParents: string[];
551
+ wrappers: string[];
552
+ immediateParent: string;
553
+ immediateWrapper: string;
554
+ depth: number;
555
+ }
556
+ interface ContextItem {
557
+ name: string;
558
+ semanticName: string;
559
+ isQualified: boolean;
560
+ }
561
+ interface SemanticContextType {
562
+ contextStack: ContextItem[];
563
+ addContext: (context: string, semanticName?: string, isQualified?: boolean) => void;
564
+ removeContext: () => void;
565
+ getHierarchy: () => HierarchyData;
566
+ clearContext: () => void;
567
+ }
568
+ declare const useSemanticContext: () => SemanticContextType;
569
+ interface SemanticProviderProps {
570
+ children: ReactNode;
571
+ }
572
+ declare const SemanticProvider: React.FC<SemanticProviderProps>;
573
+
574
+ export { ActionMetadata, Button, ButtonProps, Card, CardProps, Checkbox, CheckboxProps, ComponentMetadata, Drawer, DrawerProps, DropdownItem, Flex, FlexItem, FlexItemProps, FlexProps, Form, FormProps, HierarchyData, HierarchyMetadata, Link, LinkProps, MenuToggle, Modal, ModalProps, Radio, RadioProps, Select, SelectProps, SemanticComponent, SemanticComponentProps, SemanticProvider, StarIcon, StarIconProps, StatusBadge, StatusBadgeProps, Switch, SwitchProps, Tbody, TbodyProps, Td, TdProps, TextArea, TextAreaProps, TextInput, TextInputProps, Th, ThProps, Thead, TheadProps, Tr, TrProps, generateAriaAttributes, generateComponentMetadata, generateKeyboardShortcuts, generateMetadataFromProps, inferAccessibilityFeatures, inferAlertSeverity, inferButtonAction, inferCardContentType, inferCardInteractiveState, inferCardPurpose, inferCategory, inferCheckboxPurpose, inferContext, inferFormContext, inferInputPurpose, inferLinkPurpose, inferModalInteractionType, inferModalPurpose, inferRadioGroupContext, inferRadioPurpose, inferSelectPurpose, inferSelectSelectionType, inferSettingsContext, inferStarIconPurpose, inferStatusBadgePurpose, inferStatusBadgeType, inferSwitchPurpose, inferSwitchToggleTarget, inferTextAreaContentType, inferTextAreaPurpose, inferUsagePatterns, inferValidationContext, isVisualParent, mergeMetadata, useAccessibility, useSemanticContext, useSemanticMetadata, validateAccessibility, validateMetadata };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,2BAA2B,CAAC"}