@kennycorrea/ui 0.6.1 → 0.8.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0 — 2026-10-09
4
+
5
+ ### Added
6
+ - **Every Radix Themes component the atoms do not wrap**, re-exported unchanged from
7
+ `src/primitives/`: layout (Box, Flex, Grid, Container, Section, Inset), type (Text, Heading,
8
+ Link, Code, Kbd, Em, Strong, Quote, Blockquote), and AlertDialog, AspectRatio, Callout,
9
+ CheckboxCards, CheckboxGroup, DataList, DropdownMenu, HoverCard, IconButton, Radio,
10
+ RadioCards, RadioGroup, ScrollArea, SegmentedControl, TabNav, Table, Tabs, TextField,
11
+ AccessibleIcon, Portal, Reset, Slot, Slottable, ThemePanel, VisuallyHidden. Where an atom
12
+ exists it remains the export under that name.
13
+ - **`ThemeRoot`** — Themes' `<Theme>`, renamed because `Theme` is already this package's type.
14
+ - **All of Radix Icons** (`@radix-ui/react-icons`, 320 `*Icon` components). `Icon` is
15
+ unchanged and still the house glyph set.
16
+
17
+ ## 0.7.0 — 2026-10-09
18
+
19
+ ### Added
20
+ - **`Alert`**: an inline message with `type` (`info` default, `warning`, `success`, `error`,
21
+ `brand`), `head`, `body`, and optional `actionButton` / `secondaryActionButton`
22
+ (`{ label, onPress }`). Same colours and icons as `Toast`; `brand` uses the info icon in the
23
+ theme's own accent. Errors and warnings are `role="alert"`, the rest `role="status"`.
24
+ - **`Skeleton`** (Themes' skeleton) and **`SkeletonText`** (a `lines`-long paragraph placeholder).
25
+
3
26
  ## 0.6.1 — 2026-10-08
4
27
 
5
28
  ### Fixed
@@ -0,0 +1,19 @@
1
+ export type AlertType = 'info' | 'warning' | 'success' | 'error' | 'brand';
2
+ export interface AlertAction {
3
+ label: string;
4
+ onPress?: () => void;
5
+ }
6
+ export interface AlertProps {
7
+ type?: AlertType;
8
+ head?: string;
9
+ body?: string;
10
+ actionButton?: AlertAction;
11
+ secondaryActionButton?: AlertAction;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * An inline message that stays on the page, unlike a toast. Errors and warnings are
16
+ * `role="alert"` so they are announced when they appear; the rest are `status`, which waits
17
+ * its turn rather than interrupting.
18
+ */
19
+ export declare function Alert({ type, head, body, actionButton, secondaryActionButton, className, }: AlertProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../utils/cn.js';
3
+ import { Button } from '../Button/Button.js';
4
+ import { Icon } from '../Icon/Icon.js';
5
+ /**
6
+ * The same colour and icon vocabulary as `Toast`. `brand` borrows info's glyph but sets no
7
+ * `data-accent-color`, so `--accent-*` is whatever the theme — and the accent picker — say.
8
+ */
9
+ const TYPES = {
10
+ info: { color: 'blue', icon: 'info' },
11
+ warning: { color: 'amber', icon: 'warning' },
12
+ success: { color: 'jade', icon: 'check-circle' },
13
+ error: { color: 'red', icon: 'error' },
14
+ brand: { icon: 'info' },
15
+ };
16
+ /**
17
+ * An inline message that stays on the page, unlike a toast. Errors and warnings are
18
+ * `role="alert"` so they are announced when they appear; the rest are `status`, which waits
19
+ * its turn rather than interrupting.
20
+ */
21
+ export function Alert({ type = 'info', head, body, actionButton, secondaryActionButton, className, }) {
22
+ const { color, icon } = TYPES[type];
23
+ const urgent = type === 'error' || type === 'warning';
24
+ return (_jsxs("div", { role: urgent ? 'alert' : 'status', "data-accent-color": color, "data-alert-type": type, className: cn('flex gap-3 rounded-[var(--radius-3)] border border-[var(--accent-6)] bg-[var(--accent-3)] p-4 text-[var(--gray-12)]', className), children: [_jsx(Icon, { name: icon, className: "mt-0.5 text-[var(--accent-11)]" }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [head && _jsx("p", { className: "font-medium", children: head }), body && _jsx("p", { className: "text-sm text-[var(--gray-11)]", children: body }), (actionButton || secondaryActionButton) && (_jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [actionButton && (_jsx(Button, { size: "sm", variant: "primary", onClick: actionButton.onPress, children: actionButton.label })), secondaryActionButton && (_jsx(Button, { size: "sm", variant: "ghost", onClick: secondaryActionButton.onPress, children: secondaryActionButton.label }))] }))] })] }));
25
+ }
@@ -0,0 +1 @@
1
+ export * from './Alert.js';
@@ -0,0 +1 @@
1
+ export * from './Alert.js';
@@ -0,0 +1,19 @@
1
+ import { Skeleton as ThemedSkeleton } from '@radix-ui/themes';
2
+ import type { ComponentPropsWithoutRef } from 'react';
3
+ export interface SkeletonProps extends ComponentPropsWithoutRef<typeof ThemedSkeleton> {
4
+ }
5
+ /**
6
+ * Themes' skeleton, re-exported under the house name.
7
+ *
8
+ * Two ways to use it, both Themes': wrap real content with `loading` and it takes that
9
+ * content's shape, or give it a `width`/`height` and it stands alone. Wrapping is the better
10
+ * one — the placeholder is then exactly the size of what replaces it, so nothing jumps.
11
+ */
12
+ export declare function Skeleton({ className, ...props }: SkeletonProps): import("react").JSX.Element;
13
+ export interface SkeletonTextProps {
14
+ /** How many lines to draw. The last one is shorter, as a paragraph's is. */
15
+ lines?: number;
16
+ className?: string;
17
+ }
18
+ /** A paragraph-shaped placeholder, for where the text's length is not known yet. */
19
+ export declare function SkeletonText({ lines, className }: SkeletonTextProps): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Skeleton as ThemedSkeleton } from '@radix-ui/themes';
3
+ import { cn } from '../../utils/cn.js';
4
+ /**
5
+ * Themes' skeleton, re-exported under the house name.
6
+ *
7
+ * Two ways to use it, both Themes': wrap real content with `loading` and it takes that
8
+ * content's shape, or give it a `width`/`height` and it stands alone. Wrapping is the better
9
+ * one — the placeholder is then exactly the size of what replaces it, so nothing jumps.
10
+ */
11
+ export function Skeleton({ className, ...props }) {
12
+ return _jsx(ThemedSkeleton, { className: cn(className), ...props });
13
+ }
14
+ /** A paragraph-shaped placeholder, for where the text's length is not known yet. */
15
+ export function SkeletonText({ lines = 3, className }) {
16
+ return (_jsx("div", { className: cn('flex flex-col gap-2', className), "aria-hidden": true, children: Array.from({ length: lines }, (_, i) => i).map((i) => (_jsx(ThemedSkeleton, { height: "0.875rem", width: i === lines - 1 && lines > 1 ? '60%' : '100%' }, i))) }));
17
+ }
@@ -0,0 +1 @@
1
+ export * from './Skeleton.js';
@@ -0,0 +1 @@
1
+ export * from './Skeleton.js';
@@ -1,3 +1,4 @@
1
+ export * from './Alert/index.js';
1
2
  export * from './Avatar/index.js';
2
3
  export * from './Badge/index.js';
3
4
  export * from './Button/index.js';
@@ -13,6 +14,7 @@ export * from './Progress/index.js';
13
14
  export * from './RichText/index.js';
14
15
  export * from './Select/index.js';
15
16
  export * from './Separator/index.js';
17
+ export * from './Skeleton/index.js';
16
18
  export * from './Slider/index.js';
17
19
  export * from './Spinner/index.js';
18
20
  export * from './Switch/index.js';
@@ -1,3 +1,4 @@
1
+ export * from './Alert/index.js';
1
2
  export * from './Avatar/index.js';
2
3
  export * from './Badge/index.js';
3
4
  export * from './Button/index.js';
@@ -13,6 +14,7 @@ export * from './Progress/index.js';
13
14
  export * from './RichText/index.js';
14
15
  export * from './Select/index.js';
15
16
  export * from './Separator/index.js';
17
+ export * from './Skeleton/index.js';
16
18
  export * from './Slider/index.js';
17
19
  export * from './Spinner/index.js';
18
20
  export * from './Switch/index.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The whole Radix Icons set, drawn on a 15px grid to sit beside Themes components.
3
+ *
4
+ * `Icon` stays the house glyph set for navigation and status; these cover everything else.
5
+ */
6
+ export * from '@radix-ui/react-icons';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The whole Radix Icons set, drawn on a 15px grid to sit beside Themes components.
3
+ *
4
+ * `Icon` stays the house glyph set for navigation and status; these cover everything else.
5
+ */
6
+ export * from '@radix-ui/react-icons';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './atoms/index.js';
2
+ export * from './icons/index.js';
3
+ export * from './primitives/index.js';
2
4
  export * from './strings.js';
3
5
  export * from './utils/index.js';
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
1
  export * from './atoms/index.js';
2
+ export * from './icons/index.js';
3
+ export * from './primitives/index.js';
2
4
  export * from './strings.js';
3
5
  export * from './utils/index.js';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Every Radix Themes component the atoms do not already wrap, re-exported as is.
3
+ *
4
+ * The atoms stay the house API where one exists — `Button`, `Card`, `Dialog` and the rest
5
+ * carry decisions the raw component does not. These are for everything else, so an app
6
+ * reaches for a `Table` or `Tabs` through this package rather than importing Themes beside it
7
+ * and drifting from the version the atoms were built against.
8
+ */
9
+ export { AccessibleIcon, AlertDialog, AspectRatio, Blockquote, Box, Callout, CheckboxCards, CheckboxGroup, Code, Container, DataList, DropdownMenu, Em, Flex, Grid, Heading, HoverCard, IconButton, Inset, Kbd, Link, Portal, Quote, Radio, RadioCards, RadioGroup, Reset, ScrollArea, Section, SegmentedControl, Slot, Slottable, Strong, Table, TabNav, Tabs, Text, TextField, Theme as ThemeRoot, ThemePanel, VisuallyHidden, } from '@radix-ui/themes';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Every Radix Themes component the atoms do not already wrap, re-exported as is.
3
+ *
4
+ * The atoms stay the house API where one exists — `Button`, `Card`, `Dialog` and the rest
5
+ * carry decisions the raw component does not. These are for everything else, so an app
6
+ * reaches for a `Table` or `Tabs` through this package rather than importing Themes beside it
7
+ * and drifting from the version the atoms were built against.
8
+ */
9
+ export { AccessibleIcon, AlertDialog, AspectRatio, Blockquote, Box, Callout, CheckboxCards, CheckboxGroup, Code, Container, DataList, DropdownMenu, Em, Flex, Grid, Heading, HoverCard, IconButton, Inset, Kbd, Link, Portal, Quote, Radio, RadioCards, RadioGroup, Reset, ScrollArea, Section, SegmentedControl, Slot, Slottable, Strong, Table, TabNav, Tabs, Text, TextField, Theme as ThemeRoot, ThemePanel, VisuallyHidden, } from '@radix-ui/themes';
@@ -97,5 +97,5 @@ export interface Theming<A extends readonly string[]> {
97
97
  export declare function createTheming<const A extends readonly [string, ...string[]]>(config: ThemingConfig<A>): Theming<A>;
98
98
  export declare const readTheme: () => Theme;
99
99
  export declare const storeTheme: (theme: Theme) => void;
100
- export declare const readAccent: () => "jade" | "red" | "yellow" | "orange" | "purple" | "blue";
101
- export declare const storeAccent: (accent: "jade" | "red" | "yellow" | "orange" | "purple" | "blue") => void;
100
+ export declare const readAccent: () => "red" | "yellow" | "orange" | "purple" | "blue" | "jade";
101
+ export declare const storeAccent: (accent: "red" | "yellow" | "orange" | "purple" | "blue" | "jade") => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kennycorrea/ui",
3
- "version": "0.6.1",
3
+ "version": "0.8.0",
4
4
  "description": "Upfront's house component layer: atoms over Radix Themes, the token bridge, and the accent logic.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -35,6 +35,7 @@
35
35
  "react-dom": "^19.0.0"
36
36
  },
37
37
  "dependencies": {
38
+ "@radix-ui/react-icons": "^1.3.2",
38
39
  "@radix-ui/react-slider": "^1.5.0",
39
40
  "@radix-ui/react-toast": "^1.2.23",
40
41
  "@radix-ui/react-toolbar": "^1.1.20",