@vendure-io/ui 3.0.0-next.0 → 3.0.0-next.2

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 (38) hide show
  1. package/package.json +2 -2
  2. package/src/components/atoms/alert.tsx +13 -6
  3. package/src/components/atoms/avatar.tsx +11 -3
  4. package/src/components/atoms/breadcrumb.tsx +467 -53
  5. package/src/components/atoms/button.tsx +1 -1
  6. package/src/components/atoms/calendar.tsx +11 -2
  7. package/src/components/atoms/combobox.tsx +220 -17
  8. package/src/components/atoms/command.tsx +51 -130
  9. package/src/components/atoms/dialog.tsx +23 -1
  10. package/src/components/atoms/empty.tsx +1 -1
  11. package/src/components/atoms/field.tsx +4 -1
  12. package/src/components/atoms/input-group.tsx +2 -2
  13. package/src/components/atoms/label-swap.tsx +59 -3
  14. package/src/components/atoms/popover.tsx +6 -1
  15. package/src/components/atoms/sheet.tsx +18 -1
  16. package/src/components/atoms/sidebar.tsx +73 -1
  17. package/src/components/atoms/sonner.tsx +1 -1
  18. package/src/components/atoms/table.tsx +133 -10
  19. package/src/components/atoms/tooltip.tsx +3 -3
  20. package/src/components/molecules/chip.tsx +43 -4
  21. package/src/components/molecules/confirm-dialog.tsx +9 -0
  22. package/src/components/molecules/count-badge.tsx +115 -0
  23. package/src/components/molecules/data-table/data-table-filters.tsx +61 -21
  24. package/src/components/molecules/data-table/data-table-helpers.tsx +26 -1
  25. package/src/components/molecules/data-table/data-table-types.tsx +66 -2
  26. package/src/components/molecules/data-table/data-table.tsx +190 -35
  27. package/src/components/molecules/direction-link.tsx +1 -1
  28. package/src/components/molecules/format-provider.tsx +12 -2
  29. package/src/components/molecules/page-header.tsx +1 -1
  30. package/src/components/molecules/search-trigger.tsx +2 -18
  31. package/src/components/molecules/secret-value.tsx +6 -3
  32. package/src/components/molecules/state-views/loading-state.tsx +37 -7
  33. package/src/components/molecules/state-views/skeleton-parts.tsx +245 -0
  34. package/src/components/molecules/status-badge.tsx +2 -2
  35. package/src/components/molecules/timeline.tsx +1 -1
  36. package/src/hooks/use-active-label-size.ts +39 -5
  37. package/src/hooks/use-apple-platform.ts +26 -0
  38. package/src/lib/utils.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendure-io/ui",
3
- "version": "3.0.0-next.0",
3
+ "version": "3.0.0-next.2",
4
4
  "description": "React component library for Vendure, built on shadcn/ui and Tailwind v4",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://github.com/vendurehq/design/tree/main/packages/ui",
@@ -47,7 +47,7 @@
47
47
  "pack:check": "bun pm pack --dry-run"
48
48
  },
49
49
  "peerDependencies": {
50
- "@vendure-io/design-tokens": "^3.0.0-next.0",
50
+ "@vendure-io/design-tokens": "^3.0.0-next.2",
51
51
  "react": ">=19",
52
52
  "react-dom": ">=19",
53
53
  "next": ">=14",
@@ -119,17 +119,24 @@ function AlertDescription({
119
119
  )
120
120
  }
121
121
 
122
- // From a 28rem-wide alert up, the action takes the last grid column on the first
123
- // row, so the text wraps before it. The action box is one text line high and
124
- // centres its content, so a button lines up with the first line of the text and
125
- // overflows into the alert padding instead of making the alert taller. In a
126
- // narrower alert the action moves to its own row under the text.
122
+ // From a 28rem-wide alert up, the action takes the last grid column and spans
123
+ // the text rows, so the text wraps before it. The action box is one text line
124
+ // high and centres its content, so a button lines up with a line of text and
125
+ // overflows into the alert padding instead of making the alert taller.
126
+ // Where the box sits follows the height of the text beside it (100% of the
127
+ // spanned rows):
128
+ // - Up to two lines (a title and one sentence), it is centred on the text.
129
+ // - From three lines (an error block, a next step), it stays on the first line.
130
+ // The step happens at 2.5 lines; `(2.5lh - 100%) * 999` turns it into 0 or a
131
+ // large value, so `min()` picks either the centre offset or 0.
132
+ // The span of 9 rows covers every text row; extra implicit rows are 0 high.
133
+ // In a narrower alert the action moves to its own row under the text.
127
134
  function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
128
135
  return (
129
136
  <div
130
137
  data-slot="alert-action"
131
138
  className={cn(
132
- "col-end-[-1] flex flex-wrap content-center items-center gap-2 @max-md/alert:col-start-1 @max-md/alert:mt-2 @max-md/alert:group-has-[>svg]/alert:col-start-2 @md/alert:row-start-1 @md/alert:ms-3 @md/alert:h-lh @md/alert:self-start",
139
+ "col-end-[-1] flex flex-wrap content-center items-center gap-2 @max-md/alert:col-start-1 @max-md/alert:mt-2 @max-md/alert:group-has-[>svg]/alert:col-start-2 @md/alert:relative @md/alert:row-start-1 @md/alert:row-span-9 @md/alert:ms-3 @md/alert:h-lh @md/alert:self-start @md/alert:top-[min((100%_-_1lh)/2,max(0px,(2.5lh_-_100%)*999))]",
133
140
  className
134
141
  )}
135
142
  {...props}
@@ -8,16 +8,24 @@ import { cn } from "@vendure-io/ui/lib/utils"
8
8
  function Avatar({
9
9
  className,
10
10
  size = "default",
11
+ shape = "circle",
11
12
  ...props
12
13
  }: AvatarPrimitive.Root.Props & {
13
14
  size?: "default" | "sm" | "lg"
15
+ /**
16
+ * `circle` for a person. `square` for an account, an organisation or a
17
+ * channel: a logo or initials in a rounded square. The shape covers the
18
+ * ring, the image and the fallback, so do not set a radius by hand.
19
+ */
20
+ shape?: "circle" | "square"
14
21
  }) {
15
22
  return (
16
23
  <AvatarPrimitive.Root
17
24
  data-slot="avatar"
18
25
  data-size={size}
26
+ data-shape={shape}
19
27
  className={cn(
20
- "after:border-border group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",
28
+ "after:border-border group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 data-[shape=square]:rounded-lg data-[shape=square]:after:rounded-lg dark:after:mix-blend-lighten",
21
29
  className
22
30
  )}
23
31
  {...props}
@@ -30,7 +38,7 @@ function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
30
38
  <AvatarPrimitive.Image
31
39
  data-slot="avatar-image"
32
40
  className={cn(
33
- "aspect-square size-full rounded-full object-cover",
41
+ "aspect-square size-full rounded-full object-cover group-data-[shape=square]/avatar:rounded-lg",
34
42
  className
35
43
  )}
36
44
  {...props}
@@ -46,7 +54,7 @@ function AvatarFallback({
46
54
  <AvatarPrimitive.Fallback
47
55
  data-slot="avatar-fallback"
48
56
  className={cn(
49
- "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",
57
+ "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs group-data-[shape=square]/avatar:rounded-lg",
50
58
  className
51
59
  )}
52
60
  {...props}