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