@syscore/ui-library 2.0.0-beta-publish-workflow-beta.10 → 2.0.0-beta-publish-workflow-beta.11

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 (34) hide show
  1. package/client/components/ui/avatar-identity.tsx +16 -3
  2. package/client/components/ui/avatar.tsx +32 -4
  3. package/client/components/ui/back-link.tsx +35 -0
  4. package/client/components/ui/card.tsx +20 -3
  5. package/client/components/ui/centered-page.tsx +27 -0
  6. package/client/components/ui/checkbox-field.tsx +57 -0
  7. package/client/components/ui/dialog.tsx +6 -0
  8. package/client/components/ui/icon-button.tsx +45 -0
  9. package/client/components/ui/layout.tsx +32 -5
  10. package/client/components/ui/modal-panel.tsx +35 -4
  11. package/client/components/ui/outline-node.tsx +112 -0
  12. package/client/components/ui/radio-card.tsx +54 -0
  13. package/client/components/ui/resource-thumbnail.tsx +12 -1
  14. package/client/components/ui/side-nav.tsx +126 -0
  15. package/client/components/ui/status-pill.tsx +37 -4
  16. package/client/components/ui/table.tsx +26 -4
  17. package/client/components/ui/typography.tsx +29 -2
  18. package/client/global.css +813 -4
  19. package/client/ui/Avatar.stories.tsx +78 -0
  20. package/client/ui/BackLink.stories.tsx +50 -0
  21. package/client/ui/Card.stories.tsx +30 -0
  22. package/client/ui/CenteredPage.stories.tsx +43 -0
  23. package/client/ui/CheckboxField.stories.tsx +68 -0
  24. package/client/ui/Dialog.stories.tsx +31 -0
  25. package/client/ui/IconButton.stories.tsx +77 -0
  26. package/client/ui/OutlineNode.stories.tsx +106 -0
  27. package/client/ui/RadioCard.stories.tsx +75 -0
  28. package/client/ui/SideNav.stories.tsx +68 -0
  29. package/client/ui/StatusPill.stories.tsx +78 -0
  30. package/client/ui/Table/Table.stories.tsx +32 -0
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.d.ts +84 -0
  33. package/dist/index.es.js +398 -40
  34. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { StatusPill, type StatusPillTone } from "../components/ui/status-pill";
3
+
4
+ const TONES: { tone: StatusPillTone; label: string }[] = [
5
+ { tone: "unpaid", label: "Unpaid" },
6
+ { tone: "paid", label: "Paid" },
7
+ { tone: "waived", label: "Waived" },
8
+ { tone: "void", label: "Void" },
9
+ { tone: "neutral", label: "Neutral" },
10
+ { tone: "info", label: "Info" },
11
+ { tone: "success", label: "Success" },
12
+ { tone: "warning", label: "Warning" },
13
+ { tone: "danger", label: "Danger" },
14
+ { tone: "accent", label: "Accent" },
15
+ { tone: "inactive", label: "Inactive" },
16
+ { tone: "plain", label: "Plain" },
17
+ ];
18
+
19
+ const meta = {
20
+ title: "Components/StatusPill",
21
+ component: StatusPill,
22
+ tags: ["autodocs"],
23
+ parameters: {
24
+ layout: "centered",
25
+ docs: {
26
+ description: {
27
+ component:
28
+ "Small static status badge. `unpaid / paid / waived / void` are invoice states; " +
29
+ "`info / success / warning / danger / accent / inactive` are generic tones for roles, " +
30
+ "record states and flags.",
31
+ },
32
+ },
33
+ },
34
+ } satisfies Meta<typeof StatusPill>;
35
+
36
+ export default meta;
37
+
38
+ type Story = StoryObj<typeof meta>;
39
+
40
+ export const Default: Story = {
41
+ args: { tone: "neutral", children: "Neutral" },
42
+ };
43
+
44
+ export const Info: Story = { args: { tone: "info", children: "Admin" } };
45
+ export const Success: Story = { args: { tone: "success", children: "Active" } };
46
+ export const Warning: Story = { args: { tone: "warning", children: "Renewal due" } };
47
+ export const Danger: Story = { args: { tone: "danger", children: "Overdue" } };
48
+ export const Accent: Story = { args: { tone: "accent", children: "Super admin" } };
49
+ export const Inactive: Story = { args: { tone: "inactive", children: "Deactivated" } };
50
+
51
+ export const Chip: Story = {
52
+ args: { tone: "info", appearance: "chip", children: "WELL admin" },
53
+ };
54
+
55
+ export const AllVariants: Story = {
56
+ args: { children: "All variants" },
57
+ render: () => (
58
+ <div style={{ display: "flex", flexWrap: "wrap", gap: 8, maxWidth: 480 }}>
59
+ {TONES.map(({ tone, label }) => (
60
+ <StatusPill key={tone} tone={tone}>
61
+ {label}
62
+ </StatusPill>
63
+ ))}
64
+ {TONES.map(({ tone, label }) => (
65
+ <StatusPill key={`chip-${tone}`} tone={tone} appearance="chip">
66
+ {label}
67
+ </StatusPill>
68
+ ))}
69
+ </div>
70
+ ),
71
+ };
72
+
73
+ export const InteractiveStatusPill: Story = {
74
+ args: { tone: "success", children: "Published" },
75
+ argTypes: {
76
+ tone: { control: "select", options: TONES.map((t) => t.tone) },
77
+ },
78
+ };
@@ -252,3 +252,35 @@ export const AllVariants: Story = {
252
252
  </div>
253
253
  ),
254
254
  };
255
+
256
+ /** `appearance="card"`: bordered, rounded card with a tinted header, soft row dividers and a hover highlight. */
257
+ export const CardAppearance: Story = {
258
+ render: () => (
259
+ <Table appearance="card">
260
+ <TableHeader>
261
+ <TableRow>
262
+ <TableHeaderCell label="Customer" />
263
+ <TableHeaderCell label="Role" />
264
+ <TableHeaderCell label="Action" align="right" />
265
+ </TableRow>
266
+ </TableHeader>
267
+ <TableBody>
268
+ {[
269
+ ["Ananya Rao", "Customer"],
270
+ ["Marcus Lee", "Customer"],
271
+ ["Priya Nair", "Admin"],
272
+ ].map(([name, role]) => (
273
+ <TableRow key={name}>
274
+ <TableCell text={name} />
275
+ <TableCell text={role} />
276
+ <TableCell align="right">
277
+ <TableAction aria-label={`Edit ${name}`}>
278
+ <Pencil size={16} />
279
+ </TableAction>
280
+ </TableCell>
281
+ </TableRow>
282
+ ))}
283
+ </TableBody>
284
+ </Table>
285
+ ),
286
+ };