@zentara-co/zenos-ui 0.2.4 → 0.2.6

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 (4) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +274 -14
  4. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @zentara-co/zenos-ui
2
2
 
3
+ ## 0.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Expand the package READMEs with installation, usage examples, API and recipe guidance, coding-agent setup, troubleshooting, and contribution instructions.
8
+ - 896651d: Standardize CSS setup documentation on a global index.css file. Tailwind v4 projects import tailwindcss and the Zenos Tailwind entrypoint there so Tailwind CSS IntelliSense can discover Zenos theme utilities and custom variants. Update generated CLI agent instructions and the package README to match.
9
+
10
+ ## 0.2.5
11
+
12
+ ### Patch Changes
13
+
14
+ - Publish releases from GitHub Actions using npm trusted publishing under the existing @zentara-co scope.
15
+
3
16
  ## 0.2.4
4
17
 
5
18
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zenos contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,32 +1,292 @@
1
1
  # Zenos UI
2
2
 
3
- React 19 components, layout primitives, hooks, and semantic styles for product interfaces.
3
+ React 19 and TypeScript components, layout primitives, hooks, and semantic styles for product interfaces. `@zentara-co/zenos-ui` is the core package for dashboards, administration tools, security products, and internal platforms.
4
+
5
+ Native HTML supplies semantics, Base UI supplies complex interactions, and Zenos styles apply the visual system. Your application owns routing, data, authorization, validation policy, and workflows. Specialist features such as calendars and charts are available as editable recipes through the companion CLI.
6
+
7
+ [Documentation](https://zenos-ui.pages.dev) · [npm](https://www.npmjs.com/package/@zentara-co/zenos-ui) · [Source](https://github.com/zentara-co/zenos/tree/main/packages/ui)
8
+
9
+ ## Requirements
10
+
11
+ - React 19 and React DOM 19.
12
+ - An ESM bundler with CSS import support, such as Vite, Next.js, Astro, React Router, or TanStack Start.
13
+ - TypeScript 5.x is recommended for typed props and editor completion.
14
+
15
+ The package is public on npm. Installation does not require a token or repository access.
16
+
17
+ ## Installation
18
+
19
+ Install the package with your application's package manager:
4
20
 
5
21
  ```bash
6
22
  npm install @zentara-co/zenos-ui
23
+ # pnpm add @zentara-co/zenos-ui
24
+ # yarn add @zentara-co/zenos-ui
25
+ # bun add @zentara-co/zenos-ui
7
26
  ```
8
27
 
9
- Import the compiled stylesheet once in your application's global entry, before
10
- your own styles:
28
+ In a monorepo, install it in the package that renders React.
11
29
 
12
- ```tsx
13
- import "@zentara-co/zenos-ui/styles.css";
14
- import { Button } from "@zentara-co/zenos-ui";
30
+ ### Styles without Tailwind
31
+
32
+ Import the compiled stylesheet in your application's global CSS file:
33
+
34
+ ```css
35
+ @import "@zentara-co/zenos-ui/styles.css";
15
36
  ```
16
37
 
17
- For Tailwind CSS v4 applications, use the Tailwind entrypoint in your global CSS
18
- instead of the compiled stylesheet:
38
+ The stylesheet includes semantic tokens, component styles, typography, elevation, motion, layout classes, and light and dark theme values. Tailwind is not required to use it.
39
+
40
+ ### Styles with Tailwind CSS v4
41
+
42
+ Use the Tailwind-native entrypoint in your global CSS file instead:
19
43
 
20
44
  ```css
21
45
  @import "tailwindcss";
22
46
  @import "@zentara-co/zenos-ui/tailwind.css";
23
47
  ```
24
48
 
25
- Requires React and React DOM 19 and an ESM bundler with CSS import support.
26
- Installation from npm does not require a token or repository access.
49
+ This entrypoint exposes Zenos theme utilities and custom variants to the compiler and Tailwind CSS IntelliSense. Consumers do not need to add Zenos source to a Tailwind content list.
50
+
51
+ ### Load your global CSS
52
+
53
+ Import only your local CSS file from the application entry:
54
+
55
+ ```tsx
56
+ import "./index.css";
57
+ ```
58
+
59
+ Place application CSS rules below the package imports. Choose one of the two stylesheet setups above; loading both duplicates styles. Keep package CSS imports in your global stylesheet rather than importing them directly from `.tsx` files.
60
+
61
+ Narrower foundation sheets are also exported as `theme.css`, `colors.css`, `elevation.css`, and `typography.css`. These are partials, not a replacement for component styles. Avoid duplicating the foundations by loading them alongside the complete stylesheet.
62
+
63
+ Framework-specific CSS placement, client boundaries, and theme bootstrapping are covered in the [installation guide](https://zenos-ui.pages.dev/getting-started/installation/).
64
+
65
+ ## Quick start
66
+
67
+ Compose controls with `Field` for labels and descriptions, and use layout primitives for spacing:
68
+
69
+ ```tsx
70
+ import { Button, Field, FormLayout, Input } from "@zentara-co/zenos-ui";
71
+
72
+ export function ProjectForm() {
73
+ return (
74
+ <FormLayout as="form" action="/projects" method="post" gap="4">
75
+ <Field.Root required>
76
+ <Field.Label>Project name</Field.Label>
77
+ <Field.Control render={<Input name="projectName" />} />
78
+ <Field.Description>Use a name your team will recognize.</Field.Description>
79
+ </Field.Root>
80
+ <Button type="submit">Create project</Button>
81
+ </FormLayout>
82
+ );
83
+ }
84
+ ```
85
+
86
+ The application supplies the `/projects` handler. `FormLayout` arranges the form; `Field` connects the label, description, errors, and state to the control. Validation and submission logic stay in your application or form library.
87
+
88
+ See the [quick start](https://zenos-ui.pages.dev/getting-started/quick-start/) for a full form example.
89
+
90
+ ## Components
91
+
92
+ Everything below is exported from `@zentara-co/zenos-ui`. Compound components expose a namespace (`Dialog.Root`, `Dialog.Trigger`) and the same parts as flat exports (`DialogRoot`, `DialogTrigger`).
93
+
94
+ | Group | Components |
95
+ | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
96
+ | Actions | Button, Button Group, Icon Button, Split Button, Toggle, Toggle Group, Toolbar, Theme Toggle Button |
97
+ | Forms and input | Field, Label, Input, Textarea, Input Group, Numeric Input, Date Input, OTP Field, Password Strength, Color Picker, Native Select, Questionnaire, Checkbox, Radio Group, Switch, Slider, Select, Combobox, Autocomplete, Tag, Tag Input |
98
+ | Feedback and status | Alert, Alert Dialog, Badge, Empty State, Loader, Progress, Skeleton, Status Pill, Toast |
99
+ | Overlays and menus | Dialog, Sheet, Popover, Tooltip, Overlay, Lightbox, Context Menu, Dropdown Menu, Navigation Menu, Command |
100
+ | Navigation and disclosure | Accordion, Breadcrumb, Collapsible, Pagination, Stepper, Tabs, Table of Contents |
101
+ | Content | Activity Feed, Avatar, Avatar Group, Card, Clickable Card, Code Block, File Card, File Tree, Kbd, Link, Preview, Resizable, Scroll Area, Selectable Card, Separator, Stagger, Table, Text, Thumbnail, Prose, Bubble, Message, Message Scroller, Trace, Visually Hidden |
102
+
103
+ Each component page lists props, parts, and keyboard behavior. Start with [Button](https://zenos-ui.pages.dev/components/button/) or [Field](https://zenos-ui.pages.dev/components/field/).
104
+
105
+ ## Layout
106
+
107
+ Layout primitives arrange content and leave product styling to tokens and `className`. They forward refs and accept `className`, `style`, `aria-*`, and `data-*`. Polymorphic primitives take `as`. Responsive values use the shared breakpoints `base`, `sm`, `md`, `lg`, `xl`, and `2xl`. `GridSpan` takes content-oriented `columns` and `rows` values.
108
+
109
+ | Primitive | Responsibility |
110
+ | ------------------------------------------------------------------------ | --------------------------------------- |
111
+ | `AppShell`, `Header`, `SideNav` | Application frame and navigation |
112
+ | `Layout`, `LayoutHeader`, `LayoutContent`, `LayoutFooter`, `LayoutPanel` | Page regions |
113
+ | `Stack`, `HStack`, `VStack`, `StackItem` | Flow on one axis |
114
+ | `Grid`, `GridItem`, `GridSpan` | Columns, placement, and spans |
115
+ | `Center`, `Cluster`, `Container`, `Section`, `Box`, `AspectRatio` | Alignment, grouping, measure, and ratio |
116
+ | `FormLayout` | The grid around form controls |
117
+ | `Divider` | A visual break |
118
+
119
+ `HStack` and `VStack` keep alignment readable at the call site:
120
+
121
+ ```tsx
122
+ import { Button, HStack, VStack } from "@zentara-co/zenos-ui";
123
+
124
+ <VStack as="section" gap="6">
125
+ <HStack as="header" hAlign="between" vAlign="center" gap="2">
126
+ <h2>Profile</h2>
127
+ <Button>Edit</Button>
128
+ </HStack>
129
+ <p>Manage your personal information.</p>
130
+ </VStack>;
131
+ ```
132
+
133
+ ```tsx
134
+ import { Grid, GridSpan } from "@zentara-co/zenos-ui";
135
+
136
+ <Grid columns={{ base: 1, md: 4 }} gap="4">
137
+ <GridSpan as="article" columns={{ base: 1, md: 3 }}>
138
+ Main content
139
+ </GridSpan>
140
+ <GridSpan as="aside" columns={{ base: 1, md: 1 }}>
141
+ Supporting content
142
+ </GridSpan>
143
+ </Grid>;
144
+ ```
145
+
146
+ `Center` centers on one axis or both, including inline when it sits in text. `FormLayout` only structures the form. Labels, errors, and validation stay on `Field` and the application's form library.
147
+
148
+ Composition guide: [layout](https://zenos-ui.pages.dev/layout/composition/).
149
+
150
+ ## Hooks
151
+
152
+ | Export | Responsibility |
153
+ | ----------------- | --------------------------------------------------------------------------- |
154
+ | `useTheme` | Reads and writes color mode, with optional `localStorage` and document sync |
155
+ | `useMobileMode` | Reports whether the width is within the mobile range |
156
+ | `useTabletMode` | Reports tablet portrait and landscape ranges |
157
+ | `useDensity` | Reads `comfortable` or `compact` from the nearest `DensityProvider` |
158
+ | `useSideNav` | Reads side-navigation state inside `SideNav` |
159
+ | `useFieldContext` | Reads ids and invalid, required, and disabled state inside `Field` |
160
+
161
+ `useMobileMode` and `useTabletMode` follow viewport width. Pair them with the [breakpoint scale](https://zenos-ui.pages.dev/foundations/breakpoints/).
162
+
163
+ ## Theming and customization
164
+
165
+ ### Semantic tokens
166
+
167
+ Components use roles such as `background`, `surface`, `foreground`, `border`, and `primary`. Override CSS variables after the Zenos stylesheet to change the system, and use `className` or `style` for local composition. Semantic props such as `size`, `gap`, and `variant` accept documented values rather than Tailwind class strings.
168
+
169
+ See [tokens](https://zenos-ui.pages.dev/foundations/tokens/) for the role names and [motion](https://zenos-ui.pages.dev/foundations/motion/) for duration and easing tokens.
170
+
171
+ ### Light and dark mode
172
+
173
+ Dark styles respond to a `.dark` class or `data-theme="dark"` on the document root. `useTheme` and `ThemeToggleButton` can update and persist the preference. Their default storage key is `theme`.
174
+
175
+ Apply the stored preference before first paint, using the same key in your bootstrap script and theme control. When another provider owns the preference, use `storageKey={null}` to disable Zenos persistence. The hook also accepts `applyToDocument: false` when document synchronization belongs to that provider.
176
+
177
+ See [dark mode](https://zenos-ui.pages.dev/foundations/dark-mode/) for setup and framework examples.
178
+
179
+ ### Density
180
+
181
+ Use `DensityProvider` to scope `comfortable` or `compact` density to a region of the application:
182
+
183
+ ```tsx
184
+ import { DensityProvider, Input } from "@zentara-co/zenos-ui";
185
+
186
+ <DensityProvider density="compact">
187
+ <Input aria-label="Filter projects" placeholder="Filter projects" />
188
+ </DensityProvider>;
189
+ ```
190
+
191
+ Components that support density can read the nearest provider through `useDensity`. See [density](https://zenos-ui.pages.dev/foundations/density/) for the supported behavior.
192
+
193
+ ### Fonts
194
+
195
+ Zenos defines font stacks for SUSE, Albert Sans, and Geist Mono. Font files are not bundled. Load them through your framework, self-hosted assets, or a font provider; system fallbacks keep text readable when those files are absent. See [fonts](https://zenos-ui.pages.dev/foundations/fonts/) for weights and self-hosting.
196
+
197
+ ## API conventions
198
+
199
+ The same names recur across families. A component only implements the concepts that belong to it: a layout primitive has no `variant`, and a badge has no open state.
200
+
201
+ | Concept | Convention |
202
+ | ----------------------- | ------------------------------------------------------ |
203
+ | Layout polymorphism | `as` |
204
+ | Interactive composition | `render` |
205
+ | Value state | `value`, `defaultValue`, `onValueChange` |
206
+ | Open state | `open`, `defaultOpen`, `onOpenChange` |
207
+ | Native checked controls | `checked`, `defaultChecked`, `onCheckedChange` |
208
+ | Visual treatment | `variant` |
209
+ | Control size | `sm`, `md`, `lg` |
210
+ | Field state | `disabled`, `invalid`, `required` |
211
+ | DOM anatomy | stable `data-slot`, plus `data-size` or `data-variant` |
212
+ | Escape hatches | `className`, `style`, ARIA attributes, `data-*` |
213
+
214
+ Checked controls keep `checked` so their HTML `value` still means the submitted form value.
215
+
216
+ Use `as` to change the element rendered by a layout primitive. Use `render` to compose an interactive part with a Zenos control:
217
+
218
+ ```tsx
219
+ import { Box, Button, Dialog } from "@zentara-co/zenos-ui";
220
+
221
+ export function ProjectDetails() {
222
+ return (
223
+ <Box as="section">
224
+ <Dialog.Root>
225
+ <Dialog.Trigger render={<Button variant="outline" />}>View project</Dialog.Trigger>
226
+ <Dialog.Content>
227
+ <Dialog.Title>Project details</Dialog.Title>
228
+ <Dialog.Description>Review the project before making changes.</Dialog.Description>
229
+ <Dialog.Close>Close</Dialog.Close>
230
+ </Dialog.Content>
231
+ </Dialog.Root>
232
+ </Box>
233
+ );
234
+ }
235
+ ```
236
+
237
+ Preserve native attributes, refs, ARIA relationships, and keyboard behavior when composing controls. Provide accessible names for icon-only actions and associate form controls with labels. Each [component reference](https://zenos-ui.pages.dev/components/button/) documents its parts and interaction behavior.
238
+
239
+ ## Optional recipes
240
+
241
+ The companion `@zentara-co/zenos-cli` copies specialist components into your application as editable source and installs their additional dependencies. The copied files belong to your application. These engines are not baseline dependencies of the UI package.
242
+
243
+ Available recipes include animated numbers, animated labels, calendars and date pickers, carousels, charts, data tables, emoji pickers, file uploads, and time pickers.
244
+
245
+ ```bash
246
+ npx @zentara-co/zenos-cli add calendar --dry-run
247
+ npx @zentara-co/zenos-cli add calendar
248
+ npx @zentara-co/zenos-cli add data-table --dir src/components/ui
249
+ ```
250
+
251
+ Import recipes from the destination printed by the CLI, rather than from `@zentara-co/zenos-ui`. See the [recipe guides](https://zenos-ui.pages.dev/recipes/) and [CLI README](https://github.com/zentara-co/zenos/tree/main/packages/cli#readme) for the catalog, directory detection, and overwrite behavior.
252
+
253
+ ## Coding agents
254
+
255
+ The CLI can install managed instructions and query its bundled component catalog:
256
+
257
+ ```bash
258
+ npx @zentara-co/zenos-cli init --features agents
259
+ npx @zentara-co/zenos-cli component --list --dense
260
+ npx @zentara-co/zenos-cli component Dialog --dense
261
+ npx @zentara-co/zenos-cli docs api --dense
262
+ ```
263
+
264
+ An optional development workflow is available with `init --features skills`. When CLI and UI versions differ, verify exact APIs against the installed UI declarations. The docs also expose [llms.txt](https://zenos-ui.pages.dev/llms.txt) and [llms-full.txt](https://zenos-ui.pages.dev/llms-full.txt). See [working with AI](https://zenos-ui.pages.dev/getting-started/working-with-ai/) for setup.
265
+
266
+ ## Troubleshooting
267
+
268
+ - **Components appear unstyled:** check that your entry imports the local global CSS file, and that it imports one Zenos stylesheet.
269
+ - **Tailwind utilities or variants are missing:** use the Tailwind v4 entrypoint after `@import "tailwindcss"` instead of the compiled stylesheet.
270
+ - **Fonts look different from the docs:** load the font files; the package only defines the stacks.
271
+ - **Theme flashes on reload:** apply the saved preference before first paint and use the same storage key as the theme control.
272
+ - **Installation still requests GitHub credentials:** remove old `@zentara-co` GitHub Packages registry mappings and their token lines from project and user `.npmrc` files. Update lockfile entries that still resolve Zenos through GitHub Packages. If you use a custom default registry, add `@zentara-co:registry=https://registry.npmjs.org`.
273
+
274
+ ## Contributing
275
+
276
+ Development takes place in the [Zenos monorepo](https://github.com/zentara-co/zenos). Repository work requires Node.js 22.12 or newer and the pinned pnpm version through Corepack. Start with the repository's [agent guide](https://github.com/zentara-co/zenos/blob/main/AGENTS.md) and [frontend guidelines](https://github.com/zentara-co/zenos/blob/main/docs/AI_FRONTEND_GUIDELINES.md).
277
+
278
+ From the repository root:
279
+
280
+ ```bash
281
+ corepack enable
282
+ pnpm install
283
+ pnpm build:ui
284
+ pnpm --filter @zentara-co/zenos-ui typecheck
285
+ pnpm --filter @zentara-co/zenos-ui test
286
+ ```
287
+
288
+ The [root README](https://github.com/zentara-co/zenos#readme) covers docs development, repository-wide checks, and releases. Public API or behavior changes need a changeset.
27
289
 
28
- See the [documentation](https://zenos-ui.pages.dev) for installation, component
29
- APIs, themes, and framework setup. Optional recipes are installed through
30
- [@zentara-co/zenos-cli](https://www.npmjs.com/package/@zentara-co/zenos-cli).
290
+ ## License
31
291
 
32
- MIT licensed.
292
+ MIT. See [LICENSE](https://github.com/zentara-co/zenos/blob/main/LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zentara-co/zenos-ui",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Zenos React UI kit",
5
5
  "license": "MIT",
6
6
  "repository": {