@pstrikez/fluent-winui-theme 0.0.0-stage → 0.1.1
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/LICENSE +22 -0
- package/NOTICE.md +46 -0
- package/README.md +140 -2
- package/dist/base.css +9 -0
- package/dist/components/nav-selection-indicator.d.ts +7 -0
- package/dist/components/ui/back-navigation-button.d.ts +10 -0
- package/dist/components/ui/badge-hue.d.ts +21 -0
- package/dist/components/ui/chip.d.ts +11 -0
- package/dist/components/ui/choice-group.d.ts +25 -0
- package/dist/components/ui/code-block.d.ts +13 -0
- package/dist/components/ui/confirm-dialog.d.ts +16 -0
- package/dist/components/ui/copy-to-clipboard.d.ts +1 -0
- package/dist/components/ui/danger.d.ts +4 -0
- package/dist/components/ui/dashboard-page-header.d.ts +7 -0
- package/dist/components/ui/dialog-shell.d.ts +24 -0
- package/dist/components/ui/empty-state.d.ts +17 -0
- package/dist/components/ui/error-shell.css.d.ts +1 -0
- package/dist/components/ui/error-shell.d.ts +11 -0
- package/dist/components/ui/fluent-form-controls.d.ts +27 -0
- package/dist/components/ui/http-badge.d.ts +8 -0
- package/dist/components/ui/info-label.d.ts +3 -0
- package/dist/components/ui/layout.d.ts +9 -0
- package/dist/components/ui/loading-screen.css.d.ts +1 -0
- package/dist/components/ui/loading-screen.d.ts +6 -0
- package/dist/components/ui/masked-icon.d.ts +5 -0
- package/dist/components/ui/multiselect-combobox.d.ts +21 -0
- package/dist/components/ui/open-link-label.d.ts +4 -0
- package/dist/components/ui/outcome-message-bar.d.ts +9 -0
- package/dist/components/ui/outcome-toast.d.ts +14 -0
- package/dist/components/ui/panel.d.ts +12 -0
- package/dist/components/ui/prism.d.ts +30 -0
- package/dist/components/ui/progress-ring.d.ts +8 -0
- package/dist/components/ui/reorder-list.d.ts +55 -0
- package/dist/components/ui/resource-list.d.ts +33 -0
- package/dist/components/ui/route-link.d.ts +19 -0
- package/dist/components/ui/row-title.d.ts +7 -0
- package/dist/components/ui/scroll-area.d.ts +44 -0
- package/dist/components/ui/secret-input.d.ts +7 -0
- package/dist/components/ui/section-header.d.ts +11 -0
- package/dist/components/ui/settings-card.d.ts +36 -0
- package/dist/components/ui/status-badge.d.ts +8 -0
- package/dist/components/ui/switch-setting.d.ts +7 -0
- package/dist/components/ui/table-actions.d.ts +13 -0
- package/dist/components/ui/table-columns.d.ts +3 -0
- package/dist/components/ui/tooltip-icon-button.d.ts +17 -0
- package/dist/components/ui/truncation-tooltip.d.ts +27 -0
- package/dist/components/ui/use-copy-to-clipboard.d.ts +13 -0
- package/dist/components/ui/use-dialog-invocation.d.ts +11 -0
- package/dist/components/ui/use-discard-guard.d.ts +19 -0
- package/dist/document.css.d.ts +1 -0
- package/dist/fluent.d.ts +2 -0
- package/dist/font-stacks.d.ts +2 -0
- package/dist/fonts/LICENSE-Meslo-LG.txt +201 -0
- package/dist/fonts/meslo-lg-s-400-italic.generated.woff2 +0 -0
- package/dist/fonts/meslo-lg-s-400-normal.generated.woff2 +0 -0
- package/dist/fonts/meslo-lg-s-700-italic.generated.woff2 +0 -0
- package/dist/fonts/meslo-lg-s-700-normal.generated.woff2 +0 -0
- package/dist/i18n/translation.d.ts +49 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +8945 -0
- package/dist/index.js.map +7 -0
- package/dist/lib/color.d.ts +9 -0
- package/dist/lib/legacy-css-color.d.ts +1 -0
- package/dist/lib/reduced-motion.d.ts +1 -0
- package/dist/lib/use-media-query.d.ts +2 -0
- package/dist/shell/app-shell.d.ts +30 -0
- package/dist/shell/gradient-background.css.d.ts +1 -0
- package/dist/shell/gradient-background.d.ts +2 -0
- package/dist/shell/navigation-pane.d.ts +42 -0
- package/dist/shell/navigation-progress.css.d.ts +1 -0
- package/dist/shell/navigation-progress.d.ts +3 -0
- package/dist/shell/page-frames.d.ts +24 -0
- package/dist/theme-mode.d.ts +17 -0
- package/dist/theme.d.ts +938 -0
- package/dist/winui/appearance.d.ts +11 -0
- package/dist/winui/controls/accordion.css.d.ts +1 -0
- package/dist/winui/controls/badge-tag.css.d.ts +1 -0
- package/dist/winui/controls/button.css.d.ts +1 -0
- package/dist/winui/controls/card.css.d.ts +1 -0
- package/dist/winui/controls/checkbox-surface.d.ts +25 -0
- package/dist/winui/controls/choice.css.d.ts +4 -0
- package/dist/winui/controls/color-picker.css.d.ts +1 -0
- package/dist/winui/controls/dialog.css.d.ts +1 -0
- package/dist/winui/controls/drawer.css.d.ts +1 -0
- package/dist/winui/controls/field.css.d.ts +3 -0
- package/dist/winui/controls/list.css.d.ts +1 -0
- package/dist/winui/controls/menu.css.d.ts +1 -0
- package/dist/winui/controls/message-bar.css.d.ts +1 -0
- package/dist/winui/controls/nav.css.d.ts +1 -0
- package/dist/winui/controls/popover.css.d.ts +1 -0
- package/dist/winui/controls/progress.css.d.ts +1 -0
- package/dist/winui/controls/reveal.d.ts +11 -0
- package/dist/winui/controls/scrollbar.css.d.ts +1 -0
- package/dist/winui/controls/select.css.d.ts +1 -0
- package/dist/winui/controls/selection-pill.d.ts +1 -0
- package/dist/winui/controls/selectors.d.ts +48 -0
- package/dist/winui/controls/severity.d.ts +24 -0
- package/dist/winui/controls/switch.css.d.ts +1 -0
- package/dist/winui/controls/table.css.d.ts +1 -0
- package/dist/winui/controls/tabs.css.d.ts +1 -0
- package/dist/winui/controls/text-input.css.d.ts +1 -0
- package/dist/winui/controls/text.css.d.ts +1 -0
- package/dist/winui/controls/toast.css.d.ts +1 -0
- package/dist/winui/controls/toolbar.css.d.ts +1 -0
- package/dist/winui/controls/tooltip.css.d.ts +1 -0
- package/dist/winui/focus-rect.css.d.ts +2 -0
- package/dist/winui/index.d.ts +1 -0
- package/dist/winui/motion.d.ts +29 -0
- package/dist/winui/page-transition.css.d.ts +2 -0
- package/dist/winui/presence.d.ts +3 -0
- package/dist/winui/progress-indeterminate.css.d.ts +1 -0
- package/dist/winui/reposition.d.ts +8 -0
- package/dist/winui/reset.css.d.ts +1 -0
- package/dist/winui/switch-drag.d.ts +2 -0
- package/dist/winui/theme.d.ts +3 -0
- package/dist/winui/toaster.d.ts +2 -0
- package/dist/winui/tokens.d.ts +1 -0
- package/dist/winui/wrap.d.ts +3 -0
- package/dist/winui.css +1 -0
- package/package.json +76 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CardProps } from '@fluentui/react-components';
|
|
2
|
+
export declare const PANEL_INSET_CLASS = "p-[var(--fwt-panel-inset)]";
|
|
3
|
+
export declare const PANEL_BAND_CLASS = "px-[var(--fwt-panel-inset)] py-[var(--spacingVerticalSNudge)]";
|
|
4
|
+
declare const PADDING_CLASS: {
|
|
5
|
+
readonly content: "!p-[var(--fwt-panel-inset)]";
|
|
6
|
+
readonly flush: "!p-0";
|
|
7
|
+
};
|
|
8
|
+
export type PanelProps = CardProps & {
|
|
9
|
+
padding?: keyof typeof PADDING_CLASS;
|
|
10
|
+
};
|
|
11
|
+
export declare function Panel({ className, padding, ...props }: PanelProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const highlight: (code: string, language: string) => string;
|
|
2
|
+
export declare const prismTokenStyles: {
|
|
3
|
+
readonly '& .token.comment, & .token.prolog, & .token.doctype, & .token.cdata': {
|
|
4
|
+
readonly color: string;
|
|
5
|
+
};
|
|
6
|
+
readonly '& .token.punctuation': {
|
|
7
|
+
readonly color: string;
|
|
8
|
+
};
|
|
9
|
+
readonly '& .token.property, & .token.tag, & .token.constant, & .token.symbol, & .token.deleted': {
|
|
10
|
+
readonly color: string;
|
|
11
|
+
};
|
|
12
|
+
readonly '& .token.boolean, & .token.number': {
|
|
13
|
+
readonly color: string;
|
|
14
|
+
};
|
|
15
|
+
readonly '& .token.selector, & .token.attr-name, & .token.string, & .token.char, & .token.builtin, & .token.inserted': {
|
|
16
|
+
readonly color: string;
|
|
17
|
+
};
|
|
18
|
+
readonly '& .token.operator, & .token.entity, & .token.url, & .language-css .token.string': {
|
|
19
|
+
readonly color: string;
|
|
20
|
+
};
|
|
21
|
+
readonly '& .token.atrule, & .token.attr-value, & .token.keyword': {
|
|
22
|
+
readonly color: string;
|
|
23
|
+
};
|
|
24
|
+
readonly '& .token.function, & .token.class-name': {
|
|
25
|
+
readonly color: string;
|
|
26
|
+
};
|
|
27
|
+
readonly '& .token.regex, & .token.important, & .token.variable': {
|
|
28
|
+
readonly color: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type ProgressRingTone = 'accent' | 'caution' | 'critical';
|
|
2
|
+
export declare function ProgressRing({ className, percent, size, tone }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
/** Clamped to the ring: past 100 the arc is closed, not wound a second time. */
|
|
5
|
+
percent: number;
|
|
6
|
+
size?: number;
|
|
7
|
+
tone: ProgressRingTone;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type CSSProperties, type KeyboardEvent as ReactKeyboardEvent, type PointerEvent as ReactPointerEvent } from 'react';
|
|
2
|
+
declare const HANDLE_ATTRIBUTE = "data-reorder-handle";
|
|
3
|
+
/** The move every caller commits and the preview reads, stated once. */
|
|
4
|
+
export declare const moveItem: <Item>(items: readonly Item[], from: number, to: number) => Item[];
|
|
5
|
+
export interface ReorderHandleProps {
|
|
6
|
+
[HANDLE_ATTRIBUTE]: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
disabledFocusable: boolean;
|
|
9
|
+
onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Drag-to-position reordering for a list the caller renders.
|
|
13
|
+
*
|
|
14
|
+
* The caller spreads `listProps` on the element that holds the items,
|
|
15
|
+
* `itemProps` on each item and `handleProps` on the grip, and keeps rendering
|
|
16
|
+
* in its own order throughout. A gesture moves the rows with transforms,
|
|
17
|
+
* starts `onDrop` at release when the caller has a write to perform, and keeps
|
|
18
|
+
* the preview in place until both that write and the settle animation finish.
|
|
19
|
+
* `onReorder` then commits the rendered order without another visible move.
|
|
20
|
+
* `position` gives an item's previewed rank, for a list that shows one.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useReorderList({ busy, disabled, length, onDrop, onDropError, onReorder }: {
|
|
23
|
+
/**
|
|
24
|
+
* The list's own write is in flight. The grip reads as unavailable but keeps
|
|
25
|
+
* focus, so a keyboard move does not throw the operator back to the document
|
|
26
|
+
* between steps -- the same line `TooltipIconButton` draws.
|
|
27
|
+
*/
|
|
28
|
+
busy?: boolean;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
length: number;
|
|
31
|
+
/** Starts an asynchronous write as soon as the pointer is released. */
|
|
32
|
+
onDrop?: (from: number, to: number) => Promise<void>;
|
|
33
|
+
/** Runs after the visual preview has rolled back from a rejected write. */
|
|
34
|
+
onDropError?: (error: unknown, from: number, to: number) => void | Promise<void>;
|
|
35
|
+
onReorder: (from: number, to: number) => void;
|
|
36
|
+
}): {
|
|
37
|
+
handleProps: (index: number) => ReorderHandleProps;
|
|
38
|
+
itemProps: (index: number, className?: string) => {
|
|
39
|
+
"data-reorder-item": string;
|
|
40
|
+
"data-reorder-edge": string | undefined;
|
|
41
|
+
className: string;
|
|
42
|
+
style: CSSProperties | undefined;
|
|
43
|
+
};
|
|
44
|
+
listProps: (className?: string) => {
|
|
45
|
+
"data-reorder-list": string;
|
|
46
|
+
className: string;
|
|
47
|
+
onKeyDown: (event: ReactKeyboardEvent<HTMLElement>) => void;
|
|
48
|
+
};
|
|
49
|
+
position: (index: number) => number;
|
|
50
|
+
};
|
|
51
|
+
export type ReorderList = ReturnType<typeof useReorderList>;
|
|
52
|
+
export declare function ReorderHandle({ label, ...gesture }: ReorderHandleProps & {
|
|
53
|
+
label: string;
|
|
54
|
+
}): import("react").JSX.Element;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { type PanelProps } from './panel';
|
|
3
|
+
export declare function ResourceListPanel({ className, rowHeight, style, ...props }: PanelProps & {
|
|
4
|
+
rowHeight?: string;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
type ResourceListActionsProps = {
|
|
7
|
+
appearance?: 'subtle';
|
|
8
|
+
createDisabled?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onRefresh: () => void;
|
|
11
|
+
refreshLabel: string;
|
|
12
|
+
refreshing?: boolean;
|
|
13
|
+
} & ({
|
|
14
|
+
createLabel: string;
|
|
15
|
+
createTrailingIcon?: never;
|
|
16
|
+
onCreate: () => void;
|
|
17
|
+
createTrigger?: never;
|
|
18
|
+
} | {
|
|
19
|
+
createLabel: string;
|
|
20
|
+
createTrailingIcon?: ReactNode;
|
|
21
|
+
createTrigger: (button: ReactElement) => ReactNode;
|
|
22
|
+
onCreate?: never;
|
|
23
|
+
} | {
|
|
24
|
+
createLabel?: never;
|
|
25
|
+
createTrailingIcon?: never;
|
|
26
|
+
onCreate?: never;
|
|
27
|
+
createTrigger?: never;
|
|
28
|
+
});
|
|
29
|
+
export declare function ResourceListActions(props: ResourceListActionsProps): import("react").JSX.Element;
|
|
30
|
+
export declare function ResourceListEmptyState({ children }: {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MouseEvent, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
export interface WinuiRouter {
|
|
3
|
+
/** Navigates within the application, e.g. react-router's `useNavigate()` result. */
|
|
4
|
+
navigate: (to: string) => void;
|
|
5
|
+
/** Maps a route to the href an anchor carries. Defaults to the route itself. */
|
|
6
|
+
href?: (to: string) => string;
|
|
7
|
+
}
|
|
8
|
+
export declare function WinuiRouterProvider({ router, children }: PropsWithChildren<{
|
|
9
|
+
router: WinuiRouter;
|
|
10
|
+
}>): import("react").JSX.Element;
|
|
11
|
+
export interface RouteAddress {
|
|
12
|
+
href: string;
|
|
13
|
+
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function useRouteAddress(to: string, onActivate?: () => void): RouteAddress;
|
|
16
|
+
export declare function RouteLink({ children, to }: {
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
to: string;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
type RowTitleTriggerProps = Omit<ComponentProps<'button'>, 'children' | 'className' | 'onClick' | 'type'>;
|
|
3
|
+
export declare function RowTitleButton({ children, onClick, ...trigger }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
} & RowTitleTriggerProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
export type ScrollAxes = 'both' | 'horizontal' | 'vertical';
|
|
3
|
+
interface ScrollAreaProps extends PropsWithChildren {
|
|
4
|
+
axes: ScrollAxes;
|
|
5
|
+
className?: string;
|
|
6
|
+
contentClassName?: string;
|
|
7
|
+
noTabIndex?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Styles the scrollport itself -- the box that clips. Padding on the host is
|
|
10
|
+
* outside the clip, so a shadow, focus ring or outline drawn inside the
|
|
11
|
+
* scroller is cut at the scrollport's edge; padding here keeps the overhang.
|
|
12
|
+
*/
|
|
13
|
+
viewportClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
interface ScrollAreaHost {
|
|
16
|
+
axes: ScrollAxes;
|
|
17
|
+
noTabIndex?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A host whose scrollport is built by something else -- a virtualised list
|
|
20
|
+
* owning its own element -- hands it over here instead of taking
|
|
21
|
+
* `viewportRef`, so the wiring waits for the element the same way.
|
|
22
|
+
*/
|
|
23
|
+
viewport?: HTMLElement | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The whole recipe a scroll area host needs: the two elements, the props that
|
|
27
|
+
* mark the host, the scrollport's own overflow, and the library binding
|
|
28
|
+
* between them. `ScrollArea` is this hook over a plain div; a host that has to
|
|
29
|
+
* be some other element calls the hook directly.
|
|
30
|
+
*/
|
|
31
|
+
export declare const useScrollAreaHost: ({ axes, noTabIndex, viewport }: ScrollAreaHost) => {
|
|
32
|
+
hostProps: {
|
|
33
|
+
ref: import("react").RefObject<HTMLDivElement | null>;
|
|
34
|
+
'data-overlayscrollbars-initialize'?: string | undefined;
|
|
35
|
+
className: string;
|
|
36
|
+
};
|
|
37
|
+
viewportRef: import("react").RefObject<HTMLDivElement | null>;
|
|
38
|
+
viewportStyle: {
|
|
39
|
+
overflowX: "hidden" | "auto" | "scroll";
|
|
40
|
+
overflowY: "hidden" | "auto" | "scroll";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export declare const ScrollArea: import("react").ForwardRefExoticComponent<ScrollAreaProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { Input } from './fluent-form-controls';
|
|
3
|
+
type InputProps = ComponentProps<typeof Input>;
|
|
4
|
+
export declare function SecretInput({ onChange, revealed, value, ...rest }: InputProps & {
|
|
5
|
+
revealed?: boolean;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InfoButtonProps } from '@fluentui/react-components';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export declare function SectionHeader({ actions, description, info, level, title, titleId, truncate }: {
|
|
4
|
+
actions?: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
info?: InfoButtonProps['info'];
|
|
7
|
+
level: 2 | 3 | 4;
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
titleId?: string;
|
|
10
|
+
truncate?: boolean;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function SettingsSwitch({ checked, disabled, label, onChange }: {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
onChange: (checked: boolean) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function SettingsCard({ action, description, header, icon }: {
|
|
9
|
+
action?: ReactNode;
|
|
10
|
+
description?: string;
|
|
11
|
+
header: ReactNode;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function SettingsExpander({ action, children, defaultOpen, description, disclosureDisabled, header, icon, revealOn, toggledOn }: {
|
|
15
|
+
action?: ReactNode;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
defaultOpen?: boolean;
|
|
18
|
+
description?: string;
|
|
19
|
+
/** Disable the disclosure while leaving a trailing action operable. */
|
|
20
|
+
disclosureDisabled?: boolean;
|
|
21
|
+
header: ReactNode;
|
|
22
|
+
icon?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the region currently holds something that has to be seen -- a
|
|
25
|
+
* validation message that refused a submit. Rising, it opens the row.
|
|
26
|
+
* Falling, it does nothing: closing the row mid-correction would take the
|
|
27
|
+
* editing surface off the screen.
|
|
28
|
+
*/
|
|
29
|
+
revealOn?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The state of the switch in `action`, when there is one. It moves the
|
|
32
|
+
* disclosure in both directions -- what the switch admits is what the region
|
|
33
|
+
* configures -- while the row stays independently openable by hand.
|
|
34
|
+
*/
|
|
35
|
+
toggledOn?: boolean;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type BadgeTone = 'accent' | 'danger' | 'neutral' | 'success' | 'warning';
|
|
3
|
+
/** Fluent's `medium` default has an empty size rule, leaving the 20px root reset box, so every dashboard badge is `large`. */
|
|
4
|
+
export declare function StatusBadge({ children, className, tone }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
tone: BadgeTone;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InfoButtonProps } from '@fluentui/react-components';
|
|
2
|
+
export declare function SwitchSetting({ checked, description, label, onChange }: {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
description: InfoButtonProps['info'];
|
|
5
|
+
label: string;
|
|
6
|
+
onChange: (checked: boolean) => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TableCellProps, TableHeaderCellProps } from '@fluentui/react-components';
|
|
2
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
3
|
+
export declare function TableTrailingHeader({ className, ...props }: TableHeaderCellProps): import("react").JSX.Element;
|
|
4
|
+
export declare function TableTrailingCell({ className, ...props }: TableCellProps): import("react").JSX.Element;
|
|
5
|
+
export declare function TableCentredHeader({ className, ...props }: TableHeaderCellProps): import("react").JSX.Element;
|
|
6
|
+
export declare function TableCentredCell({ className, ...props }: TableCellProps): import("react").JSX.Element;
|
|
7
|
+
export declare const stopRowSelection: {
|
|
8
|
+
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const TABLE_ACTIONS_WIDTH = "calc(3 * 24px + 2 * var(--spacingHorizontalXS) + var(--spacingHorizontalS) + var(--fwt-panel-inset))";
|
|
11
|
+
export declare function TableActions({ children }: {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MouseEvent, ReactElement } from 'react';
|
|
2
|
+
interface IconButtonProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
danger?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
disabledFocusable?: boolean;
|
|
7
|
+
icon: ReactElement;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function TooltipIconButton(props: IconButtonProps & ({
|
|
11
|
+
onClick: (event: MouseEvent<HTMLElement>) => void;
|
|
12
|
+
to?: never;
|
|
13
|
+
} | {
|
|
14
|
+
onClick?: never;
|
|
15
|
+
to: string;
|
|
16
|
+
})): import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactElement, type RefCallback } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A tooltip that restores text its trigger cannot show, and stays away when the
|
|
4
|
+
* trigger shows all of it — a tooltip repeating a string already in full view
|
|
5
|
+
* is noise.
|
|
6
|
+
*
|
|
7
|
+
* `measureRef` goes on the element that clips, which is not always the element
|
|
8
|
+
* the tooltip opens on: a `Chip` clips inside its text slot, a
|
|
9
|
+
* `TableCellLayout` inside its `main` slot. Measuring an ancestor that does not
|
|
10
|
+
* clip reports no overflow and the tooltip never appears.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useTruncation: (content: string, relationship: "description" | "label") => {
|
|
13
|
+
measureRef: RefCallback<HTMLElement>;
|
|
14
|
+
tooltipProps: {
|
|
15
|
+
content: string;
|
|
16
|
+
relationship: "label" | "description";
|
|
17
|
+
visible: boolean;
|
|
18
|
+
onVisibleChange: (_: unknown, data: {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
}) => void;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare function TruncationTooltip({ children, content, relationship }: {
|
|
24
|
+
children: (measureRef: RefCallback<HTMLElement>) => ReactElement;
|
|
25
|
+
content: string;
|
|
26
|
+
relationship: 'description' | 'label';
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
export type CopyOutcome = 'idle' | 'copied' | 'failed';
|
|
3
|
+
export declare const copyOutcomeIcon: (outcome: CopyOutcome) => ReactElement;
|
|
4
|
+
export declare const useCopyLabel: () => ((outcome: CopyOutcome, idle: string) => string);
|
|
5
|
+
export interface ClipboardCopy {
|
|
6
|
+
/**
|
|
7
|
+
* `tag` names which button is showing the outcome, so one hook can serve a
|
|
8
|
+
* whole table of them and a late expiry can only clear its own result.
|
|
9
|
+
*/
|
|
10
|
+
copy: (text: string, tag?: string) => void;
|
|
11
|
+
outcomeFor: (tag?: string) => CopyOutcome;
|
|
12
|
+
}
|
|
13
|
+
export declare const useCopyToClipboard: () => ClipboardCopy;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DialogInvocation<Value> {
|
|
2
|
+
key: number;
|
|
3
|
+
value: Value;
|
|
4
|
+
}
|
|
5
|
+
export interface DialogControl<Value> {
|
|
6
|
+
close: () => void;
|
|
7
|
+
invocation: DialogInvocation<Value> | null;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
open: (value: Value) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const useDialogInvocation: <Value>() => DialogControl<Value>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Answers every dismissal of a dialog that holds a draft. Esc, the scrim and
|
|
3
|
+
* Cancel all route through `requestClose`, so none of them can be a control
|
|
4
|
+
* that does nothing when pressed, and none of them can throw away an edit the
|
|
5
|
+
* operator has not been asked about.
|
|
6
|
+
*
|
|
7
|
+
* Dirtiness is the draft against the draft this dialog opened with, not
|
|
8
|
+
* react-hook-form's own `isDirty`: these forms write most of their fields
|
|
9
|
+
* through `setValue`, which leaves that flag saying whatever the last caller
|
|
10
|
+
* remembered to ask for. Each dialog is mounted per invocation, so the values
|
|
11
|
+
* of the first render are the ones it opened with.
|
|
12
|
+
*/
|
|
13
|
+
export declare const useDiscardGuard: <T>({ onClose, values }: {
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
values: T;
|
|
16
|
+
}) => {
|
|
17
|
+
discardConfirmation: import("react").JSX.Element | null;
|
|
18
|
+
requestClose: () => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const baseDocumentCss = "\nbody { margin: 0; }\n@media (prefers-color-scheme: dark) { html { color-scheme: dark; } }\n*, *::before, *::after { box-sizing: border-box; }\n:root { --fontFamilyBase: 'Segoe UI Variable Web', 'Segoe UI Variable Text', 'Segoe UI Variable Display', 'Segoe UI Variable Small', 'Segoe UI', system-ui, sans-serif; }\nbody { font-family: var(--fontFamilyBase); }\n";
|
package/dist/fluent.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const baseFontStack = "'Segoe UI Variable Web', 'Segoe UI Variable Text', 'Segoe UI Variable Display', 'Segoe UI Variable Small', 'Segoe UI', system-ui, sans-serif";
|
|
2
|
+
export declare const monospaceStack = "'Meslo LG S Web', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|