@firstprateek/vastu 1.0.0 → 1.1.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/README.md +2 -1
- package/custom-elements.json +691 -0
- package/dist/dev/all.d.ts +3 -0
- package/dist/dev/all.d.ts.map +1 -1
- package/dist/dev/all.js +3 -0
- package/dist/dev/all.js.map +1 -1
- package/dist/dev/bar-chart/bar-chart.d.ts +63 -0
- package/dist/dev/bar-chart/bar-chart.d.ts.map +1 -0
- package/dist/dev/bar-chart/bar-chart.js +316 -0
- package/dist/dev/bar-chart/bar-chart.js.map +1 -0
- package/dist/dev/bar-chart/index.d.ts +3 -0
- package/dist/dev/bar-chart/index.d.ts.map +1 -0
- package/dist/dev/bar-chart/index.js +5 -0
- package/dist/dev/bar-chart/index.js.map +1 -0
- package/dist/dev/core/cssom.d.ts +15 -0
- package/dist/dev/core/cssom.d.ts.map +1 -0
- package/dist/dev/core/cssom.js +30 -0
- package/dist/dev/core/cssom.js.map +1 -0
- package/dist/dev/navbar/index.d.ts +3 -0
- package/dist/dev/navbar/index.d.ts.map +1 -0
- package/dist/dev/navbar/index.js +5 -0
- package/dist/dev/navbar/index.js.map +1 -0
- package/dist/dev/navbar/navbar.d.ts +69 -0
- package/dist/dev/navbar/navbar.d.ts.map +1 -0
- package/dist/dev/navbar/navbar.js +353 -0
- package/dist/dev/navbar/navbar.js.map +1 -0
- package/dist/dev/poll/index.d.ts +3 -0
- package/dist/dev/poll/index.d.ts.map +1 -0
- package/dist/dev/poll/index.js +5 -0
- package/dist/dev/poll/index.js.map +1 -0
- package/dist/dev/poll/poll.d.ts +67 -0
- package/dist/dev/poll/poll.d.ts.map +1 -0
- package/dist/dev/poll/poll.js +301 -0
- package/dist/dev/poll/poll.js.map +1 -0
- package/dist/prod/all.js +3 -0
- package/dist/prod/bar-chart/bar-chart.js +316 -0
- package/dist/prod/bar-chart/index.js +5 -0
- package/dist/prod/core/cssom.js +30 -0
- package/dist/prod/navbar/index.js +5 -0
- package/dist/prod/navbar/navbar.js +353 -0
- package/dist/prod/poll/index.js +5 -0
- package/dist/prod/poll/poll.js +301 -0
- package/package.json +18 -3
package/custom-elements.json
CHANGED
|
@@ -2,6 +2,201 @@
|
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"readme": "",
|
|
4
4
|
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/bar-chart/bar-chart.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "class",
|
|
11
|
+
"description": "A bar chart that compares values across a few categories. The data is plain markup, and the\nbars animate when it changes, so it can follow live values.",
|
|
12
|
+
"name": "VaBarChart",
|
|
13
|
+
"cssProperties": [
|
|
14
|
+
{
|
|
15
|
+
"type": {
|
|
16
|
+
"text": "<color>"
|
|
17
|
+
},
|
|
18
|
+
"description": "Colour of the bars.",
|
|
19
|
+
"name": "--va-bar-chart-bar-bg",
|
|
20
|
+
"x-applies": {
|
|
21
|
+
"part": "bar",
|
|
22
|
+
"property": "background-color"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": {
|
|
27
|
+
"text": "<length>"
|
|
28
|
+
},
|
|
29
|
+
"description": "Corner radius of the bars' outer end.",
|
|
30
|
+
"name": "--va-bar-chart-bar-radius",
|
|
31
|
+
"x-applies": {
|
|
32
|
+
"part": "bar",
|
|
33
|
+
"property": "border-top-left-radius"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": {
|
|
38
|
+
"text": "<length>"
|
|
39
|
+
},
|
|
40
|
+
"description": "Height of the plot area.",
|
|
41
|
+
"name": "--va-bar-chart-size",
|
|
42
|
+
"x-applies": {
|
|
43
|
+
"part": "plot",
|
|
44
|
+
"property": "height"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"cssParts": [
|
|
49
|
+
{
|
|
50
|
+
"description": "The chart's title.",
|
|
51
|
+
"name": "label"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"description": "The area the bars are drawn in.",
|
|
55
|
+
"name": "plot"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "Each bar.",
|
|
59
|
+
"name": "bar"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"description": "The value labels along the left edge.",
|
|
63
|
+
"name": "axis"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"slots": [
|
|
67
|
+
{
|
|
68
|
+
"description": "The data, as `<data value=\"N\">Category</data>` elements, in order. Change them and the bars animate to the new values.",
|
|
69
|
+
"name": ""
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"members": [
|
|
73
|
+
{
|
|
74
|
+
"kind": "field",
|
|
75
|
+
"name": "label",
|
|
76
|
+
"privacy": "public",
|
|
77
|
+
"type": {
|
|
78
|
+
"text": "string"
|
|
79
|
+
},
|
|
80
|
+
"description": "The chart's title, shown above it.",
|
|
81
|
+
"default": "''",
|
|
82
|
+
"attribute": "label"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "field",
|
|
86
|
+
"name": "max",
|
|
87
|
+
"privacy": "public",
|
|
88
|
+
"type": {
|
|
89
|
+
"text": "number"
|
|
90
|
+
},
|
|
91
|
+
"description": "The top of the value axis. 0 (the default) fits the axis to the data; set it to keep the scale steady while live values change.",
|
|
92
|
+
"default": "0",
|
|
93
|
+
"attribute": "max"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"attributes": [
|
|
97
|
+
{
|
|
98
|
+
"name": "label",
|
|
99
|
+
"type": {
|
|
100
|
+
"text": "string"
|
|
101
|
+
},
|
|
102
|
+
"description": "The chart's title, shown above it.",
|
|
103
|
+
"default": "''",
|
|
104
|
+
"fieldName": "label"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "max",
|
|
108
|
+
"type": {
|
|
109
|
+
"text": "number"
|
|
110
|
+
},
|
|
111
|
+
"description": "The top of the value axis. 0 (the default) fits the axis to the data; set it to keep the scale steady while live values change.",
|
|
112
|
+
"default": "0",
|
|
113
|
+
"fieldName": "max"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"superclass": {
|
|
117
|
+
"name": "LitElement",
|
|
118
|
+
"package": "lit"
|
|
119
|
+
},
|
|
120
|
+
"tagName": "va-bar-chart",
|
|
121
|
+
"customElement": true,
|
|
122
|
+
"summary": "Compares a number across a few categories, one bar per category.",
|
|
123
|
+
"x-keyboard": [
|
|
124
|
+
{
|
|
125
|
+
"context": "items",
|
|
126
|
+
"key": "ArrowRight",
|
|
127
|
+
"action": "next",
|
|
128
|
+
"description": "Moves to the next bar, wrapping round."
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"context": "items",
|
|
132
|
+
"key": "ArrowLeft",
|
|
133
|
+
"action": "previous",
|
|
134
|
+
"description": "Moves to the previous bar, wrapping round."
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"context": "items",
|
|
138
|
+
"key": "Home",
|
|
139
|
+
"action": "first",
|
|
140
|
+
"description": "Moves to the first bar."
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"context": "items",
|
|
144
|
+
"key": "End",
|
|
145
|
+
"action": "last",
|
|
146
|
+
"description": "Moves to the last bar."
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"x-keyboard-items": "data",
|
|
150
|
+
"x-a11y": {
|
|
151
|
+
"notes": [
|
|
152
|
+
"Each `<data>` element is in the Tab order once (roving tabindex) and is announced as \"Category: value\". Arrow keys move between bars.",
|
|
153
|
+
"The value axis is hidden from assistive technology, because every bar announces its own value."
|
|
154
|
+
],
|
|
155
|
+
"role": "figure",
|
|
156
|
+
"nameFrom": [
|
|
157
|
+
"label"
|
|
158
|
+
],
|
|
159
|
+
"name": "The `label`, which is the chart's visible title."
|
|
160
|
+
},
|
|
161
|
+
"x-guidance": {
|
|
162
|
+
"use": "To compare one number across a few categories (up to about 12), such as visitors per day or sales per region.",
|
|
163
|
+
"avoid": "For trends over many points in time, for parts of a whole, or when readers need to look up exact values.",
|
|
164
|
+
"instead": "A line chart for trends; a table when exact values matter."
|
|
165
|
+
},
|
|
166
|
+
"events": [],
|
|
167
|
+
"x-examples": [
|
|
168
|
+
{
|
|
169
|
+
"title": "Visitors per day",
|
|
170
|
+
"description": "Each bar is a <data> element: value is the number and the text is the category. Change the elements and the bars animate to the new values.",
|
|
171
|
+
"path": "src/bar-chart/examples/1-per-day.html",
|
|
172
|
+
"code": "<va-bar-chart label=\"Visitors per day\">\n <data value=\"120\">Mon</data>\n <data value=\"98\">Tue</data>\n <data value=\"143\">Wed</data>\n <data value=\"87\">Thu</data>\n <data value=\"164\">Fri</data>\n <data value=\"61\">Sat</data>\n <data value=\"45\">Sun</data>\n</va-bar-chart>"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"title": "A fixed scale",
|
|
176
|
+
"description": "max fixes the top of the axis, so the scale stays steady while live values change. Here every value is a percentage.",
|
|
177
|
+
"path": "src/bar-chart/examples/2-fixed-scale.html",
|
|
178
|
+
"code": "<va-bar-chart label=\"Build success rate (%)\" max=\"100\">\n <data value=\"97\">Web</data>\n <data value=\"88\">iOS</data>\n <data value=\"91\">Android</data>\n <data value=\"99\">API</data>\n</va-bar-chart>"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"title": "Gains and losses",
|
|
182
|
+
"description": "Negative values hang below the zero line.",
|
|
183
|
+
"path": "src/bar-chart/examples/3-negative.html",
|
|
184
|
+
"code": "<va-bar-chart label=\"Change in sign-ups from last month\">\n <data value=\"42\">North</data>\n <data value=\"-18\">South</data>\n <data value=\"7\">East</data>\n <data value=\"-5\">West</data>\n</va-bar-chart>"
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"exports": [
|
|
190
|
+
{
|
|
191
|
+
"kind": "js",
|
|
192
|
+
"name": "VaBarChart",
|
|
193
|
+
"declaration": {
|
|
194
|
+
"name": "VaBarChart",
|
|
195
|
+
"module": "src/bar-chart/bar-chart.ts"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
},
|
|
5
200
|
{
|
|
6
201
|
"kind": "javascript-module",
|
|
7
202
|
"path": "src/button/button.ts",
|
|
@@ -841,6 +1036,26 @@
|
|
|
841
1036
|
}
|
|
842
1037
|
]
|
|
843
1038
|
},
|
|
1039
|
+
{
|
|
1040
|
+
"kind": "javascript-module",
|
|
1041
|
+
"path": "src/core/cssom.ts",
|
|
1042
|
+
"declarations": [
|
|
1043
|
+
{
|
|
1044
|
+
"kind": "variable",
|
|
1045
|
+
"name": "cssom"
|
|
1046
|
+
}
|
|
1047
|
+
],
|
|
1048
|
+
"exports": [
|
|
1049
|
+
{
|
|
1050
|
+
"kind": "js",
|
|
1051
|
+
"name": "cssom",
|
|
1052
|
+
"declaration": {
|
|
1053
|
+
"name": "cssom",
|
|
1054
|
+
"module": "src/core/cssom.ts"
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
]
|
|
1058
|
+
},
|
|
844
1059
|
{
|
|
845
1060
|
"kind": "javascript-module",
|
|
846
1061
|
"path": "src/core/form-control.ts",
|
|
@@ -1621,6 +1836,482 @@
|
|
|
1621
1836
|
}
|
|
1622
1837
|
]
|
|
1623
1838
|
},
|
|
1839
|
+
{
|
|
1840
|
+
"kind": "javascript-module",
|
|
1841
|
+
"path": "src/navbar/navbar.ts",
|
|
1842
|
+
"declarations": [
|
|
1843
|
+
{
|
|
1844
|
+
"kind": "class",
|
|
1845
|
+
"description": "A site's main navigation bar: a brand link and links to pages. On narrow screens the links fold\nbehind a Menu button, following the WAI-ARIA disclosure navigation pattern.",
|
|
1846
|
+
"name": "VaNavbar",
|
|
1847
|
+
"cssProperties": [
|
|
1848
|
+
{
|
|
1849
|
+
"type": {
|
|
1850
|
+
"text": "<color>"
|
|
1851
|
+
},
|
|
1852
|
+
"description": "Background colour of the bar and of the open panel.",
|
|
1853
|
+
"name": "--va-navbar-bg",
|
|
1854
|
+
"x-applies": {
|
|
1855
|
+
"part": "bar",
|
|
1856
|
+
"property": "background-color"
|
|
1857
|
+
}
|
|
1858
|
+
},
|
|
1859
|
+
{
|
|
1860
|
+
"type": {
|
|
1861
|
+
"text": "<color>"
|
|
1862
|
+
},
|
|
1863
|
+
"description": "Colour of the line under the bar.",
|
|
1864
|
+
"name": "--va-navbar-border",
|
|
1865
|
+
"x-applies": {
|
|
1866
|
+
"part": "bar",
|
|
1867
|
+
"property": "border-bottom-color"
|
|
1868
|
+
}
|
|
1869
|
+
},
|
|
1870
|
+
{
|
|
1871
|
+
"type": {
|
|
1872
|
+
"text": "<length>"
|
|
1873
|
+
},
|
|
1874
|
+
"description": "Minimum height of the bar.",
|
|
1875
|
+
"name": "--va-navbar-size",
|
|
1876
|
+
"x-applies": {
|
|
1877
|
+
"part": "bar",
|
|
1878
|
+
"property": "min-height"
|
|
1879
|
+
}
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
"type": {
|
|
1883
|
+
"text": "<color>"
|
|
1884
|
+
},
|
|
1885
|
+
"description": "Text colour of the links.",
|
|
1886
|
+
"name": "--va-navbar-link-fg",
|
|
1887
|
+
"x-applies": {
|
|
1888
|
+
"light": "a:not([slot]):not([aria-current])",
|
|
1889
|
+
"property": "color"
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1892
|
+
{
|
|
1893
|
+
"type": {
|
|
1894
|
+
"text": "<color>"
|
|
1895
|
+
},
|
|
1896
|
+
"description": "Colour of the line that marks the current page's link.",
|
|
1897
|
+
"name": "--va-navbar-indicator-border",
|
|
1898
|
+
"x-applies": {
|
|
1899
|
+
"light": "[aria-current=\"page\"]",
|
|
1900
|
+
"property": "border-bottom-color"
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
],
|
|
1904
|
+
"cssParts": [
|
|
1905
|
+
{
|
|
1906
|
+
"description": "The bar, which is the `<nav>` element.",
|
|
1907
|
+
"name": "bar"
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
"description": "The Menu button shown on narrow screens.",
|
|
1911
|
+
"name": "toggle"
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
"description": "The wrapper around the links. On narrow screens it is the panel that opens.",
|
|
1915
|
+
"name": "links"
|
|
1916
|
+
}
|
|
1917
|
+
],
|
|
1918
|
+
"slots": [
|
|
1919
|
+
{
|
|
1920
|
+
"description": "The links, as `<a href=\"…\">` elements. Mark the current page's link with `aria-current=\"page\"`.",
|
|
1921
|
+
"name": ""
|
|
1922
|
+
},
|
|
1923
|
+
{
|
|
1924
|
+
"description": "The site's name or logo, as an `<a href=\"…\">` to the home page.",
|
|
1925
|
+
"name": "brand"
|
|
1926
|
+
}
|
|
1927
|
+
],
|
|
1928
|
+
"members": [
|
|
1929
|
+
{
|
|
1930
|
+
"kind": "field",
|
|
1931
|
+
"name": "open",
|
|
1932
|
+
"privacy": "public",
|
|
1933
|
+
"type": {
|
|
1934
|
+
"text": "boolean"
|
|
1935
|
+
},
|
|
1936
|
+
"description": "Whether the panel of links is open. It only shows while the navbar is folded.",
|
|
1937
|
+
"default": "false",
|
|
1938
|
+
"attribute": "open",
|
|
1939
|
+
"reflects": true
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
"kind": "field",
|
|
1943
|
+
"name": "collapseBelow",
|
|
1944
|
+
"privacy": "public",
|
|
1945
|
+
"type": {
|
|
1946
|
+
"text": "number"
|
|
1947
|
+
},
|
|
1948
|
+
"description": "Width in pixels below which the links fold behind the Menu button. It is the navbar's own width, not the window's.",
|
|
1949
|
+
"default": "600",
|
|
1950
|
+
"attribute": "collapse-below"
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
"kind": "field",
|
|
1954
|
+
"name": "toggleLabel",
|
|
1955
|
+
"privacy": "public",
|
|
1956
|
+
"type": {
|
|
1957
|
+
"text": "string"
|
|
1958
|
+
},
|
|
1959
|
+
"description": "Visible text of the Menu button.",
|
|
1960
|
+
"default": "'Menu'",
|
|
1961
|
+
"attribute": "toggle-label"
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"kind": "field",
|
|
1965
|
+
"name": "accessibleLabel",
|
|
1966
|
+
"privacy": "public",
|
|
1967
|
+
"type": {
|
|
1968
|
+
"text": "string"
|
|
1969
|
+
},
|
|
1970
|
+
"description": "Accessible name of the navigation landmark.",
|
|
1971
|
+
"default": "''",
|
|
1972
|
+
"attribute": "accessible-label"
|
|
1973
|
+
}
|
|
1974
|
+
],
|
|
1975
|
+
"attributes": [
|
|
1976
|
+
{
|
|
1977
|
+
"name": "open",
|
|
1978
|
+
"type": {
|
|
1979
|
+
"text": "boolean"
|
|
1980
|
+
},
|
|
1981
|
+
"description": "Whether the panel of links is open. It only shows while the navbar is folded.",
|
|
1982
|
+
"default": "false",
|
|
1983
|
+
"fieldName": "open"
|
|
1984
|
+
},
|
|
1985
|
+
{
|
|
1986
|
+
"name": "collapse-below",
|
|
1987
|
+
"type": {
|
|
1988
|
+
"text": "number"
|
|
1989
|
+
},
|
|
1990
|
+
"description": "Width in pixels below which the links fold behind the Menu button. It is the navbar's own width, not the window's.",
|
|
1991
|
+
"default": "600",
|
|
1992
|
+
"fieldName": "collapseBelow"
|
|
1993
|
+
},
|
|
1994
|
+
{
|
|
1995
|
+
"name": "toggle-label",
|
|
1996
|
+
"type": {
|
|
1997
|
+
"text": "string"
|
|
1998
|
+
},
|
|
1999
|
+
"description": "Visible text of the Menu button.",
|
|
2000
|
+
"default": "'Menu'",
|
|
2001
|
+
"fieldName": "toggleLabel"
|
|
2002
|
+
},
|
|
2003
|
+
{
|
|
2004
|
+
"name": "accessible-label",
|
|
2005
|
+
"type": {
|
|
2006
|
+
"text": "string"
|
|
2007
|
+
},
|
|
2008
|
+
"description": "Accessible name of the navigation landmark.",
|
|
2009
|
+
"default": "''",
|
|
2010
|
+
"fieldName": "accessibleLabel"
|
|
2011
|
+
}
|
|
2012
|
+
],
|
|
2013
|
+
"cssStates": [
|
|
2014
|
+
{
|
|
2015
|
+
"description": "The links are folded behind the Menu button.",
|
|
2016
|
+
"name": "collapsed"
|
|
2017
|
+
}
|
|
2018
|
+
],
|
|
2019
|
+
"superclass": {
|
|
2020
|
+
"name": "LitElement",
|
|
2021
|
+
"package": "lit"
|
|
2022
|
+
},
|
|
2023
|
+
"tagName": "va-navbar",
|
|
2024
|
+
"customElement": true,
|
|
2025
|
+
"summary": "Shows a site's brand and main links in a bar that folds behind a Menu button on narrow screens.",
|
|
2026
|
+
"x-keyboard": [
|
|
2027
|
+
{
|
|
2028
|
+
"context": "open",
|
|
2029
|
+
"key": "Escape",
|
|
2030
|
+
"action": "closes",
|
|
2031
|
+
"description": "Closes the open panel of links and returns focus to the Menu button."
|
|
2032
|
+
}
|
|
2033
|
+
],
|
|
2034
|
+
"x-a11y": {
|
|
2035
|
+
"notes": [
|
|
2036
|
+
"The bar is a `<nav>` landmark. The links keep their own names; mark the current page with `aria-current=\"page\"`.",
|
|
2037
|
+
"Style the folded layout with `va-navbar:state(collapsed)`.",
|
|
2038
|
+
"On narrow screens the Menu button has a visible label, `aria-expanded` and `aria-controls`. Escape, a click outside or moving focus away closes the panel."
|
|
2039
|
+
],
|
|
2040
|
+
"role": "navigation",
|
|
2041
|
+
"nameFrom": [
|
|
2042
|
+
"accessible-label"
|
|
2043
|
+
],
|
|
2044
|
+
"name": "The `accessible-label` attribute, such as \"Main\" (not shown). Needed when a page has more than one navigation landmark."
|
|
2045
|
+
},
|
|
2046
|
+
"x-guidance": {
|
|
2047
|
+
"use": "For a site's or app's main navigation: a brand link and up to about seven links to pages.",
|
|
2048
|
+
"avoid": "For actions that do something on the page, for switching views in one place, or for deep hierarchies of pages.",
|
|
2049
|
+
"instead": "`va-menu` for actions; `va-tabs` for views in one place; nested lists in a sidebar for deep navigation."
|
|
2050
|
+
},
|
|
2051
|
+
"events": [],
|
|
2052
|
+
"x-examples": [
|
|
2053
|
+
{
|
|
2054
|
+
"title": "Site navigation",
|
|
2055
|
+
"description": "A brand link, then links to pages. The current page's link has aria-current=\"page\". When the navbar is narrower than 600px, the links fold behind a Menu button.",
|
|
2056
|
+
"path": "src/navbar/examples/1-site.html",
|
|
2057
|
+
"code": "<va-navbar accessible-label=\"Main\">\n <a slot=\"brand\" href=\"#\">Acme</a>\n <a href=\"#\" aria-current=\"page\">Home</a>\n <a href=\"#work\">Work</a>\n <a href=\"#about\">About</a>\n <a href=\"#contact\">Contact</a>\n</va-navbar>"
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
"title": "Folding earlier",
|
|
2061
|
+
"description": "collapse-below sets the width at which the links fold. With many links, fold earlier so they never wrap. toggle-label changes the Menu button's text.",
|
|
2062
|
+
"path": "src/navbar/examples/2-fold-earlier.html",
|
|
2063
|
+
"code": "<va-navbar accessible-label=\"Main\" collapse-below=\"900\" toggle-label=\"Pages\">\n <a slot=\"brand\" href=\"#\">Northwind Studio</a>\n <a href=\"#\">Projects</a>\n <a href=\"#services\" aria-current=\"page\">Services</a>\n <a href=\"#team\">Team</a>\n <a href=\"#journal\">Journal</a>\n <a href=\"#careers\">Careers</a>\n <a href=\"#contact\">Contact</a>\n</va-navbar>"
|
|
2064
|
+
}
|
|
2065
|
+
]
|
|
2066
|
+
}
|
|
2067
|
+
],
|
|
2068
|
+
"exports": [
|
|
2069
|
+
{
|
|
2070
|
+
"kind": "js",
|
|
2071
|
+
"name": "VaNavbar",
|
|
2072
|
+
"declaration": {
|
|
2073
|
+
"name": "VaNavbar",
|
|
2074
|
+
"module": "src/navbar/navbar.ts"
|
|
2075
|
+
}
|
|
2076
|
+
}
|
|
2077
|
+
]
|
|
2078
|
+
},
|
|
2079
|
+
{
|
|
2080
|
+
"kind": "javascript-module",
|
|
2081
|
+
"path": "src/poll/poll.ts",
|
|
2082
|
+
"declarations": [
|
|
2083
|
+
{
|
|
2084
|
+
"kind": "class",
|
|
2085
|
+
"description": "A one-question poll. The user votes with one click, and the poll shows the results.",
|
|
2086
|
+
"name": "VaPoll",
|
|
2087
|
+
"cssProperties": [
|
|
2088
|
+
{
|
|
2089
|
+
"type": {
|
|
2090
|
+
"text": "<color>"
|
|
2091
|
+
},
|
|
2092
|
+
"description": "Border colour of each answer's row.",
|
|
2093
|
+
"name": "--va-poll-border",
|
|
2094
|
+
"x-applies": {
|
|
2095
|
+
"part": "option",
|
|
2096
|
+
"property": "border-top-color"
|
|
2097
|
+
}
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
"type": {
|
|
2101
|
+
"text": "<length>"
|
|
2102
|
+
},
|
|
2103
|
+
"description": "Corner radius of each answer's row.",
|
|
2104
|
+
"name": "--va-poll-radius",
|
|
2105
|
+
"x-applies": {
|
|
2106
|
+
"part": "option",
|
|
2107
|
+
"property": "border-top-left-radius"
|
|
2108
|
+
}
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
"type": {
|
|
2112
|
+
"text": "<color>"
|
|
2113
|
+
},
|
|
2114
|
+
"description": "Colour of the result bars.",
|
|
2115
|
+
"name": "--va-poll-bar-bg",
|
|
2116
|
+
"x-applies": {
|
|
2117
|
+
"part": "bar",
|
|
2118
|
+
"property": "background-color"
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
],
|
|
2122
|
+
"cssParts": [
|
|
2123
|
+
{
|
|
2124
|
+
"description": "The question.",
|
|
2125
|
+
"name": "label"
|
|
2126
|
+
},
|
|
2127
|
+
{
|
|
2128
|
+
"description": "The row around each answer.",
|
|
2129
|
+
"name": "option"
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
"description": "The bar behind each answer that shows its share of the votes.",
|
|
2133
|
+
"name": "bar"
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
"description": "The share of the votes, shown after voting.",
|
|
2137
|
+
"name": "result"
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
"description": "The help text and the vote count.",
|
|
2141
|
+
"name": "help-text"
|
|
2142
|
+
}
|
|
2143
|
+
],
|
|
2144
|
+
"slots": [
|
|
2145
|
+
{
|
|
2146
|
+
"description": "The answers, as `<button value=\"…\" data-votes=\"N\">` elements. `data-votes` is the number of votes so far.",
|
|
2147
|
+
"name": ""
|
|
2148
|
+
},
|
|
2149
|
+
{
|
|
2150
|
+
"description": "Optional text under the poll, such as when it closes. Overrides the `help-text` attribute.",
|
|
2151
|
+
"name": "help-text"
|
|
2152
|
+
}
|
|
2153
|
+
],
|
|
2154
|
+
"members": [
|
|
2155
|
+
{
|
|
2156
|
+
"kind": "field",
|
|
2157
|
+
"name": "label",
|
|
2158
|
+
"privacy": "public",
|
|
2159
|
+
"type": {
|
|
2160
|
+
"text": "string"
|
|
2161
|
+
},
|
|
2162
|
+
"description": "The question, shown above the answers.",
|
|
2163
|
+
"default": "''",
|
|
2164
|
+
"attribute": "label"
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
"kind": "field",
|
|
2168
|
+
"name": "value",
|
|
2169
|
+
"privacy": "public",
|
|
2170
|
+
"type": {
|
|
2171
|
+
"text": "string"
|
|
2172
|
+
},
|
|
2173
|
+
"description": "The value of the answer the user voted for, or an empty string before a vote. Setting it shows the results with that answer marked, for a user who has already voted.",
|
|
2174
|
+
"default": "''",
|
|
2175
|
+
"attribute": "value"
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
"kind": "field",
|
|
2179
|
+
"name": "showResults",
|
|
2180
|
+
"privacy": "public",
|
|
2181
|
+
"type": {
|
|
2182
|
+
"text": "boolean"
|
|
2183
|
+
},
|
|
2184
|
+
"description": "Shows the results without a vote, such as for a closed poll.",
|
|
2185
|
+
"default": "false",
|
|
2186
|
+
"attribute": "show-results",
|
|
2187
|
+
"reflects": true
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
"kind": "field",
|
|
2191
|
+
"name": "helpText",
|
|
2192
|
+
"privacy": "public",
|
|
2193
|
+
"type": {
|
|
2194
|
+
"text": "string"
|
|
2195
|
+
},
|
|
2196
|
+
"description": "Text under the poll, such as when it closes.",
|
|
2197
|
+
"default": "''",
|
|
2198
|
+
"attribute": "help-text"
|
|
2199
|
+
}
|
|
2200
|
+
],
|
|
2201
|
+
"events": [
|
|
2202
|
+
{
|
|
2203
|
+
"type": {
|
|
2204
|
+
"text": "CustomEvent<{ value: string, item: HTMLElement }>"
|
|
2205
|
+
},
|
|
2206
|
+
"description": "When the user votes. `event.detail.value` is the answer's `value`, or its text when it has none; `event.detail.item` is the answer. Send the vote to your server here.",
|
|
2207
|
+
"name": "va-select",
|
|
2208
|
+
"x-trigger": {
|
|
2209
|
+
"how": "click-item 2"
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
],
|
|
2213
|
+
"attributes": [
|
|
2214
|
+
{
|
|
2215
|
+
"name": "label",
|
|
2216
|
+
"type": {
|
|
2217
|
+
"text": "string"
|
|
2218
|
+
},
|
|
2219
|
+
"description": "The question, shown above the answers.",
|
|
2220
|
+
"default": "''",
|
|
2221
|
+
"fieldName": "label"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
"name": "value",
|
|
2225
|
+
"type": {
|
|
2226
|
+
"text": "string"
|
|
2227
|
+
},
|
|
2228
|
+
"description": "The value of the answer the user voted for, or an empty string before a vote. Setting it shows the results with that answer marked, for a user who has already voted.",
|
|
2229
|
+
"default": "''",
|
|
2230
|
+
"fieldName": "value"
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
"name": "show-results",
|
|
2234
|
+
"type": {
|
|
2235
|
+
"text": "boolean"
|
|
2236
|
+
},
|
|
2237
|
+
"description": "Shows the results without a vote, such as for a closed poll.",
|
|
2238
|
+
"default": "false",
|
|
2239
|
+
"fieldName": "showResults"
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
"name": "help-text",
|
|
2243
|
+
"type": {
|
|
2244
|
+
"text": "string"
|
|
2245
|
+
},
|
|
2246
|
+
"description": "Text under the poll, such as when it closes.",
|
|
2247
|
+
"default": "''",
|
|
2248
|
+
"fieldName": "helpText"
|
|
2249
|
+
}
|
|
2250
|
+
],
|
|
2251
|
+
"superclass": {
|
|
2252
|
+
"name": "LitElement",
|
|
2253
|
+
"package": "lit"
|
|
2254
|
+
},
|
|
2255
|
+
"tagName": "va-poll",
|
|
2256
|
+
"customElement": true,
|
|
2257
|
+
"summary": "A poll: asks one question with a few answers. Visitors vote with one click and see everyone's results.",
|
|
2258
|
+
"x-keyboard": [
|
|
2259
|
+
{
|
|
2260
|
+
"context": "items",
|
|
2261
|
+
"key": "Enter",
|
|
2262
|
+
"action": "activates",
|
|
2263
|
+
"description": "Votes for the focused answer."
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
"context": "items",
|
|
2267
|
+
"key": "Space",
|
|
2268
|
+
"action": "activates",
|
|
2269
|
+
"description": "Votes for the focused answer."
|
|
2270
|
+
}
|
|
2271
|
+
],
|
|
2272
|
+
"x-keyboard-items": "button",
|
|
2273
|
+
"x-a11y": {
|
|
2274
|
+
"notes": [
|
|
2275
|
+
"After a vote the answers stay focusable but get `aria-disabled=\"true\"` and an `aria-description` with their share of the votes. A polite live region announces that the vote was counted."
|
|
2276
|
+
],
|
|
2277
|
+
"role": "group",
|
|
2278
|
+
"nameFrom": [
|
|
2279
|
+
"label"
|
|
2280
|
+
],
|
|
2281
|
+
"name": "The `label`, which is the question shown above the answers."
|
|
2282
|
+
},
|
|
2283
|
+
"x-guidance": {
|
|
2284
|
+
"use": "For a quick, one-click opinion poll on a page, with two to six answers.",
|
|
2285
|
+
"avoid": "For choices that are submitted with a form, for surveys with several questions, or where users need to review their answer before sending it.",
|
|
2286
|
+
"instead": "A radio group in a form, with a submit `va-button`."
|
|
2287
|
+
},
|
|
2288
|
+
"x-examples": [
|
|
2289
|
+
{
|
|
2290
|
+
"title": "A quick poll",
|
|
2291
|
+
"description": "Each answer is a button with a value and its votes so far in data-votes. One click counts the vote, fires va-select and shows the results.",
|
|
2292
|
+
"path": "src/poll/examples/1-quick-poll.html",
|
|
2293
|
+
"code": "<va-poll label=\"Tabs or spaces?\">\n <button value=\"tabs\" data-votes=\"12\">Tabs</button>\n <button value=\"spaces\" data-votes=\"30\">Spaces</button>\n <button value=\"formatter\" data-votes=\"9\">Whatever the formatter does</button>\n</va-poll>"
|
|
2294
|
+
},
|
|
2295
|
+
{
|
|
2296
|
+
"title": "After a vote",
|
|
2297
|
+
"description": "Set value to the answer the user chose before, and the poll shows the results with that answer marked. help-text adds a note under the vote count.",
|
|
2298
|
+
"path": "src/poll/examples/2-already-voted.html",
|
|
2299
|
+
"code": "<va-poll label=\"Which view library do you use most?\" value=\"lit\" help-text=\"The poll closes on Friday.\">\n <button value=\"lit\" data-votes=\"48\">Lit</button>\n <button value=\"react\" data-votes=\"61\">React</button>\n <button value=\"vue\" data-votes=\"27\">Vue</button>\n <button value=\"none\" data-votes=\"14\">None, plain DOM</button>\n</va-poll>"
|
|
2300
|
+
}
|
|
2301
|
+
]
|
|
2302
|
+
}
|
|
2303
|
+
],
|
|
2304
|
+
"exports": [
|
|
2305
|
+
{
|
|
2306
|
+
"kind": "js",
|
|
2307
|
+
"name": "VaPoll",
|
|
2308
|
+
"declaration": {
|
|
2309
|
+
"name": "VaPoll",
|
|
2310
|
+
"module": "src/poll/poll.ts"
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
]
|
|
2314
|
+
},
|
|
1624
2315
|
{
|
|
1625
2316
|
"kind": "javascript-module",
|
|
1626
2317
|
"path": "src/switch/switch.ts",
|