@moldable-ai/ui 0.2.29 → 0.2.32
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/dist/catalog/component-catalog.d.ts +9 -2
- package/dist/catalog/component-catalog.d.ts.map +1 -1
- package/dist/catalog/component-catalog.js +11 -7
- package/dist/catalog/core-control-stories.d.ts.map +1 -1
- package/dist/catalog/core-control-stories.js +1 -1
- package/dist/catalog/core-foundation-stories.d.ts.map +1 -1
- package/dist/catalog/core-foundation-stories.js +5 -5
- package/dist/components/app-error-boundary.d.ts +1 -1
- package/dist/components/chat/chat-image-lightbox.d.ts +8 -0
- package/dist/components/chat/chat-image-lightbox.d.ts.map +1 -1
- package/dist/components/chat/chat-image-lightbox.js +24 -2
- package/dist/components/chat/chat-input.d.ts +3 -2
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-input.js +3 -3
- package/dist/components/chat/chat-message.d.ts.map +1 -1
- package/dist/components/chat/chat-message.js +3 -1
- package/dist/components/chat/chat-panel.d.ts +3 -1
- package/dist/components/chat/chat-panel.d.ts.map +1 -1
- package/dist/components/chat/chat-panel.js +53 -39
- package/dist/components/chat/conversation-history.d.ts +4 -2
- package/dist/components/chat/conversation-history.d.ts.map +1 -1
- package/dist/components/chat/conversation-history.js +20 -15
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/app-frame.d.ts +20 -1
- package/dist/components/ui/app-frame.d.ts.map +1 -1
- package/dist/components/ui/app-frame.js +37 -7
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/button.d.ts +5 -3
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +39 -11
- package/dist/components/ui/card.d.ts +12 -2
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +3 -2
- package/dist/components/ui/checkbox.d.ts +4 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox.js +4 -4
- package/dist/components/ui/context-menu.d.ts.map +1 -1
- package/dist/components/ui/context-menu.js +7 -6
- package/dist/components/ui/date-field.d.ts +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +1 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +9 -8
- package/dist/components/ui/icon-button.d.ts +1 -1
- package/dist/components/ui/icon-button.d.ts.map +1 -1
- package/dist/components/ui/icon-button.js +1 -0
- package/dist/components/ui/input.d.ts +6 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +2 -2
- package/dist/components/ui/material.d.ts +8 -3
- package/dist/components/ui/material.d.ts.map +1 -1
- package/dist/components/ui/material.js +2 -2
- package/dist/components/ui/menu-items.d.ts +2 -1
- package/dist/components/ui/menu-items.d.ts.map +1 -1
- package/dist/components/ui/menu-items.js +3 -2
- package/dist/components/ui/message-scroller-controller.d.ts +15 -17
- package/dist/components/ui/message-scroller-controller.d.ts.map +1 -1
- package/dist/components/ui/message-scroller-controller.js +106 -91
- package/dist/components/ui/message-scroller-primitive.d.ts +2 -0
- package/dist/components/ui/message-scroller-primitive.d.ts.map +1 -1
- package/dist/components/ui/message-scroller-primitive.js +2 -0
- package/dist/components/ui/message-scroller.d.ts.map +1 -1
- package/dist/components/ui/message-scroller.js +2 -2
- package/dist/components/ui/number-input.d.ts +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/search-field.d.ts +4 -2
- package/dist/components/ui/search-field.d.ts.map +1 -1
- package/dist/components/ui/search-field.js +16 -6
- package/dist/components/ui/segmented-control.d.ts +3 -1
- package/dist/components/ui/segmented-control.d.ts.map +1 -1
- package/dist/components/ui/segmented-control.js +23 -17
- package/dist/components/ui/select.js +2 -2
- package/dist/components/ui/sidebar.d.ts +10 -4
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/sidebar.js +74 -17
- package/dist/components/ui/status.d.ts +1 -1
- package/dist/components/ui/status.js +1 -1
- package/dist/components/ui/switch.d.ts +3 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +3 -2
- package/dist/components/ui/toolbar-controls.d.ts +13 -3
- package/dist/components/ui/toolbar-controls.d.ts.map +1 -1
- package/dist/components/ui/toolbar-controls.js +35 -10
- package/dist/components/ui/toolbar.d.ts +5 -4
- package/dist/components/ui/toolbar.d.ts.map +1 -1
- package/dist/components/ui/toolbar.js +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/frame-lifecycle.d.ts +1 -0
- package/dist/lib/frame-lifecycle.d.ts.map +1 -1
- package/dist/lib/frame-lifecycle.js +7 -0
- package/dist/lib/theme.d.ts +39 -5
- package/dist/lib/theme.d.ts.map +1 -1
- package/dist/lib/theme.js +105 -17
- package/dist/tokens/contracts.d.ts +79 -0
- package/dist/tokens/contracts.d.ts.map +1 -0
- package/dist/tokens/contracts.js +57 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +1 -0
- package/docs/README.md +2 -0
- package/docs/adaptive-materials.md +14 -9
- package/docs/design-tokens.md +10 -6
- package/docs/foundations.md +3 -3
- package/docs/macos-design-audit.md +144 -0
- package/docs/native-integration.md +4 -4
- package/docs/platform-architecture.md +189 -0
- package/docs/standalone-app-windows.md +37 -0
- package/docs/visual-regression.md +6 -8
- package/package.json +13 -1
- package/src/components/ui/accordion.md +46 -0
- package/src/components/ui/alert.md +12 -4
- package/src/components/ui/app-frame.md +8 -5
- package/src/components/ui/aspect-ratio.md +37 -0
- package/src/components/ui/avatar.md +48 -0
- package/src/components/ui/breadcrumb.md +52 -0
- package/src/components/ui/button-group.md +43 -0
- package/src/components/ui/button.md +21 -4
- package/src/components/ui/calendar.md +42 -0
- package/src/components/ui/card.md +43 -0
- package/src/components/ui/carousel.md +47 -0
- package/src/components/ui/chart.md +52 -0
- package/src/components/ui/checkbox.md +36 -0
- package/src/components/ui/collapsible.md +2 -3
- package/src/components/ui/color-well.md +14 -4
- package/src/components/ui/combobox.md +3 -3
- package/src/components/ui/confirm-dialog.md +5 -4
- package/src/components/ui/context-menu.md +3 -2
- package/src/components/ui/date-field.md +6 -1
- package/src/components/ui/date-picker.md +6 -3
- package/src/components/ui/dialog.md +14 -12
- package/src/components/ui/drawer.md +58 -0
- package/src/components/ui/dropdown-menu.md +16 -14
- package/src/components/ui/error-boundary-view.md +1 -1
- package/src/components/ui/field.md +2 -1
- package/src/components/ui/form.md +71 -0
- package/src/components/ui/grid.md +4 -3
- package/src/components/ui/icon-button.md +4 -1
- package/src/components/ui/input-group.md +49 -0
- package/src/components/ui/input-otp.md +56 -0
- package/src/components/ui/input.md +40 -0
- package/src/components/ui/inspector.md +47 -7
- package/src/components/ui/item.md +5 -3
- package/src/components/ui/kbd.md +30 -0
- package/src/components/ui/label.md +29 -0
- package/src/components/ui/list.md +2 -2
- package/src/components/ui/material.md +25 -12
- package/src/components/ui/menu-items.md +62 -0
- package/src/components/ui/menubar.md +58 -0
- package/src/components/ui/message-scroller-primitive.md +70 -0
- package/src/components/ui/message-scroller.md +89 -0
- package/src/components/ui/navigation-button-group.md +4 -3
- package/src/components/ui/navigation-menu.md +52 -0
- package/src/components/ui/number-input.md +8 -0
- package/src/components/ui/pagination.md +51 -0
- package/src/components/ui/panel.md +6 -0
- package/src/components/ui/popover.md +10 -7
- package/src/components/ui/progress.md +31 -0
- package/src/components/ui/radio-group.md +36 -0
- package/src/components/ui/resizable.md +2 -1
- package/src/components/ui/scroll-area.md +3 -1
- package/src/components/ui/search-field.md +6 -1
- package/src/components/ui/segmented-control.md +6 -1
- package/src/components/ui/separator.md +35 -0
- package/src/components/ui/sidebar.md +29 -6
- package/src/components/ui/skeleton.md +36 -0
- package/src/components/ui/slider.md +58 -0
- package/src/components/ui/spinner.md +41 -0
- package/src/components/ui/split-view.md +8 -4
- package/src/components/ui/switch.md +44 -0
- package/src/components/ui/table.md +7 -7
- package/src/components/ui/tabs.md +3 -1
- package/src/components/ui/textarea.md +41 -0
- package/src/components/ui/toggle-group.md +2 -2
- package/src/components/ui/toggle.md +9 -9
- package/src/components/ui/toolbar-controls.md +24 -12
- package/src/components/ui/toolbar.md +6 -6
- package/src/styles/index.css +298 -117
- package/src/tokens/contracts.ts +131 -0
- package/src/tokens/index.css +6 -0
- package/src/tokens/index.ts +23 -0
- package/src/tokens/macos-26/README.md +37 -0
- package/src/tokens/macos-26/aliases.css +53 -0
- package/src/tokens/macos-26/compatibility.css +7 -0
- package/src/tokens/macos-26/index.css +3 -0
- package/src/tokens/macos-26/source/provenance.generated.json +28 -0
- package/src/tokens/macos-26/source/sidebar.generated.css +29 -0
- package/src/tokens/macos-26/source.css +7 -0
- package/src/tokens/macos-26/web-adaptations.json +25 -0
- package/src/tokens/macos-26/web-adaptations.md +15 -0
- package/src/tokens/macos-27/accessibility.css +11 -0
- package/src/tokens/macos-27/aliases.css +304 -0
- package/src/tokens/macos-27/compatibility.css +212 -0
- package/src/tokens/macos-27/index.css +15 -0
- package/src/tokens/macos-27/recipes.css +23 -0
- package/src/tokens/macos-27/source/chrome.generated.css +338 -0
- package/src/tokens/macos-27/source/colors.generated.css +140 -0
- package/src/tokens/macos-27/source/context.generated.css +18 -0
- package/src/tokens/macos-27/source/controls.generated.css +764 -0
- package/src/tokens/macos-27/source/effects.generated.css +68 -0
- package/src/tokens/macos-27/source/kit.generated.css +50 -0
- package/src/tokens/macos-27/source/overlays-status.generated.css +931 -0
- package/src/tokens/macos-27/source/paint-styles.generated.css +81 -0
- package/src/tokens/macos-27/source/provenance.generated.json +62 -0
- package/src/tokens/macos-27/source/sizes.generated.css +385 -0
- package/src/tokens/macos-27/source/source.generated.json +554 -0
- package/src/tokens/macos-27/source/text-styles.generated.css +116 -0
- package/src/tokens/macos-27/source.css +17 -0
- package/src/tokens/macos-27/web-adaptations.css +98 -0
- package/src/tokens/macos-27/web-adaptations.json +163 -0
- package/src/tokens/macos-27/web-adaptations.md +117 -0
- package/src/tokens/moldable/brand.css +165 -0
- package/src/tokens/moldable/index.css +1 -0
- package/src/tokens/platform-contract.test.ts +294 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`Switch` changes a boolean setting that takes effect as soon as it is toggled.
|
|
6
|
+
Use it for preferences such as notifications, syncing, or visibility.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Label, Switch } from '@moldable-ai/ui'
|
|
12
|
+
|
|
13
|
+
;<div className="flex items-center justify-between gap-3">
|
|
14
|
+
<Label htmlFor="sync-changes">Sync changes</Label>
|
|
15
|
+
<Switch
|
|
16
|
+
id="sync-changes"
|
|
17
|
+
checked={syncChanges}
|
|
18
|
+
onCheckedChange={setSyncChanges}
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## API
|
|
24
|
+
|
|
25
|
+
- Accepts Radix Switch root props, including `checked`, `defaultChecked`,
|
|
26
|
+
`onCheckedChange`, `disabled`, `required`, `name`, and `value`.
|
|
27
|
+
- `size` is `default` or `sm` and defaults to `default`.
|
|
28
|
+
- `controlSize` accepts the shared `ControlSize` values (`mini`, `small`,
|
|
29
|
+
`medium`, `large`, or `xl`) and overrides the size-derived token setting.
|
|
30
|
+
- Without `controlSize`, `size="sm"` resolves to `small`; the default resolves
|
|
31
|
+
to `medium`.
|
|
32
|
+
- Supports checked, unchecked, active, focus-visible, and disabled states.
|
|
33
|
+
- Exports `Switch`.
|
|
34
|
+
|
|
35
|
+
## Guidance
|
|
36
|
+
|
|
37
|
+
- Pair the switch with a visible `Label` using `htmlFor` and `id`, or provide an
|
|
38
|
+
`aria-label` when no visible label is possible.
|
|
39
|
+
- Use controlled state when the value is persisted or shared with another
|
|
40
|
+
surface.
|
|
41
|
+
- Write labels for the setting itself, such as “Sync changes,” rather than
|
|
42
|
+
“Enable” or “On.”
|
|
43
|
+
- Use a checkbox for selections submitted as a group and a button for one-shot
|
|
44
|
+
actions.
|
|
@@ -28,10 +28,10 @@ Structured, comparable data with shared density and row-selection behavior.
|
|
|
28
28
|
Use `compact` for inspector-like datasets, `default` for general work, and
|
|
29
29
|
`comfortable` where scanning matters more than density.
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
a row event handler only when an app
|
|
36
|
-
For rich grid navigation, column
|
|
37
|
-
|
|
31
|
+
Pass `selected` and `onSelectionChange` together for a selectable row; either
|
|
32
|
+
prop alone marks the row as selectable. Selection is controlled by the caller
|
|
33
|
+
and toggles with pointer, Enter, or Space. Independent buttons, links, form
|
|
34
|
+
controls, and editable descendants keep their own behavior without toggling
|
|
35
|
+
the row. Call `event.preventDefault()` in a row event handler only when an app
|
|
36
|
+
needs to cancel the built-in response. For rich grid navigation, column
|
|
37
|
+
sorting, or cell editing, use a dedicated data grid.
|
|
@@ -36,7 +36,9 @@ Use the `line` variant in dense app chrome where a filled segmented control woul
|
|
|
36
36
|
|
|
37
37
|
## API summary
|
|
38
38
|
|
|
39
|
-
- `Tabs`: Radix Tabs root; supports controlled `value`/`onValueChange`,
|
|
39
|
+
- `Tabs`: Radix Tabs root; supports controlled `value`/`onValueChange`,
|
|
40
|
+
`defaultValue`, `orientation`, text direction, activation mode, and other root
|
|
41
|
+
props. Orientation defaults to `horizontal`.
|
|
40
42
|
- `TabsList`: `variant="default"` or `"line"`. Defaults to `default`.
|
|
41
43
|
- `TabsTrigger`: requires a `value` matching a content panel; supports `disabled`.
|
|
42
44
|
- `TabsContent`: requires a matching `value`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
`Textarea` is a native multiline text field for notes, descriptions, comments,
|
|
6
|
+
and other freeform input.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Label, Textarea } from '@moldable-ai/ui'
|
|
12
|
+
|
|
13
|
+
;<div className="grid gap-2">
|
|
14
|
+
<Label htmlFor="description">Description</Label>
|
|
15
|
+
<Textarea
|
|
16
|
+
id="description"
|
|
17
|
+
name="description"
|
|
18
|
+
placeholder="Describe this project"
|
|
19
|
+
maxLength={500}
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## API
|
|
25
|
+
|
|
26
|
+
- Accepts native `textarea` props, event handlers, and `className`.
|
|
27
|
+
- Supports controlled `value`/`onChange` and uncontrolled `defaultValue`.
|
|
28
|
+
- Uses content-based field sizing with a minimum height of `4rem`.
|
|
29
|
+
- Includes placeholder, focus-visible, disabled, and `aria-invalid` styling.
|
|
30
|
+
- Exports `Textarea`.
|
|
31
|
+
|
|
32
|
+
## Guidance
|
|
33
|
+
|
|
34
|
+
- Always provide a visible label; use `aria-describedby` for help or validation
|
|
35
|
+
text.
|
|
36
|
+
- Set `aria-invalid="true"` only when an error is present, and associate the
|
|
37
|
+
error message with the field.
|
|
38
|
+
- Add `maxLength` and a visible character count when input length is constrained.
|
|
39
|
+
- Preserve the native keyboard, selection, form, and resize behavior.
|
|
40
|
+
- Use `Input` for a single line and a rich-text editor only when formatting is
|
|
41
|
+
genuinely required.
|
|
@@ -51,8 +51,8 @@ Multiple selection:
|
|
|
51
51
|
|
|
52
52
|
- `ToggleGroup`: Radix Toggle Group root. `type="single"` uses a string value; `type="multiple"` uses a string array.
|
|
53
53
|
- Supports controlled `value`/`onValueChange` and uncontrolled `defaultValue`.
|
|
54
|
-
- `variant`: `default` or `
|
|
55
|
-
- `size`: `
|
|
54
|
+
- `variant`: `default`, `outline`, or `filled`, shared with each item.
|
|
55
|
+
- `size`: `xs`, `sm`, `default`, or `lg`, shared with each item.
|
|
56
56
|
- `spacing`: numeric Tailwind spacing multiplier; defaults to `0`. At zero, items join into one segmented shape.
|
|
57
57
|
- `ToggleGroupItem`: requires `value`; may override `variant` or `size` when the group does not supply them.
|
|
58
58
|
- Both parts accept corresponding Radix primitive props and `className`.
|
|
@@ -9,8 +9,8 @@ Use `Button` for a one-shot command and `Switch` for a settings-style boolean th
|
|
|
9
9
|
## Usage patterns
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
|
-
import { WrapText } from 'lucide-react'
|
|
13
|
-
import { Toggle } from '@moldable-ai/ui'
|
|
12
|
+
import { Pin, WrapText } from 'lucide-react'
|
|
13
|
+
import { Toggle, ToggleButton } from '@moldable-ai/ui'
|
|
14
14
|
|
|
15
15
|
;<Toggle
|
|
16
16
|
pressed={wrap}
|
|
@@ -24,18 +24,18 @@ import { Toggle } from '@moldable-ai/ui'
|
|
|
24
24
|
</Toggle>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
For an icon-only toolbar control:
|
|
27
|
+
For an icon-only toolbar control, use the typed `ToggleButton` facade:
|
|
28
28
|
|
|
29
29
|
```tsx
|
|
30
|
-
<
|
|
30
|
+
<ToggleButton
|
|
31
|
+
iconOnly
|
|
31
32
|
defaultPressed
|
|
32
33
|
variant="outline"
|
|
33
34
|
size="sm"
|
|
34
|
-
className="cursor-pointer px-0"
|
|
35
35
|
aria-label="Pin inspector"
|
|
36
36
|
>
|
|
37
37
|
<Pin />
|
|
38
|
-
</
|
|
38
|
+
</ToggleButton>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Pair icon-only use with a tooltip.
|
|
@@ -45,8 +45,8 @@ Pair icon-only use with a tooltip.
|
|
|
45
45
|
- Built on Radix Toggle and accepts its root props.
|
|
46
46
|
- `pressed` and `onPressedChange`: controlled state.
|
|
47
47
|
- `defaultPressed`: uncontrolled initial state.
|
|
48
|
-
- `variant`: `default` or `
|
|
49
|
-
- `size`: `
|
|
48
|
+
- `variant`: `default`, `outline`, or `filled`.
|
|
49
|
+
- `size`: `xs`, `sm`, `default`, or `lg`.
|
|
50
50
|
- Supports native button accessibility props such as `aria-label` and `disabled`.
|
|
51
51
|
- `toggleVariants` is exported and shared by `ToggleGroup`.
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ Pair icon-only use with a tooltip.
|
|
|
54
54
|
|
|
55
55
|
- Use controlled state when the preference affects another pane or persisted setting.
|
|
56
56
|
- Make the pressed state legible through shape or icon treatment as well as color.
|
|
57
|
-
-
|
|
57
|
+
- Give icon-only toggles an accessible name and a tooltip.
|
|
58
58
|
- Keep toolbar toggles compact and aligned with adjacent controls.
|
|
59
59
|
- Use a specific icon tied to the state.
|
|
60
60
|
|
|
@@ -6,11 +6,14 @@ keeping app toolbars visually consistent.
|
|
|
6
6
|
|
|
7
7
|
```tsx
|
|
8
8
|
<Toolbar position="top">
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
<ToolbarControlGroup aria-label="Navigation">
|
|
10
|
+
<ToolbarSidebarToggle
|
|
11
|
+
expanded={sidebarOpen}
|
|
12
|
+
onExpandedChange={setSidebarOpen}
|
|
13
|
+
/>
|
|
14
|
+
<ToolbarControlSeparator />
|
|
15
|
+
<ToolbarBackButton onClick={goBack} />
|
|
16
|
+
</ToolbarControlGroup>
|
|
14
17
|
<ToolbarTitleField value={title} onChange={rename} />
|
|
15
18
|
<ToolbarActions>
|
|
16
19
|
<ToolbarControlGroup aria-label="History">
|
|
@@ -29,30 +32,37 @@ keeping app toolbars visually consistent.
|
|
|
29
32
|
]}
|
|
30
33
|
onSelectItem={handleMoreAction}
|
|
31
34
|
/>
|
|
32
|
-
<ToolbarButton variant="
|
|
35
|
+
<ToolbarButton variant="prominent">Present</ToolbarButton>
|
|
33
36
|
</ToolbarActions>
|
|
34
37
|
</Toolbar>
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
## Components
|
|
38
41
|
|
|
39
|
-
- `ToolbarButton` — text or mixed-content action.
|
|
40
|
-
|
|
42
|
+
- `ToolbarButton` — text or mixed-content action. Standalone chrome is a real
|
|
43
|
+
adaptive material surface: `material="regular"` by default and
|
|
44
|
+
`material="thick"` for `variant="prominent"`. Set `material="none"` or
|
|
45
|
+
`appearance="quiet"` to remove it.
|
|
41
46
|
- `ToolbarIconButton` — required accessible label and optional tooltip.
|
|
42
47
|
- `ToolbarBackButton` — single chevron Back affordance for root-to-detail
|
|
43
48
|
navigation.
|
|
44
49
|
- `ToolbarSidebarToggle` — controlled sidebar visibility button with accurate
|
|
45
50
|
pressed state and dynamic label.
|
|
46
51
|
- `ToolbarOverflowMenu` — an ellipsis button backed by Moldable's declarative
|
|
47
|
-
menu API
|
|
52
|
+
portable menu API. Set `nativeMenu` to opt into the native host menu.
|
|
48
53
|
- `ToolbarControlGroup` — a shared surface for closely related actions such as
|
|
49
|
-
Undo/Redo.
|
|
54
|
+
Undo/Redo. It defaults to `size="xl"`, supports `size="medium"`, and makes
|
|
55
|
+
children compact quiet controls.
|
|
50
56
|
- `ToolbarControlSeparator` — divider within a related action group.
|
|
51
57
|
- `ToolbarTitleField` — an accessible, inline-editable contextual title.
|
|
52
58
|
|
|
53
59
|
`ToolbarButton` and `ToolbarIconButton` accept `appearance="quiet"` when a
|
|
54
|
-
standalone action should not have raised chrome.
|
|
55
|
-
|
|
60
|
+
standalone action should not have raised chrome. `ToolbarButton` uses the
|
|
61
|
+
shared adaptive `Material` layer; `ToolbarIconButton` uses the compact toolbar
|
|
62
|
+
control treatment. `ToolbarControlGroup` also accepts `appearance="quiet"`
|
|
63
|
+
when related controls should not share a raised surface. Grouped buttons do
|
|
64
|
+
not add a nested material layer. Raised compact controls use these semantic
|
|
65
|
+
tokens:
|
|
56
66
|
|
|
57
67
|
- `--toolbar-control-background`
|
|
58
68
|
- `--toolbar-control-hover`
|
|
@@ -66,6 +76,8 @@ transparency.
|
|
|
66
76
|
## Composition rules
|
|
67
77
|
|
|
68
78
|
- Keep the current document or view title leading and the primary action last.
|
|
79
|
+
- Use fully rounded standalone controls and shared pill surfaces for related
|
|
80
|
+
controls. Avoid drawing a separate rounded rectangle around every icon.
|
|
69
81
|
- Prefer icon-only secondary controls and a text-only primary action.
|
|
70
82
|
- Put only genuinely related commands in `ToolbarControlGroup`.
|
|
71
83
|
- Move low-frequency commands such as history, duplicate, export, and delete
|
|
@@ -12,9 +12,9 @@ embedded view.
|
|
|
12
12
|
<ToolbarDescription>Local workspace</ToolbarDescription>
|
|
13
13
|
</ToolbarContent>
|
|
14
14
|
<ToolbarActions>
|
|
15
|
-
<
|
|
15
|
+
<ToolbarIconButton label="New note" tooltip>
|
|
16
16
|
<Plus />
|
|
17
|
-
</
|
|
17
|
+
</ToolbarIconButton>
|
|
18
18
|
</ToolbarActions>
|
|
19
19
|
</Toolbar>
|
|
20
20
|
```
|
|
@@ -28,10 +28,10 @@ when there is no useful view context; the remaining toolbar still provides a
|
|
|
28
28
|
drag surface and a safe home for right-aligned actions.
|
|
29
29
|
|
|
30
30
|
The `inset` prop defaults to `auto`. Use `none` for a top toolbar that is not
|
|
31
|
-
window chrome, `windowControls` to
|
|
32
|
-
`windowControlsAndButton` when another leading control sits beside
|
|
33
|
-
traffic lights. Set `draggable={false}` only for top toolbars that
|
|
34
|
-
inside app content.
|
|
31
|
+
window chrome, `windowControls` to explicitly declare the standard control
|
|
32
|
+
lane, or `windowControlsAndButton` when another leading control sits beside
|
|
33
|
+
the native traffic lights. Set `draggable={false}` only for top toolbars that
|
|
34
|
+
are nested inside app content.
|
|
35
35
|
|
|
36
36
|
The default toolbar uses `material="regular"`. The `plain` and `panel` variants
|
|
37
37
|
default to `material="none"`; pass a material explicitly only when the toolbar
|