@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,9 @@
|
|
|
1
|
+
export declare const alphaColor: (hex: string, opacity: number) => string;
|
|
2
|
+
export declare const blendHex: (hex: string, alpha: number, backdrop: string) => string;
|
|
3
|
+
/**
|
|
4
|
+
* The nearest tone of `hex` that reads as text on `surface`. Hue is held fixed
|
|
5
|
+
* because it carries the upstream's identity; value moves first because it costs
|
|
6
|
+
* the least recognition, and saturation gives way only where value alone cannot
|
|
7
|
+
* reach the floor.
|
|
8
|
+
*/
|
|
9
|
+
export declare const readableTone: (hex: string, surface: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const toLegacyCssColor: (source: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const prefersReducedMotion: () => boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AppShellLabels {
|
|
3
|
+
/** The skip link that jumps past the navigation. */
|
|
4
|
+
skipToContent: string;
|
|
5
|
+
/** The header button that opens the navigation drawer. */
|
|
6
|
+
openNavigation: string;
|
|
7
|
+
/** Accessible name of the navigation drawer. */
|
|
8
|
+
navigation: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AppShellProps {
|
|
11
|
+
/**
|
|
12
|
+
* Renders the navigation pane, usually a `NavigationPane`. It is rendered
|
|
13
|
+
* twice: docked, and in the narrow-layout drawer, where `onNavigate` is set so
|
|
14
|
+
* the pane can close the drawer and show its close button.
|
|
15
|
+
*/
|
|
16
|
+
navigation: (props: {
|
|
17
|
+
onNavigate?: () => void;
|
|
18
|
+
}) => ReactNode;
|
|
19
|
+
/** Content of the narrow-layout header bar after the menu button, e.g. the logo. */
|
|
20
|
+
narrowHeader?: ReactNode;
|
|
21
|
+
/** Trailing content of the narrow-layout header bar, e.g. a language picker. */
|
|
22
|
+
narrowHeaderActions?: ReactNode;
|
|
23
|
+
labels: AppShellLabels;
|
|
24
|
+
/** Names the current page. A change plays the page transition; keep it stable across query-string rewrites. */
|
|
25
|
+
pageKey: string;
|
|
26
|
+
/** A workspace page fills the viewport height instead of growing with its content. */
|
|
27
|
+
workspace?: boolean;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare function AppShell({ children, labels, narrowHeader, narrowHeaderActions, navigation, pageKey, workspace }: AppShellProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const gradientBackgroundCss = "\n .fwt-gradient-background {\n background-image:\n radial-gradient(circle at 50% 0%, #ffffff 0%, #f7fbff 36%, transparent 64%),\n linear-gradient(180deg, #f6f8fb 0%, #eef2f6 100%);\n height: 100dvh;\n overflow: hidden;\n }\n @media (prefers-color-scheme: dark) {\n .fwt-gradient-background {\n background-image:\n radial-gradient(circle at 50% 0%, #2d2d2d 0%, #242424 38%, transparent 68%),\n linear-gradient(180deg, #202020 0%, #1c1c1c 100%);\n }\n }\n";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { NavItemProps } from '@fluentui/react-components';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface NavigationPaneItem {
|
|
4
|
+
/** Identifies the item for selection. Usually the route it leads to. */
|
|
5
|
+
value: string;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
icon?: NavItemProps['icon'];
|
|
8
|
+
/**
|
|
9
|
+
* A route to link to. Followed through `WinuiRouterProvider` when one is
|
|
10
|
+
* mounted, otherwise by the browser. Omit it for an action such as signing
|
|
11
|
+
* out, and handle `onSelect` instead.
|
|
12
|
+
*/
|
|
13
|
+
href?: string;
|
|
14
|
+
onSelect?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface NavigationPaneGroup {
|
|
17
|
+
/** Section header. Omit for an unlabelled first group. */
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
items: NavigationPaneItem[];
|
|
20
|
+
}
|
|
21
|
+
export interface NavigationPaneProps {
|
|
22
|
+
/** Accessible name of the navigation landmark. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Leading header content, e.g. the product logo. */
|
|
25
|
+
header?: ReactNode;
|
|
26
|
+
/** Trailing header content shown when docked (not in the drawer), e.g. a language picker. */
|
|
27
|
+
headerActions?: ReactNode;
|
|
28
|
+
groups: NavigationPaneGroup[];
|
|
29
|
+
/** Items pinned to the bottom of the pane, e.g. the account and sign-out. */
|
|
30
|
+
footerItems?: NavigationPaneItem[];
|
|
31
|
+
selectedValue: string;
|
|
32
|
+
/** The item a navigation in flight is heading to. */
|
|
33
|
+
pendingValue?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Set when the pane sits in the narrow-layout drawer: called after an in-view
|
|
36
|
+
* navigation so the drawer can close, and it shows a close button.
|
|
37
|
+
*/
|
|
38
|
+
onNavigate?: () => void;
|
|
39
|
+
/** Accessible name of the drawer's close button. */
|
|
40
|
+
closeLabel?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function NavigationPane({ closeLabel, footerItems, groups, header, headerActions, label, onNavigate, pendingValue, selectedValue, }: NavigationPaneProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const navigationProgressCss: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AnimationEventHandler, ReactNode } from 'react';
|
|
2
|
+
export interface PageFrame {
|
|
3
|
+
/** Stable while the page stays, new on a page change. */
|
|
4
|
+
id: number;
|
|
5
|
+
node: ReactNode;
|
|
6
|
+
leaving: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Belongs on the element that carries the transition classes: the leaving
|
|
9
|
+
* frame is dropped when its own leave animation ends, so its lifetime is the
|
|
10
|
+
* animation's rather than a second statement of the animation's length.
|
|
11
|
+
*/
|
|
12
|
+
onAnimationEnd: AnimationEventHandler<HTMLElement>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The frames to draw: the current page, and the page it replaced for as long as
|
|
16
|
+
* that one takes to leave. Render each with `pageFrameClassName(frame)`.
|
|
17
|
+
*
|
|
18
|
+
* The leaving frame keeps the id it already had, so React matches it to the DOM
|
|
19
|
+
* already on screen; held under a new id it would mount afresh, snap back to its
|
|
20
|
+
* initial state and lose its scroll position before it fades.
|
|
21
|
+
*/
|
|
22
|
+
export declare const usePageFrames: (page: ReactNode, pageKey: string) => PageFrame[];
|
|
23
|
+
/** The transition class a frame carries: leaving, entering, or none for the first page. */
|
|
24
|
+
export declare const pageFrameClassName: (frame: PageFrame) => string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Theme } from '@fluentui/react-components';
|
|
2
|
+
export type ThemeMode = 'system' | 'light' | 'dark';
|
|
3
|
+
export type ResolvedThemeMode = 'light' | 'dark';
|
|
4
|
+
export declare const THEME_MODE_ATTRIBUTE = "data-fwt-theme";
|
|
5
|
+
/** The scheme the stylesheets resolve to for a mode, given the system preference. */
|
|
6
|
+
export declare const resolveThemeMode: (mode: ThemeMode, prefersDark: boolean) => ResolvedThemeMode;
|
|
7
|
+
/** Stamps `mode` on `root` so the stylesheets follow it; `system` removes the override. */
|
|
8
|
+
export declare const applyThemeMode: (mode: ThemeMode, root?: HTMLElement) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Applies `mode` to the document and returns the matching Fluent theme for
|
|
11
|
+
* `FluentProvider`. The token stylesheet and the Fluent theme must agree, so the
|
|
12
|
+
* provider's theme is derived from the same resolved scheme the CSS uses.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useWinuiTheme: (mode?: ThemeMode) => {
|
|
15
|
+
theme: Theme;
|
|
16
|
+
resolved: ResolvedThemeMode;
|
|
17
|
+
};
|