@qualcomm-ui/react 1.5.0 → 1.6.0

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 (34) hide show
  1. package/dist/checkbox/checkbox-control.d.ts +2 -1
  2. package/dist/checkbox/checkbox-control.d.ts.map +1 -1
  3. package/dist/radio/index.js +1 -1
  4. package/dist/radio/index.js.map +2 -2
  5. package/dist/radio/radio-group/radio-group-error-text.d.ts.map +1 -1
  6. package/dist/slider/index.js +1 -1
  7. package/dist/slider/index.js.map +3 -3
  8. package/dist/slider/slider-error-text.d.ts.map +1 -1
  9. package/dist/text-area/__tests__/test-text-area.d.ts +23 -0
  10. package/dist/text-area/__tests__/test-text-area.d.ts.map +1 -0
  11. package/dist/text-area/index.d.ts +38 -1
  12. package/dist/text-area/index.d.ts.map +1 -1
  13. package/dist/text-area/index.js +1 -0
  14. package/dist/text-area/index.js.map +4 -4
  15. package/dist/text-area/qds-text-area-context.d.ts +3 -0
  16. package/dist/text-area/qds-text-area-context.d.ts.map +1 -0
  17. package/dist/text-area/text-area-counter.d.ts +19 -0
  18. package/dist/text-area/text-area-counter.d.ts.map +1 -0
  19. package/dist/text-area/text-area-error-text.d.ts +14 -0
  20. package/dist/text-area/text-area-error-text.d.ts.map +1 -0
  21. package/dist/text-area/text-area-hint.d.ts +13 -0
  22. package/dist/text-area/text-area-hint.d.ts.map +1 -0
  23. package/dist/text-area/text-area-input.d.ts +9 -0
  24. package/dist/text-area/text-area-input.d.ts.map +1 -0
  25. package/dist/text-area/text-area-label.d.ts +14 -0
  26. package/dist/text-area/text-area-label.d.ts.map +1 -0
  27. package/dist/text-area/text-area-root.d.ts +15 -0
  28. package/dist/text-area/text-area-root.d.ts.map +1 -0
  29. package/dist/text-area/text-area.d.ts +68 -0
  30. package/dist/text-area/text-area.d.ts.map +1 -0
  31. package/dist/text-input/text-input-input.d.ts +2 -1
  32. package/dist/text-input/text-input-input.d.ts.map +1 -1
  33. package/dist/tsbuildinfo +1 -1
  34. package/package.json +13 -13
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qds-text-area-context.d.ts","sourceRoot":"","sources":["../../src/text-area/qds-text-area-context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAGnE,eAAO,MAAO,0BAA0B,4CAAE,qBAAqB,8CAK3D,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
3
+ export interface TextAreaCounterProps extends ElementRenderProp<"div"> {
4
+ /**
5
+ * Customize how the counter is displayed. Receives the current character
6
+ * count and optional max length, and returns a React node.
7
+ *
8
+ * @example
9
+ * // Display as "42 of 100"
10
+ * display={(count, max) => max ? `${count} of ${max}` : count}
11
+ */
12
+ display?: (count: number, maxLength?: number) => ReactNode;
13
+ }
14
+ /**
15
+ * Character counter displayed opposite the textarea label. Renders a `<div>`
16
+ * element by default.
17
+ */
18
+ export declare function TextAreaCounter({ display, id, ...props }: TextAreaCounterProps): ReactElement;
19
+ //# sourceMappingURL=text-area-counter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area-counter.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area-counter.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAElD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AASvC,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IACpE;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,SAAS,CAAA;CAC3D;AAMD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAwB,EACxB,EAAE,EACF,GAAG,KAAK,EACT,EAAE,oBAAoB,GAAG,YAAY,CAiBrC"}
@@ -0,0 +1,14 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
3
+ export interface TextAreaErrorTextProps extends ElementRenderProp<"div"> {
4
+ /**
5
+ * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
6
+ */
7
+ children?: ReactNode;
8
+ }
9
+ /**
10
+ * Error message displayed when the textarea is invalid. Renders a `<div>` element by
11
+ * default.
12
+ */
13
+ export declare function TextAreaErrorText({ children, id, ...props }: TextAreaErrorTextProps): ReactElement;
14
+ //# sourceMappingURL=text-area-error-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area-error-text.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area-error-text.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAKlD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAMvC,MAAM,WAAW,sBAAuB,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IACtE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,EAAE,EACF,GAAG,KAAK,EACT,EAAE,sBAAsB,GAAG,YAAY,CAgBvC"}
@@ -0,0 +1,13 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
3
+ export interface TextAreaHintProps extends ElementRenderProp<"div"> {
4
+ /**
5
+ * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
6
+ */
7
+ children?: ReactNode;
8
+ }
9
+ /**
10
+ * Helper text displayed below the textarea. Renders a `<div>` element by default.
11
+ */
12
+ export declare function TextAreaHint({ children, id, ...props }: TextAreaHintProps): ReactElement;
13
+ //# sourceMappingURL=text-area-hint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area-hint.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area-hint.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAElD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AAMvC,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,EAAE,EACF,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,YAAY,CAelC"}
@@ -0,0 +1,9 @@
1
+ import type { ComponentPropsWithRef, ReactElement } from "react";
2
+ import type { IdProp } from "@qualcomm-ui/react-core/system";
3
+ export interface TextAreaInputProps extends ComponentPropsWithRef<"textarea">, IdProp {
4
+ }
5
+ /**
6
+ * The text area element. Renders a `<textarea>` element.
7
+ */
8
+ export declare function TextAreaInput({ id, ...props }: TextAreaInputProps): ReactElement;
9
+ //# sourceMappingURL=text-area-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area-input.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area-input.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,YAAY,EAAC,MAAM,OAAO,CAAA;AAE9D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAA;AAM1D,MAAM,WAAW,kBACf,SAAQ,qBAAqB,CAAC,UAAU,CAAC,EACvC,MAAM;CAAG;AAEb;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,YAAY,CAWnC"}
@@ -0,0 +1,14 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
3
+ export interface TextAreaLabelProps extends ElementRenderProp<"label"> {
4
+ /**
5
+ * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
6
+ */
7
+ children?: ReactNode;
8
+ }
9
+ /**
10
+ * An accessible label that is automatically associated with the input. Renders a
11
+ * `<label>` element by default.
12
+ */
13
+ export declare function TextAreaLabel({ children, id, ...props }: TextAreaLabelProps): ReactElement;
14
+ //# sourceMappingURL=text-area-label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area-label.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area-label.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAKlD,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AASvC,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB,CAAC,OAAO,CAAC;IACpE;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,EAAE,EACF,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,YAAY,CAwBnC"}
@@ -0,0 +1,15 @@
1
+ import { type ReactElement, type ReactNode } from "react";
2
+ import { type TextAreaApiProps } from "@qualcomm-ui/core/text-area";
3
+ import { type QdsTextAreaApiProps } from "@qualcomm-ui/qds-core/text-area";
4
+ import { type ElementRenderProp } from "@qualcomm-ui/react-core/system";
5
+ export interface TextAreaRootProps extends TextAreaApiProps, QdsTextAreaApiProps, Omit<ElementRenderProp<"div">, "dir" | "defaultValue"> {
6
+ /**
7
+ * React {@link https://react.dev/learn/passing-props-to-a-component#passing-jsx-as-children children} prop.
8
+ */
9
+ children?: ReactNode;
10
+ }
11
+ /**
12
+ * Groups all parts of the text-area. Renders a `<div>` element by default.
13
+ */
14
+ export declare function TextAreaRoot({ children, size, ...props }: TextAreaRootProps): ReactElement;
15
+ //# sourceMappingURL=text-area-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area-root.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area-root.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAA;AAEhE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,gCAAgC,CAAA;AASvC,MAAM,WAAW,iBACf,SAAQ,gBAAgB,EACtB,mBAAmB,EACnB,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,cAAc,CAAC;IACxD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,YAAY,CAwBlC"}
@@ -0,0 +1,68 @@
1
+ import type { ReactElement, ReactNode } from "react";
2
+ import { type TextAreaCounterProps } from "./text-area-counter";
3
+ import { type TextAreaErrorTextProps } from "./text-area-error-text";
4
+ import { type TextAreaHintProps } from "./text-area-hint";
5
+ import { type TextAreaInputProps } from "./text-area-input";
6
+ import { type TextAreaLabelProps } from "./text-area-label";
7
+ import { type TextAreaRootProps } from "./text-area-root";
8
+ export interface TextAreaProps extends TextAreaRootProps {
9
+ /**
10
+ * The simple TextArea doesn't support children.
11
+ */
12
+ children?: never;
13
+ /**
14
+ * Controls whether to display the counter element.
15
+ *
16
+ * - `true`: always show the counter
17
+ * - `false`: never show the counter
18
+ * - `undefined` (default): only show the counter if `maxLength` is set
19
+ */
20
+ counter?: boolean;
21
+ /**
22
+ * Props applied to the counter element.
23
+ */
24
+ counterProps?: TextAreaCounterProps;
25
+ /**
26
+ * Optional error that describes the element when {@link invalid} is true.
27
+ */
28
+ errorText?: string;
29
+ /**
30
+ * Props applied to the error text element.
31
+ */
32
+ errorTextProps?: TextAreaErrorTextProps;
33
+ /**
34
+ * Optional hint describing the element. This element is automatically
35
+ * associated with the component's textarea element for accessibility.
36
+ */
37
+ hint?: ReactNode;
38
+ /**
39
+ * Props applied to the hint element.
40
+ */
41
+ hintProps?: TextAreaHintProps;
42
+ /**
43
+ * Props applied to the textarea element.
44
+ */
45
+ inputProps?: TextAreaInputProps;
46
+ /**
47
+ * Optional label describing the element. Recommended. This element is
48
+ * automatically associated with the component's input element for
49
+ * accessibility.
50
+ */
51
+ label?: ReactNode;
52
+ /**
53
+ * Props applied to the label element.
54
+ */
55
+ labelProps?: TextAreaLabelProps;
56
+ /**
57
+ * HTML {@link https://www.w3schools.com/tags/att_input_maxlength.asp maxlength} attribute,
58
+ * passed to the underlying textarea element.
59
+ */
60
+ maxLength?: number;
61
+ /**
62
+ * HTML {@link https://www.w3schools.com/tags/att_input_placeholder.asp placeholder} attribute,
63
+ * passed to the underlying textarea element.
64
+ */
65
+ placeholder?: string;
66
+ }
67
+ export declare function TextArea({ counter, counterProps, errorText, errorTextProps, hint, hintProps, inputProps, label, labelProps, maxLength, placeholder, ...props }: TextAreaProps): ReactElement;
68
+ //# sourceMappingURL=text-area.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../src/text-area/text-area.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAKlD,OAAO,EAAkB,KAAK,oBAAoB,EAAC,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAe,KAAK,iBAAiB,EAAC,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAgB,KAAK,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAgB,KAAK,kBAAkB,EAAC,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAe,KAAK,iBAAiB,EAAC,MAAM,kBAAkB,CAAA;AAErE,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAA;IAEhB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,oBAAoB,CAAA;IAEnC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;IAEvC;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAEhB;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAE7B;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAA;IAE/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAA;IAE/B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EACP,YAAY,EACZ,SAAS,EACT,cAAc,EACd,IAAI,EACJ,SAAS,EACT,UAAU,EACV,KAAK,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,GAAG,KAAK,EACT,EAAE,aAAa,GAAG,YAAY,CA8C9B"}
@@ -1,6 +1,7 @@
1
1
  import type { ComponentPropsWithRef, ReactElement } from "react";
2
2
  import type { IdProp } from "@qualcomm-ui/react-core/system";
3
- export interface TextInputInputProps extends ComponentPropsWithRef<"input">, IdProp {
3
+ import type { ComponentDataAttributes } from "@qualcomm-ui/utils/attributes";
4
+ export interface TextInputInputProps extends ComponentPropsWithRef<"input">, ComponentDataAttributes, IdProp {
4
5
  }
5
6
  /**
6
7
  * The text input element. Renders an `<input>` element.
@@ -1 +1 @@
1
- {"version":3,"file":"text-input-input.d.ts","sourceRoot":"","sources":["../../src/text-input/text-input-input.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,YAAY,EAAC,MAAM,OAAO,CAAA;AAG9D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAA;AAI1D,MAAM,WAAW,mBACf,SAAQ,qBAAqB,CAAC,OAAO,CAAC,EACpC,MAAM;CAAG;AAEb;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,GAAG,KAAK,EACT,EAAE,mBAAmB,GAAG,YAAY,CAYpC"}
1
+ {"version":3,"file":"text-input-input.d.ts","sourceRoot":"","sources":["../../src/text-input/text-input-input.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,qBAAqB,EAAE,YAAY,EAAC,MAAM,OAAO,CAAA;AAG9D,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAA;AAE1D,OAAO,KAAK,EAAC,uBAAuB,EAAC,MAAM,+BAA+B,CAAA;AAG1E,MAAM,WAAW,mBACf,SAAQ,qBAAqB,CAAC,OAAO,CAAC,EACpC,uBAAuB,EACvB,MAAM;CAAG;AAEb;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,GAAG,KAAK,EACT,EAAE,mBAAmB,GAAG,YAAY,CAYpC"}