eidotter 0.45.0 → 0.46.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/README.md +4 -4
- package/dist/components/Alert/components/Alert.js +1 -1
- package/dist/components/Badge/components/Badge.js +5 -5
- package/dist/components/Button/components/Button.js +8 -8
- package/dist/components/Chat/components/ChatHistory.js +1 -1
- package/dist/components/Chat/components/ChatInput.js +1 -1
- package/dist/components/Chat/components/ChatMessage.js +1 -1
- package/dist/components/Checkbox/components/Checkbox.js +1 -1
- package/dist/components/ChecklistRow/components/ChecklistRow.js +1 -1
- package/dist/components/CopyButton/components/CopyButton.js +1 -1
- package/dist/components/DecayStrip/components/DecayStrip.js +3 -3
- package/dist/components/DisplayMenu/components/DisplayMenu.d.ts +4 -3
- package/dist/components/DisplayMenu/components/DisplayMenu.js +11 -7
- package/dist/components/EmptyState/components/EmptyState.js +1 -1
- package/dist/components/Gauge/components/Gauge.js +4 -4
- package/dist/components/Header/components/Header.d.ts +8 -4
- package/dist/components/Header/components/Header.js +1 -1
- package/dist/components/Header/components/HeaderContextRow.js +1 -1
- package/dist/components/HeaderButton/components/HeaderButton.d.ts +38 -0
- package/dist/components/HeaderButton/components/HeaderButton.js +25 -0
- package/dist/components/HeaderButton/components/index.d.ts +2 -0
- package/dist/components/HeaderButton/components/index.js +1 -0
- package/dist/components/HeaderButton/index.d.ts +2 -0
- package/dist/components/HeaderButton/index.js +1 -0
- package/dist/components/LabeledProgress/components/LabeledProgress.js +1 -1
- package/dist/components/LedgerRow/components/LedgerRow.js +1 -1
- package/dist/components/Meter/components/Meter.js +3 -3
- package/dist/components/Notification/components/Notification.js +1 -1
- package/dist/components/PageShell/components/PageShell.d.ts +12 -6
- package/dist/components/PageShell/components/PageShell.js +7 -4
- package/dist/components/Progress/components/Progress.js +6 -5
- package/dist/components/RangeBar/components/RangeBar.js +3 -3
- package/dist/components/Select/components/Select.js +6 -6
- package/dist/components/SeriesBars/components/SeriesBars.js +3 -3
- package/dist/components/Stat/components/Stat.js +6 -6
- package/dist/components/Switch/components/Switch.d.ts +2 -0
- package/dist/components/Tag/components/Tag.js +5 -5
- package/dist/components/VitalsStrip/components/VitalsStrip.js +4 -4
- package/dist/components/registry.js +18 -0
- package/dist/eidotter.css +2 -2
- package/dist/index.d.ts +5 -1
- package/dist/index.es.js +422 -300
- package/dist/index.umd.js +1 -1
- package/dist/utils/displayTheme.d.ts +53 -0
- package/dist/utils/displayTheme.js +76 -0
- package/guidelines/README.md +8 -0
- package/llms.txt +3 -3
- package/migrations/0.45.0.md +9 -5
- package/migrations/0.46.0.md +120 -0
- package/migrations/README.md +2 -0
- package/package.json +1 -1
- package/src/styles/shadcn.css +1 -1
- package/src/styles/theme.amber-paper.css +3 -3
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
[](./LICENSE.md)
|
|
16
16
|
[](https://react.dev/)
|
|
17
17
|
|
|
18
|
-
**eiDotter** is a React component library that takes the DOS/CGA terminal aesthetic seriously: authentic 16-color palette, bitmap-accurate typography, phosphor glow physics, keyboard-first interactions.
|
|
18
|
+
**eiDotter** is a React component library that takes the DOS/CGA terminal aesthetic seriously: authentic 16-color palette, bitmap-accurate typography, phosphor glow physics, keyboard-first interactions. 63 components across forms, navigation, windowing, timelines, health displays, and terminal chrome — shipped as ES modules with a prebuilt stylesheet so consumers don't need Tailwind to use it.
|
|
19
19
|
|
|
20
20
|
→ **[Storybook](https://cinimody.github.io/eiDotter/)** · **[CHANGELOG](./CHANGELOG.md)** · **[Accessibility](./ACCESSIBILITY.md)** · **[Issues](https://github.com/CinimoDY/eiDotter/issues)** · **[npm](https://www.npmjs.com/package/eidotter)**
|
|
21
21
|
|
|
@@ -116,9 +116,9 @@ for client apps and `'use client'` files.
|
|
|
116
116
|
|
|
117
117
|
## Upgrading
|
|
118
118
|
|
|
119
|
-
Every minor with breaking or visible changes ships an upgrade guide in the package, at `node_modules/eidotter/migrations/<version>.md` (source: [`migrations/`](./migrations/)). Read every guide between your installed version and the target, oldest first. Start with [0.41.0](./migrations/0.41.0.md), then [0.43.0](./migrations/0.43.0.md), [0.44.0](./migrations/0.44.0.md)
|
|
119
|
+
Every minor with breaking or visible changes ships an upgrade guide in the package, at `node_modules/eidotter/migrations/<version>.md` (source: [`migrations/`](./migrations/)). Read every guide between your installed version and the target, oldest first. Start with [0.41.0](./migrations/0.41.0.md), then [0.43.0](./migrations/0.43.0.md), [0.44.0](./migrations/0.44.0.md) , [0.45.0](./migrations/0.45.0.md) and [0.46.0](./migrations/0.46.0.md).
|
|
120
120
|
|
|
121
|
-
0.x caret ranges stop at the next minor (`^0.40.2` never resolves to 0.41.0), so bump the range explicitly: `npm install eidotter@^0.
|
|
121
|
+
0.x caret ranges stop at the next minor (`^0.40.2` never resolves to 0.41.0), so bump the range explicitly: `npm install eidotter@^0.46.0`.
|
|
122
122
|
|
|
123
123
|
## Documentation
|
|
124
124
|
|
|
@@ -133,7 +133,7 @@ Every minor with breaking or visible changes ships an upgrade guide in the packa
|
|
|
133
133
|
|
|
134
134
|
## Components
|
|
135
135
|
|
|
136
|
-
|
|
136
|
+
63 components across six families — [complete catalog in Storybook](https://cinimody.github.io/eiDotter/). Also exported but not tabled below: Bench, CalendarHeatmap, Connector, CopyButton, ChecklistRow, DisplayMenu, EmptyState, HeaderButton, HoldToComplete, LabeledProgress, LedgerRow, PageShell (with PageSection), ProgressRing, SectionHeading, Select, TimelineFeed, TimelinePage and the `Mark` brand component.
|
|
137
137
|
|
|
138
138
|
<details>
|
|
139
139
|
<summary><strong>Windowing & shell</strong> — Terminal, DosDialog, DosWindow, IconButton, Modal, Lightbox, CommandPrompt, CmdPalette, Header, Footer, Nav, Brand</summary>
|
|
@@ -47,6 +47,6 @@ export const Alert = forwardRef(({ color: colorProp, size = 'floating', type, ti
|
|
|
47
47
|
...(actions || []),
|
|
48
48
|
...(onClickHere ? [{ label: 'Click here', onClick: onClickHere }] : []),
|
|
49
49
|
];
|
|
50
|
-
return (_jsxs("div", { ref: ref, className: cn('relative w-full flex flex-col gap-4 p-4', 'font-dos text-dos-text-
|
|
50
|
+
return (_jsxs("div", { ref: ref, className: cn('relative w-full flex flex-col gap-4 p-4', 'font-dos text-dos-text-base', 'border border-dos-border-default', 'eidotter-alert', `eidotter-alert--${resolvedColor}`, resolvedSize === 'floating' && 'max-w-[1216px]', resolvedSize === 'full-width' && 'eidotter-alert--full-width max-w-none', isClosing && 'eidotter-alert--closing', className), onAnimationEnd: handleAnimationEnd, role: "alert", "data-color": resolvedColor, "data-size": resolvedSize, children: [_jsx("div", { className: "eidotter-alert__icon", children: _jsx(Icon, { name: COLOR_ICONS[resolvedColor] || 'Info', size: "S", "aria-label": `${resolvedColor} alert` }) }), _jsxs("div", { className: cn('flex-1 flex flex-col gap-3 min-w-0', onClose && 'pr-6'), children: [(title || children) && (_jsxs("div", { className: "flex flex-col gap-1", children: [title && (_jsx("div", { className: "eidotter-alert__title font-dos leading-[140%]", children: title })), children && (_jsx("div", { className: "eidotter-alert__text font-dos leading-[140%]", children: children }))] })), allActions.length > 0 && (_jsx("div", { className: "flex flex-row gap-3", children: allActions.map((action, i) => (_jsxs(AriaButton, { className: "eidotter-alert__action", onPress: action.onClick, children: [action.label, action.icon] }, i))) }))] }), onClose && (_jsx(IconButton, { icon: "Close", label: "Close alert", className: "eidotter-alert__close", onPress: triggerClose }))] }));
|
|
51
51
|
});
|
|
52
52
|
Alert.displayName = 'Alert';
|
|
@@ -2,11 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { cn } from '../../../utils/cn.js';
|
|
4
4
|
const sizeClasses = {
|
|
5
|
-
sm: 'text-dos-text-
|
|
6
|
-
md: 'text-dos-text-
|
|
7
|
-
lg: 'text-dos-text-
|
|
8
|
-
small: 'text-dos-text-
|
|
9
|
-
medium: 'text-dos-text-
|
|
5
|
+
sm: 'text-dos-text-base px-2 py-0.5 min-h-6 gap-1',
|
|
6
|
+
md: 'text-dos-text-base px-2.5 py-1 min-h-7 gap-1.5',
|
|
7
|
+
lg: 'text-dos-text-base px-3 py-1.5 min-h-8 gap-1.5',
|
|
8
|
+
small: 'text-dos-text-base px-2 py-0.5 min-h-6 gap-1',
|
|
9
|
+
medium: 'text-dos-text-base px-2.5 py-1 min-h-7 gap-1.5',
|
|
10
10
|
};
|
|
11
11
|
const variantClasses = {
|
|
12
12
|
default: 'eidotter-badge--default',
|
|
@@ -4,14 +4,14 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import { Button as AriaButton } from 'react-aria-components';
|
|
5
5
|
import { cn } from '../../../utils/cn.js';
|
|
6
6
|
const sizeClasses = {
|
|
7
|
-
xs: 'text-dos-text-
|
|
8
|
-
sm: 'text-dos-text-
|
|
9
|
-
md: 'text-dos-text-
|
|
10
|
-
lg: 'text-dos-text-
|
|
11
|
-
xl: 'text-dos-text-
|
|
12
|
-
small: 'text-dos-text-
|
|
13
|
-
medium: 'text-dos-text-
|
|
14
|
-
large: 'text-dos-text-
|
|
7
|
+
xs: 'text-dos-text-base px-2 py-1 min-h-6 gap-1',
|
|
8
|
+
sm: 'text-dos-text-base px-2.5 py-1 min-h-7 gap-1',
|
|
9
|
+
md: 'text-dos-text-base px-3 py-2 min-h-8 gap-1.5',
|
|
10
|
+
lg: 'text-dos-text-base px-4 py-2.5 min-h-10 gap-2',
|
|
11
|
+
xl: 'text-dos-text-base px-5 py-3 min-h-11 gap-2',
|
|
12
|
+
small: 'text-dos-text-base px-2.5 py-1 min-h-7 gap-1',
|
|
13
|
+
medium: 'text-dos-text-base px-3 py-2 min-h-8 gap-1.5',
|
|
14
|
+
large: 'text-dos-text-base px-4 py-2.5 min-h-10 gap-2',
|
|
15
15
|
};
|
|
16
16
|
const variantClasses = {
|
|
17
17
|
primary: 'eidotter-btn--primary',
|
|
@@ -16,7 +16,7 @@ export const ChatHistory = ({ messages, isStreaming = false, userPrefix, assista
|
|
|
16
16
|
}, [messages.length, isStreaming]);
|
|
17
17
|
const classes = cn('flex-1 overflow-y-auto font-dos p-2 min-h-0', 'eidotter-chat-history', className);
|
|
18
18
|
if (messages.length === 0) {
|
|
19
|
-
return (_jsx("div", { className: classes, role: "log", "aria-live": "polite", tabIndex: 0, ...props, children: _jsx("div", { className: "flex items-center justify-center h-full min-h-16", children: _jsx("span", { className: "text-dos-text-muted font-dos text-dos-text-
|
|
19
|
+
return (_jsx("div", { className: classes, role: "log", "aria-live": "polite", tabIndex: 0, ...props, children: _jsx("div", { className: "flex items-center justify-center h-full min-h-16", children: _jsx("span", { className: "text-dos-text-muted font-dos text-dos-text-base", children: "Awaiting input..." }) }) }));
|
|
20
20
|
}
|
|
21
21
|
return (_jsx("div", { className: classes, role: "log", "aria-live": "polite", tabIndex: 0, ...props, children: _jsxs("div", { className: "flex flex-col", children: [messages.map((msg, index) => {
|
|
22
22
|
const isLastAssistant = isStreaming &&
|
|
@@ -33,5 +33,5 @@ export const ChatInput = ({ onSend, prompt = '>', placeholder, disabled = false,
|
|
|
33
33
|
textareaRef.current.focus();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
return (_jsxs("div", { className: cn('flex items-start font-dos text-dos-text-
|
|
36
|
+
return (_jsxs("div", { className: cn('flex items-start font-dos text-dos-text-base p-2 cursor-text', 'text-dos-text-brand', 'eidotter-chat-input', disabled && 'eidotter-chat-input--disabled', className), onClick: handleContainerClick, ...props, children: [_jsx("span", { className: "text-dos-text-brand mr-2 mt-0.5 whitespace-nowrap select-none", "aria-hidden": "true", children: prompt }), _jsxs("div", { className: "flex items-start flex-1 min-w-0", children: [_jsx("textarea", { ref: textareaRef, className: "eidotter-chat-input__textarea", value: value, onChange: (e) => setValue(e.target.value), onKeyDown: handleKeyDown, placeholder: placeholder, disabled: disabled, rows: 1, "aria-label": "Chat input" }), _jsx("span", { className: "eidotter-chat-input__cursor", "aria-hidden": "true", children: "_" })] })] }));
|
|
37
37
|
};
|
|
@@ -14,5 +14,5 @@ const roleClasses = {
|
|
|
14
14
|
*/
|
|
15
15
|
export const ChatMessage = ({ role, content, isStreaming = false, userPrefix = '>', assistantPrefix = 'C:\\>', className, ...props }) => {
|
|
16
16
|
const prefix = role === 'user' ? userPrefix : role === 'assistant' ? assistantPrefix : '';
|
|
17
|
-
return (_jsxs("div", { className: cn('flex gap-2 font-dos text-dos-text-
|
|
17
|
+
return (_jsxs("div", { className: cn('flex gap-2 font-dos text-dos-text-base leading-[1.4] py-1 whitespace-pre-wrap break-words', roleClasses[role], isStreaming && 'eidotter-chat-message--streaming', className), ...props, children: [prefix && (_jsx("span", { className: "shrink-0 select-none", "aria-hidden": "true", children: prefix })), _jsx("span", { className: "min-w-0", children: content }), isStreaming && (_jsx("span", { className: "eidotter-chat-message__cursor", "aria-hidden": "true", children: "_" }))] }));
|
|
18
18
|
};
|
|
@@ -7,5 +7,5 @@ import { cn } from '../../../utils/cn.js';
|
|
|
7
7
|
* DOS-styled Checkbox with bracket text indicator [ ] / [X].
|
|
8
8
|
* Built on React Aria for accessible keyboard/focus handling.
|
|
9
9
|
*/
|
|
10
|
-
export const Checkbox = forwardRef(({ checked, defaultChecked, onChange, indeterminate = false, label, disabled = false, size = 'md', name, value, className, 'aria-label': ariaLabel, ...props }, ref) => (_jsx(AriaCheckbox, { ref: ref, isSelected: checked, defaultSelected: defaultChecked, isIndeterminate: indeterminate, onChange: onChange, isDisabled: disabled, name: name, value: value, "aria-label": ariaLabel || label, className: cn('inline-flex items-center gap-2 cursor-pointer select-none group', 'font-dos',
|
|
10
|
+
export const Checkbox = forwardRef(({ checked, defaultChecked, onChange, indeterminate = false, label, disabled = false, size = 'md', name, value, className, 'aria-label': ariaLabel, ...props }, ref) => (_jsx(AriaCheckbox, { ref: ref, isSelected: checked, defaultSelected: defaultChecked, isIndeterminate: indeterminate, onChange: onChange, isDisabled: disabled, name: name, value: value, "aria-label": ariaLabel || label, className: cn('inline-flex items-center gap-2 cursor-pointer select-none group', 'font-dos', 'text-dos-text-base', 'eidotter-checkbox', disabled && 'opacity-60 cursor-not-allowed', className), "data-size": size, ...props, children: ({ isSelected, isIndeterminate: isIndet }) => (_jsxs(_Fragment, { children: [_jsx("span", { className: cn('eidotter-checkbox__box', isSelected && 'eidotter-checkbox__box--checked', isIndet && 'eidotter-checkbox__box--indeterminate'), children: isIndet ? '[-]' : isSelected ? '[X]' : '[ ]' }), label && _jsx("span", { className: "eidotter-checkbox__label", children: label })] })) })));
|
|
11
11
|
Checkbox.displayName = 'Checkbox';
|
|
@@ -14,5 +14,5 @@ const labelToneClasses = {
|
|
|
14
14
|
* `[x]`/`[ ]` glyph is the DOS checkbox aesthetic. Tones and the note route
|
|
15
15
|
* through `text-dos-*` semantic roles (not raw `cga-*`) so the row re-themes.
|
|
16
16
|
*/
|
|
17
|
-
export const ChecklistRow = ({ checked, onToggle, disabled, pending, ariaLabel, labelTone = 'default', label, children, note, leading, trailing, className, }) => (_jsxs("div", { className: cn('eidotter-checklist-row', 'flex items-start gap-3 py-2 border-b border-dos-border-disabled', pending && 'opacity-50', className), children: [_jsx("button", { type: "button", role: "checkbox", "aria-checked": checked, onClick: onToggle, disabled: disabled, "aria-label": ariaLabel ?? (checked ? 'Mark as incomplete' : 'Mark as complete'), className: cn('shrink-0 pt-0.5 font-dos text-dos-text-
|
|
17
|
+
export const ChecklistRow = ({ checked, onToggle, disabled, pending, ariaLabel, labelTone = 'default', label, children, note, leading, trailing, className, }) => (_jsxs("div", { className: cn('eidotter-checklist-row', 'flex items-start gap-3 py-2 border-b border-dos-border-disabled', pending && 'opacity-50', className), children: [_jsx("button", { type: "button", role: "checkbox", "aria-checked": checked, onClick: onToggle, disabled: disabled, "aria-label": ariaLabel ?? (checked ? 'Mark as incomplete' : 'Mark as complete'), className: cn('shrink-0 pt-0.5 font-dos text-dos-text-base', 'text-dos-text-primary hover:text-dos-text-accent', 'cursor-pointer disabled:cursor-not-allowed'), children: checked ? '[x]' : '[ ]' }), _jsxs("div", { className: "flex-1 min-w-0", children: [leading && _jsx("div", { className: "mb-1", children: leading }), label !== undefined && (_jsx("div", { className: cn('font-dos text-dos-text-base', labelToneClasses[labelTone]), children: label })), children, note && _jsx("p", { className: "font-dos text-dos-text-base text-dos-text-muted mt-0.5", children: note })] }), trailing && _jsx("div", { className: "flex items-center gap-2 shrink-0", children: trailing })] }));
|
|
18
18
|
ChecklistRow.displayName = 'ChecklistRow';
|
|
@@ -45,6 +45,6 @@ export const CopyButton = ({ value, label = '[cp]', copiedLabel = '[OK]', title
|
|
|
45
45
|
markCopied();
|
|
46
46
|
}
|
|
47
47
|
}, [value, markCopied, fallbackCopy]);
|
|
48
|
-
return (_jsx("button", { type: "button", onClick: copy, title: copied ? copiedTitle : title, "aria-label": copied ? copiedTitle : title, className: cn('eidotter-copy-button', 'font-dos text-dos-text-
|
|
48
|
+
return (_jsx("button", { type: "button", onClick: copy, title: copied ? copiedTitle : title, "aria-label": copied ? copiedTitle : title, className: cn('eidotter-copy-button', 'font-dos text-dos-text-base px-1', 'text-dos-link hover:text-dos-link-hover cursor-pointer', className), children: copied ? copiedLabel : label }));
|
|
49
49
|
};
|
|
50
50
|
CopyButton.displayName = 'CopyButton';
|
|
@@ -6,9 +6,9 @@ import { EmptyState } from '../../EmptyState/index.js';
|
|
|
6
6
|
import { formatValue, isKnown, PLACEHOLDER, provenanceLabel, resolveLabels, } from '../../../utils/health/index.js';
|
|
7
7
|
import { normaliseSamples, resample, toMs } from './resample.js';
|
|
8
8
|
const sizeClasses = {
|
|
9
|
-
sm: 'eidotter-decay-strip--sm text-dos-text-
|
|
10
|
-
md: 'eidotter-decay-strip--md text-dos-text-
|
|
11
|
-
lg: 'eidotter-decay-strip--lg text-dos-text-
|
|
9
|
+
sm: 'eidotter-decay-strip--sm text-dos-text-base',
|
|
10
|
+
md: 'eidotter-decay-strip--md text-dos-text-base',
|
|
11
|
+
lg: 'eidotter-decay-strip--lg text-dos-text-base',
|
|
12
12
|
};
|
|
13
13
|
const toneClasses = {
|
|
14
14
|
neutral: 'eidotter-tone--neutral',
|
|
@@ -37,14 +37,15 @@ export interface DisplayMenuProps {
|
|
|
37
37
|
/**
|
|
38
38
|
* DisplayMenu: one header control for display options (DMNC-1619).
|
|
39
39
|
*
|
|
40
|
-
* A trigger
|
|
40
|
+
* A HeaderButton trigger (pixel monitor glyph, label, ▾) opens a small panel of
|
|
41
41
|
* rows, each a label and an eidotter `Switch`, for options such as DOS mode
|
|
42
42
|
* or the amber-paper theme. Built for Header's `end` slot so every site has
|
|
43
43
|
* one theme control instead of switches side by side.
|
|
44
44
|
*
|
|
45
45
|
* The panel is a React Aria popover dialog: it portals out of the header (so
|
|
46
|
-
* the end slot's clip never cuts it),
|
|
47
|
-
* and
|
|
46
|
+
* the end slot's clip never cuts it), opening it focuses the first enabled
|
|
47
|
+
* switch, Escape and a click outside close it and focus returns to the
|
|
48
|
+
* trigger, and Tab moves between the switches.
|
|
48
49
|
* Consumers own the state; DisplayMenu only renders it.
|
|
49
50
|
*/
|
|
50
51
|
export declare const DisplayMenu: React.ForwardRefExoticComponent<DisplayMenuProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useId } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Popover as AriaPopover, } from 'react-aria-components';
|
|
5
5
|
import { Monitor } from 'pixelarticons/react/Monitor.js';
|
|
6
|
-
import { ChevronDown } from 'pixelarticons/react/ChevronDown.js';
|
|
7
6
|
import { Switch } from '../../Switch/index.js';
|
|
7
|
+
import { HeaderButton } from '../../HeaderButton/index.js';
|
|
8
8
|
import { cn } from '../../../utils/cn.js';
|
|
9
9
|
/**
|
|
10
10
|
* DisplayMenu: one header control for display options (DMNC-1619).
|
|
11
11
|
*
|
|
12
|
-
* A trigger
|
|
12
|
+
* A HeaderButton trigger (pixel monitor glyph, label, ▾) opens a small panel of
|
|
13
13
|
* rows, each a label and an eidotter `Switch`, for options such as DOS mode
|
|
14
14
|
* or the amber-paper theme. Built for Header's `end` slot so every site has
|
|
15
15
|
* one theme control instead of switches side by side.
|
|
16
16
|
*
|
|
17
17
|
* The panel is a React Aria popover dialog: it portals out of the header (so
|
|
18
|
-
* the end slot's clip never cuts it),
|
|
19
|
-
* and
|
|
18
|
+
* the end slot's clip never cuts it), opening it focuses the first enabled
|
|
19
|
+
* switch, Escape and a click outside close it and focus returns to the
|
|
20
|
+
* trigger, and Tab moves between the switches.
|
|
20
21
|
* Consumers own the state; DisplayMenu only renders it.
|
|
21
22
|
*/
|
|
22
23
|
export const DisplayMenu = forwardRef(({ items, label = 'Display', labelDisplay = 'responsive', placement = 'bottom end', defaultOpen, className, }, ref) => {
|
|
23
24
|
const baseId = useId();
|
|
24
|
-
|
|
25
|
+
// Opening the panel puts focus on the first switch that can be toggled,
|
|
26
|
+
// so Space works straight away (DMNC-1619 follow-up).
|
|
27
|
+
const firstEnabled = items.findIndex((item) => !item.disabled);
|
|
28
|
+
return (_jsxs(AriaDialogTrigger, { defaultOpen: defaultOpen, children: [_jsx(HeaderButton, { ref: ref, "aria-label": label, icon: _jsx(Monitor, { className: "eidotter-display-menu__icon", focusable: "false" }), chevron: true, labelDisplay: labelDisplay, className: cn('eidotter-display-menu', `eidotter-display-menu--${labelDisplay}`, className), children: label }), _jsx(AriaPopover, { placement: placement, offset: 6, className: "eidotter-display-menu__popover", children: _jsx(AriaDialog, { "aria-label": label, className: "eidotter-display-menu__panel", children: _jsx("ul", { className: "eidotter-display-menu__list", children: items.map((item, index) => {
|
|
25
29
|
const hintId = item.hint ? `${baseId}-${item.id}-hint` : undefined;
|
|
26
|
-
return (_jsxs("li", { className: "eidotter-display-menu__row", children: [_jsx(Switch, { label: item.label, checked: item.checked, onChange: item.onChange, disabled: item.disabled, "aria-describedby": hintId, className: "eidotter-display-menu__switch" }), item.hint && (_jsx("span", { id: hintId, className: "eidotter-display-menu__hint", children: item.hint }))] }, item.id));
|
|
30
|
+
return (_jsxs("li", { className: "eidotter-display-menu__row", children: [_jsx(Switch, { label: item.label, checked: item.checked, onChange: item.onChange, disabled: item.disabled, "aria-describedby": hintId, autoFocus: index === firstEnabled, className: "eidotter-display-menu__switch" }), item.hint && (_jsx("span", { id: hintId, className: "eidotter-display-menu__hint", children: item.hint }))] }, item.id));
|
|
27
31
|
}) }) }) })] }));
|
|
28
32
|
});
|
|
29
33
|
DisplayMenu.displayName = 'DisplayMenu';
|
|
@@ -14,5 +14,5 @@ const toneClasses = {
|
|
|
14
14
|
* `text-dos-*` semantic roles (not raw `cga-*`) so it re-themes and the
|
|
15
15
|
* description stays AA-safe (`text-muted` → lightGray under amber-mono).
|
|
16
16
|
*/
|
|
17
|
-
export const EmptyState = ({ title, description, tone = 'default', action, className, }) => (_jsxs("div", { className: cn('eidotter-empty-state', 'flex flex-col gap-2 py-6 text-center', className), role: "status", children: [_jsx("p", { className: cn('font-dos text-dos-text-
|
|
17
|
+
export const EmptyState = ({ title, description, tone = 'default', action, className, }) => (_jsxs("div", { className: cn('eidotter-empty-state', 'flex flex-col gap-2 py-6 text-center', className), role: "status", children: [_jsx("p", { className: cn('font-dos text-dos-text-base', toneClasses[tone]), children: title }), description && (_jsx("p", { className: "font-dos text-dos-text-base text-dos-text-muted", children: description })), action && _jsx("div", { className: "mt-2", children: action })] }));
|
|
18
18
|
EmptyState.displayName = 'EmptyState';
|
|
@@ -5,9 +5,9 @@ import { ProgressRing } from '../../ProgressRing/index.js';
|
|
|
5
5
|
import { Skeleton } from '../../Skeleton/index.js';
|
|
6
6
|
import { formatValue, isKnown, provenanceLabel, resolveBand, resolveLabels, PLACEHOLDER, } from '../../../utils/health/index.js';
|
|
7
7
|
const sizeClasses = {
|
|
8
|
-
sm: 'eidotter-gauge--sm text-dos-text-
|
|
9
|
-
md: 'eidotter-gauge--md text-dos-text-
|
|
10
|
-
lg: 'eidotter-gauge--lg text-dos-text-
|
|
8
|
+
sm: 'eidotter-gauge--sm text-dos-text-base',
|
|
9
|
+
md: 'eidotter-gauge--md text-dos-text-base',
|
|
10
|
+
lg: 'eidotter-gauge--lg text-dos-text-base',
|
|
11
11
|
};
|
|
12
12
|
const valueSizeClasses = {
|
|
13
13
|
sm: 'text-dos-text-sm',
|
|
@@ -74,7 +74,7 @@ export const Gauge = forwardRef(({ label, shortLabel, value, max = 100, unit, se
|
|
|
74
74
|
// The small ring's hole cannot hold a secondary line, so it sits under the ring.
|
|
75
75
|
const secondaryBelow = sizeKey === 'sm';
|
|
76
76
|
const [secondaryHead, secondaryTail] = splitSecondary(secondary ?? '');
|
|
77
|
-
const secondaryPart = secondary && !unknown && !loading ? (_jsxs("span", { className: "eidotter-gauge__secondary text-dos-text-brand text-dos-text-
|
|
77
|
+
const secondaryPart = secondary && !unknown && !loading ? (_jsxs("span", { className: "eidotter-gauge__secondary text-dos-text-brand text-dos-text-base tabular-nums leading-none", children: [_jsx("span", { className: "eidotter-gauge__secondary-head", children: secondaryHead }), secondaryTail !== null && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "eidotter-gauge__secondary-tail", children: secondaryTail })] }))] })) : null;
|
|
78
78
|
const tagText = provenanceLabel(labels, provenance);
|
|
79
79
|
return (_jsxs("div", { ref: ref, className: cn('eidotter-gauge eidotter-health flex flex-col items-center gap-1 w-full font-dos', sizeClasses[size] ?? sizeClasses.md, toneClasses[effectiveTone], statusClasses[status], className), style: { minWidth: diameter }, "data-size": sizeKey, "data-has-short": shortLabel ? 'true' : 'false', role: "meter", "aria-valuemin": 0, "aria-valuemax": unknown ? 100 : max, "aria-valuenow": unknown || loading ? 0 : Math.max(0, Math.min(value, max)), "aria-valuetext": valuetext, "aria-label": name, "aria-busy": loading || undefined, ...props, children: [_jsxs("div", { className: "relative inline-flex items-center justify-center", children: [_jsx(ProgressRing, { decorative: true, value: loading ? 0 : pct, max: 100, size: diameter, thickness: thickness, segments: toneSegments[effectiveTone] ?? 16, color: effectiveTone === 'neutral' ? undefined : 'var(--eidotter-fill)', glow: false, className: cn(glow && 'eidotter-health-glow') }), _jsx("div", { className: "eidotter-gauge__center absolute flex flex-col items-center justify-center min-w-0 text-center leading-none", style: { inset: thickness + 2 }, children: loading ? (_jsx("div", { "aria-hidden": "true", className: "eidotter-gauge__skeleton w-full overflow-hidden", children: _jsx(Skeleton, { variant: "figure", lines: 2, animated: false }) })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: cn('eidotter-gauge__value text-dos-text-accent tabular-nums', valueSizeClasses[sizeKey], stale && 'opacity-60'), children: valueText }), !secondaryBelow && secondaryPart] })) })] }), secondaryBelow && secondaryPart, _jsxs("div", { className: "flex flex-wrap items-center justify-center gap-1 text-dos-text-brand uppercase tracking-wider leading-tight max-w-full", children: [effectiveTone === 'critical' && (_jsx("span", { "aria-hidden": "true", className: "eidotter-gauge__glyph text-dos-text-error", children: "\u25B2" })), _jsxs("span", { className: "eidotter-gauge__label truncate", title: label, children: [_jsx("span", { className: "eidotter-gauge__label--full", children: label }), shortLabel && _jsx("span", { className: "eidotter-gauge__label--short", children: shortLabel })] }), overflow && (_jsx("span", { "aria-hidden": "true", className: "eidotter-gauge__overflow text-dos-text-warning", children: "+" })), tagText !== null && (_jsx("span", { className: "eidotter-gauge__provenance border border-dos-border-brand px-1 normal-case", children: tagText })), stale && _jsx("span", { className: "eidotter-gauge__stale normal-case", children: labels.stale })] }), resolved.label && (_jsx("span", { className: "eidotter-gauge__band text-dos-text-brand normal-case", children: resolved.label }))] }));
|
|
80
80
|
});
|
|
@@ -32,7 +32,11 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
32
32
|
activeHref?: string;
|
|
33
33
|
/** Visual variant applied to both header and nav */
|
|
34
34
|
variant?: 'retro' | 'modern';
|
|
35
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Whether the header sticks to viewport top (default `true`). A sticky
|
|
37
|
+
* header paints an opaque ground so content scrolls under it; a header
|
|
38
|
+
* with `sticky={false}` paints none and shows the page's ground (0.46).
|
|
39
|
+
*/
|
|
36
40
|
sticky?: boolean;
|
|
37
41
|
/** Custom link component for framework routing (Next.js Link, React Router Link, etc.) */
|
|
38
42
|
linkComponent?: NavProps['linkComponent'];
|
|
@@ -82,9 +86,9 @@ export interface HeaderProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
82
86
|
*/
|
|
83
87
|
rule?: boolean;
|
|
84
88
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* uses
|
|
89
|
+
* Put the header's content in a flush-left column with a cap, so the brand
|
|
90
|
+
* and the end slot line up with a page column of the same width (e.g.
|
|
91
|
+
* `PageShell`). `true` uses 1200px (PageShell's default); a string is any CSS length
|
|
88
92
|
* (`'72rem'`, `'960px'`). The header itself (background, sticky) still spans
|
|
89
93
|
* the full width, and its inline padding follows the same
|
|
90
94
|
* `max(16px, safe-area inset)` gutter as PageShell. Default off.
|
|
@@ -58,6 +58,6 @@ export const Header = forwardRef(({ brandName, brandHref = '/', items, activeHre
|
|
|
58
58
|
return (_jsxs("header", { ref: ref, className: cn(
|
|
59
59
|
// contained: the header is only the full-width band (padding, bg,
|
|
60
60
|
// sticky); the layout moves to the centred inner column.
|
|
61
|
-
isContained ? 'px-4 py-3 font-dos' : cn(layoutClasses, 'px-4 py-3 font-dos'), 'eidotter-header', variantClasses[variant], stacked && 'eidotter-header--stacked', isContained && 'eidotter-header--contained', !rule && 'eidotter-header--no-rule', collapseToMark && 'eidotter-header--collapse-mark', sticky
|
|
61
|
+
isContained ? 'px-4 py-3 font-dos' : cn(layoutClasses, 'px-4 py-3 font-dos'), 'eidotter-header', variantClasses[variant], stacked && 'eidotter-header--stacked', isContained && 'eidotter-header--contained', !rule && 'eidotter-header--no-rule', collapseToMark && 'eidotter-header--collapse-mark', sticky ? 'sticky top-0 z-50 bg-dos-bg-primary' : 'eidotter-header--static', className), style: mergedStyle, ...rest, children: [skipLink, isContained ? (_jsx("div", { className: cn('eidotter-header__inner w-full', layoutClasses), children: rows })) : (rows)] }));
|
|
62
62
|
});
|
|
63
63
|
Header.displayName = 'Header';
|
|
@@ -4,7 +4,7 @@ import { cn } from '../../../utils/cn.js';
|
|
|
4
4
|
import { isSafeHref } from '../../../utils/isSafeHref.js';
|
|
5
5
|
import { Badge } from '../../Badge/index.js';
|
|
6
6
|
import { Icon, isIconName } from '../../Icon/index.js';
|
|
7
|
-
const returnPillClasses = cn('eidotter-header__return', 'inline-flex items-center gap-1 no-underline', 'border border-dos-border-default rounded-dos-base', 'px-2 py-0.5 text-dos-text-
|
|
7
|
+
const returnPillClasses = cn('eidotter-header__return', 'inline-flex items-center gap-1 no-underline', 'border border-dos-border-default rounded-dos-base', 'px-2 py-0.5 text-dos-text-base uppercase tracking-wider');
|
|
8
8
|
/**
|
|
9
9
|
* The measurable second row of the Header (DMNC-1326).
|
|
10
10
|
*
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
|
+
export interface HeaderButtonProps extends Omit<AriaButtonProps, 'children' | 'className' | 'style'> {
|
|
4
|
+
/** Leading glyph, e.g. a pixelarticons icon. Rendered `aria-hidden`. */
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
/** Text content, e.g. `'⌘K'` or `'Display'`. */
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Accessible name. Required when the text is not a readable name (`'⌘K'`)
|
|
10
|
+
* or is hidden (`labelDisplay` other than `'label'`). Defaults to the text
|
|
11
|
+
* when the text is a plain string.
|
|
12
|
+
*/
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
/**
|
|
15
|
+
* `'label'` (default): icon and text always. `'responsive'`: icon only
|
|
16
|
+
* below 640px of viewport width. `'icon'`: always icon only. Hidden text
|
|
17
|
+
* stays the accessible name through `aria-label`.
|
|
18
|
+
*/
|
|
19
|
+
labelDisplay?: 'label' | 'responsive' | 'icon';
|
|
20
|
+
/** Trailing ▾ chevron, for a control that opens a panel. */
|
|
21
|
+
chevron?: boolean;
|
|
22
|
+
/** Extra class on the button. */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* HeaderButton: the one control shape for the Header `end` slot (0.46).
|
|
27
|
+
*
|
|
28
|
+
* A 36px-tall outlined box (1px border-default, square; hover and an open
|
|
29
|
+
* panel invert to the brand fill; 2px focus ring) holding an optional pixel
|
|
30
|
+
* glyph, text and an optional chevron. DisplayMenu's trigger is a
|
|
31
|
+
* HeaderButton, and a ⌘K launcher is the same component with `⌘K` inside,
|
|
32
|
+
* so every header control has the same height, border and states. On phones
|
|
33
|
+
* (below 480px) it is 32px tall to fit beside the brand and MENU.
|
|
34
|
+
*
|
|
35
|
+
* React Aria Button: works as a `DialogTrigger`/`MenuTrigger` child and
|
|
36
|
+
* takes `onPress`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const HeaderButton: React.ForwardRefExoticComponent<HeaderButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { Button as AriaButton } from 'react-aria-components';
|
|
5
|
+
import { ChevronDown } from 'pixelarticons/react/ChevronDown.js';
|
|
6
|
+
import { cn } from '../../../utils/cn.js';
|
|
7
|
+
/**
|
|
8
|
+
* HeaderButton: the one control shape for the Header `end` slot (0.46).
|
|
9
|
+
*
|
|
10
|
+
* A 36px-tall outlined box (1px border-default, square; hover and an open
|
|
11
|
+
* panel invert to the brand fill; 2px focus ring) holding an optional pixel
|
|
12
|
+
* glyph, text and an optional chevron. DisplayMenu's trigger is a
|
|
13
|
+
* HeaderButton, and a ⌘K launcher is the same component with `⌘K` inside,
|
|
14
|
+
* so every header control has the same height, border and states. On phones
|
|
15
|
+
* (below 480px) it is 32px tall to fit beside the brand and MENU.
|
|
16
|
+
*
|
|
17
|
+
* React Aria Button: works as a `DialogTrigger`/`MenuTrigger` child and
|
|
18
|
+
* takes `onPress`.
|
|
19
|
+
*/
|
|
20
|
+
export const HeaderButton = forwardRef(({ icon, children, labelDisplay = 'label', chevron = false, className, 'aria-label': ariaLabel, ...rest }, ref) => {
|
|
21
|
+
const hasText = children != null && children !== false && children !== '';
|
|
22
|
+
const name = ariaLabel ?? (typeof children === 'string' ? children : undefined);
|
|
23
|
+
return (_jsxs(AriaButton, { ref: ref, "aria-label": name, className: cn('eidotter-header-button', `eidotter-header-button--${labelDisplay}`, !icon && 'eidotter-header-button--text-only', className), ...rest, children: [icon && _jsx("span", { className: "eidotter-header-button__icon", "aria-hidden": "true", children: icon }), hasText && (_jsx("span", { className: "eidotter-header-button__label", "aria-hidden": name ? true : undefined, children: children })), chevron && (_jsx(ChevronDown, { className: "eidotter-header-button__chevron", "aria-hidden": "true", focusable: "false" }))] }));
|
|
24
|
+
});
|
|
25
|
+
HeaderButton.displayName = 'HeaderButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeaderButton } from './HeaderButton.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeaderButton } from './components/index.js';
|
|
@@ -11,6 +11,6 @@ import { cn } from '../../../utils/cn.js';
|
|
|
11
11
|
*/
|
|
12
12
|
export const LabeledProgress = ({ label, value, max = 100, valueSuffix = '%', showValue = true, className, 'aria-label': ariaLabel, }) => {
|
|
13
13
|
const pct = max === 0 ? 0 : Math.min(100, Math.max(0, Math.round((value / max) * 100)));
|
|
14
|
-
return (_jsxs("div", { className: cn('eidotter-labeled-progress', 'flex items-center gap-3', className), children: [label && (_jsx("span", { className: "eidotter-labeled-progress__label font-dos text-dos-text-
|
|
14
|
+
return (_jsxs("div", { className: cn('eidotter-labeled-progress', 'flex items-center gap-3', className), children: [label && (_jsx("span", { className: "eidotter-labeled-progress__label font-dos text-dos-text-base text-dos-text-muted shrink-0", children: label })), _jsx("div", { role: "progressbar", "aria-valuenow": pct, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": ariaLabel ?? (typeof label === 'string' ? label : `${pct}${valueSuffix}`), className: "eidotter-labeled-progress__track relative h-3 flex-1 overflow-hidden bg-dos-bg-primary border border-dos-border-disabled", children: _jsx("div", { className: "eidotter-labeled-progress__fill absolute inset-y-0 left-0 w-full bg-dos-bg-accent", style: { transform: `scaleX(${pct / 100})` } }) }), showValue && (_jsxs("span", { className: "eidotter-labeled-progress__value font-dos text-dos-text-base text-dos-text-accent tabular-nums shrink-0", children: [pct, valueSuffix] }))] }));
|
|
15
15
|
};
|
|
16
16
|
LabeledProgress.displayName = 'LabeledProgress';
|
|
@@ -11,5 +11,5 @@ import { CopyButton } from '../../CopyButton/index.js';
|
|
|
11
11
|
* affordance, and compose domain chrome via `trailing`. Routes through
|
|
12
12
|
* `text-dos-*` semantic roles so it re-themes.
|
|
13
13
|
*/
|
|
14
|
-
export const LedgerRow = ({ label, note, value, copyValue, trailing, pending, className, }) => (_jsxs("div", { className: cn('eidotter-ledger-row', 'flex items-center gap-3 py-2 border-b border-dos-border-disabled', pending && 'opacity-50', className), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-dos text-dos-text-
|
|
14
|
+
export const LedgerRow = ({ label, note, value, copyValue, trailing, pending, className, }) => (_jsxs("div", { className: cn('eidotter-ledger-row', 'flex items-center gap-3 py-2 border-b border-dos-border-disabled', pending && 'opacity-50', className), children: [_jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-dos text-dos-text-base text-dos-text-primary", children: label }), note && _jsx("p", { className: "font-dos text-dos-text-base text-dos-text-muted mt-0.5", children: note })] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [_jsx("span", { className: "font-dos text-dos-text-base text-dos-text-accent tabular-nums", children: value }), copyValue !== undefined && _jsx(CopyButton, { value: copyValue }), trailing] })] }));
|
|
15
15
|
LedgerRow.displayName = 'LedgerRow';
|
|
@@ -7,9 +7,9 @@ const orientationClasses = {
|
|
|
7
7
|
horizontal: 'eidotter-meter--horizontal flex-row items-center gap-2',
|
|
8
8
|
};
|
|
9
9
|
const sizeClasses = {
|
|
10
|
-
xs: 'eidotter-meter--xs text-dos-text-
|
|
11
|
-
sm: 'eidotter-meter--sm text-dos-text-
|
|
12
|
-
md: 'eidotter-meter--md text-dos-text-
|
|
10
|
+
xs: 'eidotter-meter--xs text-dos-text-base',
|
|
11
|
+
sm: 'eidotter-meter--sm text-dos-text-base',
|
|
12
|
+
md: 'eidotter-meter--md text-dos-text-base',
|
|
13
13
|
};
|
|
14
14
|
const toneClasses = {
|
|
15
15
|
neutral: 'eidotter-tone--neutral',
|
|
@@ -31,5 +31,5 @@ export const Notification = ({ type = 'primary', title, children, actions, onClo
|
|
|
31
31
|
}, [duration, onClose, triggerClose]);
|
|
32
32
|
const hasIcon = showIcon && !avatar;
|
|
33
33
|
const hasProgress = progress != null;
|
|
34
|
-
return (_jsxs("div", { className: cn('w-full max-w-[400px]', 'font-dos text-dos-text-
|
|
34
|
+
return (_jsxs("div", { className: cn('w-full max-w-[400px]', 'font-dos text-dos-text-base', 'border border-dos-border-default', 'eidotter-notification', `eidotter-notification--${type}`, isClosing && 'eidotter-notification--closing', className), onAnimationEnd: handleAnimationEnd, role: type === 'error' ? 'alert' : 'status', "data-type": type, children: [image && (_jsx("div", { className: "eidotter-notification__image", children: image })), _jsxs("div", { className: "flex flex-row gap-4 p-4", children: [avatar && (_jsx("div", { className: "eidotter-notification__avatar flex-shrink-0", children: avatar })), hasIcon && (_jsx("div", { className: "eidotter-notification__icon", children: _jsx(Icon, { name: TYPE_ICONS[type] || 'Info', size: "S", "aria-label": `${type} notification` }) })), _jsxs("div", { className: cn('flex-1 flex flex-col gap-3 min-w-0', onClose && !hasIcon && !avatar && 'pr-8'), children: [(title || children) && (_jsxs("div", { className: "flex flex-col gap-1", children: [title && (_jsx("div", { className: "eidotter-notification__title font-dos leading-[140%]", children: title })), children && (_jsx("div", { className: "eidotter-notification__text font-dos leading-[140%]", children: children }))] })), hasProgress && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx(Progress, { value: progress, max: 100, size: "sm", fullWidth: true, showLabel: false }), progressLabel && (_jsx("div", { className: "eidotter-notification__text font-dos text-dos-text-base", children: progressLabel }))] })), actions && actions.length > 0 && (_jsx("div", { className: "flex flex-row gap-3", children: actions.map((action, i) => (_jsxs(AriaButton, { className: "eidotter-notification__action", onPress: action.onClick, children: [action.label, action.icon] }, i))) }))] }), onClose && (_jsx(IconButton, { icon: "Close", label: "Close notification", className: "eidotter-notification__close", onPress: triggerClose }))] })] }));
|
|
35
35
|
};
|
|
@@ -10,7 +10,7 @@ export interface PageShellIntro {
|
|
|
10
10
|
eyebrow?: React.ReactNode;
|
|
11
11
|
/** The page title, rendered as the page's `<h1>` in the display face. */
|
|
12
12
|
title: React.ReactNode;
|
|
13
|
-
/** Lead paragraph under the title (
|
|
13
|
+
/** Lead paragraph under the title (within the 80-column measure). */
|
|
14
14
|
lead?: React.ReactNode;
|
|
15
15
|
/** A wrapping row of facts (author, branch, captured at, …). */
|
|
16
16
|
meta?: React.ReactNode;
|
|
@@ -30,7 +30,10 @@ export interface PageShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
30
30
|
intro?: PageShellIntro;
|
|
31
31
|
/** Bottom slot, inside the column (e.g. `<Footer>`). */
|
|
32
32
|
footer?: React.ReactNode;
|
|
33
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Cap for the column, any CSS length. Default `1200px`. Text keeps the
|
|
35
|
+
* 80-column measure (45rem) inside it; wide blocks may use the full cap.
|
|
36
|
+
*/
|
|
34
37
|
maxWidth?: string;
|
|
35
38
|
/**
|
|
36
39
|
* Element that wraps `intro` and `children`. `'main'` (default) makes it the
|
|
@@ -50,10 +53,13 @@ export interface PageShellProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
50
53
|
/**
|
|
51
54
|
* PageShell: the "one block" page layout (0.43).
|
|
52
55
|
*
|
|
53
|
-
* One
|
|
54
|
-
* gutter and 24px / 64px block padding
|
|
55
|
-
*
|
|
56
|
-
*
|
|
56
|
+
* One column, flush left (0.46): it starts at a `max(16px, safe-area)`
|
|
57
|
+
* gutter and runs to a 1200px cap, with 24px / 64px block padding; the right
|
|
58
|
+
* side stays empty, like a DOS screen. Text keeps an 80-column measure
|
|
59
|
+
* (45rem); wide blocks (Bench, tables, galleries) may use the full cap.
|
|
60
|
+
* Header, intro, sections and footer all share the one left edge, stacked
|
|
61
|
+
* with a 40px gap. Same layout in every theme: themes restyle, never
|
|
62
|
+
* re-lay out. No dividers: the only lines on the page are the ones its
|
|
57
63
|
* children draw (window frames, pane gaps).
|
|
58
64
|
*
|
|
59
65
|
* Paints no background and sets no font: the page's own ground (a CRT tint,
|
|
@@ -10,10 +10,13 @@ function PageIntro({ intro }) {
|
|
|
10
10
|
/**
|
|
11
11
|
* PageShell: the "one block" page layout (0.43).
|
|
12
12
|
*
|
|
13
|
-
* One
|
|
14
|
-
* gutter and 24px / 64px block padding
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* One column, flush left (0.46): it starts at a `max(16px, safe-area)`
|
|
14
|
+
* gutter and runs to a 1200px cap, with 24px / 64px block padding; the right
|
|
15
|
+
* side stays empty, like a DOS screen. Text keeps an 80-column measure
|
|
16
|
+
* (45rem); wide blocks (Bench, tables, galleries) may use the full cap.
|
|
17
|
+
* Header, intro, sections and footer all share the one left edge, stacked
|
|
18
|
+
* with a 40px gap. Same layout in every theme: themes restyle, never
|
|
19
|
+
* re-lay out. No dividers: the only lines on the page are the ones its
|
|
17
20
|
* children draw (window frames, pane gaps).
|
|
18
21
|
*
|
|
19
22
|
* Paints no background and sets no font: the page's own ground (a CRT tint,
|
|
@@ -7,13 +7,14 @@ const DARK_SHADE = '\u2593'; // ▓
|
|
|
7
7
|
const MED_SHADE = '\u2592'; // ▒
|
|
8
8
|
// eidotter tokens only: raw Tailwind sizes (text-xs/base/lg) would compile
|
|
9
9
|
// into dist/eidotter.css and override consumers' own utilities (DMNC-1579).
|
|
10
|
+
// One body size (0.46): the bar and label are text, so every size renders at 16px.
|
|
10
11
|
const sizeClasses = {
|
|
11
|
-
sm: 'text-dos-text-base',
|
|
12
|
-
md: 'text-dos-text-
|
|
13
|
-
lg: 'text-dos-text-
|
|
12
|
+
sm: 'text-dos-text-base',
|
|
13
|
+
md: 'text-dos-text-base',
|
|
14
|
+
lg: 'text-dos-text-base',
|
|
14
15
|
small: 'text-dos-text-base',
|
|
15
|
-
medium: 'text-dos-text-
|
|
16
|
-
large: 'text-dos-text-
|
|
16
|
+
medium: 'text-dos-text-base',
|
|
17
|
+
large: 'text-dos-text-base',
|
|
17
18
|
};
|
|
18
19
|
const variantClasses = {
|
|
19
20
|
default: 'eidotter-progress--default',
|
|
@@ -7,9 +7,9 @@ const orientationClasses = {
|
|
|
7
7
|
horizontal: 'eidotter-range-bar--horizontal',
|
|
8
8
|
};
|
|
9
9
|
const sizeClasses = {
|
|
10
|
-
sm: 'eidotter-range-bar--sm text-dos-text-
|
|
11
|
-
md: 'eidotter-range-bar--md text-dos-text-
|
|
12
|
-
lg: 'eidotter-range-bar--lg text-dos-text-
|
|
10
|
+
sm: 'eidotter-range-bar--sm text-dos-text-base',
|
|
11
|
+
md: 'eidotter-range-bar--md text-dos-text-base',
|
|
12
|
+
lg: 'eidotter-range-bar--lg text-dos-text-base',
|
|
13
13
|
};
|
|
14
14
|
/** Bar thickness and length per orientation and size. */
|
|
15
15
|
const trackClasses = {
|
|
@@ -7,14 +7,14 @@ import { cn } from '../../../utils/cn.js';
|
|
|
7
7
|
// Shared style fragments — layout in Tailwind, phosphor in Select.css
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
9
9
|
const sizeTrigger = {
|
|
10
|
-
sm: 'text-dos-text-
|
|
11
|
-
md: 'text-dos-text-
|
|
12
|
-
lg: 'text-dos-text-
|
|
10
|
+
sm: 'text-dos-text-base px-2.5 py-1 min-h-7 gap-2',
|
|
11
|
+
md: 'text-dos-text-base px-3 py-2 min-h-8 gap-2',
|
|
12
|
+
lg: 'text-dos-text-base px-4 py-2.5 min-h-10 gap-2',
|
|
13
13
|
};
|
|
14
14
|
const normalizeSize = (size = 'md') => ({ small: 'sm', medium: 'md', large: 'lg' }[size] ?? size);
|
|
15
|
-
const labelClass = 'eidotter-select__label text-dos-text-brand font-dos text-dos-text-
|
|
16
|
-
const descClass = 'eidotter-select__description text-dos-text-muted font-dos text-dos-text-
|
|
17
|
-
const errClass = 'eidotter-select__error text-dos-text-error font-dos text-dos-text-
|
|
15
|
+
const labelClass = 'eidotter-select__label text-dos-text-brand font-dos text-dos-text-base uppercase tracking-wider';
|
|
16
|
+
const descClass = 'eidotter-select__description text-dos-text-muted font-dos text-dos-text-base';
|
|
17
|
+
const errClass = 'eidotter-select__error text-dos-text-error font-dos text-dos-text-base';
|
|
18
18
|
const triggerBase = 'eidotter-select__trigger flex items-center w-full bg-transparent text-dos-text-brand font-dos ' +
|
|
19
19
|
'border-2 border-dos-border-default outline-none box-border';
|
|
20
20
|
const optionClass = 'eidotter-select__option font-dos';
|