@imfusion/web-ui 0.11.1-dev.5.g8a97f4f6 → 0.11.1-dev.53.g43897e72
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 +139 -1
- package/dist/{code-NTcddiYk.js → code-BaLXMEMa.js} +13 -13
- package/dist/components/autocomplete/autocomplete.d.ts +144 -0
- package/dist/components/autocomplete/autocomplete.meta.d.ts +2 -0
- package/dist/components/autocomplete/index.d.ts +2 -0
- package/dist/components/avatar/avatar.d.ts +1 -1
- package/dist/components/card/card.d.ts +3 -2
- package/dist/components/checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/combobox/combobox.cva.d.ts +37 -0
- package/dist/components/combobox/combobox.d.ts +171 -0
- package/dist/components/combobox/combobox.meta.d.ts +2 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/file-drop-zone/collect-files.d.ts +56 -0
- package/dist/components/file-drop-zone/file-drop-zone-context.d.ts +15 -0
- package/dist/components/file-drop-zone/file-drop-zone.d.ts +185 -0
- package/dist/components/file-drop-zone/file-drop-zone.meta.d.ts +2 -0
- package/dist/components/file-drop-zone/format-bytes.d.ts +5 -0
- package/dist/components/file-drop-zone/index.d.ts +4 -0
- package/dist/components/logo/logo.d.ts +1 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/index.d.ts +2 -0
- package/dist/components/progress/progress.d.ts +40 -0
- package/dist/components/progress/progress.meta.d.ts +2 -0
- package/dist/components/select/select.cva.d.ts +7 -0
- package/dist/components/select/select.d.ts +1 -1
- package/dist/components/tab-nav/index.d.ts +2 -0
- package/dist/components/tab-nav/tab-nav.d.ts +26 -0
- package/dist/components/tab-nav/tab-nav.meta.d.ts +2 -0
- package/dist/components/table/table.d.ts +8 -0
- package/dist/components/tabs/tabs-underline.cva.d.ts +6 -0
- package/dist/components/tabs/tabs.d.ts +13 -4
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.d.ts +32 -0
- package/dist/components/textarea/textarea.meta.d.ts +2 -0
- package/dist/components/toast/toast.d.ts +2 -2
- package/dist/components/typo/typo.d.ts +5 -1
- package/dist/docgen/component-sources.d.ts +4 -0
- package/dist/icon-button-roSB497o.js +171 -0
- package/dist/icons/catalog.gen.d.ts +28 -0
- package/dist/icons/icons.gen.d.ts +4 -0
- package/dist/{icons-BsK_o-Cb.js → icons-vc1WZCxX.js} +1027 -879
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4336 -2930
- package/dist/integrations/code-highlight.js +2 -2
- package/dist/integrations/frame-selection.js +1 -1
- package/dist/integrations/image-display-options.js +73 -71
- package/dist/integrations/layout-mode/index.d.ts +2 -0
- package/dist/integrations/layout-mode/layout-mode-view.d.ts +32 -0
- package/dist/integrations/layout-mode/layout-mode.d.ts +13 -0
- package/dist/integrations/layout-mode/layout-mode.meta.d.ts +2 -0
- package/dist/integrations/layout-mode.js +103 -0
- package/dist/integrations/view-tools/index.d.ts +4 -0
- package/dist/integrations/view-tools/use-view-interaction.d.ts +21 -0
- package/dist/integrations/view-tools/view-tools-view.d.ts +23 -0
- package/dist/integrations/view-tools/view-tools.d.ts +14 -0
- package/dist/integrations/view-tools/view-tools.meta.d.ts +2 -0
- package/dist/integrations/view-tools.js +133 -0
- package/dist/{resolve-state-props-DQf9WiGv.js → rolldown-runtime-Dy4uBu1J.js} +1 -12
- package/dist/row-CImu8yXV.js +136 -0
- package/dist/{scroll-area-z9Lf9uIk.js → scroll-area-CXQ_SxPX.js} +2 -1
- package/dist/{slider-Bf274cMe.js → slider-CpIZMAFl.js} +2 -1
- package/dist/style.css +2 -1
- package/dist/tabs-BqgyMmo6.js +173 -0
- package/dist/toggle-group-Bhb3qicp.js +31 -0
- package/dist/toggle-group-eGr6_hgQ.js +125 -0
- package/dist/utils/email.d.ts +4 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/initials.d.ts +4 -0
- package/dist/utils/item-parts.d.ts +23 -0
- package/dist/utils/stable-popup-height.d.ts +10 -0
- package/dist/utils-J6vbjIt1.js +46 -0
- package/package.json +3 -3
- package/src/docgen/doc.gen.json +5187 -1669
- package/src/llms/icon-catalog.gen.json +32 -0
- package/src/llms/llms.gen.txt +47 -1
- package/src/llms/skills/imf-web-ui-conventions/templates/AUDIT_CHECKLIST.md +3 -1
- package/src/llms/skills/imf-web-ui-conventions/topics/assets.md +24 -4
- package/src/llms/skills/imf-web-ui-conventions/topics/components.md +10 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/library-boundary.md +3 -0
- package/src/llms/skills/imf-web-ui-conventions/topics/styling.md +22 -1
- package/src/llms/tokens.gen.json +19 -1
- package/dist/tabs-CU46aGud.js +0 -376
|
@@ -7571,6 +7571,30 @@
|
|
|
7571
7571
|
"origin": "iconoir",
|
|
7572
7572
|
"file": "regular/laptop-warning.svg"
|
|
7573
7573
|
},
|
|
7574
|
+
{
|
|
7575
|
+
"name": "LayoutAuto",
|
|
7576
|
+
"category": "Layout",
|
|
7577
|
+
"tags": ["layout", "auto", "masonry", "viewports", "tiles", "grid"],
|
|
7578
|
+
"style": "regular",
|
|
7579
|
+
"origin": "imfusion",
|
|
7580
|
+
"file": "regular/layout-auto.svg"
|
|
7581
|
+
},
|
|
7582
|
+
{
|
|
7583
|
+
"name": "LayoutFocusPlusRows",
|
|
7584
|
+
"category": "Layout",
|
|
7585
|
+
"tags": ["layout", "focus", "rows", "main viewport", "viewports", "split"],
|
|
7586
|
+
"style": "regular",
|
|
7587
|
+
"origin": "imfusion",
|
|
7588
|
+
"file": "regular/layout-focus-plus-rows.svg"
|
|
7589
|
+
},
|
|
7590
|
+
{
|
|
7591
|
+
"name": "LayoutFocusPlusStack",
|
|
7592
|
+
"category": "Layout",
|
|
7593
|
+
"tags": ["layout", "focus", "stack", "main viewport", "sidebar", "viewports"],
|
|
7594
|
+
"style": "regular",
|
|
7595
|
+
"origin": "imfusion",
|
|
7596
|
+
"file": "regular/layout-focus-plus-stack.svg"
|
|
7597
|
+
},
|
|
7574
7598
|
{
|
|
7575
7599
|
"name": "LayoutLeft",
|
|
7576
7600
|
"category": "Layout",
|
|
@@ -7587,6 +7611,14 @@
|
|
|
7587
7611
|
"origin": "iconoir",
|
|
7588
7612
|
"file": "regular/layout-right.svg"
|
|
7589
7613
|
},
|
|
7614
|
+
{
|
|
7615
|
+
"name": "LayoutRows",
|
|
7616
|
+
"category": "Layout",
|
|
7617
|
+
"tags": ["layout", "rows", "viewports", "grid", "2x2", "tiles"],
|
|
7618
|
+
"style": "regular",
|
|
7619
|
+
"origin": "imfusion",
|
|
7620
|
+
"file": "regular/layout-rows.svg"
|
|
7621
|
+
},
|
|
7590
7622
|
{
|
|
7591
7623
|
"name": "Leaderboard",
|
|
7592
7624
|
"category": "Activities",
|
package/src/llms/llms.gen.txt
CHANGED
|
@@ -19,6 +19,12 @@ The signed-in person's account row: the avatar in a lead column, the name or ema
|
|
|
19
19
|
Application layout shell for a header, sidebars, footer, and scrolling main area. Also called an app layout or dashboard shell; sizing is CSS-driven and sidebars can become sliding panels on small screens.
|
|
20
20
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .app-shell (jq: jq '.app-shell' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
21
21
|
|
|
22
|
+
## Autocomplete
|
|
23
|
+
- category: Inputs, status: experimental
|
|
24
|
+
Text input that suggests options as you type, keeping free text. Also called a typeahead or search suggestions. Use Combobox when the value must come from the list.
|
|
25
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .autocomplete (jq: jq '.autocomplete' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
26
|
+
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/autocomplete.md
|
|
27
|
+
|
|
22
28
|
## Avatar
|
|
23
29
|
- category: Display, status: experimental
|
|
24
30
|
Round badge that stands for a person, showing their photo, their initials, or a person glyph. Also called a profile picture or user badge; for a signed-in account row with a name, use AccountCard.
|
|
@@ -78,6 +84,12 @@ Show-and-hide region for secondary content such as FAQs, settings, or details. A
|
|
|
78
84
|
Light, System, and Dark segments that set and remember the page's color scheme. Also called an appearance or theme switch; built on ToggleGroup, which is the choice for any other segmented selection.
|
|
79
85
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .color-scheme-toggle (jq: jq '.color-scheme-toggle' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
80
86
|
|
|
87
|
+
## Combobox
|
|
88
|
+
- category: Inputs, status: experimental
|
|
89
|
+
Text input with a filterable list of options, for choosing one or several from a long list. Also called a searchable select, typeahead, or multi-select. Use Select for short lists and Autocomplete when free text is allowed.
|
|
90
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .combobox (jq: jq '.combobox' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
91
|
+
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/combobox.md
|
|
92
|
+
|
|
81
93
|
## CopyButton
|
|
82
94
|
- category: Buttons, status: stable
|
|
83
95
|
Copies a value to the clipboard and briefly shows confirmation. Also called a copy-to-clipboard button; commonly used with Code.Block.
|
|
@@ -107,6 +119,11 @@ Semantic group for related form controls with a shared legend. Also called a for
|
|
|
107
119
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .fieldset (jq: jq '.fieldset' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
108
120
|
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/fieldset.md
|
|
109
121
|
|
|
122
|
+
## FileDropZone
|
|
123
|
+
- category: Inputs, status: experimental
|
|
124
|
+
Drop zone with picker buttons for files or whole folders, reporting accepted and rejected files. Also called a file upload area or dropzone. For a single native file control inside a form, use Input.
|
|
125
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .file-drop-zone (jq: jq '.file-drop-zone' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
126
|
+
|
|
110
127
|
## FrameSelection
|
|
111
128
|
- category: Inputs, status: experimental
|
|
112
129
|
Frame or slice picker bound to the focused frame of ImFusion image sets, with a focus and count readout. For a position picker not tied to the SDK, use Slider with variant="position".
|
|
@@ -140,6 +157,12 @@ Single-line text input for form data entry. Also called a text field; it support
|
|
|
140
157
|
Shows a keyboard key or shortcut, such as the letter that activates a button. Also called a key hint; Button and Toggle render it through their `shortcut` prop.
|
|
141
158
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .kbd (jq: jq '.kbd' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
142
159
|
|
|
160
|
+
## LayoutMode
|
|
161
|
+
- category: Inputs, status: experimental
|
|
162
|
+
Picker bound to the ImFusion viewer's layout mode: Auto, Rows, Focus + stack, or Focus + rows, as a compact icon row or a labeled vertical list. Also called a layout or view arrangement switch; for a segmented choice not tied to the SDK, use ToggleGroup.
|
|
163
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .layout-mode (jq: jq '.layout-mode' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
164
|
+
- further reading (usage/anatomy, not props): https://docs.imfusion.com/
|
|
165
|
+
|
|
143
166
|
## Logo
|
|
144
167
|
- category: Display, status: stable
|
|
145
168
|
Renders a logo from a URL or inline React element with consistent sizing. Also called a wordmark or brand mark.
|
|
@@ -169,6 +192,12 @@ Floating panel anchored to a trigger for contextual content, quick forms, or act
|
|
|
169
192
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .popover (jq: jq '.popover' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
170
193
|
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/popover.md
|
|
171
194
|
|
|
195
|
+
## Progress
|
|
196
|
+
- category: Display, status: experimental
|
|
197
|
+
Bar for the completion of a running task, such as an upload or export. Also called a progress bar. Indeterminate when the amount is unknown. Use Meter for a static measure within a range.
|
|
198
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .progress (jq: jq '.progress' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
199
|
+
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/progress.md
|
|
200
|
+
|
|
172
201
|
## Prose
|
|
173
202
|
- category: Layout, status: experimental
|
|
174
203
|
Flow container that spaces long-form text and the blocks inside it. Also called an article or rich-text container. Use Stack or Row for UI layout.
|
|
@@ -229,6 +258,11 @@ Two-state control for an on/off setting that takes effect immediately. Also call
|
|
|
229
258
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .switch (jq: jq '.switch' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
230
259
|
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/switch.md
|
|
231
260
|
|
|
261
|
+
## TabNav
|
|
262
|
+
- category: Display, status: experimental
|
|
263
|
+
Row of links to routes with a bar under the current one, such as the sections of a project. Also called route tabs or link tabs; use Tabs to switch panels on one page.
|
|
264
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .tab-nav (jq: jq '.tab-nav' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
265
|
+
|
|
232
266
|
## Table
|
|
233
267
|
- category: Display, status: stable
|
|
234
268
|
Presentational table parts for static tabular data. Pair them with a headless table library for sorting, pagination, or selection.
|
|
@@ -236,10 +270,16 @@ Presentational table parts for static tabular data. Pair them with a headless ta
|
|
|
236
270
|
|
|
237
271
|
## Tabs
|
|
238
272
|
- category: Display, status: stable
|
|
239
|
-
Switches between related panels within one view. Also called a tab strip or tab bar; it supports horizontal and vertical layouts.
|
|
273
|
+
Switches between related panels within one view. Also called a tab strip or tab bar; it supports horizontal and vertical layouts and a boxed or underline look. Use TabNav for links to routes.
|
|
240
274
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .tabs (jq: jq '.tabs' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
241
275
|
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/tabs.md
|
|
242
276
|
|
|
277
|
+
## Textarea
|
|
278
|
+
- category: Inputs, status: experimental
|
|
279
|
+
Multi-line text input for longer free text, such as a description or note. Also called a text area; use Input for a single line. It reads validation state from Field.
|
|
280
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .textarea (jq: jq '.textarea' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
281
|
+
- further reading (usage/anatomy, not props): https://base-ui.com/react/components/input.md
|
|
282
|
+
|
|
243
283
|
## Toast
|
|
244
284
|
- category: Display, status: experimental
|
|
245
285
|
Transient message stack that reports the outcome of a background action without interrupting the page. Use for save confirmations, undo offers, and async progress; attach one to an element for contextual feedback like a copy confirmation. Also called a snackbar, notification, or flash message; for a message that stays inline in the page use Callout instead.
|
|
@@ -268,3 +308,9 @@ Hover- or focus-triggered label for brief help about a control or term. Also cal
|
|
|
268
308
|
- category: Display, status: stable
|
|
269
309
|
Semantic text primitives for display and standard headings, paragraphs, lists, quotes, links, and inline code. The namespace uses native HTML elements and token-based text roles.
|
|
270
310
|
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .typo (jq: jq '.typo' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
311
|
+
|
|
312
|
+
## ViewTools
|
|
313
|
+
- category: Inputs, status: experimental
|
|
314
|
+
Toolbar that limits mouse interaction in the ImFusion main 2D and MPR views to pan, zoom, or windowing, with a reset button for the view group. For a segmented control not tied to the SDK, use ToggleGroup.
|
|
315
|
+
- props: node_modules/@imfusion/web-ui/src/docgen/doc.gen.json -> .view-tools (jq: jq '.view-tools' node_modules/@imfusion/web-ui/src/docgen/doc.gen.json)
|
|
316
|
+
- further reading (usage/anatomy, not props): https://docs.imfusion.com/
|
|
@@ -46,6 +46,7 @@ sections one to one — change a topic's sections and this file follows in the s
|
|
|
46
46
|
- [ ] Grouping
|
|
47
47
|
- [ ] One file or a folder
|
|
48
48
|
- [ ] Colocation
|
|
49
|
+
- [ ] Semantic elements
|
|
49
50
|
|
|
50
51
|
## TypeScript & code style — `typescript`
|
|
51
52
|
|
|
@@ -127,7 +128,8 @@ sections one to one — change a topic's sections and this file follows in the s
|
|
|
127
128
|
## Assets — `assets`
|
|
128
129
|
|
|
129
130
|
- [ ] Importing
|
|
130
|
-
- [ ] Photographs: WebP
|
|
131
|
+
- [ ] Photographs: AVIF and WebP
|
|
132
|
+
- [ ] Loading
|
|
131
133
|
- [ ] Other formats
|
|
132
134
|
- [ ] Scope
|
|
133
135
|
|
|
@@ -8,15 +8,35 @@ consumed by document metadata or manifests, with a build step that serves the fi
|
|
|
8
8
|
For the library's favicon set and social sharing image, read `BrandAssets.mdx` through the packaged user-guide route in
|
|
9
9
|
`imf-web-ui`.
|
|
10
10
|
|
|
11
|
-
## Photographs: WebP
|
|
11
|
+
## Photographs: AVIF and WebP
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Encode photographs as AVIF and WebP at 800 and 1600px wide. A source narrower than a width skips it, and `srcSet` lists only
|
|
14
|
+
the widths that exist:
|
|
14
15
|
|
|
15
16
|
```sh
|
|
16
|
-
|
|
17
|
+
for w in 800 1600; do
|
|
18
|
+
magick source.png -resize "${w}x>" -quality 55 src/assets/name-$w.avif
|
|
19
|
+
magick source.png -resize "${w}x>" -quality 80 -define webp:method=6 src/assets/name-$w.webp
|
|
20
|
+
done
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
Render them through `<picture>`: an AVIF `<source>`, then a WebP `<source>`, each with `srcSet` and `sizes`, then an `<img>`
|
|
24
|
+
fallback. The browser takes the first format it supports at the width that fits. Both formats are supported by the browser
|
|
25
|
+
floor.
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<picture>
|
|
29
|
+
<source type="image/avif" srcSet={`${name800Avif} 800w, ${name1600Avif} 1600w`} sizes="(max-width: 40rem) 100vw, 40rem" />
|
|
30
|
+
<source type="image/webp" srcSet={`${name800Webp} 800w, ${name1600Webp} 1600w`} sizes="(max-width: 40rem) 100vw, 40rem" />
|
|
31
|
+
<img src={name800Webp} width={800} height={400} alt="…" />
|
|
32
|
+
</picture>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Loading
|
|
36
|
+
|
|
37
|
+
Every `<img>` carries `width` and `height` in the source's aspect ratio, so the browser reserves its space before it loads.
|
|
38
|
+
An image below the fold gets `loading="lazy"` and `decoding="async"`. The one image that is the page's largest paint gets
|
|
39
|
+
`fetchpriority="high"` and loads eagerly.
|
|
20
40
|
|
|
21
41
|
## Other formats
|
|
22
42
|
|
|
@@ -53,3 +53,13 @@ Keep a component's stylesheet, tests, and local types beside the component. A co
|
|
|
53
53
|
be a layout or dumb component instead.
|
|
54
54
|
|
|
55
55
|
A route-local component keeps its stylesheet and tests in the route's `-` folder beside it.
|
|
56
|
+
|
|
57
|
+
## Semantic elements
|
|
58
|
+
|
|
59
|
+
Inside `AppShell`, the shell's parts render the landmarks: `AppShell.Header` a `<header>`, `AppShell.Navbar` a `<nav>`,
|
|
60
|
+
`AppShell.Aside` an `<aside>`, `AppShell.Main` the page's one `<main>`, and `AppShell.Footer` a `<footer>`. A page puts its
|
|
61
|
+
content inside those parts.
|
|
62
|
+
|
|
63
|
+
Custom markup uses the element for its meaning: `<section>` and `<article>` for content groups, `<time dateTime>` for a date,
|
|
64
|
+
`Button` for an action, and the router's `Link` for a destination. A page has one `Typo.H1`, and heading levels descend
|
|
65
|
+
without skipping.
|
|
@@ -7,6 +7,9 @@ integration seams.
|
|
|
7
7
|
|
|
8
8
|
- Do not import Base UI or another implementation package directly, including its stylesheet.
|
|
9
9
|
- If Web UI is missing a component or part, report the gap instead of reaching around it.
|
|
10
|
+
- Use what Web UI already ships before building your own: a component, a part, or a helper such as `initialsFromName`. A
|
|
11
|
+
native element or local function that duplicates one, such as a `div role="separator"` or a hand-written initials function,
|
|
12
|
+
is a finding.
|
|
10
13
|
- Import glyphs from `@imfusion/web-ui/icons` and render them with `Icon`.
|
|
11
14
|
|
|
12
15
|
## Stand in for a missing component
|
|
@@ -19,7 +19,8 @@ Use native CSS and Web UI's public seams. The library's CSS Modules and token na
|
|
|
19
19
|
transition: opacity var(--imf-ui-duration-quick-2) var(--imf-ui-ease-2);
|
|
20
20
|
|
|
21
21
|
&:focus-visible {
|
|
22
|
-
outline: var(--imf-ui-
|
|
22
|
+
outline: var(--imf-ui-focus-ring-width) solid var(--imf-ui-focus-ring-color);
|
|
23
|
+
outline-offset: var(--imf-ui-focus-ring-offset);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
&[data-disabled] {
|
|
@@ -28,6 +29,13 @@ Use native CSS and Web UI's public seams. The library's CSS Modules and token na
|
|
|
28
29
|
}
|
|
29
30
|
```
|
|
30
31
|
|
|
32
|
+
## Focus ring
|
|
33
|
+
|
|
34
|
+
Web UI parts draw their own focus ring. Your own focusable elements draw the same one from the `--imf-ui-focus-ring-*`
|
|
35
|
+
tokens: `width` and `color` for the outline, and one of two offsets: `offset` outside a standalone control and `offset-inset`
|
|
36
|
+
for items inside a scrolling or tight container, which would clip an outside ring. A surface filled with a saturated color
|
|
37
|
+
sets `--imf-ui-focus-ring-color` to `--imf-ui-color-fg-oncolor` for everything inside it.
|
|
38
|
+
|
|
31
39
|
## Build custom UI from tokens
|
|
32
40
|
|
|
33
41
|
Use names from the shipped token index for colors, type, size, radius, and shadow. A literal beside a tokenized concept is a
|
|
@@ -54,6 +62,19 @@ hook, not a state flag.
|
|
|
54
62
|
}
|
|
55
63
|
```
|
|
56
64
|
|
|
65
|
+
Your own components follow the same seam. A container that changes a child sets a custom property; the child reads it with
|
|
66
|
+
its own default as the fallback, so it works with or without the container:
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
.panel {
|
|
70
|
+
--panel-row-gap: var(--imf-ui-size-2);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.row {
|
|
74
|
+
padding-block: var(--panel-row-gap, var(--imf-ui-size-3));
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
57
78
|
## Spacing
|
|
58
79
|
|
|
59
80
|
Web UI components have no outer margin. The parent sets the distance between its children: `Stack` and `Row` gaps in UI,
|
package/src/llms/tokens.gen.json
CHANGED
|
@@ -462,6 +462,24 @@
|
|
|
462
462
|
"value": "cubic-bezier(0, 0, 0.05, 1)"
|
|
463
463
|
}
|
|
464
464
|
],
|
|
465
|
+
"focus": [
|
|
466
|
+
{
|
|
467
|
+
"name": "--imf-ui-focus-ring-color",
|
|
468
|
+
"value": "var(--imf-ui-color-fg-primary)"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"name": "--imf-ui-focus-ring-offset",
|
|
472
|
+
"value": "2px"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"name": "--imf-ui-focus-ring-offset-inset",
|
|
476
|
+
"value": "calc(var(--imf-ui-focus-ring-width) * -1)"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"name": "--imf-ui-focus-ring-width",
|
|
480
|
+
"value": "var(--imf-ui-border-size-2)"
|
|
481
|
+
}
|
|
482
|
+
],
|
|
465
483
|
"font": [
|
|
466
484
|
{
|
|
467
485
|
"name": "--imf-ui-font-family-body",
|
|
@@ -955,5 +973,5 @@
|
|
|
955
973
|
}
|
|
956
974
|
]
|
|
957
975
|
},
|
|
958
|
-
"count":
|
|
976
|
+
"count": 237
|
|
959
977
|
}
|