@vendure-io/ui 2.0.0-beta.8 → 2.0.0-rc.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 (75) hide show
  1. package/LICENSE.md +34 -0
  2. package/package.json +8 -6
  3. package/src/components/atoms/alert-dialog.tsx +1 -1
  4. package/src/components/atoms/alert.tsx +1 -1
  5. package/src/components/atoms/badge.tsx +1 -1
  6. package/src/components/atoms/button.tsx +2 -2
  7. package/src/components/atoms/card.tsx +39 -4
  8. package/src/components/atoms/checkbox.tsx +1 -1
  9. package/src/components/atoms/combobox.tsx +24 -5
  10. package/src/components/atoms/command.tsx +16 -5
  11. package/src/components/atoms/context-menu.tsx +1 -1
  12. package/src/components/atoms/dialog.tsx +1 -1
  13. package/src/components/atoms/drawer.tsx +134 -35
  14. package/src/components/atoms/dropdown-menu.tsx +1 -1
  15. package/src/components/atoms/field.tsx +2 -2
  16. package/src/components/atoms/input.tsx +1 -1
  17. package/src/components/atoms/item.tsx +4 -1
  18. package/src/components/atoms/menubar.tsx +1 -1
  19. package/src/components/atoms/native-select.tsx +1 -1
  20. package/src/components/atoms/navigation-menu.tsx +8 -2
  21. package/src/components/atoms/progress.tsx +1 -1
  22. package/src/components/atoms/radio-group.tsx +1 -1
  23. package/src/components/atoms/scroll-area.tsx +1 -2
  24. package/src/components/atoms/select.tsx +1 -1
  25. package/src/components/atoms/sheet.tsx +1 -1
  26. package/src/components/atoms/sidebar.tsx +6 -4
  27. package/src/components/atoms/slider.tsx +2 -2
  28. package/src/components/atoms/switch.tsx +1 -1
  29. package/src/components/atoms/table.tsx +34 -2
  30. package/src/components/atoms/tabs.tsx +64 -1
  31. package/src/components/atoms/textarea.tsx +1 -1
  32. package/src/components/atoms/toggle-group.tsx +1 -1
  33. package/src/components/atoms/toggle.tsx +5 -2
  34. package/src/components/molecules/chip.tsx +7 -2
  35. package/src/components/molecules/code-block/file-type-icons.tsx +123 -0
  36. package/src/components/molecules/code-block/process-code.ts +60 -0
  37. package/src/components/molecules/code-block/transform-command.tsx +177 -0
  38. package/src/components/molecules/code-block.tsx +29 -575
  39. package/src/components/molecules/combobox-free-text.tsx +23 -2
  40. package/src/components/molecules/copyable-text.tsx +14 -1
  41. package/src/components/molecules/data-table/data-table-bulk-actions.tsx +12 -13
  42. package/src/components/molecules/data-table/data-table-types.tsx +50 -2
  43. package/src/components/molecules/data-table/data-table-view-options.tsx +2 -1
  44. package/src/components/molecules/data-table/data-table.tsx +188 -96
  45. package/src/components/molecules/date-picker.tsx +3 -1
  46. package/src/components/molecules/date-range-picker.tsx +3 -1
  47. package/src/components/molecules/date-time-picker.tsx +3 -1
  48. package/src/components/molecules/file-dropzone.tsx +15 -5
  49. package/src/components/molecules/illustrations/empty-database.tsx +8 -5
  50. package/src/components/molecules/illustrations/error.tsx +19 -17
  51. package/src/components/molecules/illustrations/expired.tsx +55 -0
  52. package/src/components/molecules/illustrations/first-run.tsx +3 -1
  53. package/src/components/molecules/illustrations/no-activity.tsx +35 -14
  54. package/src/components/molecules/illustrations/no-customers.tsx +66 -0
  55. package/src/components/molecules/illustrations/no-documents.tsx +4 -3
  56. package/src/components/molecules/illustrations/no-invoices.tsx +45 -0
  57. package/src/components/molecules/illustrations/no-notifications.tsx +7 -8
  58. package/src/components/molecules/illustrations/no-orders.tsx +25 -17
  59. package/src/components/molecules/illustrations/no-plugins.tsx +21 -31
  60. package/src/components/molecules/illustrations/no-products.tsx +53 -0
  61. package/src/components/molecules/illustrations/no-projects.tsx +54 -0
  62. package/src/components/molecules/illustrations/no-promotions.tsx +49 -0
  63. package/src/components/molecules/illustrations/no-subscription.tsx +72 -0
  64. package/src/components/molecules/illustrations/not-found.tsx +17 -15
  65. package/src/components/molecules/illustrations/offline.tsx +12 -10
  66. package/src/components/molecules/illustrations/payment-failed.tsx +53 -0
  67. package/src/components/molecules/illustrations/success.tsx +43 -0
  68. package/src/components/molecules/inline-code.tsx +26 -0
  69. package/src/components/molecules/page-header.tsx +7 -3
  70. package/src/components/molecules/stat-card.tsx +13 -12
  71. package/src/components/molecules/state-views/empty-state.tsx +12 -1
  72. package/src/components/molecules/state-views/loading-state.tsx +7 -3
  73. package/src/lib/highlight.ts +177 -0
  74. package/src/lib/state-dictionary.ts +18 -5
  75. package/src/lib/utils.ts +0 -19
@@ -91,9 +91,13 @@ function FileDropzone({
91
91
  const [validating, setValidating] = React.useState(false);
92
92
  const [rejections, setRejections] = React.useState<FileRejection[]>([]);
93
93
  const dragDepth = React.useRef(0);
94
+ // Synchronous mirror of `validating`: a drop while an async validateFile is
95
+ // in flight would otherwise start a second addFiles against a stale `value`.
96
+ const busy = React.useRef(false);
94
97
 
95
98
  async function addFiles(incoming: readonly File[]) {
96
- if (disabled || incoming.length === 0) return;
99
+ if (disabled || busy.current || incoming.length === 0) return;
100
+ busy.current = true;
97
101
  setValidating(true);
98
102
  const accepted: File[] = [];
99
103
  const rejected: FileRejection[] = [];
@@ -118,11 +122,15 @@ function FileDropzone({
118
122
 
119
123
  if (incoming.length > remaining) {
120
124
  for (const file of incoming.slice(remaining)) {
121
- rejected.push({ file, messages: [`You can select up to ${maxFiles} files.`] });
125
+ rejected.push({
126
+ file,
127
+ messages: [`You can select up to ${maxFiles} ${maxFiles === 1 ? 'file' : 'files'}.`],
128
+ });
122
129
  }
123
130
  }
124
131
 
125
132
  setRejections(rejected);
133
+ busy.current = false;
126
134
  setValidating(false);
127
135
  if (rejected.length > 0) onRejected?.(rejected);
128
136
  if (accepted.length > 0) {
@@ -211,7 +219,9 @@ function FileDropzone({
211
219
  {value.length > 0 ? (
212
220
  <ul data-slot="file-dropzone-files" className="flex flex-col gap-2">
213
221
  {value.map((file, index) => (
214
- <li key={`${file.name}-${file.size}-${file.lastModified}`}>
222
+ // Metadata alone can collide (two distinct files with identical
223
+ // name, size and mtime), so the index disambiguates the key.
224
+ <li key={`${file.name}-${file.size}-${file.lastModified}-${index}`}>
215
225
  {renderFile ? (
216
226
  renderFile(file, () => removeFile(index))
217
227
  ) : (
@@ -240,8 +250,8 @@ function FileDropzone({
240
250
 
241
251
  {rejections.length > 0 ? (
242
252
  <div id={errorId} role="alert" className="text-destructive text-sm">
243
- {rejections.map(({ file, messages }) => (
244
- <p key={`${file.name}-${file.size}`}>
253
+ {rejections.map(({ file, messages }, index) => (
254
+ <p key={`${file.name}-${file.size}-${index}`}>
245
255
  <span className="font-medium">{file.name}:</span> {messages.join(' ')}
246
256
  </p>
247
257
  ))}
@@ -3,9 +3,9 @@ import { cn } from '@vendure-io/ui/lib/utils';
3
3
 
4
4
  /**
5
5
  * A database cylinder with a solid rim but dashed walls and dividing bands —
6
- * a shell with nothing provisioned inside. For no database provisioned yet,
7
- * or no backups exist. Not for a generic empty list (use
8
- * `EmptyCollectionIllustration`).
6
+ * a shell with nothing provisioned inside, and a "+" badge for the first one
7
+ * to create. For no database provisioned yet, or no backups exist. Not for a
8
+ * generic empty list (use `EmptyCollectionIllustration`).
9
9
  */
10
10
  function EmptyDatabaseIllustration({ className, size = 160 }: IllustrationProps) {
11
11
  return (
@@ -35,8 +35,11 @@ function EmptyDatabaseIllustration({ className, size = 160 }: IllustrationProps)
35
35
  <path d="M56,66 A24,8 0 0,0 104,66" className="stroke-border" strokeDasharray="3 4" />
36
36
  <path d="M56,82 A24,8 0 0,0 104,82" className="stroke-border" strokeDasharray="3 4" />
37
37
 
38
- {/* status dot — the one brand accent */}
39
- <circle cx="100" cy="28" r="4" className="fill-brand" />
38
+ {/* provision badge — the one brand accent */}
39
+ <polygon
40
+ points="110,18 114,18 114,22 118,22 118,26 114,26 114,30 110,30 110,26 106,26 106,22 110,22"
41
+ className="fill-brand"
42
+ />
40
43
  </svg>
41
44
  );
42
45
  }
@@ -5,7 +5,9 @@ import { cn } from '@vendure-io/ui/lib/utils';
5
5
  * Two cable connectors that don't meet, with a dashed gap and a spark where
6
6
  * the connection failed. The `ErrorState` default — deliberately neutral, not
7
7
  * destructive-tinted; the "this failed" weight comes from the state view's
8
- * `role="alert"` and copy, not the illustration.
8
+ * `role="alert"` and copy, not the illustration. Not for a lost network
9
+ * connection (use `OfflineIllustration`), a 404 (use `NotFoundIllustration`)
10
+ * or a failed payment (use `PaymentFailedIllustration`).
9
11
  */
10
12
  function ErrorIllustration({ className, size = 160 }: IllustrationProps) {
11
13
  return (
@@ -24,37 +26,37 @@ function ErrorIllustration({ className, size = 160 }: IllustrationProps) {
24
26
  <ellipse cx="80" cy="104" rx="30" ry="5" className="fill-muted" />
25
27
 
26
28
  {/* left plug + trailing cable */}
27
- <path d="M20,60 Q6,60 6,44" className="stroke-muted-foreground" />
29
+ <path d="M28,64 Q16,64 16,48" className="stroke-muted-foreground" />
28
30
  <rect
29
- x="20"
30
- y="50"
31
- width="36"
32
- height="20"
31
+ x="28"
32
+ y="53"
33
+ width="34"
34
+ height="22"
33
35
  rx="4"
34
36
  className="fill-surface stroke-muted-foreground"
35
37
  />
36
- <rect x="54" y="56" width="10" height="3" rx="1.5" className="fill-muted-foreground" />
37
- <rect x="54" y="63" width="10" height="3" rx="1.5" className="fill-muted-foreground" />
38
+ <rect x="60" y="58" width="10" height="3" rx="1.5" className="fill-muted-foreground" />
39
+ <rect x="60" y="66" width="10" height="3" rx="1.5" className="fill-muted-foreground" />
38
40
 
39
41
  {/* right socket + trailing cable */}
40
- <path d="M140,60 Q154,60 154,44" className="stroke-muted-foreground" />
42
+ <path d="M132,64 Q144,64 144,48" className="stroke-muted-foreground" />
41
43
  <rect
42
- x="104"
43
- y="50"
44
- width="36"
45
- height="20"
44
+ x="98"
45
+ y="53"
46
+ width="34"
47
+ height="22"
46
48
  rx="4"
47
49
  className="fill-surface stroke-muted-foreground"
48
50
  />
49
- <rect x="98" y="56" width="8" height="3" rx="1.5" className="fill-background stroke-border" />
50
- <rect x="98" y="63" width="8" height="3" rx="1.5" className="fill-background stroke-border" />
51
+ <rect x="92" y="58" width="8" height="3" rx="1.5" className="fill-background stroke-border" />
52
+ <rect x="92" y="66" width="8" height="3" rx="1.5" className="fill-background stroke-border" />
51
53
 
52
54
  {/* the gap */}
53
- <line x1="66" y1="60" x2="94" y2="60" className="stroke-border" strokeDasharray="2 5" />
55
+ <line x1="72" y1="64" x2="90" y2="64" className="stroke-border" strokeDasharray="2 5" />
54
56
 
55
57
  {/* spark — the one brand accent */}
56
58
  <polygon
57
- points="80,52 81.5,58.5 88,60 81.5,61.5 80,68 78.5,61.5 72,60 78.5,58.5"
59
+ points="81,56 82.5,62.5 89,64 82.5,65.5 81,72 79.5,65.5 73,64 79.5,62.5"
58
60
  className="fill-brand"
59
61
  />
60
62
  </svg>
@@ -0,0 +1,55 @@
1
+ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illustrations/illustration-types';
2
+ import { cn } from '@vendure-io/ui/lib/utils';
3
+
4
+ /**
5
+ * A stopwatch whose hand is back at twelve and whose dashed track has run out.
6
+ * For something time-limited that ended: a trial or evaluation, an expired
7
+ * link, or a sign-in request that timed out. Pair it with an action that
8
+ * starts it again. Not for a request still waiting on someone (use
9
+ * `PendingApprovalIllustration`) or a generic failure (use
10
+ * `ErrorIllustration`).
11
+ */
12
+ function ExpiredIllustration({ className, size = 160 }: IllustrationProps) {
13
+ return (
14
+ <svg
15
+ viewBox="0 0 160 120"
16
+ width={size}
17
+ height={(size * 120) / 160}
18
+ fill="none"
19
+ strokeWidth={1.5}
20
+ strokeLinecap="round"
21
+ strokeLinejoin="round"
22
+ aria-hidden="true"
23
+ focusable="false"
24
+ className={cn('shrink-0', className)}
25
+ >
26
+ <ellipse cx="80" cy="104" rx="28" ry="5" className="fill-muted" />
27
+
28
+ {/* crown stem + side button */}
29
+ <rect
30
+ x="77"
31
+ y="26"
32
+ width="6"
33
+ height="8"
34
+ rx="1"
35
+ className="fill-surface stroke-muted-foreground"
36
+ />
37
+ <line x1="101" y1="41" x2="105" y2="37" className="stroke-muted-foreground" />
38
+
39
+ {/* body */}
40
+ <circle cx="80" cy="62" r="28" className="fill-surface stroke-muted-foreground" />
41
+
42
+ {/* track, run out */}
43
+ <circle cx="80" cy="62" r="21" className="stroke-border" strokeDasharray="2 4" />
44
+
45
+ {/* hand, back at twelve */}
46
+ <line x1="80" y1="62" x2="80" y2="45" className="stroke-muted-foreground" />
47
+ <circle cx="80" cy="62" r="2.5" className="fill-muted-foreground" />
48
+
49
+ {/* restart button — the one brand accent */}
50
+ <rect x="72" y="19" width="16" height="7" rx="3.5" className="fill-brand" />
51
+ </svg>
52
+ );
53
+ }
54
+
55
+ export { ExpiredIllustration };
@@ -4,7 +4,9 @@ import { cn } from '@vendure-io/ui/lib/utils';
4
4
  /**
5
5
  * A rocket lifting off on a dashed motion trail, with a lit porthole and two
6
6
  * drifting sparkles. For genuine first-run/onboarding moments — a feature
7
- * with nothing set up yet, not a filtered or failed view.
7
+ * with nothing set up yet, not a filtered or failed view. Not for an
8
+ * ordinary list that is still empty (use `EmptyCollectionIllustration`) or a
9
+ * finished task (use `SuccessIllustration`).
8
10
  */
9
11
  function FirstRunIllustration({ className, size = 160 }: IllustrationProps) {
10
12
  return (
@@ -2,8 +2,8 @@ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illu
2
2
  import { cn } from '@vendure-io/ui/lib/utils';
3
3
 
4
4
  /**
5
- * A vertical timeline rail with dashed, hollow nodes and faint dashed row
6
- * lines beside them — the rail exists but no entries have landed on it yet.
5
+ * A vertical timeline rail with hollow nodes and dashed ghost rows beside
6
+ * them — the rail exists but no entries have landed on it yet.
7
7
  * For audit logs / history / timeline views with nothing recorded — pass as
8
8
  * `illustration` to `EmptyState`. For a generic empty list with no timeline
9
9
  * shape, use `EmptyCollectionIllustration` instead.
@@ -25,23 +25,44 @@ function NoActivityIllustration({ className, size = 160 }: IllustrationProps) {
25
25
  <ellipse cx="80" cy="104" rx="28" ry="5" className="fill-muted" />
26
26
 
27
27
  {/* the timeline rail itself — present, just nothing on it */}
28
- <line x1="50" y1="26" x2="50" y2="88" className="stroke-muted-foreground" />
28
+ <line x1="50" y1="24" x2="50" y2="90" className="stroke-muted-foreground" />
29
29
 
30
30
  {/* nodes, hollow — no entries recorded at any of them */}
31
- <circle cx="50" cy="32" r="5" className="stroke-muted-foreground" strokeDasharray="3 4" />
32
- <circle cx="50" cy="58" r="5" className="stroke-muted-foreground" strokeDasharray="3 4" />
33
- <circle cx="50" cy="84" r="5" className="stroke-muted-foreground" strokeDasharray="3 4" />
31
+ <circle cx="50" cy="30" r="6" className="fill-surface stroke-muted-foreground" />
32
+ <circle cx="50" cy="57" r="6" className="fill-surface stroke-muted-foreground" />
33
+ <circle cx="50" cy="84" r="6" className="fill-surface stroke-muted-foreground" />
34
34
 
35
35
  {/* newest node — the one brand accent */}
36
- <circle cx="50" cy="32" r="2" className="fill-brand" />
36
+ <circle cx="50" cy="30" r="2.5" className="fill-brand" />
37
37
 
38
- {/* faint row placeholders beside each node, waiting for content */}
39
- <line x1="64" y1="29" x2="106" y2="29" className="stroke-border" strokeDasharray="2 5" />
40
- <line x1="64" y1="36" x2="90" y2="36" className="stroke-border" strokeDasharray="2 5" />
41
- <line x1="64" y1="55" x2="114" y2="55" className="stroke-border" strokeDasharray="2 5" />
42
- <line x1="64" y1="62" x2="96" y2="62" className="stroke-border" strokeDasharray="2 5" />
43
- <line x1="64" y1="81" x2="102" y2="81" className="stroke-border" strokeDasharray="2 5" />
44
- <line x1="64" y1="88" x2="84" y2="88" className="stroke-border" strokeDasharray="2 5" />
38
+ {/* ghost rows beside each node, waiting for content */}
39
+ <rect
40
+ x="64"
41
+ y="25"
42
+ width="50"
43
+ height="10"
44
+ rx="5"
45
+ className="stroke-border"
46
+ strokeDasharray="3 4"
47
+ />
48
+ <rect
49
+ x="64"
50
+ y="52"
51
+ width="38"
52
+ height="10"
53
+ rx="5"
54
+ className="stroke-border"
55
+ strokeDasharray="3 4"
56
+ />
57
+ <rect
58
+ x="64"
59
+ y="79"
60
+ width="44"
61
+ height="10"
62
+ rx="5"
63
+ className="stroke-border"
64
+ strokeDasharray="3 4"
65
+ />
45
66
  </svg>
46
67
  );
47
68
  }
@@ -0,0 +1,66 @@
1
+ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illustrations/illustration-types';
2
+ import { cn } from '@vendure-io/ui/lib/utils';
3
+
4
+ /**
5
+ * A shop front with an awning and an open door, and a dashed shopper outline
6
+ * where the first customer would stand. For a customer list or customer group
7
+ * with nobody in it yet. Not for a team or member list (use
8
+ * `NoMembersIllustration`) or a customer search that matched nobody (use
9
+ * `NoResultsIllustration`).
10
+ */
11
+ function NoCustomersIllustration({ className, size = 160 }: IllustrationProps) {
12
+ return (
13
+ <svg
14
+ viewBox="0 0 160 120"
15
+ width={size}
16
+ height={(size * 120) / 160}
17
+ fill="none"
18
+ strokeWidth={1.5}
19
+ strokeLinecap="round"
20
+ strokeLinejoin="round"
21
+ aria-hidden="true"
22
+ focusable="false"
23
+ className={cn('shrink-0', className)}
24
+ >
25
+ <ellipse cx="80" cy="104" rx="36" ry="5" className="fill-muted" />
26
+
27
+ {/* shop */}
28
+ <rect
29
+ x="36"
30
+ y="50"
31
+ width="60"
32
+ height="42"
33
+ rx="2"
34
+ className="fill-surface stroke-muted-foreground"
35
+ />
36
+ <rect x="44" y="60" width="20" height="14" rx="1" className="stroke-border" />
37
+ <rect
38
+ x="72"
39
+ y="62"
40
+ width="16"
41
+ height="30"
42
+ className="fill-background stroke-muted-foreground"
43
+ />
44
+
45
+ {/* awning */}
46
+ <polygon points="36,36 96,36 100,50 32,50" className="fill-muted stroke-muted-foreground" />
47
+ <path
48
+ d="M32,50 a5.667,4 0 0,0 11.333,0 a5.667,4 0 0,0 11.333,0 a5.667,4 0 0,0 11.333,0 a5.667,4 0 0,0 11.333,0 a5.667,4 0 0,0 11.333,0 a5.667,4 0 0,0 11.333,0"
49
+ className="fill-muted stroke-muted-foreground"
50
+ />
51
+
52
+ {/* open sign — the one brand accent */}
53
+ <rect x="74" y="67" width="12" height="6" rx="1.5" className="fill-brand" />
54
+
55
+ {/* first customer, not here yet */}
56
+ <circle cx="118" cy="60" r="7" className="stroke-muted-foreground" strokeDasharray="3 4" />
57
+ <path
58
+ d="M107,92 L107,78 A11,11 0 0,1 129,78 L129,92 Z"
59
+ className="stroke-muted-foreground"
60
+ strokeDasharray="3 4"
61
+ />
62
+ </svg>
63
+ );
64
+ }
65
+
66
+ export { NoCustomersIllustration };
@@ -3,9 +3,10 @@ import { cn } from '@vendure-io/ui/lib/utils';
3
3
 
4
4
  /**
5
5
  * A single document with a folded corner and a seal, with dashed "ghost"
6
- * pages stacked behind it that never got filled in. For licenses, invoices,
7
- * or certificates that haven't been issued yet. Not for a generic empty list
8
- * (use `EmptyCollectionIllustration`) or a 404 (use `NotFoundIllustration`).
6
+ * pages stacked behind it that never got filled in. For licenses,
7
+ * certificates, or changelog entries that haven't been issued yet. Not for
8
+ * invoices (use `NoInvoicesIllustration`), a generic empty list (use
9
+ * `EmptyCollectionIllustration`) or a 404 (use `NotFoundIllustration`).
9
10
  */
10
11
  function NoDocumentsIllustration({ className, size = 160 }: IllustrationProps) {
11
12
  return (
@@ -0,0 +1,45 @@
1
+ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illustrations/illustration-types';
2
+ import { cn } from '@vendure-io/ui/lib/utils';
3
+
4
+ /**
5
+ * A receipt with a torn, zigzag bottom edge and dashed line items, with only
6
+ * the total marked. For a billing page with no invoices or receipts yet. Not
7
+ * for licenses or certificates (use `NoDocumentsIllustration`) or an invoice
8
+ * whose payment failed (use `PaymentFailedIllustration`).
9
+ */
10
+ function NoInvoicesIllustration({ className, size = 160 }: IllustrationProps) {
11
+ return (
12
+ <svg
13
+ viewBox="0 0 160 120"
14
+ width={size}
15
+ height={(size * 120) / 160}
16
+ fill="none"
17
+ strokeWidth={1.5}
18
+ strokeLinecap="round"
19
+ strokeLinejoin="round"
20
+ aria-hidden="true"
21
+ focusable="false"
22
+ className={cn('shrink-0', className)}
23
+ >
24
+ <ellipse cx="80" cy="104" rx="26" ry="5" className="fill-muted" />
25
+
26
+ {/* receipt, torn bottom edge */}
27
+ <path
28
+ d="M58,22 L102,22 L102,90 L97.6,86 L93.2,90 L88.8,86 L84.4,90 L80,86 L75.6,90 L71.2,86 L66.8,90 L62.4,86 L58,90 Z"
29
+ className="fill-surface stroke-muted-foreground"
30
+ />
31
+ <line x1="66" y1="32" x2="86" y2="32" className="stroke-muted-foreground" />
32
+
33
+ {/* line items, none yet */}
34
+ <line x1="66" y1="44" x2="94" y2="44" className="stroke-border" strokeDasharray="3 4" />
35
+ <line x1="66" y1="52" x2="88" y2="52" className="stroke-border" strokeDasharray="3 4" />
36
+ <line x1="66" y1="60" x2="94" y2="60" className="stroke-border" strokeDasharray="3 4" />
37
+ <line x1="66" y1="69" x2="94" y2="69" className="stroke-border" />
38
+
39
+ {/* total — the one brand accent */}
40
+ <rect x="80" y="74" width="14" height="5" rx="2.5" className="fill-brand" />
41
+ </svg>
42
+ );
43
+ }
44
+
45
+ export { NoInvoicesIllustration };
@@ -3,7 +3,8 @@ import { cn } from '@vendure-io/ui/lib/utils';
3
3
 
4
4
  /**
5
5
  * A bell at rest, its clapper still, with faint dashed arcs trailing off
6
- * where a ring would sound — nothing new has come in. For an empty
6
+ * where a ring would sound and a check badge on its shoulder — nothing new
7
+ * has come in. For an empty
7
8
  * notifications/alerts panel where the user is caught up — pass as
8
9
  * `illustration` to `EmptyState`. Not for a generic empty list with no bell
9
10
  * shape (use `EmptyCollectionIllustration` instead).
@@ -25,8 +26,8 @@ function NoNotificationsIllustration({ className, size = 160 }: IllustrationProp
25
26
  <ellipse cx="80" cy="104" rx="28" ry="5" className="fill-muted" />
26
27
 
27
28
  {/* faint arcs where a ring would sound — dashed, trailing off */}
28
- <path d="M48,44 Q40,52 48,60" className="stroke-border" strokeDasharray="2 5" />
29
- <path d="M112,44 Q120,52 112,60" className="stroke-border" strokeDasharray="2 5" />
29
+ <path d="M46,46 Q38,54 46,62" className="stroke-border" strokeDasharray="2 5" />
30
+ <path d="M114,50 Q122,58 114,66" className="stroke-border" strokeDasharray="2 5" />
30
31
 
31
32
  {/* hanging loop */}
32
33
  <circle cx="80" cy="29" r="3" className="fill-surface stroke-muted-foreground" />
@@ -40,11 +41,9 @@ function NoNotificationsIllustration({ className, size = 160 }: IllustrationProp
40
41
  {/* clapper, still and centered — nothing ringing it */}
41
42
  <circle cx="80" cy="72" r="2.5" className="fill-muted-foreground" />
42
43
 
43
- {/* check mark — the one brand accent, caught up */}
44
- <path
45
- d="M95,78 L92.6,75.6 L91.9,76.4 L95,79.5 L101.6,72.9 L100.8,72.1 Z"
46
- className="fill-brand"
47
- />
44
+ {/* caught-up badge — the one brand accent, with a neutral check */}
45
+ <circle cx="98" cy="38" r="8" className="fill-brand" />
46
+ <path d="M94.5,38 L97,40.5 L101.5,35.5" className="stroke-surface" />
48
47
  </svg>
49
48
  );
50
49
  }
@@ -2,9 +2,11 @@ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illu
2
2
  import { cn } from '@vendure-io/ui/lib/utils';
3
3
 
4
4
  /**
5
- * An empty cart standing still, with faded motion dashes behind it where
6
- * incoming orders would trail in. For order/checkout lists with nothing in
7
- * them yet.
5
+ * An empty shopping cart parked on the ground, with a dashed parcel outline
6
+ * above the basket where the first order would go. For order/checkout lists
7
+ * with nothing in them yet. Not for a search or filter that matched no orders
8
+ * (use `NoResultsIllustration`) or a generic empty list (use
9
+ * `EmptyCollectionIllustration`).
8
10
  */
9
11
  function NoOrdersIllustration({ className, size = 160 }: IllustrationProps) {
10
12
  return (
@@ -20,27 +22,33 @@ function NoOrdersIllustration({ className, size = 160 }: IllustrationProps) {
20
22
  focusable="false"
21
23
  className={cn('shrink-0', className)}
22
24
  >
23
- <ellipse cx="78" cy="104" rx="30" ry="5" className="fill-muted" />
25
+ <ellipse cx="84" cy="104" rx="32" ry="5" className="fill-muted" />
24
26
 
25
- {/* stillness dashes, nothing rolling in */}
26
- <line x1="10" y1="56" x2="22" y2="56" className="stroke-border" strokeDasharray="2 4" />
27
- <line x1="6" y1="66" x2="20" y2="66" className="stroke-border" strokeDasharray="2 4" />
28
- <line x1="10" y1="76" x2="22" y2="76" className="stroke-border" strokeDasharray="2 4" />
27
+ {/* parcel outline, where the first order would go */}
28
+ <rect
29
+ x="76"
30
+ y="20"
31
+ width="30"
32
+ height="20"
33
+ rx="3"
34
+ className="stroke-border"
35
+ strokeDasharray="3 4"
36
+ />
29
37
 
30
38
  {/* handle */}
31
- <path d="M42,50 L32,26 L44,26" className="stroke-muted-foreground" />
39
+ <path d="M52,48 L44,26 L36,26" className="stroke-muted-foreground" />
32
40
 
33
- {/* basket */}
34
- <path d="M40,50 L120,50 L108,86 L54,86 Z" className="fill-surface stroke-muted-foreground" />
35
- <line x1="52" y1="62" x2="106" y2="62" className="stroke-border" strokeDasharray="3 3" />
36
- <line x1="55" y1="74" x2="103" y2="74" className="stroke-border" strokeDasharray="3 3" />
41
+ {/* basket, empty */}
42
+ <path d="M52,48 L128,48 L118,82 L62,82 Z" className="fill-surface stroke-muted-foreground" />
43
+ <line x1="59" y1="60" x2="121" y2="60" className="stroke-border" strokeDasharray="3 3" />
44
+ <line x1="62" y1="71" x2="118" y2="71" className="stroke-border" strokeDasharray="3 3" />
37
45
 
38
46
  {/* wheels */}
39
- <circle cx="60" cy="94" r="6" className="fill-surface stroke-muted-foreground" />
40
- <circle cx="100" cy="94" r="6" className="fill-surface stroke-muted-foreground" />
47
+ <circle cx="70" cy="91" r="6" className="fill-surface stroke-muted-foreground" />
48
+ <circle cx="110" cy="91" r="6" className="fill-surface stroke-muted-foreground" />
41
49
 
42
- {/* waiting indicator — the one brand accent */}
43
- <circle cx="112" cy="42" r="5" className="fill-brand" />
50
+ {/* handle grip — the one brand accent */}
51
+ <rect x="26" y="23" width="12" height="6" rx="3" className="fill-brand" />
44
52
  </svg>
45
53
  );
46
54
  }
@@ -2,8 +2,8 @@ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illu
2
2
  import { cn } from '@vendure-io/ui/lib/utils';
3
3
 
4
4
  /**
5
- * A module block hovering above a dashed socket outline shaped just like it —
6
- * an extension point with nothing plugged in. For an empty plugin list, or a
5
+ * A module block with two pins hovering above a dashed socket of the same
6
+ * footprint — an extension point with nothing plugged in. For an empty plugin list, or a
7
7
  * plugin catalog with nothing installed — pass as `illustration` to
8
8
  * `EmptyState`.
9
9
  *
@@ -26,45 +26,35 @@ function NoPluginsIllustration({ className, size = 160 }: IllustrationProps) {
26
26
  >
27
27
  <ellipse cx="80" cy="104" rx="28" ry="5" className="fill-muted" />
28
28
 
29
- {/* module block, hovering */}
29
+ {/* module block, hovering, with its two pins */}
30
+ <rect x="67" y="50" width="6" height="10" rx="1" className="fill-muted-foreground" />
31
+ <rect x="87" y="50" width="6" height="10" rx="1" className="fill-muted-foreground" />
30
32
  <rect
31
- x="62"
32
- y="20"
33
- width="36"
34
- height="28"
33
+ x="54"
34
+ y="18"
35
+ width="52"
36
+ height="34"
35
37
  rx="4"
36
38
  className="fill-surface stroke-muted-foreground"
37
39
  />
38
- <rect
39
- x="74"
40
- y="46"
41
- width="12"
42
- height="12"
43
- rx="2"
44
- className="fill-surface stroke-muted-foreground"
45
- />
46
- {/* connector pin — the one brand accent */}
47
- <circle cx="80" cy="52" r="2.5" className="fill-brand" />
40
+ <line x1="62" y1="28" x2="84" y2="28" className="stroke-border" />
41
+ <line x1="62" y1="36" x2="76" y2="36" className="stroke-border" />
48
42
 
49
- {/* empty socket, same shape, waiting below */}
50
- <rect
51
- x="74"
52
- y="70"
53
- width="12"
54
- height="12"
55
- rx="2"
56
- className="stroke-border"
57
- strokeDasharray="2 4"
58
- />
43
+ {/* status light — the one brand accent */}
44
+ <circle cx="96" cy="28" r="3" className="fill-brand" />
45
+
46
+ {/* empty socket, same footprint, waiting below */}
59
47
  <rect
60
- x="62"
61
- y="80"
62
- width="36"
63
- height="16"
48
+ x="54"
49
+ y="76"
50
+ width="52"
51
+ height="20"
64
52
  rx="4"
65
53
  className="stroke-border"
66
54
  strokeDasharray="3 4"
67
55
  />
56
+ <rect x="67" y="80" width="6" height="8" rx="1" className="stroke-border" />
57
+ <rect x="87" y="80" width="6" height="8" rx="1" className="stroke-border" />
68
58
  </svg>
69
59
  );
70
60
  }
@@ -0,0 +1,53 @@
1
+ import type { IllustrationProps } from '@vendure-io/ui/components/molecules/illustrations/illustration-types';
2
+ import { cn } from '@vendure-io/ui/lib/utils';
3
+
4
+ /**
5
+ * A price tag on a string with no price written on it, in front of a dashed
6
+ * second tag. For an empty catalog: no products, variants, or collection
7
+ * contents yet. Not for a search or filter that matched no products (use
8
+ * `NoResultsIllustration`) or an empty promotions list (use
9
+ * `NoPromotionsIllustration`).
10
+ */
11
+ function NoProductsIllustration({ className, size = 160 }: IllustrationProps) {
12
+ return (
13
+ <svg
14
+ viewBox="0 0 160 120"
15
+ width={size}
16
+ height={(size * 120) / 160}
17
+ fill="none"
18
+ strokeWidth={1.5}
19
+ strokeLinecap="round"
20
+ strokeLinejoin="round"
21
+ aria-hidden="true"
22
+ focusable="false"
23
+ className={cn('shrink-0', className)}
24
+ >
25
+ <ellipse cx="80" cy="104" rx="30" ry="5" className="fill-muted" />
26
+
27
+ {/* second tag, not there yet */}
28
+ <path
29
+ d="M68,36 L118,36 Q122,36 122,40 L122,72 Q122,76 118,76 L68,76 L50,56 Z"
30
+ className="stroke-border"
31
+ strokeDasharray="3 4"
32
+ />
33
+
34
+ {/* string */}
35
+ <path d="M53,68 C42,62 38,48 46,36" className="stroke-muted-foreground" />
36
+
37
+ {/* tag */}
38
+ <path
39
+ d="M58,48 L108,48 Q112,48 112,52 L112,84 Q112,88 108,88 L58,88 L40,68 Z"
40
+ className="fill-surface stroke-muted-foreground"
41
+ />
42
+
43
+ {/* price, not set */}
44
+ <line x1="66" y1="62" x2="102" y2="62" className="stroke-border" strokeDasharray="3 4" />
45
+ <line x1="66" y1="74" x2="90" y2="74" className="stroke-border" strokeDasharray="3 4" />
46
+
47
+ {/* eyelet — the one brand accent */}
48
+ <circle cx="53" cy="68" r="4" className="fill-brand" />
49
+ </svg>
50
+ );
51
+ }
52
+
53
+ export { NoProductsIllustration };