@cueplusplus/ui 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/CHANGELOG.md +21 -0
- package/dist/brand/_chassis.d.ts +1 -1
- package/dist/brand/cue-mark.d.ts +1 -1
- package/dist/brand/cue-mark.js +1 -1
- package/dist/chrome/_edge-scroller.js +12 -1
- package/dist/chrome/_tabs-scroll.d.ts +1 -1
- package/dist/chrome/_tabs-scroll.js +1 -1
- package/dist/configurator/_overrides.js +18 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/instruments/index.d.ts +2 -2
- package/dist/instruments/index.js +2 -2
- package/dist/instruments/table.d.ts +14 -1
- package/dist/instruments/table.js +20 -1
- package/dist/primitives/chip.d.ts +1 -1
- package/dist/styles.css +11 -1
- package/dist/system/index.d.ts +3 -3
- package/dist/system/portal.js +19 -5
- package/dist/system/prepaint.d.ts +20 -2
- package/dist/system/prepaint.js +39 -33
- package/dist/system/theme-provider.d.ts +13 -2
- package/dist/system/theme-provider.js +56 -20
- package/dist/theming/_presets.js +53 -0
- package/dist/theming/create-theme.d.ts +2 -2
- package/dist/theming/create-theme.js +24 -15
- package/dist/theming/serialize.d.ts +1 -1
- package/dist/theming/serialize.js +25 -1
- package/manifest/components/accordion.json +154 -0
- package/manifest/components/agent-pile.json +116 -0
- package/manifest/components/alert-dialog.json +190 -0
- package/manifest/components/app-bar.json +244 -0
- package/manifest/components/app-shell.json +291 -0
- package/manifest/components/app-window-frame.json +102 -0
- package/manifest/components/ask-box.json +209 -0
- package/manifest/components/autocomplete.json +197 -0
- package/manifest/components/avatar-group.json +72 -0
- package/manifest/components/avatar.json +95 -0
- package/manifest/components/breadcrumb.json +74 -0
- package/manifest/components/button-group.json +74 -0
- package/manifest/components/button.json +125 -0
- package/manifest/components/calendar.json +65 -0
- package/manifest/components/card.json +140 -0
- package/manifest/components/carousel.json +200 -0
- package/manifest/components/channel-matrix.json +173 -0
- package/manifest/components/chart-container.json +111 -0
- package/manifest/components/chart-ramp.json +72 -0
- package/manifest/components/chart-swatch.json +65 -0
- package/manifest/components/chart-tooltip-content.json +114 -0
- package/manifest/components/checkbox-group.json +68 -0
- package/manifest/components/checkbox.json +93 -0
- package/manifest/components/chip.json +132 -0
- package/manifest/components/collapsible.json +120 -0
- package/manifest/components/color-area.json +59 -0
- package/manifest/components/color-field.json +79 -0
- package/manifest/components/color-picker.json +175 -0
- package/manifest/components/color-slider.json +75 -0
- package/manifest/components/color-swatch.json +68 -0
- package/manifest/components/colors-section.json +66 -0
- package/manifest/components/combobox.json +198 -0
- package/manifest/components/command-palette.json +177 -0
- package/manifest/components/composer.json +176 -0
- package/manifest/components/container.json +60 -0
- package/manifest/components/context-menu.json +121 -0
- package/manifest/components/copy-button.json +93 -0
- package/manifest/components/cue-logotype.json +96 -0
- package/manifest/components/cue-mark.json +97 -0
- package/manifest/components/cue-portal-frame.json +55 -0
- package/manifest/components/data-table-pagination.json +83 -0
- package/manifest/components/data-table-toolbar.json +104 -0
- package/manifest/components/date-field.json +80 -0
- package/manifest/components/date-picker.json +191 -0
- package/manifest/components/date-range-picker.json +191 -0
- package/manifest/components/delegation-card.json +144 -0
- package/manifest/components/density.json +58 -0
- package/manifest/components/description-list.json +84 -0
- package/manifest/components/dialog.json +198 -0
- package/manifest/components/disclosure.json +109 -0
- package/manifest/components/dmx-bar.json +94 -0
- package/manifest/components/dmx-strip.json +101 -0
- package/manifest/components/drawer.json +179 -0
- package/manifest/components/dropdown-menu.json +229 -0
- package/manifest/components/empty-state.json +90 -0
- package/manifest/components/env-var-input.json +150 -0
- package/manifest/components/export-dialog.json +84 -0
- package/manifest/components/eyebrow.json +56 -0
- package/manifest/components/field-description.json +63 -0
- package/manifest/components/field-error.json +77 -0
- package/manifest/components/field-label.json +63 -0
- package/manifest/components/field.json +79 -0
- package/manifest/components/file-upload.json +159 -0
- package/manifest/components/flow-background.json +50 -0
- package/manifest/components/flow-controls.json +50 -0
- package/manifest/components/footer.json +112 -0
- package/manifest/components/grid.json +81 -0
- package/manifest/components/group-bar.json +102 -0
- package/manifest/components/hover-card.json +151 -0
- package/manifest/components/icon-button.json +88 -0
- package/manifest/components/info-tip.json +98 -0
- package/manifest/components/input-group.json +91 -0
- package/manifest/components/input.json +89 -0
- package/manifest/components/item.json +129 -0
- package/manifest/components/kbd.json +52 -0
- package/manifest/components/link.json +81 -0
- package/manifest/components/log-viewer.json +139 -0
- package/manifest/components/menubar.json +157 -0
- package/manifest/components/message-list.json +100 -0
- package/manifest/components/message.json +116 -0
- package/manifest/components/meter.json +114 -0
- package/manifest/components/multi-select.json +190 -0
- package/manifest/components/musical-time-input.json +113 -0
- package/manifest/components/navigation-menu.json +226 -0
- package/manifest/components/node-card.json +109 -0
- package/manifest/components/node-handle.json +69 -0
- package/manifest/components/number-field.json +107 -0
- package/manifest/components/otp-field.json +128 -0
- package/manifest/components/page-shell.json +96 -0
- package/manifest/components/pagination.json +92 -0
- package/manifest/components/panel-header.json +77 -0
- package/manifest/components/panel.json +71 -0
- package/manifest/components/password-input.json +119 -0
- package/manifest/components/piano-keyboard.json +120 -0
- package/manifest/components/plussie.json +111 -0
- package/manifest/components/popover.json +193 -0
- package/manifest/components/preset-section.json +73 -0
- package/manifest/components/progress.json +95 -0
- package/manifest/components/radio-group.json +73 -0
- package/manifest/components/radio.json +80 -0
- package/manifest/components/rating.json +141 -0
- package/manifest/components/resizable.json +88 -0
- package/manifest/components/row.json +109 -0
- package/manifest/components/scroll-area.json +91 -0
- package/manifest/components/scrollable-tabs-list.json +83 -0
- package/manifest/components/scrub-input.json +200 -0
- package/manifest/components/seam-cell.json +75 -0
- package/manifest/components/seam-grid.json +75 -0
- package/manifest/components/seam-list.json +56 -0
- package/manifest/components/search-input.json +134 -0
- package/manifest/components/section-header.json +112 -0
- package/manifest/components/segmented-control.json +138 -0
- package/manifest/components/select.json +194 -0
- package/manifest/components/separator.json +53 -0
- package/manifest/components/shape-section.json +66 -0
- package/manifest/components/sheet.json +186 -0
- package/manifest/components/sidebar.json +198 -0
- package/manifest/components/signal-edge.json +56 -0
- package/manifest/components/skeleton.json +46 -0
- package/manifest/components/slider.json +89 -0
- package/manifest/components/sparkline.json +76 -0
- package/manifest/components/spectrum-visualizer.json +115 -0
- package/manifest/components/spinner.json +61 -0
- package/manifest/components/stack.json +96 -0
- package/manifest/components/stat.json +87 -0
- package/manifest/components/status-bar.json +58 -0
- package/manifest/components/status-dot.json +78 -0
- package/manifest/components/stepper.json +89 -0
- package/manifest/components/switch.json +87 -0
- package/manifest/components/table-scroll-region.json +69 -0
- package/manifest/components/table.json +155 -0
- package/manifest/components/tabs.json +145 -0
- package/manifest/components/tags-input.json +190 -0
- package/manifest/components/terminal-frame.json +119 -0
- package/manifest/components/textarea.json +76 -0
- package/manifest/components/theme-configurator.json +124 -0
- package/manifest/components/theme-provider.json +134 -0
- package/manifest/components/threshold-rail.json +160 -0
- package/manifest/components/time-field.json +80 -0
- package/manifest/components/timeline-ruler.json +139 -0
- package/manifest/components/timeline.json +115 -0
- package/manifest/components/title-bar.json +82 -0
- package/manifest/components/toast.json +130 -0
- package/manifest/components/toggle-group.json +106 -0
- package/manifest/components/toggle.json +109 -0
- package/manifest/components/token-editor.json +90 -0
- package/manifest/components/toolbar.json +163 -0
- package/manifest/components/tooltip.json +164 -0
- package/manifest/components/tree-visibility-toggle.json +84 -0
- package/manifest/components/tree.json +140 -0
- package/manifest/components/two-step-button.json +113 -0
- package/manifest/components/universe-grid.json +127 -0
- package/manifest/components/usage-chart.json +124 -0
- package/manifest/manifest.json +2142 -0
- package/manifest/tokens.json +138 -0
- package/package.json +11 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @cueplusplus/ui
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 31e3607: Ship the linked RequestPort preset release across tokens, UI, and brand tokens.
|
|
8
|
+
|
|
9
|
+
The release adds the typed RequestPort preset and its generated dark, light, and
|
|
10
|
+
system selectors; system SSR, prepaint, provider, and portal behavior; the
|
|
11
|
+
`persistPreferences={false}` and authoritative prepaint options contracts; the
|
|
12
|
+
typed `fontFamilies` provider/portal override; the deterministic package
|
|
13
|
+
manifest and companion checksums; and the accessible `TableScrollRegion`.
|
|
14
|
+
|
|
15
|
+
All three linked tarballs receive the same minor version and changelog entry.
|
|
16
|
+
The Version Packages path regenerates the package manifest after applying those
|
|
17
|
+
versions and rejects stale or nondeterministic output before publication.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [31e3607]
|
|
22
|
+
- @cueplusplus/tokens@0.3.0
|
|
23
|
+
|
|
3
24
|
## 0.2.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/dist/brand/_chassis.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ type BrandSize = "sm" | "md" | "lg";
|
|
|
22
22
|
*
|
|
23
23
|
* Not a light/dark pair. The source artwork ships two files that hard-code
|
|
24
24
|
* `white`, `black` and `#1E1E1E`; this library ships one component that reads
|
|
25
|
-
* the token layer, so a single element is correct in all
|
|
25
|
+
* the token layer, so a single element is correct in all ten presets and both
|
|
26
26
|
* modes without anybody choosing a file.
|
|
27
27
|
*/
|
|
28
28
|
type BrandTone = "inherit" | "fg" | "accent";
|
package/dist/brand/cue-mark.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface CueMarkProps extends BrandAssetProps {}
|
|
|
8
8
|
* Square at every size, drawn from the artwork's own path data, and painted
|
|
9
9
|
* entirely from tokens — the disc takes the tone's ink and the two "+" glyphs
|
|
10
10
|
* take the ground, which is exactly the relationship the two shipped SVGs
|
|
11
|
-
* encode by hand. One element is therefore correct in all
|
|
11
|
+
* encode by hand. One element is therefore correct in all ten presets and
|
|
12
12
|
* both modes, and there is no light/dark variant to pick.
|
|
13
13
|
*
|
|
14
14
|
* The two glyphs are {@link Plussie}'s eyes; both components read one geometry
|
package/dist/brand/cue-mark.js
CHANGED
|
@@ -10,7 +10,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
* Square at every size, drawn from the artwork's own path data, and painted
|
|
11
11
|
* entirely from tokens — the disc takes the tone's ink and the two "+" glyphs
|
|
12
12
|
* take the ground, which is exactly the relationship the two shipped SVGs
|
|
13
|
-
* encode by hand. One element is therefore correct in all
|
|
13
|
+
* encode by hand. One element is therefore correct in all ten presets and
|
|
14
14
|
* both modes, and there is no light/dark variant to pick.
|
|
15
15
|
*
|
|
16
16
|
* The two glyphs are {@link Plussie}'s eyes; both components read one geometry
|
|
@@ -52,9 +52,20 @@ function useEdgeScroll(enabled = true) {
|
|
|
52
52
|
el.addEventListener("scroll", sync, { passive: true });
|
|
53
53
|
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => sync());
|
|
54
54
|
observer?.observe(el);
|
|
55
|
-
|
|
55
|
+
let observedChildren = /* @__PURE__ */ new Set();
|
|
56
|
+
const syncObservedChildren = () => {
|
|
57
|
+
const nextChildren = new Set(el.children);
|
|
58
|
+
for (const child of observedChildren) if (!nextChildren.has(child)) observer?.unobserve(child);
|
|
59
|
+
for (const child of nextChildren) if (!observedChildren.has(child)) observer?.observe(child);
|
|
60
|
+
observedChildren = nextChildren;
|
|
61
|
+
sync();
|
|
62
|
+
};
|
|
63
|
+
syncObservedChildren();
|
|
64
|
+
const mutations = typeof MutationObserver === "undefined" ? null : new MutationObserver(() => syncObservedChildren());
|
|
65
|
+
mutations?.observe(el, { childList: true });
|
|
56
66
|
return () => {
|
|
57
67
|
el.removeEventListener("scroll", sync);
|
|
68
|
+
mutations?.disconnect();
|
|
58
69
|
observer?.disconnect();
|
|
59
70
|
};
|
|
60
71
|
}, [enabled, sync]);
|
|
@@ -50,7 +50,7 @@ declare function computeScrollEdges(scrollLeft: number, scrollWidth: number, cli
|
|
|
50
50
|
* an overlay would have to re-create that background as an opaque colour and
|
|
51
51
|
* would drift the moment the theme changed. Masking fades the content itself
|
|
52
52
|
* and lets whatever is behind show through, so it matches by construction in
|
|
53
|
-
*
|
|
53
|
+
* every theme and both modes.
|
|
54
54
|
*
|
|
55
55
|
* This softens the cut; it is NOT the whole affordance. What sits at an
|
|
56
56
|
* overflowing edge is often the gap between two tabs, and fading empty space is
|
|
@@ -53,7 +53,7 @@ function computeScrollEdges(scrollLeft, scrollWidth, clientWidth) {
|
|
|
53
53
|
* an overlay would have to re-create that background as an opaque colour and
|
|
54
54
|
* would drift the moment the theme changed. Masking fades the content itself
|
|
55
55
|
* and lets whatever is behind show through, so it matches by construction in
|
|
56
|
-
*
|
|
56
|
+
* every theme and both modes.
|
|
57
57
|
*
|
|
58
58
|
* This softens the cut; it is NOT the whole affordance. What sits at an
|
|
59
59
|
* overflowing edge is often the gap between two tabs, and fading empty space is
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BASE_FONT_STACKS, DEFAULT_DENSITY_LEVEL, DENSITY_RADIUS_SCALE, THEME_COLOR_TOKENS, THEME_PRESETS } from "../theming/_presets.js";
|
|
2
|
-
import { THEME_NAME_PATTERN, assertCssValue, serializeThemeBlock, tokenProperty } from "../theming/serialize.js";
|
|
2
|
+
import { THEME_NAME_PATTERN, assertCssValue, serializeSystemModeAliases, serializeThemeBlock, tokenProperty } from "../theming/serialize.js";
|
|
3
3
|
//#region src/configurator/_overrides.ts
|
|
4
4
|
/**
|
|
5
5
|
* The override model behind the theme configurator: what a user may move, where
|
|
@@ -338,17 +338,23 @@ const INLINE_COMMENT = "the provider inlines this one; !important is the only le
|
|
|
338
338
|
*/
|
|
339
339
|
function serializeOverrideCss(overrides, options = {}) {
|
|
340
340
|
const blocks = [];
|
|
341
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
341
342
|
for (const key of Object.keys(overrides.themes).toSorted()) {
|
|
342
343
|
const scope = parseScopeKey(key);
|
|
343
344
|
const declarations = orderedDeclarations(overrides.themes[key] ?? {});
|
|
344
345
|
if (scope === null || declarations.length === 0) continue;
|
|
346
|
+
const sections = [{
|
|
347
|
+
comment: blocks.length === 0 ? THEME_COMMENT : void 0,
|
|
348
|
+
declarations
|
|
349
|
+
}];
|
|
345
350
|
blocks.push({
|
|
346
351
|
selector: overrideSelector(scope.theme, scope.mode),
|
|
347
|
-
sections
|
|
348
|
-
comment: blocks.length === 0 ? THEME_COMMENT : void 0,
|
|
349
|
-
declarations
|
|
350
|
-
}]
|
|
352
|
+
sections
|
|
351
353
|
});
|
|
354
|
+
aliases.set(scope.theme, [...aliases.get(scope.theme) ?? [], {
|
|
355
|
+
mode: scope.mode,
|
|
356
|
+
sections
|
|
357
|
+
}]);
|
|
352
358
|
}
|
|
353
359
|
const global = orderedDeclarations(overrides.global);
|
|
354
360
|
const scaledDeclarations = global.filter(([property]) => tokenKind(property) === "scaled");
|
|
@@ -376,7 +382,13 @@ function serializeOverrideCss(overrides, options = {}) {
|
|
|
376
382
|
}]
|
|
377
383
|
});
|
|
378
384
|
if (blocks.length === 0) return "";
|
|
379
|
-
|
|
385
|
+
const banner = options.banner === void 0 ? [] : [`/*! ${options.banner}\n * Written by <ThemeConfigurator>. Paste it, do not edit it.\n */`];
|
|
386
|
+
const systemAliases = [...aliases.entries()].map(([theme, modes]) => serializeSystemModeAliases(theme, modes));
|
|
387
|
+
return `${[
|
|
388
|
+
...banner,
|
|
389
|
+
...blocks.map(serializeThemeBlock),
|
|
390
|
+
...systemAliases
|
|
391
|
+
].join("\n\n")}\n`;
|
|
380
392
|
}
|
|
381
393
|
/**
|
|
382
394
|
* The stylesheet the panel applies — and, byte for byte, the one its CSS export
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { Tree, TreeProps, TreeVisibility, TreeVisibilityToggle, TreeVisibilityTo
|
|
|
32
32
|
import { Toolbar, ToolbarButtonProps, ToolbarGroupProps, ToolbarRootProps, ToolbarSeparatorProps } from "./chrome/toolbar.js";
|
|
33
33
|
import "./chrome/index.js";
|
|
34
34
|
import { ControlVariantProps, FormControlSize, bareControlClasses, controlClasses, controlGroupFocusClasses, controlSurface, controlVariants } from "./forms/_chassis.js";
|
|
35
|
-
import { ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps } from "./system/theme-provider.js";
|
|
35
|
+
import { FontFamilies, ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps } from "./system/theme-provider.js";
|
|
36
36
|
import { Autocomplete, AutocompleteProps } from "./forms/autocomplete.js";
|
|
37
37
|
import { ButtonGroup, ButtonGroupOrientation, ButtonGroupProps } from "./forms/button-group.js";
|
|
38
38
|
import { Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps } from "./forms/checkbox.js";
|
|
@@ -72,7 +72,7 @@ import { Progress, ProgressProps } from "./instruments/progress.js";
|
|
|
72
72
|
import { SeamCell, SeamCellProps, SeamGrid, SeamGridProps, SeamGround } from "./instruments/seam-grid.js";
|
|
73
73
|
import { Sparkline, SparklineProps } from "./instruments/sparkline.js";
|
|
74
74
|
import { Stat, StatProps, StatTone } from "./instruments/stat.js";
|
|
75
|
-
import { Table, TableCaptionProps, TableCellProps, TableHeadProps, TableRootProps, TableRowProps, TableSectionProps } from "./instruments/table.js";
|
|
75
|
+
import { Table, TableCaptionProps, TableCellProps, TableHeadProps, TableRootProps, TableRowProps, TableScrollRegion, TableScrollRegionProps, TableSectionProps } from "./instruments/table.js";
|
|
76
76
|
import { TerminalFrame, TerminalFrameLine, TerminalFrameProps, TerminalLine, TerminalLineTone, TerminalScript, TerminalStep } from "./instruments/terminal-frame.js";
|
|
77
77
|
import { TwoStepButton, TwoStepButtonProps, TwoStepTone } from "./instruments/two-step-button.js";
|
|
78
78
|
import { UsageChart, UsageChartPoint, UsageChartProps, UsageChartTone } from "./instruments/usage-chart.js";
|
|
@@ -114,8 +114,8 @@ import { Spinner, SpinnerProps } from "./primitives/spinner.js";
|
|
|
114
114
|
import "./primitives/index.js";
|
|
115
115
|
import { Density, DensityProps } from "./system/density.js";
|
|
116
116
|
import { CuePortalFrame, CuePortalFrameProps, useCuePortalProps } from "./system/portal.js";
|
|
117
|
-
import { DEFAULT_STORAGE_KEY, PersistedPreferences, prepaintScript } from "./system/prepaint.js";
|
|
117
|
+
import { DEFAULT_STORAGE_KEY, PersistedPreferences, PrepaintDefaults, PrepaintOptions, prepaintScript } from "./system/prepaint.js";
|
|
118
118
|
import { ControlSize, useControlHeight, useDensity } from "./system/use-density.js";
|
|
119
119
|
import { useTheme } from "./system/use-theme.js";
|
|
120
120
|
import { DensityLevel, FontName, Mode, ThemeName } from "./system/index.js";
|
|
121
|
-
export { AGENT_COLOR_PROPERTY, AGENT_HUES, AGENT_ROOT_COLOR, Accordion, type AccordionHeaderProps, type AccordionItemProps, type AccordionPanelProps, type AccordionRootProps, type AccordionTriggerProps, type AgentColorOptions, AgentPile, type AgentPileEntry, type AgentPileProps, type AgentPileSize, AlertDialog, type AlertDialogActionProps, type AlertDialogCancelProps, type AlertDialogContentProps, type AlertDialogDescriptionProps, type AlertDialogFooterProps, type AlertDialogRootProps, type AlertDialogTitleProps, type AlertDialogTriggerProps, AppBar, type AppBarActionsProps, type AppBarBrandProps, type AppBarLinkProps, type AppBarNavProps, type AppBarRegister, type AppBarRootProps, type AppBarSeparatorProps, AppShell, type AppShellAsideProps, type AppShellBodyProps, type AppShellContentProps, type AppShellNavTriggerProps, type AppShellRootProps, type AppShellScrollerProps, type AppShellSidebarProps, AppWindowFrame, type AppWindowFrameProps, type AskAnswer, AskBox, type AskBoxProps, type AskDanger, type AskKind, type AskOption, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type BarOverflow, type BrandAssetProps, type BrandSize, type BrandTone, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonProps, Card, type CardContentProps, type CardDescriptionProps, type CardFooterProps, type CardHeaderProps, type CardRootProps, type CardTitleProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipProps, Collapsible, type CollapsiblePanelProps, type CollapsibleRootProps, type CollapsibleTriggerProps, Combobox, type ComboboxOption, type ComboboxProps, CommandPalette, type CommandPaletteItem, type CommandPaletteProps, Composer, type ComposerProps, type ComposerSubmitKey, Container, type ContainerProps, type ContainerWidth, ContextMenu, type ContextMenuContentProps, type ContextMenuRootProps, type ContextMenuTriggerProps, type ControlSize, type ControlVariantProps, CopyButton, type CopyButtonProps, CueLogotype, type CueLogotypeProps, CueMark, type CueMarkProps, CuePortalFrame, type CuePortalFrameProps, DEFAULT_STORAGE_KEY, DelegationCard, type DelegationCardProps, type DelegationDirection, type DelegationStatus, Density, type DensityLevel, type DensityProps, DescriptionList, type DescriptionListDetailProps, type DescriptionListLayout, type DescriptionListRootProps, type DescriptionListTermProps, Dialog, type DialogCloseProps, type DialogContentProps, type DialogDescriptionProps, type DialogFooterProps, type DialogRootProps, type DialogTitleProps, type DialogTriggerProps, Disclosure, type DisclosureProps, Drawer, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerRootProps, type DrawerSwipeDirection, type DrawerTitleProps, type DrawerTriggerProps, DropdownMenu, type DropdownMenuCheckboxItemProps, type DropdownMenuContentProps, type DropdownMenuGroupProps, type DropdownMenuItemProps, type DropdownMenuLabelProps, type DropdownMenuRootProps, type DropdownMenuSeparatorProps, type DropdownMenuTriggerProps, EmptyState, type EmptyStateProps, EnvVarInput, type EnvVarInputProps, Eyebrow, type EyebrowProps, Field, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, type FieldIssue, FieldLabel, type FieldLabelProps, type FieldProps, type FilePartition, type FilePartitionOptions, type FileRejectReason, type FileRejection, FileUpload, type FileUploadProps, type FontName, Footer, type FooterProps, type FormControlSize, Grid, type GridColumns, type GridProps, GroupBar, type GroupBarItem, type GroupBarProps, type GroupBarTone, HoverCard, type HoverCardContentProps, type HoverCardRootProps, type HoverCardTriggerProps, IconButton, type IconButtonProps, InfoTip, type InfoTipProps, Input, InputGroup, type InputGroupProps, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Link, type LinkProps, Menubar, type MenubarContentProps, type MenubarMenuProps, type MenubarRootProps, type MenubarTriggerProps, Message, MessageList, type MessageListProps, type MessageProps, type MessageRole, Meter, type MeterProps, type MeterProvenance, type MeterTone, type Mode, MultiSelect, type MultiSelectProps, NavigationMenu, type NavigationMenuContentProps, type NavigationMenuItemProps, type NavigationMenuLinkProps, type NavigationMenuListProps, type NavigationMenuRootProps, type NavigationMenuTriggerProps, type NavigationMenuViewportProps, NumberField, type NumberFieldProps, OTPField, type OTPFieldProps, OVERLAY_SIDE_OFFSET, PageShell, type PageShellProps, type PageWidth, Pagination, type PaginationEntry, type PaginationProps, Panel, PanelHeader, type PanelHeaderProps, type PanelProps, PasswordInput, type PasswordInputProps, type PersistedPreferences, Plussie, type PlussieExpression, type PlussieProps, Popover, type PopoverCloseProps, type PopoverContentProps, type PopoverDescriptionProps, type PopoverRootProps, type PopoverTitleProps, type PopoverTriggerProps, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, type RatingSize, type ResolvedMode, Row, type RowProps, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, type ScrollEdges, ScrollableTabsList, type ScrollableTabsListProps, ScrubInput, type ScrubInputProps, SeamCell, type SeamCellProps, SeamGrid, type SeamGridProps, type SeamGround, SeamList, type SeamListProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, type SegmentedControlSize, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetCloseProps, type SheetContentProps, type SheetDescriptionProps, type SheetFooterProps, type SheetRootProps, type SheetTitleProps, type SheetTriggerProps, Sidebar, type SidebarItemProps, type SidebarRailProps, type SidebarRootProps, type SidebarSectionProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SpaceStep, Sparkline, type SparklineProps, Spinner, type SpinnerProps, Stack, type StackAlign, type StackJustify, type StackProps, Stat, type StatProps, type StatTone, StatusBar, type StatusBarItemProps, type StatusBarProps, type StatusBarTone, StatusDot, type StatusDotProps, type StatusTone, Stepper, type StepperProps, type StepperState, type StepperStep, Switch, type SwitchProps, TAB_FADE_PX, TREE_GUIDE_GLYPHS, Table, type TableCaptionProps, type TableCellProps, type TableHeadProps, type TableRootProps, type TableRowProps, type TableSectionProps, Tabs, type TabsListProps, type TabsPanelProps, type TabsRootProps, type TabsTabProps, TagsInput, type TagsInputProps, TerminalFrame, type TerminalFrameLine, type TerminalFrameProps, type TerminalLine, type TerminalLineTone, type TerminalScript, type TerminalStep, Textarea, type TextareaProps, type ThemeContextValue, type ThemeName, ThemeProvider, type ThemeProviderProps, Timeline, type TimelineContentProps, type TimelineItemProps, type TimelineMarkerProps, type TimelineRootProps, TitleBar, type TitleBarProps, Toast, type ToastManager, type ToastOptions, type ToastProviderProps, type ToastTone, type ToastViewportProps, Toggle, ToggleGroup, type ToggleGroupProps, type ToggleProps, Toolbar, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarRootProps, type ToolbarSeparatorProps, Tooltip, type TooltipContentProps, type TooltipProviderProps, type TooltipRootProps, type TooltipTriggerProps, Tree, type TreeGuide, type TreeItem, type TreeProps, type TreeRow, type TreeVisibility, TreeVisibilityToggle, type TreeVisibilityToggleProps, TwoStepButton, type TwoStepButtonProps, type TwoStepTone, type UploadFile, type UploadStatus, UsageChart, type UsageChartPoint, type UsageChartProps, type UsageChartTone, agentColor, agentColorStyle, bareControlClasses, buttonVariants, chipVariants, computeScrollEdges, controlClasses, controlGroupFocusClasses, controlSurface, controlVariants, edgeFadeMask, envReference, flattenTree, itemVariants, linkVariants, menuItemClasses, menuLabelClasses, menuPopupClasses, menuSeparatorClasses, overlayDescriptionClasses, overlayFooterClasses, overlayModalTransitionClasses, overlayPopupTransitionClasses, overlayPositionerClasses, overlaySurfaceClasses, overlayTextClasses, overlayTitleClasses, paginationRange, parseEnvReference, partitionFiles, prepaintScript, rowVariants, scrimClasses, useControlHeight, useCuePortalProps, useDensity, useSidebar, useTheme, useToast };
|
|
121
|
+
export { AGENT_COLOR_PROPERTY, AGENT_HUES, AGENT_ROOT_COLOR, Accordion, type AccordionHeaderProps, type AccordionItemProps, type AccordionPanelProps, type AccordionRootProps, type AccordionTriggerProps, type AgentColorOptions, AgentPile, type AgentPileEntry, type AgentPileProps, type AgentPileSize, AlertDialog, type AlertDialogActionProps, type AlertDialogCancelProps, type AlertDialogContentProps, type AlertDialogDescriptionProps, type AlertDialogFooterProps, type AlertDialogRootProps, type AlertDialogTitleProps, type AlertDialogTriggerProps, AppBar, type AppBarActionsProps, type AppBarBrandProps, type AppBarLinkProps, type AppBarNavProps, type AppBarRegister, type AppBarRootProps, type AppBarSeparatorProps, AppShell, type AppShellAsideProps, type AppShellBodyProps, type AppShellContentProps, type AppShellNavTriggerProps, type AppShellRootProps, type AppShellScrollerProps, type AppShellSidebarProps, AppWindowFrame, type AppWindowFrameProps, type AskAnswer, AskBox, type AskBoxProps, type AskDanger, type AskKind, type AskOption, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, type BarOverflow, type BrandAssetProps, type BrandSize, type BrandTone, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonProps, Card, type CardContentProps, type CardDescriptionProps, type CardFooterProps, type CardHeaderProps, type CardRootProps, type CardTitleProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipProps, Collapsible, type CollapsiblePanelProps, type CollapsibleRootProps, type CollapsibleTriggerProps, Combobox, type ComboboxOption, type ComboboxProps, CommandPalette, type CommandPaletteItem, type CommandPaletteProps, Composer, type ComposerProps, type ComposerSubmitKey, Container, type ContainerProps, type ContainerWidth, ContextMenu, type ContextMenuContentProps, type ContextMenuRootProps, type ContextMenuTriggerProps, type ControlSize, type ControlVariantProps, CopyButton, type CopyButtonProps, CueLogotype, type CueLogotypeProps, CueMark, type CueMarkProps, CuePortalFrame, type CuePortalFrameProps, DEFAULT_STORAGE_KEY, DelegationCard, type DelegationCardProps, type DelegationDirection, type DelegationStatus, Density, type DensityLevel, type DensityProps, DescriptionList, type DescriptionListDetailProps, type DescriptionListLayout, type DescriptionListRootProps, type DescriptionListTermProps, Dialog, type DialogCloseProps, type DialogContentProps, type DialogDescriptionProps, type DialogFooterProps, type DialogRootProps, type DialogTitleProps, type DialogTriggerProps, Disclosure, type DisclosureProps, Drawer, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerRootProps, type DrawerSwipeDirection, type DrawerTitleProps, type DrawerTriggerProps, DropdownMenu, type DropdownMenuCheckboxItemProps, type DropdownMenuContentProps, type DropdownMenuGroupProps, type DropdownMenuItemProps, type DropdownMenuLabelProps, type DropdownMenuRootProps, type DropdownMenuSeparatorProps, type DropdownMenuTriggerProps, EmptyState, type EmptyStateProps, EnvVarInput, type EnvVarInputProps, Eyebrow, type EyebrowProps, Field, FieldDescription, type FieldDescriptionProps, FieldError, type FieldErrorProps, type FieldIssue, FieldLabel, type FieldLabelProps, type FieldProps, type FilePartition, type FilePartitionOptions, type FileRejectReason, type FileRejection, FileUpload, type FileUploadProps, type FontFamilies, type FontName, Footer, type FooterProps, type FormControlSize, Grid, type GridColumns, type GridProps, GroupBar, type GroupBarItem, type GroupBarProps, type GroupBarTone, HoverCard, type HoverCardContentProps, type HoverCardRootProps, type HoverCardTriggerProps, IconButton, type IconButtonProps, InfoTip, type InfoTipProps, Input, InputGroup, type InputGroupProps, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Link, type LinkProps, Menubar, type MenubarContentProps, type MenubarMenuProps, type MenubarRootProps, type MenubarTriggerProps, Message, MessageList, type MessageListProps, type MessageProps, type MessageRole, Meter, type MeterProps, type MeterProvenance, type MeterTone, type Mode, MultiSelect, type MultiSelectProps, NavigationMenu, type NavigationMenuContentProps, type NavigationMenuItemProps, type NavigationMenuLinkProps, type NavigationMenuListProps, type NavigationMenuRootProps, type NavigationMenuTriggerProps, type NavigationMenuViewportProps, NumberField, type NumberFieldProps, OTPField, type OTPFieldProps, OVERLAY_SIDE_OFFSET, PageShell, type PageShellProps, type PageWidth, Pagination, type PaginationEntry, type PaginationProps, Panel, PanelHeader, type PanelHeaderProps, type PanelProps, PasswordInput, type PasswordInputProps, type PersistedPreferences, Plussie, type PlussieExpression, type PlussieProps, Popover, type PopoverCloseProps, type PopoverContentProps, type PopoverDescriptionProps, type PopoverRootProps, type PopoverTitleProps, type PopoverTriggerProps, type PrepaintDefaults, type PrepaintOptions, Progress, type ProgressProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, type RatingSize, type ResolvedMode, Row, type RowProps, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, type ScrollEdges, ScrollableTabsList, type ScrollableTabsListProps, ScrubInput, type ScrubInputProps, SeamCell, type SeamCellProps, SeamGrid, type SeamGridProps, type SeamGround, SeamList, type SeamListProps, SearchInput, type SearchInputProps, SectionHeader, type SectionHeaderProps, SegmentedControl, type SegmentedControlItem, type SegmentedControlProps, type SegmentedControlSize, Select, type SelectOption, type SelectProps, Separator, type SeparatorProps, Sheet, type SheetCloseProps, type SheetContentProps, type SheetDescriptionProps, type SheetFooterProps, type SheetRootProps, type SheetTitleProps, type SheetTriggerProps, Sidebar, type SidebarItemProps, type SidebarRailProps, type SidebarRootProps, type SidebarSectionProps, Skeleton, type SkeletonProps, Slider, type SliderProps, type SpaceStep, Sparkline, type SparklineProps, Spinner, type SpinnerProps, Stack, type StackAlign, type StackJustify, type StackProps, Stat, type StatProps, type StatTone, StatusBar, type StatusBarItemProps, type StatusBarProps, type StatusBarTone, StatusDot, type StatusDotProps, type StatusTone, Stepper, type StepperProps, type StepperState, type StepperStep, Switch, type SwitchProps, TAB_FADE_PX, TREE_GUIDE_GLYPHS, Table, type TableCaptionProps, type TableCellProps, type TableHeadProps, type TableRootProps, type TableRowProps, TableScrollRegion, type TableScrollRegionProps, type TableSectionProps, Tabs, type TabsListProps, type TabsPanelProps, type TabsRootProps, type TabsTabProps, TagsInput, type TagsInputProps, TerminalFrame, type TerminalFrameLine, type TerminalFrameProps, type TerminalLine, type TerminalLineTone, type TerminalScript, type TerminalStep, Textarea, type TextareaProps, type ThemeContextValue, type ThemeName, ThemeProvider, type ThemeProviderProps, Timeline, type TimelineContentProps, type TimelineItemProps, type TimelineMarkerProps, type TimelineRootProps, TitleBar, type TitleBarProps, Toast, type ToastManager, type ToastOptions, type ToastProviderProps, type ToastTone, type ToastViewportProps, Toggle, ToggleGroup, type ToggleGroupProps, type ToggleProps, Toolbar, type ToolbarButtonProps, type ToolbarGroupProps, type ToolbarRootProps, type ToolbarSeparatorProps, Tooltip, type TooltipContentProps, type TooltipProviderProps, type TooltipRootProps, type TooltipTriggerProps, Tree, type TreeGuide, type TreeItem, type TreeProps, type TreeRow, type TreeVisibility, TreeVisibilityToggle, type TreeVisibilityToggleProps, TwoStepButton, type TwoStepButtonProps, type TwoStepTone, type UploadFile, type UploadStatus, UsageChart, type UsageChartPoint, type UsageChartProps, type UsageChartTone, agentColor, agentColorStyle, bareControlClasses, buttonVariants, chipVariants, computeScrollEdges, controlClasses, controlGroupFocusClasses, controlSurface, controlVariants, edgeFadeMask, envReference, flattenTree, itemVariants, linkVariants, menuItemClasses, menuLabelClasses, menuPopupClasses, menuSeparatorClasses, overlayDescriptionClasses, overlayFooterClasses, overlayModalTransitionClasses, overlayPopupTransitionClasses, overlayPositionerClasses, overlaySurfaceClasses, overlayTextClasses, overlayTitleClasses, paginationRange, parseEnvReference, partitionFiles, prepaintScript, rowVariants, scrimClasses, useControlHeight, useCuePortalProps, useDensity, useSidebar, useTheme, useToast };
|
package/dist/index.js
CHANGED
|
@@ -74,7 +74,7 @@ import { Progress } from "./instruments/progress.js";
|
|
|
74
74
|
import { SeamCell, SeamGrid } from "./instruments/seam-grid.js";
|
|
75
75
|
import { Sparkline } from "./instruments/sparkline.js";
|
|
76
76
|
import { Stat } from "./instruments/stat.js";
|
|
77
|
-
import { Table } from "./instruments/table.js";
|
|
77
|
+
import { Table, TableScrollRegion } from "./instruments/table.js";
|
|
78
78
|
import { TerminalFrame } from "./instruments/terminal-frame.js";
|
|
79
79
|
import { TwoStepButton } from "./instruments/two-step-button.js";
|
|
80
80
|
import { UsageChart } from "./instruments/usage-chart.js";
|
|
@@ -107,4 +107,4 @@ import { Kbd } from "./primitives/kbd.js";
|
|
|
107
107
|
import { Skeleton } from "./primitives/skeleton.js";
|
|
108
108
|
import { useControlHeight, useDensity } from "./system/use-density.js";
|
|
109
109
|
import { useTheme } from "./system/use-theme.js";
|
|
110
|
-
export { AGENT_COLOR_PROPERTY, AGENT_HUES, AGENT_ROOT_COLOR, Accordion, AgentPile, AlertDialog, AppBar, AppShell, AppWindowFrame, AskBox, Autocomplete, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, Checkbox, CheckboxGroup, Chip, Collapsible, Combobox, CommandPalette, Composer, Container, ContextMenu, CopyButton, CueLogotype, CueMark, CuePortalFrame, DEFAULT_STORAGE_KEY, DelegationCard, Density, DescriptionList, Dialog, Disclosure, Drawer, DropdownMenu, EmptyState, EnvVarInput, Eyebrow, Field, FieldDescription, FieldError, FieldLabel, FileUpload, Footer, Grid, GroupBar, HoverCard, IconButton, InfoTip, Input, InputGroup, Item, Kbd, Link, Menubar, Message, MessageList, Meter, MultiSelect, NavigationMenu, NumberField, OTPField, OVERLAY_SIDE_OFFSET, PageShell, Pagination, Panel, PanelHeader, PasswordInput, Plussie, Popover, Progress, Radio, RadioGroup, Rating, Row, ScrollArea, ScrollableTabsList, ScrubInput, SeamCell, SeamGrid, SeamList, SearchInput, SectionHeader, SegmentedControl, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Sparkline, Spinner, Stack, Stat, StatusBar, StatusDot, Stepper, Switch, TAB_FADE_PX, TREE_GUIDE_GLYPHS, Table, Tabs, TagsInput, TerminalFrame, Textarea, ThemeProvider, Timeline, TitleBar, Toast, Toggle, ToggleGroup, Toolbar, Tooltip, Tree, TreeVisibilityToggle, TwoStepButton, UsageChart, agentColor, agentColorStyle, bareControlClasses, buttonVariants, chipVariants, computeScrollEdges, controlClasses, controlGroupFocusClasses, controlSurface, controlVariants, edgeFadeMask, envReference, flattenTree, itemVariants, linkVariants, menuItemClasses, menuLabelClasses, menuPopupClasses, menuSeparatorClasses, overlayDescriptionClasses, overlayFooterClasses, overlayModalTransitionClasses, overlayPopupTransitionClasses, overlayPositionerClasses, overlaySurfaceClasses, overlayTextClasses, overlayTitleClasses, paginationRange, parseEnvReference, partitionFiles, prepaintScript, rowVariants, scrimClasses, useControlHeight, useCuePortalProps, useDensity, useSidebar, useTheme, useToast };
|
|
110
|
+
export { AGENT_COLOR_PROPERTY, AGENT_HUES, AGENT_ROOT_COLOR, Accordion, AgentPile, AlertDialog, AppBar, AppShell, AppWindowFrame, AskBox, Autocomplete, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, Checkbox, CheckboxGroup, Chip, Collapsible, Combobox, CommandPalette, Composer, Container, ContextMenu, CopyButton, CueLogotype, CueMark, CuePortalFrame, DEFAULT_STORAGE_KEY, DelegationCard, Density, DescriptionList, Dialog, Disclosure, Drawer, DropdownMenu, EmptyState, EnvVarInput, Eyebrow, Field, FieldDescription, FieldError, FieldLabel, FileUpload, Footer, Grid, GroupBar, HoverCard, IconButton, InfoTip, Input, InputGroup, Item, Kbd, Link, Menubar, Message, MessageList, Meter, MultiSelect, NavigationMenu, NumberField, OTPField, OVERLAY_SIDE_OFFSET, PageShell, Pagination, Panel, PanelHeader, PasswordInput, Plussie, Popover, Progress, Radio, RadioGroup, Rating, Row, ScrollArea, ScrollableTabsList, ScrubInput, SeamCell, SeamGrid, SeamList, SearchInput, SectionHeader, SegmentedControl, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Sparkline, Spinner, Stack, Stat, StatusBar, StatusDot, Stepper, Switch, TAB_FADE_PX, TREE_GUIDE_GLYPHS, Table, TableScrollRegion, Tabs, TagsInput, TerminalFrame, Textarea, ThemeProvider, Timeline, TitleBar, Toast, Toggle, ToggleGroup, Toolbar, Tooltip, Tree, TreeVisibilityToggle, TwoStepButton, UsageChart, agentColor, agentColorStyle, bareControlClasses, buttonVariants, chipVariants, computeScrollEdges, controlClasses, controlGroupFocusClasses, controlSurface, controlVariants, edgeFadeMask, envReference, flattenTree, itemVariants, linkVariants, menuItemClasses, menuLabelClasses, menuPopupClasses, menuSeparatorClasses, overlayDescriptionClasses, overlayFooterClasses, overlayModalTransitionClasses, overlayPopupTransitionClasses, overlayPositionerClasses, overlaySurfaceClasses, overlayTextClasses, overlayTitleClasses, paginationRange, parseEnvReference, partitionFiles, prepaintScript, rowVariants, scrimClasses, useControlHeight, useCuePortalProps, useDensity, useSidebar, useTheme, useToast };
|
|
@@ -6,8 +6,8 @@ import { Progress, ProgressProps } from "./progress.js";
|
|
|
6
6
|
import { SeamCell, SeamCellProps, SeamGrid, SeamGridProps, SeamGround } from "./seam-grid.js";
|
|
7
7
|
import { Sparkline, SparklineProps } from "./sparkline.js";
|
|
8
8
|
import { Stat, StatProps, StatTone } from "./stat.js";
|
|
9
|
-
import { Table, TableCaptionProps, TableCellProps, TableHeadProps, TableRootProps, TableRowProps, TableSectionProps } from "./table.js";
|
|
9
|
+
import { Table, TableCaptionProps, TableCellProps, TableHeadProps, TableRootProps, TableRowProps, TableScrollRegion, TableScrollRegionProps, TableSectionProps } from "./table.js";
|
|
10
10
|
import { TerminalFrame, TerminalFrameLine, TerminalFrameProps, TerminalLine, TerminalLineTone, TerminalScript, TerminalStep } from "./terminal-frame.js";
|
|
11
11
|
import { TwoStepButton, TwoStepButtonProps, TwoStepTone } from "./two-step-button.js";
|
|
12
12
|
import { UsageChart, UsageChartPoint, UsageChartProps, UsageChartTone } from "./usage-chart.js";
|
|
13
|
-
export { AppWindowFrame, type AppWindowFrameProps, CopyButton, type CopyButtonProps, GroupBar, type GroupBarItem, type GroupBarProps, type GroupBarTone, Meter, type MeterProps, type MeterProvenance, type MeterTone, Progress, type ProgressProps, SeamCell, type SeamCellProps, SeamGrid, type SeamGridProps, type SeamGround, Sparkline, type SparklineProps, Stat, type StatProps, type StatTone, Table, type TableCaptionProps, type TableCellProps, type TableHeadProps, type TableRootProps, type TableRowProps, type TableSectionProps, TerminalFrame, type TerminalFrameLine, type TerminalFrameProps, type TerminalLine, type TerminalLineTone, type TerminalScript, type TerminalStep, TwoStepButton, type TwoStepButtonProps, type TwoStepTone, UsageChart, type UsageChartPoint, type UsageChartProps, type UsageChartTone };
|
|
13
|
+
export { AppWindowFrame, type AppWindowFrameProps, CopyButton, type CopyButtonProps, GroupBar, type GroupBarItem, type GroupBarProps, type GroupBarTone, Meter, type MeterProps, type MeterProvenance, type MeterTone, Progress, type ProgressProps, SeamCell, type SeamCellProps, SeamGrid, type SeamGridProps, type SeamGround, Sparkline, type SparklineProps, Stat, type StatProps, type StatTone, Table, type TableCaptionProps, type TableCellProps, type TableHeadProps, type TableRootProps, type TableRowProps, TableScrollRegion, type TableScrollRegionProps, type TableSectionProps, TerminalFrame, type TerminalFrameLine, type TerminalFrameProps, type TerminalLine, type TerminalLineTone, type TerminalScript, type TerminalStep, TwoStepButton, type TwoStepButtonProps, type TwoStepTone, UsageChart, type UsageChartPoint, type UsageChartProps, type UsageChartTone };
|
|
@@ -6,8 +6,8 @@ import { Progress } from "./progress.js";
|
|
|
6
6
|
import { SeamCell, SeamGrid } from "./seam-grid.js";
|
|
7
7
|
import { Sparkline } from "./sparkline.js";
|
|
8
8
|
import { Stat } from "./stat.js";
|
|
9
|
-
import { Table } from "./table.js";
|
|
9
|
+
import { Table, TableScrollRegion } from "./table.js";
|
|
10
10
|
import { TerminalFrame } from "./terminal-frame.js";
|
|
11
11
|
import { TwoStepButton } from "./two-step-button.js";
|
|
12
12
|
import { UsageChart } from "./usage-chart.js";
|
|
13
|
-
export { AppWindowFrame, CopyButton, GroupBar, Meter, Progress, SeamCell, SeamGrid, Sparkline, Stat, Table, TerminalFrame, TwoStepButton, UsageChart };
|
|
13
|
+
export { AppWindowFrame, CopyButton, GroupBar, Meter, Progress, SeamCell, SeamGrid, Sparkline, Stat, Table, TableScrollRegion, TerminalFrame, TwoStepButton, UsageChart };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
//#region src/instruments/table.d.ts
|
|
3
|
+
interface TableScrollRegionProps extends Omit<React.ComponentPropsWithoutRef<"div">, "aria-label" | "role" | "tabIndex"> {
|
|
4
|
+
/** Accessible name announced for the keyboard-focusable scrolling region. */
|
|
5
|
+
"aria-label": string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A named horizontal viewport for a table wider than its container.
|
|
9
|
+
*
|
|
10
|
+
* The region is independently keyboard-focusable so keyboard users can reach
|
|
11
|
+
* native horizontal scrolling. It adds no table semantics of its own; place a
|
|
12
|
+
* compound {@link Table} inside it and keep the table's caption.
|
|
13
|
+
*/
|
|
14
|
+
declare const TableScrollRegion: React.ForwardRefExoticComponent<TableScrollRegionProps & React.RefAttributes<HTMLDivElement>>;
|
|
3
15
|
interface TableRootProps extends React.ComponentPropsWithoutRef<"table"> {}
|
|
4
16
|
interface TableSectionProps extends React.ComponentPropsWithoutRef<"tbody"> {}
|
|
5
17
|
interface TableRowProps extends React.ComponentPropsWithoutRef<"tr"> {}
|
|
@@ -21,6 +33,7 @@ interface TableCaptionProps extends React.ComponentPropsWithoutRef<"caption"> {}
|
|
|
21
33
|
* are thicker than the data.
|
|
22
34
|
*
|
|
23
35
|
* Static markup — no `"use client"`. Compose it with `Panel` for the rim.
|
|
36
|
+
* Use {@link TableScrollRegion} only when the table can exceed its container.
|
|
24
37
|
*
|
|
25
38
|
* @example
|
|
26
39
|
* <Table.Root>
|
|
@@ -48,4 +61,4 @@ declare const Table: {
|
|
|
48
61
|
Caption: React.ForwardRefExoticComponent<TableCaptionProps & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
49
62
|
};
|
|
50
63
|
//#endregion
|
|
51
|
-
export { Table, TableCaptionProps, TableCellProps, TableHeadProps, TableRootProps, TableRowProps, TableSectionProps };
|
|
64
|
+
export { Table, TableCaptionProps, TableCellProps, TableHeadProps, TableRootProps, TableRowProps, TableScrollRegion, TableScrollRegionProps, TableSectionProps };
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { cn } from "../lib/cn.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/instruments/table.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A named horizontal viewport for a table wider than its container.
|
|
7
|
+
*
|
|
8
|
+
* The region is independently keyboard-focusable so keyboard users can reach
|
|
9
|
+
* native horizontal scrolling. It adds no table semantics of its own; place a
|
|
10
|
+
* compound {@link Table} inside it and keep the table's caption.
|
|
11
|
+
*/
|
|
12
|
+
const TableScrollRegion = React.forwardRef(function TableScrollRegion({ className, ...elementProps }, ref) {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
ref,
|
|
15
|
+
...elementProps,
|
|
16
|
+
role: "region",
|
|
17
|
+
tabIndex: 0,
|
|
18
|
+
"data-slot": "table-scroll-region",
|
|
19
|
+
className: cn("overflow-x-auto outline-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-accent", className)
|
|
20
|
+
});
|
|
21
|
+
});
|
|
4
22
|
/**
|
|
5
23
|
* The canonical console table: hairlines, mono figures, no zebra striping.
|
|
6
24
|
*
|
|
@@ -10,6 +28,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
28
|
* are thicker than the data.
|
|
11
29
|
*
|
|
12
30
|
* Static markup — no `"use client"`. Compose it with `Panel` for the rim.
|
|
31
|
+
* Use {@link TableScrollRegion} only when the table can exceed its container.
|
|
13
32
|
*
|
|
14
33
|
* @example
|
|
15
34
|
* <Table.Root>
|
|
@@ -89,4 +108,4 @@ const Table = {
|
|
|
89
108
|
})
|
|
90
109
|
};
|
|
91
110
|
//#endregion
|
|
92
|
-
export { Table };
|
|
111
|
+
export { Table, TableScrollRegion };
|
|
@@ -15,7 +15,7 @@ import * as React from "react";
|
|
|
15
15
|
* <span className={chipVariants({ tone: "danger", variant: "outline" })}>fault</span>
|
|
16
16
|
*/
|
|
17
17
|
declare const chipVariants: (props?: ({
|
|
18
|
-
tone?: "
|
|
18
|
+
tone?: "info" | "warn" | "danger" | "accent" | "ok" | "busy" | "neutral" | null | undefined;
|
|
19
19
|
variant?: "outline" | "tinted" | null | undefined;
|
|
20
20
|
interactive?: boolean | null | undefined;
|
|
21
21
|
} & ClassProp) | undefined) => string;
|
package/dist/styles.css
CHANGED
|
@@ -28,7 +28,17 @@
|
|
|
28
28
|
@custom-variant density-normal (&:where([data-density="normal"], [data-density="normal"] *));
|
|
29
29
|
@custom-variant density-large (&:where([data-density="large"], [data-density="large"] *));
|
|
30
30
|
@custom-variant density-ultra-large (&:where([data-density="ultra-large"], [data-density="ultra-large"] *));
|
|
31
|
-
@custom-variant mode-light
|
|
31
|
+
@custom-variant mode-light {
|
|
32
|
+
&:where([data-mode="light"], [data-mode="light"] *) {
|
|
33
|
+
@slot;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (prefers-color-scheme: light) {
|
|
37
|
+
&:where([data-mode="system"], [data-mode="system"] *) {
|
|
38
|
+
@slot;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
32
42
|
|
|
33
43
|
/* The one keyframe this library's core needs, and the reason it cannot be a
|
|
34
44
|
* utility: `<Plussie idle />` blinks, and Tailwind has no `animate-*` for a
|
package/dist/system/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps } from "./theme-provider.js";
|
|
1
|
+
import { FontFamilies, ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps } from "./theme-provider.js";
|
|
2
2
|
import { Density, DensityProps } from "./density.js";
|
|
3
3
|
import { CuePortalFrame, CuePortalFrameProps, useCuePortalProps } from "./portal.js";
|
|
4
|
-
import { DEFAULT_STORAGE_KEY, PersistedPreferences, prepaintScript } from "./prepaint.js";
|
|
4
|
+
import { DEFAULT_STORAGE_KEY, PersistedPreferences, PrepaintDefaults, PrepaintOptions, prepaintScript } from "./prepaint.js";
|
|
5
5
|
import { ControlSize, useControlHeight, useDensity } from "./use-density.js";
|
|
6
6
|
import { useTheme } from "./use-theme.js";
|
|
7
7
|
import { Density as DensityLevel, FontName, Mode, ThemeName } from "@cueplusplus/tokens";
|
|
8
|
-
export { type ControlSize, CuePortalFrame, type CuePortalFrameProps, DEFAULT_STORAGE_KEY, Density, type DensityLevel, type DensityProps, type FontName, type Mode, type PersistedPreferences, type ResolvedMode, type ThemeContextValue, type ThemeName, ThemeProvider, type ThemeProviderProps, prepaintScript, useControlHeight, useCuePortalProps, useDensity, useTheme };
|
|
8
|
+
export { type ControlSize, CuePortalFrame, type CuePortalFrameProps, DEFAULT_STORAGE_KEY, Density, type DensityLevel, type DensityProps, type FontFamilies, type FontName, type Mode, type PersistedPreferences, type PrepaintDefaults, type PrepaintOptions, type ResolvedMode, type ThemeContextValue, type ThemeName, ThemeProvider, type ThemeProviderProps, prepaintScript, useControlHeight, useCuePortalProps, useDensity, useTheme };
|
package/dist/system/portal.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
3
3
|
import { DensityContext } from "./density.js";
|
|
4
|
-
import { FontScaleContext, ThemeContext } from "./theme-provider.js";
|
|
4
|
+
import { FontFamiliesContext, FontScaleContext, ThemeContext } from "./theme-provider.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { DEFAULT_FONT } from "@cueplusplus/tokens";
|
|
8
8
|
//#region src/system/portal.tsx
|
|
9
9
|
const DEFAULT_THEME = "cue";
|
|
10
|
-
const
|
|
10
|
+
const DEFAULT_MODE = "dark";
|
|
11
11
|
/** Custom property the density text ladder multiplies by; see `FontScaleContext`. */
|
|
12
12
|
const FONT_SCALE_PROPERTY = "--cue-font-scale";
|
|
13
|
+
const FONT_SANS_PROPERTY = "--cue-font-sans";
|
|
14
|
+
const FONT_MONO_PROPERTY = "--cue-font-mono";
|
|
13
15
|
/**
|
|
14
16
|
* Read the stamp from React context — never from the DOM. A portal is mounted
|
|
15
17
|
* outside its owner's DOM subtree, so `getComputedStyle`-style discovery would
|
|
@@ -22,12 +24,14 @@ function usePortalStamp() {
|
|
|
22
24
|
const theme = React.useContext(ThemeContext);
|
|
23
25
|
const island = React.useContext(DensityContext);
|
|
24
26
|
const fontScale = React.useContext(FontScaleContext);
|
|
27
|
+
const fontFamilies = React.useContext(FontFamiliesContext);
|
|
25
28
|
return {
|
|
26
29
|
theme: theme?.theme ?? DEFAULT_THEME,
|
|
27
30
|
density: island ?? theme?.density ?? "compact",
|
|
31
|
+
mode: theme?.mode ?? DEFAULT_MODE,
|
|
28
32
|
font: theme?.font ?? DEFAULT_FONT,
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
fontScale,
|
|
34
|
+
fontFamilies
|
|
31
35
|
};
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
@@ -79,7 +83,9 @@ function useCuePortalProps() {
|
|
|
79
83
|
stamp.density,
|
|
80
84
|
stamp.font,
|
|
81
85
|
stamp.mode,
|
|
82
|
-
stamp.fontScale
|
|
86
|
+
stamp.fontScale,
|
|
87
|
+
stamp.fontFamilies?.sans,
|
|
88
|
+
stamp.fontFamilies?.mono
|
|
83
89
|
]);
|
|
84
90
|
return React.useMemo(() => container === null ? {} : { container }, [container]);
|
|
85
91
|
}
|
|
@@ -91,6 +97,12 @@ function applyStamp(element, stamp) {
|
|
|
91
97
|
element.setAttribute("data-mode", stamp.mode);
|
|
92
98
|
if (stamp.fontScale === null) element.style.removeProperty(FONT_SCALE_PROPERTY);
|
|
93
99
|
else element.style.setProperty(FONT_SCALE_PROPERTY, String(stamp.fontScale));
|
|
100
|
+
setOptionalProperty(element, FONT_SANS_PROPERTY, stamp.fontFamilies?.sans);
|
|
101
|
+
setOptionalProperty(element, FONT_MONO_PROPERTY, stamp.fontFamilies?.mono);
|
|
102
|
+
}
|
|
103
|
+
function setOptionalProperty(element, property, value) {
|
|
104
|
+
if (value === void 0) element.style.removeProperty(property);
|
|
105
|
+
else element.style.setProperty(property, value);
|
|
94
106
|
}
|
|
95
107
|
/**
|
|
96
108
|
* Inline version of the portal contract, for portals whose container cannot be
|
|
@@ -110,6 +122,8 @@ function CuePortalFrame({ children, className, style }) {
|
|
|
110
122
|
const frameStyle = {
|
|
111
123
|
display: "contents",
|
|
112
124
|
...stamp.fontScale === null ? null : { [FONT_SCALE_PROPERTY]: stamp.fontScale },
|
|
125
|
+
...stamp.fontFamilies?.sans === void 0 ? null : { [FONT_SANS_PROPERTY]: stamp.fontFamilies.sans },
|
|
126
|
+
...stamp.fontFamilies?.mono === void 0 ? null : { [FONT_MONO_PROPERTY]: stamp.fontFamilies.mono },
|
|
113
127
|
...style
|
|
114
128
|
};
|
|
115
129
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Density, FontName, ThemeName } from "@cueplusplus/tokens";
|
|
1
|
+
import { Density, FontName, Mode, ThemeName } from "@cueplusplus/tokens";
|
|
2
2
|
//#region src/system/prepaint.d.ts
|
|
3
3
|
/** localStorage key the ThemeProvider and the pre-paint script share by default. */
|
|
4
4
|
declare const DEFAULT_STORAGE_KEY = "cue-ui";
|
|
@@ -13,6 +13,23 @@ interface PersistedPreferences {
|
|
|
13
13
|
/** Last font pairing the user picked. */
|
|
14
14
|
font?: string;
|
|
15
15
|
}
|
|
16
|
+
/** Complete server-authoritative fallback stamped when storage is absent or ignored. */
|
|
17
|
+
interface PrepaintDefaults {
|
|
18
|
+
theme: ThemeName;
|
|
19
|
+
density: Density;
|
|
20
|
+
mode: Mode;
|
|
21
|
+
/** Initial document-wide font pairing. Defaults to the token package's system pairing. */
|
|
22
|
+
font?: FontName;
|
|
23
|
+
}
|
|
24
|
+
/** Options form for apps whose server projection, not localStorage, owns first paint. */
|
|
25
|
+
interface PrepaintOptions {
|
|
26
|
+
/** localStorage key shared with ThemeProvider. */
|
|
27
|
+
storageKey?: string;
|
|
28
|
+
/** Complete validated fallback triple. */
|
|
29
|
+
defaults: PrepaintDefaults;
|
|
30
|
+
/** Whether valid stored axes may override `defaults`. Defaults to `true`. */
|
|
31
|
+
readStoredPreferences?: boolean;
|
|
32
|
+
}
|
|
16
33
|
/**
|
|
17
34
|
* Build the blocking inline script that stamps `data-theme`, `data-density`,
|
|
18
35
|
* `data-font`, `data-mode` and `color-scheme` on `<html>` from localStorage
|
|
@@ -41,5 +58,6 @@ interface PersistedPreferences {
|
|
|
41
58
|
* prepaintScript(DEFAULT_STORAGE_KEY, "terminal", "normal");
|
|
42
59
|
*/
|
|
43
60
|
declare function prepaintScript(storageKey?: string, defaultTheme?: ThemeName, defaultDensity?: Density, defaultFont?: FontName): string;
|
|
61
|
+
declare function prepaintScript(options: PrepaintOptions): string;
|
|
44
62
|
//#endregion
|
|
45
|
-
export { DEFAULT_STORAGE_KEY, PersistedPreferences, prepaintScript };
|
|
63
|
+
export { DEFAULT_STORAGE_KEY, PersistedPreferences, PrepaintDefaults, PrepaintOptions, prepaintScript };
|
package/dist/system/prepaint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_DENSITY, DEFAULT_FONT, DENSITIES, FONTS } from "@cueplusplus/tokens";
|
|
1
|
+
import { DEFAULT_DENSITY, DEFAULT_FONT, DENSITIES, FONTS, MODES, THEMES } from "@cueplusplus/tokens";
|
|
2
2
|
//#region src/system/prepaint.ts
|
|
3
3
|
/**
|
|
4
4
|
* Pre-paint stamping. Server-safe by design: no `"use client"`, no React, no
|
|
@@ -16,39 +16,45 @@ const scriptSafe = (json) => json.replace(/</g, "\\u003c").replace(/>/g, "\\u003
|
|
|
16
16
|
function jsStringLiteral(value) {
|
|
17
17
|
return scriptSafe(JSON.stringify(value));
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* fallback, which is what an app that passes no `density` renders at.
|
|
41
|
-
* @returns One line of JavaScript, safe to inline verbatim.
|
|
42
|
-
* @example
|
|
43
|
-
* // An app whose provider is <ThemeProvider theme="terminal" density="normal">:
|
|
44
|
-
* prepaintScript(DEFAULT_STORAGE_KEY, "terminal", "normal");
|
|
45
|
-
*/
|
|
46
|
-
function prepaintScript(storageKey = DEFAULT_STORAGE_KEY, defaultTheme = "cue", defaultDensity = DEFAULT_DENSITY, defaultFont = DEFAULT_FONT) {
|
|
19
|
+
function prepaintScript(storageKeyOrOptions = DEFAULT_STORAGE_KEY, defaultTheme = "cue", defaultDensity = DEFAULT_DENSITY, defaultFont = DEFAULT_FONT) {
|
|
20
|
+
const options = typeof storageKeyOrOptions === "string" ? {
|
|
21
|
+
storageKey: storageKeyOrOptions,
|
|
22
|
+
defaults: {
|
|
23
|
+
theme: defaultTheme,
|
|
24
|
+
density: defaultDensity,
|
|
25
|
+
mode: "dark"
|
|
26
|
+
},
|
|
27
|
+
readStoredPreferences: true
|
|
28
|
+
} : storageKeyOrOptions;
|
|
29
|
+
if (options === null || typeof options !== "object" || options.defaults === void 0) throw new TypeError("prepaintScript options require a complete default triple");
|
|
30
|
+
const defaults = options.defaults;
|
|
31
|
+
if (defaults.theme === void 0 || defaults.density === void 0 || defaults.mode === void 0) throw new TypeError("prepaintScript options require a complete default triple");
|
|
32
|
+
if (!THEMES.includes(defaults.theme)) throw new TypeError("prepaintScript defaults contain an invalid theme");
|
|
33
|
+
if (!DENSITIES.includes(defaults.density)) throw new TypeError("prepaintScript defaults contain an invalid density");
|
|
34
|
+
if (!MODES.includes(defaults.mode)) throw new TypeError("prepaintScript defaults contain an invalid mode");
|
|
35
|
+
if (defaults.font !== void 0 && !FONTS.includes(defaults.font)) throw new TypeError("prepaintScript defaults contain an invalid font");
|
|
36
|
+
if (options.readStoredPreferences !== void 0 && typeof options.readStoredPreferences !== "boolean") throw new TypeError("prepaintScript readStoredPreferences must be boolean");
|
|
37
|
+
const storageKey = options.storageKey ?? "cue-ui";
|
|
38
|
+
if (typeof storageKey !== "string") throw new TypeError("prepaintScript storageKey must be a string");
|
|
39
|
+
const readStoredPreferences = options.readStoredPreferences ?? true;
|
|
47
40
|
const key = jsStringLiteral(storageKey);
|
|
48
|
-
const fallbackTheme = jsStringLiteral(
|
|
49
|
-
const fallbackDensity = jsStringLiteral(
|
|
50
|
-
const
|
|
51
|
-
|
|
41
|
+
const fallbackTheme = jsStringLiteral(defaults.theme);
|
|
42
|
+
const fallbackDensity = jsStringLiteral(defaults.density);
|
|
43
|
+
const fallbackMode = jsStringLiteral(defaults.mode);
|
|
44
|
+
const fallbackFont = jsStringLiteral(defaults.font ?? defaultFont);
|
|
45
|
+
const themes = scriptSafe(JSON.stringify([...THEMES]));
|
|
46
|
+
const densities = scriptSafe(JSON.stringify([...DENSITIES]));
|
|
47
|
+
const modes = scriptSafe(JSON.stringify([...MODES]));
|
|
48
|
+
/**
|
|
49
|
+
* The pairings, from the package that authors them, for the same reason.
|
|
50
|
+
*
|
|
51
|
+
* This is also the axis where an unvalidated read is worst: a stale or
|
|
52
|
+
* hand-edited `font` would stamp an attribute the stylesheet has no block
|
|
53
|
+
* for, `--cue-font-sans` would keep the base stack, and the page would render
|
|
54
|
+
* in a family the picker says is not selected.
|
|
55
|
+
*/
|
|
56
|
+
const pairings = scriptSafe(JSON.stringify([...FONTS]));
|
|
57
|
+
return `!function(){try{var k=${key},e=document.documentElement,s=null;` + (readStoredPreferences ? "try{var r=localStorage.getItem(k);s=r?JSON.parse(r):null}catch(_){}" : "") + `s=s&&typeof s=="object"?s:{};var t=${themes}.indexOf(s.theme)>-1?s.theme:${fallbackTheme};var d=${densities}.indexOf(s.density)>-1?s.density:${fallbackDensity};var f=${pairings}.indexOf(s.font)>-1?s.font:${fallbackFont};var m=${modes}.indexOf(s.mode)>-1?s.mode:${fallbackMode};e.setAttribute("data-theme",t);e.setAttribute("data-density",d);e.setAttribute("data-font",f);e.setAttribute("data-mode",m);e.style.colorScheme=m==="system"?"light dark":m}catch(_){}}()`;
|
|
52
58
|
}
|
|
53
59
|
//#endregion
|
|
54
60
|
export { DEFAULT_STORAGE_KEY, prepaintScript };
|
|
@@ -24,6 +24,13 @@ interface ThemeContextValue {
|
|
|
24
24
|
/** Switch the font pairing and persist the new preference. */
|
|
25
25
|
setFont: (font: FontName) => void;
|
|
26
26
|
}
|
|
27
|
+
/** Provider-owned font-family overrides that detached portals must republish. */
|
|
28
|
+
interface FontFamilies {
|
|
29
|
+
/** Value for `--cue-font-sans`. */
|
|
30
|
+
sans?: string;
|
|
31
|
+
/** Value for `--cue-font-mono`. */
|
|
32
|
+
mono?: string;
|
|
33
|
+
}
|
|
27
34
|
interface ThemeProviderProps {
|
|
28
35
|
/** Initial theme preset. Defaults to `"cue"`. Changing it after mount adopts the new value. */
|
|
29
36
|
theme?: ThemeName;
|
|
@@ -49,12 +56,16 @@ interface ThemeProviderProps {
|
|
|
49
56
|
font?: FontName;
|
|
50
57
|
/** Multiplier on every text token, published as `--cue-font-scale`. Defaults to `1`. */
|
|
51
58
|
fontScale?: number;
|
|
59
|
+
/** Optional app-owned font stacks, published as inline CUE font custom properties. */
|
|
60
|
+
fontFamilies?: FontFamilies;
|
|
52
61
|
/**
|
|
53
62
|
* localStorage key holding `{ theme, density, font, mode }`. Defaults to `"cue-ui"`.
|
|
54
63
|
* Only the outermost provider reads or writes it — a nested provider is an
|
|
55
64
|
* island whose explicit props are the point, not a second preference store.
|
|
56
65
|
*/
|
|
57
66
|
storageKey?: string;
|
|
67
|
+
/** Restore and write root preferences in localStorage. Defaults to `true`. */
|
|
68
|
+
persistPreferences?: boolean;
|
|
58
69
|
/** Stamp the single child element instead of rendering a wrapper `<div>`. */
|
|
59
70
|
asChild?: boolean;
|
|
60
71
|
/** Extra classes for the provider root. */
|
|
@@ -93,6 +104,6 @@ interface ThemeProviderProps {
|
|
|
93
104
|
* <App />
|
|
94
105
|
* </ThemeProvider>
|
|
95
106
|
*/
|
|
96
|
-
declare function ThemeProvider({ theme: themeProp, density: densityProp, mode: modeProp, font: fontProp, fontScale, storageKey, asChild, className, style: styleProp, children }: ThemeProviderProps): React.JSX.Element;
|
|
107
|
+
declare function ThemeProvider({ theme: themeProp, density: densityProp, mode: modeProp, font: fontProp, fontScale, fontFamilies, storageKey, persistPreferences, asChild, className, style: styleProp, children }: ThemeProviderProps): React.JSX.Element;
|
|
97
108
|
//#endregion
|
|
98
|
-
export { ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps };
|
|
109
|
+
export { FontFamilies, ResolvedMode, ThemeContextValue, ThemeProvider, ThemeProviderProps };
|