@ship-it-ui/shipit 0.0.2 → 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.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { BadgeProps } from '@ship-it-ui/ui';
1
+ import { BadgeProps, DataTableProps, DataTableColumn } from '@ship-it-ui/ui';
2
2
  export { cn } from '@ship-it-ui/ui';
3
3
  import * as react from 'react';
4
- import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes } from 'react';
4
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes, Ref } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
 
7
7
  /**
@@ -456,14 +456,22 @@ declare const Hero: react.ForwardRefExoticComponent<HeroProps & react.RefAttribu
456
456
  * PricingCard — single tier in a pricing table. Shows tier name, price,
457
457
  * description, list of features (with ✓ markers), and an action button slot.
458
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
+ *
459
463
  * Pass `featured` to highlight the card with an accent border + tinted
460
- * 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.
461
467
  */
462
468
  interface PricingCardProps extends HTMLAttributes<HTMLDivElement> {
463
469
  /** Tier name — e.g., `Pro`, `Team`. */
464
470
  tier: ReactNode;
465
- /** Price. Pass JSX (`<span>$29</span><span> / mo</span>`) for layout. */
471
+ /** Headline price, e.g. `$29` or `Talk to us`. */
466
472
  price: ReactNode;
473
+ /** Optional small unit rendered next to the price, e.g. `/ user / mo`. */
474
+ priceUnit?: ReactNode;
467
475
  /** Short description below the tier name. */
468
476
  description?: ReactNode;
469
477
  /** Feature bullet list. */
@@ -491,4 +499,37 @@ interface TestimonialProps extends Omit<HTMLAttributes<HTMLElement>, 'cite' | 'r
491
499
  }
492
500
  declare const Testimonial: react.ForwardRefExoticComponent<TestimonialProps & react.RefAttributes<HTMLElement>>;
493
501
 
494
- 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { BadgeProps } from '@ship-it-ui/ui';
1
+ import { BadgeProps, DataTableProps, DataTableColumn } from '@ship-it-ui/ui';
2
2
  export { cn } from '@ship-it-ui/ui';
3
3
  import * as react from 'react';
4
- import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes } from 'react';
4
+ import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, MouseEventHandler, SVGAttributes, Ref } from 'react';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
 
7
7
  /**
@@ -456,14 +456,22 @@ declare const Hero: react.ForwardRefExoticComponent<HeroProps & react.RefAttribu
456
456
  * PricingCard — single tier in a pricing table. Shows tier name, price,
457
457
  * description, list of features (with ✓ markers), and an action button slot.
458
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
+ *
459
463
  * Pass `featured` to highlight the card with an accent border + tinted
460
- * 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.
461
467
  */
462
468
  interface PricingCardProps extends HTMLAttributes<HTMLDivElement> {
463
469
  /** Tier name — e.g., `Pro`, `Team`. */
464
470
  tier: ReactNode;
465
- /** Price. Pass JSX (`<span>$29</span><span> / mo</span>`) for layout. */
471
+ /** Headline price, e.g. `$29` or `Talk to us`. */
466
472
  price: ReactNode;
473
+ /** Optional small unit rendered next to the price, e.g. `/ user / mo`. */
474
+ priceUnit?: ReactNode;
467
475
  /** Short description below the tier name. */
468
476
  description?: ReactNode;
469
477
  /** Feature bullet list. */
@@ -491,4 +499,37 @@ interface TestimonialProps extends Omit<HTMLAttributes<HTMLElement>, 'cite' | 'r
491
499
  }
492
500
  declare const Testimonial: react.ForwardRefExoticComponent<TestimonialProps & react.RefAttributes<HTMLElement>>;
493
501
 
494
- 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, 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 };
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 };
package/dist/index.js CHANGED
@@ -1024,26 +1024,29 @@ Hero.displayName = "Hero";
1024
1024
  import { forwardRef as forwardRef21 } from "react";
1025
1025
  import { cn as cn19 } from "@ship-it-ui/ui";
1026
1026
  import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
1027
- var PricingCard = forwardRef21(function PricingCard2({ tier, price, description, features, action, featured, className, ...props }, ref) {
1027
+ var PricingCard = forwardRef21(function PricingCard2({ tier, price, priceUnit, description, features, action, featured, className, ...props }, ref) {
1028
1028
  return /* @__PURE__ */ jsxs20(
1029
1029
  "div",
1030
1030
  {
1031
1031
  ref,
1032
1032
  className: cn19(
1033
- "bg-panel flex flex-col gap-5 rounded-lg border p-6",
1033
+ "bg-panel @container flex flex-col gap-5 rounded-lg border p-5 @sm:p-6",
1034
1034
  featured ? "border-accent shadow-lg" : "border-border",
1035
1035
  className
1036
1036
  ),
1037
1037
  ...props,
1038
1038
  children: [
1039
1039
  /* @__PURE__ */ jsxs20("div", { children: [
1040
- /* @__PURE__ */ jsxs20("div", { className: "mb-1 flex items-center gap-2", children: [
1040
+ /* @__PURE__ */ jsxs20("div", { className: "mb-1 flex flex-wrap items-center gap-2", children: [
1041
1041
  /* @__PURE__ */ jsx21("span", { className: "text-[14px] font-medium", children: tier }),
1042
1042
  featured && /* @__PURE__ */ jsx21("span", { className: "bg-accent-dim text-accent rounded-full px-[6px] py-[1px] font-mono text-[10px]", children: "recommended" })
1043
1043
  ] }),
1044
1044
  description && /* @__PURE__ */ jsx21("div", { className: "text-text-muted text-[12px]", children: description })
1045
1045
  ] }),
1046
- /* @__PURE__ */ jsx21("div", { className: "font-mono text-[28px] font-medium tracking-[-0.5px]", children: price }),
1046
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-baseline justify-center gap-x-2 gap-y-1", children: [
1047
+ /* @__PURE__ */ jsx21("span", { className: "font-mono text-[22px] font-medium tracking-[-0.5px] text-balance @sm:text-[28px]", children: price }),
1048
+ priceUnit != null && /* @__PURE__ */ jsx21("span", { className: "text-text-dim text-[12px] whitespace-nowrap @sm:text-[13px]", children: priceUnit })
1049
+ ] }),
1047
1050
  /* @__PURE__ */ jsx21("ul", { className: "m-0 flex list-none flex-col gap-2 p-0", children: features.map((f, i) => /* @__PURE__ */ jsxs20("li", { className: "flex items-start gap-2 text-[13px]", children: [
1048
1051
  /* @__PURE__ */ jsx21("span", { "aria-hidden": true, className: "text-accent", children: "\u2713" }),
1049
1052
  /* @__PURE__ */ jsx21("span", { children: f })
@@ -1082,6 +1085,34 @@ var Testimonial = forwardRef22(function Testimonial2({ quote, author, role, avat
1082
1085
  );
1083
1086
  });
1084
1087
  Testimonial.displayName = "Testimonial";
1088
+
1089
+ // src/data/EntityTable.tsx
1090
+ import { DataTable } from "@ship-it-ui/ui";
1091
+ import "react";
1092
+ import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
1093
+ function EntityTable(props) {
1094
+ const { rowKey, ...rest } = props;
1095
+ return /* @__PURE__ */ jsx23(DataTable, { ...rest, rowKey: rowKey ?? ((row) => row.id) });
1096
+ }
1097
+ function entityColumn(options = {}) {
1098
+ return {
1099
+ key: options.key ?? "name",
1100
+ header: options.header ?? "Name",
1101
+ accessor: (row) => row.name,
1102
+ cell: (row) => /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-2 font-mono", children: [
1103
+ /* @__PURE__ */ jsx23("span", { "aria-hidden": true, className: ENTITY_TONE_CLASS[row.type], children: ENTITY_GLYPH[row.type] }),
1104
+ row.name
1105
+ ] })
1106
+ };
1107
+ }
1108
+ function entityTypeColumn(options = {}) {
1109
+ return {
1110
+ key: options.key ?? "type",
1111
+ header: options.header ?? "Type",
1112
+ accessor: (row) => row.type,
1113
+ cell: (row) => /* @__PURE__ */ jsx23(EntityBadge, { type: row.type, size: "sm" })
1114
+ };
1115
+ }
1085
1116
  export {
1086
1117
  AskBar,
1087
1118
  CTAStrip,
@@ -1097,6 +1128,7 @@ export {
1097
1128
  EntityListRow,
1098
1129
  EntityListRowButton,
1099
1130
  EntityListRowDiv,
1131
+ EntityTable,
1100
1132
  FeatureGrid,
1101
1133
  Footer,
1102
1134
  GraphEdge,
@@ -1112,6 +1144,8 @@ export {
1112
1144
  SuggestionChip,
1113
1145
  Testimonial,
1114
1146
  ToolCallCard,
1115
- cn21 as cn
1147
+ cn21 as cn,
1148
+ entityColumn,
1149
+ entityTypeColumn
1116
1150
  };
1117
1151
  //# sourceMappingURL=index.js.map