@midas-ds/components 16.2.4 → 16.2.5

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 (54) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/calendar/index.js +1 -1
  3. package/character-counter/CharacterCounter.d.ts +3 -2
  4. package/character-counter/index.js +1 -1
  5. package/checkbox/Checkbox.d.ts +2 -4
  6. package/checkbox/CheckboxGroupItem.d.ts +1 -2
  7. package/checkbox/CheckboxInner.d.ts +2 -2
  8. package/checkbox/SingleCheckbox.d.ts +1 -2
  9. package/checkbox/index.js +2 -2
  10. package/checkbox/types.d.ts +2 -1
  11. package/chunks/CharacterCounter-_m-SgTMV.js +20 -0
  12. package/chunks/Checkbox-gsEu5wcB.js +119 -0
  13. package/chunks/{CheckboxGroup-C5kaqBcn.js → CheckboxGroup-A7UJMi5J.js} +3 -3
  14. package/chunks/{ComboBox-N97lv5kN.js → ComboBox-yl5zHYPk.js} +1 -1
  15. package/chunks/{DateField-DeuLPe1Y.js → DateField-BsT1K-bB.js} +1 -1
  16. package/chunks/{DateRangePicker-BqjLArNi.js → DateRangePicker-BsK7pMRv.js} +2 -2
  17. package/chunks/FieldError-Bc0acYNs.js +21 -0
  18. package/chunks/{Layout-ClW2Lbvq.js → Layout-DX3HUm5b.js} +72 -71
  19. package/chunks/{Radio-Dro99zCs.js → Radio-CSFYbin8.js} +1 -1
  20. package/chunks/{RangeCalendar-CGk2btOp.js → RangeCalendar-BF-6p7u2.js} +1 -1
  21. package/chunks/{SearchField-BfpeANM6.js → SearchField-mBHZ9pFg.js} +1 -1
  22. package/chunks/{Select-nL9iJMlf.js → Select-BjD5iQvX.js} +2 -2
  23. package/chunks/{Select-D-LtFSZX.js → Select-Df4333VV.js} +2 -2
  24. package/chunks/{Table-CgBjwlIi.js → Table-t3rVzb31.js} +1 -1
  25. package/chunks/TextArea-B2BePnZz.js +136 -0
  26. package/combobox/index.js +1 -1
  27. package/date-field/index.js +1 -1
  28. package/date-picker/index.js +1 -1
  29. package/field-error/FieldError.d.ts +3 -2
  30. package/field-error/index.js +1 -1
  31. package/index.js +15 -15
  32. package/layout/components/SidebarLink.d.ts +1 -2
  33. package/layout/index.js +1 -1
  34. package/legacy-select/HiddenMultiSelect.d.ts +2 -2
  35. package/legacy-select/MultiSelectValueTag.d.ts +3 -3
  36. package/legacy-select/Select.d.ts +2 -4
  37. package/legacy-select/index.js +1 -1
  38. package/legacy-select/types.d.ts +2 -1
  39. package/legacy-select/useMultiSelect.d.ts +1 -1
  40. package/package.json +1 -1
  41. package/radio/index.js +1 -1
  42. package/search-field/index.js +1 -1
  43. package/select/index.js +1 -1
  44. package/table/index.js +1 -1
  45. package/textfield/Input.d.ts +3 -2
  46. package/textfield/PasswordField.d.ts +1 -2
  47. package/textfield/TextArea.d.ts +5 -3
  48. package/textfield/TextField.d.ts +5 -3
  49. package/textfield/TextFieldBase.d.ts +3 -3
  50. package/textfield/index.js +1 -1
  51. package/chunks/CharacterCounter-DeuE2det.js +0 -21
  52. package/chunks/Checkbox-CP6Nv9yx.js +0 -122
  53. package/chunks/FieldError-C0HRIcAx.js +0 -23
  54. package/chunks/TextArea-CRvbqqVZ.js +0 -124
@@ -0,0 +1,136 @@
1
+ import { jsxs as l, jsx as e, Fragment as T } from "react/jsx-runtime";
2
+ import { TextField as F, useContextProps as h, InputContext as u, Input as N, TextArea as P } from "react-aria-components";
3
+ import { a as b, c as m } from "./clsx-AexbMWKp.js";
4
+ import { s as c } from "./TextField.module-DZslrEPC.js";
5
+ import { useState as g } from "react";
6
+ import { T as x } from "./Text-TWzJxnto.js";
7
+ import { B as C } from "./Button-wBgWrXj3.js";
8
+ import { u as v } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
9
+ import { F as p } from "./FieldError-Bc0acYNs.js";
10
+ import { C as I } from "./CharacterCounter-_m-SgTMV.js";
11
+ import { a as L, L as y } from "./Label-Dup4lWaR.js";
12
+ const f = (t) => {
13
+ const {
14
+ label: s,
15
+ description: r,
16
+ errorMessage: a,
17
+ showCounter: n,
18
+ errorPosition: o = "top",
19
+ size: i = "large",
20
+ popover: d,
21
+ children: w
22
+ } = t;
23
+ return /* @__PURE__ */ l(
24
+ F,
25
+ {
26
+ ...t,
27
+ className: b(c.textField, {
28
+ [c.medium]: i === "medium"
29
+ }),
30
+ children: [
31
+ /* @__PURE__ */ e(L, { popover: d, children: s && /* @__PURE__ */ e(y, { children: s }) }),
32
+ r && /* @__PURE__ */ e(x, { slot: "description", children: r }),
33
+ n && /* @__PURE__ */ e(I, { isLonely: !r }),
34
+ o === "top" && /* @__PURE__ */ e(p, { "data-testid": "fieldError", children: a }),
35
+ w,
36
+ o === "bottom" && /* @__PURE__ */ e(
37
+ p,
38
+ {
39
+ "data-testid": "fieldError",
40
+ className: c.bottomError,
41
+ children: a
42
+ }
43
+ )
44
+ ]
45
+ }
46
+ );
47
+ }, A = { hide: "Hide", show: "Show" }, B = { hide: "Dölj", show: "Visa" }, E = {
48
+ en: A,
49
+ sv: B
50
+ }, S = ({ ref: t, ...s }) => {
51
+ [s, t] = h(s, t, u);
52
+ const [r, a] = g(!1), n = () => a((i) => !i), o = v(E);
53
+ return /* @__PURE__ */ l(T, { children: [
54
+ r && /* @__PURE__ */ e(
55
+ x,
56
+ {
57
+ slot: "description",
58
+ className: c.passwordText,
59
+ children: s.value
60
+ }
61
+ ),
62
+ /* @__PURE__ */ e(
63
+ C,
64
+ {
65
+ variant: "tertiary",
66
+ onPress: n,
67
+ className: c.passwordButton,
68
+ children: r ? o.format("hide") : o.format("show")
69
+ }
70
+ )
71
+ ] });
72
+ }, $ = ({
73
+ ref: t,
74
+ skipContext: s = !1,
75
+ ...r
76
+ }) => {
77
+ const [a, n] = h(
78
+ r,
79
+ t,
80
+ u
81
+ ), o = s ? t : n, i = s ? r : a;
82
+ return /* @__PURE__ */ l("div", { className: c.wrap, children: [
83
+ /* @__PURE__ */ e(
84
+ N,
85
+ {
86
+ ...i,
87
+ ref: o,
88
+ className: m(c.input, i.className)
89
+ }
90
+ ),
91
+ i.type === "password" && /* @__PURE__ */ e(S, { ...i })
92
+ ] });
93
+ }, K = ({
94
+ className: t,
95
+ form: s,
96
+ list: r,
97
+ min: a,
98
+ max: n,
99
+ ref: o,
100
+ type: i,
101
+ ...d
102
+ }) => /* @__PURE__ */ e(f, { ...d, children: /* @__PURE__ */ e(
103
+ $,
104
+ {
105
+ className: m(t),
106
+ form: s,
107
+ list: r,
108
+ min: a,
109
+ max: n,
110
+ ref: o,
111
+ type: i,
112
+ skipContext: !0
113
+ }
114
+ ) }), O = ({
115
+ className: t,
116
+ form: s,
117
+ rows: r,
118
+ wrap: a,
119
+ ref: n,
120
+ ...o
121
+ }) => /* @__PURE__ */ e(f, { ...o, children: /* @__PURE__ */ e(
122
+ P,
123
+ {
124
+ className: m(c.textArea, t),
125
+ form: s,
126
+ ref: n,
127
+ rows: r,
128
+ wrap: a
129
+ }
130
+ ) });
131
+ export {
132
+ $ as I,
133
+ f as T,
134
+ K as a,
135
+ O as b
136
+ };
package/combobox/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as a, a as b, b as x } from "../chunks/ComboBox-N97lv5kN.js";
1
+ import { C as a, a as b, b as x } from "../chunks/ComboBox-yl5zHYPk.js";
2
2
  export {
3
3
  a as ComboBox,
4
4
  b as ComboBoxItem,
@@ -1,4 +1,4 @@
1
- import { D as t } from "../chunks/DateField-DeuLPe1Y.js";
1
+ import { D as t } from "../chunks/DateField-BsT1K-bB.js";
2
2
  import { a as r, b as o, D as p } from "../chunks/DateInputDivider-CkTB5q5k.js";
3
3
  export {
4
4
  t as DateField,
@@ -1,4 +1,4 @@
1
- import { D as r, a as t } from "../chunks/DateRangePicker-BqjLArNi.js";
1
+ import { D as r, a as t } from "../chunks/DateRangePicker-BsK7pMRv.js";
2
2
  export {
3
3
  r as DatePicker,
4
4
  t as DateRangePicker
@@ -1,6 +1,7 @@
1
+ import { Ref } from 'react';
1
2
  import { FieldErrorProps as AriaFieldErrorProps } from 'react-aria-components';
2
- import * as React from 'react';
3
3
  export interface FieldErrorProps extends AriaFieldErrorProps {
4
4
  isInvalid?: boolean;
5
+ ref?: Ref<HTMLElement>;
5
6
  }
6
- export declare const FieldError: React.ForwardRefExoticComponent<FieldErrorProps & React.RefAttributes<HTMLElement>>;
7
+ export declare const FieldError: ({ ref, ...props }: FieldErrorProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { F as e } from "../chunks/FieldError-C0HRIcAx.js";
1
+ import { F as e } from "../chunks/FieldError-Bc0acYNs.js";
2
2
  export {
3
3
  e as FieldError
4
4
  };
package/index.js CHANGED
@@ -3,41 +3,41 @@ import { B as s, a as p } from "./chunks/BadgeContainer-CKVsfTlF.js";
3
3
  import { B as m } from "./chunks/Breadcrumbs-By2bMbQd.js";
4
4
  import { B as i } from "./chunks/Button-wBgWrXj3.js";
5
5
  import { B as d } from "./chunks/ButtonGroup-Dr6HOBo2.js";
6
- import { C as l, R as C } from "./chunks/RangeCalendar-CGk2btOp.js";
6
+ import { C as l, R as C } from "./chunks/RangeCalendar-BF-6p7u2.js";
7
7
  import { C as g, d as u, c as B, a as c, e as L, f as S, b as D } from "./chunks/Card-ia98VoKL.js";
8
- import { C as G } from "./chunks/CharacterCounter-DeuE2det.js";
9
- import { C as R } from "./chunks/Checkbox-CP6Nv9yx.js";
10
- import { C as M } from "./chunks/CheckboxGroup-C5kaqBcn.js";
8
+ import { C as G } from "./chunks/CharacterCounter-_m-SgTMV.js";
9
+ import { C as R } from "./chunks/Checkbox-gsEu5wcB.js";
10
+ import { C as M } from "./chunks/CheckboxGroup-A7UJMi5J.js";
11
11
  import { C as v } from "./chunks/ColorSchemeSwitch-DugvPh6T.js";
12
- import { C as h, a as H, b as y } from "./chunks/ComboBox-N97lv5kN.js";
13
- import { D as N } from "./chunks/DateField-DeuLPe1Y.js";
12
+ import { C as h, a as H, b as y } from "./chunks/ComboBox-yl5zHYPk.js";
13
+ import { D as N } from "./chunks/DateField-BsT1K-bB.js";
14
14
  import { a as Q, b as Z, D as j } from "./chunks/DateInputDivider-CkTB5q5k.js";
15
- import { D as z, a as J } from "./chunks/DateRangePicker-BqjLArNi.js";
16
- import { F as O } from "./chunks/FieldError-C0HRIcAx.js";
15
+ import { D as z, a as J } from "./chunks/DateRangePicker-BsK7pMRv.js";
16
+ import { F as O } from "./chunks/FieldError-Bc0acYNs.js";
17
17
  import { D as V, F as W } from "./chunks/FileUpload-h1PxqQmb.js";
18
18
  import { G as Y } from "./chunks/Grid-B-WgMwON.js";
19
19
  import { G as $ } from "./chunks/GridItem-5t1Z14sM.js";
20
20
  import { H as ao } from "./chunks/Heading-D8tNNJkt.js";
21
21
  import { I as eo } from "./chunks/InfoBanner-DLiVpNON.js";
22
22
  import { L as so } from "./chunks/Label-Dup4lWaR.js";
23
- import { H as xo, L as mo, N as fo, S as io, a as no } from "./chunks/Layout-ClW2Lbvq.js";
23
+ import { H as xo, L as mo, N as fo, S as io, a as no } from "./chunks/Layout-DX3HUm5b.js";
24
24
  import { L as lo } from "./chunks/Link-yTNUNv3C.js";
25
25
  import { L as bo } from "./chunks/LinkButton-3nAekUJ4.js";
26
26
  import { L as uo } from "./chunks/Logo-InDSslpO.js";
27
27
  import { M as co } from "./chunks/Dialog-DC0cGNj5.js";
28
28
  import { P as So } from "./chunks/Popover-BcEtFiU1.js";
29
29
  import { P as Io } from "./chunks/ProgressBar-CbwvcHvk.js";
30
- import { R as Po, a as Ro } from "./chunks/Radio-Dro99zCs.js";
31
- import { S as Mo } from "./chunks/SearchField-BfpeANM6.js";
32
- import { S as vo } from "./chunks/Select-D-LtFSZX.js";
33
- import { S as ho } from "./chunks/Select-nL9iJMlf.js";
30
+ import { R as Po, a as Ro } from "./chunks/Radio-CSFYbin8.js";
31
+ import { S as Mo } from "./chunks/SearchField-mBHZ9pFg.js";
32
+ import { S as vo } from "./chunks/Select-Df4333VV.js";
33
+ import { S as ho } from "./chunks/Select-BjD5iQvX.js";
34
34
  import { S as yo } from "./chunks/Skeleton-DqIHQLQl.js";
35
35
  import { S as No } from "./chunks/Spinner-BORNnHph.js";
36
- import { b as Qo, C as Zo, R as jo, T as qo, c as zo, a as Jo } from "./chunks/Table-CgBjwlIi.js";
36
+ import { b as Qo, C as Zo, R as jo, T as qo, c as zo, a as Jo } from "./chunks/Table-t3rVzb31.js";
37
37
  import { a as Oo, c as Uo, b as Vo, T as Wo } from "./chunks/TabList-D2XV5ixe.js";
38
38
  import { T as Yo, a as _o } from "./chunks/Tag-DxBoeE_n.js";
39
39
  import { T as oa } from "./chunks/Text-TWzJxnto.js";
40
- import { I as ra, b as ea, a as ta, T as sa } from "./chunks/TextArea-CRvbqqVZ.js";
40
+ import { I as ra, b as ea, a as ta, T as sa } from "./chunks/TextArea-B2BePnZz.js";
41
41
  import { G as xa, b as ma, T as fa, a as ia, t as na } from "./chunks/Toast-DTwUGSJ8.js";
42
42
  import { T as Ta, a as la } from "./chunks/ToggleButtonGroup-CXKTrLbb.js";
43
43
  import { T as ba, a as ga } from "./chunks/Tooltip-m032jGgF.js";
@@ -1,3 +1,2 @@
1
1
  import { SidebarLinkProps } from '../Layout';
2
- import * as React from 'react';
3
- export declare const SidebarLink: React.FC<SidebarLinkProps>;
2
+ export declare const SidebarLink: ({ title, href, icon: IconComponent, active, hasBadge, }: SidebarLinkProps) => import("react/jsx-runtime").JSX.Element;
package/layout/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as e, L as s, N as b, S as d, a as i } from "../chunks/Layout-ClW2Lbvq.js";
1
+ import { H as e, L as s, N as b, S as d, a as i } from "../chunks/Layout-DX3HUm5b.js";
2
2
  export {
3
3
  e as Header,
4
4
  s as Layout,
@@ -1,5 +1,5 @@
1
- import { FocusableElement, RefObject } from '@react-types/shared';
2
- import { default as React, ReactNode } from 'react';
1
+ import { FocusableElement } from '@react-types/shared';
2
+ import { default as React, ReactNode, RefObject } from 'react';
3
3
  import { MultiSelectState } from './types';
4
4
  import { ListBoxOption } from '../list-box';
5
5
  export interface AriaHiddenMultiSelectProps {
@@ -1,11 +1,11 @@
1
+ import { RefObject } from 'react';
1
2
  import { MultiSelectState, SelectProps } from './types';
2
3
  import { ListBoxOption } from '../list-box';
3
- import * as React from 'react';
4
4
  interface MultiSelectValueTagProps extends SelectProps {
5
5
  state: MultiSelectState<ListBoxOption>;
6
6
  parentWidth: number;
7
7
  onClear: () => void;
8
- triggerRef: React.MutableRefObject<HTMLButtonElement | null>;
8
+ triggerRef: RefObject<HTMLButtonElement | null>;
9
9
  }
10
- export declare const MultiSelectValueTag: React.FC<MultiSelectValueTagProps>;
10
+ export declare const MultiSelectValueTag: ({ state: { selectedItems: items }, isDisabled, parentWidth, onClear, triggerRef, isClearable, }: MultiSelectValueTagProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -1,8 +1,6 @@
1
- import { SelectProps } from './types';
1
+ import { SelectContainerProps } from './types';
2
2
  import * as React from 'react';
3
3
  /**
4
4
  * @deprecated since v15.2.0 Kept for backwards compatibility, but will be removed in a future version. Use `Select` from `@midas-ds/components` instead.
5
5
  */
6
- export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "children" | "items"> & {
7
- options: import('..').ListBoxOption[];
8
- } & React.RefAttributes<HTMLButtonElement>>;
6
+ export declare const Select: React.ForwardRefExoticComponent<Omit<SelectContainerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -1,4 +1,4 @@
1
- import { S as c } from "../chunks/Select-nL9iJMlf.js";
1
+ import { S as c } from "../chunks/Select-BjD5iQvX.js";
2
2
  export {
3
3
  c as LegacySelect
4
4
  };
@@ -3,7 +3,7 @@ import { FormValidationState } from '@react-stately/form';
3
3
  import { OverlayTriggerProps } from '@react-types/overlays';
4
4
  import { ListState } from '@react-stately/list';
5
5
  import { AsyncLoadable, CollectionBase, FocusableProps, InputBase, LabelableProps, MultipleSelection, TextInputBase, Validation, Key, Node, CollectionChildren } from '@react-types/shared';
6
- import { HTMLAttributes } from 'react';
6
+ import { HTMLAttributes, Ref } from 'react';
7
7
  import { AriaListBoxOptions } from 'react-aria';
8
8
  import { AriaButtonProps } from '@react-types/button';
9
9
  import { AriaSelectProps } from '@react-types/select';
@@ -176,4 +176,5 @@ export interface SelectProps extends MultiSelectStateProps<ListBoxOption> {
176
176
  export type SelectContainerProps = Omit<SelectProps, 'children' | 'items'> & {
177
177
  /** Item objects in the collection. */
178
178
  options: ListBoxOption[];
179
+ ref?: Ref<HTMLButtonElement>;
179
180
  };
@@ -2,4 +2,4 @@ import { RefObject } from 'react';
2
2
  import { MultiSelectDOMProps, MultiSelectProps, MultiSelectState } from './types';
3
3
  import { ListBoxOption } from '../list-box';
4
4
  import { SelectionMode } from '../select';
5
- export declare function useMultiSelect<T extends ListBoxOption, M extends SelectionMode>(props: MultiSelectProps<T, M>, state: MultiSelectState<T>, ref: RefObject<HTMLElement>): MultiSelectDOMProps<T>;
5
+ export declare function useMultiSelect<T extends ListBoxOption, M extends SelectionMode>(props: MultiSelectProps<T, M>, state: MultiSelectState<T>, ref: RefObject<HTMLElement | null>): MultiSelectDOMProps<T>;
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "description": "Midas Components",
15
15
  "homepage": "https://designsystem.migrationsverket.se/",
16
16
  "license": "CC0-1.0",
17
- "version": "16.2.4",
17
+ "version": "16.2.5",
18
18
  "module": "./index.js",
19
19
  "type": "module",
20
20
  "main": "./index.js",
package/radio/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { R as r, a as R } from "../chunks/Radio-Dro99zCs.js";
1
+ import { R as r, a as R } from "../chunks/Radio-CSFYbin8.js";
2
2
  export {
3
3
  r as Radio,
4
4
  R as RadioGroup
@@ -1,4 +1,4 @@
1
- import { S as a } from "../chunks/SearchField-BfpeANM6.js";
1
+ import { S as a } from "../chunks/SearchField-mBHZ9pFg.js";
2
2
  export {
3
3
  a as SearchField
4
4
  };
package/select/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as r } from "../chunks/Select-D-LtFSZX.js";
1
+ import { S as r } from "../chunks/Select-Df4333VV.js";
2
2
  export {
3
3
  r as Select
4
4
  };
package/table/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as l, C as s, R as o, T as b, c as T, a as r } from "../chunks/Table-CgBjwlIi.js";
1
+ import { b as l, C as s, R as o, T as b, c as T, a as r } from "../chunks/Table-t3rVzb31.js";
2
2
  export {
3
3
  l as Cell,
4
4
  s as Column,
@@ -1,9 +1,10 @@
1
1
  import { InputProps as AriaInputProps } from 'react-aria-components';
2
- import * as React from 'react';
2
+ import { Ref } from 'react';
3
3
  export interface InputProps extends AriaInputProps {
4
4
  /** If the component should use local props and ref instead of a parent context
5
5
  * @default false
6
6
  */
7
7
  skipContext?: boolean;
8
+ ref?: Ref<HTMLInputElement>;
8
9
  }
9
- export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
10
+ export declare const Input: ({ ref: localRef, skipContext, ...localProps }: InputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
1
  import { InputProps } from './Input';
2
- import * as React from 'react';
3
- export declare const PasswordField: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
2
+ export declare const PasswordField: ({ ref, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
+ import { Ref } from 'react';
1
2
  import { TextFieldBaseProps } from './TextFieldBase';
2
3
  import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
3
4
  import { Complement } from '../utils/types';
4
- import * as React from 'react';
5
- export type TextAreaProps = Omit<TextFieldBaseProps, 'type' | 'pattern'> & Complement<TextFieldBaseProps, AriaTextAreaProps>;
6
- export declare const TextArea: React.ForwardRefExoticComponent<Omit<TextFieldBaseProps, "type" | "pattern"> & Complement<TextFieldBaseProps, AriaTextAreaProps> & React.RefAttributes<HTMLTextAreaElement>>;
5
+ export interface TextAreaProps extends Omit<TextFieldBaseProps, 'type' | 'pattern'>, Complement<TextFieldBaseProps, AriaTextAreaProps> {
6
+ ref?: Ref<HTMLTextAreaElement>;
7
+ }
8
+ export declare const TextArea: ({ className, form, rows, wrap, ref, ...rest }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
+ import { Ref } from 'react';
1
2
  import { TextFieldBaseProps } from './TextFieldBase';
2
3
  import { InputProps } from './Input';
3
4
  import { Complement } from '../utils/types';
4
- import * as React from 'react';
5
- export type TextFieldProps = TextFieldBaseProps & Complement<TextFieldBaseProps, InputProps>;
6
- export declare const TextField: React.ForwardRefExoticComponent<TextFieldBaseProps & Complement<TextFieldBaseProps, InputProps> & React.RefAttributes<HTMLInputElement>>;
5
+ export interface TextFieldProps extends TextFieldBaseProps, Complement<TextFieldBaseProps, InputProps> {
6
+ ref?: Ref<HTMLInputElement>;
7
+ }
8
+ export declare const TextField: ({ className, form, list, min, max, ref, type, ...rest }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
+ import { ReactNode } from 'react';
1
2
  import { TextFieldProps, ValidationResult } from 'react-aria-components';
2
3
  import { Size } from '../common/types';
3
4
  import { InfoPopoverProps } from '../label';
4
- import * as React from 'react';
5
5
  export interface TextFieldBaseProps extends Omit<TextFieldProps, 'className'> {
6
- children?: React.ReactNode;
6
+ children?: ReactNode;
7
7
  /** Specify label displayed above the TextField*/
8
8
  label?: string;
9
9
  /** Specify description displayed below the label */
@@ -23,4 +23,4 @@ export interface TextFieldBaseProps extends Omit<TextFieldProps, 'className'> {
23
23
  size?: Size;
24
24
  popover?: InfoPopoverProps;
25
25
  }
26
- export declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<HTMLDivElement>>;
26
+ export declare const TextFieldBase: (props: TextFieldBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { I as s, b as t, a as x, T } from "../chunks/TextArea-CRvbqqVZ.js";
1
+ import { I as s, b as t, a as x, T } from "../chunks/TextArea-B2BePnZz.js";
2
2
  export {
3
3
  s as Input,
4
4
  t as TextArea,
@@ -1,21 +0,0 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { useContextProps as d, InputContext as h } from "react-aria-components";
4
- import '../assets/CharacterCounter.css';const m = "_characterCounter_1f0mh_1", u = {
5
- characterCounter: m
6
- }, f = i.forwardRef((t, a) => {
7
- [t] = d(t, a, h);
8
- const { maxLength: e, value: n, isLonely: c } = t, { length: r } = n?.toString() ?? "", o = e !== void 0;
9
- return /* @__PURE__ */ s(
10
- "span",
11
- {
12
- className: u.characterCounter,
13
- "data-exceeded": o && r > e || void 0,
14
- "data-lonely": c || void 0,
15
- children: o ? `${r} / ${e}` : r
16
- }
17
- );
18
- });
19
- export {
20
- f as C
21
- };
@@ -1,122 +0,0 @@
1
- import { jsxs as v, jsx as t } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import f from "react";
4
- import { mergeProps as u, VisuallyHidden as k, useCheckboxGroupItem as C, useCheckbox as R, useHover as _, usePress as I, useFocusRing as P } from "react-aria";
5
- import { useContextProps as g, CheckboxContext as G, useSlottedContext as y, FormContext as z } from "react-aria-components";
6
- import { a as h } from "./clsx-AexbMWKp.js";
7
- import { variables as m } from "@midas-ds/theme";
8
- import { c as w } from "./createLucideIcon-D4r5Phnh.js";
9
- import { C as B } from "./check-BxlvVsvD.js";
10
- import { useToggleState as F } from "@react-stately/toggle";
11
- import '../assets/Checkbox.css';const L = [["path", { d: "M5 12h14", key: "1ays0h" }]], N = w("minus", L), S = f.createContext(null), D = "_checkboxInner_tzrii_1", H = "_checkbox_tzrii_1", O = "_checkboxGroup_tzrii_143", j = "_checkboxList_tzrii_154", x = {
12
- checkboxInner: D,
13
- checkbox: H,
14
- checkboxGroup: O,
15
- checkboxList: j
16
- }, b = c.forwardRef((e, o) => {
17
- const { hoverProps: i, isHovered: s } = e.hoverResult, { pressProps: n, isPressed: a } = e.pressResult, { isFocused: r, isFocusVisible: d, focusProps: l } = e.focusRingAria;
18
- return /* @__PURE__ */ v(
19
- "label",
20
- {
21
- ref: o,
22
- ...u(i, n, e.labelProps),
23
- slot: e.slot || void 0,
24
- className: h(x.checkbox, e.className),
25
- "data-hovered": s || void 0,
26
- "data-selected": e.isSelected || void 0,
27
- "data-indeterminate": e.isIndeterminate || void 0,
28
- "data-pressed": a || void 0,
29
- "data-disabled": e.isDisabled || void 0,
30
- "data-readonly": e.isReadOnly || void 0,
31
- "data-invalid": e.isInvalid || void 0,
32
- "data-focused": r || void 0,
33
- "data-focus-visible": d || void 0,
34
- "data-required": e.isRequired || void 0,
35
- children: [
36
- /* @__PURE__ */ t("div", { className: h(x.checkboxInner), children: e.isIndeterminate ? /* @__PURE__ */ t(
37
- N,
38
- {
39
- size: 14,
40
- color: m.iconOnColor
41
- }
42
- ) : /* @__PURE__ */ t(
43
- B,
44
- {
45
- size: 14,
46
- color: m.iconOnColor
47
- }
48
- ) }),
49
- /* @__PURE__ */ t(k, { children: /* @__PURE__ */ t(
50
- "input",
51
- {
52
- ...u(e.inputProps, l),
53
- ref: e.inputRef
54
- }
55
- ) }),
56
- e.children
57
- ]
58
- }
59
- );
60
- }), q = c.forwardRef((e, o) => {
61
- const i = C(
62
- {
63
- ...e,
64
- value: e.value || ""
65
- },
66
- e.state,
67
- e.inputRef
68
- );
69
- return /* @__PURE__ */ t(
70
- b,
71
- {
72
- ...e,
73
- ...i,
74
- ref: o
75
- }
76
- );
77
- }), A = c.forwardRef((e, o) => {
78
- const i = R(e, F(e), e.inputRef);
79
- return /* @__PURE__ */ t(
80
- b,
81
- {
82
- ...e,
83
- ...i,
84
- ref: o
85
- }
86
- );
87
- }), X = c.forwardRef(
88
- (e, o) => {
89
- [e, o] = g(e, o, G);
90
- const i = y(z), s = e.validationBehavior ?? i?.validationBehavior ?? "native", n = c.useContext(S), a = c.useRef(null), r = _(e), d = I({
91
- ref: o,
92
- isDisabled: e.isDisabled
93
- }), l = P();
94
- return n ? /* @__PURE__ */ t(
95
- q,
96
- {
97
- ...e,
98
- state: n,
99
- inputRef: a,
100
- hoverResult: r,
101
- pressResult: d,
102
- focusRingAria: l,
103
- validationBehavior: s
104
- }
105
- ) : /* @__PURE__ */ t(
106
- A,
107
- {
108
- ...e,
109
- inputRef: a,
110
- hoverResult: r,
111
- pressResult: d,
112
- focusRingAria: l,
113
- validationBehavior: s
114
- }
115
- );
116
- }
117
- );
118
- export {
119
- X as C,
120
- S as a,
121
- x as s
122
- };
@@ -1,23 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { FieldErrorContext as c, FieldError as f } from "react-aria-components";
4
- import { c as a } from "./clsx-AexbMWKp.js";
5
- import { T as d } from "./Text-TWzJxnto.js";
6
- import '../assets/FieldError.css';const m = "_fieldError_u3cks_1", E = {
7
- fieldError: m
8
- }, _ = s.forwardRef(
9
- (r, n) => {
10
- const { children: o, isInvalid: l } = r, t = a(E.fieldError, r.className), e = s.useContext(c);
11
- return !e && l && typeof o != "function" ? /* @__PURE__ */ i(d, { className: t, children: o }) : e?.isInvalid ? /* @__PURE__ */ i(
12
- f,
13
- {
14
- ...r,
15
- ref: n,
16
- className: t
17
- }
18
- ) : null;
19
- }
20
- );
21
- export {
22
- _ as F
23
- };