@veeqo/ui 14.6.0 → 14.7.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 (40) hide show
  1. package/dist/components/DimensionsInput/DimensionsInput.d.ts +1 -0
  2. package/dist/components/Pagination/styled.d.ts +1 -0
  3. package/dist/components/PhoneInput/index.d.ts +1 -0
  4. package/dist/components/Search/Search.d.ts +1 -0
  5. package/dist/components/Search/styled.d.ts +1 -0
  6. package/dist/components/Select/Select.cjs +20 -3
  7. package/dist/components/Select/Select.cjs.map +1 -1
  8. package/dist/components/Select/Select.d.ts +11 -0
  9. package/dist/components/Select/Select.js +20 -3
  10. package/dist/components/Select/Select.js.map +1 -1
  11. package/dist/components/Select/Select.module.scss.cjs +9 -0
  12. package/dist/components/Select/Select.module.scss.cjs.map +1 -0
  13. package/dist/components/Select/Select.module.scss.js +7 -0
  14. package/dist/components/Select/Select.module.scss.js.map +1 -0
  15. package/dist/components/TextField/TextField.cjs +23 -6
  16. package/dist/components/TextField/TextField.cjs.map +1 -1
  17. package/dist/components/TextField/TextField.d.ts +1 -0
  18. package/dist/components/TextField/TextField.js +23 -6
  19. package/dist/components/TextField/TextField.js.map +1 -1
  20. package/dist/components/TextField/TextField.module.scss.cjs +9 -0
  21. package/dist/components/TextField/TextField.module.scss.cjs.map +1 -0
  22. package/dist/components/TextField/TextField.module.scss.js +7 -0
  23. package/dist/components/TextField/TextField.module.scss.js.map +1 -0
  24. package/dist/components/TextField/index.d.ts +1 -0
  25. package/dist/components/TextField/types.d.ts +12 -1
  26. package/dist/hoc/withLabels/withLabels.cjs +3 -3
  27. package/dist/hoc/withLabels/withLabels.cjs.map +1 -1
  28. package/dist/hoc/withLabels/withLabels.js +3 -3
  29. package/dist/hoc/withLabels/withLabels.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/components/Select/styled.cjs +0 -16
  32. package/dist/components/Select/styled.cjs.map +0 -1
  33. package/dist/components/Select/styled.d.ts +0 -2
  34. package/dist/components/Select/styled.js +0 -9
  35. package/dist/components/Select/styled.js.map +0 -1
  36. package/dist/components/TextField/styled.cjs +0 -16
  37. package/dist/components/TextField/styled.cjs.map +0 -1
  38. package/dist/components/TextField/styled.d.ts +0 -2
  39. package/dist/components/TextField/styled.js +0 -9
  40. package/dist/components/TextField/styled.js.map +0 -1
@@ -296,6 +296,7 @@ export declare const DimensionsInput: React.ForwardRefExoticComponent<{
296
296
  type?: import("../TextField").TextFieldType | undefined;
297
297
  onChange?: ((value: string) => void) | undefined;
298
298
  hasError?: boolean | undefined;
299
+ disabledMessage?: React.ReactNode;
299
300
  size?: "base" | "sm" | undefined;
300
301
  multiline?: boolean | undefined;
301
302
  } & {
@@ -312,6 +312,7 @@ export declare const PageInput: import("styled-components").StyledComponent<impo
312
312
  type?: import("../TextField").TextFieldType | undefined;
313
313
  onChange?: ((value: string) => void) | undefined;
314
314
  hasError?: boolean | undefined;
315
+ disabledMessage?: import("react").ReactNode;
315
316
  size?: "base" | "sm" | undefined;
316
317
  multiline?: boolean | undefined;
317
318
  } & import("react").RefAttributes<HTMLInputElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps, "ref"> & import("react").RefAttributes<unknown>>, any, {}, never>;
@@ -296,6 +296,7 @@ export declare const PhoneInput: import("react").ForwardRefExoticComponent<{
296
296
  type?: import("..").TextFieldType | undefined;
297
297
  onChange?: ((value: string) => void) | undefined;
298
298
  hasError?: boolean | undefined;
299
+ disabledMessage?: import("react").ReactNode;
299
300
  size?: "base" | "sm" | undefined;
300
301
  multiline?: boolean | undefined;
301
302
  } & {
@@ -296,6 +296,7 @@ export declare const Search: React.ForwardRefExoticComponent<{
296
296
  type?: import("..").TextFieldType | undefined;
297
297
  onChange?: ((value: string) => void) | undefined;
298
298
  hasError?: boolean | undefined;
299
+ disabledMessage?: React.ReactNode;
299
300
  size?: "base" | "sm" | undefined;
300
301
  multiline?: boolean | undefined;
301
302
  } & {
@@ -297,6 +297,7 @@ declare const Input: import("styled-components").StyledComponent<import("react")
297
297
  type?: import("../TextField").TextFieldType | undefined;
298
298
  onChange?: ((value: string) => void) | undefined;
299
299
  hasError?: boolean | undefined;
300
+ disabledMessage?: import("react").ReactNode;
300
301
  size?: "base" | "sm" | undefined;
301
302
  multiline?: boolean | undefined;
302
303
  } & import("react").RefAttributes<HTMLInputElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps, "ref"> & import("react").RefAttributes<unknown>>, any, {}, never>;
@@ -1,20 +1,37 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var styled = require('./styled.cjs');
5
4
  var withLabels = require('../../hoc/withLabels/withLabels.cjs');
5
+ var buildClassnames = require('../../utils/buildClassnames.cjs');
6
+ require('uid/secure');
7
+ var form_module = require('../../utils/forms/form.module.scss.cjs');
8
+ var Select_module = require('./Select.module.scss.cjs');
6
9
 
7
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
11
 
9
12
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
13
 
11
- const Select = withLabels.withLabels(React.forwardRef(({ className, options, value, onChange, size, disabled, hasError, ...otherProps }, ref) => {
14
+ const Select = withLabels.withLabels(React.forwardRef(({ className, options, value, onChange, size, disabled, disabledMessage, hasError, id, ...otherProps }, ref) => {
12
15
  const handleChange = React.useCallback((e) => {
13
16
  if (!onChange)
14
17
  return;
15
18
  onChange(e.currentTarget.value);
16
19
  }, [onChange]);
17
- return (React__default.default.createElement(styled.SelectInput, { className: className, compact: size === 'sm', value: value !== null && value !== void 0 ? value : undefined, onChange: handleChange, disabled: disabled, hasError: hasError, ref: ref, ...otherProps }, !!options &&
20
+ const getAriaDescribedBy = () => {
21
+ if (hasError && id)
22
+ return `${id}-error`;
23
+ if (disabledMessage && id)
24
+ return `${id}-disabled`;
25
+ return undefined;
26
+ };
27
+ return (React__default.default.createElement("select", { className: buildClassnames.buildClassnames([
28
+ form_module.base,
29
+ form_module.fullStyles,
30
+ Select_module.select,
31
+ size === 'sm' && form_module.compact,
32
+ hasError && form_module.error,
33
+ className,
34
+ ]), id: id, value: value !== null && value !== void 0 ? value : undefined, onChange: handleChange, disabled: disabled, "aria-describedby": getAriaDescribedBy(), ref: ref, ...otherProps }, !!options &&
18
35
  options.map((option) => (React__default.default.createElement("option", { key: option.label, value: option.value, disabled: option.disabled, hidden: option.hidden }, option.label)))));
19
36
  }));
20
37
  Select.displayName = 'Select';
@@ -1 +1 @@
1
- {"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { SelectInput } from './styled';\nimport { withLabels } from '../../hoc';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n options: Array<SelectOption>;\n value?: string;\n size?: 'sm' | 'base';\n disabled?: boolean;\n hasError?: boolean;\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n { className, options, value, onChange, size, disabled, hasError, ...otherProps }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n return (\n <SelectInput\n className={className}\n compact={size === 'sm'}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n hasError={hasError}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </SelectInput>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["withLabels","forwardRef","useCallback","React","SelectInput"],"mappings":";;;;;;;;;;AAwBO,MAAM,MAAM,GAAGA,qBAAU,CAC9BC,gBAAU,CACR,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAe,EAC7F,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,QACEC,qCAACC,kBAAW,EAAA,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,cAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBD,iDACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACQ;AAElB,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Select.cjs","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { withLabels } from '../../hoc';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './Select.module.scss';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n /** Array of options to render in the select dropdown. */\n options: Array<SelectOption>;\n /** Currently selected value. */\n value?: string;\n /** Component size variant. Defaults to `'base'`. */\n size?: 'sm' | 'base';\n /** Disables the select element. */\n disabled?: boolean;\n /**\n * When provided, links the select to the disabled message element via `aria-describedby`.\n * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.\n */\n disabledMessage?: React.ReactNode;\n /** When true, applies error styling. Used with `withLabels` to display an error message. */\n hasError?: boolean;\n /** Callback fired with the new value on change. */\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n className,\n options,\n value,\n onChange,\n size,\n disabled,\n disabledMessage,\n hasError,\n id,\n ...otherProps\n }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n const getAriaDescribedBy = () => {\n if (hasError && id) return `${id}-error`;\n if (disabledMessage && id) return `${id}-disabled`;\n return undefined;\n };\n\n return (\n <select\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.select,\n size === 'sm' && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n id={id}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n aria-describedby={getAriaDescribedBy()}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </select>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["withLabels","forwardRef","useCallback","React","buildClassnames","formStyles","styles"],"mappings":";;;;;;;;;;;;;AAsCO,MAAM,MAAM,GAAGA,qBAAU,CAC9BC,gBAAU,CACR,CACE,EACE,SA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KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACG;AAEb,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
@@ -8,11 +8,22 @@ export type SelectOption = {
8
8
  export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {
9
9
  id?: string;
10
10
  className?: string;
11
+ /** Array of options to render in the select dropdown. */
11
12
  options: Array<SelectOption>;
13
+ /** Currently selected value. */
12
14
  value?: string;
15
+ /** Component size variant. Defaults to `'base'`. */
13
16
  size?: 'sm' | 'base';
17
+ /** Disables the select element. */
14
18
  disabled?: boolean;
19
+ /**
20
+ * When provided, links the select to the disabled message element via `aria-describedby`.
21
+ * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.
22
+ */
23
+ disabledMessage?: React.ReactNode;
24
+ /** When true, applies error styling. Used with `withLabels` to display an error message. */
15
25
  hasError?: boolean;
26
+ /** Callback fired with the new value on change. */
16
27
  onChange?: (value: string) => void;
17
28
  }
18
29
  export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps & React.RefAttributes<HTMLSelectElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps, "ref"> & React.RefAttributes<unknown>>;
@@ -1,14 +1,31 @@
1
1
  import React__default, { forwardRef, useCallback } from 'react';
2
- import { SelectInput } from './styled.js';
3
2
  import { withLabels } from '../../hoc/withLabels/withLabels.js';
3
+ import { buildClassnames } from '../../utils/buildClassnames.js';
4
+ import 'uid/secure';
5
+ import formStyles from '../../utils/forms/form.module.scss.js';
6
+ import styles from './Select.module.scss.js';
4
7
 
5
- const Select = withLabels(forwardRef(({ className, options, value, onChange, size, disabled, hasError, ...otherProps }, ref) => {
8
+ const Select = withLabels(forwardRef(({ className, options, value, onChange, size, disabled, disabledMessage, hasError, id, ...otherProps }, ref) => {
6
9
  const handleChange = useCallback((e) => {
7
10
  if (!onChange)
8
11
  return;
9
12
  onChange(e.currentTarget.value);
10
13
  }, [onChange]);
11
- return (React__default.createElement(SelectInput, { className: className, compact: size === 'sm', value: value !== null && value !== void 0 ? value : undefined, onChange: handleChange, disabled: disabled, hasError: hasError, ref: ref, ...otherProps }, !!options &&
14
+ const getAriaDescribedBy = () => {
15
+ if (hasError && id)
16
+ return `${id}-error`;
17
+ if (disabledMessage && id)
18
+ return `${id}-disabled`;
19
+ return undefined;
20
+ };
21
+ return (React__default.createElement("select", { className: buildClassnames([
22
+ formStyles.base,
23
+ formStyles.fullStyles,
24
+ styles.select,
25
+ size === 'sm' && formStyles.compact,
26
+ hasError && formStyles.error,
27
+ className,
28
+ ]), id: id, value: value !== null && value !== void 0 ? value : undefined, onChange: handleChange, disabled: disabled, "aria-describedby": getAriaDescribedBy(), ref: ref, ...otherProps }, !!options &&
12
29
  options.map((option) => (React__default.createElement("option", { key: option.label, value: option.value, disabled: option.disabled, hidden: option.hidden }, option.label)))));
13
30
  }));
14
31
  Select.displayName = 'Select';
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { SelectInput } from './styled';\nimport { withLabels } from '../../hoc';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n options: Array<SelectOption>;\n value?: string;\n size?: 'sm' | 'base';\n disabled?: boolean;\n hasError?: boolean;\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n { className, options, value, onChange, size, disabled, hasError, ...otherProps }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n return (\n <SelectInput\n className={className}\n compact={size === 'sm'}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n hasError={hasError}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </SelectInput>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["React"],"mappings":";;;;AAwBO,MAAM,MAAM,GAAG,UAAU,CAC9B,UAAU,CACR,CACE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAe,EAC7F,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,QACEA,6BAAC,WAAW,EAAA,EACV,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,cAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBA,yCACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACQ;AAElB,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { ChangeEvent, forwardRef, useCallback } from 'react';\n\nimport { withLabels } from '../../hoc';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './Select.module.scss';\n\nexport type SelectOption = {\n label: string;\n value: string;\n disabled?: boolean;\n hidden?: boolean;\n};\n\nexport interface SelectProps\n extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size' | 'onChange'> {\n id?: string;\n className?: string;\n /** Array of options to render in the select dropdown. */\n options: Array<SelectOption>;\n /** Currently selected value. */\n value?: string;\n /** Component size variant. Defaults to `'base'`. */\n size?: 'sm' | 'base';\n /** Disables the select element. */\n disabled?: boolean;\n /**\n * When provided, links the select to the disabled message element via `aria-describedby`.\n * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.\n */\n disabledMessage?: React.ReactNode;\n /** When true, applies error styling. Used with `withLabels` to display an error message. */\n hasError?: boolean;\n /** Callback fired with the new value on change. */\n onChange?: (value: string) => void;\n}\n\nexport const Select = withLabels(\n forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n className,\n options,\n value,\n onChange,\n size,\n disabled,\n disabledMessage,\n hasError,\n id,\n ...otherProps\n }: SelectProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: ChangeEvent<HTMLSelectElement>) => {\n if (!onChange) return;\n onChange(e.currentTarget.value);\n },\n [onChange],\n );\n\n const getAriaDescribedBy = () => {\n if (hasError && id) return `${id}-error`;\n if (disabledMessage && id) return `${id}-disabled`;\n return undefined;\n };\n\n return (\n <select\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.select,\n size === 'sm' && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n id={id}\n value={value ?? undefined}\n onChange={handleChange}\n disabled={disabled}\n aria-describedby={getAriaDescribedBy()}\n ref={ref}\n {...otherProps}\n >\n {!!options &&\n options.map((option) => (\n <option\n key={option.label}\n value={option.value}\n disabled={option.disabled}\n hidden={option.hidden}\n >\n {option.label}\n </option>\n ))}\n </select>\n );\n },\n ),\n);\n\nSelect.displayName = 'Select';\n"],"names":["React"],"mappings":";;;;;;;AAsCO,MAAM,MAAM,GAAG,UAAU,CAC9B,UAAU,CACR,CACE,EACE,SAAS,EACT,OAAO,EACP,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,EAAE,EACF,GAAG,UAAU,EACD,EACd,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,CAAiC,KAAI;AACpC,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC;AACjC,IAAA,CAAC,EACD,CAAC,QAAQ,CAAC,CACX;IAED,MAAM,kBAAkB,GAAG,MAAK;QAC9B,IAAI,QAAQ,IAAI,EAAE;YAAE,OAAO,CAAA,EAAG,EAAE,CAAA,MAAA,CAAQ;QACxC,IAAI,eAAe,IAAI,EAAE;YAAE,OAAO,CAAA,EAAG,EAAE,CAAA,SAAA,CAAW;AAClD,QAAA,OAAO,SAAS;AAClB,IAAA,CAAC;AAED,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACE,SAAS,EAAE,eAAe,CAAC;AACzB,YAAA,UAAU,CAAC,IAAI;AACf,YAAA,UAAU,CAAC,UAAU;AACrB,YAAA,MAAM,CAAC,MAAM;AACb,YAAA,IAAI,KAAK,IAAI,IAAI,UAAU,CAAC,OAAO;YACnC,QAAQ,IAAI,UAAU,CAAC,KAAK;YAC5B,SAAS;AACV,SAAA,CAAC,EACF,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,GAAI,SAAS,EACzB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAAA,kBAAA,EACA,kBAAkB,EAAE,EACtC,GAAG,EAAE,GAAG,EAAA,GACJ,UAAU,EAAA,EAEb,CAAC,CAAC,OAAO;AACR,QAAA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,MACjBA,yCACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAA,EAEpB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACG;AAEb,CAAC,CACF;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._select_1kp7e_1 {\n --padding-right: var(--sizes-9);\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%, 0 0;\n}\n._select_1kp7e_1:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n}");
6
+ var styles = {"select":"_select_1kp7e_1"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=Select.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.module.scss.cjs","sources":["../../../src/components/Select/Select.module.scss"],"sourcesContent":[".select {\n --padding-right: var(--sizes-9);\n\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position:\n right var(--sizes-3) top 50%,\n 0 0;\n\n &:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,0hBAAA;AAEA,aAAA,CAAA,QAAA,CAAA,iBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._select_1kp7e_1 {\n --padding-right: var(--sizes-9);\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position: right var(--sizes-3) top 50%, 0 0;\n}\n._select_1kp7e_1:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n}");
4
+ var styles = {"select":"_select_1kp7e_1"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=Select.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.module.scss.js","sources":["../../../src/components/Select/Select.module.scss"],"sourcesContent":[".select {\n --padding-right: var(--sizes-9);\n\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position:\n right var(--sizes-3) top 50%,\n 0 0;\n\n &:has(option:disabled:checked) {\n color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,0hBAAA;AAEA,aAAA,CAAA,QAAA,CAAA,iBAAA;;;;"}
@@ -2,14 +2,16 @@
2
2
 
3
3
  var React = require('react');
4
4
  var generateId = require('../../utils/generateId.cjs');
5
- var styled = require('./styled.cjs');
5
+ var buildClassnames = require('../../utils/buildClassnames.cjs');
6
+ var form_module = require('../../utils/forms/form.module.scss.cjs');
7
+ var TextField_module = require('./TextField.module.scss.cjs');
6
8
 
7
9
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
10
 
9
11
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
12
 
11
13
  const NUMBER_REGEX = /^-?[0-9]*\.?[0-9]+$/;
12
- const TextField = React.forwardRef(({ id, className, disabled = false, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
14
+ const TextField = React.forwardRef(({ id, className, disabled = false, disabledMessage, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
13
15
  const handleChange = React.useCallback((event) => {
14
16
  if (!onChange)
15
17
  return;
@@ -32,14 +34,29 @@ const TextField = React.forwardRef(({ id, className, disabled = false, hasError,
32
34
  const ariaDescribedBy = React.useMemo(() => {
33
35
  if (hasError)
34
36
  return `${componentId}-error`;
35
- if (disabled)
37
+ if (disabledMessage)
36
38
  return `${componentId}-disabled`;
37
39
  return undefined;
38
- }, [hasError, componentId, disabled]);
40
+ }, [hasError, disabledMessage, componentId]);
41
+ const isCompact = size === 'sm';
39
42
  if (type === 'text' && multiline) {
40
- return (React__default.default.createElement(styled.Textarea, { className: className, disabled: disabled, hasError: hasError, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
43
+ return (React__default.default.createElement("textarea", { className: buildClassnames.buildClassnames([
44
+ form_module.base,
45
+ form_module.fullStyles,
46
+ TextField_module.textarea,
47
+ isCompact && form_module.compact,
48
+ hasError && form_module.error,
49
+ className,
50
+ ]), disabled: disabled, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
41
51
  }
42
- return (React__default.default.createElement(styled.Input, { className: className, disabled: disabled, hasError: hasError, id: componentId, compact: size === 'sm', name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
52
+ return (React__default.default.createElement("input", { className: buildClassnames.buildClassnames([
53
+ form_module.base,
54
+ form_module.fullStyles,
55
+ TextField_module.input,
56
+ isCompact && form_module.compact,
57
+ hasError && form_module.error,
58
+ className,
59
+ ]), disabled: disabled, id: componentId, name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
43
60
  });
44
61
 
45
62
  exports.TextField = TextField;
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.cjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\n\nimport { Input, Textarea } from './styled';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabled) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, componentId, disabled]);\n\n if (type === 'text' && multiline) {\n return (\n <Textarea\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <Input\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n compact={size === 'sm'}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["forwardRef","useCallback","useMemo","generateId","React","Textarea","Input"],"mappings":";;;;;;;;;;AAMA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAGA,gBAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,MAAM,EACb,KAAK,EACL,GAAG,UAAU,EACE,EACjB,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,KAA0D,KAAI;AAC7D,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;QAE1C,IAAI,QAAQ,KAAK,EAAE,EAAE;YACnB,QAAQ,CAA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A,CAACE,YAAK,EAAA,EACJ,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,WAAW,EACf,OAAO,EAAE,IAAI,KAAK,IAAI,EACtB,IAAI,EAAE,IAAI,EAAA,YAAA,EACE,IAAI,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,EAAA,GAC7B,UAAU,EAAA,CACd;AAEN,CAAC;;;;"}
1
+ {"version":3,"file":"TextField.cjs","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './TextField.module.scss';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n disabledMessage,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabledMessage) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, disabledMessage, componentId]);\n\n const isCompact = size === 'sm';\n\n if (type === 'text' && multiline) {\n return (\n <textarea\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.textarea,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref as React.Ref<HTMLTextAreaElement>}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <input\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.input,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["forwardRef","useCallback","useMemo","generateId","React","buildClassnames","formStyles","styles"],"mappings":";;;;;;;;;;;;AAQA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAGA,gBAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,eAAe,EACf,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,MAAM,EACb,KAAK,EACL,GAAG,UAAU,EACE,EACjB,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAGC,iBAAW,CAC9B,CAAC,KAA0D,KAAI;AAC7D,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;QAE1C,IAAI,QAAQ,KAAK,EAAE,EAAE;YACnB,Q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,EAClB,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAqC,EAC1C,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,KAC7B,UAAU,EAAA,CACd;AAEL,IAAA;AAED,IAAA,QACEF,sBAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,SAAS,EAAEC,+BAAe,CAAC;AACzB,YAAAC,WAAU,CAAC,IAAI;AACf,YAAAA,WAAU,CAAC,UAAU;AACrB,YAAAC,gBAAM,CAAC,KAAK;YACZ,SAAS,IAAID,WAAU,CAAC,OAAO;YAC/B,QAAQ,IAAIA,WAAU,CAAC,KAAK;YAC5B,SAAS;SACV,CAAC,EACF,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,IAAI,EAAA,YAAA,EACE,IAAI,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,KAC7B,UAAU,EAAA,CACd;AAEN,CAAC;;;;"}
@@ -296,6 +296,7 @@ export declare const TextField: React.ForwardRefExoticComponent<{
296
296
  type?: import("./types").TextFieldType | undefined;
297
297
  onChange?: ((value: string) => void) | undefined;
298
298
  hasError?: boolean | undefined;
299
+ disabledMessage?: React.ReactNode;
299
300
  size?: "base" | "sm" | undefined;
300
301
  multiline?: boolean | undefined;
301
302
  } & React.RefAttributes<HTMLInputElement>>;
@@ -1,9 +1,11 @@
1
1
  import React__default, { forwardRef, useCallback, useMemo } from 'react';
2
2
  import { generateId } from '../../utils/generateId.js';
3
- import { Textarea, Input } from './styled.js';
3
+ import { buildClassnames } from '../../utils/buildClassnames.js';
4
+ import formStyles from '../../utils/forms/form.module.scss.js';
5
+ import styles from './TextField.module.scss.js';
4
6
 
5
7
  const NUMBER_REGEX = /^-?[0-9]*\.?[0-9]+$/;
6
- const TextField = forwardRef(({ id, className, disabled = false, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
8
+ const TextField = forwardRef(({ id, className, disabled = false, disabledMessage, hasError, multiline = false, spellCheck = false, name, onChange, placeholder, size = 'base', type = 'text', value, ...otherProps }, ref) => {
7
9
  const handleChange = useCallback((event) => {
8
10
  if (!onChange)
9
11
  return;
@@ -26,14 +28,29 @@ const TextField = forwardRef(({ id, className, disabled = false, hasError, multi
26
28
  const ariaDescribedBy = useMemo(() => {
27
29
  if (hasError)
28
30
  return `${componentId}-error`;
29
- if (disabled)
31
+ if (disabledMessage)
30
32
  return `${componentId}-disabled`;
31
33
  return undefined;
32
- }, [hasError, componentId, disabled]);
34
+ }, [hasError, disabledMessage, componentId]);
35
+ const isCompact = size === 'sm';
33
36
  if (type === 'text' && multiline) {
34
- return (React__default.createElement(Textarea, { className: className, disabled: disabled, hasError: hasError, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
37
+ return (React__default.createElement("textarea", { className: buildClassnames([
38
+ formStyles.base,
39
+ formStyles.fullStyles,
40
+ styles.textarea,
41
+ isCompact && formStyles.compact,
42
+ hasError && formStyles.error,
43
+ className,
44
+ ]), disabled: disabled, id: componentId, name: name, onChange: handleChange, placeholder: placeholder, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
35
45
  }
36
- return (React__default.createElement(Input, { className: className, disabled: disabled, hasError: hasError, id: componentId, compact: size === 'sm', name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
46
+ return (React__default.createElement("input", { className: buildClassnames([
47
+ formStyles.base,
48
+ formStyles.fullStyles,
49
+ styles.input,
50
+ isCompact && formStyles.compact,
51
+ hasError && formStyles.error,
52
+ className,
53
+ ]), disabled: disabled, id: componentId, name: name, "aria-label": name, onChange: handleChange, placeholder: placeholder, type: type, value: value, ref: ref, spellCheck: spellCheck, "aria-describedby": ariaDescribedBy, ...otherProps }));
37
54
  });
38
55
 
39
56
  export { TextField };
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../src/components/TextField/TextField.tsx"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\n\nimport { Input, Textarea } from './styled';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabled) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, componentId, disabled]);\n\n if (type === 'text' && multiline) {\n return (\n <Textarea\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <Input\n className={className}\n disabled={disabled}\n hasError={hasError}\n id={componentId}\n compact={size === 'sm'}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["React"],"mappings":";;;;AAMA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAG,UAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,MAAM,EACb,KAAK,EACL,GAAG,UAAU,EACE,EACjB,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,KAA0D,KAAI;AAC7D,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;QAE1C,IAAI,QAAQ,KAAK,EAAE,EAAE;YACnB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;AAED,QAAA,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC;AACpC,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACvB;AACD,QAAA;QAED,QAAQ,CAAC,QAAQ,CAAC;AACpB,IAAA,CAAC,EACD,CAAC,QAAQ,EAAE,IAAI,CAAC,CACjB;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAF,EAAE,GAAI,UAAU,CAAC,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x"],"sourcesContent":["import React, { useCallback, ChangeEvent, forwardRef, useMemo } from 'react';\nimport { TextFieldProps } from './types';\nimport { generateId } from '../../utils/generateId';\nimport { buildClassnames } from '../../utils';\n\nimport formStyles from '../../utils/forms/form.module.scss';\nimport styles from './TextField.module.scss';\n\nconst NUMBER_REGEX = /^-?[0-9]*\\.?[0-9]+$/;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n (\n {\n id,\n className,\n disabled = false,\n disabledMessage,\n hasError,\n multiline = false,\n spellCheck = false,\n name,\n onChange,\n placeholder,\n size = 'base',\n type = 'text',\n value,\n ...otherProps\n }: TextFieldProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (!onChange) return;\n const newValue = event.currentTarget.value;\n\n if (newValue === '') {\n onChange(newValue);\n return;\n }\n\n if (type !== 'number') {\n onChange(newValue);\n return;\n }\n\n const reg = new RegExp(NUMBER_REGEX);\n if (!reg.test(newValue)) {\n return;\n }\n\n onChange(newValue);\n },\n [onChange, type],\n );\n\n const componentId = useMemo(() => id ?? generateId('textfield'), [id]);\n const ariaDescribedBy = useMemo(() => {\n if (hasError) return `${componentId}-error`;\n if (disabledMessage) return `${componentId}-disabled`;\n return undefined;\n }, [hasError, disabledMessage, componentId]);\n\n const isCompact = size === 'sm';\n\n if (type === 'text' && multiline) {\n return (\n <textarea\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.textarea,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n ref={ref as React.Ref<HTMLTextAreaElement>}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n }\n\n return (\n <input\n className={buildClassnames([\n formStyles.base,\n formStyles.fullStyles,\n styles.input,\n isCompact && formStyles.compact,\n hasError && formStyles.error,\n className,\n ])}\n disabled={disabled}\n id={componentId}\n name={name}\n aria-label={name}\n onChange={handleChange}\n placeholder={placeholder}\n type={type}\n value={value}\n ref={ref}\n spellCheck={spellCheck}\n aria-describedby={ariaDescribedBy}\n {...otherProps}\n />\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;;AAQA,MAAM,YAAY,GAAG,qBAAqB;MAE7B,SAAS,GAAG,UAAU,CACjC,CACE,EACE,EAAE,EACF,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,eAAe,EACf,QAAQ,EACR,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,KAAK,EAClB,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,MAAM,EACb,KAAK,EACL,GAAG,UAAU,EACE,EACjB,GAAG,KACD;AACF,IAAA,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,KAA0D,KAAI;AAC7D,QAAA,IAAI,CAAC,QAAQ;YAAE;AACf,QAAA,MAAM,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,KAAK;QAE1C,IAAI,QAAQ,KAAK,EAAE,EAAE;YACnB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;QAED,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,QAAQ,CAAC,QAAQ,CAAC;YAClB;AACD,QAAA;AAED,QAAA,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC;AACpC,QAAA,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YACvB;AACD,QAAA;QAED,QAAQ,CAAC,QAAQ,CAAC;AACpB,IAAA,CAAC,EACD,CAAC,QAAQ,EAAE,IAAI,CAAC,CACjB;IAED,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,EAAE,KAAA,IAAA,IAAF,EAAE,KAAA,MAAA,GAAF,EAAE,GAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACtE,IAA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AE,WAAW,EACf,IAAI,EAAE,IAAI,EAAA,YAAA,EACE,IAAI,EAChB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EAAA,kBAAA,EACJ,eAAe,KAC7B,UAAU,EAAA,CACd;AAEN,CAAC;;;;"}
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
4
+
5
+ ___$insertStyle("._input_qtip3_1 {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n /* Hide number arrows/spinners */\n}\n._input_qtip3_1::-webkit-outer-spin-button, ._input_qtip3_1::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n}\n._input_qtip3_1[type=number] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n}\n\n._textarea_qtip3_16 {\n padding-block: var(--sizes-2);\n}");
6
+ var styles = {"input":"_input_qtip3_1","textarea":"_textarea_qtip3_16"};
7
+
8
+ module.exports = styles;
9
+ //# sourceMappingURL=TextField.module.scss.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.module.scss.cjs","sources":["../../../src/components/TextField/TextField.module.scss"],"sourcesContent":[".input {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n\n /* Hide number arrows/spinners */\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n }\n}\n\n.textarea {\n padding-block: var(--sizes-2);\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,ycAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -0,0 +1,7 @@
1
+ import insertStyle from '../../_virtual/____insertStyle.js';
2
+
3
+ insertStyle("._input_qtip3_1 {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n /* Hide number arrows/spinners */\n}\n._input_qtip3_1::-webkit-outer-spin-button, ._input_qtip3_1::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n}\n._input_qtip3_1[type=number] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n}\n\n._textarea_qtip3_16 {\n padding-block: var(--sizes-2);\n}");
4
+ var styles = {"input":"_input_qtip3_1","textarea":"_textarea_qtip3_16"};
5
+
6
+ export { styles as default };
7
+ //# sourceMappingURL=TextField.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextField.module.scss.js","sources":["../../../src/components/TextField/TextField.module.scss"],"sourcesContent":[".input {\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n\n /* Hide number arrows/spinners */\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n appearance: none;\n margin: 0;\n }\n\n &[type='number'] {\n appearance: textfield;\n min-width: 8ch;\n text-align: right;\n }\n}\n\n.textarea {\n padding-block: var(--sizes-2);\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,ycAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,UAAA,CAAA,oBAAA;;;;"}
@@ -297,6 +297,7 @@ export declare const TextField: import("react").ForwardRefExoticComponent<Omit<{
297
297
  type?: import("./types").TextFieldType | undefined;
298
298
  onChange?: ((value: string) => void) | undefined;
299
299
  hasError?: boolean | undefined;
300
+ disabledMessage?: import("react").ReactNode;
300
301
  size?: "base" | "sm" | undefined;
301
302
  multiline?: boolean | undefined;
302
303
  } & import("react").RefAttributes<HTMLInputElement> & import("../../hoc/withLabels/withLabels").WithLabelsProps, "ref"> & import("react").RefAttributes<unknown>>;
@@ -1,14 +1,25 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { ComponentSizeType } from '../types';
3
3
  export type TextFieldType = 'text' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'datetime-local' | 'month' | 'time' | 'week' | 'currency';
4
4
  export declare const textFieldTypes: readonly ["text", "email", "number", "password", "search", "tel", "url", "date", "datetime-local", "month", "time", "week", "currency"];
5
5
  type CommonAttributes = Omit<React.InputHTMLAttributes<HTMLInputElement> & React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'size' | 'type' | 'value'>;
6
6
  export type TextFieldProps = CommonAttributes & {
7
+ /** Current input value. */
7
8
  value?: string;
9
+ /** HTML input type. Defaults to `'text'`. */
8
10
  type?: TextFieldType;
11
+ /** Callback fired with the new value on change. */
9
12
  onChange?: (value: string) => void;
13
+ /** When true, applies error styling. Used with `withLabels` to display an error message. */
10
14
  hasError?: boolean;
15
+ /**
16
+ * When provided, links the input to the disabled message element via `aria-describedby`.
17
+ * Passed through from `withLabels` — the HOC renders the visible message and sets `disabled`.
18
+ */
19
+ disabledMessage?: React.ReactNode;
20
+ /** Component size variant. Defaults to `'base'`. */
11
21
  size?: ComponentSizeType;
22
+ /** Renders a `<textarea>` instead of `<input>` when `type` is `'text'`. */
12
23
  multiline?: boolean;
13
24
  };
14
25
  export {};
@@ -21,14 +21,14 @@ const withLabels = (Component) => {
21
21
  const ComponentWithLabels = React.forwardRef(({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {
22
22
  const componentId = useId.useId({ id, prefix: Component.name });
23
23
  if (!label)
24
- return (React__default.default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, ...otherProps }));
24
+ return (React__default.default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, disabledMessage: disabledMessage, ...otherProps }));
25
25
  return (React__default.default.createElement(FlexCol.FlexCol, { className: withLabels_module.rootStack },
26
26
  React__default.default.createElement(FlexRow.FlexRow, null,
27
27
  React__default.default.createElement(Text.Text, { variant: "inputLabel", id: `${componentId}-label`, htmlFor: componentId }, label),
28
28
  (tooltip || tooltipContent) && (React__default.default.createElement(styled.BlockTooltip, { text: tooltip, content: tooltipContent },
29
29
  React__default.default.createElement(HelpIcon.ReactComponent, { "data-testid": "tooltip-help", width: index.theme.sizes.base, height: index.theme.sizes.base, color: index.theme.colors.neutral.ink.light })))),
30
- hint && React__default.default.createElement(Text.Text, { variant: "hintText", as: "span", className: withLabels_module.hint, id: `${componentId}-hint` }, hint),
31
- React__default.default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, ...otherProps }),
30
+ hint && (React__default.default.createElement(Text.Text, { variant: "hintText", as: "span", className: withLabels_module.hint, id: `${componentId}-hint` }, hint)),
31
+ React__default.default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, disabledMessage: disabledMessage, ...otherProps }),
32
32
  error && (React__default.default.createElement(FlexRow.FlexRow, { id: `${componentId}-error`, gap: "xs" },
33
33
  React__default.default.createElement(CriticalIcon.ReactComponent, { width: 16, height: 16, color: index.theme.colors.secondary.red.base }),
34
34
  React__default.default.createElement(Text.Text, { variant: "error", as: "span", className: withLabels_module.error }, error))),
@@ -1 +1 @@
1
- {"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { CriticalIcon, HelpIcon, LockIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './styled';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>{hint}</Text>}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <FlexRow id={`${componentId}-error`} gap=\"xs\">\n <CriticalIcon width={16} height={16} color={theme.colors.secondary.red.base} />\n <Text variant=\"error\" as=\"span\" className={styles.error}>{error}</Text>\n </FlexRow>\n )}\n {disabledMessage && (\n <FlexRow id={`${componentId}-disabled`} gap=\"xs\">\n <LockIcon width={16} height={16} color={theme.colors.neutral.ink.light} />\n <Text variant=\"bodyBold\" as=\"span\">{disabledMessage}</Text>\n </FlexRow>\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["forwardRef","useId","React","FlexCol","styles","FlexRow","Text","BlockTooltip","HelpIcon","theme","CriticalIcon","LockIcon"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAGA,gBAAU,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AAC,OAAO,EAAC,UAAU,EAAC,EAAE,EAAC,MAAM,EAAA,EAAE,eAAe,CAAQ,CACnD,CACX,CACO;AAEd,IAAA,CAAC,CACF;AAED,IAAA,mBAAmB,CAAC,WAAW,GAAG,CAAA,WAAA,EAAc,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
1
+ {"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { CriticalIcon, HelpIcon, LockIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './styled';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <FlexRow id={`${componentId}-error`} gap=\"xs\">\n <CriticalIcon width={16} height={16} color={theme.colors.secondary.red.base} />\n <Text variant=\"error\" as=\"span\" className={styles.error}>\n {error}\n </Text>\n </FlexRow>\n )}\n {disabledMessage && (\n <FlexRow id={`${componentId}-disabled`} gap=\"xs\">\n <LockIcon width={16} height={16} color={theme.colors.neutral.ink.light} />\n <Text variant=\"bodyBold\" as=\"span\">\n {disabledMessage}\n </Text>\n </FlexRow>\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["forwardRef","useId","React","FlexCol","styles","FlexRow","Text","BlockTooltip","HelpIcon","theme","CriticalIcon","LockIcon"],"mappings":";;;;;;;;;;;;;;;;;;AAsBA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAGA,gBAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAGC,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzD,QAAA,IAAI,CAAC,KAAK;AACR,YAAA,QACEC,sBAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,WA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entWithLabels = forwardRef(({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {
16
16
  const componentId = useId({ id, prefix: Component.name });
17
17
  if (!label)
18
- return (React__default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, ...otherProps }));
18
+ return (React__default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, disabledMessage: disabledMessage, ...otherProps }));
19
19
  return (React__default.createElement(FlexCol, { className: labelStyles.rootStack },
20
20
  React__default.createElement(FlexRow, null,
21
21
  React__default.createElement(Text, { variant: "inputLabel", id: `${componentId}-label`, htmlFor: componentId }, label),
22
22
  (tooltip || tooltipContent) && (React__default.createElement(BlockTooltip, { text: tooltip, content: tooltipContent },
23
23
  React__default.createElement(HelpIcon, { "data-testid": "tooltip-help", width: theme.sizes.base, height: theme.sizes.base, color: theme.colors.neutral.ink.light })))),
24
- hint && React__default.createElement(Text, { variant: "hintText", as: "span", className: labelStyles.hint, id: `${componentId}-hint` }, hint),
25
- React__default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, ...otherProps }),
24
+ hint && (React__default.createElement(Text, { variant: "hintText", as: "span", className: labelStyles.hint, id: `${componentId}-hint` }, hint)),
25
+ React__default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, disabledMessage: disabledMessage, ...otherProps }),
26
26
  error && (React__default.createElement(FlexRow, { id: `${componentId}-error`, gap: "xs" },
27
27
  React__default.createElement(CriticalIcon, { width: 16, height: 16, color: theme.colors.secondary.red.base }),
28
28
  React__default.createElement(Text, { variant: "error", as: "span", className: labelStyles.error }, error))),
@@ -1 +1 @@
1
- {"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { CriticalIcon, HelpIcon, LockIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './styled';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>{hint}</Text>}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <FlexRow id={`${componentId}-error`} gap=\"xs\">\n <CriticalIcon width={16} height={16} color={theme.colors.secondary.red.base} />\n <Text variant=\"error\" as=\"span\" className={styles.error}>{error}</Text>\n </FlexRow>\n )}\n {disabledMessage && (\n <FlexRow id={`${componentId}-disabled`} gap=\"xs\">\n <LockIcon width={16} height={16} color={theme.colors.neutral.ink.light} />\n <Text variant=\"bodyBold\" as=\"span\">{disabledMessage}</Text>\n </FlexRow>\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["React","styles"],"mappings":";;;;;;;;;;;;AAsBA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAG,UAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzD,QAAA,IAAI,CAAC,KAAK;YACR,QACEA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,CAAC,CAAC,KAAK,EACjB,QAAQ,EAAE,CAAC,CAAC,eAAe,EAAA,GACtB,UAAgB,EAAA,CACrB;QAGN,QACEA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAEC,WAAM,CAAC,SAAS,EAAA;AAClC,YAAAD,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA;AACN,gBAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,YAAY,EAAC,EAAE,EAAE,CAAA,EAAG,WAAW,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAA,EACxE,KAAK,CACD;AACN,gBAAA,CAAC,OAAO,IAAI,cAAc,MACzBA,cAAA,CAAA,aAAA,CAAC,YAAY,EAAA,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAA;AAClD,oBAAAA,cAAA,CAAA,aAAA,CAAC,QAAQ,EAAA,EAAA,aAAA,EACK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I,EAAA;gBAC9CA,cAAA,CAAA,aAAA,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAA,CAAI;AAC1E,gBAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,UAAU,EAAC,EAAE,EAAC,MAAM,EAAA,EAAE,eAAe,CAAQ,CACnD,CACX,CACO;AAEd,IAAA,CAAC,CACF;AAED,IAAA,mBAAmB,CAAC,WAAW,GAAG,CAAA,WAAA,EAAc,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
1
+ {"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { CriticalIcon, HelpIcon, LockIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './styled';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <FlexRow id={`${componentId}-error`} gap=\"xs\">\n <CriticalIcon width={16} height={16} color={theme.colors.secondary.red.base} />\n <Text variant=\"error\" as=\"span\" className={styles.error}>\n {error}\n </Text>\n </FlexRow>\n )}\n {disabledMessage && (\n <FlexRow id={`${componentId}-disabled`} gap=\"xs\">\n <LockIcon width={16} height={16} color={theme.colors.neutral.ink.light} />\n <Text variant=\"bodyBold\" as=\"span\">\n {disabledMessage}\n </Text>\n </FlexRow>\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["React","styles"],"mappings":";;;;;;;;;;;;AAsBA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAG,UAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAA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AAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/ui",
3
- "version": "14.6.0",
3
+ "version": "14.7.0",
4
4
  "description": "New optimised component library for Veeqo.",
5
5
  "author": "Robert Wealthall",
6
6
  "license": "ISC",
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var styled = require('styled-components');
4
- var inputStyles = require('../../utils/forms/inputStyles.cjs');
5
- var index = require('../../theme/index.cjs');
6
-
7
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
10
-
11
- const dropdownIndicatorStyles = styled.css `--padding-right:${index.theme.sizes[9]};padding-right:var(--padding-right);background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right ${index.theme.sizes[3]} top 50%,0 0;`;
12
- const SelectInput = styled__default.default.select.withConfig({ displayName: "vui--SelectInput", componentId: "vui--1v4mu6a" }) `${inputStyles.inputFullStyles} ${dropdownIndicatorStyles} &:has(option:disabled:checked){color:${index.theme.colors.neutral.ink.light};}`;
13
-
14
- exports.SelectInput = SelectInput;
15
- exports.dropdownIndicatorStyles = dropdownIndicatorStyles;
16
- //# sourceMappingURL=styled.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.cjs","sources":["../../../src/components/Select/styled.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { inputFullStyles } from '../../utils/forms/inputStyles';\nimport { theme } from '../../theme';\n\nexport const dropdownIndicatorStyles = css`\n --padding-right: ${theme.sizes[9]};\n\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position:\n right ${theme.sizes[3]} top 50%,\n 0 0;\n`;\n\nexport const SelectInput = styled.select<any>`\n ${inputFullStyles}\n ${dropdownIndicatorStyles}\n\n /* Simulate placeholder styles when a disabled option is selected */\n &:has(option:disabled:checked) {\n color: ${theme.colors.neutral.ink.light};\n }\n`;\n"],"names":["css","theme","styled","inputFullStyles"],"mappings":";;;;;;;;;;MAIa,uBAAuB,GAAGA,UAAG,CAAA,CAAA,gBAAA,EACrBC,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,+UAAA,EAMvBA,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;MAIb,WAAW,GAAGC,uBAAM,CAAC,MAAM,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,kBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,EACpCC,2BAAe,CAAA,CAAA,EACf,uBAAuB,yCAIdF,WAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,EAAA;;;;;"}
@@ -1,2 +0,0 @@
1
- export declare const dropdownIndicatorStyles: import("styled-components").FlattenSimpleInterpolation;
2
- export declare const SelectInput: import("styled-components").StyledComponent<"select", any, any, never>;
@@ -1,9 +0,0 @@
1
- import styled, { css } from 'styled-components';
2
- import { inputFullStyles } from '../../utils/forms/inputStyles.js';
3
- import { theme } from '../../theme/index.js';
4
-
5
- const dropdownIndicatorStyles = css `--padding-right:${theme.sizes[9]};padding-right:var(--padding-right);background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right ${theme.sizes[3]} top 50%,0 0;`;
6
- const SelectInput = styled.select.withConfig({ displayName: "vui--SelectInput", componentId: "vui--1v4mu6a" }) `${inputFullStyles} ${dropdownIndicatorStyles} &:has(option:disabled:checked){color:${theme.colors.neutral.ink.light};}`;
7
-
8
- export { SelectInput, dropdownIndicatorStyles };
9
- //# sourceMappingURL=styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.js","sources":["../../../src/components/Select/styled.ts"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { inputFullStyles } from '../../utils/forms/inputStyles';\nimport { theme } from '../../theme';\n\nexport const dropdownIndicatorStyles = css`\n --padding-right: ${theme.sizes[9]};\n\n padding-right: var(--padding-right);\n background-image: url(\"data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fillRule='evenodd' clipRule='evenodd' d='M4 6L8 10L12 6H4Z' fill='currentColor' /%3E%3C/svg%3E\");\n background-repeat: no-repeat;\n background-position:\n right ${theme.sizes[3]} top 50%,\n 0 0;\n`;\n\nexport const SelectInput = styled.select<any>`\n ${inputFullStyles}\n ${dropdownIndicatorStyles}\n\n /* Simulate placeholder styles when a disabled option is selected */\n &:has(option:disabled:checked) {\n color: ${theme.colors.neutral.ink.light};\n }\n`;\n"],"names":[],"mappings":";;;;MAIa,uBAAuB,GAAG,GAAG,CAAA,CAAA,gBAAA,EACrB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA,+UAAA,EAMvB,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;MAIb,WAAW,GAAG,MAAM,CAAC,MAAM,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,kBAAA,EAAA,WAAA,EAAA,cAAA,EAAA,CAAA,CAAA,CAAA,EACpC,eAAe,CAAA,CAAA,EACf,uBAAuB,yCAId,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA,EAAA;;;;"}
@@ -1,16 +0,0 @@
1
- 'use strict';
2
-
3
- var styled = require('styled-components');
4
- var inputStyles = require('../../utils/forms/inputStyles.cjs');
5
- var index = require('../../theme/index.cjs');
6
-
7
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
-
9
- var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
10
-
11
- const Input = styled__default.default.input.withConfig({ displayName: "vui--Input", componentId: "vui--3jt15a" }) `${inputStyles.inputFullStyles} width:100%;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;min-width:8ch;text-align:right;}`;
12
- const Textarea = styled__default.default.textarea.withConfig({ displayName: "vui--Textarea", componentId: "vui--1k04ik" }) `${inputStyles.inputFullStyles} padding-block:${index.theme.sizes[2]};`;
13
-
14
- exports.Input = Input;
15
- exports.Textarea = Textarea;
16
- //# sourceMappingURL=styled.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.cjs","sources":["../../../src/components/TextField/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { inputFullStyles } from '../../utils/forms/inputStyles';\nimport { theme } from '../../theme';\n\nexport const Input = styled.input<any>`\n ${inputFullStyles}\n\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n\n /* Hide number arrows/spinners */\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &[type='number'] {\n -moz-appearance: textfield;\n min-width: 8ch;\n text-align: right;\n }\n`;\n\nexport const Textarea = styled.textarea<any>`\n ${inputFullStyles}\n\n padding-block: ${theme.sizes[2]};\n`;\n"],"names":["styled","inputFullStyles","theme"],"mappings":";;;;;;;;;;AAIO,MAAM,KAAK,GAAGA,uBAAM,CAAC,KAAK,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,EAC7BC,2BAAe,CAAA,mLAAA;AAkBZ,MAAM,QAAQ,GAAGD,uBAAM,CAAC,QAAQ,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,eAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,EACnCC,2BAAe,CAAA,eAAA,EAEAC,WAAK,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;"}
@@ -1,2 +0,0 @@
1
- export declare const Input: import("styled-components").StyledComponent<"input", any, any, never>;
2
- export declare const Textarea: import("styled-components").StyledComponent<"textarea", any, any, never>;
@@ -1,9 +0,0 @@
1
- import styled from 'styled-components';
2
- import { inputFullStyles } from '../../utils/forms/inputStyles.js';
3
- import { theme } from '../../theme/index.js';
4
-
5
- const Input = styled.input.withConfig({ displayName: "vui--Input", componentId: "vui--3jt15a" }) `${inputFullStyles} width:100%;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;min-width:8ch;text-align:right;}`;
6
- const Textarea = styled.textarea.withConfig({ displayName: "vui--Textarea", componentId: "vui--1k04ik" }) `${inputFullStyles} padding-block:${theme.sizes[2]};`;
7
-
8
- export { Input, Textarea };
9
- //# sourceMappingURL=styled.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styled.js","sources":["../../../src/components/TextField/styled.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { inputFullStyles } from '../../utils/forms/inputStyles';\nimport { theme } from '../../theme';\n\nexport const Input = styled.input<any>`\n ${inputFullStyles}\n\n /* Overrides browser default width - note: this breaks the native [size] attribute */\n width: 100%;\n\n /* Hide number arrows/spinners */\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &[type='number'] {\n -moz-appearance: textfield;\n min-width: 8ch;\n text-align: right;\n }\n`;\n\nexport const Textarea = styled.textarea<any>`\n ${inputFullStyles}\n\n padding-block: ${theme.sizes[2]};\n`;\n"],"names":[],"mappings":";;;;AAIO,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,EAC7B,eAAe,CAAA,mLAAA;AAkBZ,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA,UAAA,CAAA,EAAA,WAAA,EAAA,eAAA,EAAA,WAAA,EAAA,aAAA,EAAA,CAAA,CAAA,CAAA,EACnC,eAAe,CAAA,eAAA,EAEA,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;;;;"}