@iress-oss/ids-components 6.0.0-alpha.19 → 6.0.0-alpha.20

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.
@@ -1,5 +1,5 @@
1
- import { jsx as a, jsxs as V } from "react/jsx-runtime";
2
- import { forwardRef as U, useRef as b, useState as Y, useImperativeHandle as $, useEffect as z } from "react";
1
+ import { jsx as s, jsxs as b } from "react/jsx-runtime";
2
+ import { forwardRef as U, useRef as M, useState as Y, useImperativeHandle as $, useEffect as z } from "react";
3
3
  import { GlobalCSSClass as h } from "../../enums.js";
4
4
  import { getFormControlValueAsString as J } from "../../helpers/form/getFormControlValueAsString.js";
5
5
  import { InputBase as K } from "./InputBase/InputBase.js";
@@ -15,127 +15,127 @@ import { s as _ } from "../../is-valid-prop-DweT-eOL.js";
15
15
  import { useNoDefaultValueInForms as ee } from "../../patterns/Form/hooks/useNoDefaultValueInForms.js";
16
16
  import "../../Button-BTkololu.js";
17
17
  import { IressCloseButton as te } from "../Button/CloseButton/CloseButton.js";
18
- const oe = ({ rows: t, ...c }, M) => {
18
+ const re = ({ rows: t, ...c }, P) => {
19
19
  const {
20
20
  loading: d = !1,
21
- clearable: P = !1,
21
+ clearable: D = !1,
22
22
  defaultValue: g,
23
- onClear: D,
24
- width: E,
23
+ onClear: E,
24
+ width: R,
25
25
  prepend: v,
26
26
  append: p,
27
- onChange: R,
27
+ onChange: B,
28
28
  className: I,
29
- readOnly: B,
29
+ readOnly: G,
30
30
  formatter: m,
31
- type: G,
32
- inline: T,
31
+ type: T,
32
+ inline: j,
33
33
  alignRight: C,
34
- ...o
34
+ ...r
35
35
  } = c;
36
- let n = t !== void 0 ? c.autoGrow : void 0;
37
- n === !0 && (n = 5), ee({
36
+ let o = t !== void 0 ? c.autoGrow : void 0;
37
+ o === !0 && (o = 5), ee({
38
38
  component: "IressInput",
39
39
  defaultValue: g
40
40
  });
41
- const s = b(null), f = b(null), { value: i, setValue: y } = Q({
41
+ const a = M(null), f = M(null), { value: i, setValue: y } = Q({
42
42
  component: "IressInput",
43
43
  defaultValue: g,
44
44
  value: c.value
45
- }), x = J(i), [w, F] = Y(!1), [j, O] = _(o), H = m && !w ? m(i) : x;
46
- let N = m && !w ? { type: "text" } : { type: G };
47
- if (t !== void 0 && (N = void 0), $(
48
- M,
45
+ }), x = J(i), [w, F] = Y(!1), [H, O] = _(r), N = m && !w ? m(i) : x;
46
+ let S = m && !w ? { type: "text" } : { type: T };
47
+ if (t !== void 0 && (S = void 0), $(
48
+ P,
49
49
  () => ({
50
- ...s.current,
50
+ ...a.current,
51
51
  extras: {
52
52
  additionalOnChangeProps: ["onClear"]
53
53
  }
54
54
  })
55
55
  ), z(() => {
56
- if (t && n && s.current) {
57
- const e = s.current.input;
56
+ if (t && o && a.current) {
57
+ const e = a.current.input;
58
58
  if (!e) return;
59
59
  e.style.height = "auto";
60
- const S = parseFloat(getComputedStyle(e).lineHeight) * 1.075 * n, A = Math.min(e.scrollHeight, S);
61
- e.style.height = `${A}px`, e.style.overflowY = e.scrollHeight > S ? "auto" : "hidden";
60
+ const V = parseFloat(getComputedStyle(e).lineHeight) * 1.075 * o, A = Math.min(e.scrollHeight, V);
61
+ e.style.height = `${A}px`, e.style.overflowY = e.scrollHeight > V ? "auto" : "hidden";
62
62
  }
63
- }, [i, t, n]), B)
64
- return /* @__PURE__ */ a(
63
+ }, [i, t, o]), G)
64
+ return /* @__PURE__ */ s(
65
65
  W,
66
66
  {
67
- ...o,
67
+ ...r,
68
68
  defaultValue: void 0,
69
69
  value: i,
70
70
  alignRight: C,
71
71
  append: p,
72
72
  className: I,
73
- children: H
73
+ children: N
74
74
  }
75
75
  );
76
76
  const k = (e) => {
77
- y(""), s.current?.focus();
78
- const r = new Event("change", {
77
+ y(""), a.current?.focus();
78
+ const n = new Event("change", {
79
79
  bubbles: !0
80
80
  });
81
- Object.defineProperty(r, "target", {
81
+ Object.defineProperty(n, "target", {
82
82
  writable: !1,
83
83
  value: { value: "", ...e.target }
84
- }), D?.(r);
84
+ }), E?.(n);
85
85
  }, q = (e) => {
86
- const r = e.target.value;
87
- y(r), R?.(e, r);
86
+ const n = e.target.value;
87
+ y(n), B?.(e, n);
88
88
  }, l = X({
89
89
  alignRight: C,
90
- autoGrow: !!n,
91
- inline: T,
90
+ autoGrow: !!o,
91
+ inline: j,
92
92
  isTextarea: t !== void 0,
93
- width: E
93
+ stretched: !!H.stretch,
94
+ width: R
94
95
  });
95
- return /* @__PURE__ */ V(
96
+ return /* @__PURE__ */ b(
96
97
  Z.div,
97
98
  {
98
99
  className: u(
99
- // classes.root,
100
100
  h.FormElement,
101
101
  h.Input,
102
102
  I,
103
103
  l.wrapper,
104
104
  h.FormElementInner
105
105
  ),
106
- "data-testid": o["data-testid"],
107
- ...j,
106
+ "data-testid": r["data-testid"],
107
+ ...H,
108
108
  children: [
109
- v && /* @__PURE__ */ a("div", { className: u(l.addon), children: v }),
110
- /* @__PURE__ */ a(
109
+ v && /* @__PURE__ */ s("div", { className: u(l.addon), children: v }),
110
+ /* @__PURE__ */ s(
111
111
  K,
112
112
  {
113
113
  ...O,
114
- ...N,
114
+ ...S,
115
115
  className: l.formControl,
116
- value: H,
116
+ value: N,
117
117
  onChange: q,
118
118
  onFocus: (e) => {
119
- F(!0), o?.onFocus?.(e), f.current ? f.current = null : queueMicrotask(() => e.target.select());
119
+ F(!0), r?.onFocus?.(e), f.current ? f.current = null : queueMicrotask(() => e.target.select());
120
120
  },
121
121
  onMouseDown: (e) => {
122
- o?.onMouseDown?.(e), f.current = !0;
122
+ r?.onMouseDown?.(e), f.current = !0;
123
123
  },
124
124
  onBlur: (e) => {
125
- F(!1), o?.onBlur?.(e);
125
+ F(!1), r?.onBlur?.(e);
126
126
  },
127
127
  rows: t,
128
- ref: s
128
+ ref: a
129
129
  }
130
130
  ),
131
- /* @__PURE__ */ V("div", { className: u(l.internal), children: [
132
- d && /* @__PURE__ */ a(
131
+ /* @__PURE__ */ b("div", { className: u(l.internal), children: [
132
+ d && /* @__PURE__ */ s(
133
133
  L,
134
134
  {
135
135
  screenreaderText: d === !0 ? "loading" : d
136
136
  }
137
137
  ),
138
- x && P && /* @__PURE__ */ a(
138
+ x && D && /* @__PURE__ */ s(
139
139
  te,
140
140
  {
141
141
  onClick: k,
@@ -144,12 +144,12 @@ const oe = ({ rows: t, ...c }, M) => {
144
144
  }
145
145
  )
146
146
  ] }),
147
- p && /* @__PURE__ */ a("div", { className: u(l.addon), children: p })
147
+ p && /* @__PURE__ */ s("div", { className: u(l.addon), children: p })
148
148
  ]
149
149
  }
150
150
  );
151
- }, ne = U(oe);
152
- ne.displayName = "IressInput";
151
+ }, oe = U(re);
152
+ oe.displayName = "IressInput";
153
153
  export {
154
- ne as IressInput
154
+ oe as IressInput
155
155
  };
@@ -129,4 +129,11 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
129
129
  };
130
130
  };
131
131
  };
132
+ stretched: {
133
+ true: {
134
+ formControl: {
135
+ height: "[100%]";
136
+ };
137
+ };
138
+ };
132
139
  }>;
@@ -4,7 +4,7 @@ const o = r({
4
4
  base: {
5
5
  wrapper: {
6
6
  // Performance: CSS containment limits style recalculation scope
7
- contain: "layout style paint",
7
+ contain: "style paint",
8
8
  display: "flex",
9
9
  alignItems: "stretch",
10
10
  borderRadius: "radius.system.form",
@@ -212,6 +212,13 @@ const o = r({
212
212
  width: "[100%]"
213
213
  }
214
214
  }
215
+ },
216
+ stretched: {
217
+ true: {
218
+ formControl: {
219
+ height: "[100%]"
220
+ }
221
+ }
215
222
  }
216
223
  },
217
224
  defaultVariants: {}
@@ -10,7 +10,7 @@ const a = t({
10
10
  },
11
11
  content: {
12
12
  // Performance: CSS containment (no paint due to floating nature)
13
- contain: "layout style",
13
+ contain: "style",
14
14
  bg: "colour.neutral.10",
15
15
  border: "divider",
16
16
  borderRadius: "radius.system.form",
@@ -4,7 +4,7 @@ const i = t({
4
4
  base: {
5
5
  root: {
6
6
  // Performance: CSS containment (no paint due to fixed positioning)
7
- contain: "layout style",
7
+ contain: "style",
8
8
  textStyle: "typography.body.md",
9
9
  position: "fixed",
10
10
  insetBlockStart: "spacing.0",
@@ -4304,6 +4304,10 @@ const z = `@layer reset, base, tokens, recipes, utilities;
4304
4304
  align-items: stretch;
4305
4305
  }
4306
4306
 
4307
+ .contain_style_paint {
4308
+ contain: style paint;
4309
+ }
4310
+
4307
4311
  .bg-c_colour\\.neutral\\.10 {
4308
4312
  background-color: var(--colors-colour\\.neutral\\.10);
4309
4313
  }
@@ -4451,6 +4455,10 @@ const z = `@layer reset, base, tokens, recipes, utilities;
4451
4455
  stroke-opacity: 0.5;
4452
4456
  }
4453
4457
 
4458
+ .contain_style {
4459
+ contain: style;
4460
+ }
4461
+
4454
4462
  .ap_none {
4455
4463
  appearance: none;
4456
4464
  -webkit-appearance: none;