@threadlabs/looma 0.9.1 → 0.9.2
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/components/ui-avatar/ui-avatar.html +12 -4
- package/components/ui-avatar-group/ui-avatar-group.html +5 -2
- package/components/ui-badge/ui-badge.html +6 -2
- package/components/ui-button/ui-button.html +6 -2
- package/components/ui-callout/ui-callout.html +3 -1
- package/components/ui-checkbox/ui-checkbox.html +9 -4
- package/components/ui-cluster/ui-cluster.html +6 -2
- package/components/ui-combobox/ui-combobox.html +35 -13
- package/components/ui-container/ui-container.html +5 -2
- package/components/ui-disclosure/ui-disclosure.html +6 -3
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +3 -1
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +3 -1
- package/components/ui-floating-action-button/ui-floating-action-button.html +5 -3
- package/components/ui-form-field/ui-form-field.html +9 -3
- package/components/ui-grid/ui-grid.html +6 -2
- package/components/ui-icon/ui-icon.html +3 -1
- package/components/ui-icon-button/ui-icon-button.html +11 -4
- package/components/ui-input/ui-input.html +3 -1
- package/components/ui-menu-item/ui-menu-item.html +5 -2
- package/components/ui-radio/ui-radio.html +9 -4
- package/components/ui-radio-group/ui-radio-group.html +14 -6
- package/components/ui-reel/ui-reel.html +9 -3
- package/components/ui-search-result-row/ui-search-result-row.html +4 -2
- package/components/ui-stack/ui-stack.html +9 -3
- package/components/ui-switch/ui-switch.html +5 -3
- package/components/ui-switcher/ui-switcher.html +9 -3
- package/components/ui-tabs/ui-tabs.html +8 -3
- package/components/ui-textarea/ui-textarea.html +3 -1
- package/components/ui-tree/ui-tree.html +7 -3
- package/components/ui-tree-item/ui-tree-item.html +32 -11
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<template component="ui-avatar" controller="./ui-avatar.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="src" type="string"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<prop name="
|
|
3
|
+
<prop name="src" type="string"
|
|
4
|
+
>The image to show, cropped to fill the circle. Until it loads, or if it fails, the avatar shows initials instead. An img element authored inside the avatar
|
|
5
|
+
takes precedence over src.</prop>
|
|
6
|
+
<prop name="alt" type="string" default=""
|
|
7
|
+
>The avatar's accessible name, announced for it as an image. When empty, name is used, then "Avatar". Initials come from name first, so alt supplies them
|
|
8
|
+
only when name is empty. An authored img carries its own alt instead.</prop>
|
|
9
|
+
<prop name="name" type="string" default=""
|
|
10
|
+
>The person's name. The initials are drawn from it: the first letters of the first two words, or the first two letters of a single word. It is also the
|
|
11
|
+
accessible name when alt is empty.</prop>
|
|
12
|
+
<prop name="fallback" type="string" default=""
|
|
13
|
+
>Text shown instead of the initials derived from name or alt, whenever there is no image. It is uppercased; keep it to a couple of characters, because the
|
|
14
|
+
circle clips anything wider.</prop>
|
|
7
15
|
<state name="hasImage" :value="false"></state>
|
|
8
16
|
<state name="hasAuthoredImage" :value="false"></state>
|
|
9
17
|
<state name="initials" :value="'?'"></state>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template component="ui-avatar-group" controller="./ui-avatar-group.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="max" type="number" default="5"
|
|
4
|
-
|
|
3
|
+
<prop name="max" type="number" default="5"
|
|
4
|
+
>How many avatars to show. The rest are hidden and counted in a +N badge after the last visible one. Fractions round down, and 0 hides every avatar behind
|
|
5
|
+
the badge.</prop>
|
|
6
|
+
<prop name="label" type="string" default="People"
|
|
7
|
+
>The group's accessible name, announced for the set of avatars as a whole. Name who they are rather than repeating the default.</prop>
|
|
5
8
|
<state name="overflowCount" :value="0"></state>
|
|
6
9
|
</defs>
|
|
7
10
|
<div role="group" :aria-label="label">
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template component="ui-badge">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="variant" type="solid | subtle" default="subtle"
|
|
4
|
-
|
|
3
|
+
<prop name="variant" type="solid | subtle" default="subtle"
|
|
4
|
+
>Emphasis. subtle sets the text in its tone over a soft wash of it; solid fills with the tone and uses contrasting text, for a status that has to stand out.
|
|
5
|
+
The neutral tone looks the same in both.</prop>
|
|
6
|
+
<prop name="tone" type="neutral | accent | info | success | warning | danger" default="neutral"
|
|
7
|
+
>Which colour the badge speaks in. neutral is a quiet grey for plain labels; accent draws the eye in the accent colour; info, success, warning, and danger
|
|
8
|
+
mark a status, so match the tone to what the badge says.</prop>
|
|
5
9
|
<prop name="shape" type="pill | tag" default="pill"
|
|
6
10
|
>Silhouette. pill is rounded at both ends; tag is a label: flat at the start and coming to a point at the end, for a tag or a chosen chip.</prop>
|
|
7
11
|
</defs>
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
<prop name="variant" type="outline | solid | danger | ghost | link" default="outline"
|
|
4
4
|
>Emphasis: how loudly the button asks. solid fills with its tone, outline draws its tone at the edge over a wash of it, ghost carries only text until it is
|
|
5
5
|
hovered, and link is an inline text action that reads as a link. danger is solid in the danger tone, kept for the call sites that name it.</prop>
|
|
6
|
-
<prop name="size" type="sm | md | lg" default="md"
|
|
6
|
+
<prop name="size" type="sm | md | lg" default="md"
|
|
7
|
+
>Height, padding, and type size. sm is the small control height (2rem by default) with tighter padding and smaller text, md is the standard control height
|
|
8
|
+
(2.5rem), and lg is taller (3rem) with roomier padding.</prop>
|
|
7
9
|
<prop name="tone" type="accent | neutral | danger | success | warning | info" default="accent"
|
|
8
10
|
>Which colour the button speaks in. It applies to every variant, so an outline, a ghost, and a solid in the same tone are the same action at three volumes:
|
|
9
11
|
tone="danger" variant="outline" is a destructive secondary action. neutral is the quiet one, for a button that should not claim a colour.</prop>
|
|
10
|
-
<prop name="disabled" type="boolean" default="false"
|
|
12
|
+
<prop name="disabled" type="boolean" default="false"
|
|
13
|
+
>Makes the button unavailable: it cannot be pressed, its tone fades, and it loses its raised look. A disabled link (as="a" with href) drops its href and
|
|
14
|
+
states aria-disabled="true" instead, because a link has no native disabled state.</prop>
|
|
11
15
|
<prop name="align" type="center | start" default="center"
|
|
12
16
|
>Content alignment. start lays the content out like a list option: from the start edge, with start-aligned text.</prop>
|
|
13
17
|
<prop name="stretch" type="boolean" default="false">Fills the inline size of its container.</prop>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template component="ui-callout">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="tone" type="info | note | warning | success | danger" default="info"
|
|
3
|
+
<prop name="tone" type="info | note | warning | success | danger" default="info"
|
|
4
|
+
>Which kind of message the callout carries, shown by its icon and colour: info (the default) for neutral information, note for an aside in muted grey,
|
|
5
|
+
warning for a caution, success for a confirmation, and danger for an error or a destructive consequence.</prop>
|
|
4
6
|
</defs>
|
|
5
7
|
<div role="note">
|
|
6
8
|
<span class="icon" aria-hidden="true">
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<template component="ui-checkbox" controller="./ui-checkbox.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="checked" type="boolean" default="false">Whether the checkbox is checked initially or when set externally.</prop>
|
|
4
|
-
<prop name="disabled" type="boolean" default="false">
|
|
5
|
-
<prop name="indeterminate" type="boolean" default="false"
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
<prop name="disabled" type="boolean" default="false">Disables the native checkbox, so it cannot be toggled or focused.</prop>
|
|
5
|
+
<prop name="indeterminate" type="boolean" default="false"
|
|
6
|
+
>Shows the mixed state, for a checkbox that summarises a group whose items are partly checked. It sets the native indeterminate property, which is
|
|
7
|
+
independent of checked, so update it as the group changes.</prop>
|
|
8
|
+
<prop name="required" type="boolean" default="false"
|
|
9
|
+
>Marks the native checkbox required, so native form validation treats it as invalid until it is checked.</prop>
|
|
10
|
+
<prop name="value" type="string" default="on"
|
|
11
|
+
>The value set on the native input and reported in the change event's detail, so one handler can tell checkboxes apart. on by default, as on a native
|
|
12
|
+
checkbox.</prop>
|
|
8
13
|
<state name="internalChecked" :value="false"></state>
|
|
9
14
|
<event name="change" type="object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })"></event>
|
|
10
15
|
</defs>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template component="ui-cluster">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
-
|
|
3
|
+
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
+
>Space between items, on the spacing scale: xs is 0.5rem, s 0.75rem (also the default), m 1rem, l 1.5rem, and xl 2rem. The --ui-cluster-gap custom property,
|
|
5
|
+
when set, overrides it.</prop>
|
|
6
|
+
<prop name="align" type="start | center | end | stretch"
|
|
7
|
+
>How items line up within each row: center (the default) aligns their middles, start their tops, end their bottoms, and stretch makes every item as tall as
|
|
8
|
+
its row.</prop>
|
|
5
9
|
</defs>
|
|
6
10
|
<div><slot></slot></div>
|
|
7
11
|
<style>
|
|
@@ -2,25 +2,47 @@
|
|
|
2
2
|
<link rel="component" href="../ui-tooltip/ui-tooltip.html">
|
|
3
3
|
<template component="ui-combobox" controller="./ui-combobox.js">
|
|
4
4
|
<defs>
|
|
5
|
-
<prop name="label" type="string" default=""
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<prop name="label" type="string" default=""
|
|
6
|
+
>The field's label, tied to its input and shown above it; required adds an asterisk. It also names the suggestion list. Pair it with
|
|
7
|
+
labelVisibility="sr-only" when the context already labels the field visibly.</prop>
|
|
8
|
+
<prop name="placeholder" type="string" default=""
|
|
9
|
+
>Hint text shown in the empty input, as on a native input. It disappears as the user types, so it never replaces label.</prop>
|
|
10
|
+
<prop name="name" type="string" default=""
|
|
11
|
+
>The form field name set on the native input. A form submits the input's text, which after a selection is the chosen option's label, not its value; read
|
|
12
|
+
value-change for the value.</prop>
|
|
8
13
|
<prop name="value" type="string | null">The selected value in single mode.</prop>
|
|
9
14
|
<prop name="items" type="list(object({ id: string, value: string, label: string, group?: string, disabled?: boolean }))"
|
|
10
15
|
>The selected items in multiple mode, as JSON.</prop>
|
|
11
|
-
<prop name="multiple" type="boolean" default="false"
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
<prop name="multiple" type="boolean" default="false"
|
|
17
|
+
>Lets the user choose several options. Each choice becomes a removable badge before the input, the list stays open between picks, and choosing a checked
|
|
18
|
+
option removes it. value-change then reports the whole list of items; use items, not value, in this mode.</prop>
|
|
19
|
+
<prop name="tokenSeparators" type="list(string)"
|
|
20
|
+
>Keys that commit the typed text in multiple mode, as KeyboardEvent key values such as "," or ";". The text is added as the option whose label matches it,
|
|
21
|
+
ignoring case, or with allowCreate is reported as create-item; otherwise it stays in the input.</prop>
|
|
22
|
+
<prop name="query" type="string"
|
|
23
|
+
>The input's text, when the consumer controls it. Once set, the consumer owns the text: typing reports query-change, and the input returns to query unless
|
|
24
|
+
query is updated to match. Leave it unset to let the combobox manage its own text, showing the chosen option's label.</prop>
|
|
14
25
|
<prop name="allowFreeText" type="boolean" default="false">Allows values that do not match an authored option.</prop>
|
|
15
26
|
<prop name="allowCreate" type="boolean" default="false">Offers the current query as a new option.</prop>
|
|
16
|
-
<prop name="disabled" type="boolean" default="false"
|
|
27
|
+
<prop name="disabled" type="boolean" default="false"
|
|
28
|
+
>Disables the input, the chosen-item badges, and the help button. The list closes and cannot be opened.</prop>
|
|
17
29
|
<prop name="readonly" type="boolean" default="false">Whether the current value may be selected but not edited.</prop>
|
|
18
|
-
<prop name="required" type="boolean" default="false"
|
|
19
|
-
|
|
20
|
-
<prop name="
|
|
21
|
-
|
|
22
|
-
<prop name="
|
|
23
|
-
|
|
30
|
+
<prop name="required" type="boolean" default="false"
|
|
31
|
+
>Marks the input required, adds an asterisk to the label, and makes validation report "A value is required." when the field is left empty.</prop>
|
|
32
|
+
<prop name="size" type="sm | md" default="md"
|
|
33
|
+
>Field height. md is the standard control height; sm is the small control height with tighter padding, for dense forms.</prop>
|
|
34
|
+
<prop name="labelVisibility" type="visible | sr-only" default="visible"
|
|
35
|
+
>visible shows the label above the field; sr-only hides it visually but keeps it as the input's accessible name. Use sr-only only when the surrounding
|
|
36
|
+
layout already makes the field's purpose clear.</prop>
|
|
37
|
+
<prop name="disclosure" type="boolean" default="false"
|
|
38
|
+
>Adds a chevron button that opens and closes the full, unfiltered list of options, for users who would rather browse than type. ArrowDown opens the same
|
|
39
|
+
list with or without it.</prop>
|
|
40
|
+
<prop name="clearable" type="boolean" default="false"
|
|
41
|
+
>Adds a clear button to the field that empties the input and clears the selection, reported as value-change with kind "clear". In multiple mode it clears
|
|
42
|
+
only the typed text; chosen items stay.</prop>
|
|
43
|
+
<prop name="help" type="string" default=""
|
|
44
|
+
>Help text for the field. When set, a help button appears beside the field and opens a tooltip with this text; while it is open, the input is described by
|
|
45
|
+
it.</prop>
|
|
24
46
|
<state name="internalItems" type="list(object({ id: string, value: string, label: string, group?: string, disabled?: boolean }))" :value="[]"></state>
|
|
25
47
|
<state name="raw" :value="''"></state>
|
|
26
48
|
<state name="display" :value="''"></state>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template component="ui-container">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="measure" type="narrow | wide"
|
|
4
|
-
|
|
3
|
+
<prop name="measure" type="narrow | wide"
|
|
4
|
+
>The container's maximum width, in characters of the current font: narrow is 45ch, wide is 80ch, and unset is 65ch, a comfortable reading line. The
|
|
5
|
+
container centres itself when its parent is wider. The --ui-container-measure custom property, when set, overrides it.</prop>
|
|
6
|
+
<prop name="gutters" type="s | m | l"
|
|
7
|
+
>Inline padding on both sides, which keeps content off the edges of a narrow screen: s is 0.75rem, m is 1rem (also the default), and l is 1.5rem.</prop>
|
|
5
8
|
</defs>
|
|
6
9
|
<div><slot></slot></div>
|
|
7
10
|
<style>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<template component="ui-disclosure" controller="./ui-disclosure.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="density" type="comfortable | compact" default="comfortable">Compact trades padding and type size for rows that fit more on screen.</prop>
|
|
4
|
-
<prop name="summary" type="string" default="Details"
|
|
5
|
-
|
|
6
|
-
<prop name="
|
|
4
|
+
<prop name="summary" type="string" default="Details"
|
|
5
|
+
>The text of the trigger row that opens and closes the disclosure. It is the trigger button's accessible name, so name what the content is.</prop>
|
|
6
|
+
<prop name="open" type="boolean" default="false"
|
|
7
|
+
>Whether the disclosure is open initially or when set externally. The trigger toggles it from there, reporting each change as an open or close event.</prop>
|
|
8
|
+
<prop name="disabled" type="boolean" default="false"
|
|
9
|
+
>Disables the trigger and mutes its text, so the disclosure keeps its current state and the user cannot toggle it.</prop>
|
|
7
10
|
<state name="internalOpen" :value="false"></state>
|
|
8
11
|
<state name="contentId" :value="''"></state>
|
|
9
12
|
<event
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
<prop name="open" type="boolean" default="false">Whether the menu is open.</prop>
|
|
4
4
|
<prop name="query" type="string" default="">The text typed after the @.</prop>
|
|
5
5
|
<prop name="items" type="list(object({ id: string, label: string, detail?: string, initials?: string }))">The people the menu offers.</prop>
|
|
6
|
-
<prop name="selectedIndex" type="integer" default="0"
|
|
6
|
+
<prop name="selectedIndex" type="integer" default="0"
|
|
7
|
+
>The zero-based index of the highlighted person, capped at the last one shown, and announced through aria-activedescendant. The menu does not handle arrow
|
|
8
|
+
keys itself: the editor sets this as the user moves, while hovering a person highlights them and reports a highlight event.</prop>
|
|
7
9
|
<prop name="loading" type="boolean" default="false">Whether a search is in progress.</prop>
|
|
8
10
|
<prop
|
|
9
11
|
name="anchorRect"
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
<prop name="open" type="boolean" default="false">Whether the menu is open.</prop>
|
|
5
5
|
<prop name="query" type="string" default="">The text typed after the slash.</prop>
|
|
6
6
|
<prop name="items" type="list(object({ title: string, description: string, icon: string }))">The blocks the menu offers.</prop>
|
|
7
|
-
<prop name="selectedIndex" type="integer" default="0"
|
|
7
|
+
<prop name="selectedIndex" type="integer" default="0"
|
|
8
|
+
>The zero-based index of the highlighted item. The menu does not handle arrow keys itself: the editor sets this as the user moves, while hovering an item
|
|
9
|
+
highlights it and reports a highlight event.</prop>
|
|
8
10
|
<prop
|
|
9
11
|
name="anchorRect"
|
|
10
12
|
type="object({ left?: number, top?: number, right?: number, bottom?: number, x?: number, y?: number, width?: number, height?: number }) | null"
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<template component="ui-floating-action-button">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="disabled" type="boolean" default="false">
|
|
4
|
-
<prop name="mobileOnly" type="boolean" default="false"
|
|
5
|
-
|
|
3
|
+
<prop name="disabled" type="boolean" default="false">Disables the button, so it cannot be pressed or focused, and fades it to 60% opacity.</prop>
|
|
4
|
+
<prop name="mobileOnly" type="boolean" default="false"
|
|
5
|
+
>Hides the button on viewports 768px wide and wider, for a shortcut that only phones need. Make sure the action is reachable another way at those
|
|
6
|
+
widths.</prop>
|
|
7
|
+
<prop name="label" type="string" default="">The button's accessible name. The button usually holds only an icon, so name the action it performs.</prop>
|
|
6
8
|
</defs>
|
|
7
9
|
<button type="button" :aria-label="label" :disabled="disabled"><slot></slot></button>
|
|
8
10
|
<style>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<template component="ui-form-field" controller="./ui-form-field.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="invalid" type="boolean" default="false"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<prop name="invalid" type="boolean" default="false"
|
|
4
|
+
>Marks the field's control invalid by setting aria-invalid on it. Pair it with content in the error slot, which the field already links to the control as
|
|
5
|
+
its description.</prop>
|
|
6
|
+
<prop name="disabled" type="boolean" default="false"
|
|
7
|
+
>Disables the field's control: the first input, textarea, or select inside it. The field writes this to the control whenever it updates, so set it here
|
|
8
|
+
rather than on the control.</prop>
|
|
9
|
+
<prop name="required" type="boolean" default="false"
|
|
10
|
+
>Marks the field's control required, for native form validation. Like disabled, it is written to the control, so set it here rather than on the control. It
|
|
11
|
+
adds no visual marker; show one in the label if the form needs it.</prop>
|
|
6
12
|
</defs>
|
|
7
13
|
<div>
|
|
8
14
|
<div class="label"><slot name="label"></slot></div>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template component="ui-grid">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
-
|
|
3
|
+
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
+
>Space between cells, on the spacing scale: xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-grid-gap custom property,
|
|
5
|
+
when set, overrides it.</prop>
|
|
6
|
+
<prop name="min" type="sm | md | lg"
|
|
7
|
+
>The narrowest a column may get before the grid drops to fewer columns: sm is 12rem (also the default), md is 16rem, and lg is 20rem. The grid fits as many
|
|
8
|
+
equal columns as its width allows, and a single column never overflows a narrower container.</prop>
|
|
5
9
|
</defs>
|
|
6
10
|
<div><slot></slot></div>
|
|
7
11
|
<style>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template component="ui-icon" controller="./ui-icon.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="name" type="string" default=""
|
|
3
|
+
<prop name="name" type="string" default=""
|
|
4
|
+
>Which icon to draw, by its name in Looma's icon set (LOOMA_ICONS), such as "align-left". An unknown or empty name draws nothing. The icon is hidden from
|
|
5
|
+
assistive technology, so name the control it sits in.</prop>
|
|
4
6
|
<state
|
|
5
7
|
name="shapes"
|
|
6
8
|
type="list(object({ tag: path | circle | rect, d?: string, cx?: string, cy?: string, r?: string, x?: string, y?: string, width?: string, height?: string, rx?: string }))"
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
<template component="ui-icon-button" controller="./ui-icon-button.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="disabled" type="boolean" default="false"
|
|
3
|
+
<prop name="disabled" type="boolean" default="false"
|
|
4
|
+
>Disables the button, so it cannot be pressed or focused, and greys the icon; outline and solid also take the disabled surface.</prop>
|
|
4
5
|
<prop name="label" type="string">Accessible name for the icon.</prop>
|
|
5
|
-
<prop name="size" type="sm | md | lg" default="md"
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
<prop name="size" type="sm | md | lg" default="md"
|
|
7
|
+
>Button and icon size together: sm is 1.75rem with a small icon, md is 2rem, and lg is 2.5rem with a large icon. On touch, every size gets an invisible hit
|
|
8
|
+
area of at least 44px.</prop>
|
|
9
|
+
<prop name="variant" type="ghost | outline | solid" default="ghost"
|
|
10
|
+
>Emphasis. ghost shows only the icon until it is hovered, for toolbars and dense rows; outline adds a border on the default surface; solid fills with the
|
|
11
|
+
accent colour, for the one primary action in a group.</prop>
|
|
12
|
+
<prop name="anticipatory" type="boolean" default="false"
|
|
13
|
+
>Keeps the button out of sight until it is wanted: at rest a fine pointer sees only a small guide dot, and the button appears on hover, on focus, or when
|
|
14
|
+
the pointer comes near inside a ui-affordance-scope. Touch devices and the solid variant always show it.</prop>
|
|
8
15
|
<prop name="round" type="boolean" default="false">Use a fully circular shape.</prop>
|
|
9
16
|
</defs>
|
|
10
17
|
<button :disabled="disabled" type="button" :aria-label="label"><slot></slot></button>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template component="ui-input" controller="./ui-input.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="value" type="string"
|
|
3
|
+
<prop name="value" type="string"
|
|
4
|
+
>The input's text. Setting or changing it replaces the live text; between changes the user's typing stands, so follow input events to keep it in
|
|
5
|
+
step.</prop>
|
|
4
6
|
<prop name="disabled" type="boolean" default="false">Prevents editing and form submission.</prop>
|
|
5
7
|
<prop name="invalid" type="boolean" default="false">Exposes invalid state to assistive technology and styling.</prop>
|
|
6
8
|
<prop name="readonly" type="boolean" default="false">Allows selection without allowing edits.</prop>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template component="ui-menu-item">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="disabled" type="boolean" default="false"
|
|
4
|
-
|
|
3
|
+
<prop name="disabled" type="boolean" default="false"
|
|
4
|
+
>Makes the item unavailable: it is faded, skipped by the arrow keys, and choosing it does nothing. It stays visible and is announced as disabled.</prop>
|
|
5
|
+
<prop name="value" type="string" default=""
|
|
6
|
+
>The value the enclosing menu reports in its select event when this item is chosen. Give each item a distinct value so one handler can tell them
|
|
7
|
+
apart.</prop>
|
|
5
8
|
</defs>
|
|
6
9
|
<div role="menuitem" tabindex="-1" :aria-disabled="disabled" :data-value="value"><slot></slot></div>
|
|
7
10
|
<style>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
<template component="ui-radio" controller="./ui-radio.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="checked" type="boolean" default="false">Whether the radio is checked initially or when set externally.</prop>
|
|
4
|
-
<prop name="disabled" type="boolean" default="false">
|
|
5
|
-
<prop name="name" type="string" default=""
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
<prop name="disabled" type="boolean" default="false">Disables the native radio, so it cannot be chosen, focused, or reached with the arrow keys.</prop>
|
|
5
|
+
<prop name="name" type="string" default=""
|
|
6
|
+
>The native name that groups radios: of the radios that share a name, only one can be checked, and the arrow keys move between them. Inside a ui-radio-group
|
|
7
|
+
the group sets the name, so leave this empty there.</prop>
|
|
8
|
+
<prop name="required" type="boolean" default="false"
|
|
9
|
+
>Marks the native radio required, so native form validation fails until a radio with the same name is checked.</prop>
|
|
10
|
+
<prop name="value" type="string" default="on"
|
|
11
|
+
>The value this radio stands for: submitted with a form, reported in its change event, and matched against a ui-radio-group's value to decide which radio is
|
|
12
|
+
checked.</prop>
|
|
8
13
|
<state name="internalChecked" :value="false"></state>
|
|
9
14
|
<event name="change" type="object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })"></event>
|
|
10
15
|
</defs>
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
<template component="ui-radio-group" controller="./ui-radio-group.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="value" type="string" default=""
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<prop name="
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
<prop name="value" type="string" default=""
|
|
4
|
+
>The value of the checked radio, initially or when set externally; empty checks none. The user's choice updates it from there and is reported as select and
|
|
5
|
+
change events.</prop>
|
|
6
|
+
<prop name="name" type="string" default=""
|
|
7
|
+
>The native name given to every radio in the group, under which a form submits the chosen value. Left empty, the group generates a unique name that keeps
|
|
8
|
+
the radios together, so set it when the choice submits with a form.</prop>
|
|
9
|
+
<prop name="label" type="string" default="Options"
|
|
10
|
+
>The group's legend, shown above the radios and announced as the group's name. Phrase it as the question the radios answer.</prop>
|
|
11
|
+
<prop name="orientation" type="horizontal | vertical" default="horizontal"
|
|
12
|
+
>horizontal lays the radios out in a row; vertical stacks them in a column. The arrow keys move between radios either way.</prop>
|
|
13
|
+
<prop name="disabled" type="boolean" default="false">Disables every radio in the group, so no choice can be made.</prop>
|
|
14
|
+
<prop name="required" type="boolean" default="false"
|
|
15
|
+
>Not applied yet: the group neither marks its radios required nor checks that one is chosen. Set required on the ui-radio children instead, which native
|
|
16
|
+
form validation honours for the whole group.</prop>
|
|
9
17
|
<state name="internalValue" :value="''"></state>
|
|
10
18
|
<event name="select" type="object({ value: string, previousValue: string, trigger: keyboard | pointer | programmatic })"></event>
|
|
11
19
|
<event name="change" type="object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })"></event>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<template component="ui-reel">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
+
>Space between items, on the spacing scale: xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-reel-gap custom property,
|
|
5
|
+
when set, overrides it.</prop>
|
|
6
|
+
<prop name="itemWidth" type="sm | md | lg"
|
|
7
|
+
>A fixed width for every item: sm is 12rem, md is 16rem, and lg is 20rem. Unset, each item keeps its content's width. Items never shrink to fit, so the reel
|
|
8
|
+
scrolls sideways once they overflow.</prop>
|
|
9
|
+
<prop name="snap" type="start | center"
|
|
10
|
+
>Snaps scrolling to items: start comes to rest with an item's start edge at the reel's start, and center with an item centred in the reel. Unset, the reel
|
|
11
|
+
scrolls freely.</prop>
|
|
6
12
|
</defs>
|
|
7
13
|
<div role="region" tabindex="0"><slot></slot></div>
|
|
8
14
|
<style>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<template component="ui-search-result-row">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="disabled" type="boolean" default="false">
|
|
4
|
-
<prop name="selected" type="boolean" default="false"
|
|
3
|
+
<prop name="disabled" type="boolean" default="false">Disables the row's button, so it cannot be chosen or focused, and fades it to 60% opacity.</prop>
|
|
4
|
+
<prop name="selected" type="boolean" default="false"
|
|
5
|
+
>Highlights the row with its hover surface, to mark the current result. It is visual only and sets no ARIA state, so convey the selection to assistive
|
|
6
|
+
technology another way where it matters.</prop>
|
|
5
7
|
</defs>
|
|
6
8
|
<button type="button" :disabled="disabled">
|
|
7
9
|
<span class="leading"><slot name="leading"></slot></span>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<template component="ui-stack">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
+
>Space between items, on the spacing scale: xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-stack-gap custom property,
|
|
5
|
+
when set, overrides it.</prop>
|
|
6
|
+
<prop name="align" type="start | center | end | stretch"
|
|
7
|
+
>How items sit across the stack: stretch (the default) makes each fill the stack's width; start, center, and end keep each at its own width, against the
|
|
8
|
+
start, in the middle, or against the end.</prop>
|
|
9
|
+
<prop name="justify" type="start | center | end | between"
|
|
10
|
+
>Where items sit along a stack that is taller than its content: start (the default), center, end, or between, which spreads the spare space between items.
|
|
11
|
+
It has no effect unless the stack is given a height or stretched to one.</prop>
|
|
6
12
|
</defs>
|
|
7
13
|
<div><slot></slot></div>
|
|
8
14
|
<style>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
<template component="ui-switch" controller="./ui-switch.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="checked" type="boolean" default="false">Whether the switch is checked initially or when set externally.</prop>
|
|
4
|
-
<prop name="disabled" type="boolean" default="false">
|
|
5
|
-
<prop name="required" type="boolean" default="false">required
|
|
6
|
-
<prop name="value" type="string" default="on"
|
|
4
|
+
<prop name="disabled" type="boolean" default="false">Disables the native switch, so it cannot be toggled or focused.</prop>
|
|
5
|
+
<prop name="required" type="boolean" default="false">Marks the native switch required, so native form validation treats it as invalid until it is on.</prop>
|
|
6
|
+
<prop name="value" type="string" default="on"
|
|
7
|
+
>The value set on the native input and reported in the change event's detail, so one handler can tell switches apart. on by default, as on a native
|
|
8
|
+
checkbox.</prop>
|
|
7
9
|
<state name="internalChecked" :value="false"></state>
|
|
8
10
|
<event name="change" type="object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })"></event>
|
|
9
11
|
</defs>
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
<template component="ui-switcher">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<prop name="gap" type="xs | s | m | l | xl"
|
|
4
|
+
>Space between items, on the spacing scale: xs is 0.5rem, s 0.75rem, m 1rem (also the default), l 1.5rem, and xl 2rem. The --ui-switcher-gap custom
|
|
5
|
+
property, when set, overrides it.</prop>
|
|
6
|
+
<prop name="threshold" type="xs | sm | md | lg"
|
|
7
|
+
>The container width at which items switch between a row and a stack: wider, they all sit side by side; narrower, each takes the full width. xs is 20rem, sm
|
|
8
|
+
is 30rem (also the default), md is 45rem, and lg is 60rem.</prop>
|
|
9
|
+
<prop name="align" type="start | center | end | stretch"
|
|
10
|
+
>How items line up while they sit in a row: stretch (the default) makes them equally tall; start, center, and end align their tops, middles, or
|
|
11
|
+
bottoms.</prop>
|
|
6
12
|
</defs>
|
|
7
13
|
<div><slot></slot></div>
|
|
8
14
|
<style>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
<template component="ui-tabs" controller="./ui-tabs.js">
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="density" type="comfortable | compact" default="comfortable">Compact trades padding and type size for rows that fit more on screen.</prop>
|
|
4
|
-
<prop name="label" type="string" default="Tabs"
|
|
5
|
-
|
|
6
|
-
<prop name="
|
|
4
|
+
<prop name="label" type="string" default="Tabs"
|
|
5
|
+
>The tab list's accessible name, announced when focus enters the list. Name what the tabs switch between.</prop>
|
|
6
|
+
<prop name="value" type="string" default=""
|
|
7
|
+
>The id of the selected panel, initially or when set externally; empty selects the first panel. Choosing a tab updates it from there and reports a select
|
|
8
|
+
event. A panel without an id is given a generated one.</prop>
|
|
9
|
+
<prop name="orientation" type="horizontal | vertical" default="horizontal"
|
|
10
|
+
>horizontal puts the tabs in a row above the panels, moved between with the Left and Right arrow keys; vertical puts them in a column beside the panels,
|
|
11
|
+
moved between with Up and Down.</prop>
|
|
7
12
|
<prop name="stretch" type="boolean" default="false">Share the full width of the tab list equally between tabs instead of sizing each to its label.</prop>
|
|
8
13
|
<state name="internalValue" :value="''"></state>
|
|
9
14
|
<state name="tabs" type="list(object({ id: string, label: string }))" :value="[]"></state>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template component="ui-textarea" controller="./ui-textarea.js">
|
|
2
2
|
<defs>
|
|
3
|
-
<prop name="value" type="string"
|
|
3
|
+
<prop name="value" type="string"
|
|
4
|
+
>The textarea's text. Setting or changing it replaces the live text; between changes the user's typing stands, so follow input events to keep it in
|
|
5
|
+
step.</prop>
|
|
4
6
|
<prop name="disabled" type="boolean" default="false">Prevents editing and form submission.</prop>
|
|
5
7
|
<prop name="invalid" type="boolean" default="false">Exposes invalid state to assistive technology and styling.</prop>
|
|
6
8
|
<prop name="readonly" type="boolean" default="false">Allows selection without allowing edits.</prop>
|
|
@@ -2,9 +2,13 @@
|
|
|
2
2
|
<template component="ui-tree" controller="./ui-tree.js">
|
|
3
3
|
<defs>
|
|
4
4
|
<prop name="density" type="comfortable | compact" default="comfortable">Compact trades padding and type size for rows that fit more on screen.</prop>
|
|
5
|
-
<prop name="label" type="string" default="Tree">
|
|
6
|
-
<prop name="hoverExpandDelay" type="number" default="700"
|
|
7
|
-
|
|
5
|
+
<prop name="label" type="string" default="Tree">The tree's accessible name, announced when focus enters it. Name what the tree holds.</prop>
|
|
6
|
+
<prop name="hoverExpandDelay" type="number" default="700"
|
|
7
|
+
>How long, in milliseconds, a dragged item must hover over the middle of a collapsed branch before the branch opens to receive it. 0 opens it at
|
|
8
|
+
once.</prop>
|
|
9
|
+
<prop name="maxDepth" type="number" default="0"
|
|
10
|
+
>The deepest level a drag may produce, counting the top level as 1. A drop that would place the dragged item, or any item beneath it, deeper than this is
|
|
11
|
+
refused and reported as reorder-rejected. 0 means no limit.</prop>
|
|
8
12
|
<event
|
|
9
13
|
name="reorder"
|
|
10
14
|
type="object({ sourceId: string, targetId: string, position: before | inside | after, sourceType: string, targetType: string, sourceScope: string, targetScope: string, trigger: keyboard | pointer | programmatic })"
|