pathum-ds-library 0.0.8

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/dist/index.js ADDED
@@ -0,0 +1,485 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Button: () => Button,
24
+ Input: () => Input,
25
+ cx: () => cx
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/components/Button.tsx
30
+ var import_class_variance_authority = require("class-variance-authority");
31
+ var import_react_aria_components = require("react-aria-components");
32
+
33
+ // src/utils/cx.ts
34
+ var import_clsx = require("clsx");
35
+ var import_tailwind_merge = require("tailwind-merge");
36
+ function cx(...inputs) {
37
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
38
+ }
39
+
40
+ // src/components/Button.tsx
41
+ var import_jsx_runtime = require("react/jsx-runtime");
42
+ var buttonIconDotUnsupportedHierarchies = [
43
+ "link-gray",
44
+ "link-color"
45
+ ];
46
+ var layoutStyles = {
47
+ labeled: {
48
+ sm: cx(
49
+ "min-h-[36px] gap-[6px] rounded-(--radius-md) px-[14px] py-2 font-semibold",
50
+ "[font-size:var(--font-size-text-sm)] [font-family:var(--font-family)] [font-weight:var(--font-weight-semibold)] leading-[var(--line-height-text-sm)]"
51
+ ),
52
+ md: cx(
53
+ "min-h-[40px] gap-[6px] rounded-(--radius-md) px-4 py-[10px] font-semibold",
54
+ "[font-size:var(--font-size-text-sm)] [font-family:var(--font-family)] [font-weight:var(--font-weight-semibold)] leading-[var(--line-height-text-sm)]"
55
+ ),
56
+ lg: cx(
57
+ "min-h-[44px] gap-2 rounded-(--radius-lg) px-[18px] py-[10px] font-semibold",
58
+ "[font-size:var(--font-size-text-md)] [font-family:var(--font-family)] [font-weight:var(--font-weight-semibold)] leading-[var(--line-height-text-md)]"
59
+ ),
60
+ xl: cx(
61
+ "min-h-[48px] gap-2 rounded-(--radius-xl) px-5 py-3 font-semibold",
62
+ "[font-size:var(--font-size-text-md)] [font-family:var(--font-family)] [font-weight:var(--font-weight-semibold)] leading-[var(--line-height-text-md)]"
63
+ ),
64
+ "2xl": cx(
65
+ "min-h-[60px] gap-[10px] rounded-(--radius-xl) px-[28px] py-4 font-semibold",
66
+ "[font-size:var(--font-size-text-lg)] [font-family:var(--font-family)] [font-weight:var(--font-weight-semibold)] leading-[var(--line-height-text-lg)]"
67
+ )
68
+ },
69
+ iconOnly: {
70
+ sm: "size-8 min-h-8 min-w-8 rounded-(--radius-md) p-2",
71
+ md: "size-10 min-h-10 min-w-10 rounded-(--radius-md) p-[10px]",
72
+ lg: "size-10 min-h-10 min-w-10 rounded-(--radius-lg) p-[10px]",
73
+ xl: "min-h-[44px] min-w-[44px] rounded-(--radius-xl) p-3",
74
+ "2xl": "min-h-14 min-w-14 rounded-(--radius-xl) p-4"
75
+ }
76
+ };
77
+ var iconSizer = (sz, labeled) => labeled ? sz === "sm" ? "[&_svg]:size-4 shrink-0" : sz === "2xl" ? "[&_svg]:size-6 shrink-0" : "[&_svg]:size-5 shrink-0" : sz === "sm" ? "flex size-full items-center justify-center [&_svg]:size-4" : sz === "2xl" ? "flex size-full items-center justify-center [&_svg]:size-6" : "flex size-full items-center justify-center [&_svg]:size-5";
78
+ var focusRing = "outline-none focus-visible:shadow-[0px_0px_0px_4px_color-mix(in_srgb,var(--color-fg-brand-secondary)_24%,transparent)]";
79
+ var hierarchySurface = {
80
+ primary: cx(
81
+ /** Figma primary fill uses `utility-brand-600`; default state has no stroke (avoid 1px same-color border). */
82
+ "border-0",
83
+ "bg-(--color-component-utility-brand-utility-brand-600)",
84
+ "text-(--color-text-primary_on-brand)",
85
+ "data-hovered:bg-(--color-component-utility-brand-utility-brand-700)",
86
+ "data-hovered:text-(--color-text-primary_on-brand)",
87
+ /** `utility-brand-*` shifts in `.dark`; keep exported button tokens there. */
88
+ "dark:bg-(--color-component-components-buttons-primary-button-primary-bg)",
89
+ "dark:data-hovered:bg-(--color-component-components-buttons-primary-button-primary-bg_hover)",
90
+ "dark:text-(--color-component-components-buttons-primary-button-primary-fg)",
91
+ "dark:data-hovered:text-(--color-component-components-buttons-primary-button-primary-fg_hover)",
92
+ "data-disabled:border-0 data-disabled:bg-(--color-bg-disabled)",
93
+ "data-disabled:text-(--color-text-disabled)",
94
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-text-primary_on-brand)",
95
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-text-primary_on-brand)",
96
+ "dark:[&_[data-slot=lead-icon]_svg]:text-(--color-component-components-buttons-primary-button-primary-fg)",
97
+ "dark:[&_[data-slot=trail-icon]_svg]:text-(--color-component-components-buttons-primary-button-primary-fg)",
98
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
99
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
100
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
101
+ ),
102
+ "secondary-gray": cx(
103
+ "border border-(--color-component-components-buttons-secondary-button-secondary-border)",
104
+ "bg-transparent text-(--color-component-components-buttons-secondary-button-secondary-fg)",
105
+ "data-hovered:bg-(--color-component-components-buttons-secondary-button-secondary-bg_hover)",
106
+ "data-hovered:text-(--color-component-components-buttons-secondary-button-secondary-fg_hover)",
107
+ "data-hovered:border-(--color-component-components-buttons-secondary-button-secondary-border_hover)",
108
+ "data-disabled:border-(--color-border-disabled)",
109
+ "data-disabled:bg-transparent data-disabled:text-(--color-text-disabled)",
110
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-component-components-buttons-secondary-button-secondary-fg)",
111
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-component-components-buttons-secondary-button-secondary-fg)",
112
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
113
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
114
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
115
+ ),
116
+ "secondary-color": cx(
117
+ "border border-(--color-component-components-buttons-secondary-color-button-secondary-color-border)",
118
+ "bg-transparent text-(--color-component-components-buttons-secondary-color-button-secondary-color-fg)",
119
+ "data-hovered:bg-(--color-bg-brand-section_subtle)",
120
+ "data-hovered:border-(--color-component-components-buttons-secondary-color-button-secondary-color-border_hover)",
121
+ "data-hovered:text-(--color-component-components-buttons-secondary-color-button-secondary-color-fg_hover)",
122
+ "data-disabled:border-(--color-border-disabled)",
123
+ "data-disabled:bg-transparent data-disabled:text-(--color-text-disabled)",
124
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-component-components-buttons-secondary-color-button-secondary-color-fg)",
125
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-component-components-buttons-secondary-color-button-secondary-color-fg)",
126
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
127
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
128
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
129
+ ),
130
+ "tertiary-gray": cx(
131
+ "border border-transparent bg-transparent",
132
+ "text-(--color-component-components-buttons-tertiary-button-tertiary-fg)",
133
+ "data-hovered:bg-(--color-component-components-buttons-tertiary-button-tertiary-bg_hover)",
134
+ "data-hovered:text-(--color-component-components-buttons-tertiary-button-tertiary-fg_hover)",
135
+ "data-disabled:text-(--color-text-disabled)",
136
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-component-components-buttons-tertiary-button-tertiary-fg)",
137
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-component-components-buttons-tertiary-button-tertiary-fg)",
138
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
139
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
140
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
141
+ ),
142
+ "tertiary-color": cx(
143
+ "border border-transparent bg-transparent",
144
+ "text-(--color-component-components-buttons-tertiary-color-button-tertiary-color-fg)",
145
+ "data-hovered:bg-(--color-component-components-buttons-tertiary-color-button-tertiary-color-bg_hover)",
146
+ "data-hovered:text-(--color-component-components-buttons-tertiary-color-button-tertiary-color-fg_hover)",
147
+ "data-disabled:text-(--color-text-disabled)",
148
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-component-components-buttons-tertiary-color-button-tertiary-color-fg)",
149
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-component-components-buttons-tertiary-color-button-tertiary-color-fg)",
150
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
151
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
152
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
153
+ ),
154
+ "link-gray": cx(
155
+ "border border-transparent bg-transparent text-(--color-text-secondary)",
156
+ "data-hovered:bg-(--color-component-components-buttons-tertiary-button-tertiary-bg_hover)",
157
+ "data-hovered:text-(--color-text-secondary_hover)",
158
+ "data-disabled:text-(--color-text-disabled)",
159
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-text-secondary)",
160
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-text-secondary)",
161
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
162
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
163
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
164
+ ),
165
+ "link-color": cx(
166
+ "border border-transparent bg-transparent text-(--color-text-brand-tertiary)",
167
+ "data-hovered:bg-(--color-component-components-buttons-tertiary-color-button-tertiary-color-bg_hover)",
168
+ "data-hovered:text-(--color-component-components-buttons-tertiary-color-button-tertiary-color-fg_hover)",
169
+ "data-disabled:text-(--color-text-disabled)",
170
+ "[&_[data-slot=lead-icon]_svg]:text-(--color-text-brand-tertiary)",
171
+ "[&_[data-slot=trail-icon]_svg]:text-(--color-text-brand-tertiary)",
172
+ "data-disabled:[&_[data-slot=lead-icon]_svg]:text-(--color-fg-disabled)",
173
+ "data-disabled:[&_[data-slot=trail-icon]_svg]:text-(--color-fg-disabled)",
174
+ "data-disabled:[&_[data-slot=icon-only]_svg]:text-(--color-fg-disabled)"
175
+ )
176
+ };
177
+ var buttonVariants = (0, import_class_variance_authority.cva)(
178
+ cx(
179
+ "inline-flex shrink-0 items-center justify-center font-semibold transition-colors",
180
+ "disabled:pointer-events-none",
181
+ focusRing
182
+ ),
183
+ {
184
+ variants: {
185
+ hierarchy: {
186
+ primary: hierarchySurface.primary,
187
+ "secondary-gray": hierarchySurface["secondary-gray"],
188
+ "secondary-color": hierarchySurface["secondary-color"],
189
+ "tertiary-gray": hierarchySurface["tertiary-gray"],
190
+ "tertiary-color": hierarchySurface["tertiary-color"],
191
+ "link-gray": hierarchySurface["link-gray"],
192
+ "link-color": hierarchySurface["link-color"]
193
+ },
194
+ size: { sm: "", md: "", lg: "", xl: "", "2xl": "" },
195
+ layoutMode: { labeled: "", iconOnly: "" },
196
+ dotLeading: { false: "", true: "" }
197
+ },
198
+ compoundVariants: [
199
+ { layoutMode: "labeled", size: "sm", dotLeading: false, class: layoutStyles.labeled.sm },
200
+ { layoutMode: "labeled", size: "md", dotLeading: false, class: layoutStyles.labeled.md },
201
+ { layoutMode: "labeled", size: "lg", dotLeading: false, class: layoutStyles.labeled.lg },
202
+ { layoutMode: "labeled", size: "xl", dotLeading: false, class: layoutStyles.labeled.xl },
203
+ {
204
+ layoutMode: "labeled",
205
+ size: "2xl",
206
+ dotLeading: false,
207
+ class: layoutStyles.labeled["2xl"]
208
+ },
209
+ { layoutMode: "labeled", size: "sm", dotLeading: true, class: layoutStyles.labeled.sm },
210
+ { layoutMode: "labeled", size: "md", dotLeading: true, class: layoutStyles.labeled.md },
211
+ { layoutMode: "labeled", size: "lg", dotLeading: true, class: layoutStyles.labeled.lg },
212
+ { layoutMode: "labeled", size: "xl", dotLeading: true, class: layoutStyles.labeled.xl },
213
+ {
214
+ layoutMode: "labeled",
215
+ size: "2xl",
216
+ dotLeading: true,
217
+ class: layoutStyles.labeled["2xl"]
218
+ },
219
+ { layoutMode: "iconOnly", size: "sm", class: layoutStyles.iconOnly.sm },
220
+ { layoutMode: "iconOnly", size: "md", class: layoutStyles.iconOnly.md },
221
+ { layoutMode: "iconOnly", size: "lg", class: layoutStyles.iconOnly.lg },
222
+ { layoutMode: "iconOnly", size: "xl", class: layoutStyles.iconOnly.xl },
223
+ { layoutMode: "iconOnly", size: "2xl", class: layoutStyles.iconOnly["2xl"] }
224
+ ],
225
+ defaultVariants: {
226
+ hierarchy: "primary",
227
+ size: "sm",
228
+ layoutMode: "labeled",
229
+ dotLeading: false
230
+ }
231
+ }
232
+ );
233
+ function Button({
234
+ hierarchy = "primary",
235
+ size = "sm",
236
+ className,
237
+ children,
238
+ iconLeft,
239
+ iconRight,
240
+ iconOnly,
241
+ dotLeading,
242
+ isDisabled,
243
+ ...rest
244
+ }) {
245
+ const resolvedSize = size ?? "sm";
246
+ const layoutMode = iconOnly != null ? "iconOnly" : "labeled";
247
+ const effectiveDotLeading = layoutMode === "labeled" && dotLeading === true && hierarchy != null && !buttonIconDotUnsupportedHierarchies.includes(hierarchy);
248
+ const labeled = layoutMode === "labeled";
249
+ const leadSlot = labeled && !effectiveDotLeading && iconLeft != null ? iconLeft : null;
250
+ const trailSlot = labeled && iconRight != null ? iconRight : null;
251
+ const content = labeled ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
252
+ leadSlot ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: iconSizer(resolvedSize, true), "data-slot": "lead-icon", "aria-hidden": true, children: leadSlot }) : null,
253
+ effectiveDotLeading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "size-2 shrink-0 rounded-full bg-current", "aria-hidden": true }) : null,
254
+ children != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "min-w-0", children }) : null,
255
+ trailSlot ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: iconSizer(resolvedSize, true), "data-slot": "trail-icon", "aria-hidden": true, children: trailSlot }) : null
256
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: iconSizer(resolvedSize, false), "data-slot": "icon-only", children: iconOnly });
257
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
258
+ import_react_aria_components.Button,
259
+ {
260
+ ...rest,
261
+ isDisabled,
262
+ className: cx(
263
+ buttonVariants({
264
+ hierarchy,
265
+ size: resolvedSize,
266
+ layoutMode,
267
+ dotLeading: effectiveDotLeading
268
+ }),
269
+ className
270
+ ),
271
+ children: content
272
+ }
273
+ );
274
+ }
275
+
276
+ // src/components/Input.tsx
277
+ var import_react_aria_components2 = require("react-aria-components");
278
+ var import_jsx_runtime2 = require("react/jsx-runtime");
279
+ function FieldDividerDropdown() {
280
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "h-[20px] w-px shrink-0 bg-[#d4dbe5]", "aria-hidden": true });
281
+ }
282
+ function FieldDividerButton() {
283
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "h-[20px] w-px shrink-0 bg-(--color-border-secondary)", "aria-hidden": true });
284
+ }
285
+ function HelpIconChrome({
286
+ children,
287
+ isDisabled
288
+ }) {
289
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
290
+ "span",
291
+ {
292
+ className: cx(
293
+ "flex size-4 shrink-0 items-center justify-center rounded-[8px] border-[1.5px] border-solid",
294
+ isDisabled ? "border-(--color-fg-disabled)" : "border-(--color-fg-tertiary)"
295
+ ),
296
+ children
297
+ }
298
+ );
299
+ }
300
+ function PaymentChipFrame({ children }) {
301
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex h-[20px] w-[32px] shrink-0 items-center justify-center overflow-hidden rounded-[4px] border border-solid border-[#99abbf]", children });
302
+ }
303
+ function shellPadding(composition) {
304
+ switch (composition) {
305
+ case "leading-text":
306
+ case "leading-dropdown":
307
+ return "pl-0 pr-[14px]";
308
+ case "trailing-dropdown":
309
+ return "pl-[14px] pr-0";
310
+ default:
311
+ return "px-[14px]";
312
+ }
313
+ }
314
+ function Input({
315
+ size = "md",
316
+ composition = "default",
317
+ destructive = false,
318
+ label,
319
+ hint,
320
+ errorMessage,
321
+ leadingIcon,
322
+ leadingDropdown,
323
+ trailingDropdown,
324
+ leadingText,
325
+ paymentGraphic,
326
+ tags,
327
+ trailingButton,
328
+ helpIcon,
329
+ placeholder,
330
+ inputClassName,
331
+ className,
332
+ isDisabled,
333
+ ...rest
334
+ }) {
335
+ const invalid = destructive === true;
336
+ const shellVertical = size === "sm" ? "min-h-[40px] py-[8px]" : "min-h-[44px] py-[10px]";
337
+ const shellBorderBg = cx(
338
+ "overflow-hidden rounded-(--radius-md) border border-solid transition-[border-color,box-shadow]",
339
+ shellVertical,
340
+ shellPadding(composition),
341
+ // Inner row gap — Figma 8px between leading pieces / text / trailing pieces.
342
+ "flex items-center gap-2",
343
+ isDisabled ? "border-[color:var(--color-border-disabled)] bg-[color:var(--color-bg-disabled)]" : invalid ? "border-[color:var(--color-border-error)] bg-[color:var(--color-bg-primary)]" : cx(
344
+ "border-[color:var(--color-border-secondary)] bg-[color:var(--color-bg-primary)]",
345
+ "focus-within:border-(--color-border-brand)",
346
+ // Ring: 2px gap via field surface, 4px outer glow — brand purple (Figma).
347
+ "focus-within:shadow-[0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-fg-brand-secondary)]"
348
+ )
349
+ );
350
+ const inputTypography = cx(
351
+ "min-h-0 min-w-0 flex-1 bg-transparent font-normal outline-none ring-0 ring-transparent",
352
+ "focus:outline-none focus-visible:outline-none",
353
+ "[font-family:var(--font-family)] [font-size:var(--font-size-text-md)] [font-weight:var(--font-weight-regular)] leading-[var(--line-height-text-md)]",
354
+ "text-[color:var(--color-text-primary)] placeholder:text-[color:var(--color-text-placeholder)]",
355
+ "disabled:text-[color:var(--color-text-disabled)] disabled:placeholder:text-[color:var(--color-text-disabled)]",
356
+ inputClassName
357
+ );
358
+ const racInput = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_aria_components2.Input, { placeholder, className: inputTypography, disabled: isDisabled });
359
+ let control;
360
+ switch (composition) {
361
+ case "leading-dropdown":
362
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
363
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex shrink-0 items-center gap-2 pl-[14px] pr-[8px]", children: leadingDropdown }),
364
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldDividerDropdown, {}),
365
+ racInput,
366
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null
367
+ ] });
368
+ break;
369
+ case "trailing-dropdown":
370
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
371
+ racInput,
372
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldDividerDropdown, {}),
373
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex shrink-0 items-center gap-2 pl-[8px] pr-[14px]", children: trailingDropdown }),
374
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null
375
+ ] });
376
+ break;
377
+ case "leading-text":
378
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
379
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex min-h-full shrink-0 items-stretch", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
380
+ "span",
381
+ {
382
+ className: cx(
383
+ "flex items-center bg-(--color-bg-secondary) pl-[14px] pr-[12px]",
384
+ "[font-family:var(--font-family)] [font-size:var(--font-size-text-md)] [font-weight:var(--font-weight-regular)] leading-[var(--line-height-text-md)]",
385
+ "text-(--color-text-primary)",
386
+ isDisabled && "text-(--color-text-disabled)"
387
+ ),
388
+ children: leadingText
389
+ }
390
+ ) }),
391
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldDividerDropdown, {}),
392
+ racInput,
393
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null
394
+ ] });
395
+ break;
396
+ case "payment-input":
397
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
398
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PaymentChipFrame, { children: paymentGraphic }),
399
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldDividerDropdown, {}),
400
+ racInput
401
+ ] });
402
+ break;
403
+ case "tags":
404
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
405
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-2 [&_[data-slot=input-tags]>input]:min-w-[120px]", children: [
406
+ tags,
407
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-slot": "input-tags", className: "min-w-0 flex-1", children: racInput })
408
+ ] }),
409
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null
410
+ ] });
411
+ break;
412
+ case "trailing-button":
413
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
414
+ racInput,
415
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null,
416
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FieldDividerButton, {}),
417
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "flex shrink-0 items-center gap-[6px]", children: trailingButton })
418
+ ] });
419
+ break;
420
+ case "icon-leading":
421
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
422
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "flex shrink-0 items-center [&_svg]:size-4", children: leadingIcon }),
423
+ racInput,
424
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null
425
+ ] });
426
+ break;
427
+ default:
428
+ control = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
429
+ racInput,
430
+ helpIcon != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(HelpIconChrome, { isDisabled, children: helpIcon }) : null
431
+ ] });
432
+ }
433
+ const hintRow = invalid && errorMessage != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
434
+ import_react_aria_components2.FieldError,
435
+ {
436
+ className: cx(
437
+ "[font-family:var(--font-family)] [font-size:var(--font-size-text-sm)] [font-weight:var(--font-weight-regular)] leading-[var(--line-height-text-sm)]",
438
+ "text-[color:var(--color-text-error-primary)]"
439
+ ),
440
+ children: errorMessage
441
+ }
442
+ ) : hint != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
443
+ import_react_aria_components2.Text,
444
+ {
445
+ slot: "description",
446
+ className: cx(
447
+ "[font-family:var(--font-family)] [font-size:var(--font-size-text-sm)] [font-weight:var(--font-weight-regular)] leading-[var(--line-height-text-sm)]",
448
+ "text-[color:var(--color-text-tertiary)]",
449
+ "group-data-[disabled]:text-[color:var(--color-text-disabled)]"
450
+ ),
451
+ children: hint
452
+ }
453
+ ) : null;
454
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
455
+ import_react_aria_components2.TextField,
456
+ {
457
+ ...rest,
458
+ isDisabled,
459
+ isInvalid: invalid,
460
+ validationBehavior: "aria",
461
+ className: cx("group flex flex-col gap-[6px]", className),
462
+ children: [
463
+ label != null ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
464
+ import_react_aria_components2.Label,
465
+ {
466
+ className: cx(
467
+ "[font-family:var(--font-family)] [font-size:var(--font-size-text-sm)] [font-weight:var(--font-weight-medium)] leading-[var(--line-height-text-sm)]",
468
+ "text-[color:var(--color-text-secondary)]",
469
+ "group-data-[disabled]:text-[color:var(--color-text-disabled)]"
470
+ ),
471
+ children: label
472
+ }
473
+ ) : null,
474
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: shellBorderBg, children: control }),
475
+ hintRow
476
+ ]
477
+ }
478
+ );
479
+ }
480
+ // Annotate the CommonJS export names for ESM import in node:
481
+ 0 && (module.exports = {
482
+ Button,
483
+ Input,
484
+ cx
485
+ });