@stll/ui 0.6.0 → 0.8.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 (42) hide show
  1. package/README.md +20 -0
  2. package/dist/components/application-rail.d.ts +20 -0
  3. package/dist/components/application-rail.js +52 -0
  4. package/dist/components/application-shell.d.ts +27 -0
  5. package/dist/components/application-shell.js +25 -0
  6. package/dist/components/button-variants.d.ts +2 -2
  7. package/dist/components/combobox.d.ts +3 -2
  8. package/dist/components/combobox.js +35 -7
  9. package/dist/components/command.d.ts +2 -1
  10. package/dist/components/command.js +8 -2
  11. package/dist/components/input-group.d.ts +1 -1
  12. package/dist/components/input.d.ts +2 -1
  13. package/dist/components/input.js +9 -2
  14. package/dist/components/select.d.ts +2 -1
  15. package/dist/components/select.js +8 -2
  16. package/dist/components/textarea.d.ts +2 -1
  17. package/dist/components/textarea.js +9 -2
  18. package/dist/index.d.ts +13 -1
  19. package/dist/index.js +14 -2
  20. package/dist/inspector/index.d.ts +2 -1
  21. package/dist/inspector/index.js +2 -1
  22. package/dist/inspector/tabs.d.ts +16 -0
  23. package/dist/inspector/tabs.js +49 -0
  24. package/dist/lib/control-size.d.ts +10 -0
  25. package/dist/lib/control-size.js +9 -0
  26. package/dist/lib/initials.d.ts +16 -0
  27. package/dist/lib/initials.js +27 -0
  28. package/dist/review/review-author-avatar.d.ts +23 -0
  29. package/dist/review/review-author-avatar.js +30 -0
  30. package/dist/review/review-comment-card.d.ts +33 -0
  31. package/dist/review/review-comment-card.js +76 -0
  32. package/dist/review/review-decision-actions.d.ts +32 -0
  33. package/dist/review/review-decision-actions.js +74 -0
  34. package/dist/review/review-diff-text.d.ts +33 -0
  35. package/dist/review/review-diff-text.js +67 -0
  36. package/dist/review/review-out-of-date-notice.d.ts +28 -0
  37. package/dist/review/review-out-of-date-notice.js +32 -0
  38. package/dist/review/review-severity-dot.d.ts +27 -0
  39. package/dist/review/review-severity-dot.js +35 -0
  40. package/dist/review/review-status-badge.d.ts +30 -0
  41. package/dist/review/review-status-badge.js +45 -0
  42. package/package.json +53 -1
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/review/review-out-of-date-notice.d.ts
3
+ type ReviewOutOfDateTone = "warning" | "muted";
4
+ /**
5
+ * One reason a review has fallen behind. Carries its own key so the list is
6
+ * never rendered by array index: reasons come and go independently (the
7
+ * document changed, the playbook moved on, the source was deleted) and each
8
+ * one has a stable identity at its call site.
9
+ */
10
+ type ReviewOutOfDateReason = {
11
+ id: string;
12
+ label: ReactNode;
13
+ };
14
+ type ReviewOutOfDateNoticeProps = {
15
+ reasons: readonly ReviewOutOfDateReason[];
16
+ actionLabel?: ReactNode;
17
+ onAction?: (() => void) | undefined;
18
+ tone?: ReviewOutOfDateTone;
19
+ className?: string;
20
+ };
21
+ /**
22
+ * What a review no longer reflects. Every applicable reason is listed
23
+ * together: they are different reasons to run again, and a reviewer working
24
+ * through findings should see each one rather than the first.
25
+ */
26
+ declare const ReviewOutOfDateNotice: ({ reasons, actionLabel, onAction, tone, className }: ReviewOutOfDateNoticeProps) => import("react").JSX.Element | null;
27
+ //#endregion
28
+ export { ReviewOutOfDateNotice, ReviewOutOfDateReason, ReviewOutOfDateTone };
@@ -0,0 +1,32 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { Button } from "../components/button.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/review/review-out-of-date-notice.tsx
5
+ /**
6
+ * What a review no longer reflects. Every applicable reason is listed
7
+ * together: they are different reasons to run again, and a reviewer working
8
+ * through findings should see each one rather than the first.
9
+ */
10
+ const ReviewOutOfDateNotice = ({ reasons, actionLabel, onAction, tone = "warning", className }) => {
11
+ if (reasons.length === 0) return null;
12
+ return /* @__PURE__ */ jsxs("div", {
13
+ className: cn("mb-2 rounded-lg border px-3 py-2", TONE_CLASS[tone], className),
14
+ "data-slot": "review-out-of-date-notice",
15
+ children: [/* @__PURE__ */ jsx("ul", {
16
+ className: "space-y-1 text-xs",
17
+ children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: reason.label }, reason.id))
18
+ }), onAction === void 0 ? null : /* @__PURE__ */ jsx(Button, {
19
+ className: "mt-2",
20
+ onClick: onAction,
21
+ size: "xs",
22
+ variant: "outline",
23
+ children: actionLabel
24
+ })]
25
+ });
26
+ };
27
+ const TONE_CLASS = {
28
+ warning: "border-warning/30 bg-warning/10 text-warning-foreground",
29
+ muted: "border-border bg-muted/50 text-muted-foreground"
30
+ };
31
+ //#endregion
32
+ export { ReviewOutOfDateNotice };
@@ -0,0 +1,27 @@
1
+ import { ReviewStatusTone } from "./review-status-badge.js";
2
+ //#region src/review/review-severity-dot.d.ts
3
+ /**
4
+ * How bad a finding is, on the one scale every review surface reports against.
5
+ * Vocabularies that stop short of five levels (a playbook's blocker/high/
6
+ * medium/low, a suggestion's high/medium/low/unspecified) map onto this at
7
+ * their call site rather than growing a palette of their own.
8
+ */
9
+ type ReviewSeverityLevel = "critical" | "high" | "medium" | "low" | "none";
10
+ type ReviewSeverityDotProps = {
11
+ level: ReviewSeverityLevel;
12
+ className?: string | undefined;
13
+ };
14
+ /** The dot that precedes a severity label, and the one place a severity level
15
+ * turns into a colour. */
16
+ declare const ReviewSeverityDot: ({ level, className }: ReviewSeverityDotProps) => import("react").JSX.Element;
17
+ type ReviewStatusDotProps = {
18
+ tone: ReviewStatusTone;
19
+ className?: string | undefined;
20
+ };
21
+ /** The same dot keyed by tone, for vocabularies that are not severities
22
+ * (verdicts, directed impact, comparison assessments). */
23
+ declare const ReviewStatusDot: ({ tone, className }: ReviewStatusDotProps) => import("react").JSX.Element;
24
+ /** The tone a severity level carries, so a badge and its dot cannot disagree. */
25
+ declare const reviewSeverityTone: (level: ReviewSeverityLevel) => ReviewStatusTone;
26
+ //#endregion
27
+ export { ReviewSeverityDot, ReviewSeverityLevel, ReviewStatusDot, reviewSeverityTone };
@@ -0,0 +1,35 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/review/review-severity-dot.tsx
4
+ /** The dot that precedes a severity label, and the one place a severity level
5
+ * turns into a colour. */
6
+ const ReviewSeverityDot = ({ level, className }) => /* @__PURE__ */ jsx(ReviewStatusDot, {
7
+ className,
8
+ tone: SEVERITY_TONE[level]
9
+ });
10
+ /** The same dot keyed by tone, for vocabularies that are not severities
11
+ * (verdicts, directed impact, comparison assessments). */
12
+ const ReviewStatusDot = ({ tone, className }) => /* @__PURE__ */ jsx("span", {
13
+ "aria-hidden": "true",
14
+ className: cn(REVIEW_STATUS_DOT_BASE_CLASS, TONE_DOT_CLASS[tone], className),
15
+ "data-slot": "review-status-dot"
16
+ });
17
+ /** The tone a severity level carries, so a badge and its dot cannot disagree. */
18
+ const reviewSeverityTone = (level) => SEVERITY_TONE[level];
19
+ const REVIEW_STATUS_DOT_BASE_CLASS = "size-1.5 shrink-0 rounded-full";
20
+ const SEVERITY_TONE = {
21
+ critical: "destructive",
22
+ high: "destructive",
23
+ medium: "warning",
24
+ low: "neutral",
25
+ none: "success"
26
+ };
27
+ const TONE_DOT_CLASS = {
28
+ neutral: "bg-muted-foreground",
29
+ success: "bg-success",
30
+ warning: "bg-warning",
31
+ destructive: "bg-destructive",
32
+ highlight: "bg-highlight-foreground"
33
+ };
34
+ //#endregion
35
+ export { ReviewSeverityDot, ReviewStatusDot, reviewSeverityTone };
@@ -0,0 +1,30 @@
1
+ import { ReactNode } from "react";
2
+ //#region src/review/review-status-badge.d.ts
3
+ /**
4
+ * The semantic weight of a review status, independent of the words a surface
5
+ * uses for it. Playbook verdicts, overall risk, proposal states, suggestion
6
+ * decisions and approval states each map their own vocabulary onto one tone,
7
+ * so "this is fine" reads as the same green everywhere and a reviewer never
8
+ * has to relearn a palette when moving between panels.
9
+ */
10
+ type ReviewStatusTone = "neutral" | "success" | "warning" | "destructive" | "highlight";
11
+ type ReviewStatusVariant = "solid" | "outline" | "strong";
12
+ type ReviewStatusSize = "xs" | "sm";
13
+ type ReviewStatusBadgeProps = {
14
+ tone: ReviewStatusTone;
15
+ /** Outlined by default. `solid` adds a tonal wash for a status that has to
16
+ * carry more weight than its neighbours (an overall risk, an approval);
17
+ * `strong` fills it outright, reserved for the one state on a surface that
18
+ * must escalate past every other badge beside it. */
19
+ variant?: ReviewStatusVariant;
20
+ size?: ReviewStatusSize;
21
+ /** Leading glyph, typically a `<ReviewSeverityDot />`. */
22
+ icon?: ReactNode;
23
+ className?: string;
24
+ children: ReactNode;
25
+ };
26
+ /** One status pill for every review surface: one radius, one padding scale,
27
+ * one tone vocabulary. */
28
+ declare const ReviewStatusBadge: ({ tone, variant, size, icon, className, children }: ReviewStatusBadgeProps) => import("react").JSX.Element;
29
+ //#endregion
30
+ export { ReviewStatusBadge, ReviewStatusSize, ReviewStatusTone, ReviewStatusVariant };
@@ -0,0 +1,45 @@
1
+ import { cn } from "../lib/utils.js";
2
+ import { jsxs } from "react/jsx-runtime";
3
+ //#region src/review/review-status-badge.tsx
4
+ /** One status pill for every review surface: one radius, one padding scale,
5
+ * one tone vocabulary. */
6
+ const ReviewStatusBadge = ({ tone, variant = "outline", size = "xs", icon, className, children }) => /* @__PURE__ */ jsxs("span", {
7
+ className: cn(REVIEW_STATUS_BADGE_BASE_CLASS, SIZE_CLASS[size], VARIANT_CLASS[variant], TONE_CLASS[variant][tone], className),
8
+ "data-slot": "review-status-badge",
9
+ children: [icon, children]
10
+ });
11
+ const REVIEW_STATUS_BADGE_BASE_CLASS = "inline-flex shrink-0 items-center rounded-full border font-medium whitespace-nowrap";
12
+ const SIZE_CLASS = {
13
+ xs: "gap-1 px-1.5 py-0.5 text-[11px]",
14
+ sm: "gap-1.5 px-2 py-0.5 text-xs"
15
+ };
16
+ const TONE_CLASS = {
17
+ outline: {
18
+ neutral: "border-border text-muted-foreground",
19
+ success: "border-success/30 text-success",
20
+ warning: "border-warning/30 text-warning-foreground",
21
+ destructive: "border-destructive/30 text-destructive",
22
+ highlight: "border-highlight text-highlight-foreground"
23
+ },
24
+ solid: {
25
+ neutral: "border-transparent bg-muted text-muted-foreground",
26
+ success: "border-transparent bg-success/12 text-success",
27
+ warning: "border-transparent bg-warning/12 text-warning-foreground",
28
+ destructive: "border-transparent bg-destructive/12 text-destructive",
29
+ highlight: "border-transparent bg-highlight/50 text-highlight-foreground"
30
+ },
31
+ strong: {
32
+ neutral: "border-transparent bg-muted-foreground text-background",
33
+ success: "border-transparent bg-success text-success-foreground",
34
+ warning: "border-transparent bg-warning text-warning-foreground",
35
+ destructive: "border-transparent bg-destructive text-destructive-foreground",
36
+ highlight: "border-transparent bg-highlight text-highlight-foreground"
37
+ }
38
+ };
39
+ const VARIANT_CLASS = {
40
+ outline: "",
41
+ solid: "",
42
+ strong: "[&_[data-slot=review-status-dot]]:bg-current"
43
+ };
44
+ //#endregion
45
+ export { ReviewStatusBadge };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/ui",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
5
5
  "keywords": [
6
6
  "base-ui",
@@ -37,10 +37,18 @@
37
37
  "types": "./dist/components/accordion.d.ts",
38
38
  "import": "./dist/components/accordion.js"
39
39
  },
40
+ "./application-rail": {
41
+ "types": "./dist/components/application-rail.d.ts",
42
+ "import": "./dist/components/application-rail.js"
43
+ },
40
44
  "./alert-dialog": {
41
45
  "types": "./dist/components/alert-dialog.d.ts",
42
46
  "import": "./dist/components/alert-dialog.js"
43
47
  },
48
+ "./application-shell": {
49
+ "types": "./dist/components/application-shell.d.ts",
50
+ "import": "./dist/components/application-shell.js"
51
+ },
44
52
  "./avatar": {
45
53
  "types": "./dist/components/avatar.d.ts",
46
54
  "import": "./dist/components/avatar.js"
@@ -81,6 +89,10 @@
81
89
  "types": "./dist/components/command.d.ts",
82
90
  "import": "./dist/components/command.js"
83
91
  },
92
+ "./control-size": {
93
+ "types": "./dist/lib/control-size.d.ts",
94
+ "import": "./dist/lib/control-size.js"
95
+ },
84
96
  "./calendar": {
85
97
  "types": "./dist/calendar/index.d.ts",
86
98
  "import": "./dist/calendar/index.js"
@@ -133,6 +145,10 @@
133
145
  "types": "./dist/components/input-group.d.ts",
134
146
  "import": "./dist/components/input-group.js"
135
147
  },
148
+ "./initials": {
149
+ "types": "./dist/lib/initials.d.ts",
150
+ "import": "./dist/lib/initials.js"
151
+ },
136
152
  "./input-otp": {
137
153
  "types": "./dist/components/input-otp.d.ts",
138
154
  "import": "./dist/components/input-otp.js"
@@ -173,6 +189,34 @@
173
189
  "types": "./dist/components/preview-pane.d.ts",
174
190
  "import": "./dist/components/preview-pane.js"
175
191
  },
192
+ "./review-author-avatar": {
193
+ "types": "./dist/review/review-author-avatar.d.ts",
194
+ "import": "./dist/review/review-author-avatar.js"
195
+ },
196
+ "./review-comment-card": {
197
+ "types": "./dist/review/review-comment-card.d.ts",
198
+ "import": "./dist/review/review-comment-card.js"
199
+ },
200
+ "./review-decision-actions": {
201
+ "types": "./dist/review/review-decision-actions.d.ts",
202
+ "import": "./dist/review/review-decision-actions.js"
203
+ },
204
+ "./review-diff-text": {
205
+ "types": "./dist/review/review-diff-text.d.ts",
206
+ "import": "./dist/review/review-diff-text.js"
207
+ },
208
+ "./review-out-of-date-notice": {
209
+ "types": "./dist/review/review-out-of-date-notice.d.ts",
210
+ "import": "./dist/review/review-out-of-date-notice.js"
211
+ },
212
+ "./review-severity-dot": {
213
+ "types": "./dist/review/review-severity-dot.d.ts",
214
+ "import": "./dist/review/review-severity-dot.js"
215
+ },
216
+ "./review-status-badge": {
217
+ "types": "./dist/review/review-status-badge.d.ts",
218
+ "import": "./dist/review/review-status-badge.js"
219
+ },
176
220
  "./scroll-area": {
177
221
  "types": "./dist/components/scroll-area.d.ts",
178
222
  "import": "./dist/components/scroll-area.js"
@@ -278,10 +322,18 @@
278
322
  "types": "./dist/components/accordion.d.ts",
279
323
  "import": "./dist/components/accordion.js"
280
324
  },
325
+ "./components/application-rail": {
326
+ "types": "./dist/components/application-rail.d.ts",
327
+ "import": "./dist/components/application-rail.js"
328
+ },
281
329
  "./components/alert-dialog": {
282
330
  "types": "./dist/components/alert-dialog.d.ts",
283
331
  "import": "./dist/components/alert-dialog.js"
284
332
  },
333
+ "./components/application-shell": {
334
+ "types": "./dist/components/application-shell.d.ts",
335
+ "import": "./dist/components/application-shell.js"
336
+ },
285
337
  "./components/avatar": {
286
338
  "types": "./dist/components/avatar.d.ts",
287
339
  "import": "./dist/components/avatar.js"