atlas-react-kit 0.9.0 → 0.9.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.
package/DESIGN_RULES.md CHANGED
@@ -82,9 +82,17 @@ still read normal words.
82
82
 
83
83
  ## Shape and composition
84
84
 
85
- Primitives have square corners. Reserve `rounded-full` for dots, avatars, and
86
- other circles. Card and dialog titles already use uppercase, tracked
87
- `font-heading` styling.
85
+ Primitives have square corners. Reserve `rounded-full` for dots, avatars,
86
+ other circles, and the toast close badge. Card and dialog titles already use
87
+ uppercase, tracked `font-heading` styling. Toasts are overlay popovers with
88
+ the same square corners and Alert left/vertical padding (`pl-4 py-3`). Right
89
+ padding is `pr-6` so copy clears the floating close badge. Icon-to-text is
90
+ `gap-x-2.5` so the status icon and copy read as one unit. The close control is
91
+ a circular badge centred on the top-right corner (half outside the border),
92
+ not a control in the text row. A plain `toast()` has no icon — status icons
93
+ belong to `success`, `info`, `warning`, `error`, and `loading`. Tone colors
94
+ the icon, title, and border, not the body. Width is the content up to 356px,
95
+ or the viewport minus gutters on small screens.
88
96
 
89
97
  Use `EmptyPanel` for empty states, `TableBodySkeleton` for loading table bodies,
90
98
  and `<Card flush>` for an edge-to-edge list or table. `Table` scrolls wide
package/README.md CHANGED
@@ -7,7 +7,7 @@ keeping locally (`InfoTip`, `ColorLegend`, `SearchPicker`, `Markdown`,
7
7
  React 19 and Tailwind 4 are required.
8
8
 
9
9
  ```sh
10
- npm install --save-exact atlas-react-kit@0.9.0
10
+ npm install --save-exact atlas-react-kit@0.9.2
11
11
  ```
12
12
 
13
13
  Import components by subpath:
@@ -129,7 +129,7 @@ artifact with the package owner's npm login:
129
129
  ```sh
130
130
  mkdir -p release-artifacts
131
131
  npm pack --pack-destination release-artifacts
132
- npm publish ./release-artifacts/atlas-react-kit-0.9.0.tgz --access public
132
+ npm publish ./release-artifacts/atlas-react-kit-0.9.2.tgz --access public
133
133
  ```
134
134
 
135
135
  See [CONTRIBUTING.md](./CONTRIBUTING.md) for adding components, the browser
package/dist/toast.js CHANGED
@@ -37,23 +37,40 @@ const toast = Object.assign(show(sonnerToast), {
37
37
  /**
38
38
  * Toasts drawn entirely with kit classes. Sonner's own styles are unlayered
39
39
  * CSS that Tailwind utilities cannot override, so the toaster runs Sonner
40
- * `unstyled` and styles every part here: the popover surface, Alert-style
41
- * status icons (the tone colors the icon, title, and border, not the body
42
- * text), kit buttons for actions, and a labelled close button with the
43
- * shared focus ring.
40
+ * `unstyled` and styles every part here.
41
+ *
42
+ * Icon policy: a plain `toast()` has no icon. `success`, `info`, `warning`,
43
+ * `error`, and `loading` each show a status icon. Tone colors the icon, title,
44
+ * and border (same approach as Alert), not the body text.
45
+ *
46
+ * Close button: a circular badge centred on the top-right corner (`-top-2
47
+ * -right-2`, half outside the border). Ghost / icon-xs still supplies the
48
+ * shared focus ring, but Sonner's unlayered `[data-button]` default
49
+ * (`background: var(--normal-text)`) and the dark `[data-close-button]` rule
50
+ * (not gated on `data-styled`) would paint a foreground square. Important
51
+ * popover fill, border, and muted text beat those fills. The 24px hit area
52
+ * is the badge itself; the X is 12px. `overflow-visible` on the toast and
53
+ * toaster keeps stacked badges from being clipped.
54
+ *
55
+ * Padding is asymmetric: `pl-4` matches Alert; `pr-6` clears the badge
56
+ * (about 16px of it sits inside the border). Icon-to-text is `gap-x-2.5`
57
+ * so the status icon and copy read as one unit.
44
58
  */
45
59
  const classNames = {
46
- toast: "flex w-(--width) flex-wrap items-start justify-end gap-3 rounded-none border border-border bg-popover p-4 pr-10 text-sm text-popover-foreground shadow-lg",
60
+ toast: "relative flex w-max max-w-[min(356px,calc(100vw-2rem))] flex-wrap items-center justify-end gap-x-2.5 gap-y-2 overflow-visible rounded-none border border-border bg-popover py-3 pl-4 pr-6 text-sm text-popover-foreground shadow-md",
47
61
  // Fills the row beside the icon, so action buttons wrap to their own row
48
- // (aligned right by the toast's justify-end).
49
- content: "flex min-w-0 flex-1 basis-[calc(100%-1.75rem)] flex-col gap-0.5",
62
+ // (aligned right by the toast's justify-end). Without an icon the basis
63
+ // falls back to the title's width, so a one-word toast stays compact.
64
+ // 1.625rem = 16px icon + 10px gap-x-2.5.
65
+ content: "flex min-w-0 flex-1 basis-full flex-col gap-1 [[data-icon]+&]:basis-[calc(100%-1.625rem)]",
50
66
  title: "font-medium leading-5",
51
67
  description: "leading-5 text-muted-foreground",
52
- icon: "mt-0.5 flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
68
+ icon: "flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
53
69
  actionButton: cn(buttonVariants({ size: "xs" }), "shrink-0"),
54
70
  cancelButton: cn(buttonVariants({ variant: "outline", size: "xs" }), "shrink-0"),
55
- closeButton: cn(buttonVariants({ variant: "ghost", size: "icon-xs" }), "absolute top-2 right-2 text-muted-foreground"),
71
+ closeButton: cn(buttonVariants({ variant: "ghost", size: "icon-xs" }), "!absolute !-top-2 !-right-2 !left-auto !z-10 !size-6 !rounded-full !border !border-border !bg-popover !p-0 !text-muted-foreground !shadow-xs !translate-x-0 !translate-y-0 hover:!border-border hover:!bg-popover hover:!text-foreground focus-visible:!text-foreground active:!translate-y-0 [&_svg]:!size-3"),
56
72
  success: "border-success/40 [&_[data-title]]:text-success",
73
+ info: "[&_[data-title]]:text-foreground",
57
74
  warning: "border-warning/40 [&_[data-title]]:text-warning",
58
75
  error: "border-destructive/40 [&_[data-title]]:text-destructive",
59
76
  };
@@ -63,7 +80,7 @@ const icons = {
63
80
  warning: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-warning" }),
64
81
  error: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-destructive" }),
65
82
  loading: (_jsx(LoaderCircleIcon, { "aria-hidden": true, className: "animate-spin text-muted-foreground" })),
66
- close: _jsx(XIcon, { "aria-hidden": true }),
83
+ close: _jsx(XIcon, { "aria-hidden": true, className: "size-3" }),
67
84
  };
68
85
  /**
69
86
  * Mount one near the app root, and show toasts with `toast()` from this
@@ -71,6 +88,6 @@ const icons = {
71
88
  */
72
89
  const Toaster = ({ position, closeButton = true, expand, visibleToasts, duration, }) => {
73
90
  const { theme = "system" } = useTheme();
74
- return (_jsx(Sonner, { theme: theme, className: "toaster group", position: position, closeButton: closeButton, expand: expand, visibleToasts: visibleToasts, duration: duration, icons: icons, toastOptions: { unstyled: true, classNames } }));
91
+ return (_jsx(Sonner, { theme: theme, className: "toaster group overflow-visible", position: position, closeButton: closeButton, expand: expand, visibleToasts: visibleToasts, duration: duration, icons: icons, toastOptions: { unstyled: true, classNames } }));
75
92
  };
76
93
  export { Toaster, toast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-react-kit",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Shared React components and Tailwind theme for Atlas",
5
5
  "type": "module",
6
6
  "license": "MIT",