@polastack/design-system 0.1.14 → 0.1.15

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.d.ts CHANGED
@@ -370,7 +370,7 @@ declare const formLayoutVariants: (props?: ({
370
370
  size?: "sm" | "md" | "lg" | null | undefined;
371
371
  } & class_variance_authority_types.ClassProp) | undefined) => string;
372
372
  interface FormLayoutProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof formLayoutVariants> {
373
- columns?: number;
373
+ columns?: number | 'responsive';
374
374
  }
375
375
  declare const FormLayout: React.ForwardRefExoticComponent<FormLayoutProps & React.RefAttributes<HTMLDivElement>>;
376
376
  interface FormSectionProps extends React.HTMLAttributes<HTMLFieldSetElement> {
@@ -717,7 +717,7 @@ interface PrintFieldProps extends React.HTMLAttributes<HTMLDivElement> {
717
717
  }
718
718
  declare const PrintField: React.ForwardRefExoticComponent<PrintFieldProps & React.RefAttributes<HTMLDivElement>>;
719
719
  declare const printFieldGroupVariants: (props?: ({
720
- columns?: 2 | 1 | 3 | null | undefined;
720
+ columns?: 2 | 1 | 3 | "responsive" | null | undefined;
721
721
  } & class_variance_authority_types.ClassProp) | undefined) => string;
722
722
  interface PrintFieldGroupProps extends React.HTMLAttributes<HTMLDListElement>, VariantProps<typeof printFieldGroupVariants> {
723
723
  }
package/dist/index.js CHANGED
@@ -302,7 +302,7 @@ import * as React4 from "react";
302
302
  import { cva as cva2 } from "class-variance-authority";
303
303
  import { jsx as jsx3 } from "react/jsx-runtime";
304
304
  var badgeVariants = cva2(
305
- "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors",
305
+ "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium transition-colors touch:px-3 touch:py-1 touch:text-sm",
306
306
  {
307
307
  variants: {
308
308
  variant: {
@@ -637,7 +637,7 @@ var CardHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE
637
637
  "div",
638
638
  {
639
639
  ref,
640
- className: cn("flex flex-col gap-1.5 p-6", className),
640
+ className: cn("flex flex-col gap-1.5 p-4 sm:p-6", className),
641
641
  ...props
642
642
  }
643
643
  ));
@@ -646,7 +646,7 @@ var CardTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE_
646
646
  "h3",
647
647
  {
648
648
  ref,
649
- className: cn("text-lg font-semibold leading-none tracking-tight", className),
649
+ className: cn("text-base sm:text-lg font-semibold leading-none tracking-tight", className),
650
650
  ...props
651
651
  }
652
652
  ));
@@ -660,13 +660,13 @@ var CardDescription = React10.forwardRef(({ className, ...props }, ref) => /* @_
660
660
  }
661
661
  ));
662
662
  CardDescription.displayName = "CardDescription";
663
- var CardContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9("div", { ref, className: cn("p-6 pt-0", className), ...props }));
663
+ var CardContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9("div", { ref, className: cn("p-4 pt-0 sm:p-6 sm:pt-0", className), ...props }));
664
664
  CardContent.displayName = "CardContent";
665
665
  var CardFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
666
666
  "div",
667
667
  {
668
668
  ref,
669
- className: cn("flex items-center p-6 pt-0", className),
669
+ className: cn("flex items-center p-4 pt-0 sm:p-6 sm:pt-0", className),
670
670
  ...props
671
671
  }
672
672
  ));
@@ -715,7 +715,7 @@ var ToastViewport = React12.forwardRef(({ className, ...props }, ref) => /* @__P
715
715
  ));
716
716
  ToastViewport.displayName = "ToastViewport";
717
717
  var toastVariants = cva5(
718
- "group pointer-events-auto relative flex w-full items-center justify-between gap-4 overflow-hidden rounded-lg border p-4 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=open]:slide-in-from-right-full data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full",
718
+ "group pointer-events-auto relative flex w-full items-center justify-between gap-4 overflow-hidden rounded-lg border p-3 sm:p-4 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom-full sm:data-[state=open]:slide-in-from-right-full data-[state=closed]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full sm:data-[state=closed]:slide-out-to-right-full",
719
719
  {
720
720
  variants: {
721
721
  variant: {
@@ -1865,15 +1865,22 @@ var formLayoutVariants = cva10("", {
1865
1865
  }
1866
1866
  });
1867
1867
  var FormLayout = React26.forwardRef(
1868
- ({ className, layout, size, columns = 2, style, ...props }, ref) => /* @__PURE__ */ jsx25(
1869
- "div",
1870
- {
1871
- ref,
1872
- className: cn(formLayoutVariants({ layout, size }), className),
1873
- style: layout === "grid" ? { gridTemplateColumns: `repeat(${columns}, 1fr)`, ...style } : style,
1874
- ...props
1875
- }
1876
- )
1868
+ ({ className, layout, size, columns = 2, style, ...props }, ref) => {
1869
+ const isResponsive = columns === "responsive";
1870
+ return /* @__PURE__ */ jsx25(
1871
+ "div",
1872
+ {
1873
+ ref,
1874
+ className: cn(
1875
+ formLayoutVariants({ layout, size }),
1876
+ isResponsive && layout === "grid" && "grid-cols-1 md:grid-cols-2 lg:grid-cols-3",
1877
+ className
1878
+ ),
1879
+ style: layout === "grid" && !isResponsive ? { gridTemplateColumns: `repeat(${columns}, 1fr)`, ...style } : style,
1880
+ ...props
1881
+ }
1882
+ );
1883
+ }
1877
1884
  );
1878
1885
  FormLayout.displayName = "FormLayout";
1879
1886
  var FormSection = React26.forwardRef(({ className, title, description, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
@@ -1920,7 +1927,7 @@ import { jsx as jsx26 } from "react/jsx-runtime";
1920
1927
  var [TabsVariantProvider, useTabsVariant] = createContext2("TabsVariant");
1921
1928
  var Tabs = TabsPrimitive.Root;
1922
1929
  var tabsListVariants = cva11(
1923
- "inline-flex items-center justify-center",
1930
+ "inline-flex items-center justify-center overflow-x-auto max-w-full",
1924
1931
  {
1925
1932
  variants: {
1926
1933
  variant: {
@@ -1940,7 +1947,7 @@ var TabsList = React27.forwardRef(({ className, variant = "default", ...props },
1940
1947
  }
1941
1948
  ) }));
1942
1949
  TabsList.displayName = "TabsList";
1943
- var tabsTriggerBase = "inline-flex items-center justify-center whitespace-nowrap px-3 py-1.5 text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 touch:min-h-[--touch-target-min]";
1950
+ var tabsTriggerBase = "inline-flex items-center justify-center whitespace-nowrap shrink-0 px-3 py-1.5 text-sm font-medium transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 touch:min-h-[--touch-target-min]";
1944
1951
  var tabsTriggerVariantStyles = {
1945
1952
  default: "rounded-md data-[state=active]:bg-[var(--color-surface-raised)] data-[state=active]:shadow-sm data-[state=active]:text-[var(--color-on-surface)] text-[var(--color-on-surface-secondary)]",
1946
1953
  underline: "border-b-2 border-transparent rounded-none data-[state=active]:border-primary-500 data-[state=active]:text-[var(--color-on-surface)] text-[var(--color-on-surface-secondary)]"
@@ -2103,7 +2110,7 @@ var TableCell = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE_
2103
2110
  {
2104
2111
  ref,
2105
2112
  className: cn(
2106
- "px-3 py-2.5 align-middle text-sm [&:has([role=checkbox])]:pr-0",
2113
+ "px-2 py-2 sm:px-3 sm:py-2.5 align-middle text-sm [&:has([role=checkbox])]:pr-0",
2107
2114
  className
2108
2115
  ),
2109
2116
  ...props
@@ -2145,12 +2152,12 @@ function DataTablePagination({
2145
2152
  "div",
2146
2153
  {
2147
2154
  className: cn(
2148
- "flex items-center justify-between px-3 py-3 text-sm text-[var(--color-on-surface-secondary)]",
2155
+ "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between px-3 py-3 text-sm text-[var(--color-on-surface-secondary)]",
2149
2156
  className
2150
2157
  ),
2151
2158
  children: [
2152
2159
  /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
2153
- /* @__PURE__ */ jsx29("span", { children: "Rows per page" }),
2160
+ /* @__PURE__ */ jsx29("span", { className: "hidden sm:inline", children: "Rows per page" }),
2154
2161
  /* @__PURE__ */ jsx29(
2155
2162
  "select",
2156
2163
  {
@@ -2849,7 +2856,7 @@ var DialogContent = React35.forwardRef(({ className, children, ...props }, ref)
2849
2856
  "inset-0",
2850
2857
  // Desktop: centered modal
2851
2858
  "sm:inset-auto sm:left-1/2 sm:top-1/2 sm:-translate-x-1/2 sm:-translate-y-1/2",
2852
- "sm:w-full sm:max-w-lg sm:rounded-xl sm:border sm:border-[var(--color-border)]",
2859
+ "sm:w-full sm:max-w-lg md:max-w-xl sm:rounded-xl sm:border sm:border-[var(--color-border)]",
2853
2860
  // Animations
2854
2861
  "animate-in fade-in-0",
2855
2862
  "sm:zoom-in-95 sm:slide-in-from-left-1/2 sm:slide-in-from-top-[48%]",
@@ -3169,7 +3176,7 @@ var DrawerContent = React36.forwardRef(({ className, size, children, ...props },
3169
3176
  {
3170
3177
  ref,
3171
3178
  className: cn(
3172
- "fixed top-0 h-full bg-[var(--color-surface-raised)] shadow-xl",
3179
+ "fixed top-0 h-full max-w-full bg-[var(--color-surface-raised)] shadow-xl",
3173
3180
  "focus-visible:outline-none",
3174
3181
  side === "right" && "right-0 border-l border-[var(--color-border)] animate-slide-in-right data-[state=closed]:animate-slide-out-right",
3175
3182
  side === "left" && "left-0 border-r border-[var(--color-border)] animate-slide-in-left data-[state=closed]:animate-slide-out-left",
@@ -3191,7 +3198,7 @@ var DrawerHeader = React36.forwardRef(({ className, ...props }, ref) => {
3191
3198
  {
3192
3199
  ref,
3193
3200
  className: cn(
3194
- "flex items-center justify-between border-b border-[var(--color-border)] px-6 py-4",
3201
+ "flex items-center justify-between border-b border-[var(--color-border)] px-4 py-3 sm:px-6 sm:py-4",
3195
3202
  className
3196
3203
  ),
3197
3204
  ...props,
@@ -3270,7 +3277,7 @@ var DrawerFooter = React36.forwardRef(({ className, ...props }, ref) => /* @__PU
3270
3277
  {
3271
3278
  ref,
3272
3279
  className: cn(
3273
- "flex items-center justify-end gap-2 border-t border-[var(--color-border)] px-6 py-4",
3280
+ "flex items-center justify-end gap-2 border-t border-[var(--color-border)] px-4 py-3 sm:px-6 sm:py-4",
3274
3281
  className
3275
3282
  ),
3276
3283
  ...props
@@ -3840,7 +3847,8 @@ var printFieldGroupVariants = cva16("grid gap-x-6 gap-y-2", {
3840
3847
  columns: {
3841
3848
  1: "grid-cols-1",
3842
3849
  2: "grid-cols-2",
3843
- 3: "grid-cols-3"
3850
+ 3: "grid-cols-3",
3851
+ responsive: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
3844
3852
  }
3845
3853
  },
3846
3854
  defaultVariants: {
@@ -3901,7 +3909,7 @@ var StatCard = React46.forwardRef(
3901
3909
  {
3902
3910
  ref,
3903
3911
  className: cn(
3904
- "rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-raised)] p-5",
3912
+ "rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-raised)] p-4 sm:p-5",
3905
3913
  className
3906
3914
  ),
3907
3915
  ...props,
@@ -3911,7 +3919,7 @@ var StatCard = React46.forwardRef(
3911
3919
  icon && /* @__PURE__ */ jsx48("span", { className: "text-[var(--color-on-surface-muted)]", children: icon })
3912
3920
  ] }),
3913
3921
  /* @__PURE__ */ jsxs27("div", { className: "flex items-baseline gap-2 mt-2", children: [
3914
- /* @__PURE__ */ jsx48("span", { className: "text-2xl font-bold tabular-nums", children: value }),
3922
+ /* @__PURE__ */ jsx48("span", { className: "text-xl sm:text-2xl font-bold tabular-nums", children: value }),
3915
3923
  trend && /* @__PURE__ */ jsxs27("span", { className: cn("inline-flex items-center gap-0.5 text-xs font-medium", TREND_STYLES[direction]), children: [
3916
3924
  direction !== "neutral" && /* @__PURE__ */ jsx48("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx48("path", { d: TREND_ICONS[direction] }) }),
3917
3925
  trend
@@ -3938,14 +3946,14 @@ var ChartContainer = React47.forwardRef(
3938
3946
  ),
3939
3947
  ...props,
3940
3948
  children: [
3941
- /* @__PURE__ */ jsxs28("div", { className: "flex items-start justify-between gap-4 p-5 pb-0", children: [
3949
+ /* @__PURE__ */ jsxs28("div", { className: "flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4 p-4 sm:p-5 pb-0", children: [
3942
3950
  /* @__PURE__ */ jsxs28("div", { children: [
3943
3951
  /* @__PURE__ */ jsx49("h3", { className: "text-sm font-semibold leading-none tracking-tight", children: title }),
3944
3952
  description && /* @__PURE__ */ jsx49("p", { className: "mt-1 text-xs text-[var(--color-on-surface-muted)]", children: description })
3945
3953
  ] }),
3946
3954
  actions && /* @__PURE__ */ jsx49("div", { className: "flex items-center gap-2 shrink-0", children: actions })
3947
3955
  ] }),
3948
- /* @__PURE__ */ jsx49("div", { className: "p-5", children })
3956
+ /* @__PURE__ */ jsx49("div", { className: "p-4 sm:p-5", children })
3949
3957
  ]
3950
3958
  }
3951
3959
  )