@warp-ds/elements 2.9.0-next.6 → 2.9.1-next.1
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 +80 -21
- package/dist/docs/affix/affix.md +24 -38
- package/dist/docs/affix/examples.md +24 -38
- package/dist/docs/alert/accessibility.md +4 -9
- package/dist/docs/alert/alert.md +24 -39
- package/dist/docs/alert/examples.md +20 -30
- package/dist/docs/attention/accessibility.md +50 -0
- package/dist/docs/attention/api.md +40 -27
- package/dist/docs/attention/attention.md +276 -27
- package/dist/docs/attention/examples.md +91 -0
- package/dist/docs/attention/usage.md +91 -0
- package/dist/docs/badge/badge.md +23 -36
- package/dist/docs/badge/examples.md +23 -36
- 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/docs/textarea/accessibility.md +5 -0
- package/dist/docs/textarea/api.md +32 -47
- package/dist/docs/textarea/examples.md +81 -0
- package/dist/docs/textarea/textarea.md +133 -49
- package/dist/docs/textarea/usage.md +9 -0
- package/dist/docs/textfield/examples.md +32 -49
- package/dist/docs/textfield/textfield.md +39 -60
- package/dist/docs/textfield/usage.md +7 -11
- package/dist/index.d.ts +276 -154
- package/dist/packages/attention/attention.d.ts +46 -37
- package/dist/packages/attention/attention.js +20 -20
- package/dist/packages/attention/attention.js.map +3 -3
- 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/textarea/textarea.d.ts +38 -29
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/web-types.json +216 -44
- package/package.json +1 -2
|
@@ -4,7 +4,7 @@ import { Box } from './react';
|
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
6
|
component: import("@lit/react").ReactWebComponent<import("./box").WarpBox, {}>;
|
|
7
|
-
render(args: Omit<React.HTMLAttributes<import("./box").WarpBox>, "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "render" | "renderOptions" | "info" | "neutral" | "_class" | "bleed" | "bordered"
|
|
7
|
+
render(args: Omit<React.HTMLAttributes<import("./box").WarpBox>, "form" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "resetFormControl" | "render" | "validationTarget" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "info" | "neutral" | "_class" | "bleed" | "bordered"> & {} & Partial<Omit<import("./box").WarpBox, keyof HTMLElement>> & React.RefAttributes<import("./box").WarpBox>): React.JSX.Element;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
10
10
|
export type Story = StoryObj<typeof Box>;
|
|
@@ -29,31 +29,38 @@ export const Default = {
|
|
|
29
29
|
bordered: false,
|
|
30
30
|
info: false,
|
|
31
31
|
neutral: false,
|
|
32
|
-
role: 'region',
|
|
33
32
|
},
|
|
34
33
|
};
|
|
35
34
|
export const Info = {
|
|
36
35
|
args: {
|
|
37
36
|
info: true,
|
|
38
|
-
role: 'region',
|
|
39
37
|
},
|
|
40
38
|
};
|
|
41
39
|
export const Neutral = {
|
|
42
40
|
args: {
|
|
43
41
|
neutral: true,
|
|
44
|
-
role: 'region',
|
|
45
42
|
},
|
|
46
43
|
};
|
|
47
44
|
export const Bordered = {
|
|
48
45
|
args: {
|
|
49
46
|
bordered: true,
|
|
50
|
-
role: 'region',
|
|
51
47
|
},
|
|
52
48
|
};
|
|
53
49
|
export const Bleed = {
|
|
54
50
|
args: {
|
|
55
51
|
bleed: true,
|
|
56
52
|
neutral: true,
|
|
57
|
-
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export const AccessibleRegion = {
|
|
56
|
+
args: {},
|
|
57
|
+
render: (args) => {
|
|
58
|
+
return html `
|
|
59
|
+
<w-box aria-labelledby="box-content">
|
|
60
|
+
<h3 id="box-content">Box Content</h3>
|
|
61
|
+
<p>Inspect this box in the accessibility tree to see that it is treated as a region.</p>
|
|
62
|
+
<p>If aria-labelled by is not used, the box will not be treated as a region.</p>
|
|
63
|
+
</w-box>
|
|
64
|
+
`;
|
|
58
65
|
},
|
|
59
66
|
};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
2
|
declare const WarpTextarea_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
4
|
+
* A multi-line text input with built-in form validation, auto-resizing, and styling support.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* The component automatically handles:
|
|
7
|
+
* - Form integration
|
|
8
|
+
* - Auto-resizing based on content and row constraints
|
|
9
|
+
* - Built-in validation with customizable error messages
|
|
10
|
+
* - Accessibility attributes and labeling
|
|
7
11
|
*/
|
|
8
12
|
declare class WarpTextarea extends WarpTextarea_base {
|
|
9
13
|
#private;
|
|
14
|
+
/** @internal */
|
|
10
15
|
static shadowRootOptions: {
|
|
11
16
|
delegatesFocus: boolean;
|
|
12
17
|
mode: ShadowRootMode;
|
|
@@ -14,71 +19,75 @@ declare class WarpTextarea extends WarpTextarea_base {
|
|
|
14
19
|
slotAssignment?: SlotAssignmentMode;
|
|
15
20
|
};
|
|
16
21
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
22
|
+
* Keep in mind that using disabled in its current form is an anti-pattern.
|
|
23
|
+
*
|
|
24
|
+
* There will always be users who don't understand why an element is disabled, or users who can't even see that it is disabled because of poor lighting conditions or other reasons.
|
|
25
|
+
*
|
|
26
|
+
* Please consider more informative alternatives before choosing to use disabled on an element.
|
|
27
|
+
*
|
|
28
|
+
* @summary Makes the element not focusable and hides it from form submits
|
|
19
29
|
*/
|
|
20
30
|
disabled: boolean;
|
|
21
31
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
32
|
+
* Mark the form field as invalid.
|
|
33
|
+
*
|
|
34
|
+
* Make sure to also set a `help-text` to help users fix the validation problem.
|
|
24
35
|
*/
|
|
25
36
|
invalid: boolean;
|
|
26
37
|
/**
|
|
27
|
-
*
|
|
28
|
-
* @description
|
|
38
|
+
* Either a `label` or an `aria-label` must be provided.
|
|
29
39
|
*/
|
|
30
40
|
label: string;
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
42
|
+
* Use in combination with `invalid` to show as a validation error message,
|
|
43
|
+
* or on its own to show a help text.
|
|
44
|
+
*
|
|
45
|
+
* @summary Description shown below the input field
|
|
34
46
|
*/
|
|
35
47
|
helpText: string;
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
38
|
-
* @description
|
|
49
|
+
* Sets the maximum number of text rows before the content starts scrolling.
|
|
39
50
|
*/
|
|
40
51
|
maxRows: number;
|
|
41
52
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @description
|
|
53
|
+
* Sets the minimum number of text rows the textarea should display
|
|
44
54
|
*/
|
|
45
55
|
minRows: number;
|
|
46
56
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @description
|
|
57
|
+
* The [name](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input#name) of the input field when submitting the form
|
|
49
58
|
*/
|
|
50
59
|
name: string;
|
|
51
60
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
61
|
+
* Set a text that is shown in the textarea when it doesn't have a value.
|
|
62
|
+
*
|
|
63
|
+
* Placeholder text should not be used as a substitute for labeling the element with a visible label.
|
|
64
|
+
*
|
|
65
|
+
* @summary Shown in the textarea when it doesn't have a value
|
|
54
66
|
*/
|
|
55
67
|
placeholder: string;
|
|
56
|
-
/**
|
|
57
|
-
* @
|
|
58
|
-
* @description
|
|
68
|
+
/**
|
|
69
|
+
* @deprecated Use the native `readonly` attribute instead
|
|
59
70
|
*/
|
|
60
71
|
readOnly: boolean;
|
|
61
72
|
/**
|
|
62
|
-
*
|
|
63
|
-
* @description
|
|
73
|
+
* Whether the input can be selected but not changed by the user
|
|
64
74
|
*/
|
|
65
75
|
readonly: boolean;
|
|
66
76
|
/**
|
|
67
|
-
*
|
|
68
|
-
* @description
|
|
77
|
+
* Whether user input is required on the input before form submission
|
|
69
78
|
*/
|
|
70
79
|
required: boolean;
|
|
71
80
|
/**
|
|
72
|
-
*
|
|
73
|
-
* @description
|
|
81
|
+
* Lets you set the current value
|
|
74
82
|
*/
|
|
75
83
|
value: string;
|
|
76
84
|
/**
|
|
77
|
-
*
|
|
78
|
-
* @description
|
|
85
|
+
* Show an icon behind the label indicating the field is optional
|
|
79
86
|
*/
|
|
80
87
|
optional: boolean;
|
|
88
|
+
/** @internal */
|
|
81
89
|
minHeight: number;
|
|
90
|
+
/** @internal */
|
|
82
91
|
maxHeight: number;
|
|
83
92
|
private _textarea;
|
|
84
93
|
updated(changedProperties: PropertyValues<this>): void;
|