@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.
Files changed (40) hide show
  1. package/dist/custom-elements.json +80 -21
  2. package/dist/docs/affix/affix.md +24 -38
  3. package/dist/docs/affix/examples.md +24 -38
  4. package/dist/docs/alert/accessibility.md +4 -9
  5. package/dist/docs/alert/alert.md +24 -39
  6. package/dist/docs/alert/examples.md +20 -30
  7. package/dist/docs/attention/accessibility.md +50 -0
  8. package/dist/docs/attention/api.md +40 -27
  9. package/dist/docs/attention/attention.md +276 -27
  10. package/dist/docs/attention/examples.md +91 -0
  11. package/dist/docs/attention/usage.md +91 -0
  12. package/dist/docs/badge/badge.md +23 -36
  13. package/dist/docs/badge/examples.md +23 -36
  14. package/dist/docs/box/accessibility.md +29 -0
  15. package/dist/docs/box/api.md +16 -11
  16. package/dist/docs/box/box.md +189 -11
  17. package/dist/docs/box/examples.md +98 -0
  18. package/dist/docs/box/usage.md +47 -0
  19. package/dist/docs/textarea/accessibility.md +5 -0
  20. package/dist/docs/textarea/api.md +32 -47
  21. package/dist/docs/textarea/examples.md +81 -0
  22. package/dist/docs/textarea/textarea.md +133 -49
  23. package/dist/docs/textarea/usage.md +9 -0
  24. package/dist/docs/textfield/examples.md +32 -49
  25. package/dist/docs/textfield/textfield.md +39 -60
  26. package/dist/docs/textfield/usage.md +7 -11
  27. package/dist/index.d.ts +276 -154
  28. package/dist/packages/attention/attention.d.ts +46 -37
  29. package/dist/packages/attention/attention.js +20 -20
  30. package/dist/packages/attention/attention.js.map +3 -3
  31. package/dist/packages/box/box.d.ts +15 -14
  32. package/dist/packages/box/box.js +6 -6
  33. package/dist/packages/box/box.js.map +4 -4
  34. package/dist/packages/box/box.react.stories.d.ts +1 -1
  35. package/dist/packages/box/box.stories.d.ts +1 -0
  36. package/dist/packages/box/box.stories.js +12 -5
  37. package/dist/packages/textarea/textarea.d.ts +38 -29
  38. package/dist/packages/textarea/textarea.js.map +2 -2
  39. package/dist/web-types.json +216 -44
  40. 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" | "_optOutRoleWithDefault"> & {} & Partial<Omit<import("./box").WarpBox, keyof HTMLElement>> & React.RefAttributes<import("./box").WarpBox>): React.JSX.Element;
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>;
@@ -12,3 +12,4 @@ export declare const Info: Story;
12
12
  export declare const Neutral: Story;
13
13
  export declare const Bordered: Story;
14
14
  export declare const Bleed: Story;
15
+ export declare const AccessibleRegion: Story;
@@ -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
- role: 'region',
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 single line text input element.
4
+ * A multi-line text input with built-in form validation, auto-resizing, and styling support.
5
5
  *
6
- * [See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/forms-textfield--docs)
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
- * @summary
18
- * @description
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
- * @summary
23
- * @description
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
- * @summary
28
- * @description
38
+ * Either a `label` or an `aria-label` must be provided.
29
39
  */
30
40
  label: string;
31
41
  /**
32
- * @summary
33
- * @description
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
- * @summary
38
- * @description
49
+ * Sets the maximum number of text rows before the content starts scrolling.
39
50
  */
40
51
  maxRows: number;
41
52
  /**
42
- * @summary
43
- * @description
53
+ * Sets the minimum number of text rows the textarea should display
44
54
  */
45
55
  minRows: number;
46
56
  /**
47
- * @summary
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
- * @summary
53
- * @description
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
- /** @deprecated Use the native readonly attribute instead. Here for API consistency with `w-textfield`.
57
- * @summary
58
- * @description
68
+ /**
69
+ * @deprecated Use the native `readonly` attribute instead
59
70
  */
60
71
  readOnly: boolean;
61
72
  /**
62
- * @summary
63
- * @description
73
+ * Whether the input can be selected but not changed by the user
64
74
  */
65
75
  readonly: boolean;
66
76
  /**
67
- * @summary
68
- * @description
77
+ * Whether user input is required on the input before form submission
69
78
  */
70
79
  required: boolean;
71
80
  /**
72
- * @summary
73
- * @description
81
+ * Lets you set the current value
74
82
  */
75
83
  value: string;
76
84
  /**
77
- * @summary
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;