@aurodesignsystem/auro-formkit 5.9.0 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -4
- package/README.md +4 -4
- package/components/bibtemplate/dist/iconVersion.d.ts +1 -1
- package/components/bibtemplate/dist/index.js +2 -2
- package/components/bibtemplate/dist/registered.js +2 -2
- package/components/checkbox/README.md +62 -62
- package/components/checkbox/demo/api.js +1 -1
- package/components/checkbox/demo/api.md +127 -84
- package/components/checkbox/demo/api.min.js +125 -42
- package/components/checkbox/demo/index.md +9 -281
- package/components/checkbox/demo/index.min.js +125 -42
- package/components/checkbox/demo/readme.html +3 -4
- package/components/checkbox/demo/readme.md +62 -62
- package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -8
- package/components/checkbox/dist/auro-checkbox.d.ts +74 -20
- package/components/checkbox/dist/index.js +125 -42
- package/components/checkbox/dist/registered.js +125 -42
- package/components/combobox/README.md +76 -74
- package/components/combobox/demo/api.html +1 -0
- package/components/combobox/demo/api.js +11 -12
- package/components/combobox/demo/api.md +1302 -875
- package/components/combobox/demo/api.min.js +416 -492
- package/components/combobox/demo/index.html +1 -7
- package/components/combobox/demo/index.js +0 -19
- package/components/combobox/demo/index.md +43 -723
- package/components/combobox/demo/index.min.js +369 -302
- package/components/combobox/demo/readme.html +3 -4
- package/components/combobox/demo/readme.md +76 -74
- package/components/combobox/dist/auro-combobox.d.ts +42 -42
- package/components/combobox/dist/index.js +204 -210
- package/components/combobox/dist/registered.js +204 -210
- package/components/counter/README.md +81 -66
- package/components/counter/demo/api.html +1 -2
- package/components/counter/demo/api.js +2 -2
- package/components/counter/demo/api.md +777 -259
- package/components/counter/demo/api.min.js +119 -171
- package/components/counter/demo/index.html +0 -2
- package/components/counter/demo/index.md +20 -329
- package/components/counter/demo/index.min.js +117 -152
- package/components/counter/demo/readme.html +3 -4
- package/components/counter/demo/readme.md +81 -66
- package/components/counter/dist/auro-counter-group.d.ts +21 -36
- package/components/counter/dist/auro-counter-wrapper.d.ts +1 -6
- package/components/counter/dist/auro-counter.d.ts +5 -8
- package/components/counter/dist/index.js +117 -152
- package/components/counter/dist/registered.js +117 -152
- package/components/datepicker/README.md +57 -61
- package/components/datepicker/demo/api.js +8 -8
- package/components/datepicker/demo/api.md +720 -561
- package/components/datepicker/demo/api.min.js +678 -2769
- package/components/datepicker/demo/index.md +65 -117
- package/components/datepicker/demo/index.min.js +678 -2769
- package/components/datepicker/demo/readme.html +3 -4
- package/components/datepicker/demo/readme.md +57 -61
- package/components/datepicker/dist/auro-calendar.d.ts +60 -34
- package/components/datepicker/dist/auro-datepicker.d.ts +32 -32
- package/components/datepicker/dist/iconVersion.d.ts +1 -1
- package/components/datepicker/dist/index.js +505 -2596
- package/components/datepicker/dist/popoverVersion.d.ts +1 -1
- package/components/datepicker/dist/registered.js +505 -2596
- package/components/dropdown/README.md +78 -62
- package/components/dropdown/demo/api.js +4 -4
- package/components/dropdown/demo/api.md +520 -478
- package/components/dropdown/demo/api.min.js +80 -95
- package/components/dropdown/demo/index.md +65 -119
- package/components/dropdown/demo/index.min.js +70 -85
- package/components/dropdown/demo/readme.html +3 -4
- package/components/dropdown/demo/readme.md +78 -62
- package/components/dropdown/dist/auro-dropdown.d.ts +42 -33
- package/components/dropdown/dist/iconVersion.d.ts +1 -1
- package/components/dropdown/dist/index.js +70 -85
- package/components/dropdown/dist/registered.js +70 -85
- package/components/form/README.md +16 -58
- package/components/form/demo/api.md +16 -21
- package/components/form/demo/api.min.js +13 -8
- package/components/form/demo/index.md +38 -39
- package/components/form/demo/index.min.js +13 -8
- package/components/form/demo/readme.md +16 -58
- package/components/form/demo/working.html +1 -1
- package/components/form/dist/auro-form.d.ts +15 -3
- package/components/form/dist/index.js +13 -8
- package/components/form/dist/registered.js +13 -8
- package/components/input/README.md +55 -60
- package/components/input/demo/api.js +3 -5
- package/components/input/demo/api.md +558 -537
- package/components/input/demo/api.min.js +102 -115
- package/components/input/demo/index.js +0 -1
- package/components/input/demo/index.md +90 -203
- package/components/input/demo/index.min.js +87 -99
- package/components/input/demo/readme.html +3 -4
- package/components/input/demo/readme.md +55 -60
- package/components/input/dist/auro-input.d.ts +6 -5
- package/components/input/dist/base-input.d.ts +68 -69
- package/components/input/dist/iconVersion.d.ts +1 -1
- package/components/input/dist/index.js +87 -82
- package/components/input/dist/registered.js +87 -82
- package/components/menu/README.md +61 -61
- package/components/menu/demo/api.js +6 -8
- package/components/menu/demo/api.md +520 -577
- package/components/menu/demo/api.min.js +199 -97
- package/components/menu/demo/index.js +0 -5
- package/components/menu/demo/index.md +36 -119
- package/components/menu/demo/index.min.js +164 -101
- package/components/menu/demo/readme.html +3 -4
- package/components/menu/demo/readme.md +61 -61
- package/components/menu/dist/auro-menu.context.d.ts +5 -0
- package/components/menu/dist/auro-menu.d.ts +75 -37
- package/components/menu/dist/auro-menuoption.d.ts +38 -13
- package/components/menu/dist/index.js +164 -50
- package/components/menu/dist/registered.js +164 -50
- package/components/radio/README.md +61 -57
- package/components/radio/demo/api.js +2 -2
- package/components/radio/demo/api.md +241 -170
- package/components/radio/demo/api.min.js +154 -77
- package/components/radio/demo/index.md +22 -99
- package/components/radio/demo/index.min.js +145 -68
- package/components/radio/demo/readme.html +3 -4
- package/components/radio/demo/readme.md +61 -57
- package/components/radio/dist/auro-radio-group.d.ts +67 -35
- package/components/radio/dist/auro-radio.d.ts +56 -33
- package/components/radio/dist/index.js +145 -68
- package/components/radio/dist/registered.js +145 -68
- package/components/select/README.md +68 -65
- package/components/select/demo/api.html +1 -0
- package/components/select/demo/api.js +7 -7
- package/components/select/demo/api.md +1305 -625
- package/components/select/demo/api.min.js +357 -262
- package/components/select/demo/index.html +0 -2
- package/components/select/demo/index.md +25 -833
- package/components/select/demo/index.min.js +356 -230
- package/components/select/demo/readme.html +3 -4
- package/components/select/demo/readme.md +68 -65
- package/components/select/dist/auro-select.d.ts +99 -90
- package/components/select/dist/index.js +192 -180
- package/components/select/dist/registered.js +192 -180
- package/package.json +9 -4
|
@@ -1,69 +1,32 @@
|
|
|
1
1
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/api.md) -->
|
|
2
2
|
<!-- The below content is automatically added from ./../docs/api.md -->
|
|
3
3
|
|
|
4
|
-
# auro-counter
|
|
5
|
-
|
|
6
|
-
## Properties
|
|
7
|
-
|
|
8
|
-
| Property | Attribute | Type | Default | Description |
|
|
9
|
-
|--------------|--------------|-----------|-------------|--------------------------------------------------|
|
|
10
|
-
| [appearance](#appearance) | `appearance` | `string` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
|
|
11
|
-
| [disabled](#disabled) | `disabled` | `boolean` | false | Indicates if the counter is disabled. |
|
|
12
|
-
| [error](#error) | `error` | `string` | | Error state and message.<br />True if set, value is the error message. |
|
|
13
|
-
| [max](#max) | `max` | `number` | 9 | The maximum value for the counter. |
|
|
14
|
-
| [min](#min) | `min` | `number` | 0 | The minimum value for the counter. |
|
|
15
|
-
| [onDark](#onDark) | `onDark` | `boolean` | false | DEPRECATED - use `appearance` instead. |
|
|
16
|
-
| [validity](#validity) | `validity` | `string` | "undefined" | The validity state of the counter. |
|
|
17
|
-
| [value](#value) | `value` | `number` | "undefined" | The current value of the counter. |
|
|
18
|
-
|
|
19
|
-
## Methods
|
|
20
|
-
|
|
21
|
-
| Method | Type | Description |
|
|
22
|
-
|-------------|----------------------------------------|--------------------------------------------------|
|
|
23
|
-
| [decrement](#decrement) | `(value?: number \| undefined): void` | Decrements the value of the counter by 1. If a value is provided, it decrements by that amount.<br /><br />**value**: The amount to decrement by. |
|
|
24
|
-
| [increment](#increment) | `(value?: number \| undefined): void` | Increments the counter value by 1. If a value is provided, it increments by that amount.<br /><br />**value**: The amount to increment by. |
|
|
25
|
-
| [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
|
|
26
|
-
|
|
27
|
-
## Events
|
|
4
|
+
# auro-counter-group
|
|
28
5
|
|
|
29
|
-
|
|
30
|
-
|---------|------------------------------------------------|
|
|
31
|
-
| [input](#input) | `CustomEvent<{ value: number \| undefined; }>` |
|
|
32
|
-
|
|
33
|
-
## Slots
|
|
34
|
-
|
|
35
|
-
| Name | Description |
|
|
36
|
-
|-------------------|--------------------------------------------|
|
|
37
|
-
| | Main label content for the counter. |
|
|
38
|
-
| `ariaLabel.minus` | Accessible label for the decrement button. |
|
|
39
|
-
| `ariaLabel.plus` | Accessible label for the increment button. |
|
|
40
|
-
| [description](#description) | Descriptive content for the counter. |
|
|
41
|
-
| [helpText](#helpText) | Help text content for the counter. |
|
|
42
|
-
|
|
43
|
-
# auro-counter-group
|
|
6
|
+
The `auro-counter-group` element provides a flexible interface for grouping multiple counters, supporting validation, custom validity messages, and disabled states based on the group's value.
|
|
44
7
|
|
|
45
8
|
## Properties
|
|
46
9
|
|
|
47
|
-
| Property | Attribute | Type
|
|
48
|
-
|
|
49
|
-
| [appearance](#appearance) | `appearance` | `
|
|
50
|
-
| [autoPlacement](#autoPlacement) | `autoPlacement` | `boolean`
|
|
51
|
-
| [error](#error) | `error` | `string`
|
|
52
|
-
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `
|
|
53
|
-
| [isDropdown](#isDropdown) | `isDropdown` | `boolean`
|
|
54
|
-
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean`
|
|
55
|
-
| [layout](#layout) |
|
|
56
|
-
| [matchWidth](#matchWidth) | `matchWidth` | `boolean`
|
|
57
|
-
| [max](#max) | `max` | `number`
|
|
58
|
-
| [min](#min) | `min` | `number`
|
|
59
|
-
| [noFlip](#noFlip) | `noFlip` | `boolean`
|
|
60
|
-
| [offset](#offset) | `offset` | `number`
|
|
61
|
-
| [onDark](#onDark) | `onDark` | `boolean`
|
|
62
|
-
| [placement](#placement) | `placement` | `
|
|
63
|
-
| [shift](#shift) | `shift` | `boolean`
|
|
64
|
-
| [total](#total) | `total` | `number`
|
|
65
|
-
| [validity](#validity) | `validity` | `string`
|
|
66
|
-
| [value](#value) | `value` | `object`
|
|
10
|
+
| Property | Attribute | Type | Default | Description |
|
|
11
|
+
|---------------------------|---------------------------|--------------------------------------------------|------------------|--------------------------------------------------|
|
|
12
|
+
| [appearance](#appearance) | `appearance` | `'default' \| 'inverse'` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
|
|
13
|
+
| [autoPlacement](#autoPlacement) | `autoPlacement` | `boolean` | "false" | If declared, bib's position will be automatically calculated where to appear. |
|
|
14
|
+
| [error](#error) | `error` | `string` | | The current error message to display when the component is invalid. |
|
|
15
|
+
| [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl' \| 'disabled'` | "'sm'" | Defines the screen size breakpoint at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
|
|
16
|
+
| [isDropdown](#isDropdown) | `isDropdown` | `boolean` | false | If true, the counter group is displayed as a dropdown. |
|
|
17
|
+
| [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | false | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
|
|
18
|
+
| [layout](#layout) | `layout` | `'classic' \| 'snowflake'` | "'classic'" | Determines the layout style of the counter group when it is a dropdown. |
|
|
19
|
+
| [matchWidth](#matchWidth) | `matchWidth` | `boolean` | false | If declared, the dropdown will expand to the width of its parent container.<br />Otherwise, the dropdown width will be determined by its content. |
|
|
20
|
+
| [max](#max) | `max` | `number` | "undefined" | The maximum value allowed for the whole group of counters. |
|
|
21
|
+
| [min](#min) | `min` | `number` | "undefined" | The minimum value allowed for the whole group of counters. |
|
|
22
|
+
| [noFlip](#noFlip) | `noFlip` | `boolean` | false | If declared, the bib will NOT flip to an alternate position<br />when there isn't enough space in the specified `placement`. |
|
|
23
|
+
| [offset](#offset) | `offset` | `number` | "0" | Gap between the trigger element and bib. |
|
|
24
|
+
| [onDark](#onDark) | `onDark` | `boolean` | false | DEPRECATED - use `appearance` instead. |
|
|
25
|
+
| [placement](#placement) | `placement` | `'top' \| 'right' \| 'bottom' \| 'left' \| 'bottom-start' \| 'top-start' \| 'top-end' \| 'right-start' \| 'right-end' \| 'bottom-end' \| 'left-start' \| 'left-end'` | "'bottom-start'" | Position where the bib should appear relative to the trigger. |
|
|
26
|
+
| [shift](#shift) | `shift` | `boolean` | false | If declared, the dropdown will shift its position to avoid being cut off by the viewport. |
|
|
27
|
+
| [total](#total) | `total` | `number` | "undefined" | The total value of the counters. |
|
|
28
|
+
| [validity](#validity) | `validity` | `string` | "undefined" | Reflects the validity state. |
|
|
29
|
+
| [value](#value) | `value` | `object` | "undefined" | The current individual values of the nested counters. |
|
|
67
30
|
|
|
68
31
|
## Methods
|
|
69
32
|
|
|
@@ -89,38 +52,142 @@
|
|
|
89
52
|
| [default](#default) | Slot for counter elements. |
|
|
90
53
|
| [helpText](#helpText) | Dropdown help text content. Only used when `isDropdown` is true. |
|
|
91
54
|
| [label](#label) | Dropdown label content. Only used when `isDropdown` is true. |
|
|
92
|
-
| [valueText](#valueText) | Dropdown value text display. Only used when `isDropdown` is true. |
|
|
55
|
+
| [valueText](#valueText) | Dropdown value text display. Only used when `isDropdown` is true. |
|
|
56
|
+
|
|
57
|
+
# auro-counter
|
|
58
|
+
|
|
59
|
+
The `auro-counter` element provides a flexible counter interface with increment and decrement buttons, supporting optional sub-labels and disabled states.
|
|
60
|
+
|
|
61
|
+
## Properties
|
|
62
|
+
|
|
63
|
+
| Property | Attribute | Type | Default | Description |
|
|
64
|
+
|--------------|--------------|--------------------------|-------------|--------------------------------------------------|
|
|
65
|
+
| [appearance](#appearance) | `appearance` | `'default' \| 'inverse'` | "'default'" | Defines whether the component will be on lighter or darker backgrounds. |
|
|
66
|
+
| [disabled](#disabled) | `disabled` | `boolean` | | Indicates if the counter is disabled. |
|
|
67
|
+
| [error](#error) | `error` | `string` | | Error state and message.<br />True if set, value is the error message. |
|
|
68
|
+
| [max](#max) | `max` | `number` | | The maximum value for the counter. |
|
|
69
|
+
| [min](#min) | `min` | `number` | | The minimum value for the counter. |
|
|
70
|
+
| [onDark](#onDark) | `onDark` | `boolean` | | DEPRECATED - use `appearance="inverse"` instead. |
|
|
71
|
+
| [validity](#validity) | `validity` | `string` | | The validity state of the counter. |
|
|
72
|
+
| [value](#value) | `value` | `number` | | The current value of the counter. |
|
|
73
|
+
|
|
74
|
+
## Methods
|
|
75
|
+
|
|
76
|
+
| Method | Type | Description |
|
|
77
|
+
|-------------|----------------------------------------|--------------------------------------------------|
|
|
78
|
+
| [decrement](#decrement) | `(value?: number \| undefined): void` | Decrements the value of the counter by 1. If a value is provided, it decrements by that amount.<br /><br />**value**: The amount to decrement by. |
|
|
79
|
+
| [increment](#increment) | `(value?: number \| undefined): void` | Increments the counter value by 1. If a value is provided, it increments by that amount.<br /><br />**value**: The amount to increment by. |
|
|
80
|
+
| [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
|
|
81
|
+
|
|
82
|
+
## Events
|
|
83
|
+
|
|
84
|
+
| Event | Type |
|
|
85
|
+
|---------|------------------------------------------------|
|
|
86
|
+
| [input](#input) | `CustomEvent<{ value: number \| undefined; }>` |
|
|
87
|
+
|
|
88
|
+
## Slots
|
|
89
|
+
|
|
90
|
+
| Name | Description |
|
|
91
|
+
|-------------------|--------------------------------------------|
|
|
92
|
+
| `ariaLabel.minus` | Accessible label for the decrement button. |
|
|
93
|
+
| `ariaLabel.plus` | Accessible label for the increment button. |
|
|
94
|
+
| [default](#default) | Main label content for the counter. |
|
|
95
|
+
| [description](#description) | Descriptive content for the counter. |
|
|
96
|
+
| [helpText](#helpText) | Help text content for the counter. |
|
|
93
97
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
94
98
|
|
|
95
|
-
##
|
|
99
|
+
## Basic Counter
|
|
100
|
+
|
|
101
|
+
<div class="exampleWrapper">
|
|
102
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic-standalone.html) -->
|
|
103
|
+
<!-- The below content is automatically added from ./../apiExamples/basic-standalone.html -->
|
|
104
|
+
<auro-counter>
|
|
105
|
+
Adults
|
|
106
|
+
</auro-counter>
|
|
107
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
108
|
+
</div>
|
|
109
|
+
<auro-accordion alignRight>
|
|
110
|
+
<span slot="trigger">See code</span>
|
|
111
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic-standalone.html) -->
|
|
112
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic-standalone.html -->
|
|
96
113
|
|
|
97
|
-
|
|
114
|
+
```html
|
|
115
|
+
<auro-counter>
|
|
116
|
+
Adults
|
|
117
|
+
</auro-counter>
|
|
118
|
+
```
|
|
119
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
120
|
+
</auro-accordion>
|
|
98
121
|
|
|
99
|
-
|
|
122
|
+
## Basic Counter Group
|
|
123
|
+
|
|
100
124
|
<div class="exampleWrapper">
|
|
101
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
102
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
103
|
-
<auro-counter
|
|
125
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
126
|
+
<!-- The below content is automatically added from ./../apiExamples/basic.html -->
|
|
127
|
+
<auro-counter-group>
|
|
128
|
+
<auro-counter>
|
|
129
|
+
Short label
|
|
130
|
+
</auro-counter>
|
|
131
|
+
<auro-counter>
|
|
132
|
+
Another short label
|
|
133
|
+
</auro-counter>
|
|
134
|
+
<auro-counter>
|
|
135
|
+
This is an example of the wrapping behavior for a long label
|
|
136
|
+
</auro-counter>
|
|
137
|
+
</auro-counter-group>
|
|
138
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
139
|
+
</div>
|
|
140
|
+
<auro-accordion alignRight>
|
|
141
|
+
<span slot="trigger">See code</span>
|
|
142
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.html) -->
|
|
143
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/basic.html -->
|
|
144
|
+
|
|
145
|
+
```html
|
|
146
|
+
<auro-counter-group>
|
|
147
|
+
<auro-counter>
|
|
148
|
+
Short label
|
|
149
|
+
</auro-counter>
|
|
150
|
+
<auro-counter>
|
|
151
|
+
Another short label
|
|
152
|
+
</auro-counter>
|
|
153
|
+
<auro-counter>
|
|
154
|
+
This is an example of the wrapping behavior for a long label
|
|
155
|
+
</auro-counter>
|
|
156
|
+
</auro-counter-group>
|
|
157
|
+
```
|
|
158
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
159
|
+
</auro-accordion>
|
|
160
|
+
|
|
161
|
+
## Counter Properties & Attribute Examples
|
|
162
|
+
|
|
163
|
+
### Appearance on Dark Backgrounds
|
|
164
|
+
|
|
165
|
+
Use `appearance="inverse"` to ensure proper contrast on dark backgrounds.
|
|
166
|
+
|
|
167
|
+
<div class="exampleWrapper--ondark" aria-hidden>
|
|
168
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse.html) -->
|
|
169
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
170
|
+
<auro-counter appearance="inverse">
|
|
104
171
|
Adults
|
|
105
|
-
<span slot="description">Min: 1, Max: 5</span>
|
|
106
172
|
</auro-counter>
|
|
107
173
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
108
174
|
</div>
|
|
109
175
|
<auro-accordion alignRight>
|
|
110
|
-
<span slot="trigger">See code</span>
|
|
111
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
112
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
176
|
+
<span slot="trigger">See code</span>
|
|
177
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse.html) -->
|
|
178
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse.html -->
|
|
113
179
|
|
|
114
180
|
```html
|
|
115
|
-
<auro-counter
|
|
181
|
+
<auro-counter appearance="inverse">
|
|
116
182
|
Adults
|
|
117
|
-
<span slot="description">Min: 1, Max: 5</span>
|
|
118
183
|
</auro-counter>
|
|
119
184
|
```
|
|
120
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
185
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
121
186
|
</auro-accordion>
|
|
122
187
|
|
|
123
|
-
|
|
188
|
+
### Disabled
|
|
189
|
+
|
|
190
|
+
A counter can be disabled by adding the `disabled` attribute.
|
|
124
191
|
|
|
125
192
|
<div class="exampleWrapper">
|
|
126
193
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/counter-disabled.html) -->
|
|
@@ -132,8 +199,8 @@
|
|
|
132
199
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
133
200
|
</div>
|
|
134
201
|
<div class="exampleWrapper--ondark" aria-hidden>
|
|
135
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
136
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
202
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-disabled.html) -->
|
|
203
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-disabled.html -->
|
|
137
204
|
<auro-counter appearance="inverse" disabled value="0">
|
|
138
205
|
Disabled counter
|
|
139
206
|
<span slot="description">This counter cannot be modified</span>
|
|
@@ -152,193 +219,235 @@
|
|
|
152
219
|
</auro-counter>
|
|
153
220
|
```
|
|
154
221
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
155
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
156
|
-
<!-- The below
|
|
222
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-disabled.html) -->
|
|
223
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-disabled.html -->
|
|
224
|
+
|
|
225
|
+
```html
|
|
157
226
|
<auro-counter appearance="inverse" disabled value="0">
|
|
158
227
|
Disabled counter
|
|
159
228
|
<span slot="description">This counter cannot be modified</span>
|
|
160
|
-
</auro-counter>
|
|
229
|
+
</auro-counter>
|
|
230
|
+
```
|
|
161
231
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
162
232
|
</auro-accordion>
|
|
163
233
|
|
|
164
|
-
###
|
|
234
|
+
### Error
|
|
235
|
+
|
|
236
|
+
A custom error can be set on the counter by adding the `error` attribute the desired message.
|
|
237
|
+
|
|
238
|
+
<div class="exampleWrapper">
|
|
239
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/counter-error.html) -->
|
|
240
|
+
<!-- The below content is automatically added from ./../apiExamples/counter-error.html -->
|
|
241
|
+
<auro-counter error="There is an error with the counter">
|
|
242
|
+
Adults
|
|
243
|
+
</auro-counter>
|
|
244
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
245
|
+
</div>
|
|
246
|
+
<div class="exampleWrapper--ondark" aria-hidden>
|
|
247
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-error.html) -->
|
|
248
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-error.html -->
|
|
249
|
+
<auro-counter appearance="inverse" error="There is an error with the counter">
|
|
250
|
+
Adults
|
|
251
|
+
</auro-counter>
|
|
252
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
253
|
+
</div>
|
|
254
|
+
<auro-accordion alignRight>
|
|
255
|
+
<span slot="trigger">See code</span>
|
|
256
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/counter-error.html) -->
|
|
257
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/counter-error.html -->
|
|
258
|
+
|
|
259
|
+
```html
|
|
260
|
+
<auro-counter error="There is an error with the counter">
|
|
261
|
+
Adults
|
|
262
|
+
</auro-counter>
|
|
263
|
+
```
|
|
264
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
265
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-error.html) -->
|
|
266
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-error.html -->
|
|
267
|
+
|
|
268
|
+
```html
|
|
269
|
+
<auro-counter appearance="inverse" error="There is an error with the counter">
|
|
270
|
+
Adults
|
|
271
|
+
</auro-counter>
|
|
272
|
+
```
|
|
273
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
274
|
+
</auro-accordion>
|
|
165
275
|
|
|
166
|
-
|
|
167
|
-
|
|
276
|
+
### Min/Max and Value
|
|
277
|
+
|
|
278
|
+
Use the `min`, `max`, and `value` attributes to set the minimum and maximum allowable values for the counter, as well as its initial value.
|
|
168
279
|
|
|
169
280
|
<div class="exampleWrapper">
|
|
170
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
171
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
<div slot="helpText">Total must be between 2-10</div>
|
|
177
|
-
<div slot="valueText">Custom total display</div>
|
|
178
|
-
<auro-counter>
|
|
179
|
-
Counter 1
|
|
180
|
-
</auro-counter>
|
|
181
|
-
<auro-counter>
|
|
182
|
-
Counter 2
|
|
183
|
-
</auro-counter>
|
|
184
|
-
</auro-counter-group>
|
|
281
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/counter-minmax.html) -->
|
|
282
|
+
<!-- The below content is automatically added from ./../apiExamples/counter-minmax.html -->
|
|
283
|
+
<auro-counter min="1" max="5" value="2">
|
|
284
|
+
Adults
|
|
285
|
+
<span slot="description">Min: 1, Max: 5</span>
|
|
286
|
+
</auro-counter>
|
|
185
287
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
186
288
|
</div>
|
|
187
289
|
<auro-accordion alignRight>
|
|
188
290
|
<span slot="trigger">See code</span>
|
|
189
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
190
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
291
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/counter-minmax.html) -->
|
|
292
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/counter-minmax.html -->
|
|
191
293
|
|
|
192
294
|
```html
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
<
|
|
196
|
-
|
|
197
|
-
<div slot="helpText">Total must be between 2-10</div>
|
|
198
|
-
<div slot="valueText">Custom total display</div>
|
|
199
|
-
<auro-counter>
|
|
200
|
-
Counter 1
|
|
201
|
-
</auro-counter>
|
|
202
|
-
<auro-counter>
|
|
203
|
-
Counter 2
|
|
204
|
-
</auro-counter>
|
|
205
|
-
</auro-counter-group>
|
|
295
|
+
<auro-counter min="1" max="5" value="2">
|
|
296
|
+
Adults
|
|
297
|
+
<span slot="description">Min: 1, Max: 5</span>
|
|
298
|
+
</auro-counter>
|
|
206
299
|
```
|
|
207
300
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
208
301
|
</auro-accordion>
|
|
209
302
|
|
|
210
|
-
|
|
211
|
-
|
|
303
|
+
## Counter Slot Examples
|
|
304
|
+
|
|
305
|
+
### Description
|
|
306
|
+
|
|
307
|
+
A description can be added with the `description` slot. The description appears below the main label and is useful for displaying important information or requirements.
|
|
212
308
|
|
|
213
309
|
<div class="exampleWrapper">
|
|
214
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
215
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
</auro-counter>
|
|
230
|
-
</auro-counter-group>
|
|
310
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/description.html) -->
|
|
311
|
+
<!-- The below content is automatically added from ./../apiExamples/description.html -->
|
|
312
|
+
<auro-counter>
|
|
313
|
+
Adults
|
|
314
|
+
<span slot="description">18 years or older</span>
|
|
315
|
+
</auro-counter>
|
|
316
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
317
|
+
</div>
|
|
318
|
+
<div class="exampleWrapper--ondark" aria-hidden>
|
|
319
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-description.html) -->
|
|
320
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-description.html -->
|
|
321
|
+
<auro-counter appearance="inverse">
|
|
322
|
+
Adults
|
|
323
|
+
<span slot="description">18 years or older</span>
|
|
324
|
+
</auro-counter>
|
|
231
325
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
232
326
|
</div>
|
|
233
327
|
<auro-accordion alignRight>
|
|
234
|
-
<span slot="trigger">See code</span>
|
|
235
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
236
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
328
|
+
<span slot="trigger">See code</span>
|
|
329
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/description.html) -->
|
|
330
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/description.html -->
|
|
237
331
|
|
|
238
332
|
```html
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
333
|
+
<auro-counter>
|
|
334
|
+
Adults
|
|
335
|
+
<span slot="description">18 years or older</span>
|
|
336
|
+
</auro-counter>
|
|
337
|
+
```
|
|
338
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
339
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-description.html) -->
|
|
340
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-description.html -->
|
|
341
|
+
|
|
342
|
+
```html
|
|
343
|
+
<auro-counter appearance="inverse">
|
|
344
|
+
Adults
|
|
345
|
+
<span slot="description">18 years or older</span>
|
|
346
|
+
</auro-counter>
|
|
347
|
+
```
|
|
348
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
349
|
+
</auro-accordion>
|
|
350
|
+
|
|
351
|
+
### Help Text
|
|
352
|
+
|
|
353
|
+
Help text is supported with counters, and can be added by targetting the `helptext` slot.
|
|
354
|
+
|
|
355
|
+
<div class="exampleWrapper">
|
|
356
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/counter-helptext.html) -->
|
|
357
|
+
<!-- The below content is automatically added from ./../apiExamples/counter-helptext.html -->
|
|
247
358
|
<auro-counter>
|
|
248
|
-
|
|
249
|
-
<span slot="
|
|
250
|
-
<span slot="ariaLabel.plus">Custom Plus Button Label</span>
|
|
251
|
-
<span slot="description">Description slot content</span>
|
|
359
|
+
Adults
|
|
360
|
+
<span slot="helpText">This is help text for the counter</span>
|
|
252
361
|
</auro-counter>
|
|
253
|
-
|
|
362
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
363
|
+
</div>
|
|
364
|
+
<div class="exampleWrapper--ondark" aria-hidden>
|
|
365
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-helptext.html) -->
|
|
366
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-helptext.html -->
|
|
367
|
+
<auro-counter appearance="inverse">
|
|
368
|
+
Adults
|
|
369
|
+
<span slot="helpText">This is help text for the counter</span>
|
|
370
|
+
</auro-counter>
|
|
371
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
372
|
+
</div>
|
|
373
|
+
<auro-accordion alignRight>
|
|
374
|
+
<span slot="trigger">See code</span>
|
|
375
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/counter-helptext.html) -->
|
|
376
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/counter-helptext.html -->
|
|
377
|
+
|
|
378
|
+
```html
|
|
379
|
+
<auro-counter>
|
|
380
|
+
Adults
|
|
381
|
+
<span slot="helpText">This is help text for the counter</span>
|
|
382
|
+
</auro-counter>
|
|
254
383
|
```
|
|
255
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
384
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
385
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-helptext.html) -->
|
|
386
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-helptext.html -->
|
|
387
|
+
|
|
388
|
+
```html
|
|
389
|
+
<auro-counter appearance="inverse">
|
|
390
|
+
Adults
|
|
391
|
+
<span slot="helpText">This is help text for the counter</span>
|
|
392
|
+
</auro-counter>
|
|
393
|
+
```
|
|
394
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
256
395
|
</auro-accordion>
|
|
257
396
|
|
|
258
|
-
|
|
259
|
-
|
|
397
|
+
## Counter Group Properties & Attribute Examples
|
|
398
|
+
|
|
399
|
+
### Appearance on Dark Backgrounds
|
|
260
400
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
<!--
|
|
266
|
-
|
|
267
|
-
<auro-counter-group id="eventExample">
|
|
401
|
+
Use `appearance="inverse"` to ensure proper contrast on dark backgrounds.
|
|
402
|
+
|
|
403
|
+
<div class="exampleWrapper--ondark" aria-hidden>
|
|
404
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-group.html) -->
|
|
405
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-group.html -->
|
|
406
|
+
<auro-counter-group appearance="inverse">
|
|
268
407
|
<auro-counter>
|
|
269
|
-
|
|
408
|
+
Short label
|
|
270
409
|
</auro-counter>
|
|
271
410
|
<auro-counter>
|
|
272
|
-
|
|
411
|
+
Another short label
|
|
412
|
+
</auro-counter>
|
|
413
|
+
<auro-counter>
|
|
414
|
+
This is an example of the wrapping behavior for a long label
|
|
273
415
|
</auro-counter>
|
|
274
416
|
</auro-counter-group>
|
|
275
417
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
276
418
|
</div>
|
|
277
419
|
<auro-accordion alignRight>
|
|
278
|
-
<span slot="trigger">See code</span>
|
|
279
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
280
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
420
|
+
<span slot="trigger">See code</span>
|
|
421
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-group.html) -->
|
|
422
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-group.html -->
|
|
281
423
|
|
|
282
424
|
```html
|
|
283
|
-
<auro-counter-group
|
|
425
|
+
<auro-counter-group appearance="inverse">
|
|
284
426
|
<auro-counter>
|
|
285
|
-
|
|
427
|
+
Short label
|
|
286
428
|
</auro-counter>
|
|
287
429
|
<auro-counter>
|
|
288
|
-
|
|
430
|
+
Another short label
|
|
431
|
+
</auro-counter>
|
|
432
|
+
<auro-counter>
|
|
433
|
+
This is an example of the wrapping behavior for a long label
|
|
289
434
|
</auro-counter>
|
|
290
435
|
</auro-counter-group>
|
|
291
436
|
```
|
|
292
437
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
293
|
-
----
|
|
294
|
-
|
|
295
|
-
```javascript
|
|
296
|
-
const counter = document.getElementById('eventExample');
|
|
297
|
-
counter.addEventListener('input', (event) => {
|
|
298
|
-
console.log(`Values updated: ${JSON.stringify(event.detail)}`);
|
|
299
|
-
});
|
|
300
|
-
```
|
|
301
|
-
|
|
302
438
|
</auro-accordion>
|
|
303
439
|
|
|
304
|
-
|
|
440
|
+
### Dropdown Counter Group
|
|
441
|
+
|
|
442
|
+
Use the `isDropdown` attribute to place a counter group into the dropdown menu. The dropdown mode provides a more compact interface, ideal for forms where space is limited. It collapses the counters into a dropdown that expands when clicked.
|
|
443
|
+
|
|
305
444
|
<div class="exampleWrapper">
|
|
306
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown
|
|
307
|
-
<!-- The below content is automatically added from ./../apiExamples/dropdown
|
|
308
|
-
<div style="max-width: 350px;">
|
|
309
|
-
<auro-counter-group isDropdown>
|
|
310
|
-
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
311
|
-
<span slot="bib.fullscreen.headline">Passengers</span>
|
|
312
|
-
<div slot="valueText">Custom value text</div>
|
|
313
|
-
<div slot="label"></div>
|
|
314
|
-
<auro-counter>
|
|
315
|
-
Adults
|
|
316
|
-
<span slot="description">18 years or older</span>
|
|
317
|
-
</auro-counter>
|
|
318
|
-
<auro-counter>
|
|
319
|
-
Children
|
|
320
|
-
<span slot="description">Under 17 years old. Restrictions apply if traveling without an adult.</span>
|
|
321
|
-
</auro-counter>
|
|
322
|
-
<auro-counter>
|
|
323
|
-
Lap Infants
|
|
324
|
-
<span slot="description">Under 2 years</span>
|
|
325
|
-
</auro-counter>
|
|
326
|
-
</auro-counter-group>
|
|
327
|
-
</div>
|
|
328
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
329
|
-
</div>
|
|
330
|
-
<auro-accordion alignRight>
|
|
331
|
-
<span slot="trigger">See code</span>
|
|
332
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-value-text.html) -->
|
|
333
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-value-text.html -->
|
|
334
|
-
|
|
335
|
-
```html
|
|
336
|
-
<div style="max-width: 350px;">
|
|
445
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown.html) -->
|
|
446
|
+
<!-- The below content is automatically added from ./../apiExamples/dropdown.html -->
|
|
337
447
|
<auro-counter-group isDropdown>
|
|
338
448
|
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
339
449
|
<span slot="bib.fullscreen.headline">Passengers</span>
|
|
340
|
-
<div slot="
|
|
341
|
-
<div slot="label"></div>
|
|
450
|
+
<div slot="label">Passengers</div>
|
|
342
451
|
<auro-counter>
|
|
343
452
|
Adults
|
|
344
453
|
<span slot="description">18 years or older</span>
|
|
@@ -352,66 +461,172 @@ counter.addEventListener('input', (event) => {
|
|
|
352
461
|
<span slot="description">Under 2 years</span>
|
|
353
462
|
</auro-counter>
|
|
354
463
|
</auro-counter-group>
|
|
464
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
465
|
+
</div>
|
|
466
|
+
<div class="exampleWrapper--ondark" aria-hidden>
|
|
467
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-dropdown.html) -->
|
|
468
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-dropdown.html -->
|
|
469
|
+
<auro-counter-group appearance="inverse" isDropdown>
|
|
470
|
+
<div slot="bib.fullscreen.headline">Passengers</div>
|
|
471
|
+
<div slot="label">Passengers</div>
|
|
472
|
+
<auro-counter>
|
|
473
|
+
Adults
|
|
474
|
+
<span slot="description">18 years or older</span>
|
|
475
|
+
</auro-counter>
|
|
476
|
+
<auro-counter>
|
|
477
|
+
Children
|
|
478
|
+
<span slot="description">2-17 years</span>
|
|
479
|
+
</auro-counter>
|
|
480
|
+
</auro-counter-group>
|
|
481
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
355
482
|
</div>
|
|
483
|
+
<auro-accordion alignRight>
|
|
484
|
+
<span slot="trigger">See code</span>
|
|
485
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown.html) -->
|
|
486
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown.html -->
|
|
487
|
+
|
|
488
|
+
```html
|
|
489
|
+
<auro-counter-group isDropdown>
|
|
490
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
491
|
+
<span slot="bib.fullscreen.headline">Passengers</span>
|
|
492
|
+
<div slot="label">Passengers</div>
|
|
493
|
+
<auro-counter>
|
|
494
|
+
Adults
|
|
495
|
+
<span slot="description">18 years or older</span>
|
|
496
|
+
</auro-counter>
|
|
497
|
+
<auro-counter>
|
|
498
|
+
Children
|
|
499
|
+
<span slot="description">Under 17 years old. Restrictions apply if traveling without an adult.</span>
|
|
500
|
+
</auro-counter>
|
|
501
|
+
<auro-counter>
|
|
502
|
+
Lap Infants
|
|
503
|
+
<span slot="description">Under 2 years</span>
|
|
504
|
+
</auro-counter>
|
|
505
|
+
</auro-counter-group>
|
|
356
506
|
```
|
|
357
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
507
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
508
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-dropdown.html) -->
|
|
509
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-dropdown.html -->
|
|
510
|
+
|
|
511
|
+
```html
|
|
512
|
+
<auro-counter-group appearance="inverse" isDropdown>
|
|
513
|
+
<div slot="bib.fullscreen.headline">Passengers</div>
|
|
514
|
+
<div slot="label">Passengers</div>
|
|
515
|
+
<auro-counter>
|
|
516
|
+
Adults
|
|
517
|
+
<span slot="description">18 years or older</span>
|
|
518
|
+
</auro-counter>
|
|
519
|
+
<auro-counter>
|
|
520
|
+
Children
|
|
521
|
+
<span slot="description">2-17 years</span>
|
|
522
|
+
</auro-counter>
|
|
523
|
+
</auro-counter-group>
|
|
524
|
+
```
|
|
525
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
358
526
|
</auro-accordion>
|
|
359
527
|
|
|
360
|
-
###
|
|
528
|
+
### Snowflake Layout
|
|
361
529
|
|
|
362
|
-
|
|
530
|
+
Counter dropdowns support an alternate "snowflake" layout, using `layout="snowflake"`.
|
|
363
531
|
|
|
364
532
|
<div class="exampleWrapper">
|
|
365
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
366
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
533
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown-snowflake.html) -->
|
|
534
|
+
<!-- The below content is automatically added from ./../apiExamples/dropdown-snowflake.html -->
|
|
535
|
+
<!-- Example of counter-group properties -->
|
|
536
|
+
<auro-counter-group max="10" min="2" isDropdown layout="snowflake">
|
|
537
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
538
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
539
|
+
<auro-icon slot="typeIcon" category="interface" name="account-stroke" customColor></auro-icon>
|
|
540
|
+
<div slot="label">Snowflake Dropdown Group</div>
|
|
541
|
+
<div slot="helpText">Total must be between 2-10</div>
|
|
542
|
+
<auro-counter>
|
|
543
|
+
Counter 1
|
|
544
|
+
</auro-counter>
|
|
545
|
+
<auro-counter>
|
|
546
|
+
Counter 2
|
|
547
|
+
</auro-counter>
|
|
548
|
+
</auro-counter-group>
|
|
370
549
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
371
550
|
</div>
|
|
372
|
-
<div class="exampleWrapper--ondark"
|
|
373
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
374
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
551
|
+
<div class="exampleWrapper--ondark">
|
|
552
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/appearance-inverse-snowflake.html) -->
|
|
553
|
+
<!-- The below content is automatically added from ./../apiExamples/appearance-inverse-snowflake.html -->
|
|
554
|
+
<!-- Example of counter-group properties -->
|
|
555
|
+
<auro-counter-group max="10" min="2" isDropdown layout="snowflake" appearance="inverse">
|
|
556
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
557
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
558
|
+
<auro-icon slot="typeIcon" category="interface" name="account-stroke" customColor></auro-icon>
|
|
559
|
+
<div slot="label">Snowflake Dropdown Group</div>
|
|
560
|
+
<div slot="helpText">Total must be between 2-10</div>
|
|
561
|
+
<auro-counter>
|
|
562
|
+
Counter 1
|
|
563
|
+
</auro-counter>
|
|
564
|
+
<auro-counter>
|
|
565
|
+
Counter 2
|
|
566
|
+
</auro-counter>
|
|
567
|
+
</auro-counter-group>
|
|
378
568
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
379
569
|
</div>
|
|
380
570
|
<auro-accordion alignRight>
|
|
381
571
|
<span slot="trigger">See code</span>
|
|
382
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
383
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
572
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-snowflake.html) -->
|
|
573
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-snowflake.html -->
|
|
384
574
|
|
|
385
575
|
```html
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
</
|
|
576
|
+
<!-- Example of counter-group properties -->
|
|
577
|
+
<auro-counter-group max="10" min="2" isDropdown layout="snowflake">
|
|
578
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
579
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
580
|
+
<auro-icon slot="typeIcon" category="interface" name="account-stroke" customColor></auro-icon>
|
|
581
|
+
<div slot="label">Snowflake Dropdown Group</div>
|
|
582
|
+
<div slot="helpText">Total must be between 2-10</div>
|
|
583
|
+
<auro-counter>
|
|
584
|
+
Counter 1
|
|
585
|
+
</auro-counter>
|
|
586
|
+
<auro-counter>
|
|
587
|
+
Counter 2
|
|
588
|
+
</auro-counter>
|
|
589
|
+
</auro-counter-group>
|
|
389
590
|
```
|
|
390
591
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
391
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
392
|
-
<!-- The below
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
592
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/appearance-inverse-snowflake.html) -->
|
|
593
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/appearance-inverse-snowflake.html -->
|
|
594
|
+
|
|
595
|
+
```html
|
|
596
|
+
<!-- Example of counter-group properties -->
|
|
597
|
+
<auro-counter-group max="10" min="2" isDropdown layout="snowflake" appearance="inverse">
|
|
598
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
599
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
600
|
+
<auro-icon slot="typeIcon" category="interface" name="account-stroke" customColor></auro-icon>
|
|
601
|
+
<div slot="label">Snowflake Dropdown Group</div>
|
|
602
|
+
<div slot="helpText">Total must be between 2-10</div>
|
|
603
|
+
<auro-counter>
|
|
604
|
+
Counter 1
|
|
605
|
+
</auro-counter>
|
|
606
|
+
<auro-counter>
|
|
607
|
+
Counter 2
|
|
608
|
+
</auro-counter>
|
|
609
|
+
</auro-counter-group>
|
|
610
|
+
```
|
|
396
611
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
397
612
|
</auro-accordion>
|
|
398
613
|
|
|
399
614
|
### Counter Dropdown with Errored Counters
|
|
400
615
|
|
|
401
|
-
A counter dropdown with counters in an errored state will display the errors for each errored counter by default
|
|
616
|
+
A counter dropdown with individual counters in an errored state will display the errors for each errored counter by default.
|
|
402
617
|
|
|
403
618
|
<div class="exampleWrapper">
|
|
404
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown-error
|
|
405
|
-
<!-- The below content is automatically added from ./../apiExamples/dropdown-error
|
|
619
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown-error.html) -->
|
|
620
|
+
<!-- The below content is automatically added from ./../apiExamples/dropdown-error.html -->
|
|
406
621
|
<auro-counter-group isDropdown>
|
|
407
622
|
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
408
623
|
<div slot="bib.fullscreen.headline">Passengers</div>
|
|
409
624
|
<div slot="label">Passengers</div>
|
|
410
|
-
<auro-counter error="
|
|
625
|
+
<auro-counter error="Custom error on Adults counter">
|
|
411
626
|
Adults
|
|
412
627
|
<span slot="description">18 years or older</span>
|
|
413
628
|
</auro-counter>
|
|
414
|
-
<auro-counter error="
|
|
629
|
+
<auro-counter error="Custom error on Children counter">
|
|
415
630
|
Children
|
|
416
631
|
<span slot="description">2-17 years</span>
|
|
417
632
|
</auro-counter>
|
|
@@ -420,19 +635,19 @@ A counter dropdown with counters in an errored state will display the errors for
|
|
|
420
635
|
</div>
|
|
421
636
|
<auro-accordion alignRight>
|
|
422
637
|
<span slot="trigger">See code</span>
|
|
423
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-error
|
|
424
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-error
|
|
638
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-error.html) -->
|
|
639
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-error.html -->
|
|
425
640
|
|
|
426
641
|
```html
|
|
427
642
|
<auro-counter-group isDropdown>
|
|
428
643
|
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
429
644
|
<div slot="bib.fullscreen.headline">Passengers</div>
|
|
430
645
|
<div slot="label">Passengers</div>
|
|
431
|
-
<auro-counter error="
|
|
646
|
+
<auro-counter error="Custom error on Adults counter">
|
|
432
647
|
Adults
|
|
433
648
|
<span slot="description">18 years or older</span>
|
|
434
649
|
</auro-counter>
|
|
435
|
-
<auro-counter error="
|
|
650
|
+
<auro-counter error="Custom error on Children counter">
|
|
436
651
|
Children
|
|
437
652
|
<span slot="description">2-17 years</span>
|
|
438
653
|
</auro-counter>
|
|
@@ -443,20 +658,20 @@ A counter dropdown with counters in an errored state will display the errors for
|
|
|
443
658
|
|
|
444
659
|
### Counter Dropdown with Custom Error
|
|
445
660
|
|
|
446
|
-
The error
|
|
661
|
+
The `error` attribute can also be used on the counter group to set a custom error message. This will override any individual counter error messages.
|
|
447
662
|
|
|
448
663
|
<div class="exampleWrapper">
|
|
449
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown-error-
|
|
450
|
-
<!-- The below content is automatically added from ./../apiExamples/dropdown-error-
|
|
451
|
-
<auro-counter-group error="
|
|
664
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown-error-group.html) -->
|
|
665
|
+
<!-- The below content is automatically added from ./../apiExamples/dropdown-error-group.html -->
|
|
666
|
+
<auro-counter-group error="Custom error on counter group" isDropdown>
|
|
452
667
|
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
453
668
|
<div slot="bib.fullscreen.headline">Passengers</div>
|
|
454
669
|
<div slot="label">Passengers</div>
|
|
455
|
-
<auro-counter error="
|
|
670
|
+
<auro-counter error="Custom error on Adults counter">
|
|
456
671
|
Adults
|
|
457
672
|
<span slot="description">18 years or older</span>
|
|
458
673
|
</auro-counter>
|
|
459
|
-
<auro-counter error="
|
|
674
|
+
<auro-counter error="Custom error on Children counter">
|
|
460
675
|
Children
|
|
461
676
|
<span slot="description">2-17 years</span>
|
|
462
677
|
</auro-counter>
|
|
@@ -465,19 +680,19 @@ The error message for a dropdown counter with errored counters can also be overr
|
|
|
465
680
|
</div>
|
|
466
681
|
<auro-accordion alignRight>
|
|
467
682
|
<span slot="trigger">See code</span>
|
|
468
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-error-
|
|
469
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-error-
|
|
683
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-error-group.html) -->
|
|
684
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-error-group.html -->
|
|
470
685
|
|
|
471
686
|
```html
|
|
472
|
-
<auro-counter-group error="
|
|
687
|
+
<auro-counter-group error="Custom error on counter group" isDropdown>
|
|
473
688
|
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
474
689
|
<div slot="bib.fullscreen.headline">Passengers</div>
|
|
475
690
|
<div slot="label">Passengers</div>
|
|
476
|
-
<auro-counter error="
|
|
691
|
+
<auro-counter error="Custom error on Adults counter">
|
|
477
692
|
Adults
|
|
478
693
|
<span slot="description">18 years or older</span>
|
|
479
694
|
</auro-counter>
|
|
480
|
-
<auro-counter error="
|
|
695
|
+
<auro-counter error="Custom error on Children counter">
|
|
481
696
|
Children
|
|
482
697
|
<span slot="description">2-17 years</span>
|
|
483
698
|
</auro-counter>
|
|
@@ -488,7 +703,7 @@ The error message for a dropdown counter with errored counters can also be overr
|
|
|
488
703
|
|
|
489
704
|
### Group Max/Min
|
|
490
705
|
|
|
491
|
-
The group counter max or min property sets the
|
|
706
|
+
The group counter `max` or `min` property sets the property for all counters in the group. If a counter has a `max` value set, the group `max` attribute will override it. All increment buttons as a result will be disabled to prevent the group of counters from exceeding the group `max`.
|
|
492
707
|
|
|
493
708
|
**Example has group max set to 12**
|
|
494
709
|
|
|
@@ -523,9 +738,9 @@ The group counter max or min property sets the value for all counters in the gro
|
|
|
523
738
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
524
739
|
</auro-accordion>
|
|
525
740
|
|
|
526
|
-
### Counter Max/Min
|
|
741
|
+
### Counter Max/Min within Group
|
|
527
742
|
|
|
528
|
-
You can also individually set the max or min value for each counter in a group.
|
|
743
|
+
You can also individually set the `max` or `min` value for each counter in a group.
|
|
529
744
|
|
|
530
745
|
**Example has group max set to 12**
|
|
531
746
|
|
|
@@ -560,7 +775,8 @@ You can also individually set the max or min value for each counter in a group.
|
|
|
560
775
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
561
776
|
</auro-accordion>
|
|
562
777
|
|
|
563
|
-
### Customized
|
|
778
|
+
### Customized Bib Position
|
|
779
|
+
|
|
564
780
|
The bib position can be customized with `placement`, `offset`, `flip`, `autoPlacement`, and `shift` attributes.
|
|
565
781
|
|
|
566
782
|
- `placement` specifies the preferred position where the bib should appear relative to the trigger.
|
|
@@ -692,13 +908,13 @@ The bib position can be customized with `placement`, `offset`, `flip`, `autoPlac
|
|
|
692
908
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
693
909
|
</auro-accordion>
|
|
694
910
|
|
|
695
|
-
### Dropdown with
|
|
911
|
+
### Dropdown with Fullscreen Bib
|
|
696
912
|
|
|
697
913
|
You can make the dropdown open in fullscreen at a specific breakpoint by setting `fullscreenBreakpoint`.
|
|
698
914
|
|
|
699
915
|
The default value of `fullscreenBreakpoint` is `sm`.
|
|
700
916
|
|
|
701
|
-
Breakpoint token can be found [here](https://auro.alaskaair.com/getting-started/developers/design-tokens)
|
|
917
|
+
Breakpoint token can be found [here](https://auro.alaskaair.com/getting-started/developers/design-tokens).
|
|
702
918
|
|
|
703
919
|
To support fullscreen bib, setting the `bib.fullscreen.headline` slot is **REQUIRED**.
|
|
704
920
|
You can also set `bib.fullscreen.footer` slot to add any additional options on fullscreen view.
|
|
@@ -764,4 +980,306 @@ You can also set `bib.fullscreen.footer` slot to add any additional options on f
|
|
|
764
980
|
</div>
|
|
765
981
|
```
|
|
766
982
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
767
|
-
</auro-accordion>
|
|
983
|
+
</auro-accordion>
|
|
984
|
+
|
|
985
|
+
## Counter Group Slot Examples
|
|
986
|
+
|
|
987
|
+
### Display Value
|
|
988
|
+
|
|
989
|
+
Use the `valueText` slot to customize the value display in the dropdown trigger.
|
|
990
|
+
|
|
991
|
+
<div class="exampleWrapper">
|
|
992
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/dropdown-value-text.html) -->
|
|
993
|
+
<!-- The below content is automatically added from ./../apiExamples/dropdown-value-text.html -->
|
|
994
|
+
<div style="max-width: 350px;">
|
|
995
|
+
<auro-counter-group isDropdown>
|
|
996
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
997
|
+
<span slot="bib.fullscreen.headline">Passengers</span>
|
|
998
|
+
<div slot="valueText">Custom value text</div>
|
|
999
|
+
<div slot="label"></div>
|
|
1000
|
+
<auro-counter>
|
|
1001
|
+
Adults
|
|
1002
|
+
<span slot="description">18 years or older</span>
|
|
1003
|
+
</auro-counter>
|
|
1004
|
+
<auro-counter>
|
|
1005
|
+
Children
|
|
1006
|
+
<span slot="description">Under 17 years old. Restrictions apply if traveling without an adult.</span>
|
|
1007
|
+
</auro-counter>
|
|
1008
|
+
<auro-counter>
|
|
1009
|
+
Lap Infants
|
|
1010
|
+
<span slot="description">Under 2 years</span>
|
|
1011
|
+
</auro-counter>
|
|
1012
|
+
</auro-counter-group>
|
|
1013
|
+
</div>
|
|
1014
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1015
|
+
</div>
|
|
1016
|
+
<auro-accordion alignRight>
|
|
1017
|
+
<span slot="trigger">See code</span>
|
|
1018
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/dropdown-value-text.html) -->
|
|
1019
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/dropdown-value-text.html -->
|
|
1020
|
+
|
|
1021
|
+
```html
|
|
1022
|
+
<div style="max-width: 350px;">
|
|
1023
|
+
<auro-counter-group isDropdown>
|
|
1024
|
+
<span slot="ariaLabel.bib.close">Close Popup</span>
|
|
1025
|
+
<span slot="bib.fullscreen.headline">Passengers</span>
|
|
1026
|
+
<div slot="valueText">Custom value text</div>
|
|
1027
|
+
<div slot="label"></div>
|
|
1028
|
+
<auro-counter>
|
|
1029
|
+
Adults
|
|
1030
|
+
<span slot="description">18 years or older</span>
|
|
1031
|
+
</auro-counter>
|
|
1032
|
+
<auro-counter>
|
|
1033
|
+
Children
|
|
1034
|
+
<span slot="description">Under 17 years old. Restrictions apply if traveling without an adult.</span>
|
|
1035
|
+
</auro-counter>
|
|
1036
|
+
<auro-counter>
|
|
1037
|
+
Lap Infants
|
|
1038
|
+
<span slot="description">Under 2 years</span>
|
|
1039
|
+
</auro-counter>
|
|
1040
|
+
</auro-counter-group>
|
|
1041
|
+
</div>
|
|
1042
|
+
```
|
|
1043
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1044
|
+
</auro-accordion>
|
|
1045
|
+
|
|
1046
|
+
## Event Examples
|
|
1047
|
+
|
|
1048
|
+
### Input Event
|
|
1049
|
+
|
|
1050
|
+
Listen for `input` events to react to user interactions. Open the browser console to see the event output.
|
|
1051
|
+
|
|
1052
|
+
This event fires both on individual counter changes and when the counter group value changes. The event detail contains the current values of all counters in the group.
|
|
1053
|
+
|
|
1054
|
+
<div class="exampleWrapper">
|
|
1055
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/events.html) -->
|
|
1056
|
+
<!-- The below content is automatically added from ./../apiExamples/events.html -->
|
|
1057
|
+
<auro-counter-group id="eventExample">
|
|
1058
|
+
<auro-counter>
|
|
1059
|
+
Adults
|
|
1060
|
+
</auro-counter>
|
|
1061
|
+
<auro-counter>
|
|
1062
|
+
Children
|
|
1063
|
+
</auro-counter>
|
|
1064
|
+
</auro-counter-group>
|
|
1065
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1066
|
+
</div>
|
|
1067
|
+
<auro-accordion alignRight>
|
|
1068
|
+
<span slot="trigger">See code</span>
|
|
1069
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/events.html) -->
|
|
1070
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/events.html -->
|
|
1071
|
+
|
|
1072
|
+
```html
|
|
1073
|
+
<auro-counter-group id="eventExample">
|
|
1074
|
+
<auro-counter>
|
|
1075
|
+
Adults
|
|
1076
|
+
</auro-counter>
|
|
1077
|
+
<auro-counter>
|
|
1078
|
+
Children
|
|
1079
|
+
</auro-counter>
|
|
1080
|
+
</auro-counter-group>
|
|
1081
|
+
```
|
|
1082
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1083
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/events.js) -->
|
|
1084
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/events.js -->
|
|
1085
|
+
|
|
1086
|
+
```js
|
|
1087
|
+
export function eventCounterExample() {
|
|
1088
|
+
const counter = document.getElementById('eventExample');
|
|
1089
|
+
|
|
1090
|
+
counter.addEventListener('input', (event) => {
|
|
1091
|
+
console.log(`Values updated: ${JSON.stringify(event.detail)}`);
|
|
1092
|
+
});
|
|
1093
|
+
}
|
|
1094
|
+
```
|
|
1095
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1096
|
+
</auro-accordion>
|
|
1097
|
+
|
|
1098
|
+
## Common Usage Patterns & Functional Examples
|
|
1099
|
+
|
|
1100
|
+
### All Counter Properties
|
|
1101
|
+
|
|
1102
|
+
This example demonstrates the use of all available counter properties.
|
|
1103
|
+
|
|
1104
|
+
<div class="exampleWrapper">
|
|
1105
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/api-properties.html) -->
|
|
1106
|
+
<!-- The below content is automatically added from ./../apiExamples/api-properties.html -->
|
|
1107
|
+
<!-- Example of all counter properties -->
|
|
1108
|
+
<auro-counter-group>
|
|
1109
|
+
<!-- Basic counter with min/max -->
|
|
1110
|
+
<auro-counter min="1" max="5" value="2">
|
|
1111
|
+
Min 1, Max 5
|
|
1112
|
+
</auro-counter>
|
|
1113
|
+
<!-- Disabled counter -->
|
|
1114
|
+
<auro-counter disabled value="0">
|
|
1115
|
+
Disabled counter
|
|
1116
|
+
</auro-counter>
|
|
1117
|
+
</auro-counter-group>
|
|
1118
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1119
|
+
</div>
|
|
1120
|
+
<auro-accordion alignRight>
|
|
1121
|
+
<span slot="trigger">See code</span>
|
|
1122
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/api-properties.html) -->
|
|
1123
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/api-properties.html -->
|
|
1124
|
+
|
|
1125
|
+
```html
|
|
1126
|
+
<!-- Example of all counter properties -->
|
|
1127
|
+
<auro-counter-group>
|
|
1128
|
+
<!-- Basic counter with min/max -->
|
|
1129
|
+
<auro-counter min="1" max="5" value="2">
|
|
1130
|
+
Min 1, Max 5
|
|
1131
|
+
</auro-counter>
|
|
1132
|
+
<!-- Disabled counter -->
|
|
1133
|
+
<auro-counter disabled value="0">
|
|
1134
|
+
Disabled counter
|
|
1135
|
+
</auro-counter>
|
|
1136
|
+
</auro-counter-group>
|
|
1137
|
+
```
|
|
1138
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1139
|
+
</auro-accordion>
|
|
1140
|
+
|
|
1141
|
+
### All Counter Group Properties
|
|
1142
|
+
|
|
1143
|
+
This example demonstrates the use of all available counter group properties.
|
|
1144
|
+
|
|
1145
|
+
<div class="exampleWrapper">
|
|
1146
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/api-group-properties.html) -->
|
|
1147
|
+
<!-- The below content is automatically added from ./../apiExamples/api-group-properties.html -->
|
|
1148
|
+
<!-- Example of counter-group properties -->
|
|
1149
|
+
<auro-counter-group max="10" min="2" isDropdown>
|
|
1150
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
1151
|
+
<div slot="label">Group with all properties</div>
|
|
1152
|
+
<div slot="helpText">Total must be between 2-10</div>
|
|
1153
|
+
<div slot="valueText">Custom total display</div>
|
|
1154
|
+
<auro-counter>
|
|
1155
|
+
Counter 1
|
|
1156
|
+
</auro-counter>
|
|
1157
|
+
<auro-counter>
|
|
1158
|
+
Counter 2
|
|
1159
|
+
</auro-counter>
|
|
1160
|
+
</auro-counter-group>
|
|
1161
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1162
|
+
</div>
|
|
1163
|
+
<auro-accordion alignRight>
|
|
1164
|
+
<span slot="trigger">See code</span>
|
|
1165
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/api-group-properties.html) -->
|
|
1166
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/api-group-properties.html -->
|
|
1167
|
+
|
|
1168
|
+
```html
|
|
1169
|
+
<!-- Example of counter-group properties -->
|
|
1170
|
+
<auro-counter-group max="10" min="2" isDropdown>
|
|
1171
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
1172
|
+
<div slot="label">Group with all properties</div>
|
|
1173
|
+
<div slot="helpText">Total must be between 2-10</div>
|
|
1174
|
+
<div slot="valueText">Custom total display</div>
|
|
1175
|
+
<auro-counter>
|
|
1176
|
+
Counter 1
|
|
1177
|
+
</auro-counter>
|
|
1178
|
+
<auro-counter>
|
|
1179
|
+
Counter 2
|
|
1180
|
+
</auro-counter>
|
|
1181
|
+
</auro-counter-group>
|
|
1182
|
+
```
|
|
1183
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1184
|
+
</auro-accordion>
|
|
1185
|
+
|
|
1186
|
+
### All Slots
|
|
1187
|
+
|
|
1188
|
+
All available slots for both components.
|
|
1189
|
+
|
|
1190
|
+
<div class="exampleWrapper">
|
|
1191
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/api-slots.html) -->
|
|
1192
|
+
<!-- The below content is automatically added from ./../apiExamples/api-slots.html -->
|
|
1193
|
+
<!-- Example of all available slots -->
|
|
1194
|
+
<auro-counter-group isDropdown>
|
|
1195
|
+
<!-- Group slots -->
|
|
1196
|
+
<div slot="label">Group with all slots</div>
|
|
1197
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
1198
|
+
<div slot="helpText">Help text appears below the group</div>
|
|
1199
|
+
<div slot="valueText">Custom value display</div>
|
|
1200
|
+
<!-- Counter with all slots -->
|
|
1201
|
+
<auro-counter>
|
|
1202
|
+
Default slot content
|
|
1203
|
+
<span slot="ariaLabel.minus">Custom Minus Button Label</span>
|
|
1204
|
+
<span slot="ariaLabel.plus">Custom Plus Button Label</span>
|
|
1205
|
+
<span slot="description">Description slot content</span>
|
|
1206
|
+
</auro-counter>
|
|
1207
|
+
</auro-counter-group>
|
|
1208
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1209
|
+
</div>
|
|
1210
|
+
<auro-accordion alignRight>
|
|
1211
|
+
<span slot="trigger">See code</span>
|
|
1212
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/api-slots.html) -->
|
|
1213
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/api-slots.html -->
|
|
1214
|
+
|
|
1215
|
+
```html
|
|
1216
|
+
<!-- Example of all available slots -->
|
|
1217
|
+
<auro-counter-group isDropdown>
|
|
1218
|
+
<!-- Group slots -->
|
|
1219
|
+
<div slot="label">Group with all slots</div>
|
|
1220
|
+
<div slot="bib.fullscreen.headline">Group fullscreen label</div>
|
|
1221
|
+
<div slot="helpText">Help text appears below the group</div>
|
|
1222
|
+
<div slot="valueText">Custom value display</div>
|
|
1223
|
+
<!-- Counter with all slots -->
|
|
1224
|
+
<auro-counter>
|
|
1225
|
+
Default slot content
|
|
1226
|
+
<span slot="ariaLabel.minus">Custom Minus Button Label</span>
|
|
1227
|
+
<span slot="ariaLabel.plus">Custom Plus Button Label</span>
|
|
1228
|
+
<span slot="description">Description slot content</span>
|
|
1229
|
+
</auro-counter>
|
|
1230
|
+
</auro-counter-group>
|
|
1231
|
+
```
|
|
1232
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
1233
|
+
</auro-accordion>
|
|
1234
|
+
|
|
1235
|
+
## Restyle Component with CSS Variables
|
|
1236
|
+
|
|
1237
|
+
The component may be restyled by changing the values of the following token(s).
|
|
1238
|
+
|
|
1239
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
1240
|
+
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
1241
|
+
|
|
1242
|
+
```scss
|
|
1243
|
+
@use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
|
|
1244
|
+
|
|
1245
|
+
:host(:not([ondark])),
|
|
1246
|
+
:host(:not([appearance="inverse"])) {
|
|
1247
|
+
/* Snowflake Dropdown Tokens */
|
|
1248
|
+
--ds-auro-counter-border-color: var(--ds-basic-color-border-bold, #{v.$ds-basic-color-border-bold});
|
|
1249
|
+
--ds-auro-counter-background-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
|
|
1250
|
+
--ds-auro-counter-label-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
1251
|
+
--ds-auro-counter-placeholder-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1252
|
+
--ds-auro-counter-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1253
|
+
--ds-auro-counter-error-icon-color: var(--ds-basic-color-status-error, #{v.$ds-basic-color-status-error});
|
|
1254
|
+
--ds-auro-counter-outline-color: transparent;
|
|
1255
|
+
|
|
1256
|
+
/* Classic Tokens */
|
|
1257
|
+
--ds-auro-counter-control-background-color: var(--ds-advanced-color-button-tertiary-background, #{v.$ds-advanced-color-button-tertiary-background});
|
|
1258
|
+
--ds-auro-counter-control-border-color: var(--ds-advanced-color-state-focused, #{v.$ds-advanced-color-state-focused});
|
|
1259
|
+
--ds-auro-counter-description-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
1260
|
+
--ds-auro-counter-icon-color: var(--ds-advanced-color-button-tertiary-text, #{v.$ds-advanced-color-button-tertiary-text});
|
|
1261
|
+
--ds-auro-counter-quantity-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1262
|
+
--ds-auro-counter-divider-color: var(--ds-basic-color-border-divider, #{v.$ds-basic-color-border-divider});
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
:host([ondark]),
|
|
1266
|
+
:host([appearance="inverse"]) {
|
|
1267
|
+
/* Snowflake Dropdown Tokens */
|
|
1268
|
+
--ds-auro-counter-border-color: var(--ds-basic-color-border-inverse, #{v.$ds-basic-color-border-inverse});
|
|
1269
|
+
--ds-auro-counter-background-color: var(--ds-advanced-color-shared-background-inverse, #{v.$ds-advanced-color-shared-background-inverse});
|
|
1270
|
+
--ds-auro-counter-label-text-color: var(--ds-basic-color-texticon-inverse-muted, #{v.$ds-basic-color-texticon-inverse-muted});
|
|
1271
|
+
--ds-auro-counter-placeholder-text-color: var(--ds-basic-color-texticon-inverse, #{v.$ds-basic-color-texticon-inverse});
|
|
1272
|
+
--ds-auro-counter-text-color: var(--ds-basic-color-texticon-inverse, #{v.$ds-basic-color-texticon-inverse});
|
|
1273
|
+
--ds-auro-counter-error-icon-color: var(--ds-advanced-color-state-error-inverse, #{v.$ds-advanced-color-state-error-inverse});
|
|
1274
|
+
--ds-auro-counter-outline-color: transparent;
|
|
1275
|
+
|
|
1276
|
+
/* Classic Tokens */
|
|
1277
|
+
--ds-auro-counter-control-background-color: var(--ds-advanced-color-button-tertiary-background-inverse, #{v.$ds-advanced-color-button-tertiary-background-inverse});
|
|
1278
|
+
--ds-auro-counter-control-border-color: var(--ds-advanced-color-state-focused-inverse, #{v.$ds-advanced-color-state-focused-inverse});
|
|
1279
|
+
--ds-auro-counter-description-text-color: var(--ds-basic-color-texticon-muted, #{v.$ds-basic-color-texticon-muted});
|
|
1280
|
+
--ds-auro-counter-icon-color: var(--ds-advanced-color-button-tertiary-text-inverse, #{v.$ds-advanced-color-button-tertiary-text-inverse});
|
|
1281
|
+
--ds-auro-counter-quantity-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
|
|
1282
|
+
--ds-auro-counter-divider-color: var(--ds-basic-color-border-divider-inverse, #{v.$ds-basic-color-border-divider-inverse});
|
|
1283
|
+
}
|
|
1284
|
+
```
|
|
1285
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|