@imfusion/web-ui 0.10.1-dev.33.g8275f59f → 0.10.1-dev.37.g9147f90f

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/CHANGELOG.md CHANGED
@@ -55,6 +55,12 @@ never changes the character width, so columns stay aligned. CoFo Sans Mono still
55
55
 
56
56
  ### Added
57
57
 
58
+ - [`ColorSchemeToggle`](src/components/color-scheme-toggle/color-scheme-toggle.mdx) lets the user pick Light, System, or
59
+ Dark. It stores the choice through `useColorScheme` and needs no props; `label`, `lightLabel`, `systemLabel`, and
60
+ `darkLabel` replace the English text — Nikolaus Brunner <brunner@imfusion.com>
61
+ - [`ToggleGroup`](src/components/toggle-group/toggle-group.mdx) and `Toggle` take a `size` of `sm` or `md`. A small group
62
+ has no inset or gap, a 1px border, and 1.5rem toggles; a toggle takes its group's size unless it sets its own
63
+ — Nikolaus Brunner <brunner@imfusion.com>
58
64
  - `Skeleton.Suspense` takes a `fallback` of bones, a `label`, and the content. It is a Suspense boundary whose fallback is a
59
65
  busy `Skeleton.Root`; when the content mounts after the fallback showed, it fades in, and content that was
60
66
  ready at mount appears without a fade. Use it for data loaded through Suspense, and `Skeleton.Root` for data loaded with
@@ -80,6 +86,9 @@ never changes the character width, so columns stay aligned. CoFo Sans Mono still
80
86
  - `--imf-ui-appshell-heading-*`, `--imf-ui-appshell-navitem-dim`, `--imf-ui-appshell-navitem-underline-thickness`, and `--imf-ui-appshell-navitem-underline-offset` tune the logo row's strut and the NavItem underline. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
81
87
  - `AppShell.Aside` shows a close button in its drawer below `lg`, labelled by `closeLabel` (`Close panel` by default). [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
82
88
  - `AppShell.Burger` with no props opens and closes the navbar drawer, so the header needs no state wiring. [AppShell](src/components/app-shell/app-shell.mdx) — Nikolaus Brunner <brunner@imfusion.com>
89
+ - `Select.Root` takes a `width` of `auto`, `wide`, or `full`: `auto` keeps the 10rem trigger minimum, `wide` raises it to
90
+ 15rem, and `full` fills the parent. `--imf-ui-select-trigger-min-width` on `Select.Root` sets the minimum from CSS.
91
+ [Select](src/components/select/select.mdx) — Nikolaus Brunner <brunner@imfusion.com>
83
92
 
84
93
  ### Changed
85
94
 
@@ -106,9 +115,13 @@ never changes the character width, so columns stay aligned. CoFo Sans Mono still
106
115
  `git:config`.
107
116
  - `imf-web-ui-conventions` names the Skeleton part for each way data loads, and says a layout that reads suspending data
108
117
  needs its own boundary. `imf-web-ui-ux` points to that rule from its loading state.
118
+ - `imf-web-ui-conventions` lets a mutation name the sub-resource after its verb when a topic has more than one target,
119
+ as in `api.projects.removeMember(projectId)`; a name still never repeats its topic.
109
120
  - CI and verification — Nikolaus Brunner <brunner@imfusion.com>
110
121
  - The Git hooks live in `.vite-hooks/` and run through the Vite+ hook dispatcher, which `npm run git:config` installs.
111
122
  Existing clones and worktrees rerun `npm run git:config`; until then their hooks do not run.
123
+ - `engines.node` is `^22.22.1 || ^24.11 || >=26`, the range Vite+ supports. Node 24.0 to 24.10 and Node 25 fall
124
+ outside it.
112
125
  - The main column, header, and footer snap when the aside docks or undocks — Nikolaus Brunner <brunner@imfusion.com>
113
126
  - Components ([WEBSDK-247](https://imfusion.atlassian.net/browse/WEBSDK-247)) — Nikolaus Brunner <brunner@imfusion.com>
114
127
  - The AppShell navbar drawer, `Code`, and `ImageDisplayOptions` scroll in a `ScrollArea`, with its overlay thumb and edge
@@ -0,0 +1,3 @@
1
+ import { ColorSchemePreference } from '../../types/theme';
2
+ /** Narrows a `ToggleGroup` value entry to a scheme preference. */
3
+ export declare function isColorSchemePreference(value: unknown): value is ColorSchemePreference;
@@ -0,0 +1,17 @@
1
+ import { ToggleGroup } from '../toggle-group';
2
+ type Props = Omit<React.ComponentProps<typeof ToggleGroup>, "value" | "defaultValue" | "onValueChange" | "multiple" | "children"> & {
3
+ /** Accessible name of the group. */
4
+ label?: string;
5
+ /** Text of the segment that picks the light scheme. */
6
+ lightLabel?: string;
7
+ /** Text of the segment that follows the operating system. */
8
+ systemLabel?: string;
9
+ /** Text of the segment that picks the dark scheme. */
10
+ darkLabel?: string;
11
+ };
12
+ /**
13
+ * ColorSchemeToggle - lets the user pick Light, System, or Dark. It reads and stores the preference through
14
+ * `useColorScheme`, so placing it is enough. System stays pressed while the page follows the operating system.
15
+ */
16
+ export declare function ColorSchemeToggle({ label, lightLabel, systemLabel, darkLabel, ...props }: Props): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,2 @@
1
+ import { ComponentMeta } from '../../types/meta';
2
+ export declare const colorSchemeToggleMeta: ComponentMeta;
@@ -0,0 +1,2 @@
1
+ export { ColorSchemeToggle } from './color-scheme-toggle';
2
+ export { colorSchemeToggleMeta } from './color-scheme-toggle.meta';
@@ -1,6 +1,12 @@
1
1
  import { Select as SelectPrimitive } from '@base-ui/react/select';
2
+ import { VariantProps } from 'class-variance-authority';
2
3
  type UpstreamItem = React.ComponentProps<typeof SelectPrimitive.Item>;
4
+ declare const selectRoot: (props?: ({
5
+ width?: "auto" | "full" | "wide" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
3
7
  interface RootProps<Value = unknown, Multiple extends boolean | undefined = false> extends React.ComponentProps<typeof SelectPrimitive.Root<Value, Multiple>> {
8
+ /** Trigger width: `auto` keeps the compact minimum; `wide` raises it; `full` fills the parent. @default "auto" */
9
+ width?: VariantProps<typeof selectRoot>["width"];
4
10
  }
5
11
  /**
6
12
  * Select.Root — accessible select / listbox primitive.
@@ -12,7 +18,7 @@ interface RootProps<Value = unknown, Multiple extends boolean | undefined = fals
12
18
  * @doc https://base-ui.com/react/components/select
13
19
  * @llm https://base-ui.com/react/components/select.md
14
20
  */
15
- export declare function Root<Value = unknown, Multiple extends boolean | undefined = false>({ className, style, ...props }: RootProps<Value, Multiple> & {
21
+ export declare function Root<Value = unknown, Multiple extends boolean | undefined = false>({ width, className, style, ...props }: RootProps<Value, Multiple> & {
16
22
  className?: string;
17
23
  style?: React.CSSProperties;
18
24
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,17 @@
1
1
  import { Toggle as TogglePrimitive } from '@base-ui/react/toggle';
2
- interface Props extends React.ComponentProps<typeof TogglePrimitive> {
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const toggle: (props?: ({
4
+ size?: "sm" | "md" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ interface Props extends React.ComponentProps<typeof TogglePrimitive>, VariantProps<typeof toggle> {
3
7
  /**
4
8
  * Key hint shown in the top corner at the end of the line, such as `"P"` or `"Ctrl Z"`. It also sets
5
9
  * `aria-keyshortcuts` in its notation (`Control+Z`), which an explicit
6
10
  * `aria-keyshortcuts` prop overrides. Display only: bind the key in the app, for example with `useHotkey` from TanStack Hotkeys.
7
11
  */
8
12
  shortcut?: string;
13
+ /** Defaults to the enclosing `ToggleGroup`'s `size`, or `"md"` standalone. */
14
+ size?: VariantProps<typeof toggle>["size"];
9
15
  }
10
16
  /**
11
17
  * Toggle - a two-state button. Use standalone for a
@@ -15,5 +21,5 @@ interface Props extends React.ComponentProps<typeof TogglePrimitive> {
15
21
  * @doc https://base-ui.com/react/components/toggle
16
22
  * @llm https://base-ui.com/react/components/toggle.md
17
23
  */
18
- export declare function Toggle({ style, shortcut, children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
24
+ export declare function Toggle({ style, shortcut, size, children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
19
25
  export {};
@@ -0,0 +1,3 @@
1
+ export type ToggleGroupSize = "sm" | "md";
2
+ /** The size a `ToggleGroup` hands to its toggles; a standalone `Toggle` reads the default. */
3
+ export declare const ToggleGroupSizeContext: import('react').Context<ToggleGroupSize>;
@@ -1,13 +1,17 @@
1
1
  import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';
2
- interface Props extends React.ComponentProps<typeof ToggleGroupPrimitive> {
2
+ import { VariantProps } from 'class-variance-authority';
3
+ declare const toggleGroup: (props?: ({
4
+ size?: "sm" | "md" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ interface Props extends React.ComponentProps<typeof ToggleGroupPrimitive>, VariantProps<typeof toggleGroup> {
3
7
  }
4
8
  /**
5
9
  * ToggleGroup - a set of connected `Toggle`s sharing one value. Single-select by
6
10
  * default (a segmented control); set `multiple` for multi-select. Compose one
7
- * `Toggle` per segment, each with a `value`.
11
+ * `Toggle` per segment, each with a `value`. `size` applies to every toggle in the group.
8
12
  *
9
13
  * @doc https://base-ui.com/react/components/toggle-group
10
14
  * @llm https://base-ui.com/react/components/toggle-group.md
11
15
  */
12
- export declare function ToggleGroup(props: Props): import("react/jsx-runtime").JSX.Element;
16
+ export declare function ToggleGroup({ size, ...props }: Props): import("react/jsx-runtime").JSX.Element;
13
17
  export {};
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { CopyButton, copyButtonMeta } from './components/copy-button';
4
4
  export { IconButton, iconButtonMeta } from './components/icon-button';
5
5
  export { RichLink, richLinkMeta } from './components/rich-link';
6
6
  export { Checkbox, checkboxMeta } from './components/checkbox';
7
+ export { ColorSchemeToggle, colorSchemeToggleMeta } from './components/color-scheme-toggle';
7
8
  export { Field, fieldMeta } from './components/field';
8
9
  export { Fieldset, fieldsetMeta } from './components/fieldset';
9
10
  export { Input, inputMeta } from './components/input';