@ship-it-ui/shipit 0.0.4 → 0.0.6

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.cjs CHANGED
@@ -46,6 +46,7 @@ __export(index_exports, {
46
46
  GraphMinimap: () => GraphMinimap,
47
47
  GraphNode: () => GraphNode,
48
48
  Hero: () => Hero,
49
+ NotifRow: () => NotifRow,
49
50
  PathOverlay: () => PathOverlay,
50
51
  PricingCard: () => PricingCard,
51
52
  ReasoningBlock: () => ReasoningBlock,
@@ -53,7 +54,7 @@ __export(index_exports, {
53
54
  SuggestionChip: () => SuggestionChip,
54
55
  Testimonial: () => Testimonial,
55
56
  ToolCallCard: () => ToolCallCard,
56
- cn: () => import_ui29.cn,
57
+ cn: () => import_ui30.cn,
57
58
  entityColumn: () => entityColumn,
58
59
  entityTypeColumn: () => entityTypeColumn,
59
60
  getEntityTypeMeta: () => getEntityTypeMeta,
@@ -63,7 +64,7 @@ __export(index_exports, {
63
64
  resetEntityTypeRegistry: () => resetEntityTypeRegistry
64
65
  });
65
66
  module.exports = __toCommonJS(index_exports);
66
- var import_ui29 = require("@ship-it-ui/ui");
67
+ var import_ui30 = require("@ship-it-ui/ui");
67
68
 
68
69
  // src/ai/AskBar.tsx
69
70
  var import_ui = require("@ship-it-ui/ui");
@@ -80,10 +81,12 @@ var AskBar = (0, import_react.forwardRef)(function AskBar2({
80
81
  submitLabel = "Ask",
81
82
  disabled,
82
83
  maxWidth = 620,
84
+ density = "comfortable",
83
85
  className,
84
86
  children,
85
87
  ...props
86
88
  }, ref) {
89
+ const isTouch = density === "touch";
87
90
  const [value, setValue] = (0, import_ui.useControllableState)({
88
91
  value: valueProp,
89
92
  defaultValue: defaultValue ?? "",
@@ -111,16 +114,17 @@ var AskBar = (0, import_react.forwardRef)(function AskBar2({
111
114
  ref,
112
115
  role: "search",
113
116
  onSubmit: handleSubmit,
114
- style: { maxWidth },
117
+ style: { maxWidth: isTouch ? void 0 : maxWidth },
115
118
  className: (0, import_ui2.cn)(
116
- "border-border-strong bg-panel w-full rounded-xl border p-[14px] shadow",
119
+ "border-border-strong bg-panel w-full border",
120
+ isTouch ? "rounded-m-card p-3" : "rounded-xl p-[14px] shadow",
117
121
  "focus-within:border-accent focus-within:ring-accent-dim focus-within:ring-[3px]",
118
122
  className
119
123
  ),
120
124
  ...props,
121
125
  children: [
122
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-[10px] flex items-start gap-[10px]", children: [
123
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "text-accent text-[16px]", children: "\u2726" }),
126
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_ui2.cn)("flex items-start gap-[10px]", isTouch ? "mb-2" : "mb-[10px]"), children: [
127
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: (0, import_ui2.cn)("text-accent", isTouch ? "text-[18px]" : "text-[16px]"), children: "\u2726" }),
124
128
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
125
129
  "textarea",
126
130
  {
@@ -132,8 +136,9 @@ var AskBar = (0, import_react.forwardRef)(function AskBar2({
132
136
  "aria-label": placeholder,
133
137
  rows: 1,
134
138
  className: (0, import_ui2.cn)(
135
- "text-text flex-1 resize-none border-0 bg-transparent text-[14px] leading-[1.5] outline-none",
136
- "placeholder:text-text-dim"
139
+ "text-text flex-1 resize-none border-0 bg-transparent leading-[1.5] outline-none",
140
+ "placeholder:text-text-dim",
141
+ isTouch ? "text-m-body" : "text-[14px]"
137
142
  )
138
143
  }
139
144
  ),
@@ -141,19 +146,23 @@ var AskBar = (0, import_react.forwardRef)(function AskBar2({
141
146
  "span",
142
147
  {
143
148
  "aria-hidden": true,
144
- className: "bg-accent mt-[3px] inline-block h-4 w-px animate-[ship-pulse_1s_infinite]"
149
+ className: (0, import_ui2.cn)(
150
+ "bg-accent mt-[3px] inline-block w-px animate-[ship-pulse_1s_infinite]",
151
+ isTouch ? "h-5" : "h-4"
152
+ )
145
153
  }
146
154
  )
147
155
  ] }),
148
156
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-center gap-[6px]", children: [
149
157
  children,
150
158
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [
151
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "text-text-dim font-mono text-[11px]", children: "\u2318\u21B5" }),
159
+ !isTouch && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": true, className: "text-text-dim font-mono text-[11px]", children: "\u2318\u21B5" }),
152
160
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
153
161
  import_ui.Button,
154
162
  {
155
163
  type: "submit",
156
- size: "sm",
164
+ size: isTouch ? "md" : "sm",
165
+ density: isTouch ? "touch" : void 0,
157
166
  variant: "primary",
158
167
  disabled: disabled || !(value ?? "").trim(),
159
168
  children: submitLabel
@@ -283,8 +292,49 @@ var import_ui6 = require("@ship-it-ui/ui");
283
292
  var import_react4 = require("react");
284
293
  var import_jsx_runtime4 = require("react/jsx-runtime");
285
294
  var CopilotMessage = (0, import_react4.forwardRef)(
286
- function CopilotMessage2({ role, avatar, streaming, className, children, ...props }, ref) {
295
+ function CopilotMessage2({ role, avatar, streaming, density = "comfortable", className, children, ...props }, ref) {
287
296
  const isAssistant = role === "assistant";
297
+ const isTouch = density === "touch";
298
+ if (isTouch) {
299
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
300
+ "div",
301
+ {
302
+ ref,
303
+ className: (0, import_ui6.cn)(
304
+ "flex flex-col gap-[6px]",
305
+ isAssistant ? "items-start" : "items-end",
306
+ className
307
+ ),
308
+ "data-role": role,
309
+ ...props,
310
+ children: [
311
+ isAssistant && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "text-m-eyebrow text-accent inline-flex items-center gap-[6px] font-mono tracking-wide uppercase", children: [
312
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, children: "\u2726" }),
313
+ streaming ? "thinking" : "ShipIt"
314
+ ] }),
315
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
316
+ "div",
317
+ {
318
+ className: (0, import_ui6.cn)(
319
+ "rounded-m-card text-m-body max-w-[85%] px-[14px] py-3 leading-normal",
320
+ isAssistant ? "bg-panel border-border border" : "bg-accent text-on-accent"
321
+ ),
322
+ children: [
323
+ children,
324
+ streaming && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
325
+ "span",
326
+ {
327
+ "aria-hidden": true,
328
+ className: "bg-accent ml-[2px] inline-block h-4 w-px animate-[ship-pulse_1s_infinite] align-middle"
329
+ }
330
+ )
331
+ ]
332
+ }
333
+ )
334
+ ]
335
+ }
336
+ );
337
+ }
288
338
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
289
339
  "div",
290
340
  {
@@ -1337,6 +1387,88 @@ function entityTypeColumn(options = {}) {
1337
1387
  cell: (row) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(EntityBadge, { type: row.type, size: "sm" })
1338
1388
  };
1339
1389
  }
1390
+
1391
+ // src/notifications/NotifRow.tsx
1392
+ var import_ui29 = require("@ship-it-ui/ui");
1393
+ var import_react25 = require("react");
1394
+ var import_jsx_runtime25 = require("react/jsx-runtime");
1395
+ var toneClass = {
1396
+ ok: "bg-ok",
1397
+ warn: "bg-warn",
1398
+ err: "bg-err",
1399
+ neutral: "bg-accent-text"
1400
+ };
1401
+ var NotifRow = (0, import_react25.forwardRef)(function NotifRow2({
1402
+ title,
1403
+ body,
1404
+ time,
1405
+ tone = "neutral",
1406
+ unread,
1407
+ isFirst,
1408
+ isLast,
1409
+ href,
1410
+ className,
1411
+ onClick,
1412
+ ...props
1413
+ }, ref) {
1414
+ const content = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
1415
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "pt-1", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1416
+ "div",
1417
+ {
1418
+ className: (0, import_ui29.cn)("h-2 w-2 rounded-full", unread ? toneClass[tone] : "bg-border-strong")
1419
+ }
1420
+ ) }),
1421
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-0 flex-1", children: [
1422
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-baseline justify-between gap-2", children: [
1423
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "truncate text-[14px] font-medium tracking-tight", children: title }),
1424
+ time != null && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-text-muted shrink-0 font-mono text-[11px] whitespace-nowrap", children: time })
1425
+ ] }),
1426
+ body && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "text-text-muted mt-[3px] text-[13px] leading-tight", children: body })
1427
+ ] })
1428
+ ] });
1429
+ const baseClass = (0, import_ui29.cn)(
1430
+ "flex gap-3 p-[14px] bg-panel border-border border-l border-r",
1431
+ isFirst ? "border-t rounded-t-m-card" : "",
1432
+ "border-b",
1433
+ isLast ? "rounded-b-m-card" : "",
1434
+ href || onClick ? "cursor-pointer hover:bg-panel-2" : "",
1435
+ className
1436
+ );
1437
+ if (href) {
1438
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1439
+ "a",
1440
+ {
1441
+ ref,
1442
+ href,
1443
+ onClick,
1444
+ className: (0, import_ui29.cn)(
1445
+ baseClass,
1446
+ "text-text focus-visible:ring-accent-dim no-underline outline-none focus-visible:ring-[3px]"
1447
+ ),
1448
+ ...props,
1449
+ children: content
1450
+ }
1451
+ );
1452
+ }
1453
+ if (onClick) {
1454
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1455
+ "button",
1456
+ {
1457
+ type: "button",
1458
+ ref,
1459
+ onClick,
1460
+ className: (0, import_ui29.cn)(
1461
+ baseClass,
1462
+ "focus-visible:ring-accent-dim text-left outline-none focus-visible:ring-[3px]"
1463
+ ),
1464
+ ...props,
1465
+ children: content
1466
+ }
1467
+ );
1468
+ }
1469
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, className: baseClass, ...props, children: content });
1470
+ });
1471
+ NotifRow.displayName = "NotifRow";
1340
1472
  // Annotate the CommonJS export names for ESM import in node:
1341
1473
  0 && (module.exports = {
1342
1474
  AskBar,
@@ -1363,6 +1495,7 @@ function entityTypeColumn(options = {}) {
1363
1495
  GraphMinimap,
1364
1496
  GraphNode,
1365
1497
  Hero,
1498
+ NotifRow,
1366
1499
  PathOverlay,
1367
1500
  PricingCard,
1368
1501
  ReasoningBlock,