@warp-ds/elements 2.10.0-next.17 → 2.10.0-next.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +106 -0
- package/dist/docs/breadcrumb-item/api.md +27 -0
- package/dist/docs/breadcrumb-item/breadcrumb-item.md +34 -0
- package/dist/docs/breadcrumbs/accessibility.md +8 -18
- package/dist/docs/breadcrumbs/breadcrumbs.md +57 -34
- package/dist/docs/breadcrumbs/examples.md +8 -8
- package/dist/docs/breadcrumbs/styling.md +33 -0
- package/dist/docs/breadcrumbs/usage.md +8 -8
- package/dist/docs/index.md +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.d.ts +29 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.js +2520 -0
- package/dist/packages/breadcrumb-item/breadcrumb-item.js.map +7 -0
- package/dist/packages/breadcrumb-item/react.d.ts +2 -0
- package/dist/packages/breadcrumb-item/react.js +11 -0
- package/dist/packages/breadcrumb-item/styles.d.ts +4 -0
- package/dist/packages/breadcrumb-item/styles.js +72 -0
- package/dist/packages/breadcrumbs/breadcrumbs.d.ts +2 -0
- package/dist/packages/breadcrumbs/breadcrumbs.js +11 -13
- package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
- package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +11 -10
- package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +4 -5
- package/dist/packages/breadcrumbs/breadcrumbs.stories.js +14 -11
- package/dist/packages/pagination/pagination.react.stories.d.ts +2 -2
- package/dist/packages/pagination/react.d.ts +1 -1
- package/dist/packages/toast/styles.js +1 -1
- package/dist/packages/toast/toast.js +7 -7
- package/dist/packages/toast/toast.js.map +2 -2
- package/dist/packages/toast-container/toast-container.js +8 -8
- package/dist/packages/toast-container/toast-container.js.map +3 -3
- package/dist/web-types.json +37 -1
- package/eik/index.js +12 -12
- package/package.json +8 -1
|
@@ -2222,6 +2222,14 @@
|
|
|
2222
2222
|
},
|
|
2223
2223
|
"privacy": "private"
|
|
2224
2224
|
},
|
|
2225
|
+
{
|
|
2226
|
+
"kind": "field",
|
|
2227
|
+
"name": "_defaultLabel",
|
|
2228
|
+
"type": {
|
|
2229
|
+
"text": "string"
|
|
2230
|
+
},
|
|
2231
|
+
"privacy": "private"
|
|
2232
|
+
},
|
|
2225
2233
|
{
|
|
2226
2234
|
"kind": "field",
|
|
2227
2235
|
"name": "ariaLabel",
|
|
@@ -2230,6 +2238,15 @@
|
|
|
2230
2238
|
},
|
|
2231
2239
|
"description": "Accessible label for the breadcrumb navigation.\nDefaults to the localized \"You are here\" label. Set `aria-label` when the default label is not specific enough for the page."
|
|
2232
2240
|
},
|
|
2241
|
+
{
|
|
2242
|
+
"kind": "field",
|
|
2243
|
+
"name": "_label",
|
|
2244
|
+
"type": {
|
|
2245
|
+
"text": "string"
|
|
2246
|
+
},
|
|
2247
|
+
"privacy": "private",
|
|
2248
|
+
"readonly": true
|
|
2249
|
+
},
|
|
2233
2250
|
{
|
|
2234
2251
|
"kind": "field",
|
|
2235
2252
|
"name": "_children",
|
|
@@ -2269,6 +2286,95 @@
|
|
|
2269
2286
|
}
|
|
2270
2287
|
]
|
|
2271
2288
|
},
|
|
2289
|
+
{
|
|
2290
|
+
"kind": "javascript-module",
|
|
2291
|
+
"path": "packages/breadcrumb-item/breadcrumb-item.ts",
|
|
2292
|
+
"declarations": [
|
|
2293
|
+
{
|
|
2294
|
+
"kind": "class",
|
|
2295
|
+
"description": "Represents one item in a `w-breadcrumbs` trail.\nRenders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items.\n\n[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-breadcrumbs--docs)",
|
|
2296
|
+
"name": "WarpBreadcrumbItem",
|
|
2297
|
+
"slots": [
|
|
2298
|
+
{
|
|
2299
|
+
"description": "The breadcrumb label content.",
|
|
2300
|
+
"name": ""
|
|
2301
|
+
}
|
|
2302
|
+
],
|
|
2303
|
+
"members": [
|
|
2304
|
+
{
|
|
2305
|
+
"kind": "field",
|
|
2306
|
+
"name": "currentPage",
|
|
2307
|
+
"type": {
|
|
2308
|
+
"text": "boolean"
|
|
2309
|
+
},
|
|
2310
|
+
"default": "false",
|
|
2311
|
+
"description": "Marks this item as the current page.\nUse this on the final breadcrumb item so it exposes `aria-current=\"page\"` and does not render a trailing separator.",
|
|
2312
|
+
"attribute": "current-page"
|
|
2313
|
+
},
|
|
2314
|
+
{
|
|
2315
|
+
"kind": "field",
|
|
2316
|
+
"name": "href",
|
|
2317
|
+
"type": {
|
|
2318
|
+
"text": "string | null"
|
|
2319
|
+
},
|
|
2320
|
+
"default": "null",
|
|
2321
|
+
"description": "URL for linked breadcrumb items.\nWhen omitted, the item renders as non-focusable text.",
|
|
2322
|
+
"attribute": "href"
|
|
2323
|
+
}
|
|
2324
|
+
],
|
|
2325
|
+
"attributes": [
|
|
2326
|
+
{
|
|
2327
|
+
"name": "current-page",
|
|
2328
|
+
"type": {
|
|
2329
|
+
"text": "boolean"
|
|
2330
|
+
},
|
|
2331
|
+
"default": "false",
|
|
2332
|
+
"description": "Marks this item as the current page.\nUse this on the final breadcrumb item so it exposes `aria-current=\"page\"` and does not render a trailing separator.",
|
|
2333
|
+
"fieldName": "currentPage"
|
|
2334
|
+
},
|
|
2335
|
+
{
|
|
2336
|
+
"name": "href",
|
|
2337
|
+
"type": {
|
|
2338
|
+
"text": "string | null"
|
|
2339
|
+
},
|
|
2340
|
+
"default": "null",
|
|
2341
|
+
"description": "URL for linked breadcrumb items.\nWhen omitted, the item renders as non-focusable text.",
|
|
2342
|
+
"fieldName": "href"
|
|
2343
|
+
}
|
|
2344
|
+
],
|
|
2345
|
+
"superclass": {
|
|
2346
|
+
"name": "LitElement",
|
|
2347
|
+
"package": "lit"
|
|
2348
|
+
},
|
|
2349
|
+
"parent": {
|
|
2350
|
+
"name": "w-breadcrumbs",
|
|
2351
|
+
"description": ""
|
|
2352
|
+
},
|
|
2353
|
+
"tagName": "w-breadcrumb-item",
|
|
2354
|
+
"customElement": true,
|
|
2355
|
+
"modulePath": "packages/breadcrumb-item/breadcrumb-item.ts",
|
|
2356
|
+
"definitionPath": "packages/breadcrumb-item/breadcrumb-item.ts"
|
|
2357
|
+
}
|
|
2358
|
+
],
|
|
2359
|
+
"exports": [
|
|
2360
|
+
{
|
|
2361
|
+
"kind": "custom-element-definition",
|
|
2362
|
+
"name": "w-breadcrumb-item",
|
|
2363
|
+
"declaration": {
|
|
2364
|
+
"name": "WarpBreadcrumbItem",
|
|
2365
|
+
"module": "packages/breadcrumb-item/breadcrumb-item.ts"
|
|
2366
|
+
}
|
|
2367
|
+
},
|
|
2368
|
+
{
|
|
2369
|
+
"kind": "js",
|
|
2370
|
+
"name": "WarpBreadcrumbItem",
|
|
2371
|
+
"declaration": {
|
|
2372
|
+
"name": "WarpBreadcrumbItem",
|
|
2373
|
+
"module": "packages/breadcrumb-item/breadcrumb-item.ts"
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
]
|
|
2377
|
+
},
|
|
2272
2378
|
{
|
|
2273
2379
|
"kind": "javascript-module",
|
|
2274
2380
|
"path": "packages/card/card.ts",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
### `<w-breadcrumb-item>` API
|
|
2
|
+
|
|
3
|
+
#### Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Summary |
|
|
6
|
+
|-|-|-|-|
|
|
7
|
+
| current-page | `boolean` | `false` | Marks this item as the current page. |
|
|
8
|
+
| href | `string \| null` | `null` | URL for linked breadcrumb items. |
|
|
9
|
+
|
|
10
|
+
#### Property Details
|
|
11
|
+
|
|
12
|
+
##### current-page
|
|
13
|
+
|
|
14
|
+
Marks this item as the current page.
|
|
15
|
+
Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator.
|
|
16
|
+
|
|
17
|
+
- Type: `boolean`
|
|
18
|
+
- Default: `false`
|
|
19
|
+
|
|
20
|
+
##### href
|
|
21
|
+
|
|
22
|
+
URL for linked breadcrumb items.
|
|
23
|
+
When omitted, the item renders as non-focusable text.
|
|
24
|
+
|
|
25
|
+
- Type: `string | null`
|
|
26
|
+
- Default: `null`
|
|
27
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# BreadcrumbItem (w-breadcrumb-item)
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Represents one item in a `w-breadcrumbs` trail.
|
|
6
|
+
Renders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items.
|
|
7
|
+
|
|
8
|
+
### `<w-breadcrumb-item>` API
|
|
9
|
+
|
|
10
|
+
#### Properties
|
|
11
|
+
|
|
12
|
+
| Name | Type | Default | Summary |
|
|
13
|
+
|-|-|-|-|
|
|
14
|
+
| current-page | `boolean` | `false` | Marks this item as the current page. |
|
|
15
|
+
| href | `string \| null` | `null` | URL for linked breadcrumb items. |
|
|
16
|
+
|
|
17
|
+
#### Property Details
|
|
18
|
+
|
|
19
|
+
##### current-page
|
|
20
|
+
|
|
21
|
+
Marks this item as the current page.
|
|
22
|
+
Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator.
|
|
23
|
+
|
|
24
|
+
- Type: `boolean`
|
|
25
|
+
- Default: `false`
|
|
26
|
+
|
|
27
|
+
##### href
|
|
28
|
+
|
|
29
|
+
URL for linked breadcrumb items.
|
|
30
|
+
When omitted, the item renders as non-focusable text.
|
|
31
|
+
|
|
32
|
+
- Type: `string | null`
|
|
33
|
+
- Default: `null`
|
|
34
|
+
|
|
@@ -8,33 +8,23 @@ The component has a localized default accessible label. Use `aria-label` when th
|
|
|
8
8
|
|
|
9
9
|
```html
|
|
10
10
|
<w-breadcrumbs aria-label="Product category path">
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
11
|
+
<w-breadcrumb-item href="/marketplace">Marketplace</w-breadcrumb-item>
|
|
12
|
+
<w-breadcrumb-item href="/marketplace/furniture">Furniture</w-breadcrumb-item>
|
|
13
|
+
<w-breadcrumb-item href="/marketplace/furniture/1234566" current-page>Sofas</w-breadcrumb-item>
|
|
14
14
|
</w-breadcrumbs>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
### Mark The Current Page
|
|
18
18
|
|
|
19
|
-
The last breadcrumb item should represent the current page and include
|
|
19
|
+
The last breadcrumb item should represent the current page and include the current-page attribute which in turn ensures correct accessibility semantics are used.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Omit an href attribute for the current page when it should not be clickable:
|
|
22
22
|
|
|
23
23
|
```html
|
|
24
24
|
<w-breadcrumbs aria-label="You are here">
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
</w-breadcrumbs>
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
If the current page remains a link, keep `aria-current="page"` on that link:
|
|
32
|
-
|
|
33
|
-
```html
|
|
34
|
-
<w-breadcrumbs aria-label="You are here">
|
|
35
|
-
<a href="/real-estate">Real estate</a>
|
|
36
|
-
<a href="/real-estate/homes">Homes for sale</a>
|
|
37
|
-
<a href="/real-estate/homes/oslo" aria-current="page">Oslo</a>
|
|
25
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
26
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
27
|
+
<w-breadcrumb-item current-page>Oslo</w-breadcrumb-item>
|
|
38
28
|
</w-breadcrumbs>
|
|
39
29
|
```
|
|
40
30
|
|
|
@@ -13,13 +13,13 @@ Use `w-breadcrumbs` near the top of a page or section, before the main page head
|
|
|
13
13
|
|
|
14
14
|
### Basic Breadcrumbs
|
|
15
15
|
|
|
16
|
-
Use
|
|
16
|
+
Use w-breadcrumb-item components with an href for parent pages and mark the current page with the current-page attribute.
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
19
|
<w-breadcrumbs aria-label="You are here">
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
20
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
21
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
22
|
+
<w-breadcrumb-item current-page>Oslo</w-breadcrumb-item>
|
|
23
23
|
</w-breadcrumbs>
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -27,13 +27,13 @@ Use links for parent pages and mark the current page with `aria-current="page"`.
|
|
|
27
27
|
|
|
28
28
|
The current page should be the last breadcrumb item.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
By default the current-page will not be presented as a link, setting href will change it to a link.
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
33
|
<w-breadcrumbs aria-label="You are here">
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
<
|
|
34
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
35
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
36
|
+
<w-breadcrumb-item href="/real-estate/homes/12345612" current-page>Oslo</w-breadcrumb-item>
|
|
37
37
|
</w-breadcrumbs>
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -53,33 +53,23 @@ The component has a localized default accessible label. Use `aria-label` when th
|
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
55
|
<w-breadcrumbs aria-label="Product category path">
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
<
|
|
56
|
+
<w-breadcrumb-item href="/marketplace">Marketplace</w-breadcrumb-item>
|
|
57
|
+
<w-breadcrumb-item href="/marketplace/furniture">Furniture</w-breadcrumb-item>
|
|
58
|
+
<w-breadcrumb-item href="/marketplace/furniture/1234566" current-page>Sofas</w-breadcrumb-item>
|
|
59
59
|
</w-breadcrumbs>
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
### Mark The Current Page
|
|
63
63
|
|
|
64
|
-
The last breadcrumb item should represent the current page and include
|
|
64
|
+
The last breadcrumb item should represent the current page and include the current-page attribute which in turn ensures correct accessibility semantics are used.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Omit an href attribute for the current page when it should not be clickable:
|
|
67
67
|
|
|
68
68
|
```html
|
|
69
69
|
<w-breadcrumbs aria-label="You are here">
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
<
|
|
73
|
-
</w-breadcrumbs>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
If the current page remains a link, keep `aria-current="page"` on that link:
|
|
77
|
-
|
|
78
|
-
```html
|
|
79
|
-
<w-breadcrumbs aria-label="You are here">
|
|
80
|
-
<a href="/real-estate">Real estate</a>
|
|
81
|
-
<a href="/real-estate/homes">Homes for sale</a>
|
|
82
|
-
<a href="/real-estate/homes/oslo" aria-current="page">Oslo</a>
|
|
70
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
71
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
72
|
+
<w-breadcrumb-item current-page>Oslo</w-breadcrumb-item>
|
|
83
73
|
</w-breadcrumbs>
|
|
84
74
|
```
|
|
85
75
|
|
|
@@ -99,9 +89,9 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
99
89
|
|
|
100
90
|
```html
|
|
101
91
|
<w-breadcrumbs>
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
<
|
|
92
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
93
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
94
|
+
<w-breadcrumb-item current-page>Oslo</w-breadcrumb-item>
|
|
105
95
|
</w-breadcrumbs>
|
|
106
96
|
```
|
|
107
97
|
|
|
@@ -113,9 +103,9 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
113
103
|
|
|
114
104
|
```html
|
|
115
105
|
<w-breadcrumbs aria-label="Product category path">
|
|
116
|
-
<
|
|
117
|
-
<
|
|
118
|
-
<
|
|
106
|
+
<w-breadcrumb-item href="#/marketplace">Marketplace</w-breadcrumb-item>
|
|
107
|
+
<w-breadcrumb-item href="#/marketplace/furniture">Furniture</w-breadcrumb-item>
|
|
108
|
+
<w-breadcrumb-item current-page>Sofas</w-breadcrumb-item>
|
|
119
109
|
</w-breadcrumbs>
|
|
120
110
|
```
|
|
121
111
|
|
|
@@ -127,8 +117,8 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
127
117
|
|
|
128
118
|
```html
|
|
129
119
|
<w-breadcrumbs>
|
|
130
|
-
<
|
|
131
|
-
<
|
|
120
|
+
<w-breadcrumb-item href="#/help">Help</w-breadcrumb-item>
|
|
121
|
+
<w-breadcrumb-item current-page>Contact us</w-breadcrumb-item>
|
|
132
122
|
</w-breadcrumbs>
|
|
133
123
|
```
|
|
134
124
|
|
|
@@ -136,6 +126,39 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
136
126
|
|
|
137
127
|
## Styling API
|
|
138
128
|
|
|
129
|
+
### Breadcrumbs
|
|
130
|
+
|
|
131
|
+
The styling API for the Breadcrumbs component is under construction.
|
|
132
|
+
|
|
133
|
+
### Breadcrumb Item
|
|
134
|
+
|
|
135
|
+
The w-breadcrumb-item component supports styling through **parts**.
|
|
136
|
+
|
|
137
|
+
#### Parts
|
|
138
|
+
|
|
139
|
+
Use `::part(...)` from outside the component.
|
|
140
|
+
|
|
141
|
+
- `link` - the link element rendered when `href` is set.
|
|
142
|
+
- `text` - the text element rendered when `href` is omitted.
|
|
143
|
+
- `separator` - the separator rendered after non-current items.
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
|
|
147
|
+
```css
|
|
148
|
+
w-breadcrumb-item::part(link) {
|
|
149
|
+
text-decoration-thickness: 2px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
w-breadcrumb-item::part(separator) {
|
|
153
|
+
margin-inline: 1.2rem;
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Notes
|
|
158
|
+
|
|
159
|
+
- `separator` is not rendered when `current-page` is set.
|
|
160
|
+
- Use `link` for linked breadcrumb items and `text` for non-linked breadcrumb items.
|
|
161
|
+
|
|
139
162
|
## `<w-breadcrumbs>` API
|
|
140
163
|
|
|
141
164
|
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
```html
|
|
8
8
|
<w-breadcrumbs>
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
<
|
|
9
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
10
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
11
|
+
<w-breadcrumb-item current-page>Oslo</w-breadcrumb-item>
|
|
12
12
|
</w-breadcrumbs>
|
|
13
13
|
```
|
|
14
14
|
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
|
|
21
21
|
```html
|
|
22
22
|
<w-breadcrumbs aria-label="Product category path">
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
23
|
+
<w-breadcrumb-item href="#/marketplace">Marketplace</w-breadcrumb-item>
|
|
24
|
+
<w-breadcrumb-item href="#/marketplace/furniture">Furniture</w-breadcrumb-item>
|
|
25
|
+
<w-breadcrumb-item current-page>Sofas</w-breadcrumb-item>
|
|
26
26
|
</w-breadcrumbs>
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<w-breadcrumbs>
|
|
37
|
-
<
|
|
38
|
-
<
|
|
37
|
+
<w-breadcrumb-item href="#/help">Help</w-breadcrumb-item>
|
|
38
|
+
<w-breadcrumb-item current-page>Contact us</w-breadcrumb-item>
|
|
39
39
|
</w-breadcrumbs>
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -1 +1,34 @@
|
|
|
1
1
|
## Styling API
|
|
2
|
+
|
|
3
|
+
### Breadcrumbs
|
|
4
|
+
|
|
5
|
+
The styling API for the Breadcrumbs component is under construction.
|
|
6
|
+
|
|
7
|
+
### Breadcrumb Item
|
|
8
|
+
|
|
9
|
+
The w-breadcrumb-item component supports styling through **parts**.
|
|
10
|
+
|
|
11
|
+
#### Parts
|
|
12
|
+
|
|
13
|
+
Use `::part(...)` from outside the component.
|
|
14
|
+
|
|
15
|
+
- `link` - the link element rendered when `href` is set.
|
|
16
|
+
- `text` - the text element rendered when `href` is omitted.
|
|
17
|
+
- `separator` - the separator rendered after non-current items.
|
|
18
|
+
|
|
19
|
+
Example:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
w-breadcrumb-item::part(link) {
|
|
23
|
+
text-decoration-thickness: 2px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
w-breadcrumb-item::part(separator) {
|
|
27
|
+
margin-inline: 1.2rem;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
#### Notes
|
|
32
|
+
|
|
33
|
+
- `separator` is not rendered when `current-page` is set.
|
|
34
|
+
- Use `link` for linked breadcrumb items and `text` for non-linked breadcrumb items.
|
|
@@ -6,13 +6,13 @@ Use `w-breadcrumbs` near the top of a page or section, before the main page head
|
|
|
6
6
|
|
|
7
7
|
### Basic Breadcrumbs
|
|
8
8
|
|
|
9
|
-
Use
|
|
9
|
+
Use w-breadcrumb-item components with an href for parent pages and mark the current page with the current-page attribute.
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<w-breadcrumbs aria-label="You are here">
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
13
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
14
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
15
|
+
<w-breadcrumb-item current-page>Oslo</w-breadcrumb-item>
|
|
16
16
|
</w-breadcrumbs>
|
|
17
17
|
```
|
|
18
18
|
|
|
@@ -20,13 +20,13 @@ Use links for parent pages and mark the current page with `aria-current="page"`.
|
|
|
20
20
|
|
|
21
21
|
The current page should be the last breadcrumb item.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
By default the current-page will not be presented as a link, setting href will change it to a link.
|
|
24
24
|
|
|
25
25
|
```html
|
|
26
26
|
<w-breadcrumbs aria-label="You are here">
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<
|
|
27
|
+
<w-breadcrumb-item href="/real-estate">Real estate</w-breadcrumb-item>
|
|
28
|
+
<w-breadcrumb-item href="/real-estate/homes">Homes for sale</w-breadcrumb-item>
|
|
29
|
+
<w-breadcrumb-item href="/real-estate/homes/12345612" current-page>Oslo</w-breadcrumb-item>
|
|
30
30
|
</w-breadcrumbs>
|
|
31
31
|
```
|
|
32
32
|
|
package/dist/docs/index.md
CHANGED
|
@@ -14,6 +14,7 @@ Generated by `pnpm build:docs`. This file indexes the Markdown documentation shi
|
|
|
14
14
|
| Attention | `<w-attention>` | `attention` | Attention is a versatile component for displaying contextual information and messages. It can be used for a wide range of purposes, such as tooltips, callouts, popovers, and highlights. The component is designed to be anchored to a trigger element, providing contextual information related to that element. It supports various placements and styling options to accommodate different use cases and design needs. Note: attention will soon be split into multiple components (tooltip, callout, popover, highlight) at which time this component will be deprecated. For now, use the `tooltip`, `callout`, `popover`, and `highlight` boolean properties to achieve the desired style and behavior. | [attention.md](./attention/attention.md) |
|
|
15
15
|
| Badge | `<w-badge>` | `badge` | `w-badge` is used for showing a small amount of non-interactive color-categorized metadata, like a status or count. | [badge.md](./badge/badge.md) |
|
|
16
16
|
| Box | `<w-box>` | `box` | Box is a layout component used for separating content areas on a page. | [box.md](./box/box.md) |
|
|
17
|
+
| Breadcrumb Item | `<w-breadcrumb-item>` | `breadcrumb-item` | Represents one item in a `w-breadcrumbs` trail. Renders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items. | [breadcrumb-item.md](./breadcrumb-item/breadcrumb-item.md) |
|
|
17
18
|
| Breadcrumbs | `<w-breadcrumbs>` | `breadcrumbs` | Shows the navigation structure for the current page. Renders direct child links and non-link elements as a breadcrumb trail, inserts separators between items, and exposes the trail as navigation. | [breadcrumbs.md](./breadcrumbs/breadcrumbs.md) |
|
|
18
19
|
| Button | `<w-button>` | `button` | Performs an action or renders a link with button styling. Use button variants to match action priority, risk, and context. | [button.md](./button/button.md) |
|
|
19
20
|
| Card | `<w-card>` | `card` | Card is a layout component used for separating content areas on a page. | [card.md](./card/card.md) |
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { WarpAttention } from "./packages/attention/attention.ts";
|
|
|
8
8
|
import type { WarpBadge } from "./packages/badge/badge.ts";
|
|
9
9
|
import type { WarpBox } from "./packages/box/box.ts";
|
|
10
10
|
import type { WarpBreadcrumbs } from "./packages/breadcrumbs/breadcrumbs.ts";
|
|
11
|
+
import type { WarpBreadcrumbItem } from "./packages/breadcrumb-item/breadcrumb-item.ts";
|
|
11
12
|
import type { WarpCard } from "./packages/card/card.ts";
|
|
12
13
|
import type { WarpCheckbox, WCheckbox } from "./packages/checkbox/checkbox.ts";
|
|
13
14
|
import type {
|
|
@@ -856,6 +857,35 @@ Defaults to the localized "You are here" label. Set `aria-label` when the defaul
|
|
|
856
857
|
textContent?: string | number;
|
|
857
858
|
};
|
|
858
859
|
|
|
860
|
+
export type WarpBreadcrumbItemProps = {
|
|
861
|
+
/** Marks this item as the current page.
|
|
862
|
+
Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator. */
|
|
863
|
+
"current-page"?: WarpBreadcrumbItem["currentPage"];
|
|
864
|
+
/** Marks this item as the current page.
|
|
865
|
+
Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator. */
|
|
866
|
+
currentPage?: WarpBreadcrumbItem["currentPage"];
|
|
867
|
+
/** URL for linked breadcrumb items.
|
|
868
|
+
When omitted, the item renders as non-focusable text. */
|
|
869
|
+
href?: WarpBreadcrumbItem["href"];
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
export type WarpBreadcrumbItemSolidJsProps = {
|
|
873
|
+
/** Marks this item as the current page.
|
|
874
|
+
Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator. */
|
|
875
|
+
"bool:current-page"?: WarpBreadcrumbItem["currentPage"];
|
|
876
|
+
/** Marks this item as the current page.
|
|
877
|
+
Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator. */
|
|
878
|
+
"prop:currentPage"?: WarpBreadcrumbItem["currentPage"];
|
|
879
|
+
/** URL for linked breadcrumb items.
|
|
880
|
+
When omitted, the item renders as non-focusable text. */
|
|
881
|
+
"prop:href"?: WarpBreadcrumbItem["href"];
|
|
882
|
+
|
|
883
|
+
/** Set the innerHTML of the element */
|
|
884
|
+
innerHTML?: string;
|
|
885
|
+
/** Set the textContent of the element */
|
|
886
|
+
textContent?: string | number;
|
|
887
|
+
};
|
|
888
|
+
|
|
859
889
|
export type WarpCardProps = {
|
|
860
890
|
/** Whether the card is visually selected.
|
|
861
891
|
|
|
@@ -2588,6 +2618,31 @@ export type CustomElements = {
|
|
|
2588
2618
|
WarpBreadcrumbsProps & BaseProps<WarpBreadcrumbs> & BaseEvents
|
|
2589
2619
|
>;
|
|
2590
2620
|
|
|
2621
|
+
/**
|
|
2622
|
+
* Represents one item in a `w-breadcrumbs` trail.
|
|
2623
|
+
* Renders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items.
|
|
2624
|
+
*
|
|
2625
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-breadcrumbs--docs)
|
|
2626
|
+
*
|
|
2627
|
+
* ## Attributes & Properties
|
|
2628
|
+
*
|
|
2629
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
2630
|
+
*
|
|
2631
|
+
* - `current-page`/`currentPage`: Marks this item as the current page.
|
|
2632
|
+
* Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator.
|
|
2633
|
+
* - `href`: URL for linked breadcrumb items.
|
|
2634
|
+
* When omitted, the item renders as non-focusable text.
|
|
2635
|
+
*
|
|
2636
|
+
* ## Slots
|
|
2637
|
+
*
|
|
2638
|
+
* Areas where markup can be added to the component.
|
|
2639
|
+
*
|
|
2640
|
+
* - `(default)`: The breadcrumb label content.
|
|
2641
|
+
*/
|
|
2642
|
+
"w-breadcrumb-item": Partial<
|
|
2643
|
+
WarpBreadcrumbItemProps & BaseProps<WarpBreadcrumbItem> & BaseEvents
|
|
2644
|
+
>;
|
|
2645
|
+
|
|
2591
2646
|
/**
|
|
2592
2647
|
* Card is a layout component used for separating content areas on a page.
|
|
2593
2648
|
*
|
|
@@ -3457,6 +3512,7 @@ type CustomElementInstances = {
|
|
|
3457
3512
|
"w-badge": WarpBadge;
|
|
3458
3513
|
"w-box": WarpBox;
|
|
3459
3514
|
"w-breadcrumbs": WarpBreadcrumbs;
|
|
3515
|
+
"w-breadcrumb-item": WarpBreadcrumbItem;
|
|
3460
3516
|
"w-card": WarpCard;
|
|
3461
3517
|
"w-checkbox": WarpCheckbox;
|
|
3462
3518
|
"w-checkbox-group": WarpCheckboxGroup;
|
|
@@ -3496,6 +3552,7 @@ type CustomElementComponentProps = {
|
|
|
3496
3552
|
"w-badge": WarpBadgeProps;
|
|
3497
3553
|
"w-box": WarpBoxProps;
|
|
3498
3554
|
"w-breadcrumbs": WarpBreadcrumbsProps;
|
|
3555
|
+
"w-breadcrumb-item": WarpBreadcrumbItemProps;
|
|
3499
3556
|
"w-card": WarpCardProps;
|
|
3500
3557
|
"w-checkbox": WarpCheckboxProps;
|
|
3501
3558
|
"w-checkbox-group": WarpCheckboxGroupProps;
|
|
@@ -3863,6 +3920,34 @@ export type CustomElementsSolidJs = {
|
|
|
3863
3920
|
BaseEvents
|
|
3864
3921
|
>;
|
|
3865
3922
|
|
|
3923
|
+
/**
|
|
3924
|
+
* Represents one item in a `w-breadcrumbs` trail.
|
|
3925
|
+
* Renders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items.
|
|
3926
|
+
*
|
|
3927
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-breadcrumbs--docs)
|
|
3928
|
+
*
|
|
3929
|
+
* ## Attributes & Properties
|
|
3930
|
+
*
|
|
3931
|
+
* Component attributes and properties that can be applied to the element or by using JavaScript.
|
|
3932
|
+
*
|
|
3933
|
+
* - `current-page`/`currentPage`: Marks this item as the current page.
|
|
3934
|
+
* Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator.
|
|
3935
|
+
* - `href`: URL for linked breadcrumb items.
|
|
3936
|
+
* When omitted, the item renders as non-focusable text.
|
|
3937
|
+
*
|
|
3938
|
+
* ## Slots
|
|
3939
|
+
*
|
|
3940
|
+
* Areas where markup can be added to the component.
|
|
3941
|
+
*
|
|
3942
|
+
* - `(default)`: The breadcrumb label content.
|
|
3943
|
+
*/
|
|
3944
|
+
"w-breadcrumb-item": Partial<
|
|
3945
|
+
WarpBreadcrumbItemProps &
|
|
3946
|
+
WarpBreadcrumbItemSolidJsProps &
|
|
3947
|
+
BaseProps<WarpBreadcrumbItem> &
|
|
3948
|
+
BaseEvents
|
|
3949
|
+
>;
|
|
3950
|
+
|
|
3866
3951
|
/**
|
|
3867
3952
|
* Card is a layout component used for separating content areas on a page.
|
|
3868
3953
|
*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LitElement, nothing } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Represents one item in a `w-breadcrumbs` trail.
|
|
4
|
+
* Renders the slotted label as a link when `href` is set, or as text when it is not, and adds a separator after non-current items.
|
|
5
|
+
*
|
|
6
|
+
* [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-breadcrumbs--docs)
|
|
7
|
+
*
|
|
8
|
+
* @parent w-breadcrumbs
|
|
9
|
+
* @slot - The breadcrumb label content.
|
|
10
|
+
*/
|
|
11
|
+
declare class WarpBreadcrumbItem extends LitElement {
|
|
12
|
+
/**
|
|
13
|
+
* Marks this item as the current page.
|
|
14
|
+
* Use this on the final breadcrumb item so it exposes `aria-current="page"` and does not render a trailing separator.
|
|
15
|
+
*/
|
|
16
|
+
currentPage: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* URL for linked breadcrumb items.
|
|
19
|
+
* When omitted, the item renders as non-focusable text.
|
|
20
|
+
*/
|
|
21
|
+
href: string | null;
|
|
22
|
+
static styles: import("lit").CSSResult[];
|
|
23
|
+
/** @internal */
|
|
24
|
+
get link(): import("lit").TemplateResult<1>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
get separator(): import("lit").TemplateResult<1> | typeof nothing;
|
|
27
|
+
render(): import("lit").TemplateResult<1>;
|
|
28
|
+
}
|
|
29
|
+
export { WarpBreadcrumbItem };
|