@lo-tek/interfaces 0.38.0 → 0.40.0
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 +123 -0
- package/README.md +1 -1
- package/agent/astro.md +9 -9
- package/agent/bundles.md +14 -12
- package/agent/datastar.md +65 -65
- package/agent/html.md +59 -59
- package/agent/react.md +16 -15
- package/agent/templates.md +65 -58
- package/core/lotek-core.wasm +0 -0
- package/core/lotek.wasm +0 -0
- package/dist/components/css/accordion/accordion.d.ts +1 -1
- package/dist/components/css/accordion/accordion.js +1 -1
- package/dist/components/css/alert/alert.d.ts +1 -1
- package/dist/components/css/alert/alert.js +1 -1
- package/dist/components/css/avatar/avatar.d.ts +1 -1
- package/dist/components/css/avatar/avatar.js +1 -1
- package/dist/components/css/badge/badge.d.ts +1 -1
- package/dist/components/css/badge/badge.js +1 -1
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/dist/components/css/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/components/css/card/card.d.ts +1 -1
- package/dist/components/css/card/card.js +1 -1
- package/dist/components/css/file-upload/file-upload.d.ts +1 -1
- package/dist/components/css/file-upload/file-upload.js +1 -1
- package/dist/components/css/icon/icon.d.ts +1 -1
- package/dist/components/css/icon/icon.js +1 -1
- package/dist/components/css/label/label.d.ts +1 -1
- package/dist/components/css/label/label.js +1 -1
- package/dist/components/css/link/link.d.ts +1 -1
- package/dist/components/css/link/link.js +1 -1
- package/dist/components/css/spinner/spinner.d.ts +7 -5
- package/dist/components/css/spinner/spinner.d.ts.map +1 -1
- package/dist/components/css/spinner/spinner.js +7 -5
- package/dist/components/css/spinner/spinner.js.map +1 -1
- package/dist/components/css/tag/tag.d.ts +1 -1
- package/dist/components/css/tag/tag.js +1 -1
- package/dist/components/css/toggle-group/toggle-group.d.ts +1 -1
- package/dist/components/css/toggle-group/toggle-group.js +1 -1
- package/dist/components/css/tooltip/tooltip.d.ts +2 -2
- package/dist/components/css/tooltip/tooltip.js +2 -2
- package/dist/components/frame/dialog/dialog.d.ts +11 -6
- package/dist/components/frame/dialog/dialog.d.ts.map +1 -1
- package/dist/components/frame/dialog/dialog.js +4 -4
- package/dist/components/frame/dialog/dialog.js.map +1 -1
- package/dist/components/frame/dialog/lt-dialog.d.ts +1 -1
- package/dist/components/frame/dialog/lt-dialog.js +7 -7
- package/dist/components/frame/error-summary/error-summary.d.ts +6 -2
- package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -1
- package/dist/components/frame/error-summary/error-summary.js +1 -1
- package/dist/components/frame/error-summary/error-summary.js.map +1 -1
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +1 -1
- package/dist/components/frame/error-summary/lt-error-summary.js +6 -6
- package/dist/components/frame/field/field-core.d.ts +4 -2
- package/dist/components/frame/field/field-core.d.ts.map +1 -1
- package/dist/components/frame/field/field-core.js.map +1 -1
- package/dist/components/frame/field/lt-field.d.ts +5 -4
- package/dist/components/frame/field/lt-field.d.ts.map +1 -1
- package/dist/components/frame/field/lt-field.js +5 -4
- package/dist/components/frame/field/lt-field.js.map +1 -1
- package/dist/components/frame/popover/lt-popover.d.ts +3 -3
- package/dist/components/frame/popover/lt-popover.js +3 -3
- package/dist/components/frame/popover/popover.d.ts +7 -3
- package/dist/components/frame/popover/popover.d.ts.map +1 -1
- package/dist/components/frame/popover/popover.js +2 -2
- package/dist/components/frame/popover/popover.js.map +1 -1
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +8 -8
- package/dist/components/frame/session-timeout/lt-session-timeout.js +7 -7
- package/dist/components/frame/session-timeout/session-timeout.d.ts +10 -5
- package/dist/components/frame/session-timeout/session-timeout.d.ts.map +1 -1
- package/dist/components/frame/session-timeout/session-timeout.js +4 -4
- package/dist/components/frame/session-timeout/session-timeout.js.map +1 -1
- package/dist/components/frame/suggestion/lt-suggestion.d.ts +12 -11
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -1
- package/dist/components/frame/suggestion/lt-suggestion.js +11 -10
- package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -1
- package/dist/components/frame/suggestion/suggestion.d.ts +3 -1
- package/dist/components/frame/suggestion/suggestion.d.ts.map +1 -1
- package/dist/components/frame/suggestion/suggestion.js.map +1 -1
- package/dist/components/frame/tabs/lt-tabs.d.ts +3 -3
- package/dist/components/frame/tabs/lt-tabs.js +5 -5
- package/dist/components/frame/tabs/lt-tabs.js.map +1 -1
- package/dist/components/frame/tabs/tabs.d.ts +8 -6
- package/dist/components/frame/tabs/tabs.d.ts.map +1 -1
- package/dist/components/frame/tabs/tabs.js +4 -4
- package/dist/components/frame/tabs/tabs.js.map +1 -1
- package/dist/components/host-element.d.ts +3 -0
- package/dist/components/host-element.d.ts.map +1 -1
- package/dist/components/host-element.js +90 -1
- package/dist/components/host-element.js.map +1 -1
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts +1 -1
- package/dist/components/standalone/connection-status/lt-connection-status.js +1 -1
- package/dist/components/standalone/toast/lt-toast.d.ts +1 -1
- package/dist/components/standalone/toast/lt-toast.js +1 -1
- package/dist/diagnostics/index.d.ts +2 -2
- package/dist/diagnostics/index.js +2 -2
- package/dist/dom.d.ts +2 -1
- package/dist/dom.d.ts.map +1 -1
- package/dist/dom.js +2 -1
- package/dist/dom.js.map +1 -1
- package/dist/lotek.css +20 -1
- package/dist/lt.d.ts +5 -5
- package/dist/lt.js +5 -5
- package/dist/react.d.ts.map +1 -1
- package/dist/vocabulary/elements.js +1 -1
- package/dist/vocabulary/elements.js.map +1 -1
- package/dist/vocabulary/types.d.ts +26 -0
- package/dist/vocabulary/types.d.ts.map +1 -1
- package/live-templates-kotlin.xml +64 -0
- package/live-templates.xml +23 -23
- package/manifest/manifest.json +407 -80
- package/manifest/manifest.schema.json +61 -7
- package/package.json +2 -1
- package/src/components/css/accordion/accordion.ts +1 -1
- package/src/components/css/alert/alert.ts +1 -1
- package/src/components/css/avatar/avatar.ts +1 -1
- package/src/components/css/badge/badge.ts +1 -1
- package/src/components/css/breadcrumbs/breadcrumbs.ts +1 -1
- package/src/components/css/card/card.ts +1 -1
- package/src/components/css/file-upload/file-upload.ts +1 -1
- package/src/components/css/icon/icon.ts +1 -1
- package/src/components/css/input/input.css +21 -0
- package/src/components/css/label/label.ts +1 -1
- package/src/components/css/link/link.ts +1 -1
- package/src/components/css/spinner/spinner.ts +8 -5
- package/src/components/css/tag/tag.ts +1 -1
- package/src/components/css/toggle-group/toggle-group.ts +1 -1
- package/src/components/css/tooltip/tooltip.ts +2 -2
- package/src/components/frame/dialog/dialog.ts +11 -6
- package/src/components/frame/dialog/lt-dialog.ts +7 -7
- package/src/components/frame/error-summary/error-summary.ts +6 -2
- package/src/components/frame/error-summary/lt-error-summary.ts +6 -6
- package/src/components/frame/field/field-core.ts +4 -2
- package/src/components/frame/field/lt-field.ts +5 -4
- package/src/components/frame/popover/lt-popover.ts +3 -3
- package/src/components/frame/popover/popover.ts +7 -3
- package/src/components/frame/session-timeout/lt-session-timeout.ts +8 -8
- package/src/components/frame/session-timeout/session-timeout.ts +10 -5
- package/src/components/frame/suggestion/lt-suggestion.ts +13 -12
- package/src/components/frame/suggestion/suggestion.css +1 -1
- package/src/components/frame/suggestion/suggestion.ts +3 -1
- package/src/components/frame/tabs/lt-tabs.ts +5 -5
- package/src/components/frame/tabs/tabs.css +1 -1
- package/src/components/frame/tabs/tabs.ts +8 -6
- package/src/components/host-element.ts +97 -1
- package/src/components/standalone/connection-status/lt-connection-status.ts +1 -1
- package/src/components/standalone/toast/lt-toast.ts +1 -1
- package/src/diagnostics/index.ts +2 -2
- package/src/dom.ts +2 -1
- package/src/lt.ts +5 -5
- package/src/tokens/boundary.css +4 -0
- package/src/vocabulary/elements.ts +1 -1
- package/src/vocabulary/types.ts +23 -0
- package/web-types.json +2 -2
package/manifest/manifest.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.40.0",
|
|
5
5
|
"textLanguage": "en",
|
|
6
6
|
"elements": {
|
|
7
7
|
"lt-field": {
|
|
8
8
|
"link": "https://lo-tek.sobernetics.no/components/field/",
|
|
9
|
-
"description": "Wires label, field, help text and error text together: sets `aria-describedby` and `aria-invalid` on the control and an id on the help text and the error text. Never writes an id on the control: the template writes `for` and `id`, or wraps the field in the label. The field is invalid when the error text is there without `hidden`. Exists for markup
|
|
9
|
+
"description": "Wires label, field, help text and error text together: sets `aria-describedby` and `aria-invalid` on the control and an id on the help text and the error text. Never writes an id on the control: the template writes `for` and `id`, or wraps the field in the label. The field is invalid when the error text is there without `hidden`. Exists for markup from code that cannot call a builder function. When it can, in TypeScript, Kotlin or Java, use `lt.field()` or `Lt.field()` instead.",
|
|
10
10
|
"attributes": {
|
|
11
11
|
"disabled": {
|
|
12
12
|
"type": "flag",
|
|
@@ -1528,7 +1528,7 @@
|
|
|
1528
1528
|
"danger"
|
|
1529
1529
|
],
|
|
1530
1530
|
"default": "neutral",
|
|
1531
|
-
"description": "Colour of the header. Default: none."
|
|
1531
|
+
"description": "Colour of the header. Default: `neutral`, which gives none."
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
1534
1534
|
},
|
|
@@ -1879,6 +1879,8 @@
|
|
|
1879
1879
|
"builders": [
|
|
1880
1880
|
{
|
|
1881
1881
|
"name": "accordion",
|
|
1882
|
+
"description": "The attributes for a panel that can be expanded.\n\nThe class goes on a `<details>` with a `<summary>` first. The browser handles opening, closing, the keyboard and screen readers announcing \"expanded\" or \"collapsed\". Build the same thing from buttons and `aria-expanded`, and all of that must be written again, and the browser's find in page no longer finds text inside a closed panel.",
|
|
1883
|
+
"example": "<details {...accordion()}>\n <summary>Who can take out a policy?</summary>\n <div class={accordion.content}>…</div>\n</details>",
|
|
1882
1884
|
"options": [
|
|
1883
1885
|
{
|
|
1884
1886
|
"name": "variant",
|
|
@@ -1890,7 +1892,8 @@
|
|
|
1890
1892
|
"plain"
|
|
1891
1893
|
]
|
|
1892
1894
|
},
|
|
1893
|
-
"description": "Its own frame, or just a line between the panels. Default: `default`."
|
|
1895
|
+
"description": "Its own frame, or just a line between the panels. Default: `default`.",
|
|
1896
|
+
"default": "default"
|
|
1894
1897
|
}
|
|
1895
1898
|
],
|
|
1896
1899
|
"returns": {
|
|
@@ -1913,10 +1916,16 @@
|
|
|
1913
1916
|
}
|
|
1914
1917
|
}
|
|
1915
1918
|
}
|
|
1916
|
-
}
|
|
1919
|
+
},
|
|
1920
|
+
"classes": {
|
|
1921
|
+
"content": "lt-accordion__content"
|
|
1922
|
+
},
|
|
1923
|
+
"docs": "https://lo-tek.sobernetics.no/components/accordion/"
|
|
1917
1924
|
},
|
|
1918
1925
|
{
|
|
1919
1926
|
"name": "alert",
|
|
1927
|
+
"description": "The attributes for a message about the whole page or a whole form.\n\nThe role is not set here, because it depends on when the message comes. If it is in the markup from the start, it should have no role. If it appears while the page is idle, it needs `role=\"status\"`, or `role=\"alert\"` if the user must stop.",
|
|
1928
|
+
"example": "<div {...alert({ color: \"warning\" })}>\n <p class={alert.title}>Your routes have not been saved</p>\n</div>",
|
|
1920
1929
|
"options": [
|
|
1921
1930
|
{
|
|
1922
1931
|
"name": "color",
|
|
@@ -1961,10 +1970,16 @@
|
|
|
1961
1970
|
}
|
|
1962
1971
|
}
|
|
1963
1972
|
}
|
|
1964
|
-
}
|
|
1973
|
+
},
|
|
1974
|
+
"classes": {
|
|
1975
|
+
"title": "lt-alert__title"
|
|
1976
|
+
},
|
|
1977
|
+
"docs": "https://lo-tek.sobernetics.no/components/alert/"
|
|
1965
1978
|
},
|
|
1966
1979
|
{
|
|
1967
1980
|
"name": "avatar",
|
|
1981
|
+
"description": "The attributes for a profile picture or initials.\n\nIf the name is already next to it, the picture is decoration: set `aria-hidden=\"true\"` on it, or the name is announced twice. If the picture stands alone, it must have a text that says who it is.",
|
|
1982
|
+
"example": "<span {...avatar({ size: \"small\" })} aria-hidden=\"true\">DP</span>",
|
|
1968
1983
|
"options": [
|
|
1969
1984
|
{
|
|
1970
1985
|
"name": "size",
|
|
@@ -1977,7 +1992,8 @@
|
|
|
1977
1992
|
"large"
|
|
1978
1993
|
]
|
|
1979
1994
|
},
|
|
1980
|
-
"description": "Size. Default: `medium`."
|
|
1995
|
+
"description": "Size. Default: `medium`.",
|
|
1996
|
+
"default": "medium"
|
|
1981
1997
|
},
|
|
1982
1998
|
{
|
|
1983
1999
|
"name": "variant",
|
|
@@ -1989,7 +2005,8 @@
|
|
|
1989
2005
|
"square"
|
|
1990
2006
|
]
|
|
1991
2007
|
},
|
|
1992
|
-
"description": "Round or rounded square. Default: `circle`."
|
|
2008
|
+
"description": "Round or rounded square. Default: `circle`.",
|
|
2009
|
+
"default": "circle"
|
|
1993
2010
|
}
|
|
1994
2011
|
],
|
|
1995
2012
|
"returns": {
|
|
@@ -2023,10 +2040,16 @@
|
|
|
2023
2040
|
}
|
|
2024
2041
|
}
|
|
2025
2042
|
}
|
|
2026
|
-
}
|
|
2043
|
+
},
|
|
2044
|
+
"classes": {
|
|
2045
|
+
"stack": "lt-avatar-stack"
|
|
2046
|
+
},
|
|
2047
|
+
"docs": "https://lo-tek.sobernetics.no/components/avatar/"
|
|
2027
2048
|
},
|
|
2028
2049
|
{
|
|
2029
2050
|
"name": "badge",
|
|
2051
|
+
"description": "The attributes for a status badge.",
|
|
2052
|
+
"example": "<span {...badge({ color: \"success\" })}>Paid</span>",
|
|
2030
2053
|
"options": [
|
|
2031
2054
|
{
|
|
2032
2055
|
"name": "color",
|
|
@@ -2041,7 +2064,8 @@
|
|
|
2041
2064
|
"neutral"
|
|
2042
2065
|
]
|
|
2043
2066
|
},
|
|
2044
|
-
"description": "What the status means. Default: `info`."
|
|
2067
|
+
"description": "What the status means. Default: `info`.",
|
|
2068
|
+
"default": "info"
|
|
2045
2069
|
}
|
|
2046
2070
|
],
|
|
2047
2071
|
"returns": {
|
|
@@ -2073,10 +2097,13 @@
|
|
|
2073
2097
|
}
|
|
2074
2098
|
}
|
|
2075
2099
|
}
|
|
2076
|
-
}
|
|
2100
|
+
},
|
|
2101
|
+
"docs": "https://lo-tek.sobernetics.no/components/badge/"
|
|
2077
2102
|
},
|
|
2078
2103
|
{
|
|
2079
2104
|
"name": "breadcrumbs",
|
|
2105
|
+
"description": "The attributes for a breadcrumb trail.\n\nThe class goes on an `<ol>` inside a `<nav>` with a text that says what the navigation is, for example `aria-label=\"You are here\"`. The order matters, so the list must be numbered even though the numbers are not shown.\n\nThe separator between the steps is added with CSS. Had it been in the markup, screen readers would have read \"slash\" between every step.",
|
|
2106
|
+
"example": "<nav aria-label=\"You are here\">\n <ol {...breadcrumbs()}>\n <li><a href=\"/\">Home</a></li>\n <li><a href=\"/claims\" aria-current=\"page\">My claims</a></li>\n </ol>\n</nav>",
|
|
2080
2107
|
"options": [],
|
|
2081
2108
|
"returns": {
|
|
2082
2109
|
"kind": "attributes"
|
|
@@ -2089,10 +2116,13 @@
|
|
|
2089
2116
|
},
|
|
2090
2117
|
"options": {}
|
|
2091
2118
|
}
|
|
2092
|
-
}
|
|
2119
|
+
},
|
|
2120
|
+
"docs": "https://lo-tek.sobernetics.no/components/breadcrumbs/"
|
|
2093
2121
|
},
|
|
2094
2122
|
{
|
|
2095
2123
|
"name": "button",
|
|
2124
|
+
"description": "The attributes for a button.",
|
|
2125
|
+
"example": "<button {...button({ variant: \"secondary\" })}>Save draft</button>",
|
|
2096
2126
|
"options": [
|
|
2097
2127
|
{
|
|
2098
2128
|
"name": "variant",
|
|
@@ -2106,7 +2136,8 @@
|
|
|
2106
2136
|
"danger"
|
|
2107
2137
|
]
|
|
2108
2138
|
},
|
|
2109
|
-
"description": "How weighty the action is. Default: `primary`."
|
|
2139
|
+
"description": "How weighty the action is. Default: `primary`.",
|
|
2140
|
+
"default": "primary"
|
|
2110
2141
|
}
|
|
2111
2142
|
],
|
|
2112
2143
|
"returns": {
|
|
@@ -2135,10 +2166,13 @@
|
|
|
2135
2166
|
}
|
|
2136
2167
|
}
|
|
2137
2168
|
}
|
|
2138
|
-
}
|
|
2169
|
+
},
|
|
2170
|
+
"docs": "https://lo-tek.sobernetics.no/components/button/"
|
|
2139
2171
|
},
|
|
2140
2172
|
{
|
|
2141
2173
|
"name": "card",
|
|
2174
|
+
"description": "The attributes for a card.\n\n`interactive` gives hover and a focus ring, but makes nothing clickable by itself. If the whole card should be pressable, the element must be an `<a>` or a `<button>`. A `<div>` with a click listener can neither be reached with the keyboard nor be announced as something to press.",
|
|
2175
|
+
"example": "<a {...card({ interactive: true })} href=\"/claims/AV-2079-0481\">…</a>",
|
|
2142
2176
|
"options": [
|
|
2143
2177
|
{
|
|
2144
2178
|
"name": "variant",
|
|
@@ -2150,7 +2184,8 @@
|
|
|
2150
2184
|
"filled"
|
|
2151
2185
|
]
|
|
2152
2186
|
},
|
|
2153
|
-
"description": "Surface or outline. Default: `outline`."
|
|
2187
|
+
"description": "Surface or outline. Default: `outline`.",
|
|
2188
|
+
"default": "outline"
|
|
2154
2189
|
},
|
|
2155
2190
|
{
|
|
2156
2191
|
"name": "interactive",
|
|
@@ -2189,10 +2224,16 @@
|
|
|
2189
2224
|
}
|
|
2190
2225
|
}
|
|
2191
2226
|
}
|
|
2192
|
-
}
|
|
2227
|
+
},
|
|
2228
|
+
"classes": {
|
|
2229
|
+
"title": "lt-card__title"
|
|
2230
|
+
},
|
|
2231
|
+
"docs": "https://lo-tek.sobernetics.no/components/card/"
|
|
2193
2232
|
},
|
|
2194
2233
|
{
|
|
2195
2234
|
"name": "checkbox",
|
|
2235
|
+
"description": "The attributes for a checkbox.\n\n`type` is set here, so the box cannot become a text field with a box's styling. The indeterminate state is set with `element.indeterminate = true` in JavaScript, not as an attribute, because HTML has no such attribute.",
|
|
2236
|
+
"example": "<input {...checkbox({ state: \"invalid\" })} />",
|
|
2196
2237
|
"options": [
|
|
2197
2238
|
{
|
|
2198
2239
|
"name": "state",
|
|
@@ -2205,7 +2246,8 @@
|
|
|
2205
2246
|
"success"
|
|
2206
2247
|
]
|
|
2207
2248
|
},
|
|
2208
|
-
"description": "Validation state. Default: `default`."
|
|
2249
|
+
"description": "Validation state. Default: `default`.",
|
|
2250
|
+
"default": "default"
|
|
2209
2251
|
}
|
|
2210
2252
|
],
|
|
2211
2253
|
"returns": {
|
|
@@ -2233,10 +2275,16 @@
|
|
|
2233
2275
|
}
|
|
2234
2276
|
}
|
|
2235
2277
|
}
|
|
2236
|
-
}
|
|
2278
|
+
},
|
|
2279
|
+
"classes": {
|
|
2280
|
+
"row": "lt-checkbox-row"
|
|
2281
|
+
},
|
|
2282
|
+
"docs": "https://lo-tek.sobernetics.no/components/checkbox/"
|
|
2237
2283
|
},
|
|
2238
2284
|
{
|
|
2239
2285
|
"name": "connectionStatus",
|
|
2286
|
+
"description": "The attributes for the bar that says the connection is lost.\n\nBy definition the server cannot tell you it is unreachable. When it is down, nothing comes from it to render. So the component creates all the content itself, and `data-ignore-morph` stops a later patch from tearing it away the moment the connection is back. The host is the live region, `role=\"status\"` with `aria-live=\"polite\"`, so the region exists before the bar and its text arrive.",
|
|
2287
|
+
"example": "<lt-connection-status {...lt.connectionStatus()} />",
|
|
2240
2288
|
"options": [
|
|
2241
2289
|
{
|
|
2242
2290
|
"name": "offlineText",
|
|
@@ -2288,10 +2336,13 @@
|
|
|
2288
2336
|
}
|
|
2289
2337
|
}
|
|
2290
2338
|
}
|
|
2291
|
-
}
|
|
2339
|
+
},
|
|
2340
|
+
"docs": "https://lo-tek.sobernetics.no/components/connection-status/"
|
|
2292
2341
|
},
|
|
2293
2342
|
{
|
|
2294
2343
|
"name": "dialog",
|
|
2344
|
+
"description": "The attributes for a dialog.\n\nOpening a dialog is a call, not an attribute: only `showModal()` moves focus in, keeps focus inside the dialog, closes on Escape and makes the rest of the page inert. A `<dialog open>` in the markup is a box on the page.\n\nThat is a problem for a server that only sends HTML, since it cannot call anything in the browser. So the server says the dialog is open, and `<lt-dialog>` makes the call.\n\nThe two `open`s are not the same, and it is worth keeping them apart:\n\n- `open` on the **host** is the server saying the dialog should be shown. It is not preserved. If it were, the server could never open the dialog again after the user had closed it once. If the server sends the region again with `open` still set, the dialog opens again. For a dismissal to last, the app must tell the server.\n- `open` on the **`<dialog>`** is set by the browser itself when `showModal()` is called. It is not in the server's HTML, so a morph removes it, and the component puts it back. The server also writes it when it knows the dialog should be shown: without JavaScript a `<dialog>` without `open` is hidden, and its content does not exist for the reader. With the attribute it stands as a box on the page until the component turns it into a modal.",
|
|
2345
|
+
"example": "const box = lt.dialog({ titleId: \"cancel-title\", open: true })\n\n<lt-dialog {...box.host}>\n <dialog {...box.dialog}>\n <h2 {...box.title}>Cancel job 222-0481?</h2>\n <div {...box.body}>The crew keeps the advance. This cannot be undone.</div>\n <form method=\"dialog\" {...box.footer}>\n <button class=\"lt-button\" value=\"keep\">Keep the job</button>\n </form>\n </dialog>\n</lt-dialog>",
|
|
2295
2346
|
"options": [
|
|
2296
2347
|
{
|
|
2297
2348
|
"name": "titleId",
|
|
@@ -2299,7 +2350,7 @@
|
|
|
2299
2350
|
"type": {
|
|
2300
2351
|
"kind": "text"
|
|
2301
2352
|
},
|
|
2302
|
-
"description": "Id of the heading. The dialog takes its name from it with `aria-labelledby`."
|
|
2353
|
+
"description": "Id of the heading. The dialog takes its name from it with `aria-labelledby`. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
2303
2354
|
},
|
|
2304
2355
|
{
|
|
2305
2356
|
"name": "open",
|
|
@@ -2323,7 +2374,8 @@
|
|
|
2323
2374
|
"danger"
|
|
2324
2375
|
]
|
|
2325
2376
|
},
|
|
2326
|
-
"description": "Colour of the header. Default: none."
|
|
2377
|
+
"description": "Colour of the header. Default: `neutral`, which gives none.",
|
|
2378
|
+
"default": "neutral"
|
|
2327
2379
|
}
|
|
2328
2380
|
],
|
|
2329
2381
|
"returns": {
|
|
@@ -2531,10 +2583,27 @@
|
|
|
2531
2583
|
}
|
|
2532
2584
|
}
|
|
2533
2585
|
}
|
|
2586
|
+
},
|
|
2587
|
+
"docs": "https://lo-tek.sobernetics.no/components/dialog/",
|
|
2588
|
+
"parts": {
|
|
2589
|
+
"dialog": {
|
|
2590
|
+
"element": "lt-dialog",
|
|
2591
|
+
"part": "dialog"
|
|
2592
|
+
},
|
|
2593
|
+
"title": {
|
|
2594
|
+
"element": "lt-dialog",
|
|
2595
|
+
"part": "title"
|
|
2596
|
+
},
|
|
2597
|
+
"body": {
|
|
2598
|
+
"element": "lt-dialog",
|
|
2599
|
+
"part": "body"
|
|
2600
|
+
}
|
|
2534
2601
|
}
|
|
2535
2602
|
},
|
|
2536
2603
|
{
|
|
2537
2604
|
"name": "divider",
|
|
2605
|
+
"description": "The attributes for a divider.\n\nThe class goes on an `<hr>`. If the line separates two parts of the content, it is information screen readers should get. If it is only decoration between two boxes that are already apart, set `aria-hidden=\"true\"` on it.",
|
|
2606
|
+
"example": "<hr {...divider({ variant: \"subtle\" })} />",
|
|
2538
2607
|
"options": [
|
|
2539
2608
|
{
|
|
2540
2609
|
"name": "variant",
|
|
@@ -2547,7 +2616,8 @@
|
|
|
2547
2616
|
"strong"
|
|
2548
2617
|
]
|
|
2549
2618
|
},
|
|
2550
|
-
"description": "How visible the line is. Default: `default`."
|
|
2619
|
+
"description": "How visible the line is. Default: `default`.",
|
|
2620
|
+
"default": "default"
|
|
2551
2621
|
}
|
|
2552
2622
|
],
|
|
2553
2623
|
"returns": {
|
|
@@ -2573,10 +2643,13 @@
|
|
|
2573
2643
|
}
|
|
2574
2644
|
}
|
|
2575
2645
|
}
|
|
2576
|
-
}
|
|
2646
|
+
},
|
|
2647
|
+
"docs": "https://lo-tek.sobernetics.no/components/divider/"
|
|
2577
2648
|
},
|
|
2578
2649
|
{
|
|
2579
2650
|
"name": "errorSummary",
|
|
2651
|
+
"description": "The attributes for an error summary.\n\nThe server writes the whole box, including the heading and the list. `<lt-error-summary>` only moves focus and handles clicks on the links. The component used to create the heading itself, and then it disappeared on every morph in Datastar.",
|
|
2652
|
+
"example": "const summary = lt.errorSummary({\n count: errors.length,\n id: \"errors\",\n titleId: \"errors-title\",\n})\n\n<lt-error-summary {...summary.host}>\n <h2 {...summary.title}>You need to fix 2 errors</h2>\n <ul><li><a href=\"#fixer\">The fixer's address is missing an @</a></li></ul>\n</lt-error-summary>",
|
|
2580
2653
|
"options": [
|
|
2581
2654
|
{
|
|
2582
2655
|
"name": "count",
|
|
@@ -2592,7 +2665,7 @@
|
|
|
2592
2665
|
"type": {
|
|
2593
2666
|
"kind": "text"
|
|
2594
2667
|
},
|
|
2595
|
-
"description": "The id of the box, so the form can move focus here after submission."
|
|
2668
|
+
"description": "The id of the box, so the form can move focus here after submission. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
2596
2669
|
},
|
|
2597
2670
|
{
|
|
2598
2671
|
"name": "titleId",
|
|
@@ -2613,10 +2686,19 @@
|
|
|
2613
2686
|
"kind": "attributes"
|
|
2614
2687
|
}
|
|
2615
2688
|
}
|
|
2689
|
+
},
|
|
2690
|
+
"docs": "https://lo-tek.sobernetics.no/components/error-summary/",
|
|
2691
|
+
"parts": {
|
|
2692
|
+
"title": {
|
|
2693
|
+
"element": "lt-error-summary",
|
|
2694
|
+
"part": "title"
|
|
2695
|
+
}
|
|
2616
2696
|
}
|
|
2617
2697
|
},
|
|
2618
2698
|
{
|
|
2619
2699
|
"name": "errorText",
|
|
2700
|
+
"description": "The attributes for an error text below a field.",
|
|
2701
|
+
"example": "<p {...errorText({ variant: \"warning\" })}>…</p>",
|
|
2620
2702
|
"options": [
|
|
2621
2703
|
{
|
|
2622
2704
|
"name": "variant",
|
|
@@ -2628,7 +2710,8 @@
|
|
|
2628
2710
|
"warning"
|
|
2629
2711
|
]
|
|
2630
2712
|
},
|
|
2631
|
-
"description": "Whether the error stops submission or only warns. Default: `error`."
|
|
2713
|
+
"description": "Whether the error stops submission or only warns. Default: `error`.",
|
|
2714
|
+
"default": "error"
|
|
2632
2715
|
}
|
|
2633
2716
|
],
|
|
2634
2717
|
"returns": {
|
|
@@ -2651,10 +2734,13 @@
|
|
|
2651
2734
|
}
|
|
2652
2735
|
}
|
|
2653
2736
|
}
|
|
2654
|
-
}
|
|
2737
|
+
},
|
|
2738
|
+
"docs": "https://lo-tek.sobernetics.no/components/error-text/"
|
|
2655
2739
|
},
|
|
2656
2740
|
{
|
|
2657
2741
|
"name": "field",
|
|
2742
|
+
"description": "Connects the label, field, help text and error text.\n\nThe same calculation `<lt-field>` does in the browser, but as data, for the code that renders the markup. Then no web component is needed.",
|
|
2743
|
+
"example": "const field = lt.field({ id: \"fixer\", required: \"text\", help: true, error: true, invalid })\n\n<label {...field.label}>Fixer's address</label>\n<input {...lt.input({ type: \"email\", state: field.state })} {...field.control} />\n<p {...lt.helpText()} {...field.help}>The board writes to the fixer, never to the crew.</p>\n<p {...lt.errorText()} {...field.error}>Enter a valid address.</p>",
|
|
2658
2744
|
"options": [
|
|
2659
2745
|
{
|
|
2660
2746
|
"name": "id",
|
|
@@ -2662,7 +2748,7 @@
|
|
|
2662
2748
|
"type": {
|
|
2663
2749
|
"kind": "text"
|
|
2664
2750
|
},
|
|
2665
|
-
"description": "The id of the control. Required."
|
|
2751
|
+
"description": "The id of the control. Required. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
2666
2752
|
},
|
|
2667
2753
|
{
|
|
2668
2754
|
"name": "help",
|
|
@@ -2765,10 +2851,31 @@
|
|
|
2765
2851
|
]
|
|
2766
2852
|
}
|
|
2767
2853
|
}
|
|
2854
|
+
},
|
|
2855
|
+
"docs": "https://lo-tek.sobernetics.no/components/field/",
|
|
2856
|
+
"parts": {
|
|
2857
|
+
"label": {
|
|
2858
|
+
"element": "lt-field",
|
|
2859
|
+
"part": "label"
|
|
2860
|
+
},
|
|
2861
|
+
"control": {
|
|
2862
|
+
"element": "lt-field",
|
|
2863
|
+
"part": "control"
|
|
2864
|
+
},
|
|
2865
|
+
"help": {
|
|
2866
|
+
"element": "lt-field",
|
|
2867
|
+
"part": "help"
|
|
2868
|
+
},
|
|
2869
|
+
"error": {
|
|
2870
|
+
"element": "lt-field",
|
|
2871
|
+
"part": "error"
|
|
2872
|
+
}
|
|
2768
2873
|
}
|
|
2769
2874
|
},
|
|
2770
2875
|
{
|
|
2771
2876
|
"name": "fieldset",
|
|
2877
|
+
"description": "The attributes for a group of controls that belong together.\n\n`<fieldset>` with `<legend>` is the one way to give a set of radio buttons or checkboxes a shared label that screen readers actually announce before each choice.",
|
|
2878
|
+
"example": "<fieldset {...fieldset({ state: \"invalid\" })}>\n <legend {...legend({ required: \"symbol\" })}>Delivery method</legend>\n</fieldset>",
|
|
2772
2879
|
"options": [
|
|
2773
2880
|
{
|
|
2774
2881
|
"name": "state",
|
|
@@ -2781,7 +2888,8 @@
|
|
|
2781
2888
|
"success"
|
|
2782
2889
|
]
|
|
2783
2890
|
},
|
|
2784
|
-
"description": "Validation state for the whole group. Default: `default`."
|
|
2891
|
+
"description": "Validation state for the whole group. Default: `default`.",
|
|
2892
|
+
"default": "default"
|
|
2785
2893
|
},
|
|
2786
2894
|
{
|
|
2787
2895
|
"name": "disabled",
|
|
@@ -2823,10 +2931,13 @@
|
|
|
2823
2931
|
}
|
|
2824
2932
|
}
|
|
2825
2933
|
}
|
|
2826
|
-
}
|
|
2934
|
+
},
|
|
2935
|
+
"docs": "https://lo-tek.sobernetics.no/components/fieldset/"
|
|
2827
2936
|
},
|
|
2828
2937
|
{
|
|
2829
2938
|
"name": "fileUpload",
|
|
2939
|
+
"description": "The attributes for a file upload field.\n\nThe field is a plain `<input type=\"file\">`. The button inside is the browser's own, and its text comes from the operating system's language. It cannot be translated, so the label above the field must say what to upload.\n\n`accept` is a help in the file picker, not a barrier. The user can choose \"all files\", so the type must be checked on the server anyway.",
|
|
2940
|
+
"example": "<input {...fileUpload({ multiple: true, accept: \".bin\" })} />",
|
|
2830
2941
|
"options": [
|
|
2831
2942
|
{
|
|
2832
2943
|
"name": "state",
|
|
@@ -2839,7 +2950,8 @@
|
|
|
2839
2950
|
"success"
|
|
2840
2951
|
]
|
|
2841
2952
|
},
|
|
2842
|
-
"description": "Validation state. Default: `default`."
|
|
2953
|
+
"description": "Validation state. Default: `default`.",
|
|
2954
|
+
"default": "default"
|
|
2843
2955
|
},
|
|
2844
2956
|
{
|
|
2845
2957
|
"name": "multiple",
|
|
@@ -2900,10 +3012,16 @@
|
|
|
2900
3012
|
}
|
|
2901
3013
|
}
|
|
2902
3014
|
}
|
|
2903
|
-
}
|
|
3015
|
+
},
|
|
3016
|
+
"classes": {
|
|
3017
|
+
"list": "lt-file-upload-list"
|
|
3018
|
+
},
|
|
3019
|
+
"docs": "https://lo-tek.sobernetics.no/components/file-upload/"
|
|
2904
3020
|
},
|
|
2905
3021
|
{
|
|
2906
3022
|
"name": "heading",
|
|
3023
|
+
"description": "The attributes for a heading.\n\nSize and level are two different things. The level is `<h1>` to `<h6>` and sets the structure screen readers navigate by; `size` only sets how large the text looks. An `<h2>` that should look small is correct; an `<h4>` chosen because it was small enough skips a level in the structure.",
|
|
3024
|
+
"example": "<h2 {...heading({ size: \"m\" })}>Attachments</h2>",
|
|
2907
3025
|
"options": [
|
|
2908
3026
|
{
|
|
2909
3027
|
"name": "size",
|
|
@@ -2919,7 +3037,8 @@
|
|
|
2919
3037
|
"mega"
|
|
2920
3038
|
]
|
|
2921
3039
|
},
|
|
2922
|
-
"description": "Visual size. Default: `l`."
|
|
3040
|
+
"description": "Visual size. Default: `l`.",
|
|
3041
|
+
"default": "l"
|
|
2923
3042
|
}
|
|
2924
3043
|
],
|
|
2925
3044
|
"returns": {
|
|
@@ -2954,10 +3073,13 @@
|
|
|
2954
3073
|
}
|
|
2955
3074
|
}
|
|
2956
3075
|
}
|
|
2957
|
-
}
|
|
3076
|
+
},
|
|
3077
|
+
"docs": "https://lo-tek.sobernetics.no/components/heading/"
|
|
2958
3078
|
},
|
|
2959
3079
|
{
|
|
2960
3080
|
"name": "helpText",
|
|
3081
|
+
"description": "The attributes for help text below a field.",
|
|
3082
|
+
"example": "<p {...helpText({ variant: \"warning\" })}>…</p>",
|
|
2961
3083
|
"options": [
|
|
2962
3084
|
{
|
|
2963
3085
|
"name": "variant",
|
|
@@ -2971,7 +3093,8 @@
|
|
|
2971
3093
|
"warning"
|
|
2972
3094
|
]
|
|
2973
3095
|
},
|
|
2974
|
-
"description": "How loudly the text should speak. Default: `muted`."
|
|
3096
|
+
"description": "How loudly the text should speak. Default: `muted`.",
|
|
3097
|
+
"default": "muted"
|
|
2975
3098
|
}
|
|
2976
3099
|
],
|
|
2977
3100
|
"returns": {
|
|
@@ -3000,10 +3123,13 @@
|
|
|
3000
3123
|
}
|
|
3001
3124
|
}
|
|
3002
3125
|
}
|
|
3003
|
-
}
|
|
3126
|
+
},
|
|
3127
|
+
"docs": "https://lo-tek.sobernetics.no/components/help-text/"
|
|
3004
3128
|
},
|
|
3005
3129
|
{
|
|
3006
3130
|
"name": "icon",
|
|
3131
|
+
"description": "The attributes for an icon. The class goes on an `<svg>`, and the svg comes from the app's icon set: LO-TEK ships no icons.\n\nThe icon is as large as the text around it, and is drawn in the colour the svg says, which should be `currentColor`. Without `label` it is decoration, and if it stands alone in a button, the button must get its name somewhere else: `aria-label` on the button, or a text with `lt-sr-only`. The core reports a button that lacks one.",
|
|
3132
|
+
"example": "<button {...button()} aria-label=\"Delete ticket #0331\">\n <svg {...icon()} viewBox=\"0 0 24 24\">…</svg>\n</button>",
|
|
3007
3133
|
"options": [
|
|
3008
3134
|
{
|
|
3009
3135
|
"name": "label",
|
|
@@ -3036,10 +3162,13 @@
|
|
|
3036
3162
|
}
|
|
3037
3163
|
}
|
|
3038
3164
|
}
|
|
3039
|
-
}
|
|
3165
|
+
},
|
|
3166
|
+
"docs": "https://lo-tek.sobernetics.no/components/icon/"
|
|
3040
3167
|
},
|
|
3041
3168
|
{
|
|
3042
3169
|
"name": "input",
|
|
3170
|
+
"description": "The attributes for a text field.\n\n`type` sets both the HTML type and the icon variant, so the two cannot get out of step. Write them by hand, and it is easy to get a date field that looks like a date field, but where nothing happens when the user presses the icon.",
|
|
3171
|
+
"example": "<input {...input({ type: \"date\", state: \"invalid\" })} />",
|
|
3043
3172
|
"options": [
|
|
3044
3173
|
{
|
|
3045
3174
|
"name": "type",
|
|
@@ -3061,7 +3190,8 @@
|
|
|
3061
3190
|
"time"
|
|
3062
3191
|
]
|
|
3063
3192
|
},
|
|
3064
|
-
"description": "The HTML type. Set as `type`, and decides the icon. Default: `text`."
|
|
3193
|
+
"description": "The HTML type. Set as `type`, and decides the icon. Default: `text`.",
|
|
3194
|
+
"default": "text"
|
|
3065
3195
|
},
|
|
3066
3196
|
{
|
|
3067
3197
|
"name": "state",
|
|
@@ -3074,7 +3204,8 @@
|
|
|
3074
3204
|
"success"
|
|
3075
3205
|
]
|
|
3076
3206
|
},
|
|
3077
|
-
"description": "Validation state. Default: `default`."
|
|
3207
|
+
"description": "Validation state. Default: `default`.",
|
|
3208
|
+
"default": "default"
|
|
3078
3209
|
}
|
|
3079
3210
|
],
|
|
3080
3211
|
"returns": {
|
|
@@ -3143,10 +3274,13 @@
|
|
|
3143
3274
|
}
|
|
3144
3275
|
}
|
|
3145
3276
|
}
|
|
3146
|
-
}
|
|
3277
|
+
},
|
|
3278
|
+
"docs": "https://lo-tek.sobernetics.no/components/input/"
|
|
3147
3279
|
},
|
|
3148
3280
|
{
|
|
3149
3281
|
"name": "label",
|
|
3282
|
+
"description": "The attributes for a label.\n\nThe marker is only visual, so set `required` on the field itself as well, or the screen reader is not told that it must be filled in.",
|
|
3283
|
+
"example": "<label {...label({ required: \"symbol\" })} htmlFor=\"fixer\">Fixer's address</label>",
|
|
3150
3284
|
"options": [
|
|
3151
3285
|
{
|
|
3152
3286
|
"name": "required",
|
|
@@ -3179,10 +3313,12 @@
|
|
|
3179
3313
|
],
|
|
3180
3314
|
"returns": {
|
|
3181
3315
|
"kind": "attributes"
|
|
3182
|
-
}
|
|
3316
|
+
},
|
|
3317
|
+
"docs": "https://lo-tek.sobernetics.no/components/label/"
|
|
3183
3318
|
},
|
|
3184
3319
|
{
|
|
3185
3320
|
"name": "legend",
|
|
3321
|
+
"description": "The attributes for the label of a group.\n\nThe same marker as `label()`, but on a `<legend>`.",
|
|
3186
3322
|
"options": [
|
|
3187
3323
|
{
|
|
3188
3324
|
"name": "required",
|
|
@@ -3215,10 +3351,13 @@
|
|
|
3215
3351
|
],
|
|
3216
3352
|
"returns": {
|
|
3217
3353
|
"kind": "attributes"
|
|
3218
|
-
}
|
|
3354
|
+
},
|
|
3355
|
+
"docs": "https://lo-tek.sobernetics.no/components/fieldset/"
|
|
3219
3356
|
},
|
|
3220
3357
|
{
|
|
3221
3358
|
"name": "link",
|
|
3359
|
+
"description": "The attributes for a link.\n\nAn `<a>` without `href` is no link to a screen reader and is not in the tab order. `role` and `tabindex` give it both back while it is disabled.",
|
|
3360
|
+
"example": "<a {...link()} href=\"/small-print\">Read the small print</a>\n<a {...link({ disabled: true })}>See annual statement</a>",
|
|
3222
3361
|
"options": [
|
|
3223
3362
|
{
|
|
3224
3363
|
"name": "disabled",
|
|
@@ -3251,10 +3390,13 @@
|
|
|
3251
3390
|
}
|
|
3252
3391
|
}
|
|
3253
3392
|
}
|
|
3254
|
-
}
|
|
3393
|
+
},
|
|
3394
|
+
"docs": "https://lo-tek.sobernetics.no/components/link/"
|
|
3255
3395
|
},
|
|
3256
3396
|
{
|
|
3257
3397
|
"name": "list",
|
|
3398
|
+
"description": "The attributes for a list.\n\nThe class goes on `<ul>` or `<ol>`. `plain` and `divided` remove the bullets visually, but the list stays a list, so the screen reader still says how many items it has. That is why the variant exists: without it people would use `<div>` to get rid of the bullets. The exception is Safari, where a `<ul>` without visible bullets can need `role=\"list\"`. See the component page.",
|
|
3399
|
+
"example": "<ul {...list({ variant: \"divided\" })}>…</ul>",
|
|
3258
3400
|
"options": [
|
|
3259
3401
|
{
|
|
3260
3402
|
"name": "variant",
|
|
@@ -3267,7 +3409,8 @@
|
|
|
3267
3409
|
"divided"
|
|
3268
3410
|
]
|
|
3269
3411
|
},
|
|
3270
|
-
"description": "Bullets, plain rows, or rows with a line between them. Default: `default`."
|
|
3412
|
+
"description": "Bullets, plain rows, or rows with a line between them. Default: `default`.",
|
|
3413
|
+
"default": "default"
|
|
3271
3414
|
}
|
|
3272
3415
|
],
|
|
3273
3416
|
"returns": {
|
|
@@ -3293,10 +3436,13 @@
|
|
|
3293
3436
|
}
|
|
3294
3437
|
}
|
|
3295
3438
|
}
|
|
3296
|
-
}
|
|
3439
|
+
},
|
|
3440
|
+
"docs": "https://lo-tek.sobernetics.no/components/list/"
|
|
3297
3441
|
},
|
|
3298
3442
|
{
|
|
3299
3443
|
"name": "pagination",
|
|
3444
|
+
"description": "The attributes for pagination.\n\nThe class goes on a `<ul>` inside a `<nav aria-label=\"Pagination\">`. Each page is a link with its own address, not a button: the user can then open page three in a new tab, and come back with the back button.\n\nThe current page is marked with `aria-current=\"page\"`, which both gives the colour and is what the screen reader announces.",
|
|
3445
|
+
"example": "<nav aria-label=\"Pagination\">\n <ul {...pagination()}>…</ul>\n</nav>",
|
|
3300
3446
|
"options": [],
|
|
3301
3447
|
"returns": {
|
|
3302
3448
|
"kind": "attributes"
|
|
@@ -3309,10 +3455,16 @@
|
|
|
3309
3455
|
},
|
|
3310
3456
|
"options": {}
|
|
3311
3457
|
}
|
|
3312
|
-
}
|
|
3458
|
+
},
|
|
3459
|
+
"classes": {
|
|
3460
|
+
"gap": "lt-pagination__gap"
|
|
3461
|
+
},
|
|
3462
|
+
"docs": "https://lo-tek.sobernetics.no/components/pagination/"
|
|
3313
3463
|
},
|
|
3314
3464
|
{
|
|
3315
3465
|
"name": "paragraph",
|
|
3466
|
+
"description": "The attributes for a paragraph.\n\nThe width is limited to 70 characters. Longer lines make it hard to find the start of the next one, and that is the most common reason a text is hard to read even when the type is large enough.",
|
|
3467
|
+
"example": "<p {...paragraph({ variant: \"lead\" })}>A short summary of what the page is about.</p>",
|
|
3316
3468
|
"options": [
|
|
3317
3469
|
{
|
|
3318
3470
|
"name": "size",
|
|
@@ -3325,7 +3477,8 @@
|
|
|
3325
3477
|
"large"
|
|
3326
3478
|
]
|
|
3327
3479
|
},
|
|
3328
|
-
"description": "Text size. Default: `medium`."
|
|
3480
|
+
"description": "Text size. Default: `medium`.",
|
|
3481
|
+
"default": "medium"
|
|
3329
3482
|
},
|
|
3330
3483
|
{
|
|
3331
3484
|
"name": "variant",
|
|
@@ -3337,7 +3490,8 @@
|
|
|
3337
3490
|
"lead"
|
|
3338
3491
|
]
|
|
3339
3492
|
},
|
|
3340
|
-
"description": "`lead` is the introduction right below the heading. Default: `default`."
|
|
3493
|
+
"description": "`lead` is the introduction right below the heading. Default: `default`.",
|
|
3494
|
+
"default": "default"
|
|
3341
3495
|
}
|
|
3342
3496
|
],
|
|
3343
3497
|
"returns": {
|
|
@@ -3371,10 +3525,13 @@
|
|
|
3371
3525
|
}
|
|
3372
3526
|
}
|
|
3373
3527
|
}
|
|
3374
|
-
}
|
|
3528
|
+
},
|
|
3529
|
+
"docs": "https://lo-tek.sobernetics.no/components/paragraph/"
|
|
3375
3530
|
},
|
|
3376
3531
|
{
|
|
3377
3532
|
"name": "popover",
|
|
3533
|
+
"description": "The attributes for a popover.\n\nThe server writes both the button and the panel, with the wiring between them. `<lt-popover>` works out the position and closes on a click outside.",
|
|
3534
|
+
"example": "const box = lt.popover({ id: \"help\" })\n\n<lt-popover>\n <button {...box.trigger}>What is the late fee?</button>\n <div {...box.panel}>EB 100 a night past the return date. No exceptions.</div>\n</lt-popover>",
|
|
3378
3535
|
"options": [
|
|
3379
3536
|
{
|
|
3380
3537
|
"name": "id",
|
|
@@ -3382,7 +3539,7 @@
|
|
|
3382
3539
|
"type": {
|
|
3383
3540
|
"kind": "text"
|
|
3384
3541
|
},
|
|
3385
|
-
"description": "Id of the panel. Connects the button to the panel with `aria-controls`."
|
|
3542
|
+
"description": "Id of the panel. Connects the button to the panel with `aria-controls`. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
3386
3543
|
},
|
|
3387
3544
|
{
|
|
3388
3545
|
"name": "open",
|
|
@@ -3404,7 +3561,8 @@
|
|
|
3404
3561
|
"top-end"
|
|
3405
3562
|
]
|
|
3406
3563
|
},
|
|
3407
|
-
"description": "Which edge the panel hangs from. Default: `bottom-start`."
|
|
3564
|
+
"description": "Which edge the panel hangs from. Default: `bottom-start`.",
|
|
3565
|
+
"default": "bottom-start"
|
|
3408
3566
|
}
|
|
3409
3567
|
],
|
|
3410
3568
|
"returns": {
|
|
@@ -3500,10 +3658,23 @@
|
|
|
3500
3658
|
}
|
|
3501
3659
|
}
|
|
3502
3660
|
}
|
|
3661
|
+
},
|
|
3662
|
+
"docs": "https://lo-tek.sobernetics.no/components/popover/",
|
|
3663
|
+
"parts": {
|
|
3664
|
+
"trigger": {
|
|
3665
|
+
"element": "lt-popover",
|
|
3666
|
+
"part": "trigger"
|
|
3667
|
+
},
|
|
3668
|
+
"panel": {
|
|
3669
|
+
"element": "lt-popover",
|
|
3670
|
+
"part": "panel"
|
|
3671
|
+
}
|
|
3503
3672
|
}
|
|
3504
3673
|
},
|
|
3505
3674
|
{
|
|
3506
3675
|
"name": "progress",
|
|
3676
|
+
"description": "The attributes for a progress bar on a `<progress>`.\n\nThe element has the semantics built in: the browser exposes it as `role=\"progressbar\"` and announces how far it has come. You need neither a role, `aria-valuenow` nor `aria-valuemax`.\n\nLeave out `value`, and the bar becomes indeterminate: \"something is going on, we do not know for how long\". That is the same as `lt.spinner()` says, so choose one of them.\n\n`max` defaults to 100 and is always written out, against the rule that a default gives no attribute. The reason is that the rule is about appearance, where the CSS already has the answer. `max` is semantics, and HTML's own default is `1`: a `<progress value=\"40\">` without `max` shows a full bar, without anything saying so.",
|
|
3677
|
+
"example": "<progress {...progress({ value: 3, max: 7, label: \"Step 3 of 7\" })} />",
|
|
3507
3678
|
"options": [
|
|
3508
3679
|
{
|
|
3509
3680
|
"name": "value",
|
|
@@ -3607,10 +3778,13 @@
|
|
|
3607
3778
|
}
|
|
3608
3779
|
}
|
|
3609
3780
|
}
|
|
3610
|
-
}
|
|
3781
|
+
},
|
|
3782
|
+
"docs": "https://lo-tek.sobernetics.no/components/progress/"
|
|
3611
3783
|
},
|
|
3612
3784
|
{
|
|
3613
3785
|
"name": "radio",
|
|
3786
|
+
"description": "The attributes for a radio button.\n\nAll the buttons in a group must have the same `name`. That connection is what lets only one be selected, and lets the arrow keys move between them. You set `name` yourself, since only you know what the group is called.",
|
|
3787
|
+
"example": "<input {...radio()} name=\"delivery\" value=\"post\" />",
|
|
3614
3788
|
"options": [
|
|
3615
3789
|
{
|
|
3616
3790
|
"name": "state",
|
|
@@ -3623,7 +3797,8 @@
|
|
|
3623
3797
|
"success"
|
|
3624
3798
|
]
|
|
3625
3799
|
},
|
|
3626
|
-
"description": "Validation state. Default: `default`."
|
|
3800
|
+
"description": "Validation state. Default: `default`.",
|
|
3801
|
+
"default": "default"
|
|
3627
3802
|
}
|
|
3628
3803
|
],
|
|
3629
3804
|
"returns": {
|
|
@@ -3651,10 +3826,16 @@
|
|
|
3651
3826
|
}
|
|
3652
3827
|
}
|
|
3653
3828
|
}
|
|
3654
|
-
}
|
|
3829
|
+
},
|
|
3830
|
+
"classes": {
|
|
3831
|
+
"row": "lt-radio-row"
|
|
3832
|
+
},
|
|
3833
|
+
"docs": "https://lo-tek.sobernetics.no/components/radio/"
|
|
3655
3834
|
},
|
|
3656
3835
|
{
|
|
3657
3836
|
"name": "search",
|
|
3837
|
+
"description": "The attributes for a search field.\n\nThe field is an `lt-input` with room for the magnifying glass, so both classes are set. `type=\"search\"` gives the browser's own cross for clearing the field, and on mobile a keyboard with \"Search\" instead of \"Enter\".",
|
|
3838
|
+
"example": "<input {...search()} name=\"q\" />",
|
|
3658
3839
|
"options": [
|
|
3659
3840
|
{
|
|
3660
3841
|
"name": "state",
|
|
@@ -3667,7 +3848,8 @@
|
|
|
3667
3848
|
"success"
|
|
3668
3849
|
]
|
|
3669
3850
|
},
|
|
3670
|
-
"description": "Validation state. Default: `default`."
|
|
3851
|
+
"description": "Validation state. Default: `default`.",
|
|
3852
|
+
"default": "default"
|
|
3671
3853
|
}
|
|
3672
3854
|
],
|
|
3673
3855
|
"returns": {
|
|
@@ -3695,10 +3877,16 @@
|
|
|
3695
3877
|
}
|
|
3696
3878
|
}
|
|
3697
3879
|
}
|
|
3698
|
-
}
|
|
3880
|
+
},
|
|
3881
|
+
"classes": {
|
|
3882
|
+
"row": "lt-search-row"
|
|
3883
|
+
},
|
|
3884
|
+
"docs": "https://lo-tek.sobernetics.no/components/search/"
|
|
3699
3885
|
},
|
|
3700
3886
|
{
|
|
3701
3887
|
"name": "select",
|
|
3888
|
+
"description": "The attributes for a dropdown list.",
|
|
3889
|
+
"example": "<select {...select({ state: \"invalid\" })} />\n<select {...select({ picker: \"styled\" })} />",
|
|
3702
3890
|
"options": [
|
|
3703
3891
|
{
|
|
3704
3892
|
"name": "state",
|
|
@@ -3711,7 +3899,8 @@
|
|
|
3711
3899
|
"success"
|
|
3712
3900
|
]
|
|
3713
3901
|
},
|
|
3714
|
-
"description": "Validation state. Default: `default`."
|
|
3902
|
+
"description": "Validation state. Default: `default`.",
|
|
3903
|
+
"default": "default"
|
|
3715
3904
|
},
|
|
3716
3905
|
{
|
|
3717
3906
|
"name": "picker",
|
|
@@ -3723,7 +3912,8 @@
|
|
|
3723
3912
|
"styled"
|
|
3724
3913
|
]
|
|
3725
3914
|
},
|
|
3726
|
-
"description": "Who draws the dropdown list. Default: `auto`."
|
|
3915
|
+
"description": "Who draws the dropdown list. Default: `auto`.",
|
|
3916
|
+
"default": "auto"
|
|
3727
3917
|
}
|
|
3728
3918
|
],
|
|
3729
3919
|
"returns": {
|
|
@@ -3758,10 +3948,13 @@
|
|
|
3758
3948
|
}
|
|
3759
3949
|
}
|
|
3760
3950
|
}
|
|
3761
|
-
}
|
|
3951
|
+
},
|
|
3952
|
+
"docs": "https://lo-tek.sobernetics.no/components/select/"
|
|
3762
3953
|
},
|
|
3763
3954
|
{
|
|
3764
3955
|
"name": "sessionTimeout",
|
|
3956
|
+
"description": "The attributes for the warning that a signed-in session is about to expire.\n\nThe renderer writes the dialog and all of the text, in its own language and with its own translation tool. The component only keeps time: it opens and closes the dialog, fills in the number and announces the countdown.\n\nThe buttons are plain buttons in a `<form method=\"dialog\">`. The browser closes the dialog and sets `returnValue` to the button's `value`, and the component reads it. `data-ignore-morph` asks Datastar's morph to leave the warning alone. Without it the morph takes `open` and the number while the dialog is in the top layer. The component puts `open` back, and the number comes back on the next tick. With the attribute the number stays the whole time.",
|
|
3957
|
+
"example": "const session = lt.sessionTimeout({ titleId: \"session-title\" })\n\n<lt-session-timeout {...session.host}>\n <dialog {...session.dialog}>\n <h2 {...session.title}>Your session is ending</h2>\n <p {...session.text}>\n Your session on the Lattice ends in <span {...session.count}></span>. Unsaved routes will be lost.\n </p>\n <span {...session.live}></span>\n <form {...session.actions}>\n <button {...session.extend}>Stay connected</button>\n <button {...session.logout}>Log out</button>\n </form>\n </dialog>\n</lt-session-timeout>",
|
|
3765
3958
|
"options": [
|
|
3766
3959
|
{
|
|
3767
3960
|
"name": "titleId",
|
|
@@ -3769,7 +3962,7 @@
|
|
|
3769
3962
|
"type": {
|
|
3770
3963
|
"kind": "text"
|
|
3771
3964
|
},
|
|
3772
|
-
"description": "Id of the heading. The dialog takes its name from it with `aria-labelledby`."
|
|
3965
|
+
"description": "Id of the heading. The dialog takes its name from it with `aria-labelledby`. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
3773
3966
|
},
|
|
3774
3967
|
{
|
|
3775
3968
|
"name": "warnAt",
|
|
@@ -4019,10 +4212,43 @@
|
|
|
4019
4212
|
}
|
|
4020
4213
|
}
|
|
4021
4214
|
}
|
|
4215
|
+
},
|
|
4216
|
+
"docs": "https://lo-tek.sobernetics.no/components/session-timeout/",
|
|
4217
|
+
"parts": {
|
|
4218
|
+
"dialog": {
|
|
4219
|
+
"element": "lt-session-timeout",
|
|
4220
|
+
"part": "dialog"
|
|
4221
|
+
},
|
|
4222
|
+
"title": {
|
|
4223
|
+
"element": "lt-session-timeout",
|
|
4224
|
+
"part": "title"
|
|
4225
|
+
},
|
|
4226
|
+
"text": {
|
|
4227
|
+
"element": "lt-session-timeout",
|
|
4228
|
+
"part": "text"
|
|
4229
|
+
},
|
|
4230
|
+
"count": {
|
|
4231
|
+
"element": "lt-session-timeout",
|
|
4232
|
+
"part": "count"
|
|
4233
|
+
},
|
|
4234
|
+
"live": {
|
|
4235
|
+
"element": "lt-session-timeout",
|
|
4236
|
+
"part": "status"
|
|
4237
|
+
},
|
|
4238
|
+
"extend": {
|
|
4239
|
+
"element": "lt-session-timeout",
|
|
4240
|
+
"part": "button"
|
|
4241
|
+
},
|
|
4242
|
+
"logout": {
|
|
4243
|
+
"element": "lt-session-timeout",
|
|
4244
|
+
"part": "button"
|
|
4245
|
+
}
|
|
4022
4246
|
}
|
|
4023
4247
|
},
|
|
4024
4248
|
{
|
|
4025
4249
|
"name": "skeleton",
|
|
4250
|
+
"description": "The attributes for a placeholder while the content loads.\n\nThe shapes are always hidden from screen readers. They say nothing about what is coming, and a row of empty boxes being announced is worse than silence. Announce the wait in one place instead, with `role=\"status\"`.",
|
|
4251
|
+
"example": "<div {...skeleton({ variant: \"text\" })} />",
|
|
4026
4252
|
"options": [
|
|
4027
4253
|
{
|
|
4028
4254
|
"name": "variant",
|
|
@@ -4035,7 +4261,8 @@
|
|
|
4035
4261
|
"circle"
|
|
4036
4262
|
]
|
|
4037
4263
|
},
|
|
4038
|
-
"description": "Shape. Default: `block`."
|
|
4264
|
+
"description": "Shape. Default: `block`.",
|
|
4265
|
+
"default": "block"
|
|
4039
4266
|
}
|
|
4040
4267
|
],
|
|
4041
4268
|
"returns": {
|
|
@@ -4062,10 +4289,13 @@
|
|
|
4062
4289
|
}
|
|
4063
4290
|
}
|
|
4064
4291
|
}
|
|
4065
|
-
}
|
|
4292
|
+
},
|
|
4293
|
+
"docs": "https://lo-tek.sobernetics.no/components/skeleton/"
|
|
4066
4294
|
},
|
|
4067
4295
|
{
|
|
4068
4296
|
"name": "skipLink",
|
|
4297
|
+
"description": "The attributes for a skip-to-content link.\n\nThe link must be the first element in `<body>`, and point to the id of the main content. It sits off screen until it gets focus, and therefore cannot be hidden with `display: none`: the keyboard could not reach it either, and the whole point is lost.",
|
|
4298
|
+
"example": "<a {...skipLink()} href=\"#main-content\">Skip to main content</a>",
|
|
4069
4299
|
"options": [],
|
|
4070
4300
|
"returns": {
|
|
4071
4301
|
"kind": "attributes"
|
|
@@ -4078,10 +4308,13 @@
|
|
|
4078
4308
|
},
|
|
4079
4309
|
"options": {}
|
|
4080
4310
|
}
|
|
4081
|
-
}
|
|
4311
|
+
},
|
|
4312
|
+
"docs": "https://lo-tek.sobernetics.no/components/skip-link/"
|
|
4082
4313
|
},
|
|
4083
4314
|
{
|
|
4084
4315
|
"name": "spinner",
|
|
4316
|
+
"description": "The attributes for a loading indicator.\n\nWithout `label` the ring is only a shape, and is hidden from screen readers with `aria-hidden`, as an icon without a label is. With `label` it becomes a `role=\"status\"` that says what is going on. If you already have a visible text next to it, let that carry the message and drop `label`, so the same thing is not announced twice.",
|
|
4317
|
+
"example": "<span {...spinner({ label: \"Loading sectors\" })} />",
|
|
4085
4318
|
"options": [
|
|
4086
4319
|
{
|
|
4087
4320
|
"name": "size",
|
|
@@ -4094,7 +4327,8 @@
|
|
|
4094
4327
|
"large"
|
|
4095
4328
|
]
|
|
4096
4329
|
},
|
|
4097
|
-
"description": "Size. Default: `medium`."
|
|
4330
|
+
"description": "Size. Default: `medium`.",
|
|
4331
|
+
"default": "medium"
|
|
4098
4332
|
},
|
|
4099
4333
|
{
|
|
4100
4334
|
"name": "label",
|
|
@@ -4112,7 +4346,8 @@
|
|
|
4112
4346
|
"kind": "attributes",
|
|
4113
4347
|
"table": {
|
|
4114
4348
|
"base": {
|
|
4115
|
-
"class": "lt-spinner"
|
|
4349
|
+
"class": "lt-spinner",
|
|
4350
|
+
"aria-hidden": "true"
|
|
4116
4351
|
},
|
|
4117
4352
|
"options": {
|
|
4118
4353
|
"size": {
|
|
@@ -4129,6 +4364,7 @@
|
|
|
4129
4364
|
"label": {
|
|
4130
4365
|
"cases": {},
|
|
4131
4366
|
"template": {
|
|
4367
|
+
"aria-hidden": null,
|
|
4132
4368
|
"role": "status",
|
|
4133
4369
|
"aria-label": "{label}"
|
|
4134
4370
|
},
|
|
@@ -4138,10 +4374,13 @@
|
|
|
4138
4374
|
}
|
|
4139
4375
|
}
|
|
4140
4376
|
}
|
|
4141
|
-
}
|
|
4377
|
+
},
|
|
4378
|
+
"docs": "https://lo-tek.sobernetics.no/components/spinner/"
|
|
4142
4379
|
},
|
|
4143
4380
|
{
|
|
4144
4381
|
"name": "srOnly",
|
|
4382
|
+
"description": "The attributes for text that only screen readers should get.\n\nUse it when a label or explanation is needed by someone listening to the page, but would be noise to someone looking at it. If the content should be gone for everyone, use `hidden` instead.",
|
|
4383
|
+
"example": "<span {...srOnly()}>Opens in a new tab</span>",
|
|
4145
4384
|
"options": [],
|
|
4146
4385
|
"returns": {
|
|
4147
4386
|
"kind": "attributes"
|
|
@@ -4154,10 +4393,12 @@
|
|
|
4154
4393
|
},
|
|
4155
4394
|
"options": {}
|
|
4156
4395
|
}
|
|
4157
|
-
}
|
|
4396
|
+
},
|
|
4397
|
+
"docs": "https://lo-tek.sobernetics.no/components/sr-only/"
|
|
4158
4398
|
},
|
|
4159
4399
|
{
|
|
4160
4400
|
"name": "suggestion",
|
|
4401
|
+
"description": "The attributes for a field with a suggestion list.\n\nThe server writes both the field and the list. The web component filters, handles the arrow keys and keeps `aria-activedescendant` in sync. It renders nothing: it used to create the whole field itself, and then there was nothing to fill in before the script had run.\n\nNo preserve list. The attributes that change while the user types are set by the web component, and it sets them back when a patch strips them. If something else has already filtered, set `prefiltered` on `<lt-suggestion>`, and the web component leaves both the options and the empty message alone. If the server should also decide whether the list is expanded and which option is highlighted, set `server-controlled` as well.",
|
|
4161
4402
|
"options": [
|
|
4162
4403
|
{
|
|
4163
4404
|
"name": "invalid",
|
|
@@ -4241,7 +4482,7 @@
|
|
|
4241
4482
|
"type": {
|
|
4242
4483
|
"kind": "text"
|
|
4243
4484
|
},
|
|
4244
|
-
"description": "Shared id stem. The control becomes `${id}`, the list `${id}-list`, and the options `${id}-option-${key}`."
|
|
4485
|
+
"description": "Shared id stem. The control becomes `${id}`, the list `${id}-list`, and the options `${id}-option-${key}`. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
4245
4486
|
},
|
|
4246
4487
|
{
|
|
4247
4488
|
"name": "keys",
|
|
@@ -4318,10 +4559,43 @@
|
|
|
4318
4559
|
]
|
|
4319
4560
|
}
|
|
4320
4561
|
}
|
|
4562
|
+
},
|
|
4563
|
+
"docs": "https://lo-tek.sobernetics.no/components/suggestion/",
|
|
4564
|
+
"parts": {
|
|
4565
|
+
"label": {
|
|
4566
|
+
"element": "lt-suggestion",
|
|
4567
|
+
"part": "label"
|
|
4568
|
+
},
|
|
4569
|
+
"control": {
|
|
4570
|
+
"element": "lt-suggestion",
|
|
4571
|
+
"part": "control"
|
|
4572
|
+
},
|
|
4573
|
+
"list": {
|
|
4574
|
+
"element": "lt-suggestion",
|
|
4575
|
+
"part": "list"
|
|
4576
|
+
},
|
|
4577
|
+
"options": {
|
|
4578
|
+
"element": "lt-suggestion",
|
|
4579
|
+
"part": "option"
|
|
4580
|
+
},
|
|
4581
|
+
"empty": {
|
|
4582
|
+
"element": "lt-suggestion",
|
|
4583
|
+
"part": "empty"
|
|
4584
|
+
},
|
|
4585
|
+
"status": {
|
|
4586
|
+
"element": "lt-suggestion",
|
|
4587
|
+
"part": "status"
|
|
4588
|
+
},
|
|
4589
|
+
"value": {
|
|
4590
|
+
"element": "lt-suggestion",
|
|
4591
|
+
"part": "value"
|
|
4592
|
+
}
|
|
4321
4593
|
}
|
|
4322
4594
|
},
|
|
4323
4595
|
{
|
|
4324
4596
|
"name": "switch",
|
|
4597
|
+
"description": "The attributes for an on/off switch.\n\nThe switch is a checkbox with `role=\"switch\"`. Screen readers then announce it as \"on\" and \"off\" rather than \"checked\", while the keyboard and `FormData` work as for a plain checkbox.\n\nThe switch has no validation state. A choice that is on or off cannot be invalid in itself; if turning it on is required, the requirement belongs in a checkbox with `required`.",
|
|
4598
|
+
"example": "<input {...switchControl()} />",
|
|
4325
4599
|
"options": [
|
|
4326
4600
|
{
|
|
4327
4601
|
"name": "disabled",
|
|
@@ -4354,10 +4628,16 @@
|
|
|
4354
4628
|
}
|
|
4355
4629
|
}
|
|
4356
4630
|
}
|
|
4357
|
-
}
|
|
4631
|
+
},
|
|
4632
|
+
"classes": {
|
|
4633
|
+
"row": "lt-switch-row"
|
|
4634
|
+
},
|
|
4635
|
+
"docs": "https://lo-tek.sobernetics.no/components/switch/"
|
|
4358
4636
|
},
|
|
4359
4637
|
{
|
|
4360
4638
|
"name": "table",
|
|
4639
|
+
"description": "The attributes for a table.\n\nThe class goes on a real `<table>` with `<thead>` and `<th>`. The header cells are what let screen readers say \"Amount, 1,240 kroner\" when the user is in a cell. Build the table from `<div>` elements, and that connection does not exist.",
|
|
4640
|
+
"example": "<table {...table({ variant: \"striped\" })}>…</table>",
|
|
4361
4641
|
"options": [
|
|
4362
4642
|
{
|
|
4363
4643
|
"name": "variant",
|
|
@@ -4369,7 +4649,8 @@
|
|
|
4369
4649
|
"striped"
|
|
4370
4650
|
]
|
|
4371
4651
|
},
|
|
4372
|
-
"description": "Every other row on a muted surface. Default: `default`."
|
|
4652
|
+
"description": "Every other row on a muted surface. Default: `default`.",
|
|
4653
|
+
"default": "default"
|
|
4373
4654
|
},
|
|
4374
4655
|
{
|
|
4375
4656
|
"name": "hoverable",
|
|
@@ -4408,10 +4689,16 @@
|
|
|
4408
4689
|
}
|
|
4409
4690
|
}
|
|
4410
4691
|
}
|
|
4411
|
-
}
|
|
4692
|
+
},
|
|
4693
|
+
"classes": {
|
|
4694
|
+
"scroll": "lt-table-scroll"
|
|
4695
|
+
},
|
|
4696
|
+
"docs": "https://lo-tek.sobernetics.no/components/table/"
|
|
4412
4697
|
},
|
|
4413
4698
|
{
|
|
4414
4699
|
"name": "tableSort",
|
|
4700
|
+
"description": "The attributes for a sortable column header.\n\n`aria-sort` is on the `<th>`, not on the button, because the cell is what describes the column. Only the sorted column has the attribute. The arrow is drawn from the same attribute, so what the screen reader says and what is shown cannot drift apart. The sorting itself is the app's job.",
|
|
4701
|
+
"example": "const date = lt.tableSort({ direction: \"descending\" })\n\n<th scope=\"col\" {...date.header}>\n <button {...date.button}>Date</button>\n</th>",
|
|
4415
4702
|
"options": [
|
|
4416
4703
|
{
|
|
4417
4704
|
"name": "direction",
|
|
@@ -4470,10 +4757,13 @@
|
|
|
4470
4757
|
}
|
|
4471
4758
|
}
|
|
4472
4759
|
}
|
|
4473
|
-
}
|
|
4760
|
+
},
|
|
4761
|
+
"docs": "https://lo-tek.sobernetics.no/components/table/"
|
|
4474
4762
|
},
|
|
4475
4763
|
{
|
|
4476
4764
|
"name": "tabs",
|
|
4765
|
+
"description": "The attributes for a tab list where the tabs are links to the panels.\n\nOnly links, ids and classes. Without JavaScript the tab list is then a plain list of links, and the panels follow one another: a table of contents that works for everyone. The roles, which tab is selected and which panels are hidden are written by `<lt-tabs>`. Had they been here, the markup without JavaScript would have said \"tab\" about a link that does not behave like one, and hidden the panels.\n\nThe first tab is selected when the page loads. Another one comes from the address, such as `#file-attachments`, or from `selected` and `select()` on `<lt-tabs>`.",
|
|
4766
|
+
"example": "const tabs = lt.tabs({ id: \"file\", keys: [\"claim\", \"attachments\"], label: \"Parts of the claim\" })",
|
|
4477
4767
|
"options": [
|
|
4478
4768
|
{
|
|
4479
4769
|
"name": "id",
|
|
@@ -4481,7 +4771,7 @@
|
|
|
4481
4771
|
"type": {
|
|
4482
4772
|
"kind": "text"
|
|
4483
4773
|
},
|
|
4484
|
-
"description": "The shared id stem. The panels become `${id}-${key}`, and the headings in them `${id}-${key}-heading`."
|
|
4774
|
+
"description": "The shared id stem. The panels become `${id}-${key}`, and the headings in them `${id}-${key}-heading`. Make it from a key in the data, never from the loop index or a counter, so it is unique on the page and the same on every render."
|
|
4485
4775
|
},
|
|
4486
4776
|
{
|
|
4487
4777
|
"name": "keys",
|
|
@@ -4489,7 +4779,7 @@
|
|
|
4489
4779
|
"type": {
|
|
4490
4780
|
"kind": "textList"
|
|
4491
4781
|
},
|
|
4492
|
-
"description": "One key per tab, from the data, such as `[\"
|
|
4782
|
+
"description": "One key per tab, from the data, such as `[\"claim\", \"attachments\"]`. The key gives the panel its id, and the link points to it. An index is not a key: if the server inserts a tab first, the same index points to another panel. An empty key, whitespace and two identical keys throw."
|
|
4493
4783
|
},
|
|
4494
4784
|
{
|
|
4495
4785
|
"name": "label",
|
|
@@ -4525,10 +4815,27 @@
|
|
|
4525
4815
|
}
|
|
4526
4816
|
}
|
|
4527
4817
|
}
|
|
4818
|
+
},
|
|
4819
|
+
"docs": "https://lo-tek.sobernetics.no/components/tabs/",
|
|
4820
|
+
"parts": {
|
|
4821
|
+
"list": {
|
|
4822
|
+
"element": "lt-tabs",
|
|
4823
|
+
"part": "list"
|
|
4824
|
+
},
|
|
4825
|
+
"tabs": {
|
|
4826
|
+
"element": "lt-tabs",
|
|
4827
|
+
"part": "tab"
|
|
4828
|
+
},
|
|
4829
|
+
"panels": {
|
|
4830
|
+
"element": "lt-tabs",
|
|
4831
|
+
"part": "panel"
|
|
4832
|
+
}
|
|
4528
4833
|
}
|
|
4529
4834
|
},
|
|
4530
4835
|
{
|
|
4531
4836
|
"name": "tag",
|
|
4837
|
+
"description": "The attributes for a tag.\n\nA tag labels content: keywords on an article, selected filters above a list. If it says what state something is in, Badge is right instead.\n\n`selectable` gives hover and a focus ring, but makes nothing pressable. The element must be a `<button>`, and you set `aria-pressed` yourself, since only you know whether the tag is selected.",
|
|
4838
|
+
"example": "<button {...tag({ selectable: true })} aria-pressed=\"true\">Cutter</button>",
|
|
4532
4839
|
"options": [
|
|
4533
4840
|
{
|
|
4534
4841
|
"name": "variant",
|
|
@@ -4540,7 +4847,8 @@
|
|
|
4540
4847
|
"filled"
|
|
4541
4848
|
]
|
|
4542
4849
|
},
|
|
4543
|
-
"description": "Outline or muted surface. Default: `outline`."
|
|
4850
|
+
"description": "Outline or muted surface. Default: `outline`.",
|
|
4851
|
+
"default": "outline"
|
|
4544
4852
|
},
|
|
4545
4853
|
{
|
|
4546
4854
|
"name": "selectable",
|
|
@@ -4579,10 +4887,13 @@
|
|
|
4579
4887
|
}
|
|
4580
4888
|
}
|
|
4581
4889
|
}
|
|
4582
|
-
}
|
|
4890
|
+
},
|
|
4891
|
+
"docs": "https://lo-tek.sobernetics.no/components/tag/"
|
|
4583
4892
|
},
|
|
4584
4893
|
{
|
|
4585
4894
|
"name": "textarea",
|
|
4895
|
+
"description": "The attributes for a multi-line text field.",
|
|
4896
|
+
"example": "<textarea {...textarea({ state: \"invalid\" })} />",
|
|
4586
4897
|
"options": [
|
|
4587
4898
|
{
|
|
4588
4899
|
"name": "state",
|
|
@@ -4595,7 +4906,8 @@
|
|
|
4595
4906
|
"success"
|
|
4596
4907
|
]
|
|
4597
4908
|
},
|
|
4598
|
-
"description": "Validation state. Default: `default`."
|
|
4909
|
+
"description": "Validation state. Default: `default`.",
|
|
4910
|
+
"default": "default"
|
|
4599
4911
|
}
|
|
4600
4912
|
],
|
|
4601
4913
|
"returns": {
|
|
@@ -4622,10 +4934,12 @@
|
|
|
4622
4934
|
}
|
|
4623
4935
|
}
|
|
4624
4936
|
}
|
|
4625
|
-
}
|
|
4937
|
+
},
|
|
4938
|
+
"docs": "https://lo-tek.sobernetics.no/components/textarea/"
|
|
4626
4939
|
},
|
|
4627
4940
|
{
|
|
4628
4941
|
"name": "toast",
|
|
4942
|
+
"description": "The attributes for the toast region.\n\nThe region is `role=\"status\"` and not `role=\"alert\"`. A message that comes because something went well should not interrupt what the screen reader is doing.\n\n`data-ignore-morph` is not optional. `<lt-toast>` creates and removes its message elements inside the region, and without the attribute the Datastar morph tears them away at the next patch, because the server's version of the region is empty. The attribute must be in the HTML the server sends: the component cannot set it on itself, since the morph reads it from the server's node.",
|
|
4629
4943
|
"options": [
|
|
4630
4944
|
{
|
|
4631
4945
|
"name": "label",
|
|
@@ -4726,10 +5040,13 @@
|
|
|
4726
5040
|
}
|
|
4727
5041
|
}
|
|
4728
5042
|
}
|
|
4729
|
-
}
|
|
5043
|
+
},
|
|
5044
|
+
"docs": "https://lo-tek.sobernetics.no/components/toast/"
|
|
4730
5045
|
},
|
|
4731
5046
|
{
|
|
4732
5047
|
"name": "toggleGroup",
|
|
5048
|
+
"description": "The attributes for a group where one option is selected at a time.\n\nThe group is radio buttons in disguise. Each option is a `<label>` with an `<input type=\"radio\">` inside, visually shrunk away. You then keep the arrow keys, `FormData` and the screen reader saying \"2 of 3\" without writing any of it again.\n\nIf the choices are actions rather than a setting, such as \"bold, italic, underline\", buttons with `aria-pressed` belong there instead.",
|
|
5049
|
+
"example": "<fieldset {...toggleGroup()}>\n <legend class=\"lt-sr-only\">View</legend>\n <label class={toggleGroup.option}>\n <input type=\"radio\" name=\"view\" value=\"dry\" checked /> Dry\n </label>\n</fieldset>",
|
|
4733
5050
|
"options": [],
|
|
4734
5051
|
"returns": {
|
|
4735
5052
|
"kind": "attributes"
|
|
@@ -4742,10 +5059,16 @@
|
|
|
4742
5059
|
},
|
|
4743
5060
|
"options": {}
|
|
4744
5061
|
}
|
|
4745
|
-
}
|
|
5062
|
+
},
|
|
5063
|
+
"classes": {
|
|
5064
|
+
"option": "lt-toggle-group__option"
|
|
5065
|
+
},
|
|
5066
|
+
"docs": "https://lo-tek.sobernetics.no/components/toggle-group/"
|
|
4746
5067
|
},
|
|
4747
5068
|
{
|
|
4748
5069
|
"name": "tooltip",
|
|
5070
|
+
"description": "The attributes for the wrapper around a trigger and a tooltip bubble.\n\nThe bubble shows on hover and on focus. The focus part is not optional: a bubble that only comes with the mouse does not exist for keyboard users.\n\nThe text in the bubble must be connected to the trigger with `aria-describedby`. Without it the bubble is just something that appears on screen, and is never announced.\n\nUse it for something extra, never for something the user must have. On a touch screen there is neither hover nor focus before something is tapped.",
|
|
5071
|
+
"example": "<span {...tooltip()}>\n <button aria-describedby=\"hint\">Appraise</button>\n <span class={tooltip.bubble} role=\"tooltip\" id=\"hint\">At street value</span>\n</span>",
|
|
4749
5072
|
"options": [],
|
|
4750
5073
|
"returns": {
|
|
4751
5074
|
"kind": "attributes"
|
|
@@ -4758,7 +5081,11 @@
|
|
|
4758
5081
|
},
|
|
4759
5082
|
"options": {}
|
|
4760
5083
|
}
|
|
4761
|
-
}
|
|
5084
|
+
},
|
|
5085
|
+
"classes": {
|
|
5086
|
+
"bubble": "lt-tooltip__bubble"
|
|
5087
|
+
},
|
|
5088
|
+
"docs": "https://lo-tek.sobernetics.no/components/tooltip/"
|
|
4762
5089
|
}
|
|
4763
5090
|
],
|
|
4764
5091
|
"tokens": {
|