@acronis-platform/ui-react 0.28.0 → 0.31.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.
package/README.md CHANGED
@@ -29,7 +29,24 @@ export function Example() {
29
29
  }
30
30
  ```
31
31
 
32
- Toggle dark mode by adding the `dark` class to an ancestor element.
32
+ `@acronis-platform/ui-react/styles` loads the `acronis` token base. To switch
33
+ theme at runtime:
34
+
35
+ ```css
36
+ /* base brand */
37
+ @import '@acronis-platform/ui-react/styles';
38
+
39
+ /* optional: layer another brand override on top */
40
+ @import '@acronis-platform/tokens-pd/css/deep-sky.css';
41
+ ```
42
+
43
+ ```html
44
+ <!-- light/dark mode -->
45
+ <html data-theme="dark"></html>
46
+ ```
47
+
48
+ Light/dark is driven by `light-dark()` + `color-scheme`; `dark:` utilities are
49
+ wired to `[data-theme='dark']`.
33
50
 
34
51
  ## Fonts
35
52
 
@@ -0,0 +1,57 @@
1
+ import { jsxs as c, jsx as l } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { cn as f } from "../../../lib/utils.js";
4
+ import { Search as x } from "../search/search.js";
5
+ const v = o.forwardRef(
6
+ ({
7
+ className: s,
8
+ id: u,
9
+ label: a,
10
+ required: r,
11
+ disabled: e,
12
+ "aria-label": i,
13
+ ...p
14
+ }, d) => {
15
+ const h = o.useId(), t = u ?? h, n = a != null && a !== "", m = n ? { "aria-label": void 0 } : i != null ? { "aria-label": i } : {};
16
+ return /* @__PURE__ */ c("div", { className: "flex w-full min-w-[var(--ui-input-search-container-width-min)] flex-col gap-[var(--ui-input-search-container-gap)]", children: [
17
+ n && /* @__PURE__ */ c(
18
+ "label",
19
+ {
20
+ htmlFor: t,
21
+ className: f(
22
+ "flex gap-[var(--ui-input-search-container-label-gap)] text-sm leading-4",
23
+ e ? "text-[var(--ui-input-search-color-disabled)]" : "text-[var(--ui-input-search-color-idle)]"
24
+ ),
25
+ children: [
26
+ a,
27
+ r && /* @__PURE__ */ l(
28
+ "span",
29
+ {
30
+ "aria-hidden": "true",
31
+ className: "text-[var(--ui-input-search-required-color)]",
32
+ children: "*"
33
+ }
34
+ )
35
+ ]
36
+ }
37
+ ),
38
+ /* @__PURE__ */ l(
39
+ x,
40
+ {
41
+ ref: d,
42
+ id: t,
43
+ disabled: e,
44
+ "aria-required": r || void 0,
45
+ className: s,
46
+ ...m,
47
+ ...p
48
+ }
49
+ )
50
+ ] });
51
+ }
52
+ );
53
+ v.displayName = "InputSearch";
54
+ export {
55
+ v as InputSearch
56
+ };
57
+ //# sourceMappingURL=input-search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-search.js","sources":["../../../../src/components/ui/input-search/input-search.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { Search, type SearchProps } from '../search';\n\n// Mirrors the Figma \"InputSearch\" component: a full search field built around the\n// bare `Search` box (themed by the `--ui-input-search-*` tier). It adds the field\n// furniture — an optional `label` above the box (with an optional `required` `*`).\n// Every other prop (placeholder, value, onClear, disabled, …) passes straight\n// through to `Search`. Label colors come from `--ui-input-search-color-{idle,disabled}`\n// and the required marker from `--ui-input-search-required-color`, so brand overrides\n// are honored. When a visible label is present it names the field via `htmlFor`/`id`,\n// and `Search`'s built-in `aria-label=\"Search\"` is cleared so it doesn't shadow the\n// visible label.\nexport interface InputSearchProps extends SearchProps {\n /** Field label, rendered above the search box. */\n label?: React.ReactNode;\n /** Marks the field required — appends a `*` after the label. */\n required?: boolean;\n}\n\nconst InputSearch = React.forwardRef<HTMLInputElement, InputSearchProps>(\n (\n {\n className,\n id,\n label,\n required,\n disabled,\n 'aria-label': ariaLabel,\n ...props\n },\n ref\n ) => {\n const reactId = React.useId();\n const inputId = id ?? reactId;\n const hasLabel = label != null && label !== '';\n\n // A visible label names the field via `htmlFor`/`id`, so clear `Search`'s\n // default `aria-label`. With no label, forward the caller's `aria-label` (if\n // any) and otherwise let `Search`'s default stand.\n const ariaLabelProps = hasLabel\n ? { 'aria-label': undefined }\n : ariaLabel != null\n ? { 'aria-label': ariaLabel }\n : {};\n\n return (\n <div className=\"flex w-full min-w-[var(--ui-input-search-container-width-min)] flex-col gap-[var(--ui-input-search-container-gap)]\">\n {hasLabel && (\n <label\n htmlFor={inputId}\n className={cn(\n 'flex gap-[var(--ui-input-search-container-label-gap)] text-sm leading-4',\n disabled\n ? 'text-[var(--ui-input-search-color-disabled)]'\n : 'text-[var(--ui-input-search-color-idle)]'\n )}\n >\n {label}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-search-required-color)]\"\n >\n *\n </span>\n )}\n </label>\n )}\n <Search\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-required={required || undefined}\n className={className}\n {...ariaLabelProps}\n {...props}\n />\n </div>\n );\n }\n);\nInputSearch.displayName = 'InputSearch';\n\nexport { InputSearch };\n"],"names":["InputSearch","React","className","id","label","required","disabled","ariaLabel","props","ref","reactId","inputId","hasLabel","ariaLabelProps","jsxs","cn","jsx","Search"],"mappings":";;;;AAqBA,MAAMA,IAAcC,EAAM;AAAA,EACxB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAcC;AAAA,IACd,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUT,EAAM,MAAA,GAChBU,IAAUR,KAAMO,GAChBE,IAAWR,KAAS,QAAQA,MAAU,IAKtCS,IAAiBD,IACnB,EAAE,cAAc,OAAA,IAChBL,KAAa,OACX,EAAE,cAAcA,EAAA,IAChB,CAAA;AAEN,WACE,gBAAAO,EAAC,OAAA,EAAI,WAAU,sHACZ,UAAA;AAAA,MAAAF,KACC,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASH;AAAA,UACT,WAAWI;AAAA,YACT;AAAA,YACAT,IACI,iDACA;AAAA,UAAA;AAAA,UAGL,UAAA;AAAA,YAAAF;AAAA,YACAC,KACC,gBAAAW;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,eAAY;AAAA,gBACZ,WAAU;AAAA,gBACX,UAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAED;AAAA,QAAA;AAAA,MAAA;AAAA,MAIN,gBAAAA;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,KAAAR;AAAA,UACA,IAAIE;AAAA,UACJ,UAAAL;AAAA,UACA,iBAAeD,KAAY;AAAA,UAC3B,WAAAH;AAAA,UACC,GAAGW;AAAA,UACH,GAAGL;AAAA,QAAA;AAAA,MAAA;AAAA,IACN,GACF;AAAA,EAEJ;AACF;AACAR,EAAY,cAAc;"}
@@ -0,0 +1,257 @@
1
+ import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { Select as a } from "@base-ui/react/select";
4
+ import { ChevronDownIcon as v, MagnifierIcon as m, CheckIcon as p, InboxIcon as g, CircleWarningIcon as x } from "@acronis-platform/icons-react/stroke-mono";
5
+ import { cn as i } from "../../../lib/utils.js";
6
+ const u = l.createContext(!1);
7
+ function h(e) {
8
+ return /* @__PURE__ */ o(u.Provider, { value: !!e.multiple, children: /* @__PURE__ */ o(a.Root, { ...e }) });
9
+ }
10
+ h.displayName = "InputSelect";
11
+ const V = a.Group, f = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
12
+ "div",
13
+ {
14
+ ref: t,
15
+ className: i(
16
+ "flex w-full min-w-[var(--ui-input-select-global-container-width-min)] flex-col gap-[var(--ui-input-select-global-container-gap)]",
17
+ e
18
+ ),
19
+ ...r
20
+ }
21
+ ));
22
+ f.displayName = "InputSelectField";
23
+ const w = l.forwardRef(({ className: e, children: r, required: t, ...n }, d) => /* @__PURE__ */ c(
24
+ a.Label,
25
+ {
26
+ ref: d,
27
+ className: i(
28
+ "flex gap-[var(--ui-input-select-global-container-label-gap)] text-sm leading-4 text-[var(--ui-input-select-global-label-color-idle)] data-[disabled]:text-[var(--ui-input-select-global-label-color-disabled)]",
29
+ e
30
+ ),
31
+ ...n,
32
+ children: [
33
+ r,
34
+ t && /* @__PURE__ */ o(
35
+ "span",
36
+ {
37
+ "aria-hidden": "true",
38
+ className: "text-[var(--ui-input-select-global-required-color)]",
39
+ children: "*"
40
+ }
41
+ )
42
+ ]
43
+ }
44
+ ));
45
+ w.displayName = "InputSelectLabel";
46
+ const I = l.forwardRef(({ className: e, children: r, ...t }, n) => /* @__PURE__ */ c(
47
+ a.Trigger,
48
+ {
49
+ ref: n,
50
+ className: i(
51
+ "group flex h-[var(--ui-input-select-global-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-select-global-box-gap)] rounded-[var(--ui-input-select-global-box-border-radius)] border bg-[var(--ui-input-select-global-box-color-idle)] border-[var(--ui-input-select-normal-box-border-color-idle)] px-[var(--ui-input-select-global-box-padding-x)] text-sm leading-6 text-[var(--ui-input-select-global-value-color-idle)] outline-none transition-colors",
52
+ "not-data-[disabled]:hover:bg-[var(--ui-input-select-global-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-select-normal-box-border-color-hover)]",
53
+ "focus-visible:border-[var(--ui-input-select-normal-box-border-color-hover)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]",
54
+ "data-[popup-open]:border-[var(--ui-input-select-normal-box-border-color-hover)] data-[popup-open]:ring-[3px] data-[popup-open]:ring-[var(--ui-focus-primary)]",
55
+ "data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-select-normal-box-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-select-global-box-color-disabled)] data-[disabled]:text-[var(--ui-input-select-global-value-color-disabled)]",
56
+ // Error treatment (driven by `aria-invalid`).
57
+ "aria-invalid:border-[var(--ui-input-select-error-box-border-color-idle)] not-data-[disabled]:aria-invalid:hover:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:ring-[var(--ui-focus-error)] aria-invalid:data-[popup-open]:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:data-[popup-open]:ring-[var(--ui-focus-error)]",
58
+ e
59
+ ),
60
+ ...t,
61
+ children: [
62
+ r,
63
+ /* @__PURE__ */ o(a.Icon, { className: "flex shrink-0 items-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] group-data-[disabled]:text-[var(--ui-input-select-normal-icon-expand-color-disabled)]", children: /* @__PURE__ */ o(
64
+ v,
65
+ {
66
+ size: 16,
67
+ className: "transition-transform group-data-[popup-open]:rotate-180"
68
+ }
69
+ ) })
70
+ ]
71
+ }
72
+ ));
73
+ I.displayName = "InputSelectTrigger";
74
+ const N = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
75
+ a.Value,
76
+ {
77
+ ref: t,
78
+ className: i(
79
+ "min-w-0 flex-1 truncate text-left text-[var(--ui-input-select-global-value-color-idle)] data-[placeholder]:text-[var(--ui-input-select-global-placeholder-color-idle)]",
80
+ "group-data-[disabled]:!text-[var(--ui-input-select-global-value-color-disabled)] group-data-[disabled]:data-[placeholder]:!text-[var(--ui-input-select-global-placeholder-color-disabled)]",
81
+ e
82
+ ),
83
+ ...r
84
+ }
85
+ ));
86
+ N.displayName = "InputSelectValue";
87
+ const S = l.forwardRef(
88
+ ({ className: e, children: r, sideOffset: t = 4, align: n = "start", side: d = "bottom", ...s }, b) => /* @__PURE__ */ o(a.Portal, { children: /* @__PURE__ */ o(
89
+ a.Positioner,
90
+ {
91
+ sideOffset: t,
92
+ align: n,
93
+ side: d,
94
+ alignItemWithTrigger: !1,
95
+ className: "z-50 outline-none",
96
+ children: /* @__PURE__ */ o(
97
+ a.Popup,
98
+ {
99
+ ref: b,
100
+ className: i(
101
+ "max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto rounded-[var(--ui-input-select-dropdown-container-border-radius)] border border-[var(--ui-input-select-dropdown-container-border-color)] bg-[var(--ui-input-select-dropdown-container-color)] py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm shadow-md outline-none",
102
+ e
103
+ ),
104
+ ...s,
105
+ children: r
106
+ }
107
+ )
108
+ }
109
+ ) })
110
+ );
111
+ S.displayName = "InputSelectContent";
112
+ const y = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ c("div", { className: "flex items-center gap-[var(--ui-input-select-dropdown-dropdown-search-gap)] px-[var(--ui-input-select-dropdown-dropdown-search-padding-x)] py-[var(--ui-input-select-dropdown-dropdown-search-padding-y)]", children: [
113
+ /* @__PURE__ */ o(
114
+ m,
115
+ {
116
+ size: 16,
117
+ className: "shrink-0 text-[var(--ui-input-select-dropdown-dropdown-search-label-color-placeholder)]"
118
+ }
119
+ ),
120
+ /* @__PURE__ */ o(
121
+ "input",
122
+ {
123
+ ref: t,
124
+ type: "search",
125
+ className: i(
126
+ "min-w-0 flex-1 border-0 bg-transparent p-0 text-sm leading-6 text-[var(--ui-input-select-dropdown-dropdown-search-label-color-value)] outline-none placeholder:text-[var(--ui-input-select-dropdown-dropdown-search-label-color-placeholder)] [&::-webkit-search-cancel-button]:appearance-none",
127
+ e
128
+ ),
129
+ ...r
130
+ }
131
+ )
132
+ ] }));
133
+ y.displayName = "InputSelectSearch";
134
+ const k = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
135
+ a.Group,
136
+ {
137
+ ref: t,
138
+ className: i(
139
+ "flex flex-col border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] py-[var(--ui-input-select-dropdown-section-container-padding-y)] first:border-t-0",
140
+ e
141
+ ),
142
+ ...r
143
+ }
144
+ ));
145
+ k.displayName = "InputSelectSection";
146
+ const R = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
147
+ a.GroupLabel,
148
+ {
149
+ ref: t,
150
+ className: i(
151
+ "px-[var(--ui-input-select-dropdown-section-container-header-padding-x)] py-[var(--ui-input-select-dropdown-section-container-header-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-input-select-dropdown-section-label-group-color)]",
152
+ e
153
+ ),
154
+ ...r
155
+ }
156
+ ));
157
+ R.displayName = "InputSelectSectionLabel";
158
+ const z = l.forwardRef(({ className: e, children: r, ...t }, n) => {
159
+ const d = l.useContext(u);
160
+ return /* @__PURE__ */ c(
161
+ a.Item,
162
+ {
163
+ ref: n,
164
+ className: i(
165
+ "group/item relative flex cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none",
166
+ "bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]",
167
+ // Single-select rows tint when selected; multiple-select rows keep the
168
+ // unselected background (the leading checkbox carries the state).
169
+ !d && "data-[selected]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-idle)] data-[selected]:data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-hover)]",
170
+ "data-[disabled]:pointer-events-none data-[disabled]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-disabled)]",
171
+ e
172
+ ),
173
+ ...t,
174
+ children: [
175
+ d && /* @__PURE__ */ o(
176
+ "span",
177
+ {
178
+ "aria-hidden": "true",
179
+ className: "flex size-[var(--ui-checkbox-global-box-size)] shrink-0 items-center justify-center rounded-[var(--ui-checkbox-global-box-border-radius)] border-[length:var(--ui-checkbox-global-box-border-width)] border-[var(--ui-checkbox-unchecked-box-border-color-idle)] bg-[var(--ui-checkbox-unchecked-box-color-idle)] text-transparent group-data-[selected]/item:border-[var(--ui-checkbox-checked-box-border-color-idle)] group-data-[selected]/item:bg-[var(--ui-checkbox-checked-box-color-idle)] group-data-[selected]/item:text-[var(--ui-checkbox-checked-icon-color-idle)]",
180
+ children: /* @__PURE__ */ o(p, { size: 16 })
181
+ }
182
+ ),
183
+ /* @__PURE__ */ o(a.ItemText, { className: "min-w-0 flex-1 truncate", children: r }),
184
+ !d && /* @__PURE__ */ o(a.ItemIndicator, { className: "flex shrink-0 items-center text-[var(--ui-input-select-normal-icon-expand-color-hover)]", children: /* @__PURE__ */ o(p, { size: 16 }) })
185
+ ]
186
+ }
187
+ );
188
+ });
189
+ z.displayName = "InputSelectItem";
190
+ const C = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
191
+ "p",
192
+ {
193
+ ref: t,
194
+ className: i(
195
+ "text-xs leading-4 text-[var(--ui-input-select-normal-description-color-idle)]",
196
+ e
197
+ ),
198
+ ...r
199
+ }
200
+ ));
201
+ C.displayName = "InputSelectDescription";
202
+ const L = l.forwardRef(({ className: e, ...r }, t) => /* @__PURE__ */ o(
203
+ "p",
204
+ {
205
+ ref: t,
206
+ className: i(
207
+ "text-xs leading-4 text-[var(--ui-input-select-error-error-msg-color)]",
208
+ e
209
+ ),
210
+ ...r
211
+ }
212
+ ));
213
+ L.displayName = "InputSelectError";
214
+ const T = l.forwardRef(
215
+ ({ className: e, variant: r, children: t, action: n, ...d }, s) => /* @__PURE__ */ c(
216
+ "div",
217
+ {
218
+ ref: s,
219
+ className: i(
220
+ "flex min-h-[128px] flex-col items-center justify-center gap-[var(--ui-input-select-dropdown-container-status-gap)] border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] px-[var(--ui-input-select-dropdown-container-status-padding-x)] py-[var(--ui-input-select-dropdown-container-status-padding-y)] text-center text-sm leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)]",
221
+ e
222
+ ),
223
+ ...d,
224
+ children: [
225
+ r === "loading" && /* @__PURE__ */ o(
226
+ "span",
227
+ {
228
+ "aria-hidden": "true",
229
+ className: "size-6 animate-spin rounded-full border-2 border-current border-t-transparent opacity-70"
230
+ }
231
+ ),
232
+ r === "empty" && /* @__PURE__ */ o(g, { size: 24, className: "opacity-70" }),
233
+ r === "error" && /* @__PURE__ */ o(x, { size: 24, className: "opacity-70" }),
234
+ t,
235
+ r === "error" && n
236
+ ]
237
+ }
238
+ )
239
+ );
240
+ T.displayName = "InputSelectStatus";
241
+ export {
242
+ h as InputSelect,
243
+ S as InputSelectContent,
244
+ C as InputSelectDescription,
245
+ L as InputSelectError,
246
+ f as InputSelectField,
247
+ V as InputSelectGroup,
248
+ z as InputSelectItem,
249
+ w as InputSelectLabel,
250
+ y as InputSelectSearch,
251
+ k as InputSelectSection,
252
+ R as InputSelectSectionLabel,
253
+ T as InputSelectStatus,
254
+ I as InputSelectTrigger,
255
+ N as InputSelectValue
256
+ };
257
+ //# sourceMappingURL=input-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-select.js","sources":["../../../../src/components/ui/input-select/input-select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Select as SelectPrimitive } from '@base-ui/react/select';\nimport {\n CheckIcon,\n ChevronDownIcon,\n CircleWarningIcon,\n InboxIcon,\n MagnifierIcon,\n} from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// The next-gen select, themed by the dedicated `--ui-input-select-*` tier (global /\n// normal / error / dropdown). It composes Base UI `Select` and adds the field\n// furniture (label, required, description, error) and the dropdown machinery\n// (in-dropdown search, sections/groups, single + multiple items, loading/empty/error\n// status). The trigger box wires each state to its own token — idle / hover / open\n// (`data-popup-open`) + focus ring / disabled — and switches to the error border +\n// `--ui-focus-error` ring when `aria-invalid` is set. Selection mode (single vs\n// multiple) flows from the `multiple` prop on the root via `InputSelectModeContext`:\n// single items toggle the row background and show a trailing check; multiple items\n// keep the row background and show a leading checkbox.\n\nconst InputSelectModeContext = React.createContext(false);\n\nfunction InputSelect<Value, Multiple extends boolean | undefined = false>(\n props: SelectPrimitive.Root.Props<Value, Multiple>\n) {\n return (\n <InputSelectModeContext.Provider value={Boolean(props.multiple)}>\n <SelectPrimitive.Root {...props} />\n </InputSelectModeContext.Provider>\n );\n}\nInputSelect.displayName = 'InputSelect';\n\nconst InputSelectGroup = SelectPrimitive.Group;\n\n/** Vertical field stack: label, trigger, description/error. */\nconst InputSelectField = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex w-full min-w-[var(--ui-input-select-global-container-width-min)] flex-col gap-[var(--ui-input-select-global-container-gap)]',\n className\n )}\n {...props}\n />\n));\nInputSelectField.displayName = 'InputSelectField';\n\nconst InputSelectLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label> & {\n /** Appends a required `*` after the label text. */\n required?: boolean;\n }\n>(({ className, children, required, ...props }, ref) => (\n <SelectPrimitive.Label\n ref={ref}\n className={cn(\n 'flex gap-[var(--ui-input-select-global-container-label-gap)] text-sm leading-4 text-[var(--ui-input-select-global-label-color-idle)] data-[disabled]:text-[var(--ui-input-select-global-label-color-disabled)]',\n className\n )}\n {...props}\n >\n {children}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-select-global-required-color)]\"\n >\n *\n </span>\n )}\n </SelectPrimitive.Label>\n));\nInputSelectLabel.displayName = 'InputSelectLabel';\n\nconst InputSelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex h-[var(--ui-input-select-global-box-height)] w-full min-w-0 items-center gap-[var(--ui-input-select-global-box-gap)] rounded-[var(--ui-input-select-global-box-border-radius)] border bg-[var(--ui-input-select-global-box-color-idle)] border-[var(--ui-input-select-normal-box-border-color-idle)] px-[var(--ui-input-select-global-box-padding-x)] text-sm leading-6 text-[var(--ui-input-select-global-value-color-idle)] outline-none transition-colors',\n 'not-data-[disabled]:hover:bg-[var(--ui-input-select-global-box-color-hover)] not-data-[disabled]:hover:border-[var(--ui-input-select-normal-box-border-color-hover)]',\n 'focus-visible:border-[var(--ui-input-select-normal-box-border-color-hover)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n 'data-[popup-open]:border-[var(--ui-input-select-normal-box-border-color-hover)] data-[popup-open]:ring-[3px] data-[popup-open]:ring-[var(--ui-focus-primary)]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-input-select-normal-box-border-color-disabled)] data-[disabled]:bg-[var(--ui-input-select-global-box-color-disabled)] data-[disabled]:text-[var(--ui-input-select-global-value-color-disabled)]',\n // Error treatment (driven by `aria-invalid`).\n 'aria-invalid:border-[var(--ui-input-select-error-box-border-color-idle)] not-data-[disabled]:aria-invalid:hover:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:focus-visible:ring-[var(--ui-focus-error)] aria-invalid:data-[popup-open]:border-[var(--ui-input-select-error-box-border-color-hover)] aria-invalid:data-[popup-open]:ring-[var(--ui-focus-error)]',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon className=\"flex shrink-0 items-center text-[var(--ui-input-select-normal-icon-expand-color-idle)] group-data-[disabled]:text-[var(--ui-input-select-normal-icon-expand-color-disabled)]\">\n <ChevronDownIcon\n size={16}\n className=\"transition-transform group-data-[popup-open]:rotate-180\"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nInputSelectTrigger.displayName = 'InputSelectTrigger';\n\nconst InputSelectValue = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Value>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Value\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 truncate text-left text-[var(--ui-input-select-global-value-color-idle)] data-[placeholder]:text-[var(--ui-input-select-global-placeholder-color-idle)]',\n 'group-data-[disabled]:!text-[var(--ui-input-select-global-value-color-disabled)] group-data-[disabled]:data-[placeholder]:!text-[var(--ui-input-select-global-placeholder-color-disabled)]',\n className\n )}\n {...props}\n />\n));\nInputSelectValue.displayName = 'InputSelectValue';\n\nconst InputSelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Popup>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Popup> & {\n sideOffset?: number;\n align?: SelectPrimitive.Positioner.Props['align'];\n side?: SelectPrimitive.Positioner.Props['side'];\n }\n>(\n (\n { className, children, sideOffset = 4, align = 'start', side = 'bottom', ...props },\n ref\n ) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n side={side}\n alignItemWithTrigger={false}\n className=\"z-50 outline-none\"\n >\n <SelectPrimitive.Popup\n ref={ref}\n className={cn(\n 'max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto rounded-[var(--ui-input-select-dropdown-container-border-radius)] border border-[var(--ui-input-select-dropdown-container-border-color)] bg-[var(--ui-input-select-dropdown-container-color)] py-[var(--ui-input-select-dropdown-container-padding-y)] text-sm shadow-md outline-none',\n className\n )}\n {...props}\n >\n {children}\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n);\nInputSelectContent.displayName = 'InputSelectContent';\n\n/**\n * Presentational in-dropdown search row (magnifier + input). The consumer wires\n * `value`/`onChange` to filter the items it renders.\n */\nconst InputSelectSearch = React.forwardRef<\n HTMLInputElement,\n React.ComponentPropsWithoutRef<'input'>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center gap-[var(--ui-input-select-dropdown-dropdown-search-gap)] px-[var(--ui-input-select-dropdown-dropdown-search-padding-x)] py-[var(--ui-input-select-dropdown-dropdown-search-padding-y)]\">\n <MagnifierIcon\n size={16}\n className=\"shrink-0 text-[var(--ui-input-select-dropdown-dropdown-search-label-color-placeholder)]\"\n />\n <input\n ref={ref}\n type=\"search\"\n className={cn(\n 'min-w-0 flex-1 border-0 bg-transparent p-0 text-sm leading-6 text-[var(--ui-input-select-dropdown-dropdown-search-label-color-value)] outline-none placeholder:text-[var(--ui-input-select-dropdown-dropdown-search-label-color-placeholder)] [&::-webkit-search-cancel-button]:appearance-none',\n className\n )}\n {...props}\n />\n </div>\n));\nInputSelectSearch.displayName = 'InputSelectSearch';\n\n/** A section (group) of items with an optional header. Divided by a top border. */\nconst InputSelectSection = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Group\n ref={ref}\n className={cn(\n 'flex flex-col border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] py-[var(--ui-input-select-dropdown-section-container-padding-y)] first:border-t-0',\n className\n )}\n {...props}\n />\n));\nInputSelectSection.displayName = 'InputSelectSection';\n\nconst InputSelectSectionLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.GroupLabel>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.GroupLabel>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.GroupLabel\n ref={ref}\n className={cn(\n 'px-[var(--ui-input-select-dropdown-section-container-header-padding-x)] py-[var(--ui-input-select-dropdown-section-container-header-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-input-select-dropdown-section-label-group-color)]',\n className\n )}\n {...props}\n />\n));\nInputSelectSectionLabel.displayName = 'InputSelectSectionLabel';\n\nconst InputSelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => {\n const multiple = React.useContext(InputSelectModeContext);\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'group/item relative flex cursor-default items-center gap-[var(--ui-input-select-dropdown-item-global-container-gap)] px-[var(--ui-input-select-dropdown-item-global-container-padding-x)] py-[var(--ui-input-select-dropdown-item-global-container-padding-y)] leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)] outline-none select-none',\n 'bg-[var(--ui-input-select-dropdown-item-unselected-container-color-idle)] data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-hover)]',\n // Single-select rows tint when selected; multiple-select rows keep the\n // unselected background (the leading checkbox carries the state).\n !multiple &&\n 'data-[selected]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-idle)] data-[selected]:data-[highlighted]:bg-[var(--ui-input-select-dropdown-item-selected-container-color-hover)]',\n 'data-[disabled]:pointer-events-none data-[disabled]:bg-[var(--ui-input-select-dropdown-item-unselected-container-color-disabled)]',\n className\n )}\n {...props}\n >\n {multiple && (\n <span\n aria-hidden=\"true\"\n className=\"flex size-[var(--ui-checkbox-global-box-size)] shrink-0 items-center justify-center rounded-[var(--ui-checkbox-global-box-border-radius)] border-[length:var(--ui-checkbox-global-box-border-width)] border-[var(--ui-checkbox-unchecked-box-border-color-idle)] bg-[var(--ui-checkbox-unchecked-box-color-idle)] text-transparent group-data-[selected]/item:border-[var(--ui-checkbox-checked-box-border-color-idle)] group-data-[selected]/item:bg-[var(--ui-checkbox-checked-box-color-idle)] group-data-[selected]/item:text-[var(--ui-checkbox-checked-icon-color-idle)]\"\n >\n <CheckIcon size={16} />\n </span>\n )}\n <SelectPrimitive.ItemText className=\"min-w-0 flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n {!multiple && (\n <SelectPrimitive.ItemIndicator className=\"flex shrink-0 items-center text-[var(--ui-input-select-normal-icon-expand-color-hover)]\">\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n )}\n </SelectPrimitive.Item>\n );\n});\nInputSelectItem.displayName = 'InputSelectItem';\n\nconst InputSelectDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<'p'>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n 'text-xs leading-4 text-[var(--ui-input-select-normal-description-color-idle)]',\n className\n )}\n {...props}\n />\n));\nInputSelectDescription.displayName = 'InputSelectDescription';\n\nconst InputSelectError = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<'p'>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\n 'text-xs leading-4 text-[var(--ui-input-select-error-error-msg-color)]',\n className\n )}\n {...props}\n />\n));\nInputSelectError.displayName = 'InputSelectError';\n\nexport interface InputSelectStatusProps\n extends React.ComponentPropsWithoutRef<'div'> {\n /** Which status to show. Drives the leading icon. */\n variant: 'loading' | 'empty' | 'error';\n /** Optional trailing action (e.g. a \"Try again\" button) — shown for `error`. */\n action?: React.ReactNode;\n}\n\n/** Loading / empty / error status row shown instead of items inside the dropdown. */\nconst InputSelectStatus = React.forwardRef<HTMLDivElement, InputSelectStatusProps>(\n ({ className, variant, children, action, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex min-h-[128px] flex-col items-center justify-center gap-[var(--ui-input-select-dropdown-container-status-gap)] border-t border-[var(--ui-input-select-dropdown-section-container-border-color)] px-[var(--ui-input-select-dropdown-container-status-padding-x)] py-[var(--ui-input-select-dropdown-container-status-padding-y)] text-center text-sm leading-6 text-[var(--ui-input-select-dropdown-item-global-label-color)]',\n className\n )}\n {...props}\n >\n {variant === 'loading' && (\n <span\n aria-hidden=\"true\"\n className=\"size-6 animate-spin rounded-full border-2 border-current border-t-transparent opacity-70\"\n />\n )}\n {variant === 'empty' && <InboxIcon size={24} className=\"opacity-70\" />}\n {variant === 'error' && <CircleWarningIcon size={24} className=\"opacity-70\" />}\n {children}\n {variant === 'error' && action}\n </div>\n )\n);\nInputSelectStatus.displayName = 'InputSelectStatus';\n\nexport {\n InputSelect,\n InputSelectField,\n InputSelectLabel,\n InputSelectTrigger,\n InputSelectValue,\n InputSelectContent,\n InputSelectSearch,\n InputSelectGroup,\n InputSelectSection,\n InputSelectSectionLabel,\n InputSelectItem,\n InputSelectDescription,\n InputSelectError,\n InputSelectStatus,\n};\n"],"names":["InputSelectModeContext","React","InputSelect","props","jsx","SelectPrimitive","InputSelectGroup","InputSelectField","className","ref","cn","InputSelectLabel","children","required","jsxs","InputSelectTrigger","ChevronDownIcon","InputSelectValue","InputSelectContent","sideOffset","align","side","InputSelectSearch","MagnifierIcon","InputSelectSection","InputSelectSectionLabel","InputSelectItem","multiple","CheckIcon","InputSelectDescription","InputSelectError","InputSelectStatus","variant","action","InboxIcon","CircleWarningIcon"],"mappings":";;;;;AAuBA,MAAMA,IAAyBC,EAAM,cAAc,EAAK;AAExD,SAASC,EACPC,GACA;AACA,SACE,gBAAAC,EAACJ,EAAuB,UAAvB,EAAgC,OAAO,EAAQG,EAAM,UACpD,4BAACE,EAAgB,MAAhB,EAAsB,GAAGF,GAAO,GACnC;AAEJ;AACAD,EAAY,cAAc;AAE1B,MAAMI,IAAmBD,EAAgB,OAGnCE,IAAmBN,EAAM,WAG7B,CAAC,EAAE,WAAAO,GAAW,GAAGL,EAAA,GAASM,MAC1B,gBAAAL;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAK;AAAA,IACA,WAAWC;AAAA,MACT;AAAA,MACAF;AAAA,IAAA;AAAA,IAED,GAAGL;AAAA,EAAA;AACN,CACD;AACDI,EAAiB,cAAc;AAE/B,MAAMI,IAAmBV,EAAM,WAM7B,CAAC,EAAE,WAAAO,GAAW,UAAAI,GAAU,UAAAC,GAAU,GAAGV,KAASM,MAC9C,gBAAAK;AAAA,EAACT,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAI;AAAA,IACA,WAAWC;AAAA,MACT;AAAA,MACAF;AAAA,IAAA;AAAA,IAED,GAAGL;AAAA,IAEH,UAAA;AAAA,MAAAS;AAAA,MACAC,KACC,gBAAAT;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,eAAY;AAAA,UACZ,WAAU;AAAA,UACX,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAED;AAAA,EAAA;AAEJ,CACD;AACDO,EAAiB,cAAc;AAE/B,MAAMI,IAAqBd,EAAM,WAG/B,CAAC,EAAE,WAAAO,GAAW,UAAAI,GA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AApB,GAAU,QAAAqB,GAAQ,GAAG9B,EAAA,GAASM,MACnD,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,WAAWC;AAAA,QACT;AAAA,QACAF;AAAA,MAAA;AAAA,MAED,GAAGL;AAAA,MAEH,UAAA;AAAA,QAAA6B,MAAY,aACX,gBAAA5B;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,QAGb4B,MAAY,WAAW,gBAAA5B,EAAC8B,KAAU,MAAM,IAAI,WAAU,cAAa;AAAA,QACnEF,MAAY,WAAW,gBAAA5B,EAAC+B,KAAkB,MAAM,IAAI,WAAU,cAAa;AAAA,QAC3EvB;AAAA,QACAoB,MAAY,WAAWC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG9B;AACAF,EAAkB,cAAc;"}
@@ -1,21 +1,77 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { cn as t } from "../../../lib/utils.js";
4
- const l = o.forwardRef(
5
- ({ className: e, ...r }, a) => /* @__PURE__ */ i(
6
- "textarea",
7
- {
8
- ref: a,
9
- className: t(
10
- "min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px] enabled:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)] focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)] disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]",
11
- e
1
+ import { jsxs as x, jsx as l } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { cn as n } from "../../../lib/utils.js";
4
+ const y = c.forwardRef(
5
+ ({
6
+ className: v,
7
+ id: p,
8
+ label: e,
9
+ required: d,
10
+ description: b,
11
+ error: r,
12
+ disabled: a,
13
+ "aria-invalid": h,
14
+ ...m
15
+ }, g) => {
16
+ const f = c.useId(), i = p ?? f, u = `${i}-message`, t = r != null && r !== "", w = t || h, o = t ? r : b, s = o != null && o !== "";
17
+ return /* @__PURE__ */ x("div", { className: "flex w-full min-w-[var(--ui-input-text-area-container-width-min)] flex-col gap-[var(--ui-input-text-area-container-gap)]", children: [
18
+ e != null && e !== "" && /* @__PURE__ */ x(
19
+ "label",
20
+ {
21
+ htmlFor: i,
22
+ className: n(
23
+ "flex gap-[var(--ui-input-text-area-container-label-gap)] text-sm leading-4",
24
+ a ? "text-[var(--ui-input-text-area-label-color-disabled)]" : "text-[var(--ui-input-text-area-label-color-idle)]"
25
+ ),
26
+ children: [
27
+ e,
28
+ d && /* @__PURE__ */ l(
29
+ "span",
30
+ {
31
+ "aria-hidden": "true",
32
+ className: "text-[var(--ui-input-text-area-required-color)]",
33
+ children: "*"
34
+ }
35
+ )
36
+ ]
37
+ }
12
38
  ),
13
- ...r
14
- }
15
- )
39
+ /* @__PURE__ */ l(
40
+ "textarea",
41
+ {
42
+ ref: g,
43
+ id: i,
44
+ disabled: a,
45
+ "aria-invalid": w || void 0,
46
+ "aria-required": d || void 0,
47
+ "aria-describedby": s ? u : void 0,
48
+ className: n(
49
+ "min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px]",
50
+ "enabled:not-aria-[invalid=true]:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:not-aria-[invalid=true]:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)]",
51
+ "not-aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)]",
52
+ "aria-[invalid=true]:border-[var(--ui-input-text-area-error-msg-box-border-color-idle)] enabled:aria-[invalid=true]:hover:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)]",
53
+ "disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]",
54
+ v
55
+ ),
56
+ ...m
57
+ }
58
+ ),
59
+ s && /* @__PURE__ */ l(
60
+ "p",
61
+ {
62
+ id: u,
63
+ className: n(
64
+ "text-xs leading-4",
65
+ t ? "text-[var(--ui-input-text-area-error-msg-error-color)]" : a ? "text-[var(--ui-input-text-area-description-color-disabled)]" : "text-[var(--ui-input-text-area-description-color-idle)]"
66
+ ),
67
+ children: o
68
+ }
69
+ )
70
+ ] });
71
+ }
16
72
  );
17
- l.displayName = "InputTextArea";
73
+ y.displayName = "InputTextArea";
18
74
  export {
19
- l as InputTextArea
75
+ y as InputTextArea
20
76
  };
21
77
  //# sourceMappingURL=input-text-area.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-text-area.js","sources":["../../../../src/components/ui/input-text-area/input-text-area.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// A multiline text area, themed by the dedicated next-gen `--ui-input-text-area-*`\n// token tier from @acronis-platform/tokens-pd. The box fill (`box-color-*`) and the\n// border (`border-color-*`) are wired per state: idle / hover / focus (border\n// `border-color-focus` + a 3px `--ui-focus-primary` ring) / disabled. Value and\n// placeholder text use `value-color-*` / `placeholder-color-*`. Box geometry\n// (96px min-height, 4px radius, 12px padding-x, 8px padding-y) comes from\n// `--ui-input-text-area-box-*`; it grows with vertical resize. Unlike the\n// single-line Input tier, this tier has NO error-specific border/fill token so\n// the error state (driven by `aria-invalid`) keeps the idle/hover/focus border and\n// only swaps the focus ring to `--ui-focus-error`. Label, description, and required\n// marker are composed by the consumer (a Field component is future work).\nexport type InputTextAreaProps = React.ComponentPropsWithoutRef<'textarea'>;\n\nconst InputTextArea = React.forwardRef<HTMLTextAreaElement, InputTextAreaProps>(\n ({ className, ...props }, ref) => (\n <textarea\n ref={ref}\n className={cn(\n 'min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px] enabled:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)] focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)] disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]',\n className\n )}\n {...props}\n />\n )\n);\nInputTextArea.displayName = 'InputTextArea';\n\nexport { InputTextArea };\n"],"names":["InputTextArea","React","className","props","ref","jsx","cn"],"mappings":";;;AAiBA,MAAMA,IAAgBC,EAAM;AAAA,EAC1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV;AACAH,EAAc,cAAc;"}
1
+ {"version":3,"file":"input-text-area.js","sources":["../../../../src/components/ui/input-text-area/input-text-area.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"InputTextArea\" component: a full multiline text field built\n// around a `<textarea>` (themed by the dedicated `--ui-input-text-area-*` tier). It\n// adds the field furniture: an optional `label` (with an optional required `*`) and\n// an optional `description` or `error` message below. Passing `error` switches the\n// field to its error treatment — the box gets the red error border (via the\n// textarea's `aria-invalid` styling) and the red error message replaces the\n// description. The box fill / border are wired per state: idle / hover / focus\n// (`border-color-focus` + a 3px `--ui-focus-primary` ring) / disabled; the error\n// state (driven by `aria-invalid`) swaps the border to\n// `error-msg-box-border-color-{idle,hover}` and the focus ring to `--ui-focus-error`.\n// Box geometry (96px min-height, 4px radius, 12px padding-x, 8px padding-y) comes\n// from `--ui-input-text-area-box-*`; it grows with vertical resize. `ref` and\n// `className` target the underlying `<textarea>`, so the bare usage\n// (`<InputTextArea placeholder=… />`, no label) renders just the box.\nexport interface InputTextAreaProps\n extends Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> {\n /** Field label, rendered above the textarea. */\n label?: React.ReactNode;\n /** Marks the field required — appends a `*` after the label. */\n required?: boolean;\n /** Helper text below the textarea. Hidden while `error` is set. */\n description?: React.ReactNode;\n /**\n * Error message below the textarea. Its presence switches the field to the error\n * treatment (red box border + red message).\n */\n error?: React.ReactNode;\n}\n\nconst InputTextArea = React.forwardRef<HTMLTextAreaElement, InputTextAreaProps>(\n (\n {\n className,\n id,\n label,\n required,\n description,\n error,\n disabled,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref\n ) => {\n const reactId = React.useId();\n const inputId = id ?? reactId;\n const messageId = `${inputId}-message`;\n\n const hasError = error != null && error !== '';\n const invalid = hasError || ariaInvalid;\n const message = hasError ? error : description;\n const hasMessage = message != null && message !== '';\n\n return (\n <div className=\"flex w-full min-w-[var(--ui-input-text-area-container-width-min)] flex-col gap-[var(--ui-input-text-area-container-gap)]\">\n {label != null && label !== '' && (\n <label\n htmlFor={inputId}\n className={cn(\n 'flex gap-[var(--ui-input-text-area-container-label-gap)] text-sm leading-4',\n disabled\n ? 'text-[var(--ui-input-text-area-label-color-disabled)]'\n : 'text-[var(--ui-input-text-area-label-color-idle)]'\n )}\n >\n {label}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-text-area-required-color)]\"\n >\n *\n </span>\n )}\n </label>\n )}\n\n <textarea\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={hasMessage ? messageId : undefined}\n className={cn(\n 'min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px]',\n 'enabled:not-aria-[invalid=true]:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:not-aria-[invalid=true]:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)]',\n 'not-aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)]',\n 'aria-[invalid=true]:border-[var(--ui-input-text-area-error-msg-box-border-color-idle)] enabled:aria-[invalid=true]:hover:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)]',\n 'disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]',\n className\n )}\n {...props}\n />\n\n {hasMessage && (\n <p\n id={messageId}\n className={cn(\n 'text-xs leading-4',\n hasError\n ? 'text-[var(--ui-input-text-area-error-msg-error-color)]'\n : disabled\n ? 'text-[var(--ui-input-text-area-description-color-disabled)]'\n : 'text-[var(--ui-input-text-area-description-color-idle)]'\n )}\n >\n {message}\n </p>\n )}\n </div>\n );\n }\n);\nInputTextArea.displayName = 'InputTextArea';\n\nexport { InputTextArea };\n"],"names":["InputTextArea","React","className","id","label","required","description","error","disabled","ariaInvalid","props","ref","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