@xzibit/ui 0.1.1 → 0.2.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 +16 -0
- package/README.md +1 -0
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +48 -1
- package/dist/index.d.ts +48 -1
- package/dist/index.js +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@xzibit/ui` are documented here. Format follows [Keep a Changelog](https://keepachangelog.com/) loosely; versioning follows [SemVer](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [0.2.0] — 2026-05-24
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **`<ContentContainer tier="...">`** — implements DESIGN-STANDARD v2.4 §Content Density Tiers. Three tiers: `'editorial'` (720px), `'reference'` (1200px, DEFAULT), `'data'` (unconstrained with 32px side padding). Drop-in wrapper for `<main>` content. Per-page overrides via `tier` prop.
|
|
10
|
+
- **`ContentTier`** type exported for app authors wanting to type tier props at their own layer.
|
|
11
|
+
|
|
12
|
+
### Coming next
|
|
13
|
+
|
|
14
|
+
- `<Toast />` + `useToast()` — wrapper around `sonner` per DESIGN-STANDARD §Toast / Notification (v2.2). Will ship as v0.2.1 once drafted.
|
|
15
|
+
- `<Modal />` — wrapper around `@radix-ui/react-dialog` per DESIGN-STANDARD §Modal / Dialog (v2.2). Will ship as v0.2.2 once drafted.
|
|
16
|
+
|
|
17
|
+
(Joel chose Option A 2026-05-24 — fast-ship v0.2.0 with just ContentContainer to unblock portfolio-wide adoption of the new content tier system. Toast + Modal ship as subsequent patches.)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
5
21
|
## [0.1.1] — 2026-05-24
|
|
6
22
|
|
|
7
23
|
### Fixed
|
package/README.md
CHANGED
|
@@ -146,6 +146,7 @@ This sets `--xz-charcoal`, `--xz-teal`, `--xz-white`, `--border`, etc. — and `
|
|
|
146
146
|
| `<AppsDropdown />` | Sectioned + alphabetical apps dropdown driven by `/api/me/apps` |
|
|
147
147
|
| `<XzibitMark size={28} />` | Xzibit X brand mark as inline SVG (any size, any density) |
|
|
148
148
|
| `useApps()` | React hook fetching `/api/me/apps` with loading + error + refetch |
|
|
149
|
+
| `<ContentContainer tier="reference">` *(v0.2+)* | Content max-width container per DESIGN-STANDARD v2.4 §Content Density Tiers — tiers: `'editorial'` (720px), `'reference'` (1200px, default), `'data'` (unconstrained). Wraps `<main>` content. |
|
|
149
150
|
|
|
150
151
|
---
|
|
151
152
|
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AppsDropdown: () => AppsDropdown,
|
|
24
24
|
BackToLauncher: () => BackToLauncher,
|
|
25
|
+
ContentContainer: () => ContentContainer,
|
|
25
26
|
TopBar: () => TopBar,
|
|
26
27
|
XzibitMark: () => XzibitMark,
|
|
27
28
|
normalizeApp: () => normalizeApp,
|
|
@@ -559,10 +560,26 @@ function BuildBadge({
|
|
|
559
560
|
}
|
|
560
561
|
);
|
|
561
562
|
}
|
|
563
|
+
|
|
564
|
+
// src/ContentContainer.tsx
|
|
565
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
566
|
+
var TIER_STYLES = {
|
|
567
|
+
editorial: { maxWidth: 720, margin: "0 auto", padding: "3rem 2rem" },
|
|
568
|
+
reference: { maxWidth: 1200, margin: "0 auto", padding: "3rem 2rem" },
|
|
569
|
+
data: { maxWidth: "100%", margin: "0 auto", padding: "1.5rem 2rem" }
|
|
570
|
+
};
|
|
571
|
+
function ContentContainer({
|
|
572
|
+
tier = "reference",
|
|
573
|
+
className,
|
|
574
|
+
children
|
|
575
|
+
}) {
|
|
576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className, style: TIER_STYLES[tier], children });
|
|
577
|
+
}
|
|
562
578
|
// Annotate the CommonJS export names for ESM import in node:
|
|
563
579
|
0 && (module.exports = {
|
|
564
580
|
AppsDropdown,
|
|
565
581
|
BackToLauncher,
|
|
582
|
+
ContentContainer,
|
|
566
583
|
TopBar,
|
|
567
584
|
XzibitMark,
|
|
568
585
|
normalizeApp,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
interface TopBarProps {
|
|
4
5
|
/** App display name shown in the wordmark slot (e.g. "ERP Overview"). */
|
|
@@ -181,4 +182,50 @@ interface UseAppsOptions {
|
|
|
181
182
|
*/
|
|
182
183
|
declare function useApps(options?: UseAppsOptions): UseAppsResult;
|
|
183
184
|
|
|
184
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Content density tier per DESIGN-STANDARD v2.4 §Content Density Tiers.
|
|
187
|
+
*
|
|
188
|
+
* - `'editorial'`: 720px max-width — marketing / public-facing docs / long-form prose
|
|
189
|
+
* - `'reference'` (DEFAULT): 1200px max-width — internal docs / wikis / dashboards / most app pages
|
|
190
|
+
* - `'data'`: unconstrained with 32px min side padding — wide tables / kanban / calendars / heatmaps
|
|
191
|
+
*/
|
|
192
|
+
type ContentTier = 'editorial' | 'reference' | 'data';
|
|
193
|
+
interface ContentContainerProps {
|
|
194
|
+
/**
|
|
195
|
+
* Content density tier — picks max-width + padding.
|
|
196
|
+
* Defaults to `'reference'` (the portfolio default per v2.4).
|
|
197
|
+
*/
|
|
198
|
+
tier?: ContentTier;
|
|
199
|
+
/** Optional className for additional styling. */
|
|
200
|
+
className?: string;
|
|
201
|
+
/** Children to render inside the container. */
|
|
202
|
+
children: ReactNode;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Content container that applies the right max-width + padding for its content
|
|
206
|
+
* density tier per DESIGN-STANDARD v2.4 §Content Density Tiers.
|
|
207
|
+
*
|
|
208
|
+
* Per the spec:
|
|
209
|
+
* - Component override > page override > app default (most-specific wins)
|
|
210
|
+
* - Cards INHERIT the parent container's max-width — they do NOT set their own
|
|
211
|
+
*
|
|
212
|
+
* Typical app usage in `src/app/layout.tsx`:
|
|
213
|
+
*
|
|
214
|
+
* ```tsx
|
|
215
|
+
* <main id="main" style={{ marginTop: 44 }}>
|
|
216
|
+
* <ContentContainer>{children}</ContentContainer>
|
|
217
|
+
* </main>
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* Per-page override (rare):
|
|
221
|
+
*
|
|
222
|
+
* ```tsx
|
|
223
|
+
* // A wide-table page within an otherwise-reference app
|
|
224
|
+
* <ContentContainer tier="data">
|
|
225
|
+
* <DataTable ... />
|
|
226
|
+
* </ContentContainer>
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
declare function ContentContainer({ tier, className, children, }: ContentContainerProps): react_jsx_runtime.JSX.Element;
|
|
230
|
+
|
|
231
|
+
export { type App, AppsDropdown, type AppsDropdownProps, type AppsResponse, BackToLauncher, type BackToLauncherProps, ContentContainer, type ContentContainerProps, type ContentTier, type RawApp, TopBar, type TopBarProps, type UseAppsOptions, type UseAppsResult, XzibitMark, type XzibitMarkProps, normalizeApp, useApps };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
interface TopBarProps {
|
|
4
5
|
/** App display name shown in the wordmark slot (e.g. "ERP Overview"). */
|
|
@@ -181,4 +182,50 @@ interface UseAppsOptions {
|
|
|
181
182
|
*/
|
|
182
183
|
declare function useApps(options?: UseAppsOptions): UseAppsResult;
|
|
183
184
|
|
|
184
|
-
|
|
185
|
+
/**
|
|
186
|
+
* Content density tier per DESIGN-STANDARD v2.4 §Content Density Tiers.
|
|
187
|
+
*
|
|
188
|
+
* - `'editorial'`: 720px max-width — marketing / public-facing docs / long-form prose
|
|
189
|
+
* - `'reference'` (DEFAULT): 1200px max-width — internal docs / wikis / dashboards / most app pages
|
|
190
|
+
* - `'data'`: unconstrained with 32px min side padding — wide tables / kanban / calendars / heatmaps
|
|
191
|
+
*/
|
|
192
|
+
type ContentTier = 'editorial' | 'reference' | 'data';
|
|
193
|
+
interface ContentContainerProps {
|
|
194
|
+
/**
|
|
195
|
+
* Content density tier — picks max-width + padding.
|
|
196
|
+
* Defaults to `'reference'` (the portfolio default per v2.4).
|
|
197
|
+
*/
|
|
198
|
+
tier?: ContentTier;
|
|
199
|
+
/** Optional className for additional styling. */
|
|
200
|
+
className?: string;
|
|
201
|
+
/** Children to render inside the container. */
|
|
202
|
+
children: ReactNode;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Content container that applies the right max-width + padding for its content
|
|
206
|
+
* density tier per DESIGN-STANDARD v2.4 §Content Density Tiers.
|
|
207
|
+
*
|
|
208
|
+
* Per the spec:
|
|
209
|
+
* - Component override > page override > app default (most-specific wins)
|
|
210
|
+
* - Cards INHERIT the parent container's max-width — they do NOT set their own
|
|
211
|
+
*
|
|
212
|
+
* Typical app usage in `src/app/layout.tsx`:
|
|
213
|
+
*
|
|
214
|
+
* ```tsx
|
|
215
|
+
* <main id="main" style={{ marginTop: 44 }}>
|
|
216
|
+
* <ContentContainer>{children}</ContentContainer>
|
|
217
|
+
* </main>
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* Per-page override (rare):
|
|
221
|
+
*
|
|
222
|
+
* ```tsx
|
|
223
|
+
* // A wide-table page within an otherwise-reference app
|
|
224
|
+
* <ContentContainer tier="data">
|
|
225
|
+
* <DataTable ... />
|
|
226
|
+
* </ContentContainer>
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
declare function ContentContainer({ tier, className, children, }: ContentContainerProps): react_jsx_runtime.JSX.Element;
|
|
230
|
+
|
|
231
|
+
export { type App, AppsDropdown, type AppsDropdownProps, type AppsResponse, BackToLauncher, type BackToLauncherProps, ContentContainer, type ContentContainerProps, type ContentTier, type RawApp, TopBar, type TopBarProps, type UseAppsOptions, type UseAppsResult, XzibitMark, type XzibitMarkProps, normalizeApp, useApps };
|
package/dist/index.js
CHANGED
|
@@ -528,9 +528,25 @@ function BuildBadge({
|
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
530
|
}
|
|
531
|
+
|
|
532
|
+
// src/ContentContainer.tsx
|
|
533
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
534
|
+
var TIER_STYLES = {
|
|
535
|
+
editorial: { maxWidth: 720, margin: "0 auto", padding: "3rem 2rem" },
|
|
536
|
+
reference: { maxWidth: 1200, margin: "0 auto", padding: "3rem 2rem" },
|
|
537
|
+
data: { maxWidth: "100%", margin: "0 auto", padding: "1.5rem 2rem" }
|
|
538
|
+
};
|
|
539
|
+
function ContentContainer({
|
|
540
|
+
tier = "reference",
|
|
541
|
+
className,
|
|
542
|
+
children
|
|
543
|
+
}) {
|
|
544
|
+
return /* @__PURE__ */ jsx5("div", { className, style: TIER_STYLES[tier], children });
|
|
545
|
+
}
|
|
531
546
|
export {
|
|
532
547
|
AppsDropdown,
|
|
533
548
|
BackToLauncher,
|
|
549
|
+
ContentContainer,
|
|
534
550
|
TopBar,
|
|
535
551
|
XzibitMark,
|
|
536
552
|
normalizeApp,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xzibit/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared chrome components for the Xzibit Apps portfolio. v0.1: TopBar + BackToLauncher + AppsDropdown + XzibitMark + useApps hook. Single source of truth for portfolio chrome — tweak once, every app picks it up on next deploy.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Xzibit Apps",
|