atlas-react-kit 0.8.2 → 0.9.1

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/COMPONENTS.md CHANGED
@@ -5,6 +5,18 @@ underlying element or Radix props, including `className`, alongside their option
5
5
  Form helpers and `TableBodySkeleton` accept only their documented props. There is
6
6
  no root component barrel.
7
7
 
8
+ Core entries need only the kit. These feature entries need an extra install
9
+ (same version ranges as the kit's optional peers). `Toaster` also reads the
10
+ theme from `next-themes`, so toast consumers install that too.
11
+
12
+ | Entry points | Extra install |
13
+ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
14
+ | `calendar`, `date-picker`, `date-time-picker`, `form/date-picker-field`, `form/date-time-picker-field` | `npm i react-day-picker@^10.0.1 date-fns@^4.4.0` |
15
+ | `markdown`, `form/markdown-field` | `npm i react-markdown@^10.1.0 remark-gfm@^4.0.1` |
16
+ | `theme-provider` | `npm i next-themes@^0.4.6` |
17
+ | `toast` | `npm i sonner@^2.0.7 next-themes@^0.4.6` |
18
+ | `next/tabs-nav-link` | `npm i next@^16.0.0` |
19
+
8
20
  | Subpath | Main exports and options |
9
21
  | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10
22
  | `accordion` | `Accordion`, `AccordionItem`, `AccordionTrigger`, `AccordionContent`; Radix `type` `single` (with `collapsible`) or `multiple` |
package/DESIGN_RULES.md CHANGED
@@ -82,9 +82,15 @@ 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 padding (`px-4 py-3`). The close control is
89
+ a circular badge centred on the top-right corner (half outside the border),
90
+ not a control in the text row. A plain `toast()` has no icon — status icons
91
+ belong to `success`, `info`, `warning`, `error`, and `loading`. Tone colors
92
+ the icon, title, and border, not the body. Width is the content up to 356px,
93
+ or the viewport minus gutters on small screens.
88
94
 
89
95
  Use `EmptyPanel` for empty states, `TableBodySkeleton` for loading table bodies,
90
96
  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.8.2
10
+ npm install --save-exact atlas-react-kit@0.9.1
11
11
  ```
12
12
 
13
13
  Import components by subpath:
@@ -27,6 +27,18 @@ export function Example() {
27
27
  }
28
28
  ```
29
29
 
30
+ Core entries need only the kit. These feature entries need an extra install
31
+ (same version ranges as the kit's optional peers). `Toaster` also reads the
32
+ theme from `next-themes`, so toast consumers install that too.
33
+
34
+ | Entry points | Extra install |
35
+ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
36
+ | `calendar`, `date-picker`, `date-time-picker`, `form/date-picker-field`, `form/date-time-picker-field` | `npm i react-day-picker@^10.0.1 date-fns@^4.4.0` |
37
+ | `markdown`, `form/markdown-field` | `npm i react-markdown@^10.1.0 remark-gfm@^4.0.1` |
38
+ | `theme-provider` | `npm i next-themes@^0.4.6` |
39
+ | `toast` | `npm i sonner@^2.0.7 next-themes@^0.4.6` |
40
+ | `next/tabs-nav-link` | `npm i next@^16.0.0` |
41
+
30
42
  In your global stylesheet, import the theme after Tailwind and register the
31
43
  installed JavaScript directory. Paths in `@source` are relative to that stylesheet;
32
44
  this example assumes it is one directory below the project root.
@@ -90,8 +102,9 @@ The public site is Storybook in `site/`. `npm run build --prefix site`
90
102
  typechecks the stories, builds Storybook into `site/dist`, then checks the
91
103
  static output. Vercel serves that directory; `/playground` and `/storybook`
92
104
  redirect to `/`. The site and Storybook dependencies are not part of the npm
93
- package. The optional Next.js 16 adapter requires Next only when imported. The
94
- package does not bundle React.
105
+ package. Optional feature libraries (markdown, dates, toasts, theme, Next) are
106
+ peer dependencies and are required only when those entry points are imported.
107
+ The package does not bundle React.
95
108
 
96
109
  Run `npm run dev --prefix site` (or `npm run storybook --prefix site`) for the
97
110
  playground on port 6006. Existing examples live in `stories/` and are imported
@@ -116,7 +129,7 @@ artifact with the package owner's npm login:
116
129
  ```sh
117
130
  mkdir -p release-artifacts
118
131
  npm pack --pack-destination release-artifacts
119
- npm publish ./release-artifacts/atlas-react-kit-0.8.2.tgz --access public
132
+ npm publish ./release-artifacts/atlas-react-kit-0.9.1.tgz --access public
120
133
  ```
121
134
 
122
135
  See [CONTRIBUTING.md](./CONTRIBUTING.md) for adding components, the browser
@@ -9,8 +9,8 @@ export type MarkdownProps = {
9
9
  };
10
10
  /**
11
11
  * GitHub-flavoured Markdown, token-styled and sanitized. No Next, no raw
12
- * HTML, no typography plugin. `react-markdown` and `remark-gfm` stay in this
13
- * module so other subpaths do not pay for them.
12
+ * HTML, no typography plugin. `react-markdown` and `remark-gfm` are optional
13
+ * peers imported only here so other subpaths do not pay for them.
14
14
  */
15
15
  declare function Markdown({ content, className }: MarkdownProps): import("react").JSX.Element;
16
16
  /** Alias used by apps that imported MarkdownContent. */
package/dist/markdown.js CHANGED
@@ -51,8 +51,8 @@ const markdownComponents = {
51
51
  };
52
52
  /**
53
53
  * GitHub-flavoured Markdown, token-styled and sanitized. No Next, no raw
54
- * HTML, no typography plugin. `react-markdown` and `remark-gfm` stay in this
55
- * module so other subpaths do not pay for them.
54
+ * HTML, no typography plugin. `react-markdown` and `remark-gfm` are optional
55
+ * peers imported only here so other subpaths do not pay for them.
56
56
  */
57
57
  function Markdown({ content, className }) {
58
58
  return (_jsx("article", { "data-slot": "markdown", className: cn("flex flex-col gap-3 text-foreground", className), children: _jsx(ReactMarkdown, { remarkPlugins: REMARK_PLUGINS, urlTransform: safeMarkdownUrl, components: markdownComponents, children: content }) }));
package/dist/toast.js CHANGED
@@ -37,23 +37,35 @@ 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.
44
54
  */
45
55
  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",
56
+ toast: "relative flex w-max max-w-[min(356px,calc(100vw-2rem))] flex-wrap items-center justify-end gap-x-3 gap-y-2 overflow-visible rounded-none border border-border bg-popover px-4 py-3 text-sm text-popover-foreground shadow-md",
47
57
  // 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",
58
+ // (aligned right by the toast's justify-end). Without an icon the basis
59
+ // falls back to the title's width, so a one-word toast stays compact.
60
+ content: "flex min-w-0 flex-1 basis-full flex-col gap-1 [[data-icon]+&]:basis-[calc(100%-1.75rem)]",
50
61
  title: "font-medium leading-5",
51
62
  description: "leading-5 text-muted-foreground",
52
- icon: "mt-0.5 flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
63
+ icon: "flex size-4 shrink-0 items-center justify-center [&_svg]:size-4",
53
64
  actionButton: cn(buttonVariants({ size: "xs" }), "shrink-0"),
54
65
  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"),
66
+ 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
67
  success: "border-success/40 [&_[data-title]]:text-success",
68
+ info: "[&_[data-title]]:text-foreground",
57
69
  warning: "border-warning/40 [&_[data-title]]:text-warning",
58
70
  error: "border-destructive/40 [&_[data-title]]:text-destructive",
59
71
  };
@@ -63,7 +75,7 @@ const icons = {
63
75
  warning: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-warning" }),
64
76
  error: _jsx(CircleAlertIcon, { "aria-hidden": true, className: "text-destructive" }),
65
77
  loading: (_jsx(LoaderCircleIcon, { "aria-hidden": true, className: "animate-spin text-muted-foreground" })),
66
- close: _jsx(XIcon, { "aria-hidden": true }),
78
+ close: _jsx(XIcon, { "aria-hidden": true, className: "size-3" }),
67
79
  };
68
80
  /**
69
81
  * Mount one near the app root, and show toasts with `toast()` from this
@@ -71,6 +83,6 @@ const icons = {
71
83
  */
72
84
  const Toaster = ({ position, closeButton = true, expand, visibleToasts, duration, }) => {
73
85
  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 } }));
86
+ 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
87
  };
76
88
  export { Toaster, toast };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atlas-react-kit",
3
- "version": "0.8.2",
3
+ "version": "0.9.1",
4
4
  "description": "Shared React components and Tailwind theme for Atlas",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -255,27 +255,45 @@
255
255
  "access": "public"
256
256
  },
257
257
  "peerDependencies": {
258
+ "date-fns": "^4.4.0",
258
259
  "next": "^16.0.0",
260
+ "next-themes": "^0.4.6",
259
261
  "react": "^19.0.0",
262
+ "react-day-picker": "^10.0.1",
260
263
  "react-dom": "^19.0.0",
264
+ "react-markdown": "^10.1.0",
265
+ "remark-gfm": "^4.0.1",
266
+ "sonner": "^2.0.7",
261
267
  "tailwindcss": "^4.0.0"
262
268
  },
263
269
  "peerDependenciesMeta": {
270
+ "date-fns": {
271
+ "optional": true
272
+ },
264
273
  "next": {
265
274
  "optional": true
275
+ },
276
+ "next-themes": {
277
+ "optional": true
278
+ },
279
+ "react-day-picker": {
280
+ "optional": true
281
+ },
282
+ "react-markdown": {
283
+ "optional": true
284
+ },
285
+ "remark-gfm": {
286
+ "optional": true
287
+ },
288
+ "sonner": {
289
+ "optional": true
266
290
  }
267
291
  },
268
292
  "dependencies": {
269
293
  "class-variance-authority": "^0.7.1",
270
294
  "clsx": "^2.1.1",
271
- "date-fns": "^4.4.0",
272
295
  "lucide-react": "^1.16.0",
273
- "next-themes": "^0.4.6",
274
296
  "radix-ui": "^1.4.3",
275
- "react-day-picker": "^10.0.1",
276
- "react-markdown": "^10.1.0",
277
- "remark-gfm": "^4.0.1",
278
- "sonner": "^2.0.7",
279
297
  "tailwind-merge": "^3.6.0",
280
298
  "tw-animate-css": "^1.4.0"
281
299
  },
@@ -288,11 +306,17 @@
288
306
  "@types/react": "^19.2.14",
289
307
  "@types/react-dom": "^19.2.3",
290
308
  "@vitest/coverage-v8": "4.1.11",
309
+ "date-fns": "^4.4.0",
291
310
  "jsdom": "^29.1.1",
292
311
  "next": "16.2.6",
312
+ "next-themes": "^0.4.6",
293
313
  "prettier": "^3.8.1",
294
314
  "react": "^19.2.4",
315
+ "react-day-picker": "^10.0.1",
295
316
  "react-dom": "^19.2.4",
317
+ "react-markdown": "^10.1.0",
318
+ "remark-gfm": "^4.0.1",
319
+ "sonner": "^2.0.7",
296
320
  "tailwindcss": "^4.2.1",
297
321
  "typescript": "^6.0.3",
298
322
  "vitest": "^4.1.9"
@@ -42,7 +42,9 @@ root (or a `dark` class on an ancestor). Toasts need one `<Toaster />` from
42
42
  `atlas-react-kit/toast`; show them with `toast()` from the same module, using
43
43
  only the options it declares. Never import a toast library such as `sonner`
44
44
  directly: the kit owns the toast API, and a second copy never reaches its
45
- toaster. Fix missing setup rather than working
45
+ toaster. Markdown, dates, toasts, and `ThemeProvider` are optional peers —
46
+ install the extras listed in `COMPONENTS.md` when you import those entry
47
+ points. Fix missing setup rather than working
46
48
  around unstyled components.
47
49
 
48
50
  ## 3. Pick the kit component for the job