@medalsocial/meda 2.8.0 → 3.0.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 +105 -2
- package/dist/auth/auth-message.d.ts +3 -3
- package/dist/auth/auth-provider-button.d.ts +1 -1
- package/dist/auth/auth-provider-list.d.ts +1 -1
- package/dist/auth/better-auth.d.ts +3 -3
- package/dist/brand/medal-social-mark.d.ts +1 -1
- package/dist/calendar/calendar-toolbar.d.ts +1 -1
- package/dist/calendar/calendar.d.ts +1 -1
- package/dist/calendar/day-view.d.ts +1 -1
- package/dist/calendar/internal/day-cell.d.ts +1 -1
- package/dist/calendar/internal/event-pill.d.ts +1 -1
- package/dist/calendar/internal/time-slot.d.ts +1 -1
- package/dist/calendar/month-view.d.ts +1 -1
- package/dist/calendar/week-view.d.ts +1 -1
- package/dist/chat/latency-badge.d.ts +1 -1
- package/dist/chat/latency-breakdown.d.ts +1 -1
- package/dist/chat/tool-call-block.d.ts +1 -1
- package/dist/chat/transcript-stream.d.ts +1 -1
- package/dist/chat/turn-card.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/collapsible.d.ts +3 -3
- package/dist/components/ui/command.d.ts +9 -9
- package/dist/components/ui/dialog.d.ts +10 -10
- package/dist/components/ui/drawer.d.ts +10 -10
- package/dist/components/ui/dropdown-menu.d.ts +15 -15
- package/dist/components/ui/tooltip.d.ts +4 -4
- package/dist/email-builder/block-palette.d.ts +1 -1
- package/dist/email-builder/block-renderer.d.ts +1 -1
- package/dist/email-builder/block-renderers/button.d.ts +1 -1
- package/dist/email-builder/block-renderers/columns.d.ts +1 -1
- package/dist/email-builder/block-renderers/divider.d.ts +1 -1
- package/dist/email-builder/block-renderers/footer.d.ts +1 -1
- package/dist/email-builder/block-renderers/heading.d.ts +1 -1
- package/dist/email-builder/block-renderers/image.d.ts +1 -1
- package/dist/email-builder/block-renderers/social.d.ts +1 -1
- package/dist/email-builder/block-renderers/spacer.d.ts +1 -1
- package/dist/email-builder/block-renderers/text.d.ts +1 -1
- package/dist/email-builder/builder-canvas.d.ts +1 -1
- package/dist/email-builder/builder-header.d.ts +1 -1
- package/dist/email-builder/builder-left-tabs.d.ts +1 -1
- package/dist/email-builder/email-builder.d.ts +1 -1
- package/dist/email-builder/envelope-card.d.ts +1 -1
- package/dist/email-builder/floating-bar.d.ts +1 -1
- package/dist/email-builder/internal/dnd-wrapper.d.ts +1 -1
- package/dist/email-builder/mobile-drawers.d.ts +1 -1
- package/dist/email-builder/mobile-tab-bar.d.ts +1 -1
- package/dist/email-builder/property-editors/_shared.d.ts +8 -8
- package/dist/email-builder/property-editors/button-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/columns-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/divider-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/footer-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/heading-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/image-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/social-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/spacer-editor.d.ts +1 -1
- package/dist/email-builder/property-editors/text-editor.d.ts +1 -1
- package/dist/email-builder/property-inspector.d.ts +1 -1
- package/dist/email-builder/view-controls.d.ts +1 -1
- package/dist/kanban/kanban-board.d.ts +1 -1
- package/dist/kanban/kanban-card-wrapper.d.ts +1 -1
- package/dist/kanban/kanban-column.d.ts +1 -1
- package/dist/list/list-row.d.ts +2 -2
- package/dist/marketing/marketing-announcement-bar.d.ts +1 -1
- package/dist/marketing/marketing-bento-card.d.ts +1 -1
- package/dist/marketing/marketing-bento-grid.d.ts +1 -1
- package/dist/marketing/marketing-callout.d.ts +1 -1
- package/dist/marketing/marketing-contact.d.ts +1 -1
- package/dist/marketing/marketing-cta-list.d.ts +1 -1
- package/dist/marketing/marketing-cta.d.ts +1 -1
- package/dist/marketing/marketing-faq.d.ts +1 -1
- package/dist/marketing/marketing-footer.d.ts +1 -1
- package/dist/marketing/marketing-header-logo.d.ts +1 -1
- package/dist/marketing/marketing-header.d.ts +1 -1
- package/dist/marketing/marketing-hero.d.ts +1 -1
- package/dist/marketing/marketing-lead-magnet.d.ts +1 -1
- package/dist/marketing/marketing-mega-menu.d.ts +1 -1
- package/dist/marketing/marketing-nav-item.d.ts +1 -1
- package/dist/marketing/marketing-numbered-features.d.ts +1 -1
- package/dist/marketing/marketing-shell.d.ts +1 -1
- package/dist/marketing/marketing-trust-bar.d.ts +1 -1
- package/dist/panel/inspector-field.d.ts +1 -1
- package/dist/panel/inspector-json.d.ts +1 -1
- package/dist/panel/inspector.d.ts +1 -1
- package/dist/post-preview/internal/avatar.d.ts +1 -1
- package/dist/post-preview/platforms/bluesky.d.ts +1 -1
- package/dist/post-preview/platforms/discord.d.ts +1 -1
- package/dist/post-preview/platforms/facebook.d.ts +1 -1
- package/dist/post-preview/platforms/generic.d.ts +1 -1
- package/dist/post-preview/platforms/google-business.d.ts +1 -1
- package/dist/post-preview/platforms/instagram.d.ts +1 -1
- package/dist/post-preview/platforms/linkedin.d.ts +1 -1
- package/dist/post-preview/platforms/telegram.d.ts +1 -1
- package/dist/post-preview/platforms/threads.d.ts +1 -1
- package/dist/post-preview/platforms/tiktok.d.ts +1 -1
- package/dist/post-preview/platforms/twitter.d.ts +1 -1
- package/dist/post-preview/platforms/youtube.d.ts +1 -1
- package/dist/primitives/avatar.d.ts +24 -0
- package/dist/primitives/avatar.js +44 -0
- package/dist/primitives/button.d.ts +21 -0
- package/dist/primitives/button.js +51 -0
- package/dist/primitives/card.d.ts +4 -4
- package/dist/primitives/empty-state.d.ts +1 -1
- package/dist/primitives/filter-rail.d.ts +2 -2
- package/dist/primitives/index.d.ts +8 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/input.d.ts +10 -0
- package/dist/primitives/input.js +9 -0
- package/dist/primitives/markdown-view.d.ts +1 -1
- package/dist/primitives/skeleton.d.ts +1 -1
- package/dist/primitives/status-pill.d.ts +1 -1
- package/dist/primitives/toggle-group.d.ts +46 -0
- package/dist/primitives/toggle-group.js +148 -0
- package/dist/shell/app-shell-auth.d.ts +1 -1
- package/dist/shell/app-shell-chat.d.ts +1 -1
- package/dist/shell/app-shell-workspace.d.ts +1 -1
- package/dist/shell/app-shell.d.ts +2 -2
- package/dist/shell/command-palette.d.ts +1 -1
- package/dist/shell/context-rail.d.ts +1 -1
- package/dist/shell/drag-mode-banner.d.ts +1 -1
- package/dist/shell/extras/shell-desktop-panel-dock.d.ts +1 -1
- package/dist/shell/extras/shell-scrollable-content.d.ts +1 -1
- package/dist/shell/extras/shell-tab-bar.d.ts +1 -1
- package/dist/shell/extras/workbench-layout.d.ts +1 -1
- package/dist/shell/icon-rail.d.ts +2 -2
- package/dist/shell/internal/mobile-bottom-nav.d.ts +1 -1
- package/dist/shell/internal/mobile-dock.d.ts +1 -1
- package/dist/shell/internal/mobile-dock.js +2 -2
- package/dist/shell/internal/mobile-drawers.d.ts +1 -1
- package/dist/shell/internal/mobile-header.d.ts +1 -1
- package/dist/shell/internal/mobile-workspace-sheet.d.ts +1 -1
- package/dist/shell/panel-views-provider.d.ts +1 -1
- package/dist/shell/rail-drop-slot.d.ts +1 -1
- package/dist/shell/rail-drop-zones.d.ts +1 -1
- package/dist/shell/resizable-shell.d.ts +3 -3
- package/dist/shell/right-panel.d.ts +1 -1
- package/dist/shell/shell-header.d.ts +4 -4
- package/dist/shell/shell-main.d.ts +1 -1
- package/dist/shell/shell-provider.d.ts +1 -1
- package/dist/shell/theme-next-themes.d.ts +1 -1
- package/dist/shell/theme.d.ts +2 -2
- package/dist/shell/use-shell-viewport.js +3 -1
- package/dist/styles/base.css +40 -0
- package/dist/styles/bridge.css +159 -0
- package/dist/styles/calendar.css +8 -0
- package/dist/styles/primitives.css +10 -0
- package/dist/styles/theme.css +12 -162
- package/dist/styles/vendor/xyflow.css +626 -0
- package/dist/styles/workflow-builder.css +17 -0
- package/dist/timeline/date-switcher.d.ts +1 -1
- package/dist/timeline/event-card.d.ts +1 -1
- package/dist/timeline/lane-timeline.d.ts +1 -1
- package/dist/timeline/lane.d.ts +1 -1
- package/dist/timeline/live-indicator.d.ts +1 -1
- package/dist/timeline/scrub-bar.d.ts +1 -1
- package/dist/timeline/time-axis.d.ts +1 -1
- package/dist/timeline/timeline-rail.d.ts +1 -1
- package/dist/timeline/timeline-tape.d.ts +1 -1
- package/dist/voice/voice-level.d.ts +2 -1
- package/dist/voice/voice-orb-scene.d.ts +2 -1
- package/dist/voice/voice-status-pill.d.ts +1 -1
- package/dist/workflow-builder/edges/default-edge.d.ts +1 -1
- package/dist/workflow-builder/nodes/action-node.d.ts +1 -1
- package/dist/workflow-builder/nodes/base-node.d.ts +1 -1
- package/dist/workflow-builder/nodes/condition-node.d.ts +1 -1
- package/dist/workflow-builder/nodes/delay-node.d.ts +1 -1
- package/dist/workflow-builder/nodes/end-node.d.ts +1 -1
- package/dist/workflow-builder/nodes/trigger-node.d.ts +1 -1
- package/dist/workflow-builder/workflow-builder.d.ts +1 -1
- package/dist/workflow-builder/workflow-canvas.d.ts +1 -1
- package/dist/workflow-builder/workflow-card-compact.d.ts +1 -1
- package/dist/workflow-builder/workflow-card.d.ts +1 -1
- package/dist/workflow-builder/workflow-header.d.ts +1 -1
- package/dist/workflow-builder/workflow-toolbox.d.ts +1 -1
- package/package.json +76 -46
|
@@ -12,8 +12,8 @@ export interface FilterRailGroupProps extends Omit<ComponentPropsWithoutRef<'fie
|
|
|
12
12
|
description?: ReactNode;
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
}
|
|
15
|
-
declare function FilterRailGroup({ title, description, children, className, ...props }: FilterRailGroupProps): import("react
|
|
16
|
-
declare function FilterRailRoot({ title, description, search, actions, footer, children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: FilterRailProps): import("react
|
|
15
|
+
declare function FilterRailGroup({ title, description, children, className, ...props }: FilterRailGroupProps): import("react").JSX.Element;
|
|
16
|
+
declare function FilterRailRoot({ title, description, search, actions, footer, children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: FilterRailProps): import("react").JSX.Element;
|
|
17
17
|
export declare const FilterRail: typeof FilterRailRoot & {
|
|
18
18
|
Group: typeof FilterRailGroup;
|
|
19
19
|
};
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
export type { AvatarProps, AvatarSize } from './avatar.js';
|
|
2
|
+
export { Avatar, getInitials } from './avatar.js';
|
|
3
|
+
export type { ButtonProps, ButtonSize, ButtonVariant } from './button.js';
|
|
4
|
+
export { Button } from './button.js';
|
|
1
5
|
export type { CardBodyProps, CardFooterProps, CardHeaderProps, CardProps, } from './card.js';
|
|
2
6
|
export { Card } from './card.js';
|
|
3
7
|
export type { EmptyStateProps, EmptyStateVariant } from './empty-state.js';
|
|
4
8
|
export { EmptyState } from './empty-state.js';
|
|
5
9
|
export type { FilterRailGroupProps, FilterRailProps } from './filter-rail.js';
|
|
6
10
|
export { FilterRail } from './filter-rail.js';
|
|
11
|
+
export type { InputProps } from './input.js';
|
|
12
|
+
export { Input } from './input.js';
|
|
7
13
|
export type { SkeletonProps } from './skeleton.js';
|
|
8
14
|
export { Skeleton } from './skeleton.js';
|
|
9
15
|
export type { StatusPillProps, StatusPillSize, StatusPillTone } from './status-pill.js';
|
|
10
16
|
export { StatusPill } from './status-pill.js';
|
|
17
|
+
export type { ToggleGroupItemProps, ToggleGroupMultipleProps, ToggleGroupOrientation, ToggleGroupProps, ToggleGroupSingleProps, ToggleGroupSize, } from './toggle-group.js';
|
|
18
|
+
export { ToggleGroup } from './toggle-group.js';
|
package/dist/primitives/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export { Avatar, getInitials } from './avatar.js';
|
|
2
|
+
export { Button } from './button.js';
|
|
1
3
|
export { Card } from './card.js';
|
|
2
4
|
export { EmptyState } from './empty-state.js';
|
|
3
5
|
export { FilterRail } from './filter-rail.js';
|
|
6
|
+
export { Input } from './input.js';
|
|
4
7
|
export { Skeleton } from './skeleton.js';
|
|
5
8
|
export { StatusPill } from './status-pill.js';
|
|
9
|
+
export { ToggleGroup } from './toggle-group.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
export interface InputProps extends ComponentProps<'input'> {
|
|
3
|
+
/**
|
|
4
|
+
* Marks the field invalid: sets `aria-invalid="true"` and the destructive
|
|
5
|
+
* border/ring. Pair it with `aria-describedby` pointing at the error text.
|
|
6
|
+
* An explicit `aria-invalid` prop still wins.
|
|
7
|
+
*/
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function Input({ invalid, type, className, 'aria-invalid': ariaInvalid, ...props }: InputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../lib/utils.js';
|
|
4
|
+
export function Input({ invalid = false, type = 'text', className, 'aria-invalid': ariaInvalid, ...props }) {
|
|
5
|
+
const resolvedInvalid = ariaInvalid ?? (invalid || undefined);
|
|
6
|
+
return (_jsx("input", { type: type, "data-slot": "input", "data-invalid": resolvedInvalid === true || resolvedInvalid === 'true' ? '' : undefined, "aria-invalid": resolvedInvalid, className: cn(
|
|
7
|
+
// text-base below `sm` keeps iOS Safari from zooming on focus.
|
|
8
|
+
'flex h-10 w-full min-w-0 rounded-md border border-input bg-background px-3 py-2 text-base text-foreground transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:focus-visible:ring-destructive/30 file:border-0 file:bg-transparent file:text-sm file:font-medium sm:text-sm', className), ...props }));
|
|
9
|
+
}
|
|
@@ -19,4 +19,4 @@ export interface MarkdownViewProps extends Omit<ComponentPropsWithoutRef<'div'>,
|
|
|
19
19
|
* pnpm add react-markdown remark-gfm rehype-highlight
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export declare function MarkdownView({ children, className, components, ...props }: MarkdownViewProps): import("react
|
|
22
|
+
export declare function MarkdownView({ children, className, components, ...props }: MarkdownViewProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
export type SkeletonProps = ComponentProps<'div'>;
|
|
3
|
-
export declare function Skeleton({ className, 'aria-hidden': ariaHidden, ...props }: SkeletonProps): import("react
|
|
3
|
+
export declare function Skeleton({ className, 'aria-hidden': ariaHidden, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
@@ -9,4 +9,4 @@ export interface StatusPillProps extends ComponentPropsWithoutRef<'span'> {
|
|
|
9
9
|
*/
|
|
10
10
|
dot?: boolean;
|
|
11
11
|
}
|
|
12
|
-
export declare function StatusPill({ tone, size, dot, className, children, ...props }: StatusPillProps): import("react
|
|
12
|
+
export declare function StatusPill({ tone, size, dot, className, children, ...props }: StatusPillProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
export type ToggleGroupSize = 'sm' | 'md';
|
|
3
|
+
export type ToggleGroupOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
interface ToggleGroupBaseProps extends Omit<ComponentProps<'div'>, 'defaultValue' | 'onChange' | 'role'> {
|
|
5
|
+
size?: ToggleGroupSize;
|
|
6
|
+
orientation?: ToggleGroupOrientation;
|
|
7
|
+
/** Disables every item. */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ToggleGroupSingleProps extends ToggleGroupBaseProps {
|
|
11
|
+
/**
|
|
12
|
+
* `single` (default) behaves like a radio group: exactly one chip can be
|
|
13
|
+
* chosen, arrow keys move focus AND selection (WAI-ARIA radio pattern), and
|
|
14
|
+
* the chosen chip cannot be un-chosen by clicking it again.
|
|
15
|
+
*/
|
|
16
|
+
type?: 'single';
|
|
17
|
+
value?: string | null;
|
|
18
|
+
defaultValue?: string | null;
|
|
19
|
+
onValueChange?: (value: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ToggleGroupMultipleProps extends ToggleGroupBaseProps {
|
|
22
|
+
/**
|
|
23
|
+
* `multiple` is a group of independent toggle buttons (`aria-pressed`);
|
|
24
|
+
* arrow keys only move focus, Space / Enter toggles.
|
|
25
|
+
*/
|
|
26
|
+
type: 'multiple';
|
|
27
|
+
value?: string[];
|
|
28
|
+
defaultValue?: string[];
|
|
29
|
+
onValueChange?: (value: string[]) => void;
|
|
30
|
+
}
|
|
31
|
+
export type ToggleGroupProps = ToggleGroupSingleProps | ToggleGroupMultipleProps;
|
|
32
|
+
export interface ToggleGroupItemProps extends Omit<ComponentProps<'button'>, 'value'> {
|
|
33
|
+
value: string;
|
|
34
|
+
}
|
|
35
|
+
declare function ToggleGroupRoot(props: ToggleGroupProps): import("react").JSX.Element;
|
|
36
|
+
declare function ToggleGroupItem({ value, disabled: itemDisabled, className, children, onClick, onKeyDown, onFocus, ...props }: ToggleGroupItemProps): import("react").JSX.Element;
|
|
37
|
+
/**
|
|
38
|
+
* Chip-style single- or multi-select. `type="single"` (default) is a
|
|
39
|
+
* `radiogroup`; `type="multiple"` is a `group` of `aria-pressed` toggles.
|
|
40
|
+
* Both use a roving tabindex (one Tab stop) with Arrow / Home / End keys.
|
|
41
|
+
* Give the group an accessible name via `aria-label` or `aria-labelledby`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const ToggleGroup: typeof ToggleGroupRoot & {
|
|
44
|
+
Item: typeof ToggleGroupItem;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useCallback, useContext, useLayoutEffect, useRef, useState, } from 'react';
|
|
4
|
+
import { cn } from '../lib/utils.js';
|
|
5
|
+
const ToggleGroupContext = createContext(null);
|
|
6
|
+
function useToggleGroupContext() {
|
|
7
|
+
const context = useContext(ToggleGroupContext);
|
|
8
|
+
if (!context)
|
|
9
|
+
throw new Error('ToggleGroup.Item must be rendered inside <ToggleGroup>.');
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
12
|
+
const ITEM_SELECTOR = '[data-slot="toggle-group-item"]';
|
|
13
|
+
const NEXT_KEYS = {
|
|
14
|
+
horizontal: ['ArrowRight', 'ArrowDown'],
|
|
15
|
+
vertical: ['ArrowDown', 'ArrowRight'],
|
|
16
|
+
};
|
|
17
|
+
const PREV_KEYS = {
|
|
18
|
+
horizontal: ['ArrowLeft', 'ArrowUp'],
|
|
19
|
+
vertical: ['ArrowUp', 'ArrowLeft'],
|
|
20
|
+
};
|
|
21
|
+
const SIZE_CLASSES = {
|
|
22
|
+
sm: 'h-8 px-3 text-xs [&_svg]:size-3.5',
|
|
23
|
+
md: 'h-10 px-4 text-sm [&_svg]:size-4',
|
|
24
|
+
};
|
|
25
|
+
function toArray(value) {
|
|
26
|
+
if (Array.isArray(value))
|
|
27
|
+
return value;
|
|
28
|
+
return value == null ? [] : [value];
|
|
29
|
+
}
|
|
30
|
+
function ToggleGroupRoot(props) {
|
|
31
|
+
const { type = 'single', value, defaultValue, onValueChange, size = 'md', orientation = 'horizontal', disabled = false, className, children, ...rest } = props;
|
|
32
|
+
const rootRef = useRef(null);
|
|
33
|
+
const [uncontrolled, setUncontrolled] = useState(() => toArray(defaultValue));
|
|
34
|
+
const isControlled = value !== undefined;
|
|
35
|
+
const selected = isControlled ? toArray(value) : uncontrolled;
|
|
36
|
+
const [focused, setFocused] = useState(null);
|
|
37
|
+
const [tabbable, setTabbable] = useState(undefined);
|
|
38
|
+
const enabledItems = useCallback(() => Array.from(rootRef.current?.querySelectorAll(ITEM_SELECTOR) ?? []).filter((item) => !item.disabled), []);
|
|
39
|
+
// Roving tabindex: exactly one enabled item is in the tab order — the last
|
|
40
|
+
// focused one, else the (first) selected one, else the first enabled one.
|
|
41
|
+
// Measured from the DOM after each render so nested / conditional items
|
|
42
|
+
// just work; the state update bails out when nothing changed.
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
const values = enabledItems().map((item) => item.dataset.value ?? '');
|
|
45
|
+
const next = [focused, ...selected].find((v) => v != null && values.includes(v)) ?? values[0];
|
|
46
|
+
setTabbable(next ?? null);
|
|
47
|
+
});
|
|
48
|
+
const commit = (next) => {
|
|
49
|
+
if (!isControlled)
|
|
50
|
+
setUncontrolled(next);
|
|
51
|
+
if (type === 'multiple') {
|
|
52
|
+
onValueChange?.(next);
|
|
53
|
+
}
|
|
54
|
+
else if (next[0] !== undefined) {
|
|
55
|
+
onValueChange?.(next[0]);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const toggle = (itemValue) => {
|
|
59
|
+
if (type === 'multiple') {
|
|
60
|
+
commit(selected.includes(itemValue)
|
|
61
|
+
? selected.filter((v) => v !== itemValue)
|
|
62
|
+
: [...selected, itemValue]);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Radio semantics: re-choosing the current value is a no-op.
|
|
66
|
+
if (selected[0] !== itemValue)
|
|
67
|
+
commit([itemValue]);
|
|
68
|
+
};
|
|
69
|
+
const onItemKeyDown = (event) => {
|
|
70
|
+
const items = enabledItems();
|
|
71
|
+
const index = items.indexOf(event.currentTarget);
|
|
72
|
+
if (index === -1 || items.length === 0)
|
|
73
|
+
return;
|
|
74
|
+
let target;
|
|
75
|
+
if (NEXT_KEYS[orientation].includes(event.key))
|
|
76
|
+
target = items[(index + 1) % items.length];
|
|
77
|
+
else if (PREV_KEYS[orientation].includes(event.key))
|
|
78
|
+
target = items[(index - 1 + items.length) % items.length];
|
|
79
|
+
else if (event.key === 'Home')
|
|
80
|
+
target = items[0];
|
|
81
|
+
else if (event.key === 'End')
|
|
82
|
+
target = items[items.length - 1];
|
|
83
|
+
if (!target)
|
|
84
|
+
return;
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
target.focus();
|
|
87
|
+
const targetValue = target.dataset.value ?? '';
|
|
88
|
+
setFocused(targetValue);
|
|
89
|
+
if (type === 'single')
|
|
90
|
+
toggle(targetValue);
|
|
91
|
+
};
|
|
92
|
+
// `aria-orientation` is only defined for radiogroup, not for group.
|
|
93
|
+
const groupSemantics = type === 'single'
|
|
94
|
+
? {
|
|
95
|
+
role: 'radiogroup',
|
|
96
|
+
'aria-orientation': orientation,
|
|
97
|
+
'aria-disabled': disabled || undefined,
|
|
98
|
+
}
|
|
99
|
+
: { role: 'group', 'aria-disabled': disabled || undefined };
|
|
100
|
+
const context = {
|
|
101
|
+
type,
|
|
102
|
+
size,
|
|
103
|
+
orientation,
|
|
104
|
+
disabled,
|
|
105
|
+
selected,
|
|
106
|
+
tabbable,
|
|
107
|
+
toggle,
|
|
108
|
+
focusItem: setFocused,
|
|
109
|
+
onItemKeyDown,
|
|
110
|
+
};
|
|
111
|
+
return (_jsx(ToggleGroupContext.Provider, { value: context, children: _jsx("div", { ref: rootRef, ...groupSemantics, "data-slot": "toggle-group", "data-type": type, "data-orientation": orientation, className: cn('flex flex-wrap gap-2', orientation === 'vertical' && 'flex-col items-stretch', className), ...rest, children: children }) }));
|
|
112
|
+
}
|
|
113
|
+
function ToggleGroupItem({ value, disabled: itemDisabled, className, children, onClick, onKeyDown, onFocus, ...props }) {
|
|
114
|
+
const group = useToggleGroupContext();
|
|
115
|
+
const isOn = group.selected.includes(value);
|
|
116
|
+
const disabled = group.disabled || Boolean(itemDisabled);
|
|
117
|
+
// Before the group has measured (SSR / first paint) keep the selected item
|
|
118
|
+
// — or every item when nothing is selected — reachable by Tab.
|
|
119
|
+
const inTabOrder = group.tabbable === undefined ? group.selected.length === 0 || isOn : group.tabbable === value;
|
|
120
|
+
const semantics = group.type === 'single'
|
|
121
|
+
? { role: 'radio', 'aria-checked': isOn }
|
|
122
|
+
: { 'aria-pressed': isOn };
|
|
123
|
+
return (_jsx("button", { type: "button", "data-slot": "toggle-group-item", "data-value": value, "data-state": isOn ? 'on' : 'off', disabled: disabled, tabIndex: inTabOrder ? 0 : -1, ...semantics, className: cn('inline-flex shrink-0 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-full border font-medium transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0', isOn
|
|
124
|
+
? 'border-primary bg-primary text-primary-foreground'
|
|
125
|
+
: 'border-border bg-background text-foreground hover:bg-accent hover:text-accent-foreground', SIZE_CLASSES[group.size], className), onClick: (event) => {
|
|
126
|
+
onClick?.(event);
|
|
127
|
+
if (event.defaultPrevented)
|
|
128
|
+
return;
|
|
129
|
+
group.focusItem(value);
|
|
130
|
+
group.toggle(value);
|
|
131
|
+
}, onKeyDown: (event) => {
|
|
132
|
+
onKeyDown?.(event);
|
|
133
|
+
if (!event.defaultPrevented)
|
|
134
|
+
group.onItemKeyDown(event);
|
|
135
|
+
}, onFocus: (event) => {
|
|
136
|
+
onFocus?.(event);
|
|
137
|
+
group.focusItem(value);
|
|
138
|
+
}, ...props, children: children }));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Chip-style single- or multi-select. `type="single"` (default) is a
|
|
142
|
+
* `radiogroup`; `type="multiple"` is a `group` of `aria-pressed` toggles.
|
|
143
|
+
* Both use a roving tabindex (one Tab stop) with Arrow / Home / End keys.
|
|
144
|
+
* Give the group an accessible name via `aria-label` or `aria-labelledby`.
|
|
145
|
+
*/
|
|
146
|
+
export const ToggleGroup = Object.assign(ToggleGroupRoot, {
|
|
147
|
+
Item: ToggleGroupItem,
|
|
148
|
+
});
|
|
@@ -2,4 +2,4 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { AppShellAuthConfig } from './types.js';
|
|
3
3
|
export declare function AppShellAuth({ children, title, description, brandName, brandMark, eyebrow, preview, actions, }: AppShellAuthConfig & {
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
}): import("react
|
|
5
|
+
}): import("react").JSX.Element;
|
|
@@ -3,4 +3,4 @@ export interface AppShellChatProps {
|
|
|
3
3
|
globalActions?: ReactNode;
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
}
|
|
6
|
-
export declare function AppShellChat({ globalActions, children }: AppShellChatProps): import("react
|
|
6
|
+
export declare function AppShellChat({ globalActions, children }: AppShellChatProps): import("react").JSX.Element;
|
|
@@ -33,4 +33,4 @@ export interface AppShellWorkspaceProps {
|
|
|
33
33
|
mobileNav?: AppShellMobileNavConfig;
|
|
34
34
|
children: ReactNode;
|
|
35
35
|
}
|
|
36
|
-
export declare function AppShellWorkspace({ iconRail, contextRail, rightPanel, workspace, appTabs, globalActions, headerCenter, headerLeading, headerLayout, banners, mainLayout, mainClassName, builtInCommandPalette, mobileNav, children, }: AppShellWorkspaceProps): import("react
|
|
36
|
+
export declare function AppShellWorkspace({ iconRail, contextRail, rightPanel, workspace, appTabs, globalActions, headerCenter, headerLeading, headerLayout, banners, mainLayout, mainClassName, builtInCommandPalette, mobileNav, children, }: AppShellWorkspaceProps): import("react").JSX.Element;
|
|
@@ -77,9 +77,9 @@ export type AppShellProps = AppShellBaseProps & ({
|
|
|
77
77
|
variant: 'chat';
|
|
78
78
|
globalActions?: ReactNode;
|
|
79
79
|
});
|
|
80
|
-
export declare function AppShell(props: AppShellProps): import("react
|
|
80
|
+
export declare function AppShell(props: AppShellProps): import("react").JSX.Element;
|
|
81
81
|
export declare function AppShellBody({ children, className }: {
|
|
82
82
|
children: ReactNode;
|
|
83
83
|
className?: string;
|
|
84
|
-
}): import("react
|
|
84
|
+
}): import("react").JSX.Element;
|
|
85
85
|
export {};
|
|
@@ -17,7 +17,7 @@ export declare function matchesHotkey(e: KeyboardEvent, spec: string): boolean;
|
|
|
17
17
|
export interface CommandPaletteProps {
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
}
|
|
20
|
-
export declare function CommandPalette({ children }: CommandPaletteProps): import("react
|
|
20
|
+
export declare function CommandPalette({ children }: CommandPaletteProps): import("react").JSX.Element;
|
|
21
21
|
export declare function useCommands(commands: CommandDefinition[]): void;
|
|
22
22
|
export declare function useCommandGroup(group: CommandGroupDefinition): void;
|
|
23
23
|
export {};
|
|
@@ -16,4 +16,4 @@ export interface ContextRailProps {
|
|
|
16
16
|
scroll?: ContextRailScroll;
|
|
17
17
|
className?: string;
|
|
18
18
|
}
|
|
19
|
-
export declare function ContextRail({ appId, module, hidden, collapsible, activeItemId, renderLink, header, scroll, className, }: ContextRailProps): import("react
|
|
19
|
+
export declare function ContextRail({ appId, module, hidden, collapsible, activeItemId, renderLink, header, scroll, className, }: ContextRailProps): import("react").JSX.Element | null;
|
|
@@ -25,7 +25,7 @@ export interface DragModeBannerProps {
|
|
|
25
25
|
isActive?: (activeId: string | number) => boolean;
|
|
26
26
|
className?: string;
|
|
27
27
|
}
|
|
28
|
-
export declare function DragModeBanner({ message, cancelKey, isActive, className }: DragModeBannerProps): import("react
|
|
28
|
+
export declare function DragModeBanner({ message, cancelKey, isActive, className }: DragModeBannerProps): import("react").JSX.Element | null;
|
|
29
29
|
export declare namespace DragModeBanner {
|
|
30
30
|
var displayName: string;
|
|
31
31
|
}
|
|
@@ -6,4 +6,4 @@ export interface ShellScrollableContentProps {
|
|
|
6
6
|
layout: ShellContentLayout;
|
|
7
7
|
maxWidth?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare function ShellScrollableContent({ children, desktopDockOffset, layout, maxWidth, }: ShellScrollableContentProps): import("react
|
|
9
|
+
export declare function ShellScrollableContent({ children, desktopDockOffset, layout, maxWidth, }: ShellScrollableContentProps): import("react").JSX.Element;
|
|
@@ -14,5 +14,5 @@ export interface ShellTabBarProps {
|
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
renderLink?: (args: ShellTabBarRenderArgs) => ReactNode;
|
|
16
16
|
}
|
|
17
|
-
export declare function ShellTabBar({ tabs, activeTab, onTabChange, className, ariaLabel, renderLink, }: ShellTabBarProps): import("react
|
|
17
|
+
export declare function ShellTabBar({ tabs, activeTab, onTabChange, className, ariaLabel, renderLink, }: ShellTabBarProps): import("react").JSX.Element | null;
|
|
18
18
|
export {};
|
|
@@ -7,4 +7,4 @@ export interface WorkbenchLayoutProps {
|
|
|
7
7
|
toolbar?: ReactNode;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare function WorkbenchLayout({ viewportBand, main, aside, toolbar, className, }: WorkbenchLayoutProps): import("react
|
|
10
|
+
export declare function WorkbenchLayout({ viewportBand, main, aside, toolbar, className, }: WorkbenchLayoutProps): import("react").JSX.Element;
|
|
@@ -28,5 +28,5 @@ export interface RailDividerProps {
|
|
|
28
28
|
pinnedBottom: boolean;
|
|
29
29
|
onToggle: () => void;
|
|
30
30
|
}
|
|
31
|
-
export declare function RailDivider({ pinnedBottom, onToggle }: RailDividerProps): import("react
|
|
32
|
-
export declare function IconRail({ mainItems, utilityItems, footer, activeId, renderLink, labelVisibility, className, }: IconRailProps): import("react
|
|
31
|
+
export declare function RailDivider({ pinnedBottom, onToggle }: RailDividerProps): import("react").JSX.Element;
|
|
32
|
+
export declare function IconRail({ mainItems, utilityItems, footer, activeId, renderLink, labelVisibility, className, }: IconRailProps): import("react").JSX.Element | null;
|
|
@@ -20,4 +20,4 @@ export interface MobileBottomNavProps {
|
|
|
20
20
|
*
|
|
21
21
|
* Hidden on non-mobile viewports and when the right panel is in fullscreen mode.
|
|
22
22
|
*/
|
|
23
|
-
export declare function MobileBottomNav({ items, className }: MobileBottomNavProps): import("react
|
|
23
|
+
export declare function MobileBottomNav({ items, className }: MobileBottomNavProps): import("react").JSX.Element | null;
|
|
@@ -27,4 +27,4 @@ export interface MobileDockProps {
|
|
|
27
27
|
*
|
|
28
28
|
* Hidden on non-mobile viewports and when the right panel is fullscreen.
|
|
29
29
|
*/
|
|
30
|
-
export declare function MobileDock({ items, activeTo, activeId, renderLink, className, variant, }: MobileDockProps): import("react
|
|
30
|
+
export declare function MobileDock({ items, activeTo, activeId, renderLink, className, variant, }: MobileDockProps): import("react").JSX.Element | null;
|
|
@@ -54,7 +54,7 @@ export function MobileDock({ items, activeTo, activeId, renderLink, className, v
|
|
|
54
54
|
const label = typeof item.label === 'function' ? item.label() : item.label;
|
|
55
55
|
const isActive = isItemActive(item);
|
|
56
56
|
const isBrand = item.emphasis === 'brand';
|
|
57
|
-
const iconEl = isBrand ? (_jsx("span", { className: cn('flex size-8 items-center justify-center rounded-full bg-[
|
|
57
|
+
const iconEl = isBrand ? (_jsx("span", { className: cn('flex size-8 items-center justify-center rounded-full bg-[var(--color-brand-600)] text-white', isActive && 'ring-2 ring-primary ring-offset-2 ring-offset-card'), children: renderIcon(item.icon, 20) })) : (renderIcon(item.icon, 25));
|
|
58
58
|
// Active wins over brand: a slot carrying `aria-current="page"` must
|
|
59
59
|
// have a visible treatment too. The label goes primary; the glyph in the
|
|
60
60
|
// disc stays white because the disc sets its own colour.
|
|
@@ -128,5 +128,5 @@ export function MobileDock({ items, activeTo, activeId, renderLink, className, v
|
|
|
128
128
|
const actionActive = activeId != null && item.id === activeId;
|
|
129
129
|
return (_jsxs("button", { type: "button", onClick: () => runAction(item), "aria-label": label, className: cn('relative flex items-center justify-center rounded-full p-1 transition-colors', actionActive ? 'text-foreground' : 'text-muted-foreground hover:text-foreground'), children: [icon, badge] }));
|
|
130
130
|
};
|
|
131
|
-
return (_jsxs("div", { "data-testid": "mobile-dock", className: cn('pointer-events-none absolute inset-x-0 bottom-0 z-30 flex items-center justify-center gap-2.5 pb-[calc(env(safe-area-inset-bottom)+12px)] pt-2', className), children: [_jsx("nav", { "aria-label": "Dock", className: "pointer-events-auto flex items-center gap-[18px] rounded-full border border-border bg-card px-4 py-2.5 shadow-[0_6px_20px_rgba(20,18,60,0.14)]", children: pillItems.map((item) => (_jsx("span", { className: "flex", children: renderSlot(item, 22) }, item.id))) }), brandItems.map((item) => (_jsx("span", { className: cn('pointer-events-auto flex size-11 items-center justify-center rounded-full bg-[
|
|
131
|
+
return (_jsxs("div", { "data-testid": "mobile-dock", className: cn('pointer-events-none absolute inset-x-0 bottom-0 z-30 flex items-center justify-center gap-2.5 pb-[calc(env(safe-area-inset-bottom)+12px)] pt-2', className), children: [_jsx("nav", { "aria-label": "Dock", className: "pointer-events-auto flex items-center gap-[18px] rounded-full border border-border bg-card px-4 py-2.5 shadow-[0_6px_20px_rgba(20,18,60,0.14)]", children: pillItems.map((item) => (_jsx("span", { className: "flex", children: renderSlot(item, 22) }, item.id))) }), brandItems.map((item) => (_jsx("span", { className: cn('pointer-events-auto flex size-11 items-center justify-center rounded-full bg-[var(--color-brand-600)] text-white shadow-[0_6px_20px_rgba(91,45,140,0.35)]', isItemActive(item) && 'ring-2 ring-primary ring-offset-2 ring-offset-background'), children: renderSlot(item, 22) }, item.id)))] }));
|
|
132
132
|
}
|
|
@@ -47,4 +47,4 @@ export interface MobileDrawersProps {
|
|
|
47
47
|
* any custom-content drawers. Mount once near the AppShell root; drawers
|
|
48
48
|
* open/close via `ctx.mobileDrawer.open` provider state.
|
|
49
49
|
*/
|
|
50
|
-
export declare function MobileDrawers({ menuItems, menuActiveId, menuRenderLink, workspaceMenuItems, workspaceMenuFooter, module, moduleAppId, moduleActiveItemId, moduleRenderLink, moduleHeader, moduleScroll, sectionTabs, panelViews, defaultView, customContent, }: MobileDrawersProps): import("react
|
|
50
|
+
export declare function MobileDrawers({ menuItems, menuActiveId, menuRenderLink, workspaceMenuItems, workspaceMenuFooter, module, moduleAppId, moduleActiveItemId, moduleRenderLink, moduleHeader, moduleScroll, sectionTabs, panelViews, defaultView, customContent, }: MobileDrawersProps): import("react").JSX.Element;
|
|
@@ -22,4 +22,4 @@ export interface MobileHeaderProps {
|
|
|
22
22
|
*
|
|
23
23
|
* Renders nothing on non-mobile viewports.
|
|
24
24
|
*/
|
|
25
|
-
export declare function MobileHeader({ parentLabel, parentTo: _parentTo, title, onBack, globalActions, headerCenter, className, }: MobileHeaderProps): import("react
|
|
25
|
+
export declare function MobileHeader({ parentLabel, parentTo: _parentTo, title, onBack, globalActions, headerCenter, className, }: MobileHeaderProps): import("react").JSX.Element | null;
|
|
@@ -29,4 +29,4 @@ export interface MobileWorkspaceSheetProps {
|
|
|
29
29
|
* is expanded and scrolled into view on every open, and the user can still
|
|
30
30
|
* collapse it.
|
|
31
31
|
*/
|
|
32
|
-
export declare function MobileWorkspaceSheet({ tree, activeTo, activeId, currentFirst, renderLink, workspaceMenuItems, workspaceMenuFooter, }: MobileWorkspaceSheetProps): import("react
|
|
32
|
+
export declare function MobileWorkspaceSheet({ tree, activeTo, activeId, currentFirst, renderLink, workspaceMenuItems, workspaceMenuFooter, }: MobileWorkspaceSheetProps): import("react").JSX.Element;
|
|
@@ -12,4 +12,4 @@ export interface ResolvedPanelViews {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function mergePanelViews(staticViews: PanelView[] | undefined, registrations: PanelViewRegistration[], staticDefaultView?: string): ResolvedPanelViews;
|
|
14
14
|
export declare function useResolvedPanelViews(staticViews?: PanelView[], staticDefaultView?: string): ResolvedPanelViews;
|
|
15
|
-
export declare function PanelViewsProvider({ views, defaultView, children }: PanelViewsProviderProps): import("react
|
|
15
|
+
export declare function PanelViewsProvider({ views, defaultView, children }: PanelViewsProviderProps): import("react").JSX.Element;
|
|
@@ -35,7 +35,7 @@ export interface RailDropSlotProps {
|
|
|
35
35
|
ariaLabel?: string;
|
|
36
36
|
ref?: Ref<HTMLElement>;
|
|
37
37
|
}
|
|
38
|
-
export declare function RailDropSlot({ id, accepts, disabled, children, render, className, ariaLabel, ref, }: RailDropSlotProps): import("react
|
|
38
|
+
export declare function RailDropSlot({ id, accepts, disabled, children, render, className, ariaLabel, ref, }: RailDropSlotProps): import("react").JSX.Element;
|
|
39
39
|
export declare namespace RailDropSlot {
|
|
40
40
|
var displayName: string;
|
|
41
41
|
}
|
|
@@ -22,7 +22,7 @@ export interface RailDropZonesProps {
|
|
|
22
22
|
children: ReactNode;
|
|
23
23
|
className?: string;
|
|
24
24
|
}
|
|
25
|
-
export declare function RailDropZones({ title, subtitle, count, icon, forceActive, isActive, children, className, }: RailDropZonesProps): import("react
|
|
25
|
+
export declare function RailDropZones({ title, subtitle, count, icon, forceActive, isActive, children, className, }: RailDropZonesProps): import("react").JSX.Element;
|
|
26
26
|
export declare namespace RailDropZones {
|
|
27
27
|
var displayName: string;
|
|
28
28
|
}
|
|
@@ -20,7 +20,7 @@ export interface ResizableShellProps {
|
|
|
20
20
|
className?: string;
|
|
21
21
|
children: ReactNode;
|
|
22
22
|
}
|
|
23
|
-
export declare function ResizableShell({ orientation, className, children, }: ResizableShellProps): import("react
|
|
23
|
+
export declare function ResizableShell({ orientation, className, children, }: ResizableShellProps): import("react").JSX.Element;
|
|
24
24
|
export interface ResizableShellPanelProps {
|
|
25
25
|
/** Percent (0–100). */
|
|
26
26
|
defaultSize?: number;
|
|
@@ -36,10 +36,10 @@ export interface ResizableShellPanelProps {
|
|
|
36
36
|
className?: string;
|
|
37
37
|
children: ReactNode;
|
|
38
38
|
}
|
|
39
|
-
export declare function ResizableShellPanel({ className, children, onResize, ...props }: ResizableShellPanelProps): import("react
|
|
39
|
+
export declare function ResizableShellPanel({ className, children, onResize, ...props }: ResizableShellPanelProps): import("react").JSX.Element;
|
|
40
40
|
export interface ResizableHandleProps {
|
|
41
41
|
className?: string;
|
|
42
42
|
/** When true, renders a visible drag-indicator bar inside the handle. */
|
|
43
43
|
withHandle?: boolean;
|
|
44
44
|
}
|
|
45
|
-
export declare function ResizableHandle({ className, withHandle }: ResizableHandleProps): import("react
|
|
45
|
+
export declare function ResizableHandle({ className, withHandle }: ResizableHandleProps): import("react").JSX.Element;
|
|
@@ -23,4 +23,4 @@ export interface RightPanelTabRenderArgs {
|
|
|
23
23
|
export type RightPanelTabButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
24
24
|
'data-active'?: boolean;
|
|
25
25
|
};
|
|
26
|
-
export declare function RightPanel({ panelViews, defaultView, modes, renderTab, className, }: RightPanelProps): import("react
|
|
26
|
+
export declare function RightPanel({ panelViews, defaultView, modes, renderTab, className, }: RightPanelProps): import("react").JSX.Element | null;
|
|
@@ -40,15 +40,15 @@ export interface WorkspaceSwitcherProps {
|
|
|
40
40
|
*/
|
|
41
41
|
showLabel?: boolean;
|
|
42
42
|
}
|
|
43
|
-
export declare function WorkspaceSwitcher({ menuItems, menuFooter, workspaceMenuFooter, variant, showLabel, }?: WorkspaceSwitcherProps): import("react
|
|
43
|
+
export declare function WorkspaceSwitcher({ menuItems, menuFooter, workspaceMenuFooter, variant, showLabel, }?: WorkspaceSwitcherProps): import("react").JSX.Element;
|
|
44
44
|
export interface AppTabsProps extends AppShellAppTabsConfig {
|
|
45
45
|
}
|
|
46
|
-
export declare function AppTabs({ renderLink }?: AppTabsProps): import("react
|
|
46
|
+
export declare function AppTabs({ renderLink }?: AppTabsProps): import("react").JSX.Element;
|
|
47
47
|
export interface PanelToggleProps {
|
|
48
48
|
/** Panel views surfaced in the chevron dropdown. Empty → plain toggle. */
|
|
49
49
|
panelViews?: PanelView[];
|
|
50
50
|
}
|
|
51
|
-
export declare function PanelToggle({ panelViews }?: PanelToggleProps): import("react
|
|
51
|
+
export declare function PanelToggle({ panelViews }?: PanelToggleProps): import("react").JSX.Element;
|
|
52
52
|
export interface ShellHeaderProps {
|
|
53
53
|
globalActions?: ReactNode;
|
|
54
54
|
/**
|
|
@@ -88,4 +88,4 @@ export interface ShellHeaderProps {
|
|
|
88
88
|
*/
|
|
89
89
|
railLabelVisibility?: IconRailLabelVisibility;
|
|
90
90
|
}
|
|
91
|
-
export declare function ShellHeader({ globalActions, headerCenter, headerLeading, appTabsRenderLink, className, workspaceMenuItems, workspaceMenuFooter, showPanelToggle, panelViews, headerLayout, railLabelVisibility, }?: ShellHeaderProps): import("react
|
|
91
|
+
export declare function ShellHeader({ globalActions, headerCenter, headerLeading, appTabsRenderLink, className, workspaceMenuItems, workspaceMenuFooter, showPanelToggle, panelViews, headerLayout, railLabelVisibility, }?: ShellHeaderProps): import("react").JSX.Element | null;
|
|
@@ -5,4 +5,4 @@ export interface ShellMainProps {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare function ShellMain({ layout, className, children }: ShellMainProps): import("react
|
|
8
|
+
export declare function ShellMain({ layout, className, children }: ShellMainProps): import("react").JSX.Element;
|
|
@@ -74,5 +74,5 @@ export interface MedaShellProviderProps {
|
|
|
74
74
|
themeAdapter?: 'default' | 'next-themes' | ThemeAdapter;
|
|
75
75
|
children: ReactNode;
|
|
76
76
|
}
|
|
77
|
-
export declare function MedaShellProvider(props: MedaShellProviderProps): import("react
|
|
77
|
+
export declare function MedaShellProvider(props: MedaShellProviderProps): import("react").JSX.Element;
|
|
78
78
|
export {};
|
package/dist/shell/theme.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import type { ThemeAdapter } from './types.js';
|
|
|
4
4
|
export declare const ThemeCtx: import("react").Context<ThemeAdapter | null>;
|
|
5
5
|
export declare function DefaultThemeProvider({ children }: {
|
|
6
6
|
children: ReactNode;
|
|
7
|
-
}): import("react
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
8
|
export declare function useTheme(): ThemeAdapter;
|
|
9
|
-
export declare function ThemeToggle(): import("react
|
|
9
|
+
export declare function ThemeToggle(): import("react").JSX.Element;
|
|
@@ -34,7 +34,9 @@ function subscribeToViewport(onChange) {
|
|
|
34
34
|
const matchMedia = getMatchMedia();
|
|
35
35
|
if (!matchMedia) {
|
|
36
36
|
subscribedMqls = null;
|
|
37
|
-
return () => {
|
|
37
|
+
return () => {
|
|
38
|
+
// no matchMedia (SSR/test) - nothing to unsubscribe
|
|
39
|
+
};
|
|
38
40
|
}
|
|
39
41
|
const mqls = Object.entries(BREAKPOINTS).map(([band, query]) => [band, matchMedia(query)]);
|
|
40
42
|
subscribedMqls = mqls;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* @medalsocial/meda/styles/base.css
|
|
2
|
+
*
|
|
3
|
+
* Lean foundation for consumers that render only a few meda surfaces:
|
|
4
|
+
* canonical design tokens + the Tailwind theme bridge + the base layer.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately does NOT `@source` meda's component output and does NOT pull
|
|
7
|
+
* in `@xyflow/react`'s stylesheet. Pair it with the per-feature stylesheets
|
|
8
|
+
* for the surfaces you render, e.g.
|
|
9
|
+
*
|
|
10
|
+
* @import "tailwindcss";
|
|
11
|
+
* @import "@medalsocial/meda/styles/base.css";
|
|
12
|
+
* @import "@medalsocial/meda/primitives/styles.css";
|
|
13
|
+
* @import "@medalsocial/meda/calendar/styles.css";
|
|
14
|
+
*
|
|
15
|
+
* `@medalsocial/meda/styles.css` (theme.css) remains the batteries-included
|
|
16
|
+
* entry: base + every feature, including workflow-builder.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
@import "./tokens.css";
|
|
20
|
+
@import "./bridge.css";
|
|
21
|
+
|
|
22
|
+
@theme inline {
|
|
23
|
+
/* Font families — Geist + Geist Mono only (no Inter) */
|
|
24
|
+
--font-sans: var(--font-family-sans);
|
|
25
|
+
--font-mono: var(--font-family-mono);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@layer base {
|
|
29
|
+
:root {
|
|
30
|
+
color-scheme: light;
|
|
31
|
+
--auth-gradient-primary: var(--color-brand-500);
|
|
32
|
+
--auth-gradient-secondary: var(--color-brand-700);
|
|
33
|
+
--auth-gradient-base: var(--color-brand-800);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.dark,
|
|
37
|
+
[data-theme="dark"] {
|
|
38
|
+
color-scheme: dark;
|
|
39
|
+
}
|
|
40
|
+
}
|