@stina/extension-api 0.28.1 → 0.29.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.
@@ -414,6 +414,16 @@ export const MarkdownPropsSchema = z
414
414
  .passthrough()
415
415
  .describe('Markdown component')
416
416
 
417
+ export const TextPreviewPropsSchema = z
418
+ .object({
419
+ component: z.literal('TextPreview'),
420
+ content: z.string().describe('Markdown content'),
421
+ maxLines: z.number().optional().describe('Max visible lines before truncating (default 5)'),
422
+ style: ExtensionComponentStyleSchema.optional(),
423
+ })
424
+ .passthrough()
425
+ .describe('TextPreview component')
426
+
417
427
  export const ModalPropsSchema = z
418
428
  .object({
419
429
  component: z.literal('Modal'),
@@ -438,6 +448,33 @@ export const ConditionalGroupPropsSchema = z
438
448
  .passthrough()
439
449
  .describe('ConditionalGroup component')
440
450
 
451
+ export const FrameVariantSchema = z
452
+ .enum(['border', 'solid'])
453
+ .describe('Frame visual variant')
454
+
455
+ export const FramePropsSchema = z
456
+ .object({
457
+ component: z.literal('Frame'),
458
+ title: z.union([z.string(), ExtensionComponentChildrenSchema]).optional().describe('Optional title (string or components)'),
459
+ icon: z.string().optional().describe('Icon name'),
460
+ collapsible: z.boolean().optional().describe('Whether content can be toggled'),
461
+ defaultExpanded: z.boolean().optional().describe('Whether expanded by default'),
462
+ variant: FrameVariantSchema.optional().describe('Visual variant'),
463
+ children: ExtensionComponentChildrenSchema.describe('Child components'),
464
+ style: ExtensionComponentStyleSchema.optional(),
465
+ })
466
+ .passthrough()
467
+ .describe('Frame container component')
468
+
469
+ export const ListPropsSchema = z
470
+ .object({
471
+ component: z.literal('List'),
472
+ children: ExtensionComponentChildrenSchema.describe('Child components rendered as list items'),
473
+ style: ExtensionComponentStyleSchema.optional(),
474
+ })
475
+ .passthrough()
476
+ .describe('List component')
477
+
441
478
  // =============================================================================
442
479
  // Type Exports
443
480
  // =============================================================================
@@ -473,5 +510,9 @@ export type CollapsibleProps = z.infer<typeof CollapsiblePropsSchema>
473
510
  export type PillProps = z.infer<typeof PillPropsSchema>
474
511
  export type CheckboxProps = z.infer<typeof CheckboxPropsSchema>
475
512
  export type MarkdownProps = z.infer<typeof MarkdownPropsSchema>
513
+ export type TextPreviewProps = z.infer<typeof TextPreviewPropsSchema>
476
514
  export type ModalProps = z.infer<typeof ModalPropsSchema>
477
515
  export type ConditionalGroupProps = z.infer<typeof ConditionalGroupPropsSchema>
516
+ export type FrameVariant = z.infer<typeof FrameVariantSchema>
517
+ export type FrameProps = z.infer<typeof FramePropsSchema>
518
+ export type ListProps = z.infer<typeof ListPropsSchema>
@@ -123,6 +123,10 @@ export {
123
123
  PanelPropsSchema,
124
124
  TogglePropsSchema,
125
125
  CollapsiblePropsSchema,
126
+ FrameVariantSchema,
127
+ FramePropsSchema,
128
+ TextPreviewPropsSchema,
129
+ ListPropsSchema,
126
130
  PillPropsSchema,
127
131
  CheckboxPropsSchema,
128
132
  MarkdownPropsSchema,
@@ -156,6 +160,10 @@ export {
156
160
  type PanelProps,
157
161
  type ToggleProps,
158
162
  type CollapsibleProps,
163
+ type FrameVariant,
164
+ type FrameProps,
165
+ type TextPreviewProps,
166
+ type ListProps,
159
167
  type PillProps,
160
168
  type CheckboxProps,
161
169
  type MarkdownProps,
@@ -1,3 +1,10 @@
1
+ // =============================================================================
2
+ // Icon Names
3
+ // =============================================================================
4
+
5
+ /** Semantic type alias for icon names (e.g. Hugeicons). Accepts any string. */
6
+ export type HugeIconName = string
7
+
1
8
  // =============================================================================
2
9
  // Styling
3
10
  // =============================================================================
@@ -235,7 +242,7 @@ export interface HeaderProps extends ExtensionComponentData {
235
242
  level: number
236
243
  title: string
237
244
  description?: string | string[]
238
- icon?: string
245
+ icon?: HugeIconName
239
246
  }
240
247
 
241
248
  /** The extension API properties for the Label component. */
@@ -321,7 +328,7 @@ export interface DividerProps extends ExtensionComponentData {
321
328
  /** The extension API properties for the Icon component. */
322
329
  export interface IconProps extends ExtensionComponentData {
323
330
  component: 'Icon'
324
- name: string
331
+ name: HugeIconName
325
332
  title?: string
326
333
  }
327
334
 
@@ -331,7 +338,7 @@ export type IconButtonType = 'normal' | 'primary' | 'danger' | 'accent'
331
338
  /** The extension API properties for the IconButton component. */
332
339
  export interface IconButtonProps extends ExtensionComponentData {
333
340
  component: 'IconButton'
334
- icon: string
341
+ icon: HugeIconName
335
342
  tooltip: string
336
343
  active?: boolean
337
344
  disabled?: boolean
@@ -341,7 +348,7 @@ export interface IconButtonProps extends ExtensionComponentData {
341
348
 
342
349
  /** Action button definition for Panel component. */
343
350
  export interface PanelAction {
344
- icon: string
351
+ icon: HugeIconName
345
352
  tooltip: string
346
353
  action: ExtensionActionRef
347
354
  type?: IconButtonType
@@ -352,7 +359,7 @@ export interface PanelProps extends ExtensionComponentData {
352
359
  component: 'Panel'
353
360
  title: string
354
361
  description?: string | string[]
355
- icon?: string
362
+ icon?: HugeIconName
356
363
  actions?: PanelAction[]
357
364
  content?: ExtensionComponentData
358
365
  }
@@ -375,7 +382,7 @@ export interface CollapsibleProps extends ExtensionComponentData {
375
382
  /** Optional description rendered under the title. */
376
383
  description?: string | string[]
377
384
  /** Optional icon shown to the left of the title. */
378
- icon?: string
385
+ icon?: HugeIconName
379
386
  /** Whether the section is expanded by default. */
380
387
  defaultExpanded?: boolean
381
388
  /** Child component to render when expanded. */
@@ -391,7 +398,7 @@ export interface PillProps extends ExtensionComponentData {
391
398
  /** Text to display in the pill. */
392
399
  text: string
393
400
  /** Optional icon shown to the left of the text. */
394
- icon?: string
401
+ icon?: HugeIconName
395
402
  /** Color variant. Defaults to 'default'. */
396
403
  variant?: PillVariant
397
404
  }
@@ -418,6 +425,15 @@ export interface MarkdownProps extends ExtensionComponentData {
418
425
  content: string
419
426
  }
420
427
 
428
+ /** The extension API properties for the TextPreview component. */
429
+ export interface TextPreviewProps extends ExtensionComponentData {
430
+ component: 'TextPreview'
431
+ /** Markdown content to render. */
432
+ content: string
433
+ /** Maximum number of visible lines before truncating. Defaults to 5. */
434
+ maxLines?: number
435
+ }
436
+
421
437
  /** The extension API properties for the Modal component. */
422
438
  export interface ModalProps extends ExtensionComponentData {
423
439
  component: 'Modal'
@@ -455,3 +471,28 @@ export interface ConditionalGroupProps extends ExtensionComponentData {
455
471
  /** Children to render when condition is true. */
456
472
  children: ExtensionComponentChildren
457
473
  }
474
+
475
+ /** Visual variant for the Frame component. */
476
+ export type FrameVariant = 'border' | 'solid'
477
+
478
+ /** The extension API properties for the Frame component. */
479
+ export interface FrameProps extends ExtensionComponentData {
480
+ component: 'Frame'
481
+ /** Optional title displayed in the header. Can be a plain string or extension components. */
482
+ title?: string | ExtensionComponentChildren
483
+ /** Whether the content can be toggled (collapsed/expanded) by clicking the title. Requires title to be set. */
484
+ collapsible?: boolean
485
+ /** Whether the frame content is expanded by default. Only used when collapsible is true. Defaults to true. */
486
+ defaultExpanded?: boolean
487
+ /** Visual variant: 'border' shows a bordered container, 'solid' shows a solid background. Defaults to 'border'. */
488
+ variant?: FrameVariant
489
+ /** Child components to render inside the frame. */
490
+ children: ExtensionComponentChildren
491
+ }
492
+
493
+ /** The extension API properties for the List component. */
494
+ export interface ListProps extends ExtensionComponentData {
495
+ component: 'List'
496
+ /** Child components to render as list items. Supports iteration. */
497
+ children: ExtensionComponentChildren
498
+ }