@warp-ds/elements 2.9.0 → 2.9.1-next.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/dist/custom-elements.json +31 -0
- package/dist/docs/box/accessibility.md +29 -0
- package/dist/docs/box/api.md +16 -11
- package/dist/docs/box/box.md +189 -11
- package/dist/docs/box/examples.md +98 -0
- package/dist/docs/box/usage.md +47 -0
- package/dist/index.d.ts +40 -20
- package/dist/packages/box/box.d.ts +15 -14
- package/dist/packages/box/box.js +6 -6
- package/dist/packages/box/box.js.map +4 -4
- package/dist/packages/box/box.react.stories.d.ts +1 -1
- package/dist/packages/box/box.stories.d.ts +1 -0
- package/dist/packages/box/box.stories.js +12 -5
- package/dist/packages/checkbox/checkbox.js +3 -3
- package/dist/packages/checkbox/checkbox.js.map +2 -2
- package/dist/packages/checkbox/checkbox.test.js +20 -0
- package/dist/packages/datepicker/datepicker.js +6 -6
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/datepicker/datepicker.stories.js +8 -1
- package/dist/packages/datepicker/datepicker.test.js +23 -1
- package/dist/packages/radio/radio.js +2 -2
- package/dist/packages/radio/radio.js.map +2 -2
- package/dist/packages/radio/radio.test.js +21 -1
- package/dist/packages/radio-group/radio-group.js +5 -5
- package/dist/packages/radio-group/radio-group.js.map +2 -2
- package/dist/packages/select/select.js +10 -10
- package/dist/packages/select/select.js.map +3 -3
- package/dist/packages/select/select.stories.js +7 -5
- package/dist/packages/select/select.test.js +23 -2
- package/dist/packages/slider/slider.stories.js +6 -3
- package/dist/packages/slider-thumb/slider-thumb.js +16 -16
- package/dist/packages/slider-thumb/slider-thumb.js.map +2 -2
- package/dist/packages/textfield/textfield.js +9 -8
- package/dist/packages/textfield/textfield.js.map +3 -3
- package/dist/packages/textfield/textfield.test.js +17 -0
- package/dist/web-types.json +35 -7
- package/package.json +1 -1
|
@@ -101,3 +101,20 @@ test('uses specified type when type attribute is set', async () => {
|
|
|
101
101
|
})
|
|
102
102
|
.toBe('email');
|
|
103
103
|
});
|
|
104
|
+
test('submits the associated form when input has focus and user presses Enter', async () => {
|
|
105
|
+
const screen = render(html `
|
|
106
|
+
<form>
|
|
107
|
+
<w-textfield data-testid="textfield" name="test" value="Submit this!"></w-textfield>
|
|
108
|
+
<button type="submit">Submit</button>
|
|
109
|
+
</form>
|
|
110
|
+
`);
|
|
111
|
+
const onSubmit = vi.fn();
|
|
112
|
+
const form = document.querySelector('form');
|
|
113
|
+
form.addEventListener('submit', (event) => {
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
onSubmit();
|
|
116
|
+
});
|
|
117
|
+
await userEvent.click(screen.getByTestId('textfield'));
|
|
118
|
+
await userEvent.keyboard('{Enter}');
|
|
119
|
+
expect(onSubmit).toHaveBeenCalled();
|
|
120
|
+
});
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@warp-ds/elements",
|
|
4
|
-
"version": "2.9.
|
|
4
|
+
"version": "2.9.1-next.1",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -666,30 +666,58 @@
|
|
|
666
666
|
"attributes": [
|
|
667
667
|
{
|
|
668
668
|
"name": "bleed",
|
|
669
|
+
"description": "Makes the box bleed to the container edge.\nExtends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up.",
|
|
669
670
|
"value": { "type": "boolean", "default": "false" }
|
|
670
671
|
},
|
|
671
672
|
{
|
|
672
673
|
"name": "bordered",
|
|
674
|
+
"description": "Shows the box as a bordered surface.\nUse this when the content needs a clear visual boundary from the surrounding page.",
|
|
673
675
|
"value": { "type": "boolean", "default": "false" }
|
|
674
676
|
},
|
|
675
677
|
{
|
|
676
678
|
"name": "info",
|
|
679
|
+
"description": "Shows the box with information styling.\nUse this for supporting informational content that should be visually separated from the surrounding page.",
|
|
677
680
|
"value": { "type": "boolean", "default": "false" }
|
|
678
681
|
},
|
|
679
682
|
{
|
|
680
683
|
"name": "neutral",
|
|
684
|
+
"description": "Shows the box with neutral styling.\nUse this for quiet grouped content that needs a background without strong emphasis.",
|
|
681
685
|
"value": { "type": "boolean", "default": "false" }
|
|
682
686
|
},
|
|
683
|
-
{
|
|
687
|
+
{
|
|
688
|
+
"name": "role",
|
|
689
|
+
"description": "ARIA role for the box wrapper.\nDefaults to a role of `region`. Set `role=\"none\"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose.",
|
|
690
|
+
"value": { "type": "string", "default": "'region'" }
|
|
691
|
+
}
|
|
684
692
|
],
|
|
685
693
|
"events": [],
|
|
686
694
|
"js": {
|
|
687
695
|
"properties": [
|
|
688
|
-
{
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
696
|
+
{
|
|
697
|
+
"name": "bleed",
|
|
698
|
+
"description": "Makes the box bleed to the container edge.\nExtends the box into the horizontal gutter on narrow screens. Adds negative horizontal margins and square side corners below the small breakpoint, then restores the normal margins and rounded corners from the small breakpoint and up.",
|
|
699
|
+
"type": "boolean"
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "bordered",
|
|
703
|
+
"description": "Shows the box as a bordered surface.\nUse this when the content needs a clear visual boundary from the surrounding page.",
|
|
704
|
+
"type": "boolean"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"name": "info",
|
|
708
|
+
"description": "Shows the box with information styling.\nUse this for supporting informational content that should be visually separated from the surrounding page.",
|
|
709
|
+
"type": "boolean"
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
"name": "neutral",
|
|
713
|
+
"description": "Shows the box with neutral styling.\nUse this for quiet grouped content that needs a background without strong emphasis.",
|
|
714
|
+
"type": "boolean"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"name": "role",
|
|
718
|
+
"description": "ARIA role for the box wrapper.\nDefaults to a role of `region`. Set `role=\"none\"` to override this behaviour for purely visual grouping, or set a specific role when the box has a clearer semantic purpose.",
|
|
719
|
+
"type": "string"
|
|
720
|
+
}
|
|
693
721
|
],
|
|
694
722
|
"events": []
|
|
695
723
|
}
|