@apliteni/apliteni-ui 0.137.0 → 0.139.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/package.json +1 -1
- package/react/README.md +25 -0
- package/react/dist/index.css +5 -0
- package/react/dist/index.d.ts +77 -2
- package/react/dist/index.js +280 -128
- package/src/components/topbar.js +3 -3
- package/src/styles/topbar.css +24 -9
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -232,6 +232,8 @@ finds its rows by `data-dd-item`, which is in the props you spread.
|
|
|
232
232
|
leave `open` out and the component keeps its own, starting from `defaultOpen`. `onSelect`
|
|
233
233
|
reports the item's `value` and the item. Pass `ariaLabel` to a `select` dropdown: a listbox
|
|
234
234
|
needs a name, and axe says so — the same reason every vanilla dropdown story passes one.
|
|
235
|
+
Pass `selectedValue` when the caller owns the selected row. Its tick stays on that value after
|
|
236
|
+
`onSelect` until the caller changes it.
|
|
235
237
|
|
|
236
238
|
**`search` puts a field over the rows**, the same one the factory draws, and Guidelines /
|
|
237
239
|
Component choice makes it a rule at ten options or any list fed by data:
|
|
@@ -976,6 +978,29 @@ instead of 32, with the same line drawn in the middle of it.
|
|
|
976
978
|
]} />
|
|
977
979
|
```
|
|
978
980
|
|
|
981
|
+
## TopBar
|
|
982
|
+
|
|
983
|
+
`TopBar` is the band: the brand first, then your slots after the spacer. Fill `view`, `version`,
|
|
984
|
+
`theme` and `account` with `ViewSwitch`, `VersionSwitcher`, `ThemeToggle` and `AccountMenu`, or
|
|
985
|
+
leave one out. Leave out `account` for the signed-out bar. The brand is the Apliteni mark and
|
|
986
|
+
`word`, or pass your own `brand`. Put it above `AppShell` or on its own.
|
|
987
|
+
|
|
988
|
+
```tsx
|
|
989
|
+
<TopBar
|
|
990
|
+
view={<ViewSwitch items={[{ id: 'deck', label: 'Deck' }, { id: 'text', label: 'Text' }]} active="deck" />}
|
|
991
|
+
version={<VersionSwitcher versions={versions} value={version} onChange={setVersion} />}
|
|
992
|
+
theme={<ThemeToggle />}
|
|
993
|
+
account={<AccountMenu name="Ada Lovelace" email="ada@apliteni.com" current="prefs" onSignOut={signOut} />} />
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
`ViewSwitch` is a group of links, so it takes `renderLink` like `NavTabs`. The current view is
|
|
997
|
+
filled with the same accent fill as a `Segmented` choice and has `aria-current="page"`.
|
|
998
|
+
`VersionSwitcher` takes `{ value, label, badge }` versions. The button shows only the chosen
|
|
999
|
+
name. Each row shows a name, a badge and the selected tick. `AccountMenu` shows the
|
|
1000
|
+
avatar mark, the reader's name and address, the rows in `items` and Sign out. Both menus are the
|
|
1001
|
+
kit's `Dropdown`, so they share its keyboard and placement. `current` marks one account page in
|
|
1002
|
+
accent ink and defaults to `prefs`.
|
|
1003
|
+
|
|
979
1004
|
## NavTabs and Breadcrumbs
|
|
980
1005
|
|
|
981
1006
|
`NavTabs` renders route links with the kit’s underline or pill presentation. Pass
|
package/react/dist/index.css
CHANGED
package/react/dist/index.d.ts
CHANGED
|
@@ -560,6 +560,8 @@ type DropdownProps = {
|
|
|
560
560
|
label?: string;
|
|
561
561
|
/** What the trigger shows. Given one, the trigger is yours to update. */
|
|
562
562
|
value?: string;
|
|
563
|
+
/** When given, the caller owns the selected row, including after a pick. */
|
|
564
|
+
selectedValue?: string | number;
|
|
563
565
|
placeholder?: string;
|
|
564
566
|
/** Inferred from the items when it is left out, exactly as the factory infers it. */
|
|
565
567
|
variant?: 'select' | 'menu';
|
|
@@ -598,7 +600,7 @@ type DropdownProps = {
|
|
|
598
600
|
/** Draw the row yourself. `props` is everything the row needs; spread it. */
|
|
599
601
|
row?: (item: DropdownItem, props: DropdownRowProps) => ReactNode;
|
|
600
602
|
};
|
|
601
|
-
declare function Dropdown({ label, value, placeholder, variant, items, sections, header, footer, triggerContent, triggerClass, disabled, chevron, align, direction, scroll, search, ariaLabel, id, panelClass, 'aria-describedby': describedBy, 'aria-invalid': invalid, open: openProp, defaultOpen, onOpenChange, onSelect, row, }: DropdownProps): react.JSX.Element;
|
|
603
|
+
declare function Dropdown({ label, value, selectedValue, placeholder, variant, items, sections, header, footer, triggerContent, triggerClass, disabled, chevron, align, direction, scroll, search, ariaLabel, id, panelClass, 'aria-describedby': describedBy, 'aria-invalid': invalid, open: openProp, defaultOpen, onOpenChange, onSelect, row, }: DropdownProps): react.JSX.Element;
|
|
602
604
|
|
|
603
605
|
type BackLinkOwnProps = {
|
|
604
606
|
/** The address. No address, or a `javascript:` one, and nothing is rendered. */
|
|
@@ -925,6 +927,16 @@ type AppShellProps = {
|
|
|
925
927
|
};
|
|
926
928
|
declare function AppShell({ sections, pathname, title, children, word, brand, brandHref, width, back, lede, actions, bandControl, account, onSignOut, searchLabel, searchShortLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
|
|
927
929
|
|
|
930
|
+
type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
931
|
+
brand: ReactNode;
|
|
932
|
+
children: ReactNode;
|
|
933
|
+
};
|
|
934
|
+
/** Centers one auth task on the kit's auth card. */
|
|
935
|
+
declare const AuthShell: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
936
|
+
brand: ReactNode;
|
|
937
|
+
children: ReactNode;
|
|
938
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
939
|
+
|
|
928
940
|
type FooterLink = {
|
|
929
941
|
label: string;
|
|
930
942
|
href?: string;
|
|
@@ -1201,6 +1213,69 @@ declare const AccentPicker: react.ForwardRefExoticComponent<Omit<HTMLAttributes<
|
|
|
1201
1213
|
options?: readonly Accent[];
|
|
1202
1214
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
1203
1215
|
|
|
1216
|
+
type TopBarProps = Omit<ComponentPropsWithoutRef<'header'>, 'children'> & {
|
|
1217
|
+
/** The lockup. Left out, the bar draws the Apliteni mark and `word`. */
|
|
1218
|
+
brand?: ReactNode;
|
|
1219
|
+
/** The product word beside the mark, when `brand` is left out. */
|
|
1220
|
+
word?: string;
|
|
1221
|
+
brandHref?: string;
|
|
1222
|
+
/** A `ViewSwitch`, or nothing. */
|
|
1223
|
+
view?: ReactNode;
|
|
1224
|
+
/** A `VersionSwitcher`, or nothing. */
|
|
1225
|
+
version?: ReactNode;
|
|
1226
|
+
/** A `ThemeToggle`, or nothing. */
|
|
1227
|
+
theme?: ReactNode;
|
|
1228
|
+
/** An `AccountMenu`. Left out, the bar is the signed-out bar. */
|
|
1229
|
+
account?: ReactNode;
|
|
1230
|
+
};
|
|
1231
|
+
/** The band: brand first, the controls after the spacer. Each control is a slot. */
|
|
1232
|
+
declare function TopBar({ brand, word, brandHref, view, version, theme, account, className, ...rest }: TopBarProps): react.JSX.Element;
|
|
1233
|
+
type ViewSwitchItem = {
|
|
1234
|
+
id: string;
|
|
1235
|
+
label: string;
|
|
1236
|
+
href?: string;
|
|
1237
|
+
target?: string;
|
|
1238
|
+
};
|
|
1239
|
+
type ViewSwitchProps = {
|
|
1240
|
+
items: readonly ViewSwitchItem[];
|
|
1241
|
+
active: string;
|
|
1242
|
+
/** Names the group. */
|
|
1243
|
+
label?: string;
|
|
1244
|
+
/** Spread linkProps onto the router link, including children. */
|
|
1245
|
+
renderLink?: (item: ViewSwitchItem, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
|
|
1246
|
+
};
|
|
1247
|
+
/** The Deck and Text switch: links between views of one page, the current one filled. */
|
|
1248
|
+
declare function ViewSwitch({ items, active, label, renderLink }: ViewSwitchProps): react.JSX.Element;
|
|
1249
|
+
type Version = {
|
|
1250
|
+
value: string;
|
|
1251
|
+
label: string;
|
|
1252
|
+
badge?: 'live' | 'archive';
|
|
1253
|
+
};
|
|
1254
|
+
type VersionSwitcherProps = {
|
|
1255
|
+
versions: readonly Version[];
|
|
1256
|
+
value: string;
|
|
1257
|
+
onChange?: (value: string) => void;
|
|
1258
|
+
/** Names the list and the button. */
|
|
1259
|
+
label?: string;
|
|
1260
|
+
defaultOpen?: boolean;
|
|
1261
|
+
};
|
|
1262
|
+
/** The version menu: the button shows the chosen name, the open list ticks it. */
|
|
1263
|
+
declare function VersionSwitcher({ versions, value, onChange, label, defaultOpen }: VersionSwitcherProps): react.JSX.Element;
|
|
1264
|
+
type AccountMenuProps = {
|
|
1265
|
+
name: string;
|
|
1266
|
+
email: string;
|
|
1267
|
+
/** The rows above Sign out. Left out, the kit's account pages. */
|
|
1268
|
+
items?: DropdownEntry[];
|
|
1269
|
+
/** The current account page. One menu row takes the accent ink. */
|
|
1270
|
+
current?: string;
|
|
1271
|
+
signOutHref?: string;
|
|
1272
|
+
onSignOut?: () => void;
|
|
1273
|
+
onSelect?: (value: string | number | undefined) => void;
|
|
1274
|
+
defaultOpen?: boolean;
|
|
1275
|
+
};
|
|
1276
|
+
/** The avatar and its menu. */
|
|
1277
|
+
declare function AccountMenu({ name, email, items, current, signOutHref, onSignOut, onSelect, defaultOpen, }: AccountMenuProps): react.JSX.Element;
|
|
1278
|
+
|
|
1204
1279
|
type NavTabBadge = string | number | {
|
|
1205
1280
|
text: string | number;
|
|
1206
1281
|
tone?: 'neutral' | 'accent' | 'live' | 'danger';
|
|
@@ -1248,4 +1323,4 @@ declare const Breadcrumbs: react.ForwardRefExoticComponent<Omit<Omit<react.Detai
|
|
|
1248
1323
|
declare const PAGE_SIZES: readonly number[];
|
|
1249
1324
|
declare const DEFAULT_PAGE_SIZE: number;
|
|
1250
1325
|
|
|
1251
|
-
export { type Accent, AccentPicker, type AccentPickerProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, Avatar, type AvatarProps, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, Chart, type ChartBridgeStep, type ChartBridgeTones, type ChartPeriod, type ChartProps, type ChartSeries, type ChartTone, CheckList, type CheckListProps, Checkbox, type CheckboxProps, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DatePicker, type DatePickerMode, type DatePickerPreset, type DatePickerProps, type DatePickerRange, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownAvatar, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, Feedback, type FeedbackPayload, type FeedbackProps, type FeedbackResult, type FeedbackSection, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Footer, type FooterColumn, type FooterLink, type FooterProps, type FooterSocial, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, type NativeButtonProps, type NavTabBadge, type NavTabItem, NavTabs, type NavTabsProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, Pill, type PillProps, RowIdentity, type RowIdentityProps, SearchField, type SearchFieldProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, SidebarNav, type SidebarNavBadge, type SidebarNavItem, type SidebarNavLeaf, type SidebarNavProps, type SidebarNavSection, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, StatusDot, type StatusDotProps, Success, SuccessCheck, type SuccessCheckProps, type SuccessCountdown, SuccessPanel, type SuccessPanelProps, type SuccessProps, Switch, type SwitchProps, THEME_INIT_SCRIPT, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineEvent, type TimelineEventKind, type TimelineProps, Toast, type ToastNotice, type ToastProps, Tooltip, type TooltipProps, sortTableRows, useToast };
|
|
1326
|
+
export { type Accent, AccentPicker, type AccentPickerProps, AccountMenu, type AccountMenuProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, AuthShell, type AuthShellProps, Avatar, type AvatarProps, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, Chart, type ChartBridgeStep, type ChartBridgeTones, type ChartPeriod, type ChartProps, type ChartSeries, type ChartTone, CheckList, type CheckListProps, Checkbox, type CheckboxProps, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DatePicker, type DatePickerMode, type DatePickerPreset, type DatePickerProps, type DatePickerRange, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownAvatar, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, Feedback, type FeedbackPayload, type FeedbackProps, type FeedbackResult, type FeedbackSection, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Footer, type FooterColumn, type FooterLink, type FooterProps, type FooterSocial, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, type NativeButtonProps, type NavTabBadge, type NavTabItem, NavTabs, type NavTabsProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, Pill, type PillProps, RowIdentity, type RowIdentityProps, SearchField, type SearchFieldProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, SidebarNav, type SidebarNavBadge, type SidebarNavItem, type SidebarNavLeaf, type SidebarNavProps, type SidebarNavSection, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, StatusDot, type StatusDotProps, Success, SuccessCheck, type SuccessCheckProps, type SuccessCountdown, SuccessPanel, type SuccessPanelProps, type SuccessProps, Switch, type SwitchProps, THEME_INIT_SCRIPT, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineEvent, type TimelineEventKind, type TimelineProps, Toast, type ToastNotice, type ToastProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, type Version, VersionSwitcher, type VersionSwitcherProps, ViewSwitch, type ViewSwitchItem, type ViewSwitchProps, sortTableRows, useToast };
|
package/react/dist/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var cx = (...a) => a.filter(Boolean).join(" ");
|
|
|
94
94
|
var Button = forwardRef3(function Button2({
|
|
95
95
|
variant = "secondary",
|
|
96
96
|
size = "md",
|
|
97
|
-
icon:
|
|
97
|
+
icon: icon9,
|
|
98
98
|
leading,
|
|
99
99
|
iconRight,
|
|
100
100
|
iconOnly,
|
|
@@ -158,7 +158,7 @@ var Button = forwardRef3(function Button2({
|
|
|
158
158
|
className
|
|
159
159
|
);
|
|
160
160
|
const labelled = rest["aria-label"] != null || rest["aria-labelledby"] != null;
|
|
161
|
-
const fallback = typeof children === "string" && children.trim() ? children.trim() :
|
|
161
|
+
const fallback = typeof children === "string" && children.trim() ? children.trim() : icon9;
|
|
162
162
|
const named = iconOnly && !labelled && fallback ? { "aria-label": fallback, title: rest.title ?? fallback } : {};
|
|
163
163
|
const Root = href === void 0 ? "button" : "a";
|
|
164
164
|
return /* @__PURE__ */ jsxs3(
|
|
@@ -203,7 +203,7 @@ var Button = forwardRef3(function Button2({
|
|
|
203
203
|
if (!blockKey(event)) onKeyUp?.(event);
|
|
204
204
|
},
|
|
205
205
|
children: [
|
|
206
|
-
leading != null ? /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", style: { display: "inline-flex" }, children: leading }) :
|
|
206
|
+
leading != null ? /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", style: { display: "inline-flex" }, children: leading }) : icon9 && /* @__PURE__ */ jsx4(Icon, { name: icon9 }),
|
|
207
207
|
!iconOnly && renderedChildren != null && /* @__PURE__ */ jsx4("span", { className: "ui-btn__label-slot", children: /* @__PURE__ */ jsx4("span", { className: "ui-btn__label", ref: labelRef, children: renderedChildren }) }),
|
|
208
208
|
iconRight && /* @__PURE__ */ jsx4(Icon, { name: iconRight }),
|
|
209
209
|
busy && /* @__PURE__ */ jsxs3("span", { className: "ui-btn__dots", "aria-hidden": "true", children: [
|
|
@@ -284,14 +284,14 @@ var StatusDot = forwardRef5(function StatusDot2({
|
|
|
284
284
|
// src/primitives/Card.tsx
|
|
285
285
|
import { icon as kitIcon, safeUrl } from "@apliteni/apliteni-ui";
|
|
286
286
|
import { Fragment, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
287
|
-
function Card({ title, sub, level = 2, variant, pad: pad2, icon:
|
|
287
|
+
function Card({ title, sub, level = 2, variant, pad: pad2, icon: icon9, href, className, children }) {
|
|
288
288
|
const n = Number(level);
|
|
289
289
|
const Heading = href != null ? "div" : `h${[2, 3, 4, 5, 6].includes(n) ? n : 2}`;
|
|
290
290
|
const titled = title != null && title !== false && title !== "";
|
|
291
291
|
const classes = ["ui-card", variant && `ui-card--${variant}`, pad2 && `ui-card--pad-${pad2}`, href != null && "ui-card--interactive", className].filter(Boolean).join(" ");
|
|
292
292
|
const inner = /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
293
293
|
titled && /* @__PURE__ */ jsxs5(Heading, { className: "ui-card__title", children: [
|
|
294
|
-
|
|
294
|
+
icon9 && /* @__PURE__ */ jsx9("span", { className: "ui-card__icon", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: kitIcon(icon9) } }),
|
|
295
295
|
title
|
|
296
296
|
] }),
|
|
297
297
|
sub != null && /* @__PURE__ */ jsx9("div", { className: "ui-card__sub", children: sub }),
|
|
@@ -303,9 +303,9 @@ function Card({ title, sub, level = 2, variant, pad: pad2, icon: icon8, href, cl
|
|
|
303
303
|
// src/primitives/Callout.tsx
|
|
304
304
|
import { calloutIcons, icon as kitIcon2 } from "@apliteni/apliteni-ui";
|
|
305
305
|
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
306
|
-
function Callout({ variant, icon:
|
|
306
|
+
function Callout({ variant, icon: icon9 = calloutIcons[variant ?? "neutral"], children, actions }) {
|
|
307
307
|
return /* @__PURE__ */ jsxs6("div", { className: `ui-callout${variant && variant !== "neutral" ? ` ui-callout--${variant}` : ""}`, role: variant === "danger" ? "alert" : void 0, children: [
|
|
308
|
-
/* @__PURE__ */ jsx10("span", { className: "ui-callout__icon", dangerouslySetInnerHTML: { __html: kitIcon2(
|
|
308
|
+
/* @__PURE__ */ jsx10("span", { className: "ui-callout__icon", dangerouslySetInnerHTML: { __html: kitIcon2(icon9) } }),
|
|
309
309
|
/* @__PURE__ */ jsxs6("div", { className: "ui-callout__body", children: [
|
|
310
310
|
children,
|
|
311
311
|
actions != null && /* @__PURE__ */ jsx10("div", { className: "ui-toolbar ui-callout__actions", children: actions })
|
|
@@ -1882,12 +1882,12 @@ function Denied({
|
|
|
1882
1882
|
title = "You don\u2019t have access",
|
|
1883
1883
|
sub,
|
|
1884
1884
|
need,
|
|
1885
|
-
icon:
|
|
1885
|
+
icon: icon9 = "lock",
|
|
1886
1886
|
className,
|
|
1887
1887
|
children
|
|
1888
1888
|
}) {
|
|
1889
1889
|
return /* @__PURE__ */ jsxs16("div", { className: cx4("ui-denied", className), children: [
|
|
1890
|
-
/* @__PURE__ */ jsx20("div", { className: "ui-denied__seal", children: /* @__PURE__ */ jsx20(Icon, { name:
|
|
1890
|
+
/* @__PURE__ */ jsx20("div", { className: "ui-denied__seal", children: /* @__PURE__ */ jsx20(Icon, { name: icon9 }) }),
|
|
1891
1891
|
/* @__PURE__ */ jsx20("div", { className: "ui-denied__title", children: title }),
|
|
1892
1892
|
sub && /* @__PURE__ */ jsx20("div", { className: "ui-denied__sub", children: sub }),
|
|
1893
1893
|
need && /* @__PURE__ */ jsxs16("div", { className: "ui-denied__need", children: [
|
|
@@ -2440,6 +2440,7 @@ var SEARCH_DEFAULTS = {
|
|
|
2440
2440
|
function Dropdown({
|
|
2441
2441
|
label,
|
|
2442
2442
|
value,
|
|
2443
|
+
selectedValue,
|
|
2443
2444
|
placeholder = "Select\u2026",
|
|
2444
2445
|
variant,
|
|
2445
2446
|
items,
|
|
@@ -2584,15 +2585,16 @@ function Dropdown({
|
|
|
2584
2585
|
const name = ariaLabel || (label ? String(label).replace(/:\s*$/, "") : "") || "Options";
|
|
2585
2586
|
const given = rows.find((it) => it.selected);
|
|
2586
2587
|
const givenKey = given ? keyOf(given) : null;
|
|
2587
|
-
const pickedKey = pick && pick.against === givenKey ? pick.key : null;
|
|
2588
|
+
const pickedKey = selectedValue === void 0 && pick && pick.against === givenKey ? pick.key : null;
|
|
2588
2589
|
useEffect8(() => {
|
|
2589
2590
|
if (pick && pick.against !== givenKey) setPick(null);
|
|
2590
2591
|
}, [givenKey, pick]);
|
|
2591
2592
|
const picked = pickedKey != null ? rows.find((it) => keyOf(it) === pickedKey) : void 0;
|
|
2592
|
-
const
|
|
2593
|
+
const controlled = selectedValue !== void 0 ? rows.find((it) => it.value === selectedValue) : void 0;
|
|
2594
|
+
const shown = value != null ? value : isSelect ? selectedValue !== void 0 ? controlled?.label : picked?.label ?? given?.label : null;
|
|
2593
2595
|
const marked2 = isSelect && rows.some((it) => it.avatar);
|
|
2594
|
-
const chosen = marked2 ? value != null ? rows.find((it) => it.label === value) : picked ?? given : void 0;
|
|
2595
|
-
const selectedOf = (it) => pickedKey != null ? it.disabled ? !!it.selected : keyOf(it) === pickedKey : !!it.selected;
|
|
2596
|
+
const chosen = marked2 ? value != null ? rows.find((it) => it.label === value) : selectedValue !== void 0 ? controlled : picked ?? given : void 0;
|
|
2597
|
+
const selectedOf = (it) => selectedValue !== void 0 ? it.value === selectedValue : pickedKey != null ? it.disabled ? !!it.selected : keyOf(it) === pickedKey : !!it.selected;
|
|
2596
2598
|
const hiddenBy = (it) => Boolean(sx) && !dropdownMatch(it.label, query);
|
|
2597
2599
|
const filtering = Boolean(sx) && dropdownFiltering(query);
|
|
2598
2600
|
const visible = rows.filter((it) => !hiddenBy(it));
|
|
@@ -2770,7 +2772,7 @@ function Dropdown({
|
|
|
2770
2772
|
e.preventDefault();
|
|
2771
2773
|
return;
|
|
2772
2774
|
}
|
|
2773
|
-
if (isSelect) setPick({ key: keyOf(item), against: givenKey });
|
|
2775
|
+
if (isSelect && selectedValue === void 0) setPick({ key: keyOf(item), against: givenKey });
|
|
2774
2776
|
onSelect?.(item.value, item);
|
|
2775
2777
|
setOpen(false);
|
|
2776
2778
|
trigger.current?.focus();
|
|
@@ -3595,11 +3597,11 @@ var cases = {
|
|
|
3595
3597
|
"not-found": { title: "We can't find that page", sub: "Check the address or return to the home page.", icon: "folder" },
|
|
3596
3598
|
"not-yet-built": { title: "This ships later", sub: "This screen is not available yet. Check back later.", icon: "clock" }
|
|
3597
3599
|
};
|
|
3598
|
-
function EmptyState({ variant = "first-run", title, sub, icon:
|
|
3600
|
+
function EmptyState({ variant = "first-run", title, sub, icon: icon9, art, actions }) {
|
|
3599
3601
|
const preset = cases[variant];
|
|
3600
3602
|
const heading = title ?? preset.title;
|
|
3601
3603
|
const guidance = sub ?? preset.sub;
|
|
3602
|
-
const glyph =
|
|
3604
|
+
const glyph = icon9 ?? preset.icon;
|
|
3603
3605
|
return /* @__PURE__ */ jsxs27("div", { className: "ui-empty", children: [
|
|
3604
3606
|
art ? typeof art === "string" ? /* @__PURE__ */ jsx32("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx32("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph ? /* @__PURE__ */ jsx32("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon3(glyph) } }) : null,
|
|
3605
3607
|
heading && /* @__PURE__ */ jsx32("div", { className: "ui-empty__title", children: heading }),
|
|
@@ -4287,10 +4289,20 @@ function AppShell({
|
|
|
4287
4289
|
] });
|
|
4288
4290
|
}
|
|
4289
4291
|
|
|
4292
|
+
// src/AuthShell.tsx
|
|
4293
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
4294
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4295
|
+
var AuthShell = forwardRef9(function AuthShell2({ brand, children, className, ...rest }, ref) {
|
|
4296
|
+
return /* @__PURE__ */ jsx39("div", { ...rest, ref, className: ["ui-auth", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs34("div", { className: "ui-auth__card", children: [
|
|
4297
|
+
/* @__PURE__ */ jsx39("div", { className: "ui-auth__brand", children: brand }),
|
|
4298
|
+
children
|
|
4299
|
+
] }) });
|
|
4300
|
+
});
|
|
4301
|
+
|
|
4290
4302
|
// src/Footer.tsx
|
|
4291
4303
|
import { useId as useId13 } from "react";
|
|
4292
4304
|
import { prism as prism2, safeUrl as safeUrl2 } from "@apliteni/apliteni-ui";
|
|
4293
|
-
import { jsx as
|
|
4305
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4294
4306
|
var SOCIAL_GLYPHS = {
|
|
4295
4307
|
github: '<path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.64 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.37.2 2.39.1 2.64.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/>',
|
|
4296
4308
|
x: '<path d="M4 3h4.5l4 5.5L17.5 3H21l-6.5 8.5L21 21h-4.5l-4.3-5.9L7 21H3.5l6.8-8.9z"/>',
|
|
@@ -4299,10 +4311,10 @@ var SOCIAL_GLYPHS = {
|
|
|
4299
4311
|
};
|
|
4300
4312
|
var escapeText = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4301
4313
|
function Legal({ legal, legalLinks, switcher }) {
|
|
4302
|
-
return /* @__PURE__ */
|
|
4303
|
-
/* @__PURE__ */
|
|
4304
|
-
legalLinks && legalLinks.length > 0 && /* @__PURE__ */
|
|
4305
|
-
switcher ? /* @__PURE__ */
|
|
4314
|
+
return /* @__PURE__ */ jsxs35("div", { className: "ui-footer__bar", children: [
|
|
4315
|
+
/* @__PURE__ */ jsx40("span", { className: "ui-footer__legal", children: legal }),
|
|
4316
|
+
legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx40("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx40("a", { href: safeUrl2(to ?? "#"), children: label }, label)) }),
|
|
4317
|
+
switcher ? /* @__PURE__ */ jsx40("div", { className: "ui-footer__switcher", children: switcher }) : null
|
|
4306
4318
|
] });
|
|
4307
4319
|
}
|
|
4308
4320
|
function Footer({
|
|
@@ -4322,12 +4334,12 @@ function Footer({
|
|
|
4322
4334
|
}) {
|
|
4323
4335
|
const uid = useId13();
|
|
4324
4336
|
const cls = ["ui-footer", `ui-footer--${variant}`, className].filter(Boolean).join(" ");
|
|
4325
|
-
const bar = /* @__PURE__ */
|
|
4337
|
+
const bar = /* @__PURE__ */ jsx40(Legal, { legal, legalLinks, switcher });
|
|
4326
4338
|
if (variant !== "full") {
|
|
4327
|
-
return /* @__PURE__ */
|
|
4339
|
+
return /* @__PURE__ */ jsx40("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsx40("div", { className: "ui-footer__in", children: bar }) });
|
|
4328
4340
|
}
|
|
4329
4341
|
const mark = prism2(uid.replace(/:/g, ""), 22);
|
|
4330
|
-
const lockup = brand ?? /* @__PURE__ */
|
|
4342
|
+
const lockup = brand ?? /* @__PURE__ */ jsx40(
|
|
4331
4343
|
"a",
|
|
4332
4344
|
{
|
|
4333
4345
|
className: "brand",
|
|
@@ -4336,21 +4348,21 @@ function Footer({
|
|
|
4336
4348
|
dangerouslySetInnerHTML: { __html: `${mark}<span>${escapeText(word)}</span>` }
|
|
4337
4349
|
}
|
|
4338
4350
|
);
|
|
4339
|
-
return /* @__PURE__ */
|
|
4340
|
-
/* @__PURE__ */
|
|
4341
|
-
brand !== false && /* @__PURE__ */
|
|
4351
|
+
return /* @__PURE__ */ jsx40("footer", { ...rest, className: cls, role: "contentinfo", children: /* @__PURE__ */ jsxs35("div", { className: "ui-footer__in", children: [
|
|
4352
|
+
/* @__PURE__ */ jsxs35("div", { className: "ui-footer__top", children: [
|
|
4353
|
+
brand !== false && /* @__PURE__ */ jsxs35("div", { className: "ui-footer__brand", children: [
|
|
4342
4354
|
lockup,
|
|
4343
|
-
tagline && /* @__PURE__ */
|
|
4344
|
-
social.length > 0 && /* @__PURE__ */
|
|
4345
|
-
const markup = SOCIAL_GLYPHS[
|
|
4346
|
-
const fill =
|
|
4347
|
-
const viewBox =
|
|
4348
|
-
return /* @__PURE__ */
|
|
4355
|
+
tagline && /* @__PURE__ */ jsx40("p", { className: "ui-footer__tagline", children: tagline }),
|
|
4356
|
+
social.length > 0 && /* @__PURE__ */ jsx40("div", { className: "ui-footer__socials", children: social.map(({ label, href: to, icon: icon9 = "github" }) => {
|
|
4357
|
+
const markup = SOCIAL_GLYPHS[icon9];
|
|
4358
|
+
const fill = icon9 === "mail" ? "none" : "currentColor";
|
|
4359
|
+
const viewBox = icon9 === "linkedin" ? "0 0 448 512" : "0 0 24 24";
|
|
4360
|
+
return /* @__PURE__ */ jsx40("a", { className: "ui-footer__social", href: safeUrl2(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx40("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
|
|
4349
4361
|
}) })
|
|
4350
4362
|
] }),
|
|
4351
|
-
(links || columns.length > 0) && /* @__PURE__ */
|
|
4352
|
-
title && /* @__PURE__ */
|
|
4353
|
-
/* @__PURE__ */
|
|
4363
|
+
(links || columns.length > 0) && /* @__PURE__ */ jsx40("nav", { className: "ui-footer__nav", "aria-label": "Footer", children: links ?? columns.map(({ title, links: columnLinks }, i) => /* @__PURE__ */ jsxs35("div", { className: "ui-footer__col", children: [
|
|
4364
|
+
title && /* @__PURE__ */ jsx40("h2", { className: "ui-footer__col-title", children: title }),
|
|
4365
|
+
/* @__PURE__ */ jsx40("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx40("li", { children: /* @__PURE__ */ jsx40("a", { href: safeUrl2(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
|
|
4354
4366
|
] }, title ?? i)) })
|
|
4355
4367
|
] }),
|
|
4356
4368
|
bar
|
|
@@ -4358,11 +4370,11 @@ function Footer({
|
|
|
4358
4370
|
}
|
|
4359
4371
|
|
|
4360
4372
|
// src/Success.tsx
|
|
4361
|
-
import { forwardRef as
|
|
4362
|
-
import { jsx as
|
|
4363
|
-
var SuccessCheck =
|
|
4373
|
+
import { forwardRef as forwardRef10, useEffect as useEffect16, useRef as useRef21, useState as useState17 } from "react";
|
|
4374
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4375
|
+
var SuccessCheck = forwardRef10(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
|
|
4364
4376
|
const circled = variant === "circled";
|
|
4365
|
-
return /* @__PURE__ */
|
|
4377
|
+
return /* @__PURE__ */ jsxs36(
|
|
4366
4378
|
"svg",
|
|
4367
4379
|
{
|
|
4368
4380
|
...rest,
|
|
@@ -4374,18 +4386,18 @@ var SuccessCheck = forwardRef9(function SuccessCheck2({ variant = "line", classN
|
|
|
4374
4386
|
"aria-hidden": "true",
|
|
4375
4387
|
focusable: "false",
|
|
4376
4388
|
children: [
|
|
4377
|
-
circled && /* @__PURE__ */
|
|
4378
|
-
/* @__PURE__ */
|
|
4389
|
+
circled && /* @__PURE__ */ jsx41("path", { className: "ui-sx__circle", d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
4390
|
+
/* @__PURE__ */ jsx41("path", { className: "ui-sx__tick", d: circled ? "M22 4L12 14.01l-3-3" : "M20 6L9 17l-5-5" })
|
|
4379
4391
|
]
|
|
4380
4392
|
}
|
|
4381
4393
|
);
|
|
4382
4394
|
});
|
|
4383
|
-
var SuccessPanel =
|
|
4395
|
+
var SuccessPanel = forwardRef10(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
|
|
4384
4396
|
const circled = check === "circled";
|
|
4385
|
-
return /* @__PURE__ */
|
|
4386
|
-
/* @__PURE__ */
|
|
4387
|
-
/* @__PURE__ */
|
|
4388
|
-
sub && /* @__PURE__ */
|
|
4397
|
+
return /* @__PURE__ */ jsxs36("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
|
|
4398
|
+
/* @__PURE__ */ jsx41("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx41(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
|
|
4399
|
+
/* @__PURE__ */ jsx41("div", { className: "ui-success__title", children: title }),
|
|
4400
|
+
sub && /* @__PURE__ */ jsx41("div", { className: "ui-success__sub", children: sub })
|
|
4389
4401
|
] });
|
|
4390
4402
|
});
|
|
4391
4403
|
var pieces = [
|
|
@@ -4422,17 +4434,17 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
|
|
|
4422
4434
|
}, 1e3);
|
|
4423
4435
|
return () => clearInterval(timer);
|
|
4424
4436
|
}, [seconds]);
|
|
4425
|
-
return /* @__PURE__ */
|
|
4426
|
-
/* @__PURE__ */
|
|
4427
|
-
/* @__PURE__ */
|
|
4437
|
+
return /* @__PURE__ */ jsxs36("div", { className: "ui-sx__count", "data-sx-count": "", style: { "--sx-secs": `${seconds}s` }, children: [
|
|
4438
|
+
/* @__PURE__ */ jsx41("span", { className: "ui-sx__count-ring", "aria-hidden": "true" }),
|
|
4439
|
+
/* @__PURE__ */ jsxs36("span", { className: "ui-sx__count-text", children: [
|
|
4428
4440
|
label,
|
|
4429
4441
|
" in ",
|
|
4430
|
-
/* @__PURE__ */
|
|
4442
|
+
/* @__PURE__ */ jsx41("b", { "data-sx-num": "", children: remaining }),
|
|
4431
4443
|
"s"
|
|
4432
4444
|
] })
|
|
4433
4445
|
] });
|
|
4434
4446
|
}
|
|
4435
|
-
var Success =
|
|
4447
|
+
var Success = forwardRef10(function Success2({
|
|
4436
4448
|
layout = "hero",
|
|
4437
4449
|
level,
|
|
4438
4450
|
check = "line",
|
|
@@ -4454,7 +4466,7 @@ var Success = forwardRef9(function Success2({
|
|
|
4454
4466
|
const seconds = countdown?.seconds;
|
|
4455
4467
|
const duration = seconds != null && Number.isFinite(seconds) && seconds >= 1 ? Math.floor(seconds) : 5;
|
|
4456
4468
|
const mark = check === "circled" ? "circled" : "line";
|
|
4457
|
-
return /* @__PURE__ */
|
|
4469
|
+
return /* @__PURE__ */ jsxs36(
|
|
4458
4470
|
"div",
|
|
4459
4471
|
{
|
|
4460
4472
|
role: "status",
|
|
@@ -4463,16 +4475,16 @@ var Success = forwardRef9(function Success2({
|
|
|
4463
4475
|
ref,
|
|
4464
4476
|
className: ["ui-sx", `ui-sx--${layout}`, `ui-sx--check-${mark}`, confetti && "ui-sx--confetti", className].filter(Boolean).join(" "),
|
|
4465
4477
|
children: [
|
|
4466
|
-
confetti && /* @__PURE__ */
|
|
4467
|
-
([x, d, r, t, s], index) => /* @__PURE__ */
|
|
4478
|
+
confetti && /* @__PURE__ */ jsx41("div", { className: "ui-sx__confetti", "aria-hidden": "true", children: pieces.map(
|
|
4479
|
+
([x, d, r, t, s], index) => /* @__PURE__ */ jsx41("i", { className: `ui-sx__piece ui-sx__piece--${t}`, style: { left: `${x}%`, "--sx-d": `${d}s`, "--sx-r": `${r}deg`, "--sx-s": s } }, index)
|
|
4468
4480
|
) }),
|
|
4469
|
-
/* @__PURE__ */
|
|
4470
|
-
/* @__PURE__ */
|
|
4471
|
-
/* @__PURE__ */
|
|
4472
|
-
/* @__PURE__ */
|
|
4473
|
-
body && /* @__PURE__ */
|
|
4474
|
-
hasActions && /* @__PURE__ */
|
|
4475
|
-
countdown && /* @__PURE__ */
|
|
4481
|
+
/* @__PURE__ */ jsxs36("div", { className: "ui-sx__inner", children: [
|
|
4482
|
+
/* @__PURE__ */ jsx41("div", { className: "ui-sx__visual", children: /* @__PURE__ */ jsx41(SuccessCheck, { variant: mark }) }),
|
|
4483
|
+
/* @__PURE__ */ jsxs36("div", { className: "ui-sx__content", children: [
|
|
4484
|
+
/* @__PURE__ */ jsx41(Heading, { className: "ui-sx__title", children: title }),
|
|
4485
|
+
body && /* @__PURE__ */ jsx41("p", { className: "ui-sx__body", children: body }),
|
|
4486
|
+
hasActions && /* @__PURE__ */ jsx41("div", { className: "ui-sx__actions", children: actions }),
|
|
4487
|
+
countdown && /* @__PURE__ */ jsx41(Countdown, { seconds: duration, label: countdown.label, onDone: onCountdownEnd }, duration)
|
|
4476
4488
|
] })
|
|
4477
4489
|
] })
|
|
4478
4490
|
]
|
|
@@ -4491,7 +4503,7 @@ import {
|
|
|
4491
4503
|
useState as useState18
|
|
4492
4504
|
} from "react";
|
|
4493
4505
|
import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
|
|
4494
|
-
import { Fragment as Fragment16, jsx as
|
|
4506
|
+
import { Fragment as Fragment16, jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4495
4507
|
var HEIGHT = { months: 216, bridge: 216, spark: 32 };
|
|
4496
4508
|
var PAD = 2;
|
|
4497
4509
|
var ZERO_INSET = 1.5;
|
|
@@ -4867,7 +4879,7 @@ function Chart(props) {
|
|
|
4867
4879
|
const estimated = columns.filter((c) => c.estimated);
|
|
4868
4880
|
const estimatedTone = marks.find((m) => m.estimated && m.kind === "bar")?.tone ?? keys[0]?.tone ?? "neutral";
|
|
4869
4881
|
const hitBand = (band) => band === "up" ? { y: PAD, h: Math.max(zero - PAD, TARGET) } : band === "down" ? { y: zero, h: Math.max(plotHeight - PAD - zero, TARGET) } : { y: PAD, h: Math.max(plotHeight - PAD * 2, TARGET) };
|
|
4870
|
-
return /* @__PURE__ */
|
|
4882
|
+
return /* @__PURE__ */ jsxs37(
|
|
4871
4883
|
"div",
|
|
4872
4884
|
{
|
|
4873
4885
|
className: cx8("ui-chart", `ui-chart--${variant}`, selectable && "ui-chart--pick", className),
|
|
@@ -4878,9 +4890,9 @@ function Chart(props) {
|
|
|
4878
4890
|
"--ui-chart-pad": `${PAD}px`
|
|
4879
4891
|
},
|
|
4880
4892
|
children: [
|
|
4881
|
-
!spark && keys.length > 0 && /* @__PURE__ */
|
|
4882
|
-
keys.map((key) => /* @__PURE__ */
|
|
4883
|
-
key.shape === "line" ? /* @__PURE__ */
|
|
4893
|
+
!spark && keys.length > 0 && /* @__PURE__ */ jsxs37("ul", { className: "ui-chart__legend", children: [
|
|
4894
|
+
keys.map((key) => /* @__PURE__ */ jsxs37("li", { className: cx8("ui-chart__key", `ui-chart__tone--${key.tone}`), children: [
|
|
4895
|
+
key.shape === "line" ? /* @__PURE__ */ jsx42("svg", { className: "ui-chart__key-mark", width: "18", height: "12", viewBox: "0 0 18 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx42("path", { className: "ui-chart__key-line", d: "M1 9 L6 5 L12 7 L17 3" }) }) : /* @__PURE__ */ jsx42("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx42(
|
|
4884
4896
|
"rect",
|
|
4885
4897
|
{
|
|
4886
4898
|
className: "ui-chart__key-swatch",
|
|
@@ -4893,12 +4905,12 @@ function Chart(props) {
|
|
|
4893
4905
|
) }),
|
|
4894
4906
|
key.name
|
|
4895
4907
|
] }, key.id)),
|
|
4896
|
-
estimated.length > 0 && /* @__PURE__ */
|
|
4897
|
-
/* @__PURE__ */
|
|
4908
|
+
estimated.length > 0 && /* @__PURE__ */ jsxs37("li", { className: cx8("ui-chart__key", `ui-chart__tone--${estimatedTone}`), children: [
|
|
4909
|
+
/* @__PURE__ */ jsx42("svg", { className: "ui-chart__key-mark", width: "12", height: "12", viewBox: "0 0 12 12", "aria-hidden": "true", children: /* @__PURE__ */ jsx42("rect", { className: "ui-chart__key-estimated", x: "1.5", y: "1.5", width: "9", height: "9", rx: "1" }) }),
|
|
4898
4910
|
"Estimated"
|
|
4899
4911
|
] })
|
|
4900
4912
|
] }),
|
|
4901
|
-
/* @__PURE__ */
|
|
4913
|
+
/* @__PURE__ */ jsxs37(
|
|
4902
4914
|
"div",
|
|
4903
4915
|
{
|
|
4904
4916
|
ref: frameEl,
|
|
@@ -4922,8 +4934,8 @@ function Chart(props) {
|
|
|
4922
4934
|
setSaid("");
|
|
4923
4935
|
},
|
|
4924
4936
|
children: [
|
|
4925
|
-
!spark && scale.ticks.length > 0 && /* @__PURE__ */
|
|
4926
|
-
/* @__PURE__ */
|
|
4937
|
+
!spark && scale.ticks.length > 0 && /* @__PURE__ */ jsx42("div", { className: "ui-chart__axis", "aria-hidden": "true", children: [...scale.ticks].reverse().map((tick) => /* @__PURE__ */ jsx42("span", { className: "ui-chart__tick", children: formatAxis(tick) }, tick)) }),
|
|
4938
|
+
/* @__PURE__ */ jsx42("div", { ref: scroller, className: "ui-chart__scroll", tabIndex: -1, onScroll: () => {
|
|
4927
4939
|
syncEdges();
|
|
4928
4940
|
const anchor = [...svgEl.current?.querySelectorAll("[data-anchor]") ?? []].find((el) => el.getAttribute("data-anchor") === openId);
|
|
4929
4941
|
if (!anchor || !scroller.current || !frameEl.current || !tipEl.current) return;
|
|
@@ -4931,8 +4943,8 @@ function Chart(props) {
|
|
|
4931
4943
|
const view = scroller.current.getBoundingClientRect();
|
|
4932
4944
|
if (mark.right <= view.left || mark.left >= view.right) setOpenId(null);
|
|
4933
4945
|
else placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
|
|
4934
|
-
}, children: /* @__PURE__ */
|
|
4935
|
-
/* @__PURE__ */
|
|
4946
|
+
}, children: /* @__PURE__ */ jsxs37("div", { ref: plot, className: "ui-chart__plot", children: [
|
|
4947
|
+
/* @__PURE__ */ jsxs37(
|
|
4936
4948
|
"svg",
|
|
4937
4949
|
{
|
|
4938
4950
|
ref: svgEl,
|
|
@@ -4992,7 +5004,7 @@ function Chart(props) {
|
|
|
4992
5004
|
announce(mark.column, selectable ? mark.column : pick);
|
|
4993
5005
|
},
|
|
4994
5006
|
children: [
|
|
4995
|
-
!spark && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */
|
|
5007
|
+
!spark && pick !== null && pick >= 0 && pick < count && /* @__PURE__ */ jsx42(
|
|
4996
5008
|
"rect",
|
|
4997
5009
|
{
|
|
4998
5010
|
className: "ui-chart__band",
|
|
@@ -5005,7 +5017,7 @@ function Chart(props) {
|
|
|
5005
5017
|
frame.links && frame.bars.slice(0, -1).map((bar, i) => {
|
|
5006
5018
|
const from = byId.get(bar.id);
|
|
5007
5019
|
const to = byId.get(frame.bars[i + 1].id);
|
|
5008
|
-
return from && to ? /* @__PURE__ */
|
|
5020
|
+
return from && to ? /* @__PURE__ */ jsx42(
|
|
5009
5021
|
"line",
|
|
5010
5022
|
{
|
|
5011
5023
|
className: "ui-chart__carry",
|
|
@@ -5017,7 +5029,7 @@ function Chart(props) {
|
|
|
5017
5029
|
`carry-${bar.id}`
|
|
5018
5030
|
) : null;
|
|
5019
5031
|
}),
|
|
5020
|
-
!spark && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */
|
|
5032
|
+
!spark && scale.ticks.filter((tick) => tick !== 0).map((tick) => /* @__PURE__ */ jsx42(
|
|
5021
5033
|
"line",
|
|
5022
5034
|
{
|
|
5023
5035
|
className: "ui-chart__grid",
|
|
@@ -5028,7 +5040,7 @@ function Chart(props) {
|
|
|
5028
5040
|
},
|
|
5029
5041
|
`grid-${tick}`
|
|
5030
5042
|
)),
|
|
5031
|
-
!spark && scale.ticks.includes(0) && /* @__PURE__ */
|
|
5043
|
+
!spark && scale.ticks.includes(0) && /* @__PURE__ */ jsx42(
|
|
5032
5044
|
"line",
|
|
5033
5045
|
{
|
|
5034
5046
|
className: "ui-chart__zero",
|
|
@@ -5038,7 +5050,7 @@ function Chart(props) {
|
|
|
5038
5050
|
y2: px(y(0))
|
|
5039
5051
|
}
|
|
5040
5052
|
),
|
|
5041
|
-
marks.filter((m) => m.kind === "bar").map((mark) => /* @__PURE__ */
|
|
5053
|
+
marks.filter((m) => m.kind === "bar").map((mark) => /* @__PURE__ */ jsx42(
|
|
5042
5054
|
"path",
|
|
5043
5055
|
{
|
|
5044
5056
|
className: cx8(
|
|
@@ -5051,7 +5063,7 @@ function Chart(props) {
|
|
|
5051
5063
|
`bar-${mark.id}`
|
|
5052
5064
|
)),
|
|
5053
5065
|
["casing", "stroke"].map((layer) => lines.flatMap(
|
|
5054
|
-
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */
|
|
5066
|
+
(line) => line.values.slice(1).map((value, i) => Number.isFinite(value) && Number.isFinite(line.values[i]) ? /* @__PURE__ */ jsx42(
|
|
5055
5067
|
"line",
|
|
5056
5068
|
{
|
|
5057
5069
|
className: layer === "casing" ? "ui-chart__line-casing" : cx8(
|
|
@@ -5067,7 +5079,7 @@ function Chart(props) {
|
|
|
5067
5079
|
`${line.id}-${layer}-${i}`
|
|
5068
5080
|
) : null)
|
|
5069
5081
|
)),
|
|
5070
|
-
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */
|
|
5082
|
+
lines.flatMap((line) => line.values.map((value, i) => Number.isFinite(value) && !Number.isFinite(line.values[i - 1]) && !Number.isFinite(line.values[i + 1]) ? /* @__PURE__ */ jsx42(
|
|
5071
5083
|
"circle",
|
|
5072
5084
|
{
|
|
5073
5085
|
className: cx8("ui-chart__isolated", `ui-chart__tone--${line.tone}`),
|
|
@@ -5077,8 +5089,8 @@ function Chart(props) {
|
|
|
5077
5089
|
},
|
|
5078
5090
|
`isolated-${line.id}-${i}`
|
|
5079
5091
|
) : null)),
|
|
5080
|
-
marks.map((mark) => /* @__PURE__ */
|
|
5081
|
-
mark.kind === "bar" ? /* @__PURE__ */
|
|
5092
|
+
marks.map((mark) => /* @__PURE__ */ jsxs37("g", { "data-mark": mark.id, children: [
|
|
5093
|
+
mark.kind === "bar" ? /* @__PURE__ */ jsx42(
|
|
5082
5094
|
"rect",
|
|
5083
5095
|
{
|
|
5084
5096
|
className: "ui-chart__hit",
|
|
@@ -5087,7 +5099,7 @@ function Chart(props) {
|
|
|
5087
5099
|
y: px(hitBand(mark.band).y),
|
|
5088
5100
|
height: px(hitBand(mark.band).h)
|
|
5089
5101
|
}
|
|
5090
|
-
) : /* @__PURE__ */
|
|
5102
|
+
) : /* @__PURE__ */ jsx42(
|
|
5091
5103
|
"rect",
|
|
5092
5104
|
{
|
|
5093
5105
|
className: "ui-chart__hit",
|
|
@@ -5097,7 +5109,7 @@ function Chart(props) {
|
|
|
5097
5109
|
height: px(mark.hit?.h ?? TARGET)
|
|
5098
5110
|
}
|
|
5099
5111
|
),
|
|
5100
|
-
/* @__PURE__ */
|
|
5112
|
+
/* @__PURE__ */ jsx42(
|
|
5101
5113
|
"rect",
|
|
5102
5114
|
{
|
|
5103
5115
|
"data-anchor": mark.id,
|
|
@@ -5112,7 +5124,7 @@ function Chart(props) {
|
|
|
5112
5124
|
]
|
|
5113
5125
|
}
|
|
5114
5126
|
),
|
|
5115
|
-
!spark && /* @__PURE__ */
|
|
5127
|
+
!spark && /* @__PURE__ */ jsx42("div", { className: "ui-chart__periods", "aria-hidden": "true", children: columns.map((column, i) => /* @__PURE__ */ jsx42(
|
|
5116
5128
|
"span",
|
|
5117
5129
|
{
|
|
5118
5130
|
className: cx8("ui-chart__period", pick === i && "is-selected"),
|
|
@@ -5121,35 +5133,35 @@ function Chart(props) {
|
|
|
5121
5133
|
`${column.label}-${i}`
|
|
5122
5134
|
)) })
|
|
5123
5135
|
] }) }),
|
|
5124
|
-
/* @__PURE__ */
|
|
5125
|
-
/* @__PURE__ */
|
|
5126
|
-
/* @__PURE__ */
|
|
5127
|
-
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */
|
|
5136
|
+
/* @__PURE__ */ jsx42("span", { ref: tipEl, className: cx8("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
5137
|
+
/* @__PURE__ */ jsx42("span", { className: "ui-tip__label", children: spark ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
|
|
5138
|
+
/* @__PURE__ */ jsx42("span", { className: "ui-tip__value", children: format(open.value) }),
|
|
5139
|
+
(stateOf(columns[open.column]) || open.detail) && /* @__PURE__ */ jsx42("span", { className: "ui-tip__detail", children: stateOf(columns[open.column]) || open.detail })
|
|
5128
5140
|
] }) })
|
|
5129
5141
|
]
|
|
5130
5142
|
}
|
|
5131
5143
|
),
|
|
5132
|
-
/* @__PURE__ */
|
|
5133
|
-
showTable && /* @__PURE__ */
|
|
5134
|
-
/* @__PURE__ */
|
|
5135
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ jsx42("div", { className: "ui-sr", role: "status", children: said }),
|
|
5145
|
+
showTable && /* @__PURE__ */ jsxs37("details", { className: "ui-chart__data", children: [
|
|
5146
|
+
/* @__PURE__ */ jsx42("summary", { className: "ui-focusable", children: "Values as a table" }),
|
|
5147
|
+
/* @__PURE__ */ jsx42(
|
|
5136
5148
|
"div",
|
|
5137
5149
|
{
|
|
5138
5150
|
className: "ui-table-scroll",
|
|
5139
5151
|
role: "region",
|
|
5140
5152
|
tabIndex: 0,
|
|
5141
5153
|
"aria-label": `${title}, as a table. Scroll for more columns.`,
|
|
5142
|
-
children: /* @__PURE__ */
|
|
5143
|
-
/* @__PURE__ */
|
|
5144
|
-
/* @__PURE__ */
|
|
5145
|
-
/* @__PURE__ */
|
|
5154
|
+
children: /* @__PURE__ */ jsxs37("table", { className: "ui-table", "aria-label": title, children: [
|
|
5155
|
+
/* @__PURE__ */ jsx42("thead", { children: /* @__PURE__ */ jsx42("tr", { children: tableHead.map((head, i) => /* @__PURE__ */ jsx42("th", { scope: "col", className: cx8(i > 0 && "ui-table__num"), children: head }, head)) }) }),
|
|
5156
|
+
/* @__PURE__ */ jsx42("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs37("tr", { "aria-current": pick === i ? true : void 0, children: [
|
|
5157
|
+
/* @__PURE__ */ jsxs37("th", { scope: "row", children: [
|
|
5146
5158
|
row.column.label,
|
|
5147
|
-
row.column.estimated && /* @__PURE__ */
|
|
5159
|
+
row.column.estimated && /* @__PURE__ */ jsxs37(Fragment16, { children: [
|
|
5148
5160
|
" ",
|
|
5149
|
-
/* @__PURE__ */
|
|
5161
|
+
/* @__PURE__ */ jsx42("span", { className: "ui-chart__state", children: stateOf(row.column) })
|
|
5150
5162
|
] })
|
|
5151
5163
|
] }),
|
|
5152
|
-
row.cells.map((cell, j) => /* @__PURE__ */
|
|
5164
|
+
row.cells.map((cell, j) => /* @__PURE__ */ jsx42("td", { className: "ui-table__num", children: cell }, tableHead[j + 1]))
|
|
5153
5165
|
] }, `${row.column.label}-${i}`)) })
|
|
5154
5166
|
] })
|
|
5155
5167
|
}
|
|
@@ -5161,10 +5173,10 @@ function Chart(props) {
|
|
|
5161
5173
|
}
|
|
5162
5174
|
|
|
5163
5175
|
// src/AccentPicker.tsx
|
|
5164
|
-
import { forwardRef as
|
|
5176
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
5165
5177
|
import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
|
|
5166
|
-
import { jsx as
|
|
5167
|
-
var AccentPicker =
|
|
5178
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
5179
|
+
var AccentPicker = forwardRef11(function AccentPicker2({
|
|
5168
5180
|
value,
|
|
5169
5181
|
onChange,
|
|
5170
5182
|
options = ACCENTS,
|
|
@@ -5172,7 +5184,7 @@ var AccentPicker = forwardRef10(function AccentPicker2({
|
|
|
5172
5184
|
"aria-label": label = "Accent",
|
|
5173
5185
|
...rest
|
|
5174
5186
|
}, ref) {
|
|
5175
|
-
return /* @__PURE__ */
|
|
5187
|
+
return /* @__PURE__ */ jsx43(
|
|
5176
5188
|
"div",
|
|
5177
5189
|
{
|
|
5178
5190
|
...rest,
|
|
@@ -5183,7 +5195,7 @@ var AccentPicker = forwardRef10(function AccentPicker2({
|
|
|
5183
5195
|
"aria-label": label,
|
|
5184
5196
|
children: options.map((accent) => {
|
|
5185
5197
|
const title = accent.charAt(0).toUpperCase() + accent.slice(1);
|
|
5186
|
-
return /* @__PURE__ */
|
|
5198
|
+
return /* @__PURE__ */ jsx43(
|
|
5187
5199
|
"button",
|
|
5188
5200
|
{
|
|
5189
5201
|
type: "button",
|
|
@@ -5201,11 +5213,146 @@ var AccentPicker = forwardRef10(function AccentPicker2({
|
|
|
5201
5213
|
);
|
|
5202
5214
|
});
|
|
5203
5215
|
|
|
5216
|
+
// src/TopBar.tsx
|
|
5217
|
+
import { Fragment as Fragment17 } from "react";
|
|
5218
|
+
import { prism as prism3, safeUrl as safeUrl3, icon as icon7, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
|
|
5219
|
+
import { Fragment as Fragment18, jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5220
|
+
function TopBar({
|
|
5221
|
+
brand,
|
|
5222
|
+
word = "Strategy",
|
|
5223
|
+
brandHref = "/",
|
|
5224
|
+
view,
|
|
5225
|
+
version,
|
|
5226
|
+
theme,
|
|
5227
|
+
account,
|
|
5228
|
+
className,
|
|
5229
|
+
...rest
|
|
5230
|
+
}) {
|
|
5231
|
+
return /* @__PURE__ */ jsx44("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs38("div", { className: "topbar__in", children: [
|
|
5232
|
+
brand ?? /* @__PURE__ */ jsxs38("a", { className: "brand", href: safeUrl3(brandHref), "aria-label": `Apliteni ${word}`, children: [
|
|
5233
|
+
/* @__PURE__ */ jsx44("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
|
|
5234
|
+
/* @__PURE__ */ jsx44("span", { children: word })
|
|
5235
|
+
] }),
|
|
5236
|
+
view,
|
|
5237
|
+
/* @__PURE__ */ jsx44("span", { className: "spacer" }),
|
|
5238
|
+
version,
|
|
5239
|
+
theme,
|
|
5240
|
+
account
|
|
5241
|
+
] }) });
|
|
5242
|
+
}
|
|
5243
|
+
function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
5244
|
+
return /* @__PURE__ */ jsx44("div", { className: "dtsw on", role: "group", "aria-label": label, children: items.map((item) => {
|
|
5245
|
+
const current = item.id === active;
|
|
5246
|
+
const linkProps = {
|
|
5247
|
+
className: current ? "cur" : void 0,
|
|
5248
|
+
href: safeUrl3(item.href || `#${item.id}`),
|
|
5249
|
+
target: item.target,
|
|
5250
|
+
"aria-current": current ? "page" : void 0,
|
|
5251
|
+
children: item.label
|
|
5252
|
+
};
|
|
5253
|
+
return /* @__PURE__ */ jsx44(Fragment17, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx44("a", { ...linkProps }) }, item.id);
|
|
5254
|
+
}) });
|
|
5255
|
+
}
|
|
5256
|
+
var BADGE = { live: "Live", archive: "Archive" };
|
|
5257
|
+
function VersionSwitcher({ versions, value, onChange, label = "Version", defaultOpen }) {
|
|
5258
|
+
const current = versions.find((v) => v.value === value);
|
|
5259
|
+
return /* @__PURE__ */ jsx44("div", { className: "vsw", children: /* @__PURE__ */ jsx44(
|
|
5260
|
+
Dropdown,
|
|
5261
|
+
{
|
|
5262
|
+
variant: "select",
|
|
5263
|
+
align: "start",
|
|
5264
|
+
triggerClass: "vsw__btn",
|
|
5265
|
+
panelClass: "vsw__menu",
|
|
5266
|
+
selectedValue: value,
|
|
5267
|
+
chevron: false,
|
|
5268
|
+
defaultOpen,
|
|
5269
|
+
ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
|
|
5270
|
+
triggerContent: /* @__PURE__ */ jsxs38(Fragment18, { children: [
|
|
5271
|
+
/* @__PURE__ */ jsx44("span", { className: "cur", children: current?.label }),
|
|
5272
|
+
/* @__PURE__ */ jsx44("span", { className: "car", "aria-hidden": "true" })
|
|
5273
|
+
] }),
|
|
5274
|
+
items: versions.map((v) => ({
|
|
5275
|
+
label: v.label,
|
|
5276
|
+
value: v.value,
|
|
5277
|
+
badge: BADGE[v.badge ?? "archive"],
|
|
5278
|
+
selected: v.value === value
|
|
5279
|
+
})),
|
|
5280
|
+
row: (item, props) => /* @__PURE__ */ jsxs38("div", { ...props, className: `${props.className} vopt`, children: [
|
|
5281
|
+
/* @__PURE__ */ jsx44("span", { className: "vname", children: item.label }),
|
|
5282
|
+
/* @__PURE__ */ jsx44("span", { className: `vbadge ${item.badge === "Live" ? "live" : "arch"}`, children: String(item.badge) }),
|
|
5283
|
+
/* @__PURE__ */ jsx44("span", { className: "vtick", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon7("check") } })
|
|
5284
|
+
] }),
|
|
5285
|
+
onSelect: (picked) => {
|
|
5286
|
+
if (picked != null) onChange?.(String(picked));
|
|
5287
|
+
}
|
|
5288
|
+
}
|
|
5289
|
+
) });
|
|
5290
|
+
}
|
|
5291
|
+
var initialsOf = (name, email) => {
|
|
5292
|
+
const from = name.trim() || email.split("@")[0] || "";
|
|
5293
|
+
return (from.split(/[\s._-]+/).filter(Boolean).slice(0, 2).map((w) => w[0]).join("") || "?").toUpperCase();
|
|
5294
|
+
};
|
|
5295
|
+
var ACCOUNT_ITEMS = ACCOUNT_NAV.map((item) => ({
|
|
5296
|
+
label: item.label,
|
|
5297
|
+
icon: item.icon,
|
|
5298
|
+
value: item.id,
|
|
5299
|
+
href: `#${item.id}`
|
|
5300
|
+
}));
|
|
5301
|
+
function AccountMenu({
|
|
5302
|
+
name,
|
|
5303
|
+
email,
|
|
5304
|
+
items = ACCOUNT_ITEMS,
|
|
5305
|
+
current = "prefs",
|
|
5306
|
+
signOutHref,
|
|
5307
|
+
onSignOut,
|
|
5308
|
+
onSelect,
|
|
5309
|
+
defaultOpen
|
|
5310
|
+
}) {
|
|
5311
|
+
const mark = initialsOf(name, email);
|
|
5312
|
+
return /* @__PURE__ */ jsx44("div", { className: "acct on", children: /* @__PURE__ */ jsx44(
|
|
5313
|
+
Dropdown,
|
|
5314
|
+
{
|
|
5315
|
+
variant: "menu",
|
|
5316
|
+
align: "end",
|
|
5317
|
+
chevron: false,
|
|
5318
|
+
triggerClass: "avatar",
|
|
5319
|
+
panelClass: "amenu",
|
|
5320
|
+
defaultOpen,
|
|
5321
|
+
ariaLabel: "Account",
|
|
5322
|
+
triggerContent: mark,
|
|
5323
|
+
header: /* @__PURE__ */ jsxs38("div", { className: "ahead", children: [
|
|
5324
|
+
/* @__PURE__ */ jsx44("span", { className: "avatar", children: mark }),
|
|
5325
|
+
/* @__PURE__ */ jsxs38("span", { className: "aw", children: [
|
|
5326
|
+
/* @__PURE__ */ jsx44("span", { className: "anm", children: name }),
|
|
5327
|
+
/* @__PURE__ */ jsx44("span", { className: "aem", title: email, children: email })
|
|
5328
|
+
] })
|
|
5329
|
+
] }),
|
|
5330
|
+
items: [...items, "---", { label: "Sign out", icon: "logout", value: "sign-out", href: signOutHref }],
|
|
5331
|
+
row: (item, props) => /* @__PURE__ */ jsxs38(
|
|
5332
|
+
"a",
|
|
5333
|
+
{
|
|
5334
|
+
...props,
|
|
5335
|
+
href: item.disabled ? void 0 : item.href ? safeUrl3(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl3(item.value === "sign-out" ? "#logout" : `#${item.value}`),
|
|
5336
|
+
className: [props.className.replace(/\bui-dropdown__item\b/, "").trim(), !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
|
|
5337
|
+
children: [
|
|
5338
|
+
item.icon && /* @__PURE__ */ jsx44("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon7(item.icon) } }),
|
|
5339
|
+
item.label
|
|
5340
|
+
]
|
|
5341
|
+
}
|
|
5342
|
+
),
|
|
5343
|
+
onSelect: (value, item) => {
|
|
5344
|
+
if (item.value === "sign-out") onSignOut?.();
|
|
5345
|
+
else onSelect?.(value);
|
|
5346
|
+
}
|
|
5347
|
+
}
|
|
5348
|
+
) });
|
|
5349
|
+
}
|
|
5350
|
+
|
|
5204
5351
|
// src/NavTabs.tsx
|
|
5205
|
-
import { Fragment as
|
|
5206
|
-
import { safeUrl as
|
|
5207
|
-
import { Fragment as
|
|
5208
|
-
var NavTabs =
|
|
5352
|
+
import { Fragment as Fragment19, forwardRef as forwardRef12, useEffect as useEffect18, useRef as useRef23, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
5353
|
+
import { safeUrl as safeUrl4, observeNavFit, revealCurrentNav, revealFocusedNav } from "@apliteni/apliteni-ui";
|
|
5354
|
+
import { Fragment as Fragment20, jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5355
|
+
var NavTabs = forwardRef12(function NavTabs2({
|
|
5209
5356
|
items,
|
|
5210
5357
|
active,
|
|
5211
5358
|
variant = "underline",
|
|
@@ -5222,7 +5369,7 @@ var NavTabs = forwardRef11(function NavTabs2({
|
|
|
5222
5369
|
useEffect18(() => {
|
|
5223
5370
|
if (navRef.current) revealCurrentNav(navRef.current);
|
|
5224
5371
|
}, [active, signature]);
|
|
5225
|
-
return /* @__PURE__ */
|
|
5372
|
+
return /* @__PURE__ */ jsx45(
|
|
5226
5373
|
"nav",
|
|
5227
5374
|
{
|
|
5228
5375
|
...rest,
|
|
@@ -5235,51 +5382,51 @@ var NavTabs = forwardRef11(function NavTabs2({
|
|
|
5235
5382
|
},
|
|
5236
5383
|
children: items.map((item) => {
|
|
5237
5384
|
const badge = item.badge != null && typeof item.badge === "object" ? item.badge : { text: item.badge, tone: void 0 };
|
|
5238
|
-
const inner = /* @__PURE__ */
|
|
5239
|
-
/* @__PURE__ */
|
|
5240
|
-
badge.text != null && badge.text !== "" && /* @__PURE__ */
|
|
5385
|
+
const inner = /* @__PURE__ */ jsxs39(Fragment20, { children: [
|
|
5386
|
+
/* @__PURE__ */ jsx45("span", { className: "ui-nav__tab-label", children: item.label }),
|
|
5387
|
+
badge.text != null && badge.text !== "" && /* @__PURE__ */ jsx45("span", { className: `ui-nav__badge is-${badge.tone || "neutral"}`, children: badge.text })
|
|
5241
5388
|
] });
|
|
5242
|
-
if (item.disabled) return /* @__PURE__ */
|
|
5389
|
+
if (item.disabled) return /* @__PURE__ */ jsx45("span", { className: "ui-nav__tab is-disabled", "aria-disabled": "true", children: inner }, item.id);
|
|
5243
5390
|
const current = item.id === active;
|
|
5244
5391
|
const linkProps = {
|
|
5245
5392
|
className: ["ui-nav__tab", current && "is-active"].filter(Boolean).join(" "),
|
|
5246
|
-
href:
|
|
5393
|
+
href: safeUrl4(item.href || `#${item.id}`),
|
|
5247
5394
|
target: item.target,
|
|
5248
5395
|
"aria-current": current ? "page" : void 0,
|
|
5249
5396
|
children: inner
|
|
5250
5397
|
};
|
|
5251
|
-
return /* @__PURE__ */
|
|
5398
|
+
return /* @__PURE__ */ jsx45(Fragment19, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx45("a", { ...linkProps }) }, item.id);
|
|
5252
5399
|
})
|
|
5253
5400
|
}
|
|
5254
5401
|
);
|
|
5255
5402
|
});
|
|
5256
5403
|
|
|
5257
5404
|
// src/Breadcrumbs.tsx
|
|
5258
|
-
import { forwardRef as
|
|
5259
|
-
import { icon as
|
|
5260
|
-
import { Fragment as
|
|
5261
|
-
var Breadcrumbs =
|
|
5405
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
5406
|
+
import { icon as icon8, safeUrl as safeUrl5 } from "@apliteni/apliteni-ui";
|
|
5407
|
+
import { Fragment as Fragment21, jsx as jsx46, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5408
|
+
var Breadcrumbs = forwardRef13(function Breadcrumbs2({
|
|
5262
5409
|
items,
|
|
5263
5410
|
renderLink,
|
|
5264
5411
|
className,
|
|
5265
5412
|
"aria-label": ariaLabel = "Breadcrumb",
|
|
5266
5413
|
...rest
|
|
5267
5414
|
}, ref) {
|
|
5268
|
-
return /* @__PURE__ */
|
|
5415
|
+
return /* @__PURE__ */ jsx46(
|
|
5269
5416
|
"nav",
|
|
5270
5417
|
{
|
|
5271
5418
|
...rest,
|
|
5272
5419
|
ref,
|
|
5273
5420
|
className: ["ui-nav", "ui-nav--crumbs", className].filter(Boolean).join(" "),
|
|
5274
5421
|
"aria-label": ariaLabel,
|
|
5275
|
-
children: /* @__PURE__ */
|
|
5422
|
+
children: /* @__PURE__ */ jsx46("ol", { className: "ui-nav__crumbs", children: items.map((item, index) => {
|
|
5276
5423
|
const current = index === items.length - 1;
|
|
5277
|
-
const inner = /* @__PURE__ */
|
|
5278
|
-
item.icon && /* @__PURE__ */
|
|
5279
|
-
/* @__PURE__ */
|
|
5424
|
+
const inner = /* @__PURE__ */ jsxs40(Fragment21, { children: [
|
|
5425
|
+
item.icon && /* @__PURE__ */ jsx46("span", { className: "ui-nav__ic", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
5426
|
+
/* @__PURE__ */ jsx46("span", { className: "ui-nav__crumb-label", children: item.label })
|
|
5280
5427
|
] });
|
|
5281
|
-
const linkProps = !current && item.href ? { className: "ui-nav__crumb", href:
|
|
5282
|
-
return /* @__PURE__ */
|
|
5428
|
+
const linkProps = !current && item.href ? { className: "ui-nav__crumb", href: safeUrl5(item.href), target: item.target, children: inner } : null;
|
|
5429
|
+
return /* @__PURE__ */ jsx46("li", { className: "ui-nav__crumb-item", children: linkProps ? renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx46("a", { ...linkProps }) : /* @__PURE__ */ jsx46(
|
|
5283
5430
|
"span",
|
|
5284
5431
|
{
|
|
5285
5432
|
className: ["ui-nav__crumb", current && "is-current"].filter(Boolean).join(" "),
|
|
@@ -5297,7 +5444,9 @@ var PAGE_SIZES = KIT_PAGE_SIZES;
|
|
|
5297
5444
|
var DEFAULT_PAGE_SIZE3 = KIT_DEFAULT_PAGE_SIZE;
|
|
5298
5445
|
export {
|
|
5299
5446
|
AccentPicker,
|
|
5447
|
+
AccountMenu,
|
|
5300
5448
|
AppShell,
|
|
5449
|
+
AuthShell,
|
|
5301
5450
|
Avatar,
|
|
5302
5451
|
BackLink,
|
|
5303
5452
|
Badge,
|
|
@@ -5356,6 +5505,9 @@ export {
|
|
|
5356
5505
|
Timeline,
|
|
5357
5506
|
Toast,
|
|
5358
5507
|
Tooltip,
|
|
5508
|
+
TopBar,
|
|
5509
|
+
VersionSwitcher,
|
|
5510
|
+
ViewSwitch,
|
|
5359
5511
|
sortTableRows,
|
|
5360
5512
|
useToast
|
|
5361
5513
|
};
|
package/src/components/topbar.js
CHANGED
|
@@ -38,11 +38,11 @@ export function versionSwitcher(versions = [], activeIdx = 0) {
|
|
|
38
38
|
const opts = versions.map((v, i) => {
|
|
39
39
|
const key = String(v.badge || 'archive').toLowerCase();
|
|
40
40
|
return `<div class="vopt" role="option" data-dd-item tabindex="-1" aria-selected="${i === activeIdx}" data-active="${i === activeIdx ? '1' : '0'}">` +
|
|
41
|
-
`<span
|
|
42
|
-
`<span class="vbadge ${key === 'live' ? 'live' : 'arch'}">${Object.hasOwn(VBADGE, key) ? VBADGE[key] : v.badge}</span></div>`;
|
|
41
|
+
`<span class="vname">${v.label}</span>` +
|
|
42
|
+
`<span class="vbadge ${key === 'live' ? 'live' : 'arch'}">${Object.hasOwn(VBADGE, key) ? VBADGE[key] : v.badge}</span><span class="vtick" aria-hidden="true">${icon('check')}</span></div>`;
|
|
43
43
|
}).join('');
|
|
44
44
|
return `<div class="vsw" data-dropdown><button type="button" class="vsw__btn" data-dropdown-trigger aria-haspopup="listbox" aria-expanded="false" aria-label="Version — ${esc(cur)}">` +
|
|
45
|
-
`<span class="
|
|
45
|
+
`<span class="cur">${cur}</span><span class="car"></span></button>` +
|
|
46
46
|
`<div class="vsw__menu" data-dropdown-panel role="listbox" aria-label="Version">${opts}</div></div>`;
|
|
47
47
|
}
|
|
48
48
|
|
package/src/styles/topbar.css
CHANGED
|
@@ -69,7 +69,11 @@
|
|
|
69
69
|
transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
|
|
70
70
|
}
|
|
71
71
|
.dtsw a:hover { color: var(--strong); }
|
|
72
|
-
.dtsw a.cur { color: var(--
|
|
72
|
+
.dtsw a.cur { color: var(--accent-contrast); background: var(--accent); }
|
|
73
|
+
:where(:root[data-theme="dark"]) .dtsw a.cur { color: var(--signal-contrast); }
|
|
74
|
+
@media (forced-colors: active) {
|
|
75
|
+
.dtsw a.cur { forced-color-adjust: none; background: Highlight; color: HighlightText; --ring: var(--ring-width) solid CanvasText; }
|
|
76
|
+
}
|
|
73
77
|
.dtsw a:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
74
78
|
|
|
75
79
|
/* Theme toggle — a single icon-only switch (no label). */
|
|
@@ -96,6 +100,7 @@
|
|
|
96
100
|
|
|
97
101
|
/* Version switcher */
|
|
98
102
|
.vsw { position: relative; }
|
|
103
|
+
.vsw > .ui-dropdown { max-width: 100%; min-width: 0; }
|
|
99
104
|
.vsw__btn {
|
|
100
105
|
display: inline-flex;
|
|
101
106
|
align-items: center;
|
|
@@ -117,16 +122,16 @@
|
|
|
117
122
|
what the kit's rows already chose. why: docs/foundations.md#the-focus-ring */
|
|
118
123
|
.vsw__btn:hover:not(:focus-visible) { border-color: var(--accent); }
|
|
119
124
|
.vsw__btn:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
120
|
-
.vsw__btn .lbl { color: var(--text); }
|
|
121
125
|
.vsw__btn .cur { color: var(--strong); font-weight: 600; letter-spacing: 0.01em; }
|
|
122
126
|
.vsw__btn .car {
|
|
123
127
|
width: 8px; height: 8px;
|
|
124
128
|
border-right: 1.6px solid var(--muted);
|
|
125
129
|
border-bottom: 1.6px solid var(--muted);
|
|
126
|
-
transform:
|
|
130
|
+
transform: translateY(-2px) rotate(45deg);
|
|
127
131
|
transition: transform var(--dur-fast) var(--ease);
|
|
128
132
|
}
|
|
129
|
-
.vsw.open .vsw__btn .car
|
|
133
|
+
.vsw.open .vsw__btn .car,
|
|
134
|
+
.vsw .ui-dropdown.open .vsw__btn .car { transform: translateY(2px) rotate(-135deg); }
|
|
130
135
|
.vsw__menu {
|
|
131
136
|
position: absolute;
|
|
132
137
|
top: calc(100% + 9px);
|
|
@@ -214,8 +219,12 @@
|
|
|
214
219
|
the arrow keys, and this is one. It takes the ring on its own 10px radius, the
|
|
215
220
|
same way `.amenu a` above does. #482 */
|
|
216
221
|
.vopt:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
222
|
+
/* The selected version carries the kit's menu tick, as `.ui-dropdown__tick` does for
|
|
223
|
+
every other menu; the badge keeps its own place beside it. */
|
|
224
|
+
.vopt .vtick { margin-left: 8px; flex: none; display: none; color: var(--accent); margin-top: 1px; }
|
|
225
|
+
.vopt .vtick svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.4; }
|
|
226
|
+
.vopt[aria-selected="true"] .vtick { display: inline-flex; }
|
|
217
227
|
.vopt .vname { font-family: var(--font-sans); font-size: calc(var(--text-sm) - 0.5px); color: var(--strong); font-weight: 600; letter-spacing: 0.01em; }
|
|
218
|
-
.vopt .vmeta { font-size: var(--text-xs); color: var(--text); margin-top: 2px; }
|
|
219
228
|
.vopt .vbadge {
|
|
220
229
|
/* rank: chip */
|
|
221
230
|
font-size: var(--text-xs);
|
|
@@ -231,10 +240,8 @@
|
|
|
231
240
|
the same neutral chip fill rather than the card surface — which, inside a panel that
|
|
232
241
|
is itself lighter than a card, was darker than the ground it sat on. #453 */
|
|
233
242
|
.vbadge.arch { /* muted-ink: state — archived version */ color: var(--muted); background: var(--chip-neutral-fill); /* ring-gap: inherit — translucent wash retains the opaque containing gap. */ }
|
|
234
|
-
/*
|
|
235
|
-
Anchor the menu to its right edge so a closed panel cannot widen the page. */
|
|
243
|
+
/* Anchor the menu to its right edge so a closed panel cannot widen the page. */
|
|
236
244
|
@media (max-width: 720px) {
|
|
237
|
-
.vsw__btn .lbl { display: none; }
|
|
238
245
|
.vsw__menu { left: auto; right: 0; }
|
|
239
246
|
}
|
|
240
247
|
|
|
@@ -273,7 +280,7 @@
|
|
|
273
280
|
end inset. A long label gives way to an ellipsis, and 8px always stays between the
|
|
274
281
|
two controls. */
|
|
275
282
|
.topbar__in > .vsw { grid-area: 2 / 2 / 3 / -1; justify-self: end; min-width: 0; max-width: calc(100% - var(--space-2)); margin-left: var(--space-2); }
|
|
276
|
-
.vsw__btn { max-width: 100%; }
|
|
283
|
+
.vsw__btn { max-width: 100%; min-width: 0; }
|
|
277
284
|
.vsw__btn .cur { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
278
285
|
.vsw__btn .car { flex: none; }
|
|
279
286
|
/* Two 44px rows, an 8px gap, the 4px and 3px insets and the bottom border. */
|
|
@@ -304,6 +311,8 @@
|
|
|
304
311
|
accent band is the second band #578 round r34 took off the focus rules, and a
|
|
305
312
|
pointer resting on a focused control would put it back. One indicator, which is
|
|
306
313
|
what the kit's rows already chose. why: docs/foundations.md#the-focus-ring */
|
|
314
|
+
/* The React menu puts the dropdown trigger's pill padding and flex row on the avatar. */
|
|
315
|
+
.acct .avatar { display: grid; padding: 0; }
|
|
307
316
|
.acct .avatar:hover:not(:focus-visible) { border-color: var(--accent); }
|
|
308
317
|
.avatar:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
309
318
|
/* The account button holding an Avatar: the part paints the circle in the reader's hue and
|
|
@@ -376,6 +385,8 @@
|
|
|
376
385
|
border-radius: 14px 14px 0 0;
|
|
377
386
|
display: flex; align-items: center; gap: 11px;
|
|
378
387
|
}
|
|
388
|
+
.amenu .ui-dropdown__sep { margin: 5px 0; }
|
|
389
|
+
.amenu .ahead .avatar { cursor: default; }
|
|
379
390
|
.amenu .ahead .aw { min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.35; }
|
|
380
391
|
.amenu .ahead .anm { color: var(--strong); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
381
392
|
.amenu .ahead .aem { color: var(--text); font-size: calc(var(--text-xs) + 0.5px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
@@ -388,6 +399,10 @@
|
|
|
388
399
|
.amenu a:hover { outline: 1px solid var(--control-edge); outline-offset: -1px; background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
|
|
389
400
|
.amenu a:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); border-radius: var(--radius-xs); }
|
|
390
401
|
.amenu a.cur { color: var(--accent); }
|
|
402
|
+
/* A custom account row keeps the Dropdown's disabled state without its row shape. */
|
|
403
|
+
.amenu a.is-disabled { /* muted-ink: state — unavailable account page */ color: var(--disabled-ink); cursor: not-allowed; pointer-events: none; }
|
|
404
|
+
/* The SVG takes the row's height; its React wrapper adds no line box. */
|
|
405
|
+
.amenu a > span[aria-hidden="true"] { display: contents; }
|
|
391
406
|
.amenu a svg { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; opacity: 0.85; }
|
|
392
407
|
.amenu .asep { height: 1px; background: var(--border); margin: 5px 0; }
|
|
393
408
|
.amenu a.aout { color: var(--text); }
|