@warp-ds/elements 2.10.0-next.17 → 2.10.0-next.19

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.
Files changed (104) hide show
  1. package/dist/custom-elements.json +285 -159
  2. package/dist/docs/affix/affix.md +117 -0
  3. package/dist/docs/affix/styling.md +107 -0
  4. package/dist/docs/breadcrumb-item/api.md +27 -0
  5. package/dist/docs/breadcrumb-item/breadcrumb-item.md +34 -0
  6. package/dist/docs/breadcrumbs/accessibility.md +8 -18
  7. package/dist/docs/breadcrumbs/breadcrumbs.md +120 -34
  8. package/dist/docs/breadcrumbs/examples.md +8 -8
  9. package/dist/docs/breadcrumbs/styling.md +96 -0
  10. package/dist/docs/breadcrumbs/usage.md +8 -8
  11. package/dist/docs/index.md +2 -1
  12. package/dist/docs/select/select.md +91 -0
  13. package/dist/docs/select/styling.md +91 -0
  14. package/dist/docs/textarea/styling.md +91 -0
  15. package/dist/docs/textarea/textarea.md +91 -0
  16. package/dist/docs/textfield/api.md +8 -0
  17. package/dist/docs/textfield/styling.md +95 -0
  18. package/dist/docs/textfield/textfield.md +103 -0
  19. package/dist/index.d.ts +175 -64
  20. package/dist/packages/affix/affix-styles.d.ts +8 -0
  21. package/dist/packages/affix/affix-styles.js +108 -0
  22. package/dist/packages/affix/affix.d.ts +11 -8
  23. package/dist/packages/affix/affix.js +118 -17
  24. package/dist/packages/affix/affix.js.map +4 -4
  25. package/dist/packages/affix/affix.react.stories.d.ts +1 -1
  26. package/dist/packages/affix/react.d.ts +1 -1
  27. package/dist/packages/alert/alert.js.map +1 -1
  28. package/dist/packages/attention/attention.js.map +1 -1
  29. package/dist/packages/breadcrumb-item/breadcrumb-item.d.ts +29 -0
  30. package/dist/packages/breadcrumb-item/breadcrumb-item.js +2529 -0
  31. package/dist/packages/breadcrumb-item/breadcrumb-item.js.map +7 -0
  32. package/dist/packages/breadcrumb-item/react.d.ts +2 -0
  33. package/dist/packages/breadcrumb-item/react.js +11 -0
  34. package/dist/packages/breadcrumb-item/styles.d.ts +4 -0
  35. package/dist/packages/breadcrumb-item/styles.js +81 -0
  36. package/dist/packages/breadcrumbs/breadcrumbs.d.ts +2 -0
  37. package/dist/packages/breadcrumbs/breadcrumbs.js +11 -13
  38. package/dist/packages/breadcrumbs/breadcrumbs.js.map +3 -3
  39. package/dist/packages/breadcrumbs/breadcrumbs.react.stories.js +11 -10
  40. package/dist/packages/breadcrumbs/breadcrumbs.stories.d.ts +4 -5
  41. package/dist/packages/breadcrumbs/breadcrumbs.stories.js +14 -11
  42. package/dist/packages/button/button.react.stories.d.ts +2 -2
  43. package/dist/packages/button/react.d.ts +1 -1
  44. package/dist/packages/checkbox-group/react.d.ts +1 -1
  45. package/dist/packages/combobox/combobox.react.stories.d.ts +2 -2
  46. package/dist/packages/combobox/react.d.ts +1 -1
  47. package/dist/packages/datepicker/datepicker.js.map +1 -1
  48. package/dist/packages/datepicker/datepicker.react.stories.d.ts +2 -2
  49. package/dist/packages/datepicker/react.d.ts +1 -1
  50. package/dist/packages/expandable/expandable.js.map +1 -1
  51. package/dist/packages/icon/icon.js +2 -2
  52. package/dist/packages/icon/icon.js.map +1 -1
  53. package/dist/packages/icon/icon.react.stories.d.ts +2 -1
  54. package/dist/packages/icon/icon.react.stories.js +1 -1
  55. package/dist/packages/modal-header/modal-header.js.map +1 -1
  56. package/dist/packages/pagination/pagination.js.map +1 -1
  57. package/dist/packages/pagination/pagination.react.stories.d.ts +2 -2
  58. package/dist/packages/pagination/react.d.ts +1 -1
  59. package/dist/packages/pill/pill.js.map +1 -1
  60. package/dist/packages/radio-group/react.d.ts +1 -1
  61. package/dist/packages/select/input-styles.d.ts +11 -0
  62. package/dist/packages/select/input-styles.js +88 -0
  63. package/dist/packages/select/react.d.ts +1 -1
  64. package/dist/packages/select/select.js +96 -19
  65. package/dist/packages/select/select.js.map +4 -4
  66. package/dist/packages/select/select.react.stories.d.ts +2 -2
  67. package/dist/packages/slider/react.d.ts +1 -1
  68. package/dist/packages/slider/slider.react.stories.d.ts +1 -1
  69. package/dist/packages/slider-thumb/react.d.ts +1 -1
  70. package/dist/packages/snackbar/snackbar.d.ts +2 -2
  71. package/dist/packages/snackbar/snackbar.js +1 -1
  72. package/dist/packages/snackbar/snackbar.js.map +2 -2
  73. package/dist/packages/step/step.js.map +1 -1
  74. package/dist/packages/textarea/input-styles.d.ts +11 -0
  75. package/dist/packages/textarea/input-styles.js +88 -0
  76. package/dist/packages/textarea/react.d.ts +1 -1
  77. package/dist/packages/textarea/textarea.js +99 -20
  78. package/dist/packages/textarea/textarea.js.map +4 -4
  79. package/dist/packages/textarea/textarea.react.stories.d.ts +2 -2
  80. package/dist/packages/textfield/input-styles.d.ts +11 -0
  81. package/dist/packages/textfield/input-styles.js +88 -0
  82. package/dist/packages/textfield/locales/da/messages.d.mts +1 -0
  83. package/dist/packages/textfield/locales/da/messages.mjs +1 -0
  84. package/dist/packages/textfield/locales/en/messages.d.mts +1 -0
  85. package/dist/packages/textfield/locales/en/messages.mjs +1 -0
  86. package/dist/packages/textfield/locales/fi/messages.d.mts +1 -0
  87. package/dist/packages/textfield/locales/fi/messages.mjs +1 -0
  88. package/dist/packages/textfield/locales/nb/messages.d.mts +1 -0
  89. package/dist/packages/textfield/locales/nb/messages.mjs +1 -0
  90. package/dist/packages/textfield/locales/sv/messages.d.mts +1 -0
  91. package/dist/packages/textfield/locales/sv/messages.mjs +1 -0
  92. package/dist/packages/textfield/react.d.ts +1 -1
  93. package/dist/packages/textfield/textfield.d.ts +11 -1
  94. package/dist/packages/textfield/textfield.js +111 -24
  95. package/dist/packages/textfield/textfield.js.map +4 -4
  96. package/dist/packages/textfield/textfield.react.stories.d.ts +2 -2
  97. package/dist/packages/toast/styles.js +1 -1
  98. package/dist/packages/toast/toast.js +7 -7
  99. package/dist/packages/toast/toast.js.map +2 -2
  100. package/dist/packages/toast-container/toast-container.js +8 -8
  101. package/dist/packages/toast-container/toast-container.js.map +3 -3
  102. package/dist/web-types.json +96 -50
  103. package/eik/index.js +20 -20
  104. package/package.json +8 -1
@@ -1 +1,108 @@
1
+ # Affix Styling
2
+
3
+ The affix component provides a comprehensive styling API through CSS custom properties (tokens).
4
+
1
5
  ## Styling API
6
+
7
+ ### Wrapper Tokens
8
+
9
+ Customize the appearance of the affix wrapper container:
10
+
11
+ ```css
12
+ --w-c-affix-wrapper-bg: transparent;
13
+ --w-c-affix-wrapper-border-radius: 0.4rem;
14
+ --w-c-affix-wrapper-padding-left: 1.2rem;
15
+ --w-c-affix-wrapper-padding-right: 1.2rem;
16
+ --w-c-affix-wrapper-width-with-label: max-content;
17
+ --w-c-affix-wrapper-width-with-icon: 4rem;
18
+ ```
19
+
20
+ ### Label Tokens
21
+
22
+ Customize the appearance of text labels (when `label` property is used):
23
+
24
+ ```css
25
+ --w-c-affix-label-color: var(--w-s-color-text);
26
+ --w-c-affix-label-font-size: var(--w-font-size-xs);
27
+ --w-c-affix-label-line-height: var(--w-line-height-xs);
28
+ --w-c-affix-label-font-weight: 700;
29
+ --w-c-affix-label-cursor: default;
30
+ ```
31
+
32
+ ## Parts
33
+
34
+ For advanced styling needs beyond tokens, you can target internal elements using CSS parts:
35
+
36
+ - `::part(wrapper)` - The container element (either `<div>` or `<button>` depending on variant)
37
+ - `::part(label)` - The text label element (when using `label` property)
38
+
39
+ ```css
40
+ w-affix::part(wrapper) {
41
+ /* Custom styling for the wrapper */
42
+ background-color: var(--w-s-color-background-subtle);
43
+ }
44
+
45
+ w-affix::part(label) {
46
+ /* Custom styling for text labels */
47
+ text-transform: uppercase;
48
+ }
49
+ ```
50
+
51
+ ## Example Usage
52
+
53
+ ### Customizing Label Color
54
+
55
+ ```css
56
+ w-affix {
57
+ --w-c-affix-label-color: var(--w-s-color-text-primary);
58
+ }
59
+ ```
60
+
61
+ ### Customizing Wrapper Background
62
+
63
+ ```css
64
+ w-affix {
65
+ --w-c-affix-wrapper-bg: var(--w-s-color-background-subtle);
66
+ --w-c-affix-wrapper-padding-left: 1.6rem;
67
+ --w-c-affix-wrapper-padding-right: 1.6rem;
68
+ }
69
+ ```
70
+
71
+ ### Adjusting Icon/Label Widths
72
+
73
+ ```css
74
+ w-affix {
75
+ --w-c-affix-wrapper-width-with-icon: 5rem;
76
+ --w-c-affix-wrapper-width-with-label: auto;
77
+ }
78
+ ```
79
+
80
+ ### Styling by Slot Position
81
+
82
+ Target prefix and suffix affixes differently:
83
+
84
+ ```css
85
+ /* Style only prefix affixes */
86
+ w-affix[slot='prefix'] {
87
+ --w-c-affix-wrapper-padding-left: 2rem;
88
+ }
89
+
90
+ /* Style only suffix affixes */
91
+ w-affix[slot='suffix'] {
92
+ --w-c-affix-wrapper-padding-right: 2rem;
93
+ }
94
+ ```
95
+
96
+ ### Using Parts for Advanced Customization
97
+
98
+ ```css
99
+ /* Add a border to the wrapper */
100
+ w-affix::part(wrapper) {
101
+ border-left: 1px solid var(--w-s-color-border);
102
+ }
103
+
104
+ /* Make labels italic */
105
+ w-affix::part(label) {
106
+ font-style: italic;
107
+ }
108
+ ```
@@ -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
- <a href="/marketplace">Marketplace</a>
12
- <a href="/marketplace/furniture">Furniture</a>
13
- <span aria-current="page">Sofas</span>
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 `aria-current="page"`.
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
- Use a non-link element for the current page when it should not be clickable:
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
- <a href="/real-estate">Real estate</a>
26
- <a href="/real-estate/homes">Homes for sale</a>
27
- <span aria-current="page">Oslo</span>
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 links for parent pages and mark the current page with `aria-current="page"`.
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
- <a href="/real-estate">Real estate</a>
21
- <a href="/real-estate/homes">Homes for sale</a>
22
- <span aria-current="page">Oslo</span>
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
- Use a `span` when the current page should not be clickable:
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
- <a href="/real-estate">Real estate</a>
35
- <a href="/real-estate/homes">Homes for sale</a>
36
- <span aria-current="page">Oslo</span>
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
- <a href="/marketplace">Marketplace</a>
57
- <a href="/marketplace/furniture">Furniture</a>
58
- <span aria-current="page">Sofas</span>
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 `aria-current="page"`.
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
- Use a non-link element for the current page when it should not be clickable:
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
- <a href="/real-estate">Real estate</a>
71
- <a href="/real-estate/homes">Homes for sale</a>
72
- <span aria-current="page">Oslo</span>
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
- <a href="#/real-estate">Real estate</a>
103
- <a href="#/real-estate/homes">Homes for sale</a>
104
- <span aria-current="page">Oslo</span>
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
- <a href="#/marketplace">Marketplace</a>
117
- <a href="#/marketplace/furniture">Furniture</a>
118
- <span aria-current="page">Sofas</span>
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
- <a href="#/help">Help</a>
131
- <span aria-current="page">Contact us</span>
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,102 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
136
126
 
137
127
  ## Styling API
138
128
 
129
+ ### Breadcrumbs
130
+
131
+ The breadcrumbs components support styling through **component tokens** (CSS custom properties with a `--w-c-` prefix) and **parts**.
132
+
133
+ `w-breadcrumbs` does not expose component-specific tokens. Set `w-breadcrumb-item` tokens on `w-breadcrumbs` or another ancestor to style all items in a breadcrumb trail.
134
+
135
+ ```css
136
+ w-breadcrumbs {
137
+ --w-c-breadcrumb-item-link-color: var(--w-s-color-text-link);
138
+ --w-c-breadcrumb-item-separator-spacing: 1.2rem;
139
+ }
140
+ ```
141
+
142
+ ### Breadcrumb Item
143
+
144
+ The `w-breadcrumb-item` component supports styling through **component tokens** and **parts**.
145
+
146
+ #### Component tokens
147
+
148
+ Set these on `w-breadcrumb-item` to override one item, or on `w-breadcrumbs` to let the values inherit into all item children.
149
+
150
+ ```css
151
+ w-breadcrumb-item {
152
+ --w-c-breadcrumb-item-link-color-hover: var(--w-s-color-text-link-hover);
153
+ --w-c-breadcrumb-item-font-weight: 700;
154
+ }
155
+ ```
156
+
157
+ ##### Layout and typography
158
+
159
+ | Token | Purpose | Default |
160
+ | ----------------------------------- | --------------------------------------- | ------------------- |
161
+ | `--w-c-breadcrumb-item-font-size` | Font size for the label and separator | inherited font size |
162
+ | `--w-c-breadcrumb-item-line-height` | Line height for the label and separator | `1.5` |
163
+ | `--w-c-breadcrumb-item-font-weight` | Font weight for the label and separator | `400` |
164
+ | `--w-c-breadcrumb-item-padding-x` | Inline padding for linked items | `0` |
165
+ | `--w-c-breadcrumb-item-padding-y` | Block padding for linked items | `0` |
166
+
167
+ ##### Link color
168
+
169
+ | Token | Purpose | Default |
170
+ | ----------------------------------------- | ------------------------------------------ | ---------------------------- |
171
+ | `--w-c-breadcrumb-item-link-color` | Color for linked items | `var(--w-s-color-text-link)` |
172
+ | `--w-c-breadcrumb-item-link-color-hover` | Color for linked items on hover | link color |
173
+ | `--w-c-breadcrumb-item-link-color-active` | Color for linked items in the active state | link color |
174
+
175
+ ##### Text color
176
+
177
+ | Token | Purpose | Default |
178
+ | ---------------------------------- | -------------------------- | ----------------------- |
179
+ | `--w-c-breadcrumb-item-text-color` | Color for non-linked items | `var(--w-s-color-text)` |
180
+
181
+ ##### Separator
182
+
183
+ | Token | Purpose | Default |
184
+ | ----------------------------------------- | ------------------------------------------- | ----------------------- |
185
+ | `--w-c-breadcrumb-item-separator-color` | Color for the separator | `var(--w-s-color-icon)` |
186
+ | `--w-c-breadcrumb-item-separator-spacing` | Inline margin on each side of the separator | `0.8rem` |
187
+
188
+ The separator uses `--w-c-breadcrumb-item-font-size`, `--w-c-breadcrumb-item-line-height`, and `--w-c-breadcrumb-item-font-weight`.
189
+
190
+ ##### Focus
191
+
192
+ | Token | Purpose | Default |
193
+ | -------------------------------------- | ------------------------------------- | -------------------- |
194
+ | `--w-c-breadcrumb-item-outline-width` | Focus outline width for linked items | native focus outline |
195
+ | `--w-c-breadcrumb-item-outline-color` | Focus outline color for linked items | native focus outline |
196
+ | `--w-c-breadcrumb-item-outline-offset` | Focus outline offset for linked items | native focus outline |
197
+
198
+ #### Parts
199
+
200
+ Use `::part(...)` from outside the component.
201
+
202
+ - `link` - the link element rendered when `href` is set.
203
+ - `text` - the text element rendered when `href` is omitted.
204
+ - `separator` - the separator rendered after non-current items.
205
+
206
+ Example:
207
+
208
+ ```css
209
+ w-breadcrumb-item::part(link) {
210
+ text-decoration-thickness: 2px;
211
+ }
212
+
213
+ w-breadcrumb-item::part(separator) {
214
+ margin-inline: 1.2rem;
215
+ }
216
+ ```
217
+
218
+ #### Notes
219
+
220
+ - `separator` is not rendered when `current-page` is set.
221
+ - Use `link` for linked breadcrumb items and `text` for non-linked breadcrumb items.
222
+ - Link color, padding, and focus tokens apply only when `href` is set.
223
+ - Focus tokens do not make non-linked breadcrumb items keyboard-focusable.
224
+
139
225
  ## `<w-breadcrumbs>` API
140
226
 
141
227
  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
- <a href="#/real-estate">Real estate</a>
10
- <a href="#/real-estate/homes">Homes for sale</a>
11
- <span aria-current="page">Oslo</span>
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
- <a href="#/marketplace">Marketplace</a>
24
- <a href="#/marketplace/furniture">Furniture</a>
25
- <span aria-current="page">Sofas</span>
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
- <a href="#/help">Help</a>
38
- <span aria-current="page">Contact us</span>
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,97 @@
1
1
  ## Styling API
2
+
3
+ ### Breadcrumbs
4
+
5
+ The breadcrumbs components support styling through **component tokens** (CSS custom properties with a `--w-c-` prefix) and **parts**.
6
+
7
+ `w-breadcrumbs` does not expose component-specific tokens. Set `w-breadcrumb-item` tokens on `w-breadcrumbs` or another ancestor to style all items in a breadcrumb trail.
8
+
9
+ ```css
10
+ w-breadcrumbs {
11
+ --w-c-breadcrumb-item-link-color: var(--w-s-color-text-link);
12
+ --w-c-breadcrumb-item-separator-spacing: 1.2rem;
13
+ }
14
+ ```
15
+
16
+ ### Breadcrumb Item
17
+
18
+ The `w-breadcrumb-item` component supports styling through **component tokens** and **parts**.
19
+
20
+ #### Component tokens
21
+
22
+ Set these on `w-breadcrumb-item` to override one item, or on `w-breadcrumbs` to let the values inherit into all item children.
23
+
24
+ ```css
25
+ w-breadcrumb-item {
26
+ --w-c-breadcrumb-item-link-color-hover: var(--w-s-color-text-link-hover);
27
+ --w-c-breadcrumb-item-font-weight: 700;
28
+ }
29
+ ```
30
+
31
+ ##### Layout and typography
32
+
33
+ | Token | Purpose | Default |
34
+ | ----------------------------------- | --------------------------------------- | ------------------- |
35
+ | `--w-c-breadcrumb-item-font-size` | Font size for the label and separator | inherited font size |
36
+ | `--w-c-breadcrumb-item-line-height` | Line height for the label and separator | `1.5` |
37
+ | `--w-c-breadcrumb-item-font-weight` | Font weight for the label and separator | `400` |
38
+ | `--w-c-breadcrumb-item-padding-x` | Inline padding for linked items | `0` |
39
+ | `--w-c-breadcrumb-item-padding-y` | Block padding for linked items | `0` |
40
+
41
+ ##### Link color
42
+
43
+ | Token | Purpose | Default |
44
+ | ----------------------------------------- | ------------------------------------------ | ---------------------------- |
45
+ | `--w-c-breadcrumb-item-link-color` | Color for linked items | `var(--w-s-color-text-link)` |
46
+ | `--w-c-breadcrumb-item-link-color-hover` | Color for linked items on hover | link color |
47
+ | `--w-c-breadcrumb-item-link-color-active` | Color for linked items in the active state | link color |
48
+
49
+ ##### Text color
50
+
51
+ | Token | Purpose | Default |
52
+ | ---------------------------------- | -------------------------- | ----------------------- |
53
+ | `--w-c-breadcrumb-item-text-color` | Color for non-linked items | `var(--w-s-color-text)` |
54
+
55
+ ##### Separator
56
+
57
+ | Token | Purpose | Default |
58
+ | ----------------------------------------- | ------------------------------------------- | ----------------------- |
59
+ | `--w-c-breadcrumb-item-separator-color` | Color for the separator | `var(--w-s-color-icon)` |
60
+ | `--w-c-breadcrumb-item-separator-spacing` | Inline margin on each side of the separator | `0.8rem` |
61
+
62
+ The separator uses `--w-c-breadcrumb-item-font-size`, `--w-c-breadcrumb-item-line-height`, and `--w-c-breadcrumb-item-font-weight`.
63
+
64
+ ##### Focus
65
+
66
+ | Token | Purpose | Default |
67
+ | -------------------------------------- | ------------------------------------- | -------------------- |
68
+ | `--w-c-breadcrumb-item-outline-width` | Focus outline width for linked items | native focus outline |
69
+ | `--w-c-breadcrumb-item-outline-color` | Focus outline color for linked items | native focus outline |
70
+ | `--w-c-breadcrumb-item-outline-offset` | Focus outline offset for linked items | native focus outline |
71
+
72
+ #### Parts
73
+
74
+ Use `::part(...)` from outside the component.
75
+
76
+ - `link` - the link element rendered when `href` is set.
77
+ - `text` - the text element rendered when `href` is omitted.
78
+ - `separator` - the separator rendered after non-current items.
79
+
80
+ Example:
81
+
82
+ ```css
83
+ w-breadcrumb-item::part(link) {
84
+ text-decoration-thickness: 2px;
85
+ }
86
+
87
+ w-breadcrumb-item::part(separator) {
88
+ margin-inline: 1.2rem;
89
+ }
90
+ ```
91
+
92
+ #### Notes
93
+
94
+ - `separator` is not rendered when `current-page` is set.
95
+ - Use `link` for linked breadcrumb items and `text` for non-linked breadcrumb items.
96
+ - Link color, padding, and focus tokens apply only when `href` is set.
97
+ - Focus tokens do not make non-linked breadcrumb items keyboard-focusable.
@@ -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 links for parent pages and mark the current page with `aria-current="page"`.
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
- <a href="/real-estate">Real estate</a>
14
- <a href="/real-estate/homes">Homes for sale</a>
15
- <span aria-current="page">Oslo</span>
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
- Use a `span` when the current page should not be clickable:
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
- <a href="/real-estate">Real estate</a>
28
- <a href="/real-estate/homes">Homes for sale</a>
29
- <span aria-current="page">Oslo</span>
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
 
@@ -9,11 +9,12 @@ Generated by `pnpm build:docs`. This file indexes the Markdown documentation shi
9
9
 
10
10
  | Component | Element / API | Package | Summary | Docs |
11
11
  |-|-|-|-|-|
12
- | Affix | `<w-affix>` | `affix` | This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`. | [affix.md](./affix/affix.md) |
12
+ | Affix | `<w-affix>` | `affix` | This component is usually used in other components like form elements to show a prefix or suffix. See for example `w-textfield`. ## Accessibility Note Due to shadow DOM encapsulation, ARIA attributes (like `aria-describedby`, `aria-labelledby`) cannot reference elements across shadow boundaries. This means: - Non-interactive affixes (text labels, icons) cannot be connected to the parent input via ARIA - Interactive affixes (buttons) must have their own `aria-label` (already implemented) - Do NOT attempt to reference affix content from parent components via ARIA ID references - it won't work For non-interactive labels (e.g., currency symbols), consider including the information in the main label or placeholder instead of relying on ARIA to announce affix content. | [affix.md](./affix/affix.md) |
13
13
  | Alert | `<w-alert>` | `alert` | Alert is an inline component used for displaying different types of messages. For accessibility reasons, alert should appear close to the element that triggered it. | [alert.md](./alert/alert.md) |
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) |