@jackbernnie/hiyf 0.2.0 → 0.3.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/AGENTS.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Building UI with `@jackbernnie/hiyf`
2
2
 
3
3
  > Instructions for AI coding agents (Claude Code, Codex, Cursor, …). This project
4
- > uses the **hiyf** design system with its **lockdown** lint. Build UI using
5
- > **only** this system — off-system code fails the build on purpose.
4
+ > uses the **hiyf** AI design protocol (a locked design system) with its **lockdown**
5
+ > lint. Build UI using **only** this system — off-system code fails the build on purpose.
6
6
 
7
7
  ## The three rules (these fail `npm run build`)
8
8
 
@@ -93,7 +93,7 @@ hatch. A few key APIs:
93
93
  Full catalog — actions: ButtonGroup, Input, InputGroup, InputOTP, Textarea, Select,
94
94
  NativeSelect, Combobox, Checkbox, Switch, Slider, Toggle, ToggleGroup, RadioGroup,
95
95
  Label, Field. Feedback/display: Status, Badge, Alert, Card, Progress, Skeleton,
96
- Spinner, Avatar, Kbd, Empty, Toaster. Layout/data: Separator, AspectRatio,
96
+ Spinner, Avatar, Image, Kbd, Empty, Toaster. Layout/data: Separator, AspectRatio,
97
97
  ScrollArea, Table, Carousel, Grid, GridItem. Navigation: Tabs, Accordion,
98
98
  Collapsible, Breadcrumb, Pagination, Command, NavigationMenu, Menubar. Overlays:
99
99
  Dialog, AlertDialog, Sheet, Drawer, Popover, HoverCard, Tooltip, DropdownMenu,
@@ -118,6 +118,26 @@ import { Home01Icon, Search01Icon } from '@jackbernnie/hiyf/icons'
118
118
  `size`: `xs s m l xl`. `color` defaults to `current` (inherits text color, so
119
119
  icons inside buttons just work); other values: `muted accent success warning danger`.
120
120
 
121
+ ## Images
122
+
123
+ Raw `<img>` fails the build — render images through `<Image>`:
124
+
125
+ ```tsx
126
+ import { Image } from '@jackbernnie/hiyf'
127
+
128
+ <Image src="/logo.png" alt="Logo" width={120} height={32} radius="m" fit="contain" />
129
+ ```
130
+
131
+ `radius`: `none s m l xl full`. `fit`: `cover contain fill none`. `alt` is required
132
+ (pass `""` for purely decorative images).
133
+
134
+ ## A note on `<Box>` vs `<Text>` className
135
+
136
+ `<Box>` accepts `className` for standard utility classes (`flex`, `items-center`).
137
+ `<Text>` does NOT — it is closed; a `className` on it is dropped and the lint flags
138
+ it. Put layout on a `<Box>` wrapper; use Text props (`variant`, `color`, `align`,
139
+ `truncate`, `monospace`) for everything else.
140
+
121
141
  ## When something you need doesn't exist
122
142
 
123
143
  Work through this in order. **Don't get stuck, and don't expand the design system
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @jackbernnie/hiyf
2
2
 
3
- **human-in-your-face** — a personal, LLM-safe design system: the full shadcn/ui
4
- component set as a robust base, themed neutral, and closed down so the only
5
- expressible choices are correct ones.
3
+ **human-in-your-face** — an AI design protocol (a locked, LLM-safe design system):
4
+ the full shadcn/ui component set as a robust base, themed neutral, and closed down
5
+ so the only expressible choices are correct ones.
6
6
 
7
7
  ```bash
8
8
  npm install @jackbernnie/hiyf
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Image — the closed, sanctioned way to render an image asset.
3
+ *
4
+ * Raw <img> fails the lockdown lint (it is an off-system escape hatch). This is
5
+ * its one home: every image on screen goes through here. There is no
6
+ * className/style escape hatch — size with width/height, shape with radius,
7
+ * control object-fit with fit.
8
+ */
9
+ declare const RADIUS: {
10
+ readonly none: "rounded-none";
11
+ readonly s: "rounded-sm";
12
+ readonly m: "rounded-md";
13
+ readonly l: "rounded-lg";
14
+ readonly xl: "rounded-xl";
15
+ readonly full: "rounded-full";
16
+ };
17
+ declare const FIT: {
18
+ readonly cover: "object-cover";
19
+ readonly contain: "object-contain";
20
+ readonly fill: "object-fill";
21
+ readonly none: "object-none";
22
+ };
23
+ export type ImageRadius = keyof typeof RADIUS;
24
+ export type ImageFit = keyof typeof FIT;
25
+ export type ImageProps = {
26
+ src: string;
27
+ /** Always required — describe the image, or pass "" for decorative images. */
28
+ alt: string;
29
+ width?: number;
30
+ height?: number;
31
+ radius?: ImageRadius;
32
+ fit?: ImageFit;
33
+ loading?: 'lazy' | 'eager';
34
+ };
35
+ export declare function Image({ src, alt, width, height, radius, fit, loading, }: ImageProps): import("react").JSX.Element;
36
+ export {};
@@ -0,0 +1,40 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { cn } from '../lib/utils.js';
3
+
4
+ const RADIUS = {
5
+ none: "rounded-none",
6
+ s: "rounded-sm",
7
+ m: "rounded-md",
8
+ l: "rounded-lg",
9
+ xl: "rounded-xl",
10
+ full: "rounded-full"
11
+ };
12
+ const FIT = {
13
+ cover: "object-cover",
14
+ contain: "object-contain",
15
+ fill: "object-fill",
16
+ none: "object-none"
17
+ };
18
+ function Image({
19
+ src,
20
+ alt,
21
+ width,
22
+ height,
23
+ radius = "none",
24
+ fit = "cover",
25
+ loading = "lazy"
26
+ }) {
27
+ return /* @__PURE__ */ jsx(
28
+ "img",
29
+ {
30
+ src,
31
+ alt,
32
+ width,
33
+ height,
34
+ loading,
35
+ className: cn("inline-block max-w-full", RADIUS[radius], FIT[fit])
36
+ }
37
+ );
38
+ }
39
+
40
+ export { Image };
package/dist/index.d.ts CHANGED
@@ -60,6 +60,8 @@ export { Spinner } from './components/Spinner';
60
60
  export type { SpinnerProps } from './components/Spinner';
61
61
  export { Avatar } from './components/Avatar';
62
62
  export type { AvatarProps } from './components/Avatar';
63
+ export { Image } from './components/Image';
64
+ export type { ImageProps, ImageRadius, ImageFit } from './components/Image';
63
65
  export { Kbd } from './components/Kbd';
64
66
  export type { KbdProps } from './components/Kbd';
65
67
  export { Empty } from './components/Empty';
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ export { Progress } from './components/Progress.js';
29
29
  export { Skeleton } from './components/Skeleton.js';
30
30
  export { Spinner } from './components/Spinner.js';
31
31
  export { Avatar } from './components/Avatar.js';
32
+ export { Image } from './components/Image.js';
32
33
  export { Kbd } from './components/Kbd.js';
33
34
  export { Empty } from './components/Empty.js';
34
35
  export { Toaster } from './components/Toaster.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jackbernnie/hiyf",
3
- "version": "0.2.0",
4
- "description": "human-in-your-face — a personal, LLM-safe design system. Forked from Polar's Orbit (Apache-2.0).",
3
+ "version": "0.3.0",
4
+ "description": "human-in-your-face — an AI design protocol (a locked, LLM-safe design system). Forked from Polar's Orbit (Apache-2.0).",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "sideEffects": [