@validationcloud/fractal-ui 1.27.0 → 1.27.1

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.
@@ -4,6 +4,7 @@ type TextInputProps = {
4
4
  disablePasswordManagers?: boolean;
5
5
  rightAccessory?: React.ReactNode;
6
6
  errorState?: boolean;
7
+ containerClassName?: string;
7
8
  } & React.InputHTMLAttributes<HTMLInputElement>;
8
- export declare const TextInput: ({ variant, disablePasswordManagers, rightAccessory, errorState, className, ...props }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const TextInput: ({ variant, disablePasswordManagers, rightAccessory, errorState, className, containerClassName, ...props }: TextInputProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -1,10 +1,11 @@
1
1
  import { StoryObj } from '@storybook/react-vite';
2
2
  declare const meta: {
3
- component: ({ variant, disablePasswordManagers, rightAccessory, errorState, className, ...props }: {
3
+ component: ({ variant, disablePasswordManagers, rightAccessory, errorState, className, containerClassName, ...props }: {
4
4
  variant?: "outlined" | "filled";
5
5
  disablePasswordManagers?: boolean;
6
6
  rightAccessory?: React.ReactNode;
7
7
  errorState?: boolean;
8
+ containerClassName?: string;
8
9
  } & import('react').InputHTMLAttributes<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
9
10
  args: {
10
11
  disabled: false;
@@ -22,3 +23,4 @@ export declare const ErrorState: Story;
22
23
  export declare const ErrorStateFilled: Story;
23
24
  export declare const Disabled: Story;
24
25
  export declare const DisabledFilled: Story;
26
+ export declare const WithContainerClassName: Story;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as i, jsxs as h, Fragment as b } from "react/jsx-runtime";
3
- import { Slot as C, DropdownMenu as c, ScrollArea as p, Tooltip as L } from "radix-ui";
4
- import { forwardRef as v } from "react";
3
+ import { Slot as F, DropdownMenu as v, ScrollArea as p, Tooltip as c } from "radix-ui";
4
+ import { forwardRef as u } from "react";
5
5
  import { extendTailwindMerge as w } from "tailwind-merge";
6
6
  const t = w({
7
7
  extend: {
@@ -46,9 +46,9 @@ const t = w({
46
46
  tag: "tg-tag px-[6px] py-[2px] rounded",
47
47
  caption: "tg-caption px-2 py-[2px] rounded-lg",
48
48
  bodyBold: "tg-body-bold px-[10px] py-1 rounded"
49
- }, B = v(
49
+ }, B = u(
50
50
  ({ asChild: e, color: l = "number", size: d = "tag", className: o, ...r }, f) => {
51
- const a = e ? C.Root : "div";
51
+ const a = e ? F.Root : "div";
52
52
  return /* @__PURE__ */ i(
53
53
  a,
54
54
  {
@@ -60,7 +60,7 @@ const t = w({
60
60
  }
61
61
  );
62
62
  B.displayName = "Badge";
63
- const A = v(
63
+ const A = u(
64
64
  ({
65
65
  asChild: e,
66
66
  header: l,
@@ -70,9 +70,9 @@ const A = v(
70
70
  background: f = "bg-neutral-70",
71
71
  className: a,
72
72
  children: n,
73
- ...F
73
+ ...L
74
74
  }, s) => {
75
- const M = e ? C.Root : "div";
75
+ const M = e ? F.Root : "div";
76
76
  return /* @__PURE__ */ i(
77
77
  M,
78
78
  {
@@ -90,7 +90,7 @@ const A = v(
90
90
  f,
91
91
  a
92
92
  ),
93
- ...F,
93
+ ...L,
94
94
  children: e ? n : /* @__PURE__ */ h(b, { children: [
95
95
  l && /* @__PURE__ */ i(_, { padding: r, children: l }),
96
96
  n
@@ -122,7 +122,7 @@ function _({ padding: e, children: l, className: d, ...o }) {
122
122
  }
123
123
  );
124
124
  }
125
- const u = {
125
+ const C = {
126
126
  base: [
127
127
  // Base
128
128
  "flex cursor-pointer items-center justify-center text-nowrap text-neutral-10 ring-inset transition ease-in-out",
@@ -231,18 +231,18 @@ const u = {
231
231
  small: "-mx-4 -my-2 px-4 py-2",
232
232
  xsmall: "-mx-4 -my-1.5 px-2 py-1"
233
233
  }
234
- }, V = v(
234
+ }, V = u(
235
235
  ({ asChild: e, variant: l = "primary", size: d = "medium", className: o, children: r, ...f }, a) => {
236
- const n = e ? C.Root : "button";
236
+ const n = e ? F.Root : "button";
237
237
  return /* @__PURE__ */ i(
238
238
  n,
239
239
  {
240
240
  ref: a,
241
241
  className: t(
242
- ...u.base,
243
- ...u.variants[l],
244
- l !== "text" && u.sizes[d],
245
- l === "ghost" && u.ghostSizes[d],
242
+ ...C.base,
243
+ ...C.variants[l],
244
+ l !== "text" && C.sizes[d],
245
+ l === "ghost" && C.ghostSizes[d],
246
246
  o
247
247
  ),
248
248
  ...f,
@@ -278,9 +278,9 @@ function I({
278
278
  )
279
279
  ] });
280
280
  }
281
- const H = v(
281
+ const H = u(
282
282
  ({ className: e, baseColor: l = "bg-neutral-60", textValue: d, ...o }, r) => /* @__PURE__ */ i(
283
- c.Item,
283
+ v.Item,
284
284
  {
285
285
  className: t(
286
286
  "tg-button-small data-highlighted:text-neutral-10 flex cursor-pointer items-center truncate rounded-[10px] px-4 py-2.5 transition-colors outline-none select-none",
@@ -304,10 +304,10 @@ function j({
304
304
  disabled: f,
305
305
  ...a
306
306
  }) {
307
- return /* @__PURE__ */ h(c.Root, { ...a, children: [
308
- /* @__PURE__ */ i(c.Trigger, { className: t("", o), asChild: !0, disabled: f, children: e }),
309
- /* @__PURE__ */ i(c.Portal, { children: /* @__PURE__ */ i(p.Root, { type: "hover", style: { "--scrollbar-size": "10px" }, asChild: !0, children: /* @__PURE__ */ h(
310
- c.Content,
307
+ return /* @__PURE__ */ h(v.Root, { ...a, children: [
308
+ /* @__PURE__ */ i(v.Trigger, { className: t("", o), asChild: !0, disabled: f, children: e }),
309
+ /* @__PURE__ */ i(v.Portal, { children: /* @__PURE__ */ i(p.Root, { type: "hover", style: { "--scrollbar-size": "10px" }, asChild: !0, children: /* @__PURE__ */ h(
310
+ v.Content,
311
311
  {
312
312
  className: t(
313
313
  "max-h-(--radix-dropdown-menu-content-available-height) overflow-hidden rounded-2xl shadow-[0px_8px_20px_2px_rgba(0,0,0,0.40)]",
@@ -438,9 +438,9 @@ function W({ className: e, ...l }) {
438
438
  }
439
439
  );
440
440
  }
441
- const q = v(
441
+ const q = u(
442
442
  ({ asChild: e, className: l, ...d }, o) => {
443
- const r = e ? C.Root : "div";
443
+ const r = e ? F.Root : "div";
444
444
  return /* @__PURE__ */ i(
445
445
  r,
446
446
  {
@@ -524,22 +524,24 @@ const G = {
524
524
  rightAccessory: d,
525
525
  errorState: o,
526
526
  className: r,
527
- ...f
527
+ containerClassName: f,
528
+ ...a
528
529
  }) => {
529
- const a = e === "filled", n = o || f["aria-invalid"];
530
+ const n = e === "filled", L = o || a["aria-invalid"];
530
531
  return /* @__PURE__ */ h(
531
532
  "div",
532
533
  {
533
534
  className: t(
534
535
  // base wrapper styles:
535
- "flex min-h-10 flex-row items-center justify-between rounded-lg",
536
+ "flex min-h-10 w-full flex-row items-center justify-between rounded-lg",
536
537
  // variant-specific base:
537
- a ? "bg-neutral-60" : "border-neutral-40 focus-within:border-secondary-40 border bg-transparent",
538
+ n ? "bg-neutral-60" : "border-neutral-40 focus-within:border-secondary-40 border bg-transparent",
538
539
  // error:
539
- n && (a ? "" : "border-warning-50 focus-within:border-warning-50"),
540
+ L && (n ? "" : "border-warning-50 focus-within:border-warning-50"),
540
541
  // disabled:
541
- f.disabled && "cursor-not-allowed",
542
- f.disabled && (a ? "bg-neutral-55" : "border-neutral-55")
542
+ a.disabled && "cursor-not-allowed",
543
+ a.disabled && (n ? "bg-neutral-55" : "border-neutral-55"),
544
+ f
543
545
  ),
544
546
  children: [
545
547
  /* @__PURE__ */ i(
@@ -549,16 +551,16 @@ const G = {
549
551
  // base input styles:
550
552
  "tg-body placeholder-neutral-40 flex-1 bg-transparent px-3 focus:outline-none disabled:cursor-not-allowed",
551
553
  // text color:
552
- a ? "text-neutral-10 caret-secondary-40" : "",
554
+ n ? "text-neutral-10 caret-secondary-40" : "",
553
555
  // error:
554
- n && a && "text-warning-50",
556
+ L && n && "text-warning-50",
555
557
  // disabled:
556
- f.disabled && !a && "text-neutral-40",
558
+ a.disabled && !n && "text-neutral-40",
557
559
  r
558
560
  ),
559
- "aria-invalid": n,
561
+ "aria-invalid": L,
560
562
  ...l && G,
561
- ...f
563
+ ...a
562
564
  }
563
565
  ),
564
566
  d && /* @__PURE__ */ i("div", { className: "pr-4", children: d })
@@ -575,21 +577,21 @@ function Y({
575
577
  defaultOpen: f,
576
578
  onOpenChange: a,
577
579
  delayDuration: n,
578
- className: F,
580
+ className: L,
579
581
  children: s,
580
582
  ...M
581
583
  }) {
582
584
  return /* @__PURE__ */ h(
583
- L.Root,
585
+ c.Root,
584
586
  {
585
587
  open: r,
586
588
  defaultOpen: f,
587
589
  onOpenChange: a,
588
590
  delayDuration: n,
589
591
  children: [
590
- /* @__PURE__ */ i(L.Trigger, { className: "cursor-pointer", asChild: !0, children: s }),
591
- /* @__PURE__ */ i(L.Portal, { children: /* @__PURE__ */ h(
592
- L.Content,
592
+ /* @__PURE__ */ i(c.Trigger, { className: "cursor-pointer", asChild: !0, children: s }),
593
+ /* @__PURE__ */ i(c.Portal, { children: /* @__PURE__ */ h(
594
+ c.Content,
593
595
  {
594
596
  className: t(
595
597
  "tg-caption text-neutral-20 max-h-(--radix-tooltip-content-available-height) origin-(--radix-tooltip-content-transform-origin) rounded-lg p-3 text-center text-pretty shadow-md",
@@ -597,7 +599,7 @@ function Y({
597
599
  "data-[state=closed]:animate-tooltip-exit data-[state=delayed-open]:animate-tooltip-delayed-enter data-[state=instant-open]:animate-tooltip-enter",
598
600
  o && "w-(--radix-tooltip-trigger-width)",
599
601
  l,
600
- F
602
+ L
601
603
  ),
602
604
  side: d,
603
605
  sideOffset: 4,
@@ -606,7 +608,7 @@ function Y({
606
608
  children: [
607
609
  e,
608
610
  /* @__PURE__ */ i(
609
- L.Arrow,
611
+ c.Arrow,
610
612
  {
611
613
  className: t(
612
614
  l === "bg-neutral-60" && "fill-neutral-60",
@@ -630,7 +632,7 @@ function l2({
630
632
  skipDelayDuration: d = 50,
631
633
  ...o
632
634
  }) {
633
- return /* @__PURE__ */ i(L.TooltipProvider, { delayDuration: l, skipDelayDuration: d, ...o, children: e });
635
+ return /* @__PURE__ */ i(c.TooltipProvider, { delayDuration: l, skipDelayDuration: d, ...o, children: e });
634
636
  }
635
637
  export {
636
638
  B as Badge,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@validationcloud/fractal-ui",
3
3
  "private": false,
4
- "version": "1.27.0",
4
+ "version": "1.27.1",
5
5
  "module": "./dist/fractal-ui.js",
6
6
  "type": "module",
7
7
  "files": [