@tryghost/shade 0.1.0-alpha.27 → 0.1.0-alpha.29

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.
Files changed (41) hide show
  1. package/es/components/patterns/image-upload.js +20 -13
  2. package/es/components/patterns/image-upload.js.map +1 -1
  3. package/es/components/patterns/settings-modal.js +1 -1
  4. package/es/components/ui/button.js +16 -3
  5. package/es/components/ui/button.js.map +1 -1
  6. package/es/components/ui/dialog.js +1 -1
  7. package/es/components/ui/dialog.js.map +1 -1
  8. package/es/components/ui/dropzone-variants.js +26 -8
  9. package/es/components/ui/dropzone-variants.js.map +1 -1
  10. package/es/components/ui/dropzone.js +2 -2
  11. package/es/components/ui/dropzone.js.map +1 -1
  12. package/es/components/ui/input-surface.js +2 -2
  13. package/es/components/ui/input-surface.js.map +1 -1
  14. package/es/components/ui/pagemenu.js +18 -6
  15. package/es/components/ui/pagemenu.js.map +1 -1
  16. package/es/components/ui/sidebar.js +1 -1
  17. package/es/components/ui/tabs-variants.js +23 -1
  18. package/es/components/ui/tabs-variants.js.map +1 -1
  19. package/es/components/ui/tabs.js +39 -18
  20. package/es/components/ui/tabs.js.map +1 -1
  21. package/es/components.js +4 -4
  22. package/es/index.js +4 -4
  23. package/es/tokens.js +4 -0
  24. package/es/tokens.js.map +1 -1
  25. package/package.json +1 -1
  26. package/styles.css +4 -4
  27. package/tailwind.theme.css +3 -0
  28. package/theme-variables.css +13 -4
  29. package/types/components/patterns/image-upload.d.ts.map +1 -1
  30. package/types/components/ui/button.d.ts +5 -0
  31. package/types/components/ui/button.d.ts.map +1 -1
  32. package/types/components/ui/dropzone-variants.d.ts +2 -1
  33. package/types/components/ui/dropzone-variants.d.ts.map +1 -1
  34. package/types/components/ui/input-surface.d.ts +2 -2
  35. package/types/components/ui/input-surface.d.ts.map +1 -1
  36. package/types/components/ui/pagemenu.d.ts.map +1 -1
  37. package/types/components/ui/tabs-variants.d.ts +5 -1
  38. package/types/components/ui/tabs-variants.d.ts.map +1 -1
  39. package/types/components/ui/tabs.d.ts.map +1 -1
  40. package/types/tokens.d.ts +1 -1
  41. package/types/tokens.d.ts.map +1 -1
@@ -1,4 +1,5 @@
1
1
  import { cn } from "../../lib/ds-utils.js";
2
+ import { useShade } from "../../providers/shade-context.js";
2
3
  import { Button } from "../ui/button.js";
3
4
  import { imageUploadPreviewVariants } from "./image-upload-variants.js";
4
5
  import { Dropzone } from "../ui/dropzone.js";
@@ -6,20 +7,26 @@ import { imageOverlayButton } from "../ui/image-overlay-button.js";
6
7
  import * as React$1 from "react";
7
8
  import { jsx } from "react/jsx-runtime";
8
9
  //#region src/components/patterns/image-upload.tsx
9
- var ImageUpload = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
10
- ref,
11
- className: cn("relative overflow-hidden rounded-md", className),
12
- "data-slot": "image-upload",
13
- ...props
14
- }));
10
+ var ImageUpload = React$1.forwardRef(({ className, ...props }, ref) => {
11
+ const { admin7Design } = useShade();
12
+ return /* @__PURE__ */ jsx("div", {
13
+ ref,
14
+ className: cn("relative rounded-md", !admin7Design && "overflow-hidden", className),
15
+ "data-slot": "image-upload",
16
+ ...props
17
+ });
18
+ });
15
19
  ImageUpload.displayName = "ImageUpload";
16
- var ImageUploadDropzone = React$1.forwardRef(({ className, variant = "filled", ...props }, ref) => /* @__PURE__ */ jsx(Dropzone, {
17
- ref,
18
- className: cn("size-full text-foreground", className),
19
- "data-slot": "image-upload-dropzone",
20
- variant,
21
- ...props
22
- }));
20
+ var ImageUploadDropzone = React$1.forwardRef(({ className, variant = "filled", ...props }, ref) => {
21
+ const { admin7Design } = useShade();
22
+ return /* @__PURE__ */ jsx(Dropzone, {
23
+ ref,
24
+ className: cn("size-full", !admin7Design && "text-foreground", className),
25
+ "data-slot": "image-upload-dropzone",
26
+ variant,
27
+ ...props
28
+ });
29
+ });
23
30
  ImageUploadDropzone.displayName = "ImageUploadDropzone";
24
31
  var ImageUploadPreview = React$1.forwardRef(({ background, className, ...props }, ref) => /* @__PURE__ */ jsx("div", {
25
32
  ref,
@@ -1 +1 @@
1
- {"version":3,"file":"image-upload.js","names":[],"sources":["../../../src/components/patterns/image-upload.tsx"],"sourcesContent":["import * as React from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { imageUploadPreviewVariants } from '@/components/patterns/image-upload-variants';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { Dropzone, type DropzoneProps } from '@/components/ui/dropzone';\nimport { cn } from '@/lib/utils';\nimport { imageOverlayButton } from '@/components/ui/image-overlay-button';\n\nconst ImageUpload = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn('relative overflow-hidden rounded-md', className)}\n data-slot=\"image-upload\"\n {...props}\n />\n ),\n);\nImageUpload.displayName = 'ImageUpload';\n\nconst ImageUploadDropzone = React.forwardRef<HTMLDivElement, DropzoneProps>(\n ({ className, variant = 'filled', ...props }, ref) => (\n <Dropzone\n ref={ref}\n className={cn('size-full text-foreground', className)}\n data-slot=\"image-upload-dropzone\"\n variant={variant}\n {...props}\n />\n ),\n);\nImageUploadDropzone.displayName = 'ImageUploadDropzone';\n\nexport interface ImageUploadPreviewProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof imageUploadPreviewVariants> {}\n\nconst ImageUploadPreview = React.forwardRef<HTMLDivElement, ImageUploadPreviewProps>(\n ({ background, className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(imageUploadPreviewVariants({ background }), className)}\n data-slot=\"image-upload-preview\"\n data-testid=\"image-upload-container\"\n {...props}\n />\n ),\n);\nImageUploadPreview.displayName = 'ImageUploadPreview';\n\nconst ImageUploadImage = React.forwardRef<\n HTMLImageElement,\n React.ImgHTMLAttributes<HTMLImageElement>\n>(({ alt = '', className, ...props }, ref) => (\n <img\n ref={ref}\n alt={alt}\n className={cn('size-full object-cover', className)}\n data-slot=\"image-upload-image\"\n {...props}\n />\n));\nImageUploadImage.displayName = 'ImageUploadImage';\n\nconst ImageUploadActions = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'absolute top-2 right-2 flex gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [@media(hover:none)]:opacity-100',\n className,\n )}\n data-slot=\"image-upload-actions\"\n {...props}\n />\n ),\n);\nImageUploadActions.displayName = 'ImageUploadActions';\n\nconst ImageUploadAction = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, size = 'icon', variant = 'ghost', ...props }, ref) => {\n return (\n <Button\n ref={ref}\n className={cn('size-8', imageOverlayButton(), className)}\n data-slot=\"image-upload-action\"\n size={size}\n variant={variant}\n {...props}\n />\n );\n },\n);\nImageUploadAction.displayName = 'ImageUploadAction';\n\nexport {\n ImageUpload,\n ImageUploadAction,\n ImageUploadActions,\n ImageUploadDropzone,\n ImageUploadImage,\n ImageUploadPreview,\n};\n"],"mappings":";;;;;;;;AASA,IAAM,cAAc,QAAM,YACvB,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,uCAAuC,SAAS;CAC9D,aAAU;CACV,GAAI;AACL,CAAA,CAEL;AACA,YAAY,cAAc;AAE1B,IAAM,sBAAsB,QAAM,YAC/B,EAAE,WAAW,UAAU,UAAU,GAAG,SAAS,QAC5C,oBAAC,UAAD;CACO;CACL,WAAW,GAAG,6BAA6B,SAAS;CACpD,aAAU;CACD;CACT,GAAI;AACL,CAAA,CAEL;AACA,oBAAoB,cAAc;AAKlC,IAAM,qBAAqB,QAAM,YAC9B,EAAE,YAAY,WAAW,GAAG,SAAS,QACpC,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,2BAA2B,EAAE,WAAW,CAAC,GAAG,SAAS;CACnE,aAAU;CACV,eAAY;CACZ,GAAI;AACL,CAAA,CAEL;AACA,mBAAmB,cAAc;AAEjC,IAAM,mBAAmB,QAAM,YAG5B,EAAE,MAAM,IAAI,WAAW,GAAG,SAAS,QACpC,oBAAC,OAAD;CACO;CACA;CACL,WAAW,GAAG,0BAA0B,SAAS;CACjD,aAAU;CACV,GAAI;AACL,CAAA,CACF;AACD,iBAAiB,cAAc;AAE/B,IAAM,qBAAqB,QAAM,YAC9B,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,OAAD;CACO;CACL,WAAW,GACT,0JACA,SACF;CACA,aAAU;CACV,GAAI;AACL,CAAA,CAEL;AACA,mBAAmB,cAAc;AAEjC,IAAM,oBAAoB,QAAM,YAC7B,EAAE,WAAW,OAAO,QAAQ,UAAU,SAAS,GAAG,SAAS,QAAQ;CAClE,OACE,oBAAC,QAAD;EACO;EACL,WAAW,GAAG,UAAU,mBAAmB,GAAG,SAAS;EACvD,aAAU;EACJ;EACG;EACT,GAAI;CACL,CAAA;AAEL,CACF;AACA,kBAAkB,cAAc"}
1
+ {"version":3,"file":"image-upload.js","names":[],"sources":["../../../src/components/patterns/image-upload.tsx"],"sourcesContent":["import * as React from 'react';\nimport { type VariantProps } from 'class-variance-authority';\n\nimport { imageUploadPreviewVariants } from '@/components/patterns/image-upload-variants';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { Dropzone, type DropzoneProps } from '@/components/ui/dropzone';\nimport { cn } from '@/lib/utils';\nimport { imageOverlayButton } from '@/components/ui/image-overlay-button';\nimport { useShade } from '@/providers/shade-context';\n\n// In Admin 7, previews own clipping so dropzone borders and focus rings remain visible.\nconst ImageUpload = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n const { admin7Design } = useShade();\n return (\n <div\n ref={ref}\n className={cn('relative rounded-md', !admin7Design && 'overflow-hidden', className)}\n data-slot=\"image-upload\"\n {...props}\n />\n );\n },\n);\nImageUpload.displayName = 'ImageUpload';\n\nconst ImageUploadDropzone = React.forwardRef<HTMLDivElement, DropzoneProps>(\n ({ className, variant = 'filled', ...props }, ref) => {\n const { admin7Design } = useShade();\n return (\n <Dropzone\n ref={ref}\n className={cn('size-full', !admin7Design && 'text-foreground', className)}\n data-slot=\"image-upload-dropzone\"\n variant={variant}\n {...props}\n />\n );\n },\n);\nImageUploadDropzone.displayName = 'ImageUploadDropzone';\n\nexport interface ImageUploadPreviewProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof imageUploadPreviewVariants> {}\n\nconst ImageUploadPreview = React.forwardRef<HTMLDivElement, ImageUploadPreviewProps>(\n ({ background, className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(imageUploadPreviewVariants({ background }), className)}\n data-slot=\"image-upload-preview\"\n data-testid=\"image-upload-container\"\n {...props}\n />\n ),\n);\nImageUploadPreview.displayName = 'ImageUploadPreview';\n\nconst ImageUploadImage = React.forwardRef<\n HTMLImageElement,\n React.ImgHTMLAttributes<HTMLImageElement>\n>(({ alt = '', className, ...props }, ref) => (\n <img\n ref={ref}\n alt={alt}\n className={cn('size-full object-cover', className)}\n data-slot=\"image-upload-image\"\n {...props}\n />\n));\nImageUploadImage.displayName = 'ImageUploadImage';\n\nconst ImageUploadActions = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'absolute top-2 right-2 flex gap-1 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 [@media(hover:none)]:opacity-100',\n className,\n )}\n data-slot=\"image-upload-actions\"\n {...props}\n />\n ),\n);\nImageUploadActions.displayName = 'ImageUploadActions';\n\nconst ImageUploadAction = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, size = 'icon', variant = 'ghost', ...props }, ref) => {\n return (\n <Button\n ref={ref}\n className={cn('size-8', imageOverlayButton(), className)}\n data-slot=\"image-upload-action\"\n size={size}\n variant={variant}\n {...props}\n />\n );\n },\n);\nImageUploadAction.displayName = 'ImageUploadAction';\n\nexport {\n ImageUpload,\n ImageUploadAction,\n ImageUploadActions,\n ImageUploadDropzone,\n ImageUploadImage,\n ImageUploadPreview,\n};\n"],"mappings":";;;;;;;;;AAWA,IAAM,cAAc,QAAM,YACvB,EAAE,WAAW,GAAG,SAAS,QAAQ;CAChC,MAAM,EAAE,iBAAiB,SAAS;CAClC,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,uBAAuB,CAAC,gBAAgB,mBAAmB,SAAS;EAClF,aAAU;EACV,GAAI;CACL,CAAA;AAEL,CACF;AACA,YAAY,cAAc;AAE1B,IAAM,sBAAsB,QAAM,YAC/B,EAAE,WAAW,UAAU,UAAU,GAAG,SAAS,QAAQ;CACpD,MAAM,EAAE,iBAAiB,SAAS;CAClC,OACE,oBAAC,UAAD;EACO;EACL,WAAW,GAAG,aAAa,CAAC,gBAAgB,mBAAmB,SAAS;EACxE,aAAU;EACD;EACT,GAAI;CACL,CAAA;AAEL,CACF;AACA,oBAAoB,cAAc;AAKlC,IAAM,qBAAqB,QAAM,YAC9B,EAAE,YAAY,WAAW,GAAG,SAAS,QACpC,oBAAC,OAAD;CACO;CACL,WAAW,GAAG,2BAA2B,EAAE,WAAW,CAAC,GAAG,SAAS;CACnE,aAAU;CACV,eAAY;CACZ,GAAI;AACL,CAAA,CAEL;AACA,mBAAmB,cAAc;AAEjC,IAAM,mBAAmB,QAAM,YAG5B,EAAE,MAAM,IAAI,WAAW,GAAG,SAAS,QACpC,oBAAC,OAAD;CACO;CACA;CACL,WAAW,GAAG,0BAA0B,SAAS;CACjD,aAAU;CACV,GAAI;AACL,CAAA,CACF;AACD,iBAAiB,cAAc;AAE/B,IAAM,qBAAqB,QAAM,YAC9B,EAAE,WAAW,GAAG,SAAS,QACxB,oBAAC,OAAD;CACO;CACL,WAAW,GACT,0JACA,SACF;CACA,aAAU;CACV,GAAI;AACL,CAAA,CAEL;AACA,mBAAmB,cAAc;AAEjC,IAAM,oBAAoB,QAAM,YAC7B,EAAE,WAAW,OAAO,QAAQ,UAAU,SAAS,GAAG,SAAS,QAAQ;CAClE,OACE,oBAAC,QAAD;EACO;EACL,WAAW,GAAG,UAAU,mBAAmB,GAAG,SAAS;EACvD,aAAU;EACJ;EACG;EACT,GAAI;CACL,CAAA;AAEL,CACF;AACA,kBAAkB,cAAc"}
@@ -3,11 +3,11 @@ import { cn } from "../../lib/ds-utils.js";
3
3
  import { Box } from "../primitives/box.js";
4
4
  import { Inline } from "../primitives/inline.js";
5
5
  import { Text } from "../primitives/text.js";
6
+ import { LoadingIndicator } from "../ui/loading-indicator.js";
6
7
  import { Button } from "../ui/button.js";
7
8
  import { DirtyConfirmDialog } from "./dirty-confirm-dialog.js";
8
9
  import { useDirtyConfirmation } from "./use-dirty-confirmation.js";
9
10
  import { settingsModalVariants } from "./settings-modal-variants.js";
10
- import { LoadingIndicator } from "../ui/loading-indicator.js";
11
11
  import { StickyFooter } from "../ui/sticky-footer.js";
12
12
  import { X } from "lucide-react";
13
13
  import { forwardRef, useEffect, useState } from "react";
@@ -1,14 +1,16 @@
1
1
  import { cn } from "../../lib/ds-utils.js";
2
2
  import { useShade } from "../../providers/shade-context.js";
3
3
  import { buttonVariants } from "./button-variants.js";
4
+ import { LoadingIndicator } from "./loading-indicator.js";
4
5
  import { ChevronDown } from "lucide-react";
5
6
  import * as React$1 from "react";
6
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
8
  import { Slot } from "@radix-ui/react-slot";
8
9
  //#region src/components/ui/button.tsx
9
- var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = false, children, ...props }, ref) => {
10
+ var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = false, loading = false, disabled, children, ...props }, ref) => {
10
11
  const { controlShape } = useShade();
11
12
  const Comp = asChild ? Slot : "button";
13
+ const isLoading = loading && !asChild;
12
14
  const resolvedShape = variant === "link" ? "rounded" : shape ?? controlShape;
13
15
  const content = variant === "dropdown" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsx(ChevronDown, {
14
16
  className: "-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50",
@@ -16,15 +18,26 @@ var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = fa
16
18
  })] }) : children;
17
19
  return /* @__PURE__ */ jsx(Comp, {
18
20
  ref,
19
- className: cn(buttonVariants({
21
+ "aria-busy": isLoading || void 0,
22
+ className: cn(isLoading && "relative", buttonVariants({
20
23
  variant,
21
24
  size,
22
25
  shape: resolvedShape,
23
26
  className
24
27
  })),
28
+ disabled: isLoading || disabled,
25
29
  ...props,
26
30
  "data-control-shape": resolvedShape,
27
- children: content
31
+ children: isLoading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
32
+ className: "inline-flex items-center justify-center gap-1.5 opacity-0",
33
+ children: content
34
+ }), /* @__PURE__ */ jsx("span", {
35
+ className: "absolute inset-0 flex items-center justify-center",
36
+ children: /* @__PURE__ */ jsx(LoadingIndicator, {
37
+ color: "current",
38
+ size: "sm"
39
+ })
40
+ })] }) : content
28
41
  });
29
42
  });
30
43
  Button.displayName = "Button";
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, shape, asChild = false, children, ...props }, ref) => {\n const { controlShape } = useShade();\n const Comp = asChild ? Slot : 'button';\n const resolvedShape = variant === 'link' ? 'rounded' : (shape ?? controlShape);\n const content =\n variant === 'dropdown' ? (\n <>\n {children}\n <ChevronDown\n className=\"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50\"\n strokeWidth={2}\n />\n </>\n ) : (\n children\n );\n\n return (\n <Comp\n ref={ref}\n className={cn(buttonVariants({ variant, size, shape: resolvedShape, className }))}\n {...props}\n data-control-shape={resolvedShape}\n >\n {content}\n </Comp>\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button };\n"],"mappings":";;;;;;;;AAcA,IAAM,SAAS,QAAM,YAClB,EAAE,WAAW,SAAS,MAAM,OAAO,UAAU,OAAO,UAAU,GAAG,SAAS,QAAQ;CACjF,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,OAAO,UAAU,OAAO;CAC9B,MAAM,gBAAgB,YAAY,SAAS,YAAa,SAAS;CACjE,MAAM,UACJ,YAAY,aACV,qBAAA,YAAA,EAAA,UAAA,CACG,UACD,oBAAC,aAAD;EACE,WAAU;EACV,aAAa;CACd,CAAA,CACD,EAAA,CAAA,IAEF;CAGJ,OACE,oBAAC,MAAD;EACO;EACL,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM,OAAO;GAAe;EAAU,CAAC,CAAC;EAChF,GAAI;EACJ,sBAAoB;YAEnB;CACG,CAAA;AAEV,CACF;AACA,OAAO,cAAc"}
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { LoadingIndicator } from '@/components/ui/loading-indicator';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Disables the button and shows a spinner over its label. The label stays in\n * the layout, so the button keeps its width. Ignored with `asChild`.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const { controlShape } = useShade();\n const Comp = asChild ? Slot : 'button';\n const isLoading = loading && !asChild;\n const resolvedShape = variant === 'link' ? 'rounded' : (shape ?? controlShape);\n const content =\n variant === 'dropdown' ? (\n <>\n {children}\n <ChevronDown\n className=\"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50\"\n strokeWidth={2}\n />\n </>\n ) : (\n children\n );\n\n return (\n <Comp\n ref={ref}\n aria-busy={isLoading || undefined}\n className={cn(\n isLoading && 'relative',\n buttonVariants({ variant, size, shape: resolvedShape, className }),\n )}\n disabled={isLoading || disabled}\n {...props}\n data-control-shape={resolvedShape}\n >\n {isLoading ? (\n <>\n <span className=\"inline-flex items-center justify-center gap-1.5 opacity-0\">\n {content}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <LoadingIndicator color=\"current\" size=\"sm\" />\n </span>\n </>\n ) : (\n content\n )}\n </Comp>\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button };\n"],"mappings":";;;;;;;;;AAoBA,IAAM,SAAS,QAAM,YAEjB,EACE,WACA,SACA,MACA,OACA,UAAU,OACV,UAAU,OACV,UACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,OAAO,UAAU,OAAO;CAC9B,MAAM,YAAY,WAAW,CAAC;CAC9B,MAAM,gBAAgB,YAAY,SAAS,YAAa,SAAS;CACjE,MAAM,UACJ,YAAY,aACV,qBAAA,YAAA,EAAA,UAAA,CACG,UACD,oBAAC,aAAD;EACE,WAAU;EACV,aAAa;CACd,CAAA,CACD,EAAA,CAAA,IAEF;CAGJ,OACE,oBAAC,MAAD;EACO;EACL,aAAW,aAAa,KAAA;EACxB,WAAW,GACT,aAAa,YACb,eAAe;GAAE;GAAS;GAAM,OAAO;GAAe;EAAU,CAAC,CACnE;EACA,UAAU,aAAa;EACvB,GAAI;EACJ,sBAAoB;YAEnB,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA,GACN,oBAAC,QAAD;GAAM,WAAU;aACd,oBAAC,kBAAD;IAAkB,OAAM;IAAU,MAAK;GAAM,CAAA;EACzC,CAAA,CACN,EAAA,CAAA,IAEF;CAEE,CAAA;AAEV,CACF;AACA,OAAO,cAAc"}
@@ -51,7 +51,7 @@ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
51
51
  });
52
52
  DialogHeader.displayName = "DialogHeader";
53
53
  var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
54
- className: cn("flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2 [&_button]:min-w-20", className),
54
+ className: cn("flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2", className),
55
55
  ...props
56
56
  });
57
57
  DialogFooter.displayName = "DialogFooter";
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\n// Radix keeps whether a dialog is modal to itself, and the overlay scroll layout needs to know.\nconst DialogModalContext = React.createContext(true);\n\nconst Dialog = ({ modal = true, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => (\n <DialogModalContext.Provider value={modal}>\n <DialogPrimitive.Root modal={modal} {...props} />\n </DialogModalContext.Provider>\n);\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n data-slot=\"dialog-overlay\"\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n// The panel itself, shared by both ways a dialog can sit on the page.\nconst dialogPanelClassName =\n 'z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg outline-hidden duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95';\n\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n> {\n /**\n * How a dialog taller than the window scrolls. `fixed` (the default) pins the dialog near\n * the top of the window, so it needs its own height limit and inner scroll. `overlay` makes\n * the backdrop the scroll container instead: the whole dialog scrolls as one piece, the way\n * a page does.\n */\n scroll?: 'fixed' | 'overlay';\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, scroll = 'fixed', ...props }, ref) => {\n const modal = React.useContext(DialogModalContext);\n\n const panel = (\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n scroll === 'overlay'\n ? 'pointer-events-auto relative rounded-lg'\n : 'fixed top-[8vmin] left-[50%] translate-x-[-50%] sm:rounded-lg',\n dialogPanelClassName,\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n\n // The space around the dialog is padding on this wrapper, not on the scroll container:\n // browsers leave a scroll container's own bottom padding out of what it scrolls, which\n // would leave the dialog flush with the bottom of the window.\n const scrollingPanel = (\n <div className=\"flex min-h-full items-start justify-center px-4 py-[8vmin]\">{panel}</div>\n );\n\n return (\n <DialogPortal>\n <ShadeScope>\n {scroll === 'overlay' ? (\n modal ? (\n // The dialog sits inside the backdrop here, so the backdrop animates as long as the\n // dialog does; otherwise closing unmounts the dialog part-way through its animation.\n <DialogOverlay className=\"overflow-y-auto duration-200\">{scrollingPanel}</DialogOverlay>\n ) : (\n // Radix renders no backdrop for a non-modal dialog, and the page behind stays\n // usable, so this scroll container lets presses beside the dialog through.\n <div\n className=\"pointer-events-none fixed inset-0 z-50 overflow-y-auto\"\n data-slot=\"dialog-scroller\"\n >\n {scrollingPanel}\n </div>\n )\n ) : (\n <>\n <DialogOverlay />\n {panel}\n </>\n )}\n </ShadeScope>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2 [&_button]:min-w-20',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-xl leading-none font-semibold tracking-tight in-data-[admin7-design=true]:font-title',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;AAOA,IAAM,qBAAqB,QAAM,cAAc,IAAI;AAEnD,IAAM,UAAU,EAAE,QAAQ,MAAM,GAAG,YACjC,oBAAC,mBAAmB,UAApB;CAA6B,OAAO;WAClC,oBAAC,gBAAgB,MAAjB;EAA6B;EAAO,GAAI;CAAQ,CAAA;AACrB,CAAA;AAG/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,yLACA,SACF;CACA,aAAU;CACV,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAGpD,IAAM,uBACJ;AAcF,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,UAAU,SAAS,SAAS,GAAG,SAAS,QAAQ;CAC9D,MAAM,QAAQ,QAAM,WAAW,kBAAkB;CAEjD,MAAM,QACJ,oBAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,WAAW,YACP,4CACA,iEACJ,sBACA,SACF;EACA,GAAI;EAEH;CACsB,CAAA;CAM3B,MAAM,iBACJ,oBAAC,OAAD;EAAK,WAAU;YAA8D;CAAW,CAAA;CAG1F,OACE,oBAAC,cAAD,EAAA,UACE,oBAAC,YAAD,EAAA,UACG,WAAW,YACV,QAGE,oBAAC,eAAD;EAAe,WAAU;YAAgC;CAA8B,CAAA,IAIvF,oBAAC,OAAD;EACE,WAAU;EACV,aAAU;YAET;CACE,CAAA,IAGP,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GACf,KACD,EAAA,CAAA,EAEM,CAAA,EACA,CAAA;AAElB,CAAC;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,aAAa,cAAc;AAE3B,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CACE,WAAW,GACT,8FACA,SACF;CACA,GAAI;AACL,CAAA;AAEH,aAAa,cAAc;AAE3B,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GACT,6FACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,aAAjB;CACO;CACL,WAAW,GAAG,yBAAyB,SAAS;CAChD,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
1
+ {"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\n// Radix keeps whether a dialog is modal to itself, and the overlay scroll layout needs to know.\nconst DialogModalContext = React.createContext(true);\n\nconst Dialog = ({ modal = true, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => (\n <DialogModalContext.Provider value={modal}>\n <DialogPrimitive.Root modal={modal} {...props} />\n </DialogModalContext.Provider>\n);\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n data-slot=\"dialog-overlay\"\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n// The panel itself, shared by both ways a dialog can sit on the page.\nconst dialogPanelClassName =\n 'z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg outline-hidden duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95';\n\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n> {\n /**\n * How a dialog taller than the window scrolls. `fixed` (the default) pins the dialog near\n * the top of the window, so it needs its own height limit and inner scroll. `overlay` makes\n * the backdrop the scroll container instead: the whole dialog scrolls as one piece, the way\n * a page does.\n */\n scroll?: 'fixed' | 'overlay';\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, scroll = 'fixed', ...props }, ref) => {\n const modal = React.useContext(DialogModalContext);\n\n const panel = (\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n scroll === 'overlay'\n ? 'pointer-events-auto relative rounded-lg'\n : 'fixed top-[8vmin] left-[50%] translate-x-[-50%] sm:rounded-lg',\n dialogPanelClassName,\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n\n // The space around the dialog is padding on this wrapper, not on the scroll container:\n // browsers leave a scroll container's own bottom padding out of what it scrolls, which\n // would leave the dialog flush with the bottom of the window.\n const scrollingPanel = (\n <div className=\"flex min-h-full items-start justify-center px-4 py-[8vmin]\">{panel}</div>\n );\n\n return (\n <DialogPortal>\n <ShadeScope>\n {scroll === 'overlay' ? (\n modal ? (\n // The dialog sits inside the backdrop here, so the backdrop animates as long as the\n // dialog does; otherwise closing unmounts the dialog part-way through its animation.\n <DialogOverlay className=\"overflow-y-auto duration-200\">{scrollingPanel}</DialogOverlay>\n ) : (\n // Radix renders no backdrop for a non-modal dialog, and the page behind stays\n // usable, so this scroll container lets presses beside the dialog through.\n <div\n className=\"pointer-events-none fixed inset-0 z-50 overflow-y-auto\"\n data-slot=\"dialog-scroller\"\n >\n {scrollingPanel}\n </div>\n )\n ) : (\n <>\n <DialogOverlay />\n {panel}\n </>\n )}\n </ShadeScope>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-xl leading-none font-semibold tracking-tight in-data-[admin7-design=true]:font-title',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;AAOA,IAAM,qBAAqB,QAAM,cAAc,IAAI;AAEnD,IAAM,UAAU,EAAE,QAAQ,MAAM,GAAG,YACjC,oBAAC,mBAAmB,UAApB;CAA6B,OAAO;WAClC,oBAAC,gBAAgB,MAAjB;EAA6B;EAAO,GAAI;CAAQ,CAAA;AACrB,CAAA;AAG/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,yLACA,SACF;CACA,aAAU;CACV,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAGpD,IAAM,uBACJ;AAcF,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,UAAU,SAAS,SAAS,GAAG,SAAS,QAAQ;CAC9D,MAAM,QAAQ,QAAM,WAAW,kBAAkB;CAEjD,MAAM,QACJ,oBAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,WAAW,YACP,4CACA,iEACJ,sBACA,SACF;EACA,GAAI;EAEH;CACsB,CAAA;CAM3B,MAAM,iBACJ,oBAAC,OAAD;EAAK,WAAU;YAA8D;CAAW,CAAA;CAG1F,OACE,oBAAC,cAAD,EAAA,UACE,oBAAC,YAAD,EAAA,UACG,WAAW,YACV,QAGE,oBAAC,eAAD;EAAe,WAAU;YAAgC;CAA8B,CAAA,IAIvF,oBAAC,OAAD;EACE,WAAU;EACV,aAAU;YAET;CACE,CAAA,IAGP,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GACf,KACD,EAAA,CAAA,EAEM,CAAA,EACA,CAAA;AAElB,CAAC;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,aAAa,cAAc;AAE3B,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CACE,WAAW,GACT,0EACA,SACF;CACA,GAAI;AACL,CAAA;AAEH,aAAa,cAAc;AAE3B,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GACT,6FACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,aAAjB;CACO;CACL,WAAW,GAAG,yBAAyB,SAAS;CAChD,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
@@ -4,16 +4,34 @@ import { inputSurface } from "./input-surface.js";
4
4
  import { cva } from "class-variance-authority";
5
5
  //#region src/components/ui/dropzone-variants.ts
6
6
  var dropzoneBaseVariants = cva("flex cursor-pointer flex-col items-center justify-center outline-hidden", {
7
- variants: { variant: {
8
- default: cn(inputSurface("self"), "border-2 border-dashed bg-transparent p-10 hover:border-border-strong"),
9
- filled: cn(inputSurface("self"), "border-transparent bg-muted p-3 hover:bg-interactive-hover"),
10
- button: "flex-row",
11
- buttonSecondary: "flex-row"
12
- } },
7
+ variants: {
8
+ variant: {
9
+ default: cn(inputSurface("self"), "border-2 border-dashed bg-transparent p-10 hover:border-border-strong"),
10
+ filled: cn(inputSurface("self"), "border-transparent bg-muted p-3 hover:bg-interactive-hover"),
11
+ button: "flex-row",
12
+ buttonSecondary: "flex-row"
13
+ },
14
+ admin7Design: {
15
+ true: "",
16
+ false: ""
17
+ }
18
+ },
19
+ compoundVariants: [{
20
+ variant: ["default", "filled"],
21
+ admin7Design: true,
22
+ className: "text-muted-foreground [&_svg.lucide]:stroke-[1.25px]"
23
+ }, {
24
+ variant: "default",
25
+ admin7Design: true,
26
+ className: "border"
27
+ }],
13
28
  defaultVariants: { variant: "default" }
14
29
  });
15
- function dropzoneVariants(props = {}, shape = "pill") {
16
- return cn(dropzoneBaseVariants(props), props.variant === "button" && buttonVariants({
30
+ function dropzoneVariants(props = {}, shape = "pill", admin7Design = true) {
31
+ return cn(dropzoneBaseVariants({
32
+ variant: props.variant,
33
+ admin7Design
34
+ }), props.class, props.variant === "button" && buttonVariants({
17
35
  shape,
18
36
  variant: "outline"
19
37
  }), props.variant === "buttonSecondary" && buttonVariants({
@@ -1 +1 @@
1
- {"version":3,"file":"dropzone-variants.js","names":[],"sources":["../../../src/components/ui/dropzone-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\nimport type { ControlShape } from '@/providers/shade-context';\n\nconst dropzoneBaseVariants = cva(\n 'flex cursor-pointer flex-col items-center justify-center outline-hidden',\n {\n variants: {\n variant: {\n default: cn(\n inputSurface('self'),\n 'border-2 border-dashed bg-transparent p-10 hover:border-border-strong',\n ),\n filled: cn(\n inputSurface('self'),\n 'border-transparent bg-muted p-3 hover:bg-interactive-hover',\n ),\n button: 'flex-row',\n buttonSecondary: 'flex-row',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\n// Keep the exported variants function useful outside the component, with current defaults.\nfunction dropzoneVariants(\n props: Parameters<typeof dropzoneBaseVariants>[0] = {},\n shape: ControlShape = 'pill',\n) {\n return cn(\n dropzoneBaseVariants(props),\n props.variant === 'button' && buttonVariants({ shape, variant: 'outline' }),\n props.variant === 'buttonSecondary' &&\n buttonVariants({ shape, size: 'sm', variant: 'secondary' }),\n props.className,\n );\n}\n\nexport { dropzoneVariants };\n"],"mappings":";;;;;AAMA,IAAM,uBAAuB,IAC3B,2EACA;CACE,UAAU,EACR,SAAS;EACP,SAAS,GACP,aAAa,MAAM,GACnB,uEACF;EACA,QAAQ,GACN,aAAa,MAAM,GACnB,4DACF;EACA,QAAQ;EACR,iBAAiB;CACnB,EACF;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAGA,SAAS,iBACP,QAAoD,CAAC,GACrD,QAAsB,QACtB;CACA,OAAO,GACL,qBAAqB,KAAK,GAC1B,MAAM,YAAY,YAAY,eAAe;EAAE;EAAO,SAAS;CAAU,CAAC,GAC1E,MAAM,YAAY,qBAChB,eAAe;EAAE;EAAO,MAAM;EAAM,SAAS;CAAY,CAAC,GAC5D,MAAM,SACR;AACF"}
1
+ {"version":3,"file":"dropzone-variants.js","names":[],"sources":["../../../src/components/ui/dropzone-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\nimport type { ControlShape } from '@/providers/shade-context';\n\nconst dropzoneBaseVariants = cva(\n 'flex cursor-pointer flex-col items-center justify-center outline-hidden',\n {\n variants: {\n variant: {\n default: cn(\n inputSurface('self'),\n 'border-2 border-dashed bg-transparent p-10 hover:border-border-strong',\n ),\n filled: cn(\n inputSurface('self'),\n 'border-transparent bg-muted p-3 hover:bg-interactive-hover',\n ),\n button: 'flex-row',\n buttonSecondary: 'flex-row',\n },\n admin7Design: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: ['default', 'filled'],\n admin7Design: true,\n className: 'text-muted-foreground [&_svg.lucide]:stroke-[1.25px]',\n },\n { variant: 'default', admin7Design: true, className: 'border' },\n ],\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\n// Keep the exported variants function useful outside the component, with current defaults.\nfunction dropzoneVariants(\n props: Omit<NonNullable<Parameters<typeof dropzoneBaseVariants>[0]>, 'admin7Design'> = {},\n shape: ControlShape = 'pill',\n admin7Design = true,\n) {\n return cn(\n dropzoneBaseVariants({ variant: props.variant, admin7Design }),\n props.class,\n props.variant === 'button' && buttonVariants({ shape, variant: 'outline' }),\n props.variant === 'buttonSecondary' &&\n buttonVariants({ shape, size: 'sm', variant: 'secondary' }),\n props.className,\n );\n}\n\nexport { dropzoneVariants };\n"],"mappings":";;;;;AAMA,IAAM,uBAAuB,IAC3B,2EACA;CACE,UAAU;EACR,SAAS;GACP,SAAS,GACP,aAAa,MAAM,GACnB,uEACF;GACA,QAAQ,GACN,aAAa,MAAM,GACnB,4DACF;GACA,QAAQ;GACR,iBAAiB;EACnB;EACA,cAAc;GACZ,MAAM;GACN,OAAO;EACT;CACF;CACA,kBAAkB,CAChB;EACE,SAAS,CAAC,WAAW,QAAQ;EAC7B,cAAc;EACd,WAAW;CACb,GACA;EAAE,SAAS;EAAW,cAAc;EAAM,WAAW;CAAS,CAChE;CACA,iBAAiB,EACf,SAAS,UACX;AACF,CACF;AAGA,SAAS,iBACP,QAAuF,CAAC,GACxF,QAAsB,QACtB,eAAe,MACf;CACA,OAAO,GACL,qBAAqB;EAAE,SAAS,MAAM;EAAS;CAAa,CAAC,GAC7D,MAAM,OACN,MAAM,YAAY,YAAY,eAAe;EAAE;EAAO,SAAS;CAAU,CAAC,GAC1E,MAAM,YAAY,qBAChB,eAAe;EAAE;EAAO,MAAM;EAAM,SAAS;CAAY,CAAC,GAC5D,MAAM,SACR;AACF"}
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { useDropzone } from "react-dropzone";
7
7
  //#region src/components/ui/dropzone.tsx
8
8
  var Dropzone = React$1.forwardRef(({ accept, multiple = false, maxFiles = multiple ? 0 : 1, disabled = false, noDragEventsBubbling = false, inputId, inputAriaLabel, inputTestId, onDropAccepted, onDropRejected, variant, className, children, ...props }, ref) => {
9
- const { controlShape } = useShade();
9
+ const { controlShape, admin7Design } = useShade();
10
10
  const { getRootProps, getInputProps, rootRef, isDragActive, isDragAccept, isDragReject, isFocused, isFileDialogActive, open } = useDropzone({
11
11
  accept,
12
12
  multiple,
@@ -35,7 +35,7 @@ var Dropzone = React$1.forwardRef(({ accept, multiple = false, maxFiles = multip
35
35
  tabIndex: disabled ? -1 : 0,
36
36
  "aria-disabled": disabled,
37
37
  "aria-invalid": isDragReject || void 0,
38
- className: cn(dropzoneVariants({ variant }, controlShape), disabled && "pointer-events-none cursor-not-allowed opacity-60", isDragReject && "border-state-danger bg-state-danger/10", isDragActive && !isDragReject && !disabled && "border-state-success bg-state-success/10", className)
38
+ className: cn(dropzoneVariants({ variant }, controlShape, admin7Design), disabled && "pointer-events-none cursor-not-allowed opacity-60", isDragReject && "border-state-danger bg-state-danger/10", isDragActive && !isDragReject && !disabled && "border-state-success bg-state-success/10", className)
39
39
  });
40
40
  return /* @__PURE__ */ jsxs("div", {
41
41
  ref: setRootRefs,
@@ -1 +1 @@
1
- {"version":3,"file":"dropzone.js","names":[],"sources":["../../../src/components/ui/dropzone.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Accept, DropEvent, FileRejection, useDropzone } from 'react-dropzone';\nimport { type VariantProps } from 'class-variance-authority';\nimport { dropzoneVariants } from '@/components/ui/dropzone-variants';\nimport { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\n\ntype DropzoneRenderProps = {\n isDragActive: boolean;\n isDragAccept: boolean;\n isDragReject: boolean;\n isFocused: boolean;\n isFileDialogActive: boolean;\n open: () => void;\n};\n\nexport interface DropzoneProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof dropzoneVariants> {\n accept?: Accept;\n multiple?: boolean;\n maxFiles?: number;\n disabled?: boolean;\n noDragEventsBubbling?: boolean;\n inputId?: string;\n inputAriaLabel?: string;\n inputTestId?: string;\n onDropAccepted?: (files: File[], event: DropEvent) => void;\n onDropRejected?: (fileRejections: FileRejection[], event: DropEvent) => void;\n children?: React.ReactNode | ((props: DropzoneRenderProps) => React.ReactNode);\n}\n\nexport const Dropzone = React.forwardRef<HTMLDivElement, DropzoneProps>(\n (\n {\n accept,\n multiple = false,\n maxFiles = multiple ? 0 : 1,\n disabled = false,\n noDragEventsBubbling = false,\n inputId,\n inputAriaLabel,\n inputTestId,\n onDropAccepted,\n onDropRejected,\n variant,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const { controlShape } = useShade();\n const {\n getRootProps,\n getInputProps,\n rootRef,\n isDragActive,\n isDragAccept,\n isDragReject,\n isFocused,\n isFileDialogActive,\n open,\n } = useDropzone({\n accept,\n multiple,\n maxFiles,\n disabled,\n noDragEventsBubbling,\n onDropAccepted,\n onDropRejected,\n });\n\n const content =\n typeof children === 'function'\n ? children({\n isDragActive,\n isDragAccept,\n isDragReject,\n isFocused,\n isFileDialogActive,\n open,\n })\n : children;\n\n const setRootRefs = (element: HTMLDivElement | null) => {\n (rootRef as React.MutableRefObject<HTMLDivElement | null>).current = element;\n\n if (typeof ref === 'function') {\n ref(element);\n } else if (ref) {\n ref.current = element;\n }\n };\n\n const dropzoneRootProps = getRootProps({\n ...props,\n role: 'button',\n tabIndex: disabled ? -1 : 0,\n 'aria-disabled': disabled,\n 'aria-invalid': isDragReject || undefined,\n className: cn(\n dropzoneVariants({ variant }, controlShape),\n disabled && 'pointer-events-none cursor-not-allowed opacity-60',\n isDragReject && 'border-state-danger bg-state-danger/10',\n isDragActive && !isDragReject && !disabled && 'border-state-success bg-state-success/10',\n className,\n ),\n }) as React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> };\n\n // Destructure out the ref from getRootProps — we use setRootRefs instead\n const { ref: _, ...rootProps } = dropzoneRootProps; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n return (\n <div ref={setRootRefs} {...rootProps}>\n <input\n {...getInputProps()}\n aria-label={inputAriaLabel}\n data-testid={inputTestId}\n id={inputId}\n />\n {content}\n </div>\n );\n },\n);\n\nDropzone.displayName = 'Dropzone';\n"],"mappings":";;;;;;;AAiCA,IAAa,WAAW,QAAM,YAE1B,EACE,QACA,WAAW,OACX,WAAW,WAAW,IAAI,GAC1B,WAAW,OACX,uBAAuB,OACvB,SACA,gBACA,aACA,gBACA,gBACA,SACA,WACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,EACJ,cACA,eACA,SACA,cACA,cACA,cACA,WACA,oBACA,SACE,YAAY;EACd;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,UACJ,OAAO,aAAa,aAChB,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,IACD;CAEN,MAAM,eAAe,YAAmC;EACtD,QAA2D,UAAU;EAErE,IAAI,OAAO,QAAQ,YACjB,IAAI,OAAO;OACN,IAAI,KACT,IAAI,UAAU;CAElB;CAkBA,MAAM,EAAE,KAAK,GAAG,GAAG,cAhBO,aAAa;EACrC,GAAG;EACH,MAAM;EACN,UAAU,WAAW,KAAK;EAC1B,iBAAiB;EACjB,gBAAgB,gBAAgB,KAAA;EAChC,WAAW,GACT,iBAAiB,EAAE,QAAQ,GAAG,YAAY,GAC1C,YAAY,qDACZ,gBAAgB,0CAChB,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,4CAC9C,SACF;CACF,CAGiC;CAEjC,OACE,qBAAC,OAAD;EAAK,KAAK;EAAa,GAAI;YAA3B,CACE,oBAAC,SAAD;GACE,GAAI,cAAc;GAClB,cAAY;GACZ,eAAa;GACb,IAAI;EACL,CAAA,GACA,OACE;;AAET,CACF;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"dropzone.js","names":[],"sources":["../../../src/components/ui/dropzone.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Accept, DropEvent, FileRejection, useDropzone } from 'react-dropzone';\nimport { type VariantProps } from 'class-variance-authority';\nimport { dropzoneVariants } from '@/components/ui/dropzone-variants';\nimport { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\n\ntype DropzoneRenderProps = {\n isDragActive: boolean;\n isDragAccept: boolean;\n isDragReject: boolean;\n isFocused: boolean;\n isFileDialogActive: boolean;\n open: () => void;\n};\n\nexport interface DropzoneProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof dropzoneVariants> {\n accept?: Accept;\n multiple?: boolean;\n maxFiles?: number;\n disabled?: boolean;\n noDragEventsBubbling?: boolean;\n inputId?: string;\n inputAriaLabel?: string;\n inputTestId?: string;\n onDropAccepted?: (files: File[], event: DropEvent) => void;\n onDropRejected?: (fileRejections: FileRejection[], event: DropEvent) => void;\n children?: React.ReactNode | ((props: DropzoneRenderProps) => React.ReactNode);\n}\n\nexport const Dropzone = React.forwardRef<HTMLDivElement, DropzoneProps>(\n (\n {\n accept,\n multiple = false,\n maxFiles = multiple ? 0 : 1,\n disabled = false,\n noDragEventsBubbling = false,\n inputId,\n inputAriaLabel,\n inputTestId,\n onDropAccepted,\n onDropRejected,\n variant,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const { controlShape, admin7Design } = useShade();\n const {\n getRootProps,\n getInputProps,\n rootRef,\n isDragActive,\n isDragAccept,\n isDragReject,\n isFocused,\n isFileDialogActive,\n open,\n } = useDropzone({\n accept,\n multiple,\n maxFiles,\n disabled,\n noDragEventsBubbling,\n onDropAccepted,\n onDropRejected,\n });\n\n const content =\n typeof children === 'function'\n ? children({\n isDragActive,\n isDragAccept,\n isDragReject,\n isFocused,\n isFileDialogActive,\n open,\n })\n : children;\n\n const setRootRefs = (element: HTMLDivElement | null) => {\n (rootRef as React.MutableRefObject<HTMLDivElement | null>).current = element;\n\n if (typeof ref === 'function') {\n ref(element);\n } else if (ref) {\n ref.current = element;\n }\n };\n\n const dropzoneRootProps = getRootProps({\n ...props,\n role: 'button',\n tabIndex: disabled ? -1 : 0,\n 'aria-disabled': disabled,\n 'aria-invalid': isDragReject || undefined,\n className: cn(\n dropzoneVariants({ variant }, controlShape, admin7Design),\n disabled && 'pointer-events-none cursor-not-allowed opacity-60',\n isDragReject && 'border-state-danger bg-state-danger/10',\n isDragActive && !isDragReject && !disabled && 'border-state-success bg-state-success/10',\n className,\n ),\n }) as React.HTMLAttributes<HTMLDivElement> & { ref?: React.Ref<HTMLDivElement> };\n\n // Destructure out the ref from getRootProps — we use setRootRefs instead\n const { ref: _, ...rootProps } = dropzoneRootProps; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n return (\n <div ref={setRootRefs} {...rootProps}>\n <input\n {...getInputProps()}\n aria-label={inputAriaLabel}\n data-testid={inputTestId}\n id={inputId}\n />\n {content}\n </div>\n );\n },\n);\n\nDropzone.displayName = 'Dropzone';\n"],"mappings":";;;;;;;AAiCA,IAAa,WAAW,QAAM,YAE1B,EACE,QACA,WAAW,OACX,WAAW,WAAW,IAAI,GAC1B,WAAW,OACX,uBAAuB,OACvB,SACA,gBACA,aACA,gBACA,gBACA,SACA,WACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,cAAc,iBAAiB,SAAS;CAChD,MAAM,EACJ,cACA,eACA,SACA,cACA,cACA,cACA,WACA,oBACA,SACE,YAAY;EACd;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,UACJ,OAAO,aAAa,aAChB,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,IACD;CAEN,MAAM,eAAe,YAAmC;EACtD,QAA2D,UAAU;EAErE,IAAI,OAAO,QAAQ,YACjB,IAAI,OAAO;OACN,IAAI,KACT,IAAI,UAAU;CAElB;CAkBA,MAAM,EAAE,KAAK,GAAG,GAAG,cAhBO,aAAa;EACrC,GAAG;EACH,MAAM;EACN,UAAU,WAAW,KAAK;EAC1B,iBAAiB;EACjB,gBAAgB,gBAAgB,KAAA;EAChC,WAAW,GACT,iBAAiB,EAAE,QAAQ,GAAG,cAAc,YAAY,GACxD,YAAY,qDACZ,gBAAgB,0CAChB,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,4CAC9C,SACF;CACF,CAGiC;CAEjC,OACE,qBAAC,OAAD;EAAK,KAAK;EAAa,GAAI;YAA3B,CACE,oBAAC,SAAD;GACE,GAAI,cAAc;GAClB,cAAY;GACZ,eAAa;GACb,IAAI;EACL,CAAA,GACA,OACE;;AAET,CACF;AAEA,SAAS,cAAc"}
@@ -3,7 +3,7 @@ import { cn } from "../../lib/ds-utils.js";
3
3
  /**
4
4
  * Shared visual recipe for input-like surfaces (Input, Textarea, InputGroup, Select trigger).
5
5
  *
6
- * The recipe owns: border, background, radius, transition, focus ring, invalid state.
6
+ * The recipe owns: border, background, radius, shadow, transition, focus ring, invalid state.
7
7
  * Consumers add their own size, padding, typography, and component-specific tweaks.
8
8
  *
9
9
  * `inputSurface()` covers the two common shapes:
@@ -33,7 +33,7 @@ import { cn } from "../../lib/ds-utils.js";
33
33
  * )} />
34
34
  */
35
35
  var inputSurfaceClasses = {
36
- base: "rounded-field border border-field-border bg-field-surface transition-colors",
36
+ base: "rounded-field border border-field-border bg-field-surface shadow-field transition-colors",
37
37
  focusSelf: "focus-visible:outline-hidden focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/25",
38
38
  focusWithin: "has-[:focus-visible]:outline-hidden has-[:focus-visible]:border-focus-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus-ring/25",
39
39
  invalidSelf: "aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40",
@@ -1 +1 @@
1
- {"version":3,"file":"input-surface.js","names":[],"sources":["../../../src/components/ui/input-surface.ts"],"sourcesContent":["import { cn } from '@/lib/utils';\n\n/**\n * Shared visual recipe for input-like surfaces (Input, Textarea, InputGroup, Select trigger).\n *\n * The recipe owns: border, background, radius, transition, focus ring, invalid state.\n * Consumers add their own size, padding, typography, and component-specific tweaks.\n *\n * `inputSurface()` covers the two common shapes:\n * - `'self'` — apply directly to the focusable element (e.g. <input>, <textarea>, <button>).\n * - `'within'` — apply to a wrapper that contains a focusable child; focus and invalid\n * styles are derived from any focusable descendant via `:has()`.\n *\n * For unusual cases (e.g. a wrapper that should only react to a specific control element,\n * not any focusable descendant) compose `inputSurfaceClasses` atoms manually.\n *\n * @example\n * // Direct on a focusable element\n * <input className={cn(inputSurface('self'), 'h-9 px-3 ...')} />\n *\n * // Wrapper with any focused descendant driving focus state\n * <div className={cn(inputSurface('within'), 'flex h-9 items-center ...')}>\n * <input ... />\n * </div>\n *\n * // Custom scope: only one specific child triggers focus state. Compose from atoms\n * // so Tailwind can statically detect the literal class string.\n * <div className={cn(\n * inputSurfaceClasses.base,\n * inputSurfaceClasses.invalidWithin,\n * // literal class string for Tailwind JIT to pick up\n * 'has-[[data-slot=control]:focus-visible]:border-focus-ring ...'\n * )} />\n */\nexport const inputSurfaceClasses = {\n base: 'rounded-field border border-field-border bg-field-surface transition-colors',\n focusSelf:\n 'focus-visible:outline-hidden focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/25',\n focusWithin:\n 'has-[:focus-visible]:outline-hidden has-[:focus-visible]:border-focus-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus-ring/25',\n invalidSelf:\n 'aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40',\n invalidWithin:\n 'has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 dark:has-[[aria-invalid=true]]:ring-destructive/40',\n disabledSelf: 'disabled:cursor-not-allowed disabled:opacity-50',\n disabledFieldSelf:\n 'disabled:bg-field-disabled-surface disabled:text-muted-foreground disabled:opacity-100 disabled:hover:bg-field-disabled-surface',\n} as const;\n\nexport function inputSurface(mode: 'self' | 'within' = 'self') {\n if (mode === 'self') {\n return cn(\n inputSurfaceClasses.base,\n inputSurfaceClasses.focusSelf,\n inputSurfaceClasses.invalidSelf,\n inputSurfaceClasses.disabledSelf,\n );\n }\n return cn(\n inputSurfaceClasses.base,\n inputSurfaceClasses.focusWithin,\n inputSurfaceClasses.invalidWithin,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,sBAAsB;CACjC,MAAM;CACN,WACE;CACF,aACE;CACF,aACE;CACF,eACE;CACF,cAAc;CACd,mBACE;AACJ;AAEA,SAAgB,aAAa,OAA0B,QAAQ;CAC7D,IAAI,SAAS,QACX,OAAO,GACL,oBAAoB,MACpB,oBAAoB,WACpB,oBAAoB,aACpB,oBAAoB,YACtB;CAEF,OAAO,GACL,oBAAoB,MACpB,oBAAoB,aACpB,oBAAoB,aACtB;AACF"}
1
+ {"version":3,"file":"input-surface.js","names":[],"sources":["../../../src/components/ui/input-surface.ts"],"sourcesContent":["import { cn } from '@/lib/utils';\n\n/**\n * Shared visual recipe for input-like surfaces (Input, Textarea, InputGroup, Select trigger).\n *\n * The recipe owns: border, background, radius, shadow, transition, focus ring, invalid state.\n * Consumers add their own size, padding, typography, and component-specific tweaks.\n *\n * `inputSurface()` covers the two common shapes:\n * - `'self'` — apply directly to the focusable element (e.g. <input>, <textarea>, <button>).\n * - `'within'` — apply to a wrapper that contains a focusable child; focus and invalid\n * styles are derived from any focusable descendant via `:has()`.\n *\n * For unusual cases (e.g. a wrapper that should only react to a specific control element,\n * not any focusable descendant) compose `inputSurfaceClasses` atoms manually.\n *\n * @example\n * // Direct on a focusable element\n * <input className={cn(inputSurface('self'), 'h-9 px-3 ...')} />\n *\n * // Wrapper with any focused descendant driving focus state\n * <div className={cn(inputSurface('within'), 'flex h-9 items-center ...')}>\n * <input ... />\n * </div>\n *\n * // Custom scope: only one specific child triggers focus state. Compose from atoms\n * // so Tailwind can statically detect the literal class string.\n * <div className={cn(\n * inputSurfaceClasses.base,\n * inputSurfaceClasses.invalidWithin,\n * // literal class string for Tailwind JIT to pick up\n * 'has-[[data-slot=control]:focus-visible]:border-focus-ring ...'\n * )} />\n */\nexport const inputSurfaceClasses = {\n base: 'rounded-field border border-field-border bg-field-surface shadow-field transition-colors',\n focusSelf:\n 'focus-visible:outline-hidden focus-visible:border-focus-ring focus-visible:ring-2 focus-visible:ring-focus-ring/25',\n focusWithin:\n 'has-[:focus-visible]:outline-hidden has-[:focus-visible]:border-focus-ring has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-focus-ring/25',\n invalidSelf:\n 'aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/20 dark:aria-[invalid=true]:ring-destructive/40',\n invalidWithin:\n 'has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 dark:has-[[aria-invalid=true]]:ring-destructive/40',\n disabledSelf: 'disabled:cursor-not-allowed disabled:opacity-50',\n disabledFieldSelf:\n 'disabled:bg-field-disabled-surface disabled:text-muted-foreground disabled:opacity-100 disabled:hover:bg-field-disabled-surface',\n} as const;\n\nexport function inputSurface(mode: 'self' | 'within' = 'self') {\n if (mode === 'self') {\n return cn(\n inputSurfaceClasses.base,\n inputSurfaceClasses.focusSelf,\n inputSurfaceClasses.invalidSelf,\n inputSurfaceClasses.disabledSelf,\n );\n }\n return cn(\n inputSurfaceClasses.base,\n inputSurfaceClasses.focusWithin,\n inputSurfaceClasses.invalidWithin,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,sBAAsB;CACjC,MAAM;CACN,WACE;CACF,aACE;CACF,aACE;CACF,eACE;CACF,cAAc;CACd,mBACE;AACJ;AAEA,SAAgB,aAAa,OAA0B,QAAQ;CAC7D,IAAI,SAAS,QACX,OAAO,GACL,oBAAoB,MACpB,oBAAoB,WACpB,oBAAoB,aACpB,oBAAoB,YACtB;CAEF,OAAO,GACL,oBAAoB,MACpB,oBAAoB,aACpB,oBAAoB,aACtB;AACF"}
@@ -1,19 +1,25 @@
1
1
  import { cn } from "../../lib/ds-utils.js";
2
+ import { useShade } from "../../providers/shade-context.js";
2
3
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "./dropdown-menu.js";
3
4
  import { Button } from "./button.js";
5
+ import { tabSurfaceVariants } from "./tabs-variants.js";
4
6
  import { MoreHorizontal } from "lucide-react";
5
7
  import * as React$1 from "react";
6
8
  import { jsx, jsxs } from "react/jsx-runtime";
7
9
  //#region src/components/ui/pagemenu.tsx
8
10
  var PageMenuContext = React$1.createContext(null);
9
11
  var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaultValue, onValueChange, className, ...props }, ref) => {
12
+ const { admin7Design } = useShade();
10
13
  const [visibleCount, setVisibleCount] = React$1.useState(React$1.Children.count(children));
11
14
  const [resizeKey, setResizeKey] = React$1.useState(0);
12
15
  const containerRef = React$1.useRef(null);
13
16
  const measureRef = React$1.useRef(null);
17
+ const overflowTriggerRef = React$1.useRef(null);
14
18
  const [uncontrolledValue, setUncontrolledValue] = React$1.useState(defaultValue);
15
19
  const isControlled = value !== void 0;
16
20
  const activeValue = isControlled ? value : uncontrolledValue;
21
+ const measuredActiveValue = admin7Design ? activeValue : void 0;
22
+ const measuredVisibleCount = admin7Design ? visibleCount : void 0;
17
23
  const handleSelect = React$1.useCallback((nextValue) => {
18
24
  if (nextValue === activeValue) return;
19
25
  if (!isControlled) setUncontrolledValue(nextValue);
@@ -37,8 +43,8 @@ var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaul
37
43
  const container = containerRef.current;
38
44
  const measureContainer = measureRef.current;
39
45
  const containerWidth = container.clientWidth;
40
- const dropdownWidth = 60;
41
- const gap = 6;
46
+ const dropdownWidth = admin7Design ? overflowTriggerRef.current?.getBoundingClientRect().width || 60 : 60;
47
+ const gap = admin7Design ? Number.parseFloat(getComputedStyle(container).columnGap) || 0 : 6;
42
48
  const items = Array.from(measureContainer.children);
43
49
  let totalWidth = 0;
44
50
  for (let i = 0; i < items.length; i++) {
@@ -54,7 +60,7 @@ var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaul
54
60
  for (let i = 0; i < items.length; i++) {
55
61
  const itemWidth = items[i].getBoundingClientRect().width;
56
62
  const newWidth = currentWidth + (i > 0 ? gap : 0) + itemWidth;
57
- if (newWidth + dropdownWidth <= containerWidth) {
63
+ if (newWidth + (admin7Design ? gap : 0) + dropdownWidth <= containerWidth) {
58
64
  currentWidth = newWidth;
59
65
  count += 1;
60
66
  } else break;
@@ -65,7 +71,10 @@ var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaul
65
71
  }, [
66
72
  responsive,
67
73
  children,
68
- resizeKey
74
+ resizeKey,
75
+ admin7Design,
76
+ measuredActiveValue,
77
+ measuredVisibleCount
69
78
  ]);
70
79
  React$1.useLayoutEffect(() => {
71
80
  if (!responsive || !containerRef.current) return;
@@ -111,7 +120,9 @@ var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaul
111
120
  }), hasOverflow && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
112
121
  asChild: true,
113
122
  children: /* @__PURE__ */ jsx(Button, {
114
- className: cn("h-[30px] flex-shrink-0 px-3 py-2", selectedHiddenItem && "bg-accent text-accent-foreground"),
123
+ ref: overflowTriggerRef,
124
+ className: cn("h-[30px] flex-shrink-0 px-3 py-2", admin7Design ? tabSurfaceVariants({ admin7Design }) : selectedHiddenItem && "bg-accent text-accent-foreground"),
125
+ ...admin7Design ? { "data-state": selectedHiddenItem ? "active" : void 0 } : {},
115
126
  variant: "ghost",
116
127
  children: selectedHiddenItem ? /* @__PURE__ */ jsx("span", {
117
128
  className: "max-w-[100px] truncate",
@@ -140,11 +151,12 @@ var PageMenu = React$1.forwardRef(({ children, responsive = false, value, defaul
140
151
  PageMenu.displayName = "PageMenu";
141
152
  var PageMenuItem = React$1.forwardRef(({ children, value, className, onClick, ...props }, ref) => {
142
153
  const pageMenu = React$1.useContext(PageMenuContext);
154
+ const { admin7Design } = useShade();
143
155
  const isActive = pageMenu?.value === value;
144
156
  return /* @__PURE__ */ jsx(Button, {
145
157
  ref,
146
158
  "aria-current": isActive ? "page" : void 0,
147
- className: cn("relative gap-1.5 px-3 text-control font-medium text-text-secondary hover:text-foreground focus-visible:ring-0", "data-[state=active]:bg-muted-foreground/10 data-[state=active]:text-foreground", "dark:hover:bg-tab-hover dark:data-[state=active]:bg-tab-active dark:data-[state=active]:hover:bg-tab-active", className),
159
+ className: cn("relative gap-1.5 px-3 text-control font-medium", admin7Design ? tabSurfaceVariants({ admin7Design }) : "text-text-secondary hover:text-foreground focus-visible:ring-0 data-[state=active]:bg-muted-foreground/10 data-[state=active]:text-foreground dark:hover:bg-tab-hover dark:data-[state=active]:bg-tab-active dark:data-[state=active]:hover:bg-tab-active", className),
148
160
  "data-state": isActive ? "active" : void 0,
149
161
  variant: "ghost",
150
162
  onClick: (event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"pagemenu.js","names":[],"sources":["../../../src/components/ui/pagemenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { MoreHorizontal } from 'lucide-react';\nimport { Button, type ButtonProps } from './button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from './dropdown-menu';\n\ninterface PageMenuContextValue {\n value?: string;\n onSelect: (value: string) => void;\n}\n\nconst PageMenuContext = React.createContext<PageMenuContextValue | null>(null);\n\nexport interface PageMenuProps {\n children: React.ReactNode;\n responsive?: boolean;\n /** The active item's value. Pass with `onValueChange` to control the menu, e.g. from the current route. */\n value?: string;\n /** The item active on first render when the menu manages its own selection. */\n defaultValue?: string;\n /** Called with the item's value when the user picks a different item. */\n onValueChange?: (value: string) => void;\n className?: string;\n}\n\nexport interface PageMenuItemProps extends Omit<ButtonProps, 'children'> {\n value: string;\n children: React.ReactNode;\n}\n\nconst PageMenu = React.forwardRef<HTMLDivElement, PageMenuProps>(\n (\n { children, responsive = false, value, defaultValue, onValueChange, className, ...props },\n ref,\n ) => {\n const [visibleCount, setVisibleCount] = React.useState(React.Children.count(children));\n const [resizeKey, setResizeKey] = React.useState(0);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const measureRef = React.useRef<HTMLDivElement>(null);\n\n // Controlled when `value` is passed, otherwise tracks its own selection\n // starting from `defaultValue` (same contract as Radix Tabs).\n const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);\n const isControlled = value !== undefined;\n const activeValue = isControlled ? value : uncontrolledValue;\n\n const handleSelect = React.useCallback(\n (nextValue: string) => {\n if (nextValue === activeValue) {\n return;\n }\n if (!isControlled) {\n setUncontrolledValue(nextValue);\n }\n onValueChange?.(nextValue);\n },\n [activeValue, isControlled, onValueChange],\n );\n\n const contextValue = React.useMemo(\n () => ({ value: activeValue, onSelect: handleSelect }),\n [activeValue, handleSelect],\n );\n\n React.useLayoutEffect(() => {\n if (!responsive || !containerRef.current || !measureRef.current) {\n setVisibleCount(React.Children.count(children));\n return;\n }\n\n // Use requestAnimationFrame to ensure DOM is fully rendered\n const calculateSizes = () => {\n if (!containerRef.current || !measureRef.current) {\n return;\n }\n\n const container = containerRef.current;\n const measureContainer = measureRef.current;\n const containerWidth = container.clientWidth;\n const dropdownWidth = 60; // Space needed for dropdown button\n const gap = 6; // Gap between items (gap-1.5)\n\n // Get all child elements from the measure container\n const items = Array.from(measureContainer.children) as HTMLElement[];\n\n // First, check if ALL items fit without any dropdown\n let totalWidth = 0;\n for (let i = 0; i < items.length; i++) {\n const itemWidth = items[i].getBoundingClientRect().width;\n const gapWidth = i > 0 ? gap : 0;\n totalWidth += gapWidth + itemWidth;\n }\n\n // If all items fit with some buffer space, show them all\n const safetyBuffer = 8; // Add 8px buffer for safe rendering\n if (totalWidth <= containerWidth - safetyBuffer) {\n setVisibleCount(items.length);\n return;\n }\n\n // Otherwise, calculate how many fit with dropdown space reserved\n let currentWidth = 0;\n let count = 0;\n\n for (let i = 0; i < items.length; i++) {\n const itemWidth = items[i].getBoundingClientRect().width;\n const gapWidth = i > 0 ? gap : 0;\n const newWidth = currentWidth + gapWidth + itemWidth;\n\n // Reserve space for dropdown (since we know not all items fit)\n const totalNeededWidth = newWidth + dropdownWidth;\n\n if (totalNeededWidth <= containerWidth) {\n currentWidth = newWidth;\n count += 1;\n } else {\n break;\n }\n }\n\n setVisibleCount(count);\n };\n\n requestAnimationFrame(calculateSizes);\n }, [responsive, children, resizeKey]);\n\n React.useLayoutEffect(() => {\n if (!responsive || !containerRef.current) {\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n // Trigger re-calculation by updating the resize key\n setResizeKey((prev) => prev + 1);\n });\n\n resizeObserver.observe(containerRef.current);\n return () => resizeObserver.disconnect();\n }, [responsive]);\n\n const childrenArray = React.Children.toArray(children);\n const visibleItems = childrenArray.slice(0, visibleCount);\n const hiddenItems = childrenArray.slice(visibleCount);\n const hasOverflow = hiddenItems.length > 0;\n\n // Find selected hidden item\n const selectedHiddenItem = hiddenItems.find(\n (child) => React.isValidElement(child) && child.props?.value === activeValue,\n ) as React.ReactElement | undefined;\n\n if (!responsive) {\n return (\n <PageMenuContext.Provider value={contextValue}>\n <div ref={ref} className={cn('flex items-center gap-2', className)} {...props}>\n {children}\n </div>\n </PageMenuContext.Provider>\n );\n }\n\n return (\n <PageMenuContext.Provider value={contextValue}>\n {/* Hidden container to measure all items */}\n <div\n ref={measureRef}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute flex items-center gap-2 opacity-0\"\n style={{ top: -9999, left: -9999 }}\n >\n {children}\n </div>\n\n {/* Visible container */}\n <div ref={containerRef} className=\"flex w-full min-w-0 flex-1 items-center gap-2\">\n <div ref={ref} className={cn('flex min-w-0 items-center gap-2', className)} {...props}>\n {visibleItems}\n </div>\n\n {hasOverflow && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className={cn(\n 'h-[30px] flex-shrink-0 px-3 py-2',\n selectedHiddenItem && 'bg-accent text-accent-foreground',\n )}\n variant=\"ghost\"\n >\n {selectedHiddenItem ? (\n <span className=\"max-w-[100px] truncate\">\n {selectedHiddenItem.props.children}\n </span>\n ) : (\n <MoreHorizontal className=\"size-6\" />\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {hiddenItems.map((item, index) => {\n if (!React.isValidElement(item) || !item.props?.value) {\n return null;\n }\n\n return (\n <DropdownMenuItem\n key={item.props.value || index}\n className={cn(\n item.props.value === activeValue && 'bg-accent text-accent-foreground',\n )}\n disabled={item.props.disabled}\n onClick={(event) => {\n // Radix still fires onClick on disabled items and relies on CSS to block pointer clicks\n if (item.props.disabled) {\n return;\n }\n item.props.onClick?.(event);\n if (!event.defaultPrevented) {\n handleSelect(item.props.value);\n }\n }}\n >\n {item.props.children}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </PageMenuContext.Provider>\n );\n },\n);\n\nPageMenu.displayName = 'PageMenu';\n\nconst PageMenuItem = React.forwardRef<HTMLButtonElement, PageMenuItemProps>(\n ({ children, value, className, onClick, ...props }, ref) => {\n const pageMenu = React.useContext(PageMenuContext);\n const isActive = pageMenu?.value === value;\n\n return (\n <Button\n ref={ref}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n 'relative gap-1.5 px-3 text-control font-medium text-text-secondary hover:text-foreground focus-visible:ring-0',\n 'data-[state=active]:bg-muted-foreground/10 data-[state=active]:text-foreground',\n 'dark:hover:bg-tab-hover dark:data-[state=active]:bg-tab-active dark:data-[state=active]:hover:bg-tab-active',\n className,\n )}\n data-state={isActive ? 'active' : undefined}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n pageMenu?.onSelect(value);\n }\n }}\n {...props}\n >\n {children}\n </Button>\n );\n },\n);\n\nPageMenuItem.displayName = 'PageMenuItem';\n\nexport { PageMenu, PageMenuItem };\n"],"mappings":";;;;;;;AAgBA,IAAM,kBAAkB,QAAM,cAA2C,IAAI;AAmB7E,IAAM,WAAW,QAAM,YAEnB,EAAE,UAAU,aAAa,OAAO,OAAO,cAAc,eAAe,WAAW,GAAG,SAClF,QACG;CACH,MA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Z,CACF;AAEA,aAAa,cAAc"}
1
+ {"version":3,"file":"pagemenu.js","names":[],"sources":["../../../src/components/ui/pagemenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { MoreHorizontal } from 'lucide-react';\nimport { useShade } from '@/providers/shade-context';\nimport { tabSurfaceVariants } from '@/components/ui/tabs-variants';\nimport { Button, type ButtonProps } from './button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from './dropdown-menu';\n\ninterface PageMenuContextValue {\n value?: string;\n onSelect: (value: string) => void;\n}\n\nconst PageMenuContext = React.createContext<PageMenuContextValue | null>(null);\n\nexport interface PageMenuProps {\n children: React.ReactNode;\n responsive?: boolean;\n /** The active item's value. Pass with `onValueChange` to control the menu, e.g. from the current route. */\n value?: string;\n /** The item active on first render when the menu manages its own selection. */\n defaultValue?: string;\n /** Called with the item's value when the user picks a different item. */\n onValueChange?: (value: string) => void;\n className?: string;\n}\n\nexport interface PageMenuItemProps extends Omit<ButtonProps, 'children'> {\n value: string;\n children: React.ReactNode;\n}\n\nconst PageMenu = React.forwardRef<HTMLDivElement, PageMenuProps>(\n (\n { children, responsive = false, value, defaultValue, onValueChange, className, ...props },\n ref,\n ) => {\n const { admin7Design } = useShade();\n const [visibleCount, setVisibleCount] = React.useState(React.Children.count(children));\n const [resizeKey, setResizeKey] = React.useState(0);\n const containerRef = React.useRef<HTMLDivElement>(null);\n const measureRef = React.useRef<HTMLDivElement>(null);\n const overflowTriggerRef = React.useRef<HTMLButtonElement>(null);\n\n // Controlled when `value` is passed, otherwise tracks its own selection\n // starting from `defaultValue` (same contract as Radix Tabs).\n const [uncontrolledValue, setUncontrolledValue] = React.useState(defaultValue);\n const isControlled = value !== undefined;\n const activeValue = isControlled ? value : uncontrolledValue;\n const measuredActiveValue = admin7Design ? activeValue : undefined;\n const measuredVisibleCount = admin7Design ? visibleCount : undefined;\n\n const handleSelect = React.useCallback(\n (nextValue: string) => {\n if (nextValue === activeValue) {\n return;\n }\n if (!isControlled) {\n setUncontrolledValue(nextValue);\n }\n onValueChange?.(nextValue);\n },\n [activeValue, isControlled, onValueChange],\n );\n\n const contextValue = React.useMemo(\n () => ({ value: activeValue, onSelect: handleSelect }),\n [activeValue, handleSelect],\n );\n\n React.useLayoutEffect(() => {\n if (!responsive || !containerRef.current || !measureRef.current) {\n setVisibleCount(React.Children.count(children));\n return;\n }\n\n // Use requestAnimationFrame to ensure DOM is fully rendered\n const calculateSizes = () => {\n if (!containerRef.current || !measureRef.current) {\n return;\n }\n\n const container = containerRef.current;\n const measureContainer = measureRef.current;\n const containerWidth = container.clientWidth;\n const dropdownWidth = admin7Design\n ? overflowTriggerRef.current?.getBoundingClientRect().width || 60\n : 60;\n const gap = admin7Design\n ? Number.parseFloat(getComputedStyle(container).columnGap) || 0\n : 6;\n\n // Get all child elements from the measure container\n const items = Array.from(measureContainer.children) as HTMLElement[];\n\n // First, check if ALL items fit without any dropdown\n let totalWidth = 0;\n for (let i = 0; i < items.length; i++) {\n const itemWidth = items[i].getBoundingClientRect().width;\n const gapWidth = i > 0 ? gap : 0;\n totalWidth += gapWidth + itemWidth;\n }\n\n // If all items fit with some buffer space, show them all\n const safetyBuffer = 8; // Add 8px buffer for safe rendering\n if (totalWidth <= containerWidth - safetyBuffer) {\n setVisibleCount(items.length);\n return;\n }\n\n // Otherwise, calculate how many fit with dropdown space reserved\n let currentWidth = 0;\n let count = 0;\n\n for (let i = 0; i < items.length; i++) {\n const itemWidth = items[i].getBoundingClientRect().width;\n const gapWidth = i > 0 ? gap : 0;\n const newWidth = currentWidth + gapWidth + itemWidth;\n\n // Reserve space for dropdown (since we know not all items fit)\n const totalNeededWidth = newWidth + (admin7Design ? gap : 0) + dropdownWidth;\n\n if (totalNeededWidth <= containerWidth) {\n currentWidth = newWidth;\n count += 1;\n } else {\n break;\n }\n }\n\n setVisibleCount(count);\n };\n\n requestAnimationFrame(calculateSizes);\n }, [responsive, children, resizeKey, admin7Design, measuredActiveValue, measuredVisibleCount]);\n\n React.useLayoutEffect(() => {\n if (!responsive || !containerRef.current) {\n return;\n }\n\n const resizeObserver = new ResizeObserver(() => {\n // Trigger re-calculation by updating the resize key\n setResizeKey((prev) => prev + 1);\n });\n\n resizeObserver.observe(containerRef.current);\n return () => resizeObserver.disconnect();\n }, [responsive]);\n\n const childrenArray = React.Children.toArray(children);\n const visibleItems = childrenArray.slice(0, visibleCount);\n const hiddenItems = childrenArray.slice(visibleCount);\n const hasOverflow = hiddenItems.length > 0;\n\n // Find selected hidden item\n const selectedHiddenItem = hiddenItems.find(\n (child) => React.isValidElement(child) && child.props?.value === activeValue,\n ) as React.ReactElement | undefined;\n\n if (!responsive) {\n return (\n <PageMenuContext.Provider value={contextValue}>\n <div ref={ref} className={cn('flex items-center gap-2', className)} {...props}>\n {children}\n </div>\n </PageMenuContext.Provider>\n );\n }\n\n return (\n <PageMenuContext.Provider value={contextValue}>\n {/* Hidden container to measure all items */}\n <div\n ref={measureRef}\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute flex items-center gap-2 opacity-0\"\n style={{ top: -9999, left: -9999 }}\n >\n {children}\n </div>\n\n {/* Visible container */}\n <div ref={containerRef} className=\"flex w-full min-w-0 flex-1 items-center gap-2\">\n <div ref={ref} className={cn('flex min-w-0 items-center gap-2', className)} {...props}>\n {visibleItems}\n </div>\n\n {hasOverflow && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n ref={overflowTriggerRef}\n className={cn(\n 'h-[30px] flex-shrink-0 px-3 py-2',\n admin7Design\n ? tabSurfaceVariants({ admin7Design })\n : selectedHiddenItem && 'bg-accent text-accent-foreground',\n )}\n {...(admin7Design\n ? { 'data-state': selectedHiddenItem ? 'active' : undefined }\n : {})}\n variant=\"ghost\"\n >\n {selectedHiddenItem ? (\n <span className=\"max-w-[100px] truncate\">\n {selectedHiddenItem.props.children}\n </span>\n ) : (\n <MoreHorizontal className=\"size-6\" />\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n {hiddenItems.map((item, index) => {\n if (!React.isValidElement(item) || !item.props?.value) {\n return null;\n }\n\n return (\n <DropdownMenuItem\n key={item.props.value || index}\n className={cn(\n item.props.value === activeValue && 'bg-accent text-accent-foreground',\n )}\n disabled={item.props.disabled}\n onClick={(event) => {\n // Radix still fires onClick on disabled items and relies on CSS to block pointer clicks\n if (item.props.disabled) {\n return;\n }\n item.props.onClick?.(event);\n if (!event.defaultPrevented) {\n handleSelect(item.props.value);\n }\n }}\n >\n {item.props.children}\n </DropdownMenuItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n </PageMenuContext.Provider>\n );\n },\n);\n\nPageMenu.displayName = 'PageMenu';\n\nconst PageMenuItem = React.forwardRef<HTMLButtonElement, PageMenuItemProps>(\n ({ children, value, className, onClick, ...props }, ref) => {\n const pageMenu = React.useContext(PageMenuContext);\n const { admin7Design } = useShade();\n const isActive = pageMenu?.value === value;\n\n return (\n <Button\n ref={ref}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n 'relative gap-1.5 px-3 text-control font-medium',\n admin7Design\n ? tabSurfaceVariants({ admin7Design })\n : 'text-text-secondary hover:text-foreground focus-visible:ring-0 data-[state=active]:bg-muted-foreground/10 data-[state=active]:text-foreground dark:hover:bg-tab-hover dark:data-[state=active]:bg-tab-active dark:data-[state=active]:hover:bg-tab-active',\n className,\n )}\n data-state={isActive ? 'active' : undefined}\n variant=\"ghost\"\n onClick={(event) => {\n onClick?.(event);\n if (!event.defaultPrevented) {\n pageMenu?.onSelect(value);\n }\n }}\n {...props}\n >\n {children}\n </Button>\n );\n },\n);\n\nPageMenuItem.displayName = 'PageMenuItem';\n\nexport { PageMenu, PageMenuItem };\n"],"mappings":";;;;;;;;;AAkBA,IAAM,kBAAkB,QAAM,cAA2C,IAAI;AAmB7E,IAAM,WAAW,QAAM,YAEnB,EAAE,UAAU,aAAa,OAAO,OAAO,cAAc,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CAAA,CAEb;IACmB;;AAE9B,CACF;AAEA,SAAS,cAAc;AAEvB,IAAM,eAAe,QAAM,YACxB,EAAE,UAAU,OAAO,WAAW,SAAS,GAAG,SAAS,QAAQ;CAC1D,MAAM,WAAW,QAAM,WAAW,eAAe;CACjD,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,WAAW,UAAU,UAAU;CAErC,OACE,oBAAC,QAAD;EACO;EACL,gBAAc,WAAW,SAAS,KAAA;EAClC,WAAW,GACT,kDACA,eACI,mBAAmB,EAAE,aAAa,CAAC,IACnC,6PACJ,SACF;EACA,cAAY,WAAW,WAAW,KAAA;EAClC,SAAQ;EACR,UAAU,UAAU;GAClB,UAAU,KAAK;GACf,IAAI,CAAC,MAAM,kBACT,UAAU,SAAS,KAAK;EAE5B;EACA,GAAI;EAEH;CACK,CAAA;AAEZ,CACF;AAEA,aAAa,cAAc"}
@@ -1,9 +1,9 @@
1
1
  import { useIsMobile } from "../../hooks/use-mobile.js";
2
2
  import { cn } from "../../lib/ds-utils.js";
3
3
  import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
4
+ import { Skeleton } from "./skeleton.js";
4
5
  import { Button } from "./button.js";
5
6
  import { Input } from "./input.js";
6
- import { Skeleton } from "./skeleton.js";
7
7
  import { Separator } from "./separator.js";
8
8
  import { Sheet, SheetContent } from "./sheet.js";
9
9
  import { SidebarContext, useSidebar } from "./sidebar-context.js";
@@ -1,5 +1,27 @@
1
1
  import { cva } from "class-variance-authority";
2
2
  //#region src/components/ui/tabs-variants.ts
3
+ var tabSurfaceVariants = cva("", {
4
+ variants: {
5
+ admin7Design: {
6
+ true: "rounded-full bg-tab-inactive text-foreground hover:bg-tab-inactive-hover hover:text-foreground enabled:active:bg-tab-inactive-hover enabled:aria-expanded:bg-tab-inactive-hover enabled:aria-expanded:text-foreground data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:hover:bg-primary data-[state=active]:hover:text-primary-foreground data-[state=active]:enabled:active:bg-primary data-[state=active]:enabled:aria-expanded:bg-primary data-[state=active]:enabled:aria-expanded:text-primary-foreground",
7
+ false: ""
8
+ },
9
+ size: {
10
+ default: "",
11
+ compact: ""
12
+ }
13
+ },
14
+ compoundVariants: [{
15
+ admin7Design: true,
16
+ size: "default",
17
+ className: "px-4"
18
+ }, {
19
+ admin7Design: true,
20
+ size: "compact",
21
+ className: "px-3"
22
+ }],
23
+ defaultVariants: { size: "default" }
24
+ });
3
25
  var tabsVariants = cva("", {
4
26
  variants: { variant: {
5
27
  segmented: "",
@@ -14,6 +36,6 @@ var tabsVariants = cva("", {
14
36
  defaultVariants: { variant: "segmented" }
15
37
  });
16
38
  //#endregion
17
- export { tabsVariants };
39
+ export { tabSurfaceVariants, tabsVariants };
18
40
 
19
41
  //# sourceMappingURL=tabs-variants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-variants.js","names":[],"sources":["../../../src/components/ui/tabs-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst tabsVariants = cva('', {\n variants: {\n variant: {\n segmented: '',\n 'segmented-sm': '',\n button: '',\n 'button-sm': '',\n underline: '',\n navbar: '',\n pill: '',\n kpis: '',\n },\n },\n defaultVariants: {\n variant: 'segmented',\n },\n});\n\nexport { tabsVariants };\n"],"mappings":";;AAEA,IAAM,eAAe,IAAI,IAAI;CAC3B,UAAU,EACR,SAAS;EACP,WAAW;EACX,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,WAAW;EACX,QAAQ;EACR,MAAM;EACN,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,YACX;AACF,CAAC"}
1
+ {"version":3,"file":"tabs-variants.js","names":[],"sources":["../../../src/components/ui/tabs-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n// Shared by panel tabs and route-based PageMenu navigation.\nconst tabSurfaceVariants = cva('', {\n variants: {\n admin7Design: {\n true: 'rounded-full bg-tab-inactive text-foreground hover:bg-tab-inactive-hover hover:text-foreground enabled:active:bg-tab-inactive-hover enabled:aria-expanded:bg-tab-inactive-hover enabled:aria-expanded:text-foreground data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:hover:bg-primary data-[state=active]:hover:text-primary-foreground data-[state=active]:enabled:active:bg-primary data-[state=active]:enabled:aria-expanded:bg-primary data-[state=active]:enabled:aria-expanded:text-primary-foreground',\n false: '',\n },\n size: {\n default: '',\n compact: '',\n },\n },\n compoundVariants: [\n { admin7Design: true, size: 'default', className: 'px-4' },\n { admin7Design: true, size: 'compact', className: 'px-3' },\n ],\n defaultVariants: { size: 'default' },\n});\n\nconst tabsVariants = cva('', {\n variants: {\n variant: {\n segmented: '',\n 'segmented-sm': '',\n button: '',\n 'button-sm': '',\n underline: '',\n navbar: '',\n pill: '',\n kpis: '',\n },\n },\n defaultVariants: {\n variant: 'segmented',\n },\n});\n\nexport { tabsVariants, tabSurfaceVariants };\n"],"mappings":";;AAGA,IAAM,qBAAqB,IAAI,IAAI;CACjC,UAAU;EACR,cAAc;GACZ,MAAM;GACN,OAAO;EACT;EACA,MAAM;GACJ,SAAS;GACT,SAAS;EACX;CACF;CACA,kBAAkB,CAChB;EAAE,cAAc;EAAM,MAAM;EAAW,WAAW;CAAO,GACzD;EAAE,cAAc;EAAM,MAAM;EAAW,WAAW;CAAO,CAC3D;CACA,iBAAiB,EAAE,MAAM,UAAU;AACrC,CAAC;AAED,IAAM,eAAe,IAAI,IAAI;CAC3B,UAAU,EACR,SAAS;EACP,WAAW;EACX,gBAAgB;EAChB,QAAQ;EACR,aAAa;EACb,WAAW;EACX,QAAQ;EACR,MAAM;EACN,MAAM;CACR,EACF;CACA,iBAAiB,EACf,SAAS,YACX;AACF,CAAC"}