@ship-it-ui/shipit 0.0.1 → 0.0.3

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.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { ClassValue } from 'clsx';
1
+ import { BadgeProps, DataTableProps, DataTableColumn } from '@ship-it-ui/ui';
2
+ export { cn } from '@ship-it-ui/ui';
2
3
  import * as react from 'react';
3
- import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, SVGAttributes } from 'react';
4
- import { BadgeProps } from '@ship-it-ui/ui';
5
-
6
- declare function cn(...inputs: ClassValue[]): string;
4
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes, Ref } from 'react';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
7
6
 
8
7
  /**
9
8
  * AskBar — the primary "ask anything" input. The leading ✦ glyph + accent
@@ -32,7 +31,7 @@ interface AskBarProps extends Omit<HTMLAttributes<HTMLFormElement>, 'onSubmit' |
32
31
  }
33
32
  declare const AskBar: react.ForwardRefExoticComponent<AskBarProps & react.RefAttributes<HTMLFormElement>>;
34
33
 
35
- interface CitationProps extends HTMLAttributes<HTMLSpanElement> {
34
+ interface CitationProps extends HTMLAttributes<HTMLElement> {
36
35
  /** Citation number (1-indexed). */
37
36
  index: number;
38
37
  /** Source label — e.g., `runbook-oncall.md:L42`. */
@@ -42,7 +41,7 @@ interface CitationProps extends HTMLAttributes<HTMLSpanElement> {
42
41
  /** Inline superscript variant (renders the number only, no source row). */
43
42
  inline?: boolean;
44
43
  }
45
- declare const Citation: react.ForwardRefExoticComponent<CitationProps & react.RefAttributes<HTMLSpanElement>>;
44
+ declare const Citation: react.ForwardRefExoticComponent<CitationProps & react.RefAttributes<HTMLElement>>;
46
45
 
47
46
  /**
48
47
  * ConfidenceIndicator — horizontal bar + percent + tier label. The tier tone
@@ -187,8 +186,34 @@ declare const EntityCard: react.ForwardRefExoticComponent<EntityCardProps & reac
187
186
  * optional trailing meta.
188
187
  *
189
188
  * Renders as a button when `onClick` is supplied; otherwise a plain row.
189
+ *
190
+ * For strongly-typed refs use the specialized exports `EntityListRowDiv`
191
+ * (non-interactive) and `EntityListRowButton` (interactive). The default
192
+ * `EntityListRow` is a thin wrapper that picks the right underlying element
193
+ * based on whether `onClick` is provided.
190
194
  */
191
- interface EntityListRowProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
195
+ interface EntityListRowCommonProps {
196
+ type: EntityType;
197
+ /** Entity name / id. Rendered in mono. */
198
+ name: ReactNode;
199
+ /** Trailing pill (e.g., relation type: `OWNED_BY`). */
200
+ relation?: ReactNode;
201
+ /** Trailing meta line (e.g., a timestamp). */
202
+ meta?: ReactNode;
203
+ /** When true, hides the leading glyph dot. */
204
+ hideGlyph?: boolean;
205
+ }
206
+ interface EntityListRowDivProps extends EntityListRowCommonProps, Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'name'> {
207
+ }
208
+ /** Non-interactive row. Use this when you have a static list of entities. */
209
+ declare const EntityListRowDiv: react.ForwardRefExoticComponent<EntityListRowDivProps & react.RefAttributes<HTMLDivElement>>;
210
+ interface EntityListRowButtonProps extends EntityListRowCommonProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'title' | 'type' | 'name' | 'onClick'> {
211
+ /** Click handler. Required for the button variant. */
212
+ onClick: MouseEventHandler<HTMLButtonElement>;
213
+ }
214
+ /** Interactive row rendered as a `<button>`. Use this when the row navigates. */
215
+ declare const EntityListRowButton: react.ForwardRefExoticComponent<EntityListRowButtonProps & react.RefAttributes<HTMLButtonElement>>;
216
+ interface EntityListRowProps extends Omit<HTMLAttributes<HTMLElement>, 'title' | 'name' | 'onClick'> {
192
217
  type: EntityType;
193
218
  /** Entity name / id. Rendered in mono. */
194
219
  name: ReactNode;
@@ -197,11 +222,19 @@ interface EntityListRowProps extends Omit<HTMLAttributes<HTMLElement>, 'title'>
197
222
  /** Trailing meta line (e.g., a timestamp). */
198
223
  meta?: ReactNode;
199
224
  /** When provided, the row becomes a clickable button. */
200
- onClick?: () => void;
225
+ onClick?: MouseEventHandler<HTMLButtonElement>;
201
226
  /** When true, hides the leading glyph dot. */
202
227
  hideGlyph?: boolean;
203
228
  }
204
- declare const EntityListRow: react.ForwardRefExoticComponent<EntityListRowProps & react.RefAttributes<HTMLElement>>;
229
+ /**
230
+ * Convenience wrapper: chooses `EntityListRowButton` when `onClick` is
231
+ * supplied, otherwise `EntityListRowDiv`. Does not forward refs — when you
232
+ * need a typed ref, reach for the specialized component directly.
233
+ */
234
+ declare function EntityListRow({ type, name, relation, meta, hideGlyph, onClick, className, ...props }: EntityListRowProps): react_jsx_runtime.JSX.Element;
235
+ declare namespace EntityListRow {
236
+ var displayName: string;
237
+ }
205
238
 
206
239
  /**
207
240
  * GraphEdge — SVG `<line>` (or `<path>` if curve points are provided) rendered
@@ -423,14 +456,22 @@ declare const Hero: react.ForwardRefExoticComponent<HeroProps & react.RefAttribu
423
456
  * PricingCard — single tier in a pricing table. Shows tier name, price,
424
457
  * description, list of features (with ✓ markers), and an action button slot.
425
458
  *
459
+ * The card establishes a CSS container, so the price scales with the card's
460
+ * own inline-size rather than the viewport — when three cards crowd into a
461
+ * narrow column the price doesn't blow out the layout.
462
+ *
426
463
  * Pass `featured` to highlight the card with an accent border + tinted
427
- * background for the "recommended" tier.
464
+ * background for the "recommended" tier. Use `priceUnit` for per-period
465
+ * suffixes (e.g. `/ user / mo`) so the unit lays out next to the price
466
+ * baseline-aligned and wraps cleanly when there isn't room.
428
467
  */
429
468
  interface PricingCardProps extends HTMLAttributes<HTMLDivElement> {
430
469
  /** Tier name — e.g., `Pro`, `Team`. */
431
470
  tier: ReactNode;
432
- /** Price. Pass JSX (`<span>$29</span><span> / mo</span>`) for layout. */
471
+ /** Headline price, e.g. `$29` or `Talk to us`. */
433
472
  price: ReactNode;
473
+ /** Optional small unit rendered next to the price, e.g. `/ user / mo`. */
474
+ priceUnit?: ReactNode;
434
475
  /** Short description below the tier name. */
435
476
  description?: ReactNode;
436
477
  /** Feature bullet list. */
@@ -458,4 +499,37 @@ interface TestimonialProps extends Omit<HTMLAttributes<HTMLElement>, 'cite' | 'r
458
499
  }
459
500
  declare const Testimonial: react.ForwardRefExoticComponent<TestimonialProps & react.RefAttributes<HTMLElement>>;
460
501
 
461
- export { AskBar, type AskBarProps, CTAStrip, type CTAStripProps, Citation, type CitationProps, ConfidenceIndicator, type ConfidenceIndicatorProps, type ConfidenceTier, CopilotMessage, type CopilotMessageProps, type CopilotRole, ENTITY_GLYPH, ENTITY_LABEL, ENTITY_TONE_BG, ENTITY_TONE_CLASS, EntityBadge, type EntityBadgeProps, EntityCard, type EntityCardProps, EntityListRow, type EntityListRowProps, type EntityStat, type EntityType, type Feature, FeatureGrid, type FeatureGridProps, Footer, type FooterColumn, type FooterLink, type FooterProps, GraphEdge, type GraphEdgeProps, type GraphEdgeStyle, GraphInspector, type GraphInspectorProps, GraphLegend, type GraphLegendEntry, type GraphLegendProps, GraphMinimap, type GraphMinimapProps, GraphNode, type GraphNodeProps, type GraphNodeState, Hero, type HeroProps, type InspectorProperty, type InspectorRelation, type MinimapPoint, type MinimapViewport, PathOverlay, type PathOverlayProps, type PathPoint, PricingCard, type PricingCardProps, ReasoningBlock, type ReasoningBlockProps, ReasoningStep, type ReasoningStepProps, SuggestionChip, type SuggestionChipProps, Testimonial, type TestimonialProps, ToolCallCard, type ToolCallCardProps, cn };
502
+ /**
503
+ * EntityTable — DataTable preset with two ShipIt-aware column helpers:
504
+ * `entityColumn(...)` for the typed name cell and `entityTypeColumn()` for a
505
+ * standalone type column. Everything else (sort, selection, sticky header)
506
+ * comes from `@ship-it-ui/ui` DataTable as-is.
507
+ */
508
+ interface MinimalEntity {
509
+ id: string;
510
+ type: EntityType;
511
+ name: string;
512
+ }
513
+ type EntityTableProps<T extends MinimalEntity> = Omit<DataTableProps<T>, 'rowKey'> & {
514
+ rowKey?: (row: T) => string;
515
+ };
516
+ declare function EntityTable<T extends MinimalEntity>(props: EntityTableProps<T> & {
517
+ ref?: Ref<HTMLTableElement>;
518
+ }): react_jsx_runtime.JSX.Element;
519
+ /**
520
+ * Pre-built column for the entity name. Renders the type glyph (in the type's
521
+ * tone) followed by the name in mono. Sorts on `name`.
522
+ */
523
+ declare function entityColumn<T extends MinimalEntity>(options?: {
524
+ key?: string;
525
+ header?: string;
526
+ }): DataTableColumn<T>;
527
+ /**
528
+ * Pre-built column rendering the canonical EntityBadge.
529
+ */
530
+ declare function entityTypeColumn<T extends MinimalEntity>(options?: {
531
+ key?: string;
532
+ header?: string;
533
+ }): DataTableColumn<T>;
534
+
535
+ export { AskBar, type AskBarProps, CTAStrip, type CTAStripProps, Citation, type CitationProps, ConfidenceIndicator, type ConfidenceIndicatorProps, type ConfidenceTier, CopilotMessage, type CopilotMessageProps, type CopilotRole, ENTITY_GLYPH, ENTITY_LABEL, ENTITY_TONE_BG, ENTITY_TONE_CLASS, EntityBadge, type EntityBadgeProps, EntityCard, type EntityCardProps, EntityListRow, EntityListRowButton, type EntityListRowButtonProps, EntityListRowDiv, type EntityListRowDivProps, type EntityListRowProps, type EntityStat, EntityTable, type EntityTableProps, type EntityType, type Feature, FeatureGrid, type FeatureGridProps, Footer, type FooterColumn, type FooterLink, type FooterProps, GraphEdge, type GraphEdgeProps, type GraphEdgeStyle, GraphInspector, type GraphInspectorProps, GraphLegend, type GraphLegendEntry, type GraphLegendProps, GraphMinimap, type GraphMinimapProps, GraphNode, type GraphNodeProps, type GraphNodeState, Hero, type HeroProps, type InspectorProperty, type InspectorRelation, type MinimapPoint, type MinimapViewport, PathOverlay, type PathOverlayProps, type PathPoint, PricingCard, type PricingCardProps, ReasoningBlock, type ReasoningBlockProps, ReasoningStep, type ReasoningStepProps, SuggestionChip, type SuggestionChipProps, Testimonial, type TestimonialProps, ToolCallCard, type ToolCallCardProps, entityColumn, entityTypeColumn };