@tryghost/shade 0.1.0-alpha.16 → 0.1.0-alpha.18

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 (123) hide show
  1. package/es/components/patterns/filter-bar.js +4 -6
  2. package/es/components/patterns/filter-bar.js.map +1 -1
  3. package/es/components/patterns/filters.js +14 -17
  4. package/es/components/patterns/filters.js.map +1 -1
  5. package/es/components/patterns/gh-chart.js +4 -2
  6. package/es/components/patterns/gh-chart.js.map +1 -1
  7. package/es/components/patterns/image-upload.js +1 -3
  8. package/es/components/patterns/image-upload.js.map +1 -1
  9. package/es/components/patterns/page-header.js +16 -42
  10. package/es/components/patterns/page-header.js.map +1 -1
  11. package/es/components/patterns/share-modal.js +3 -15
  12. package/es/components/patterns/share-modal.js.map +1 -1
  13. package/es/components/ui/alert-dialog.js +2 -4
  14. package/es/components/ui/alert-dialog.js.map +1 -1
  15. package/es/components/ui/avatar.js +8 -4
  16. package/es/components/ui/avatar.js.map +1 -1
  17. package/es/components/ui/badge-variants.js +1 -1
  18. package/es/components/ui/badge-variants.js.map +1 -1
  19. package/es/components/ui/banner-variants.js +4 -4
  20. package/es/components/ui/banner-variants.js.map +1 -1
  21. package/es/components/ui/button-variants.js +2 -33
  22. package/es/components/ui/button-variants.js.map +1 -1
  23. package/es/components/ui/button.js +1 -2
  24. package/es/components/ui/button.js.map +1 -1
  25. package/es/components/ui/calendar.js +1 -3
  26. package/es/components/ui/calendar.js.map +1 -1
  27. package/es/components/ui/copy-field.js +1 -3
  28. package/es/components/ui/copy-field.js.map +1 -1
  29. package/es/components/ui/data-list.js +1 -3
  30. package/es/components/ui/data-list.js.map +1 -1
  31. package/es/components/ui/dropzone-variants.js +1 -3
  32. package/es/components/ui/dropzone-variants.js.map +1 -1
  33. package/es/components/ui/dropzone.js +2 -2
  34. package/es/components/ui/dropzone.js.map +1 -1
  35. package/es/components/ui/floating-sidebar.js +4 -4
  36. package/es/components/ui/floating-sidebar.js.map +1 -1
  37. package/es/components/ui/image-overlay-button.js +2 -2
  38. package/es/components/ui/image-overlay-button.js.map +1 -1
  39. package/es/components/ui/input-group.js +2 -5
  40. package/es/components/ui/input-group.js.map +1 -1
  41. package/es/components/ui/navbar.js +1 -3
  42. package/es/components/ui/navbar.js.map +1 -1
  43. package/es/components/ui/select-variants.js +2 -10
  44. package/es/components/ui/select-variants.js.map +1 -1
  45. package/es/components/ui/select.js +1 -4
  46. package/es/components/ui/select.js.map +1 -1
  47. package/es/components/ui/simple-pagination.js +4 -7
  48. package/es/components/ui/simple-pagination.js.map +1 -1
  49. package/es/components/ui/sticky-footer.js +1 -1
  50. package/es/components/ui/sticky-footer.js.map +1 -1
  51. package/es/components/ui/toggle-group.js +1 -3
  52. package/es/components/ui/toggle-group.js.map +1 -1
  53. package/es/components/ui/toggle-variants.js +1 -7
  54. package/es/components/ui/toggle-variants.js.map +1 -1
  55. package/es/components/ui/toggle.js +1 -2
  56. package/es/components/ui/toggle.js.map +1 -1
  57. package/es/components/ui/tooltip.js +8 -17
  58. package/es/components/ui/tooltip.js.map +1 -1
  59. package/es/lib/ds-utils.js +17 -3
  60. package/es/lib/ds-utils.js.map +1 -1
  61. package/es/lib/utils.js +2 -2
  62. package/es/providers/header-tooltip-provider.js +1 -4
  63. package/es/providers/header-tooltip-provider.js.map +1 -1
  64. package/es/providers/shade-context.js +1 -1
  65. package/es/providers/shade-context.js.map +1 -1
  66. package/es/providers/shade-provider.js +3 -3
  67. package/es/providers/shade-provider.js.map +1 -1
  68. package/es/shade-app.js +3 -3
  69. package/es/shade-app.js.map +1 -1
  70. package/es/shade-scope.js +2 -2
  71. package/es/shade-scope.js.map +1 -1
  72. package/es/tokens.js +0 -8
  73. package/es/tokens.js.map +1 -1
  74. package/es/utils.js +2 -2
  75. package/package.json +1 -1
  76. package/tailwind.theme.css +201 -187
  77. package/theme-variables.css +289 -42
  78. package/types/components/patterns/filter-bar.d.ts.map +1 -1
  79. package/types/components/patterns/filters.d.ts +1 -4
  80. package/types/components/patterns/filters.d.ts.map +1 -1
  81. package/types/components/patterns/gh-chart.d.ts.map +1 -1
  82. package/types/components/patterns/image-upload.d.ts.map +1 -1
  83. package/types/components/patterns/page-header.d.ts +4 -10
  84. package/types/components/patterns/page-header.d.ts.map +1 -1
  85. package/types/components/patterns/share-modal.d.ts.map +1 -1
  86. package/types/components/ui/avatar.d.ts.map +1 -1
  87. package/types/components/ui/button-variants.d.ts +0 -1
  88. package/types/components/ui/button-variants.d.ts.map +1 -1
  89. package/types/components/ui/button.d.ts +1 -1
  90. package/types/components/ui/button.d.ts.map +1 -1
  91. package/types/components/ui/copy-field.d.ts.map +1 -1
  92. package/types/components/ui/data-list.d.ts.map +1 -1
  93. package/types/components/ui/dropzone-variants.d.ts +1 -1
  94. package/types/components/ui/dropzone-variants.d.ts.map +1 -1
  95. package/types/components/ui/image-overlay-button.d.ts +1 -1
  96. package/types/components/ui/image-overlay-button.d.ts.map +1 -1
  97. package/types/components/ui/input-group.d.ts.map +1 -1
  98. package/types/components/ui/navbar.d.ts.map +1 -1
  99. package/types/components/ui/select-variants.d.ts +0 -1
  100. package/types/components/ui/select-variants.d.ts.map +1 -1
  101. package/types/components/ui/select.d.ts +1 -1
  102. package/types/components/ui/select.d.ts.map +1 -1
  103. package/types/components/ui/simple-pagination.d.ts.map +1 -1
  104. package/types/components/ui/toggle-group.d.ts +4 -6
  105. package/types/components/ui/toggle-group.d.ts.map +1 -1
  106. package/types/components/ui/toggle-variants.d.ts +0 -1
  107. package/types/components/ui/toggle-variants.d.ts.map +1 -1
  108. package/types/components/ui/toggle.d.ts +2 -3
  109. package/types/components/ui/toggle.d.ts.map +1 -1
  110. package/types/components/ui/tooltip.d.ts.map +1 -1
  111. package/types/lib/ds-utils.d.ts +2 -0
  112. package/types/lib/ds-utils.d.ts.map +1 -1
  113. package/types/providers/header-tooltip-provider.d.ts.map +1 -1
  114. package/types/providers/shade-context.d.ts +2 -1
  115. package/types/providers/shade-context.d.ts.map +1 -1
  116. package/types/providers/shade-provider.d.ts +1 -1
  117. package/types/providers/shade-provider.d.ts.map +1 -1
  118. package/types/shade-app.d.ts +5 -2
  119. package/types/shade-app.d.ts.map +1 -1
  120. package/types/tokens.d.ts +1 -1
  121. package/types/tokens.d.ts.map +1 -1
  122. package/types/utils.d.ts +1 -1
  123. package/types/utils.d.ts.map +1 -1
@@ -1,4 +1,5 @@
1
- import { cn, stringToHslColor } from "../../lib/ds-utils.js";
1
+ import { cn, stringToHslColor, stringToTonalAvatarClasses } from "../../lib/ds-utils.js";
2
+ import { useShade } from "../../providers/shade-context.js";
2
3
  import { User } from "lucide-react";
3
4
  import * as React$1 from "react";
4
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -32,15 +33,18 @@ function ValidatedAvatarImage({ src }) {
32
33
  });
33
34
  }
34
35
  var Avatar = React$1.forwardRef(({ className, children, src, initials, colorSeed, ...props }, ref) => {
36
+ const { admin7Design } = useShade();
35
37
  const hasInitials = !!initials;
36
- const bgColor = hasInitials ? stringToHslColor(colorSeed || initials, "45", "55") : void 0;
38
+ const seed = colorSeed || initials || "";
39
+ const tonal = hasInitials && admin7Design;
40
+ const bgColor = hasInitials && !tonal ? stringToHslColor(seed, "45", "55") : void 0;
37
41
  return /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
38
42
  ref,
39
43
  className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
40
44
  ...props,
41
45
  children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(AvatarFallback, {
42
- className: cn("text-xs text-muted-foreground md:text-sm [&_svg]:size-3 md:[&_svg]:size-4", hasInitials && "font-semibold text-white"),
43
- style: hasInitials ? { backgroundColor: bgColor } : void 0,
46
+ className: cn("text-xs text-muted-foreground md:text-sm [&_svg]:size-3 md:[&_svg]:size-4", hasInitials && "font-semibold", hasInitials && (tonal ? stringToTonalAvatarClasses(seed) : "text-white")),
47
+ style: bgColor ? { backgroundColor: bgColor } : void 0,
44
48
  children: initials ?? /* @__PURE__ */ jsx(User, {})
45
49
  }), src && /* @__PURE__ */ jsx(ValidatedAvatarImage, { src })] })
46
50
  });
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","names":[],"sources":["../../../src/components/ui/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { User } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { stringToHslColor } from '@/lib/ds-utils';\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn('aspect-square size-full', className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n 'flex size-full items-center justify-center rounded-full bg-muted [&_svg]:size-4',\n className,\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\n// Gravatar's `d=blank` parameter returns a 1×1 transparent PNG when no avatar\n// exists for the given email. The HTTP response is 200, so Radix's AvatarImage\n// would treat it as a valid image and hide the fallback. We render the image\n// ourselves and only reveal it once it loads with non-trivial dimensions.\nfunction ValidatedAvatarImage({ src }: { src: string }) {\n const [loaded, setLoaded] = React.useState(false);\n\n React.useEffect(() => {\n setLoaded(false);\n }, [src]);\n\n return (\n <img\n alt=\"\"\n className={cn('absolute inset-0 size-full object-cover', !loaded && 'invisible')}\n src={src}\n onLoad={(e) => {\n const { naturalWidth, naturalHeight } = e.currentTarget;\n if (naturalWidth > 1 && naturalHeight > 1) {\n setLoaded(true);\n }\n }}\n />\n );\n}\n\ninterface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {\n src?: string | null;\n initials?: string | null;\n /**\n * Seeds the fallback background hue. Defaults to the initials, but callers\n * should pass the richer identity string they derived the initials from\n * (name/email) so distinct people keep distinct hues.\n */\n colorSeed?: string | null;\n}\n\nconst Avatar = React.forwardRef<React.ElementRef<typeof AvatarPrimitive.Root>, AvatarProps>(\n ({ className, children, src, initials, colorSeed, ...props }, ref) => {\n const hasInitials = !!initials;\n const bgColor = hasInitials ? stringToHslColor(colorSeed || initials, '45', '55') : undefined;\n\n return (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className)}\n {...props}\n >\n {children ?? (\n <>\n <AvatarFallback\n className={cn(\n 'text-xs text-muted-foreground md:text-sm [&_svg]:size-3 md:[&_svg]:size-4',\n hasInitials && 'font-semibold text-white',\n )}\n style={hasInitials ? { backgroundColor: bgColor } : undefined}\n >\n {initials ?? <User />}\n </AvatarFallback>\n {src && <ValidatedAvatarImage src={src} />}\n </>\n )}\n </AvatarPrimitive.Root>\n );\n },\n);\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback };\n"],"mappings":";;;;;;AAOA,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GAAG,2BAA2B,SAAS;CAClD,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,iBAAiB,QAAM,YAG1B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,UAAjB;CACO;CACL,WAAW,GACT,mFACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,eAAe,cAAc,gBAAgB,SAAS;AAMtD,SAAS,qBAAqB,EAAE,OAAwB;CACtD,MAAM,CAAC,QAAQ,aAAa,QAAM,SAAS,KAAK;CAEhD,QAAM,gBAAgB;EACpB,UAAU,KAAK;CACjB,GAAG,CAAC,GAAG,CAAC;CAER,OACE,oBAAC,OAAD;EACE,KAAI;EACJ,WAAW,GAAG,2CAA2C,CAAC,UAAU,WAAW;EAC1E;EACL,SAAS,MAAM;GACb,MAAM,EAAE,cAAc,kBAAkB,EAAE;GAC1C,IAAI,eAAe,KAAK,gBAAgB,GACtC,UAAU,IAAI;EAElB;CACD,CAAA;AAEL;AAaA,IAAM,SAAS,QAAM,YAClB,EAAE,WAAW,UAAU,KAAK,UAAU,WAAW,GAAG,SAAS,QAAQ;CACpE,MAAM,cAAc,CAAC,CAAC;CACtB,MAAM,UAAU,cAAc,iBAAiB,aAAa,UAAU,MAAM,IAAI,IAAI,KAAA;CAEpF,OACE,oBAAC,gBAAgB,MAAjB;EACO;EACL,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;YAEH,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,gBAAD;GACE,WAAW,GACT,6EACA,eAAe,0BACjB;GACA,OAAO,cAAc,EAAE,iBAAiB,QAAQ,IAAI,KAAA;aAEnD,YAAY,oBAAC,MAAD,CAAO,CAAA;EACN,CAAA,GACf,OAAO,oBAAC,sBAAD,EAA2B,IAAM,CAAA,CACzC,EAAA,CAAA;CAEgB,CAAA;AAE1B,CACF;AACA,OAAO,cAAc,gBAAgB,KAAK"}
1
+ {"version":3,"file":"avatar.js","names":[],"sources":["../../../src/components/ui/avatar.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport { User } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { stringToHslColor, stringToTonalAvatarClasses } from '@/lib/ds-utils';\nimport { useShade } from '@/providers/shade-context';\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn('aspect-square size-full', className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n 'flex size-full items-center justify-center rounded-full bg-muted [&_svg]:size-4',\n className,\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\n// Gravatar's `d=blank` parameter returns a 1×1 transparent PNG when no avatar\n// exists for the given email. The HTTP response is 200, so Radix's AvatarImage\n// would treat it as a valid image and hide the fallback. We render the image\n// ourselves and only reveal it once it loads with non-trivial dimensions.\nfunction ValidatedAvatarImage({ src }: { src: string }) {\n const [loaded, setLoaded] = React.useState(false);\n\n React.useEffect(() => {\n setLoaded(false);\n }, [src]);\n\n return (\n <img\n alt=\"\"\n className={cn('absolute inset-0 size-full object-cover', !loaded && 'invisible')}\n src={src}\n onLoad={(e) => {\n const { naturalWidth, naturalHeight } = e.currentTarget;\n if (naturalWidth > 1 && naturalHeight > 1) {\n setLoaded(true);\n }\n }}\n />\n );\n}\n\ninterface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {\n src?: string | null;\n initials?: string | null;\n /**\n * Seeds the fallback background hue. Defaults to the initials, but callers\n * should pass the richer identity string they derived the initials from\n * (name/email) so distinct people keep distinct hues.\n */\n colorSeed?: string | null;\n}\n\nconst Avatar = React.forwardRef<React.ElementRef<typeof AvatarPrimitive.Root>, AvatarProps>(\n ({ className, children, src, initials, colorSeed, ...props }, ref) => {\n const { admin7Design } = useShade();\n const hasInitials = !!initials;\n const seed = colorSeed || initials || '';\n const tonal = hasInitials && admin7Design;\n const bgColor = hasInitials && !tonal ? stringToHslColor(seed, '45', '55') : undefined;\n\n return (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn('relative flex size-8 shrink-0 overflow-hidden rounded-full', className)}\n {...props}\n >\n {children ?? (\n <>\n <AvatarFallback\n className={cn(\n 'text-xs text-muted-foreground md:text-sm [&_svg]:size-3 md:[&_svg]:size-4',\n hasInitials && 'font-semibold',\n hasInitials && (tonal ? stringToTonalAvatarClasses(seed) : 'text-white'),\n )}\n style={bgColor ? { backgroundColor: bgColor } : undefined}\n >\n {initials ?? <User />}\n </AvatarFallback>\n {src && <ValidatedAvatarImage src={src} />}\n </>\n )}\n </AvatarPrimitive.Root>\n );\n },\n);\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback };\n"],"mappings":";;;;;;;AAQA,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GAAG,2BAA2B,SAAS;CAClD,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,iBAAiB,QAAM,YAG1B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,UAAjB;CACO;CACL,WAAW,GACT,mFACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,eAAe,cAAc,gBAAgB,SAAS;AAMtD,SAAS,qBAAqB,EAAE,OAAwB;CACtD,MAAM,CAAC,QAAQ,aAAa,QAAM,SAAS,KAAK;CAEhD,QAAM,gBAAgB;EACpB,UAAU,KAAK;CACjB,GAAG,CAAC,GAAG,CAAC;CAER,OACE,oBAAC,OAAD;EACE,KAAI;EACJ,WAAW,GAAG,2CAA2C,CAAC,UAAU,WAAW;EAC1E;EACL,SAAS,MAAM;GACb,MAAM,EAAE,cAAc,kBAAkB,EAAE;GAC1C,IAAI,eAAe,KAAK,gBAAgB,GACtC,UAAU,IAAI;EAElB;CACD,CAAA;AAEL;AAaA,IAAM,SAAS,QAAM,YAClB,EAAE,WAAW,UAAU,KAAK,UAAU,WAAW,GAAG,SAAS,QAAQ;CACpE,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,cAAc,CAAC,CAAC;CACtB,MAAM,OAAO,aAAa,YAAY;CACtC,MAAM,QAAQ,eAAe;CAC7B,MAAM,UAAU,eAAe,CAAC,QAAQ,iBAAiB,MAAM,MAAM,IAAI,IAAI,KAAA;CAE7E,OACE,oBAAC,gBAAgB,MAAjB;EACO;EACL,WAAW,GAAG,8DAA8D,SAAS;EACrF,GAAI;YAEH,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,gBAAD;GACE,WAAW,GACT,6EACA,eAAe,iBACf,gBAAgB,QAAQ,2BAA2B,IAAI,IAAI,aAC7D;GACA,OAAO,UAAU,EAAE,iBAAiB,QAAQ,IAAI,KAAA;aAE/C,YAAY,oBAAC,MAAD,CAAO,CAAA;EACN,CAAA,GACf,OAAO,oBAAC,sBAAD,EAA2B,IAAM,CAAA,CACzC,EAAA,CAAA;CAEgB,CAAA;AAE1B,CACF;AACA,OAAO,cAAc,gBAAgB,KAAK"}
@@ -7,7 +7,7 @@ var badgeVariants = cva("inline-flex items-center border font-semibold tracking-
7
7
  secondary: "border-transparent bg-secondary text-secondary-foreground/70",
8
8
  destructive: "border-transparent bg-destructive/20 text-destructive",
9
9
  success: "border-transparent bg-green/20 text-green",
10
- warning: "border-transparent bg-state-warning/20 text-yellow-600",
10
+ warning: "border-transparent bg-badge-warning text-badge-warning-foreground",
11
11
  outline: "text-foreground"
12
12
  },
13
13
  size: {
@@ -1 +1 @@
1
- {"version":3,"file":"badge-variants.js","names":[],"sources":["../../../src/components/ui/badge-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst badgeVariants = cva(\n 'inline-flex items-center border font-semibold tracking-normal transition-colors focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:outline-hidden',\n {\n variants: {\n variant: {\n default: 'border-transparent bg-primary text-primary-foreground',\n secondary: 'border-transparent bg-secondary text-secondary-foreground/70',\n destructive: 'border-transparent bg-destructive/20 text-destructive',\n success: 'border-transparent bg-green/20 text-green',\n warning: 'border-transparent bg-state-warning/20 text-yellow-600',\n outline: 'text-foreground',\n },\n size: {\n default: 'h-4.5 px-1.5 text-xs',\n sm: 'h-5 px-2 text-sm',\n md: 'h-6 px-2.5 text-sm',\n },\n shape: {\n rounded: 'rounded-xs',\n pill: 'rounded-full',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n shape: 'pill',\n },\n },\n);\n\nexport { badgeVariants };\n"],"mappings":";;AAEA,IAAM,gBAAgB,IACpB,+JACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,aAAa;GACb,SAAS;GACT,SAAS;GACT,SAAS;EACX;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;EACN;EACA,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,OAAO;CACT;AACF,CACF"}
1
+ {"version":3,"file":"badge-variants.js","names":[],"sources":["../../../src/components/ui/badge-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst badgeVariants = cva(\n 'inline-flex items-center border font-semibold tracking-normal transition-colors focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 focus:outline-hidden',\n {\n variants: {\n variant: {\n default: 'border-transparent bg-primary text-primary-foreground',\n secondary: 'border-transparent bg-secondary text-secondary-foreground/70',\n destructive: 'border-transparent bg-destructive/20 text-destructive',\n success: 'border-transparent bg-green/20 text-green',\n warning: 'border-transparent bg-badge-warning text-badge-warning-foreground',\n outline: 'text-foreground',\n },\n size: {\n default: 'h-4.5 px-1.5 text-xs',\n sm: 'h-5 px-2 text-sm',\n md: 'h-6 px-2.5 text-sm',\n },\n shape: {\n rounded: 'rounded-xs',\n pill: 'rounded-full',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n shape: 'pill',\n },\n },\n);\n\nexport { badgeVariants };\n"],"mappings":";;AAEA,IAAM,gBAAgB,IACpB,+JACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,aAAa;GACb,SAAS;GACT,SAAS;GACT,SAAS;EACX;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;EACN;EACA,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,OAAO;CACT;AACF,CACF"}
@@ -6,10 +6,10 @@ var bannerVariants = cva("relative block rounded-lg transition-all duration-300"
6
6
  default: "border border-border-default bg-surface-panel shadow-sm hover:shadow-md",
7
7
  gradient: [
8
8
  "cursor-pointer bg-surface-elevated",
9
- "shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_28%),7px_6px_42px_8px_rgb(202_103_255_/_32%)]",
10
- "dark:shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_36%),7px_6px_42px_8px_rgb(202_103_255_/_38%)]",
11
- "hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_38%),7px_8px_42px_10px_rgb(202_103_255_/_42%)]",
12
- "dark:hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_50%),7px_8px_42px_10px_rgb(202_103_255_/_52%)]",
9
+ "shadow-[-7px_-6px_42px_8px_color-mix(in_oklab,var(--banner-glow-start)_28%,transparent),7px_6px_42px_8px_color-mix(in_oklab,var(--banner-glow-end)_32%,transparent)]",
10
+ "dark:shadow-[-7px_-6px_42px_8px_color-mix(in_oklab,var(--banner-glow-start)_36%,transparent),7px_6px_42px_8px_color-mix(in_oklab,var(--banner-glow-end)_38%,transparent)]",
11
+ "hover:shadow-[-7px_-4px_42px_10px_color-mix(in_oklab,var(--banner-glow-start)_38%,transparent),7px_8px_42px_10px_color-mix(in_oklab,var(--banner-glow-end)_42%,transparent)]",
12
+ "dark:hover:shadow-[-7px_-4px_42px_10px_color-mix(in_oklab,var(--banner-glow-start)_50%,transparent),7px_8px_42px_10px_color-mix(in_oklab,var(--banner-glow-end)_52%,transparent)]",
13
13
  "hover:translate-y-[-2px] hover:scale-[1.01]"
14
14
  ],
15
15
  info: "border border-state-info/40 bg-state-info/10",
@@ -1 +1 @@
1
- {"version":3,"file":"banner-variants.js","names":[],"sources":["../../../src/components/ui/banner-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst bannerVariants = cva('relative block rounded-lg transition-all duration-300', {\n variants: {\n variant: {\n default: 'border border-border-default bg-surface-panel shadow-sm hover:shadow-md',\n gradient: [\n 'cursor-pointer bg-surface-elevated',\n 'shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_28%),7px_6px_42px_8px_rgb(202_103_255_/_32%)]',\n 'dark:shadow-[-7px_-6px_42px_8px_rgb(75_225_226_/_36%),7px_6px_42px_8px_rgb(202_103_255_/_38%)]',\n 'hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_38%),7px_8px_42px_10px_rgb(202_103_255_/_42%)]',\n 'dark:hover:shadow-[-7px_-4px_42px_10px_rgb(75_225_226_/_50%),7px_8px_42px_10px_rgb(202_103_255_/_52%)]',\n 'hover:translate-y-[-2px] hover:scale-[1.01]',\n ],\n info: 'border border-state-info/40 bg-state-info/10',\n success: 'border border-state-success/40 bg-state-success/10',\n warning: 'border border-state-warning/40 bg-state-warning/10',\n destructive: 'border border-state-danger/20 bg-state-danger/10',\n },\n size: {\n sm: 'p-2 text-sm',\n md: 'p-3',\n lg: 'p-4',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\nexport { bannerVariants };\n"],"mappings":";;AAEA,IAAM,iBAAiB,IAAI,yDAAyD;CAClF,UAAU;EACR,SAAS;GACP,SAAS;GACT,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;GACF;GACA,MAAM;GACN,SAAS;GACT,SAAS;GACT,aAAa;EACf;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CAAC"}
1
+ {"version":3,"file":"banner-variants.js","names":[],"sources":["../../../src/components/ui/banner-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst bannerVariants = cva('relative block rounded-lg transition-all duration-300', {\n variants: {\n variant: {\n default: 'border border-border-default bg-surface-panel shadow-sm hover:shadow-md',\n gradient: [\n 'cursor-pointer bg-surface-elevated',\n 'shadow-[-7px_-6px_42px_8px_color-mix(in_oklab,var(--banner-glow-start)_28%,transparent),7px_6px_42px_8px_color-mix(in_oklab,var(--banner-glow-end)_32%,transparent)]',\n 'dark:shadow-[-7px_-6px_42px_8px_color-mix(in_oklab,var(--banner-glow-start)_36%,transparent),7px_6px_42px_8px_color-mix(in_oklab,var(--banner-glow-end)_38%,transparent)]',\n 'hover:shadow-[-7px_-4px_42px_10px_color-mix(in_oklab,var(--banner-glow-start)_38%,transparent),7px_8px_42px_10px_color-mix(in_oklab,var(--banner-glow-end)_42%,transparent)]',\n 'dark:hover:shadow-[-7px_-4px_42px_10px_color-mix(in_oklab,var(--banner-glow-start)_50%,transparent),7px_8px_42px_10px_color-mix(in_oklab,var(--banner-glow-end)_52%,transparent)]',\n 'hover:translate-y-[-2px] hover:scale-[1.01]',\n ],\n info: 'border border-state-info/40 bg-state-info/10',\n success: 'border border-state-success/40 bg-state-success/10',\n warning: 'border border-state-warning/40 bg-state-warning/10',\n destructive: 'border border-state-danger/20 bg-state-danger/10',\n },\n size: {\n sm: 'p-2 text-sm',\n md: 'p-3',\n lg: 'p-4',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n});\n\nexport { bannerVariants };\n"],"mappings":";;AAEA,IAAM,iBAAiB,IAAI,yDAAyD;CAClF,UAAU;EACR,SAAS;GACP,SAAS;GACT,UAAU;IACR;IACA;IACA;IACA;IACA;IACA;GACF;GACA,MAAM;GACN,SAAS;GACT,SAAS;GACT,aAAa;EACf;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CAAC"}
@@ -20,10 +20,6 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-1.5 text-c
20
20
  icon: "size-9",
21
21
  "icon-sm": "size-7 p-0 [&_svg]:size-3"
22
22
  },
23
- isAdmin7: {
24
- true: "",
25
- false: ""
26
- },
27
23
  shape: {
28
24
  rounded: "rounded-control",
29
25
  pill: "rounded-full"
@@ -31,37 +27,18 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-1.5 text-c
31
27
  },
32
28
  compoundVariants: [
33
29
  {
34
- isAdmin7: false,
35
- variant: "secondary",
36
- className: "bg-secondary hover:bg-secondary/80"
37
- },
38
- {
39
- isAdmin7: true,
40
30
  variant: "secondary",
41
31
  className: "bg-tab-active hover:bg-secondary"
42
32
  },
43
33
  {
44
- isAdmin7: false,
45
- variant: "destructive-ghost",
46
- className: "hover:bg-accent"
47
- },
48
- {
49
- isAdmin7: true,
50
34
  variant: "destructive-ghost",
51
35
  className: "hover:bg-destructive/10 enabled:active:bg-destructive/10 enabled:aria-expanded:bg-destructive/10"
52
36
  },
53
37
  {
54
- isAdmin7: false,
55
- variant: "subtle",
56
- className: "border border-control-border bg-transparent hover:bg-button-hover hover:text-accent-foreground"
57
- },
58
- {
59
- isAdmin7: true,
60
38
  variant: "subtle",
61
39
  className: "hover:bg-accent hover:text-accent-foreground"
62
40
  },
63
41
  {
64
- isAdmin7: true,
65
42
  variant: [
66
43
  "secondary",
67
44
  "ghost",
@@ -71,22 +48,18 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-1.5 text-c
71
48
  className: "enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed"
72
49
  },
73
50
  {
74
- isAdmin7: true,
75
51
  variant: "secondary",
76
52
  className: "enabled:active:bg-secondary enabled:aria-expanded:bg-secondary"
77
53
  },
78
54
  {
79
- isAdmin7: true,
80
55
  variant: ["ghost", "subtle"],
81
56
  className: "enabled:active:bg-accent enabled:aria-expanded:bg-accent enabled:aria-expanded:text-accent-foreground"
82
57
  },
83
58
  {
84
- isAdmin7: true,
85
59
  variant: "ghost",
86
60
  className: "hover:bg-button-ghost-hover enabled:active:bg-button-ghost-hover enabled:aria-expanded:bg-button-ghost-hover"
87
61
  },
88
62
  {
89
- isAdmin7: true,
90
63
  variant: "default",
91
64
  size: [
92
65
  "default",
@@ -96,7 +69,6 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-1.5 text-c
96
69
  className: "px-4"
97
70
  },
98
71
  {
99
- isAdmin7: true,
100
72
  variant: [
101
73
  "destructive",
102
74
  "outline",
@@ -114,12 +86,10 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-1.5 text-c
114
86
  className: "px-3"
115
87
  },
116
88
  {
117
- isAdmin7: true,
118
89
  variant: "outline",
119
- className: "border-0 shadow-control-outline enabled:active:shadow-control-outline-pressed enabled:aria-expanded:shadow-control-outline-pressed enabled:aria-expanded:bg-button-hover"
90
+ className: "border-0 shadow-control-outline enabled:active:shadow-control-outline-pressed enabled:aria-expanded:shadow-control-outline-pressed enabled:active:bg-button-pressed enabled:aria-expanded:bg-button-pressed"
120
91
  },
121
92
  {
122
- isAdmin7: true,
123
93
  size: "icon",
124
94
  className: "size-(--control-height) aspect-square p-0"
125
95
  }
@@ -127,8 +97,7 @@ var buttonVariants = cva("inline-flex items-center justify-center gap-1.5 text-c
127
97
  defaultVariants: {
128
98
  variant: "default",
129
99
  size: "default",
130
- shape: "pill",
131
- isAdmin7: true
100
+ shape: "pill"
132
101
  }
133
102
  });
134
103
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"button-variants.js","names":[],"sources":["../../../src/components/ui/button-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center gap-1.5 text-control whitespace-nowrap transition-colors focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]',\n {\n variants: {\n variant: {\n default:\n 'bg-primary font-semibold text-primary-foreground hover:bg-primary/90 disabled:bg-control-disabled-surface disabled:text-muted-foreground/80 disabled:opacity-100',\n destructive:\n 'bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90',\n outline:\n 'border border-control-border bg-transparent font-medium hover:bg-button-hover hover:text-accent-foreground',\n secondary: 'font-medium text-secondary-foreground',\n subtle: 'font-medium',\n ghost: 'font-medium hover:bg-accent hover:text-accent-foreground',\n 'destructive-ghost': 'font-medium text-destructive hover:text-destructive',\n link: 'font-medium text-primary underline-offset-4 hover:underline',\n dropdown:\n 'border border-control-border bg-transparent hover:bg-button-hover hover:text-accent-foreground',\n },\n size: {\n default: 'h-(--control-height) px-2.5 py-2',\n sm: 'h-7 px-3 text-sm! [&_svg]:size-3',\n lg: 'h-11 px-8 text-md font-semibold',\n icon: 'size-9',\n 'icon-sm': 'size-7 p-0 [&_svg]:size-3',\n },\n isAdmin7: { true: '', false: '' },\n shape: {\n rounded: 'rounded-control',\n pill: 'rounded-full',\n },\n },\n compoundVariants: [\n {\n isAdmin7: false,\n variant: 'secondary',\n className: 'bg-secondary hover:bg-secondary/80',\n },\n { isAdmin7: true, variant: 'secondary', className: 'bg-tab-active hover:bg-secondary' },\n { isAdmin7: false, variant: 'destructive-ghost', className: 'hover:bg-accent' },\n {\n isAdmin7: true,\n variant: 'destructive-ghost',\n className:\n 'hover:bg-destructive/10 enabled:active:bg-destructive/10 enabled:aria-expanded:bg-destructive/10',\n },\n {\n isAdmin7: false,\n variant: 'subtle',\n className:\n 'border border-control-border bg-transparent hover:bg-button-hover hover:text-accent-foreground',\n },\n {\n isAdmin7: true,\n variant: 'subtle',\n className: 'hover:bg-accent hover:text-accent-foreground',\n },\n {\n isAdmin7: true,\n variant: ['secondary', 'ghost', 'destructive-ghost', 'subtle'],\n className:\n 'enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed',\n },\n {\n isAdmin7: true,\n variant: 'secondary',\n className: 'enabled:active:bg-secondary enabled:aria-expanded:bg-secondary',\n },\n {\n isAdmin7: true,\n variant: ['ghost', 'subtle'],\n className:\n 'enabled:active:bg-accent enabled:aria-expanded:bg-accent enabled:aria-expanded:text-accent-foreground',\n },\n {\n isAdmin7: true,\n variant: 'ghost',\n className:\n 'hover:bg-button-ghost-hover enabled:active:bg-button-ghost-hover enabled:aria-expanded:bg-button-ghost-hover',\n },\n {\n isAdmin7: true,\n variant: 'default',\n size: ['default', 'sm', 'lg'],\n className: 'px-4',\n },\n {\n isAdmin7: true,\n variant: [\n 'destructive',\n 'outline',\n 'secondary',\n 'ghost',\n 'destructive-ghost',\n 'dropdown',\n 'subtle',\n ],\n size: ['default', 'sm', 'lg'],\n className: 'px-3',\n },\n {\n isAdmin7: true,\n variant: 'outline',\n className:\n 'border-0 shadow-control-outline enabled:active:shadow-control-outline-pressed enabled:aria-expanded:shadow-control-outline-pressed enabled:aria-expanded:bg-button-hover',\n },\n {\n isAdmin7: true,\n size: 'icon',\n className: 'size-(--control-height) aspect-square p-0',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n shape: 'pill',\n isAdmin7: true,\n },\n },\n);\n\nexport { buttonVariants };\n"],"mappings":";;AAEA,IAAM,iBAAiB,IACrB,wTACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,aACE;GACF,SACE;GACF,WAAW;GACX,QAAQ;GACR,OAAO;GACP,qBAAqB;GACrB,MAAM;GACN,UACE;EACJ;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WAAW;EACb;EACA,UAAU;GAAE,MAAM;GAAI,OAAO;EAAG;EAChC,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,kBAAkB;EAChB;GACE,UAAU;GACV,SAAS;GACT,WAAW;EACb;EACA;GAAE,UAAU;GAAM,SAAS;GAAa,WAAW;EAAmC;EACtF;GAAE,UAAU;GAAO,SAAS;GAAqB,WAAW;EAAkB;EAC9E;GACE,UAAU;GACV,SAAS;GACT,WACE;EACJ;EACA;GACE,UAAU;GACV,SAAS;GACT,WACE;EACJ;EACA;GACE,UAAU;GACV,SAAS;GACT,WAAW;EACb;EACA;GACE,UAAU;GACV,SAAS;IAAC;IAAa;IAAS;IAAqB;GAAQ;GAC7D,WACE;EACJ;EACA;GACE,UAAU;GACV,SAAS;GACT,WAAW;EACb;EACA;GACE,UAAU;GACV,SAAS,CAAC,SAAS,QAAQ;GAC3B,WACE;EACJ;EACA;GACE,UAAU;GACV,SAAS;GACT,WACE;EACJ;EACA;GACE,UAAU;GACV,SAAS;GACT,MAAM;IAAC;IAAW;IAAM;GAAI;GAC5B,WAAW;EACb;EACA;GACE,UAAU;GACV,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,MAAM;IAAC;IAAW;IAAM;GAAI;GAC5B,WAAW;EACb;EACA;GACE,UAAU;GACV,SAAS;GACT,WACE;EACJ;EACA;GACE,UAAU;GACV,MAAM;GACN,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,OAAO;EACP,UAAU;CACZ;AACF,CACF"}
1
+ {"version":3,"file":"button-variants.js","names":[],"sources":["../../../src/components/ui/button-variants.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center gap-1.5 text-control whitespace-nowrap transition-colors focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-[1.5px]',\n {\n variants: {\n variant: {\n default:\n 'bg-primary font-semibold text-primary-foreground hover:bg-primary/90 disabled:bg-control-disabled-surface disabled:text-muted-foreground/80 disabled:opacity-100',\n destructive:\n 'bg-destructive font-medium text-destructive-foreground hover:bg-destructive/90',\n outline:\n 'border border-control-border bg-transparent font-medium hover:bg-button-hover hover:text-accent-foreground',\n secondary: 'font-medium text-secondary-foreground',\n subtle: 'font-medium',\n ghost: 'font-medium hover:bg-accent hover:text-accent-foreground',\n 'destructive-ghost': 'font-medium text-destructive hover:text-destructive',\n link: 'font-medium text-primary underline-offset-4 hover:underline',\n dropdown:\n 'border border-control-border bg-transparent hover:bg-button-hover hover:text-accent-foreground',\n },\n size: {\n default: 'h-(--control-height) px-2.5 py-2',\n sm: 'h-7 px-3 text-sm! [&_svg]:size-3',\n lg: 'h-11 px-8 text-md font-semibold',\n icon: 'size-9',\n 'icon-sm': 'size-7 p-0 [&_svg]:size-3',\n },\n shape: {\n rounded: 'rounded-control',\n pill: 'rounded-full',\n },\n },\n compoundVariants: [\n { variant: 'secondary', className: 'bg-tab-active hover:bg-secondary' },\n {\n variant: 'destructive-ghost',\n className:\n 'hover:bg-destructive/10 enabled:active:bg-destructive/10 enabled:aria-expanded:bg-destructive/10',\n },\n {\n variant: 'subtle',\n className: 'hover:bg-accent hover:text-accent-foreground',\n },\n {\n variant: ['secondary', 'ghost', 'destructive-ghost', 'subtle'],\n className:\n 'enabled:active:shadow-control-pressed enabled:aria-expanded:shadow-control-pressed',\n },\n {\n variant: 'secondary',\n className: 'enabled:active:bg-secondary enabled:aria-expanded:bg-secondary',\n },\n {\n variant: ['ghost', 'subtle'],\n className:\n 'enabled:active:bg-accent enabled:aria-expanded:bg-accent enabled:aria-expanded:text-accent-foreground',\n },\n {\n variant: 'ghost',\n className:\n 'hover:bg-button-ghost-hover enabled:active:bg-button-ghost-hover enabled:aria-expanded:bg-button-ghost-hover',\n },\n {\n variant: 'default',\n size: ['default', 'sm', 'lg'],\n className: 'px-4',\n },\n {\n variant: [\n 'destructive',\n 'outline',\n 'secondary',\n 'ghost',\n 'destructive-ghost',\n 'dropdown',\n 'subtle',\n ],\n size: ['default', 'sm', 'lg'],\n className: 'px-3',\n },\n {\n variant: 'outline',\n className:\n 'border-0 shadow-control-outline enabled:active:shadow-control-outline-pressed enabled:aria-expanded:shadow-control-outline-pressed enabled:active:bg-button-pressed enabled:aria-expanded:bg-button-pressed',\n },\n {\n size: 'icon',\n className: 'size-(--control-height) aspect-square p-0',\n },\n ],\n defaultVariants: {\n variant: 'default',\n size: 'default',\n shape: 'pill',\n },\n },\n);\n\nexport { buttonVariants };\n"],"mappings":";;AAEA,IAAM,iBAAiB,IACrB,wTACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,aACE;GACF,SACE;GACF,WAAW;GACX,QAAQ;GACR,OAAO;GACP,qBAAqB;GACrB,MAAM;GACN,UACE;EACJ;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,WAAW;EACb;EACA,OAAO;GACL,SAAS;GACT,MAAM;EACR;CACF;CACA,kBAAkB;EAChB;GAAE,SAAS;GAAa,WAAW;EAAmC;EACtE;GACE,SAAS;GACT,WACE;EACJ;EACA;GACE,SAAS;GACT,WAAW;EACb;EACA;GACE,SAAS;IAAC;IAAa;IAAS;IAAqB;GAAQ;GAC7D,WACE;EACJ;EACA;GACE,SAAS;GACT,WAAW;EACb;EACA;GACE,SAAS,CAAC,SAAS,QAAQ;GAC3B,WACE;EACJ;EACA;GACE,SAAS;GACT,WACE;EACJ;EACA;GACE,SAAS;GACT,MAAM;IAAC;IAAW;IAAM;GAAI;GAC5B,WAAW;EACb;EACA;GACE,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GACA,MAAM;IAAC;IAAW;IAAM;GAAI;GAC5B,WAAW;EACb;EACA;GACE,SAAS;GACT,WACE;EACJ;EACA;GACE,MAAM;GACN,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;EACN,OAAO;CACT;AACF,CACF"}
@@ -7,7 +7,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Slot } from "@radix-ui/react-slot";
8
8
  //#region src/components/ui/button.tsx
9
9
  var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = false, children, ...props }, ref) => {
10
- const { controlShape, isAdmin7 } = useShade();
10
+ const { controlShape } = useShade();
11
11
  const Comp = asChild ? Slot : "button";
12
12
  const resolvedShape = variant === "link" ? "rounded" : shape ?? controlShape;
13
13
  const content = variant === "dropdown" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsx(ChevronDown, {
@@ -19,7 +19,6 @@ var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = fa
19
19
  className: cn(buttonVariants({
20
20
  variant,
21
21
  size,
22
- isAdmin7,
23
22
  shape: resolvedShape,
24
23
  className
25
24
  })),
@@ -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\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n Omit<VariantProps<typeof buttonVariants>, 'isAdmin7'> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, shape, asChild = false, children, ...props }, ref) => {\n const { controlShape, isAdmin7 } = 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, isAdmin7, 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":";;;;;;;;AAgBA,IAAM,SAAS,QAAM,YAClB,EAAE,WAAW,SAAS,MAAM,OAAO,UAAU,OAAO,UAAU,GAAG,SAAS,QAAQ;CACjF,MAAM,EAAE,cAAc,aAAa,SAAS;CAC5C,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;GAAU,OAAO;GAAe;EAAU,CAAC,CAAC;EAC1F,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 { 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"}
@@ -8,7 +8,7 @@ import { jsx } from "react/jsx-runtime";
8
8
  import { DayPicker, getDefaultClassNames } from "react-day-picker";
9
9
  //#region src/components/ui/calendar.tsx
10
10
  function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", formatters, components, ...props }) {
11
- const { controlShape, isAdmin7 } = useShade();
11
+ const { controlShape } = useShade();
12
12
  const defaultClassNames = getDefaultClassNames();
13
13
  return /* @__PURE__ */ jsx(DayPicker, {
14
14
  captionLayout,
@@ -20,12 +20,10 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
20
20
  nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
21
21
  button_previous: cn(buttonVariants({
22
22
  variant: buttonVariant,
23
- isAdmin7,
24
23
  shape: controlShape
25
24
  }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
26
25
  button_next: cn(buttonVariants({
27
26
  variant: buttonVariant,
28
- isAdmin7,
29
27
  shape: controlShape
30
28
  }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
31
29
  month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":[],"sources":["../../../src/components/ui/calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nimport { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\nimport { Button } from '@/components/ui/button';\nimport { buttonVariants } from '@/components/ui/button-variants';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) {\n const { controlShape, isAdmin7 } = useShade();\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n captionLayout={captionLayout}\n className={cn(\n 'group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant, isAdmin7, shape: controlShape }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant, isAdmin7, shape: controlShape }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n 'relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50',\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label,\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'w-(--cell-size) rounded-md text-sm font-normal text-muted-foreground select-none',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn(\n 'text-[0.8rem] text-muted-foreground select-none',\n defaultClassNames.week_number,\n ),\n day: cn(\n // A range rounds off where it wraps onto the next week; a day picked\n // on its own keeps its full shape on any weekday\n 'group/day relative aspect-square size-full p-0 text-center select-none [&:first-child[data-selected=true]_button[data-range-middle=true]]:rounded-l-md [&:last-child[data-selected=true]_button[data-range-middle=true]]:rounded-r-md',\n defaultClassNames.day,\n ),\n range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),\n // Today is marked under its number (see CalendarDayButton), not with\n // a background that would read as selected or vanish inside a range\n today: cn(defaultClassNames.today),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className: rootClassName, rootRef, ...rootProps }) => {\n return (\n <div ref={rootRef} className={cn(rootClassName)} data-slot=\"calendar\" {...rootProps} />\n );\n },\n Chevron: ({ className: chevronClassName, orientation, ...chevronProps }) => {\n if (orientation === 'left') {\n return <ChevronLeftIcon className={cn('size-4', chevronClassName)} {...chevronProps} />;\n }\n if (orientation === 'right') {\n return (\n <ChevronRightIcon className={cn('size-4', chevronClassName)} {...chevronProps} />\n );\n }\n return <ChevronDownIcon className={cn('size-4', chevronClassName)} {...chevronProps} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...weekProps }) => {\n return (\n <td {...weekProps}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) {\n ref.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n className={cn(\n \"relative flex aspect-square size-auto w-full min-w-(--cell-size) flex-auto items-center justify-center gap-1 leading-none font-normal group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[today=true]:font-medium data-[today=true]:after:absolute data-[today=true]:after:bottom-1 data-[today=true]:after:left-1/2 data-[today=true]:after:h-0.5 data-[today=true]:after:w-3 data-[today=true]:after:-translate-x-1/2 data-[today=true]:after:rounded-full data-[today=true]:after:bg-current data-[today=true]:after:content-[''] dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className,\n )}\n data-day={day.date.toLocaleDateString()}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n data-range-start={modifiers.range_start}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-today={modifiers.today}\n size=\"icon\"\n variant=\"ghost\"\n {...props}\n />\n );\n}\nCalendarDayButton.displayName = 'CalendarDayButton';\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":"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"}
1
+ {"version":3,"file":"calendar.js","names":[],"sources":["../../../src/components/ui/calendar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport { DayButton, DayPicker, getDefaultClassNames } from 'react-day-picker';\n\nimport { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\nimport { Button } from '@/components/ui/button';\nimport { buttonVariants } from '@/components/ui/button-variants';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) {\n const { controlShape } = useShade();\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n captionLayout={captionLayout}\n className={cn(\n 'group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant, shape: controlShape }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant, shape: controlShape }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn(\n 'relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50',\n defaultClassNames.dropdown_root,\n ),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label,\n ),\n table: 'w-full border-collapse',\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'w-(--cell-size) rounded-md text-sm font-normal text-muted-foreground select-none',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn(\n 'text-[0.8rem] text-muted-foreground select-none',\n defaultClassNames.week_number,\n ),\n day: cn(\n // A range rounds off where it wraps onto the next week; a day picked\n // on its own keeps its full shape on any weekday\n 'group/day relative aspect-square size-full p-0 text-center select-none [&:first-child[data-selected=true]_button[data-range-middle=true]]:rounded-l-md [&:last-child[data-selected=true]_button[data-range-middle=true]]:rounded-r-md',\n defaultClassNames.day,\n ),\n range_start: cn('rounded-l-md bg-accent', defaultClassNames.range_start),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn('rounded-r-md bg-accent', defaultClassNames.range_end),\n // Today is marked under its number (see CalendarDayButton), not with\n // a background that would read as selected or vanish inside a range\n today: cn(defaultClassNames.today),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className: rootClassName, rootRef, ...rootProps }) => {\n return (\n <div ref={rootRef} className={cn(rootClassName)} data-slot=\"calendar\" {...rootProps} />\n );\n },\n Chevron: ({ className: chevronClassName, orientation, ...chevronProps }) => {\n if (orientation === 'left') {\n return <ChevronLeftIcon className={cn('size-4', chevronClassName)} {...chevronProps} />;\n }\n if (orientation === 'right') {\n return (\n <ChevronRightIcon className={cn('size-4', chevronClassName)} {...chevronProps} />\n );\n }\n return <ChevronDownIcon className={cn('size-4', chevronClassName)} {...chevronProps} />;\n },\n DayButton: CalendarDayButton,\n WeekNumber: ({ children, ...weekProps }) => {\n return (\n <td {...weekProps}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString('default', { month: 'short' }),\n ...formatters,\n }}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n );\n}\nCalendar.displayName = 'Calendar';\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n ...props\n}: React.ComponentProps<typeof DayButton>) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) {\n ref.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n className={cn(\n \"relative flex aspect-square size-auto w-full min-w-(--cell-size) flex-auto items-center justify-center gap-1 leading-none font-normal group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[today=true]:font-medium data-[today=true]:after:absolute data-[today=true]:after:bottom-1 data-[today=true]:after:left-1/2 data-[today=true]:after:h-0.5 data-[today=true]:after:w-3 data-[today=true]:after:-translate-x-1/2 data-[today=true]:after:rounded-full data-[today=true]:after:bg-current data-[today=true]:after:content-[''] dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className,\n )}\n data-day={day.date.toLocaleDateString()}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n data-range-start={modifiers.range_start}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-today={modifiers.today}\n size=\"icon\"\n variant=\"ghost\"\n {...props}\n />\n );\n}\nCalendarDayButton.displayName = 'CalendarDayButton';\n\nexport { Calendar, CalendarDayButton };\n"],"mappings":"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"}
@@ -1,5 +1,4 @@
1
1
  import { cn } from "../../lib/ds-utils.js";
2
- import { useShade } from "../../providers/shade-context.js";
3
2
  import { Inline } from "../primitives/inline.js";
4
3
  import { Stack } from "../primitives/stack.js";
5
4
  import { Text } from "../primitives/text.js";
@@ -107,10 +106,9 @@ var CopyFieldValue = React$1.forwardRef(({ children, className, ...props }, ref)
107
106
  });
108
107
  CopyFieldValue.displayName = "CopyFieldValue";
109
108
  var CopyFieldActions = React$1.forwardRef(({ className, ...props }, ref) => {
110
- const { isAdmin7 } = useShade();
111
109
  return /* @__PURE__ */ jsx(Inline, {
112
110
  ref,
113
- className: cn("absolute top-1/2 right-[1px] -translate-y-1/2 gap-px bg-control-readonly-surface pl-1 transition-opacity md:pointer-events-none md:opacity-0 md:group-focus-within/copy-field-content:pointer-events-auto md:group-focus-within/copy-field-content:opacity-100 md:group-hover/copy-field-content:pointer-events-auto md:group-hover/copy-field-content:opacity-100 [&_button:not([data-slot=copy-field-copy-button])]:bg-control-readonly-surface [&_button:not([data-slot=copy-field-copy-button])]:hover:bg-secondary [&_button[data-control-shape=rounded]]:rounded-sm", isAdmin7 ? "[&_button]:h-6" : "[&_button]:h-7", className),
111
+ className: cn("absolute top-1/2 right-[1px] -translate-y-1/2 gap-px bg-control-readonly-surface pl-1 transition-opacity md:pointer-events-none md:opacity-0 md:group-focus-within/copy-field-content:pointer-events-auto md:group-focus-within/copy-field-content:opacity-100 md:group-hover/copy-field-content:pointer-events-auto md:group-hover/copy-field-content:opacity-100 [&_button]:h-6 [&_button:not([data-slot=copy-field-copy-button])]:bg-control-readonly-surface [&_button:not([data-slot=copy-field-copy-button])]:hover:bg-secondary [&_button[data-control-shape=rounded]]:rounded-sm", className),
114
112
  "data-slot": "copy-field-actions",
115
113
  gap: "none",
116
114
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"copy-field.js","names":[],"sources":["../../../src/components/ui/copy-field.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Inline, Stack, Text } from '@/components/primitives';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\ntype CopyFieldContextValue = {\n copied: boolean;\n copy: () => Promise<void>;\n disabled: boolean;\n labelId: string;\n value: string;\n};\n\nconst CopyFieldContext = React.createContext<CopyFieldContextValue | null>(null);\n\nfunction useCopyField() {\n const context = React.useContext(CopyFieldContext);\n\n if (!context) {\n throw new Error('CopyField subcomponents must be used within CopyField');\n }\n\n return context;\n}\n\ninterface CopyFieldProps extends React.HTMLAttributes<HTMLDivElement> {\n disabled?: boolean;\n value: string;\n}\n\nconst CopyField = React.forwardRef<HTMLDivElement, CopyFieldProps>(\n ({ children, className, disabled = false, value, ...props }, ref) => {\n const [copied, setCopied] = React.useState(false);\n const labelId = React.useId();\n const resetTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n React.useEffect(() => {\n setCopied(false);\n\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n resetTimer.current = null;\n }\n }, [value]);\n\n React.useEffect(() => {\n return () => {\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n }\n };\n }, []);\n\n const copy = React.useCallback(async () => {\n if (disabled) {\n return;\n }\n\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n }\n\n resetTimer.current = setTimeout(() => setCopied(false), 2000);\n } catch {\n setCopied(false);\n }\n }, [disabled, value]);\n\n const contextValue = React.useMemo(\n () => ({ copied, copy, disabled, labelId, value }),\n [copied, copy, disabled, labelId, value],\n );\n\n return (\n <CopyFieldContext.Provider value={contextValue}>\n <Stack\n ref={ref}\n className={cn('group/copy-field w-full', className)}\n data-disabled={disabled || undefined}\n data-slot=\"copy-field\"\n gap=\"xs\"\n {...props}\n >\n {children}\n </Stack>\n </CopyFieldContext.Provider>\n );\n },\n);\nCopyField.displayName = 'CopyField';\n\nconst CopyFieldLabel = React.forwardRef<HTMLElement, React.ComponentProps<typeof Text>>(\n ({ className, id, ...props }, ref) => {\n const { labelId } = useCopyField();\n\n return (\n <Text\n ref={ref}\n as=\"div\"\n className={cn(\n 'text-control! font-medium group-data-[disabled=true]/copy-field:opacity-50',\n className,\n )}\n data-slot=\"copy-field-label\"\n id={id || labelId}\n leading=\"snug\"\n {...props}\n />\n );\n },\n);\nCopyFieldLabel.displayName = 'CopyFieldLabel';\n\nconst CopyFieldContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n inputSurface('within'),\n 'group/copy-field-content relative flex h-(--control-height) w-full items-center overflow-hidden bg-control-readonly-surface px-3 py-1 group-data-[disabled=true]/copy-field:cursor-not-allowed group-data-[disabled=true]/copy-field:opacity-50',\n className,\n )}\n data-slot=\"copy-field-content\"\n {...props}\n />\n ),\n);\nCopyFieldContent.displayName = 'CopyFieldContent';\n\nconst CopyFieldValue = React.forwardRef<HTMLElement, React.ComponentProps<typeof Text>>(\n ({ children, className, ...props }, ref) => {\n const { disabled, labelId, value } = useCopyField();\n\n return (\n <Text\n ref={ref}\n aria-disabled={disabled || undefined}\n aria-labelledby={\n props['aria-label'] || props['aria-labelledby'] ? props['aria-labelledby'] : labelId\n }\n aria-readonly=\"true\"\n as=\"div\"\n className={cn('min-w-0 truncate pr-2 text-muted-foreground', className)}\n data-slot=\"copy-field-value\"\n leading=\"snug\"\n role=\"textbox\"\n tabIndex={disabled ? undefined : 0}\n {...props}\n >\n {children ?? value}\n </Text>\n );\n },\n);\nCopyFieldValue.displayName = 'CopyFieldValue';\n\nconst CopyFieldActions = React.forwardRef<HTMLElement, React.ComponentProps<typeof Inline>>(\n ({ className, ...props }, ref) => {\n const { isAdmin7 } = useShade();\n\n return (\n <Inline\n ref={ref}\n className={cn(\n 'absolute top-1/2 right-[1px] -translate-y-1/2 gap-px bg-control-readonly-surface pl-1 transition-opacity md:pointer-events-none md:opacity-0 md:group-focus-within/copy-field-content:pointer-events-auto md:group-focus-within/copy-field-content:opacity-100 md:group-hover/copy-field-content:pointer-events-auto md:group-hover/copy-field-content:opacity-100 [&_button:not([data-slot=copy-field-copy-button])]:bg-control-readonly-surface [&_button:not([data-slot=copy-field-copy-button])]:hover:bg-secondary [&_button[data-control-shape=rounded]]:rounded-sm',\n isAdmin7 ? '[&_button]:h-6' : '[&_button]:h-7',\n className,\n )}\n data-slot=\"copy-field-actions\"\n gap=\"none\"\n {...props}\n />\n );\n },\n);\nCopyFieldActions.displayName = 'CopyFieldActions';\n\ninterface CopyFieldCopyButtonProps extends Omit<ButtonProps, 'children'> {\n children?: React.ReactNode;\n copiedLabel?: React.ReactNode;\n}\n\nconst CopyFieldCopyButton = React.forwardRef<HTMLButtonElement, CopyFieldCopyButtonProps>(\n ({ children = 'Copy', className, copiedLabel = 'Copied', disabled, onClick, ...props }, ref) => {\n const { copied, copy, disabled: fieldDisabled } = useCopyField();\n\n return (\n <Button\n ref={ref}\n className={cn(\n 'bg-surface-elevated hover:border-border-strong/40 hover:bg-surface-elevated',\n className,\n )}\n disabled={fieldDisabled || disabled}\n size=\"sm\"\n type=\"button\"\n variant=\"outline\"\n onClick={async (event) => {\n await copy();\n onClick?.(event);\n }}\n {...props}\n data-slot=\"copy-field-copy-button\"\n >\n {copied ? copiedLabel : children}\n </Button>\n );\n },\n);\nCopyFieldCopyButton.displayName = 'CopyFieldCopyButton';\n\nexport {\n CopyField,\n CopyFieldActions,\n CopyFieldContent,\n CopyFieldCopyButton,\n CopyFieldLabel,\n CopyFieldValue,\n};\nexport type { CopyFieldProps };\n"],"mappings":"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"}
1
+ {"version":3,"file":"copy-field.js","names":[],"sources":["../../../src/components/ui/copy-field.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Inline, Stack, Text } from '@/components/primitives';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\ntype CopyFieldContextValue = {\n copied: boolean;\n copy: () => Promise<void>;\n disabled: boolean;\n labelId: string;\n value: string;\n};\n\nconst CopyFieldContext = React.createContext<CopyFieldContextValue | null>(null);\n\nfunction useCopyField() {\n const context = React.useContext(CopyFieldContext);\n\n if (!context) {\n throw new Error('CopyField subcomponents must be used within CopyField');\n }\n\n return context;\n}\n\ninterface CopyFieldProps extends React.HTMLAttributes<HTMLDivElement> {\n disabled?: boolean;\n value: string;\n}\n\nconst CopyField = React.forwardRef<HTMLDivElement, CopyFieldProps>(\n ({ children, className, disabled = false, value, ...props }, ref) => {\n const [copied, setCopied] = React.useState(false);\n const labelId = React.useId();\n const resetTimer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n\n React.useEffect(() => {\n setCopied(false);\n\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n resetTimer.current = null;\n }\n }, [value]);\n\n React.useEffect(() => {\n return () => {\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n }\n };\n }, []);\n\n const copy = React.useCallback(async () => {\n if (disabled) {\n return;\n }\n\n try {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n\n if (resetTimer.current) {\n clearTimeout(resetTimer.current);\n }\n\n resetTimer.current = setTimeout(() => setCopied(false), 2000);\n } catch {\n setCopied(false);\n }\n }, [disabled, value]);\n\n const contextValue = React.useMemo(\n () => ({ copied, copy, disabled, labelId, value }),\n [copied, copy, disabled, labelId, value],\n );\n\n return (\n <CopyFieldContext.Provider value={contextValue}>\n <Stack\n ref={ref}\n className={cn('group/copy-field w-full', className)}\n data-disabled={disabled || undefined}\n data-slot=\"copy-field\"\n gap=\"xs\"\n {...props}\n >\n {children}\n </Stack>\n </CopyFieldContext.Provider>\n );\n },\n);\nCopyField.displayName = 'CopyField';\n\nconst CopyFieldLabel = React.forwardRef<HTMLElement, React.ComponentProps<typeof Text>>(\n ({ className, id, ...props }, ref) => {\n const { labelId } = useCopyField();\n\n return (\n <Text\n ref={ref}\n as=\"div\"\n className={cn(\n 'text-control! font-medium group-data-[disabled=true]/copy-field:opacity-50',\n className,\n )}\n data-slot=\"copy-field-label\"\n id={id || labelId}\n leading=\"snug\"\n {...props}\n />\n );\n },\n);\nCopyFieldLabel.displayName = 'CopyFieldLabel';\n\nconst CopyFieldContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n inputSurface('within'),\n 'group/copy-field-content relative flex h-(--control-height) w-full items-center overflow-hidden bg-control-readonly-surface px-3 py-1 group-data-[disabled=true]/copy-field:cursor-not-allowed group-data-[disabled=true]/copy-field:opacity-50',\n className,\n )}\n data-slot=\"copy-field-content\"\n {...props}\n />\n ),\n);\nCopyFieldContent.displayName = 'CopyFieldContent';\n\nconst CopyFieldValue = React.forwardRef<HTMLElement, React.ComponentProps<typeof Text>>(\n ({ children, className, ...props }, ref) => {\n const { disabled, labelId, value } = useCopyField();\n\n return (\n <Text\n ref={ref}\n aria-disabled={disabled || undefined}\n aria-labelledby={\n props['aria-label'] || props['aria-labelledby'] ? props['aria-labelledby'] : labelId\n }\n aria-readonly=\"true\"\n as=\"div\"\n className={cn('min-w-0 truncate pr-2 text-muted-foreground', className)}\n data-slot=\"copy-field-value\"\n leading=\"snug\"\n role=\"textbox\"\n tabIndex={disabled ? undefined : 0}\n {...props}\n >\n {children ?? value}\n </Text>\n );\n },\n);\nCopyFieldValue.displayName = 'CopyFieldValue';\n\nconst CopyFieldActions = React.forwardRef<HTMLElement, React.ComponentProps<typeof Inline>>(\n ({ className, ...props }, ref) => {\n return (\n <Inline\n ref={ref}\n className={cn(\n 'absolute top-1/2 right-[1px] -translate-y-1/2 gap-px bg-control-readonly-surface pl-1 transition-opacity md:pointer-events-none md:opacity-0 md:group-focus-within/copy-field-content:pointer-events-auto md:group-focus-within/copy-field-content:opacity-100 md:group-hover/copy-field-content:pointer-events-auto md:group-hover/copy-field-content:opacity-100 [&_button]:h-6 [&_button:not([data-slot=copy-field-copy-button])]:bg-control-readonly-surface [&_button:not([data-slot=copy-field-copy-button])]:hover:bg-secondary [&_button[data-control-shape=rounded]]:rounded-sm',\n className,\n )}\n data-slot=\"copy-field-actions\"\n gap=\"none\"\n {...props}\n />\n );\n },\n);\nCopyFieldActions.displayName = 'CopyFieldActions';\n\ninterface CopyFieldCopyButtonProps extends Omit<ButtonProps, 'children'> {\n children?: React.ReactNode;\n copiedLabel?: React.ReactNode;\n}\n\nconst CopyFieldCopyButton = React.forwardRef<HTMLButtonElement, CopyFieldCopyButtonProps>(\n ({ children = 'Copy', className, copiedLabel = 'Copied', disabled, onClick, ...props }, ref) => {\n const { copied, copy, disabled: fieldDisabled } = useCopyField();\n\n return (\n <Button\n ref={ref}\n className={cn(\n 'bg-surface-elevated hover:border-border-strong/40 hover:bg-surface-elevated',\n className,\n )}\n disabled={fieldDisabled || disabled}\n size=\"sm\"\n type=\"button\"\n variant=\"outline\"\n onClick={async (event) => {\n await copy();\n onClick?.(event);\n }}\n {...props}\n data-slot=\"copy-field-copy-button\"\n >\n {copied ? copiedLabel : children}\n </Button>\n );\n },\n);\nCopyFieldCopyButton.displayName = 'CopyFieldCopyButton';\n\nexport {\n CopyField,\n CopyFieldActions,\n CopyFieldContent,\n CopyFieldCopyButton,\n CopyFieldLabel,\n CopyFieldValue,\n};\nexport type { CopyFieldProps };\n"],"mappings":"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"}
@@ -1,5 +1,4 @@
1
1
  import { cn } from "../../lib/ds-utils.js";
2
- import { useShade } from "../../providers/shade-context.js";
3
2
  import React from "react";
4
3
  import { jsx } from "react/jsx-runtime";
5
4
  //#region src/components/ui/data-list.tsx
@@ -40,10 +39,9 @@ var DataListBody = React.forwardRef(({ children, className, ...props }, ref) =>
40
39
  });
41
40
  DataListBody.displayName = "DataListBody";
42
41
  var DataListRow = React.forwardRef(({ children, className, ...props }, ref) => {
43
- const { isAdmin7 } = useShade();
44
42
  return /* @__PURE__ */ jsx("div", {
45
43
  ref,
46
- className: cn("group/row relative flex items-center justify-between gap-3 py-0.5 before:absolute before:-inset-x-0.5 before:inset-y-0.5 before:z-0 before:bg-muted/60 before:opacity-0 hover:before:opacity-100", isAdmin7 ? "before:rounded-control" : "before:rounded-[6px]", className),
44
+ className: cn("group/row relative flex items-center justify-between gap-3 py-0.5 before:absolute before:-inset-x-0.5 before:inset-y-0.5 before:z-0 before:rounded-control before:bg-muted/60 before:opacity-0 hover:before:opacity-100", className),
47
45
  ...props,
48
46
  children
49
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"data-list.js","names":[],"sources":["../../../src/components/ui/data-list.tsx"],"sourcesContent":["import { useShade } from '@/providers/shade-context';\nimport { cn } from '@/lib/utils';\nimport React from 'react';\n\n/* Data List main component\n/* -------------------------------------------------------------------------- */\ninterface DataListProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataList = React.forwardRef<HTMLDivElement, DataListProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('flex flex-col items-stretch', className)} {...props}>\n {children}\n </div>\n );\n },\n);\n\nDataList.displayName = 'DataList';\n\n/* Header\n/* -------------------------------------------------------------------------- */\ninterface DataListHeaderProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListHeader = React.forwardRef<HTMLDivElement, DataListHeaderProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-between gap-2 border-b p-2 text-xs font-medium tracking-wide text-muted-foreground uppercase',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListHeader.displayName = 'DataListHeader';\n\n/* Head\n/* -------------------------------------------------------------------------- */\ninterface DataListHeadProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListHead = React.forwardRef<HTMLDivElement, DataListHeadProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('', className)} {...props}>\n {children}\n </div>\n );\n },\n);\n\nDataListHead.displayName = 'DataListHead';\n\n/* Body\n/* -------------------------------------------------------------------------- */\ninterface DataListBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListBody = React.forwardRef<HTMLDivElement, DataListBodyProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('flex flex-col items-stretch pt-1.5', className)} {...props}>\n {children}\n </div>\n );\n },\n);\n\nDataListBody.displayName = 'DataListBody';\n\n/* Data row\n/* -------------------------------------------------------------------------- */\ninterface DataListRowProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListRow = React.forwardRef<HTMLDivElement, DataListRowProps>(\n ({ children, className, ...props }, ref) => {\n const { isAdmin7 } = useShade();\n return (\n <div\n ref={ref}\n className={cn(\n 'group/row relative flex items-center justify-between gap-3 py-0.5 before:absolute before:-inset-x-0.5 before:inset-y-0.5 before:z-0 before:bg-muted/60 before:opacity-0 hover:before:opacity-100',\n isAdmin7 ? 'before:rounded-control' : 'before:rounded-[6px]',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListRow.displayName = 'DataListRow';\n\n/* Bar\n/* -------------------------------------------------------------------------- */\ninterface DataListBarProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListBar = React.forwardRef<HTMLDivElement, DataListBarProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'absolute inset-x-0 inset-y-1 z-0 origin-left rounded-[4px] bg-state-info/10 transition-all group-hover/row:bg-state-info/25 dark:bg-state-info/20 dark:group-hover/row:bg-state-info/35',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListBar.displayName = 'DataListBar';\n\n/* List item content\n/* -------------------------------------------------------------------------- */\ninterface DataListItemContentProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemContent = React.forwardRef<HTMLDivElement, DataListItemContentProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'relative z-10 flex max-w-[calc(100%-32px)] min-w-0 items-center p-2 text-sm font-medium transition-[max-width] duration-300 ease-in-out group-hover/datalist:max-w-[calc(100%-100px)]',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemContent.displayName = 'DataListItemContent';\n\n/* Value\n/* -------------------------------------------------------------------------- */\ninterface DataListItemValueProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemValue = React.forwardRef<HTMLDivElement, DataListItemValueProps>(\n ({ children, className, ...props }, ref) => {\n // Apply animation styles when there are multiple children\n const childrenArray = React.Children.toArray(children);\n const hasMultipleChildren = childrenArray.length > 1;\n\n return (\n <div\n ref={ref}\n className={cn(\n 'z-10 flex items-center',\n // Apply animation styles when there are multiple children\n hasMultipleChildren &&\n '[&>[data-type=\"value-abs\"]]:transition-transform [&>[data-type=\"value-abs\"]]:duration-300 [&>[data-type=\"value-abs\"]]:group-hover/datalist:-translate-x-14',\n hasMultipleChildren &&\n '[&>[data-type=\"value-perc\"]]:invisible [&>[data-type=\"value-perc\"]]:absolute [&>[data-type=\"value-perc\"]]:right-0 [&>[data-type=\"value-perc\"]]:translate-x-14 [&>[data-type=\"value-perc\"]]:opacity-0 [&>[data-type=\"value-perc\"]]:transition-all [&>[data-type=\"value-perc\"]]:duration-300 [&>[data-type=\"value-perc\"]]:group-hover/datalist:visible [&>[data-type=\"value-perc\"]]:group-hover/datalist:translate-x-0 [&>[data-type=\"value-perc\"]]:group-hover/datalist:opacity-100',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemValue.displayName = 'DataListItemValue';\n\n/* Value absolute value, e.g. 996.178.341\n/* -------------------------------------------------------------------------- */\ninterface DataListItemValueAbsProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemValueAbs = React.forwardRef<HTMLDivElement, DataListItemValueAbsProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('z-10 px-2 font-mono text-sm', className)}\n data-type=\"value-abs\"\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemValueAbs.displayName = 'DataListItemValueAbs';\n\n/* Value percentage value, e.g. 85%\n/* -------------------------------------------------------------------------- */\ninterface DataListItemValuePercProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemValuePerc = React.forwardRef<HTMLDivElement, DataListItemValuePercProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('px-3 font-mono text-sm text-muted-foreground', className)}\n data-type=\"value-perc\"\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemValuePerc.displayName = 'DataListItemValuePerc';\n\n/* End of components\n/* -------------------------------------------------------------------------- */\nexport {\n DataList,\n DataListHeader,\n DataListHead,\n DataListBody,\n DataListRow,\n DataListBar,\n DataListItemContent,\n DataListItemValue,\n DataListItemValueAbs,\n DataListItemValuePerc,\n};\n"],"mappings":";;;;;AAWA,IAAM,WAAW,MAAM,YACpB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,+BAA+B,SAAS;EAAG,GAAI;EACzE;CACE,CAAA;AAET,CACF;AAEA,SAAS,cAAc;AASvB,IAAM,iBAAiB,MAAM,YAC1B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,0HACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,eAAe,cAAc;AAS7B,IAAM,eAAe,MAAM,YACxB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,IAAI,SAAS;EAAG,GAAI;EAC9C;CACE,CAAA;AAET,CACF;AAEA,aAAa,cAAc;AAS3B,IAAM,eAAe,MAAM,YACxB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,sCAAsC,SAAS;EAAG,GAAI;EAChF;CACE,CAAA;AAET,CACF;AAEA,aAAa,cAAc;AAS3B,IAAM,cAAc,MAAM,YACvB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,MAAM,EAAE,aAAa,SAAS;CAC9B,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,oMACA,WAAW,2BAA2B,wBACtC,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,YAAY,cAAc;AAS1B,IAAM,cAAc,MAAM,YACvB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,2LACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,YAAY,cAAc;AAS1B,IAAM,sBAAsB,MAAM,YAC/B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,yLACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,oBAAoB,cAAc;AASlC,IAAM,oBAAoB,MAAM,YAC7B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAG1C,MAAM,sBADgB,MAAM,SAAS,QAAQ,QACjB,CAAA,CAAc,SAAS;CAEnD,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,0BAEA,uBACE,oKACF,uBACE,0eACF,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,kBAAkB,cAAc;AAShC,IAAM,uBAAuB,MAAM,YAChC,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,+BAA+B,SAAS;EACtD,aAAU;EACV,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,qBAAqB,cAAc;AASnC,IAAM,wBAAwB,MAAM,YACjC,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,gDAAgD,SAAS;EACvE,aAAU;EACV,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,sBAAsB,cAAc"}
1
+ {"version":3,"file":"data-list.js","names":[],"sources":["../../../src/components/ui/data-list.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\nimport React from 'react';\n\n/* Data List main component\n/* -------------------------------------------------------------------------- */\ninterface DataListProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataList = React.forwardRef<HTMLDivElement, DataListProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('flex flex-col items-stretch', className)} {...props}>\n {children}\n </div>\n );\n },\n);\n\nDataList.displayName = 'DataList';\n\n/* Header\n/* -------------------------------------------------------------------------- */\ninterface DataListHeaderProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListHeader = React.forwardRef<HTMLDivElement, DataListHeaderProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'flex items-center justify-between gap-2 border-b p-2 text-xs font-medium tracking-wide text-muted-foreground uppercase',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListHeader.displayName = 'DataListHeader';\n\n/* Head\n/* -------------------------------------------------------------------------- */\ninterface DataListHeadProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListHead = React.forwardRef<HTMLDivElement, DataListHeadProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('', className)} {...props}>\n {children}\n </div>\n );\n },\n);\n\nDataListHead.displayName = 'DataListHead';\n\n/* Body\n/* -------------------------------------------------------------------------- */\ninterface DataListBodyProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListBody = React.forwardRef<HTMLDivElement, DataListBodyProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div ref={ref} className={cn('flex flex-col items-stretch pt-1.5', className)} {...props}>\n {children}\n </div>\n );\n },\n);\n\nDataListBody.displayName = 'DataListBody';\n\n/* Data row\n/* -------------------------------------------------------------------------- */\ninterface DataListRowProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListRow = React.forwardRef<HTMLDivElement, DataListRowProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'group/row relative flex items-center justify-between gap-3 py-0.5 before:absolute before:-inset-x-0.5 before:inset-y-0.5 before:z-0 before:rounded-control before:bg-muted/60 before:opacity-0 hover:before:opacity-100',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListRow.displayName = 'DataListRow';\n\n/* Bar\n/* -------------------------------------------------------------------------- */\ninterface DataListBarProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListBar = React.forwardRef<HTMLDivElement, DataListBarProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'absolute inset-x-0 inset-y-1 z-0 origin-left rounded-[4px] bg-state-info/10 transition-all group-hover/row:bg-state-info/25 dark:bg-state-info/20 dark:group-hover/row:bg-state-info/35',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListBar.displayName = 'DataListBar';\n\n/* List item content\n/* -------------------------------------------------------------------------- */\ninterface DataListItemContentProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemContent = React.forwardRef<HTMLDivElement, DataListItemContentProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'relative z-10 flex max-w-[calc(100%-32px)] min-w-0 items-center p-2 text-sm font-medium transition-[max-width] duration-300 ease-in-out group-hover/datalist:max-w-[calc(100%-100px)]',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemContent.displayName = 'DataListItemContent';\n\n/* Value\n/* -------------------------------------------------------------------------- */\ninterface DataListItemValueProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemValue = React.forwardRef<HTMLDivElement, DataListItemValueProps>(\n ({ children, className, ...props }, ref) => {\n // Apply animation styles when there are multiple children\n const childrenArray = React.Children.toArray(children);\n const hasMultipleChildren = childrenArray.length > 1;\n\n return (\n <div\n ref={ref}\n className={cn(\n 'z-10 flex items-center',\n // Apply animation styles when there are multiple children\n hasMultipleChildren &&\n '[&>[data-type=\"value-abs\"]]:transition-transform [&>[data-type=\"value-abs\"]]:duration-300 [&>[data-type=\"value-abs\"]]:group-hover/datalist:-translate-x-14',\n hasMultipleChildren &&\n '[&>[data-type=\"value-perc\"]]:invisible [&>[data-type=\"value-perc\"]]:absolute [&>[data-type=\"value-perc\"]]:right-0 [&>[data-type=\"value-perc\"]]:translate-x-14 [&>[data-type=\"value-perc\"]]:opacity-0 [&>[data-type=\"value-perc\"]]:transition-all [&>[data-type=\"value-perc\"]]:duration-300 [&>[data-type=\"value-perc\"]]:group-hover/datalist:visible [&>[data-type=\"value-perc\"]]:group-hover/datalist:translate-x-0 [&>[data-type=\"value-perc\"]]:group-hover/datalist:opacity-100',\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemValue.displayName = 'DataListItemValue';\n\n/* Value absolute value, e.g. 996.178.341\n/* -------------------------------------------------------------------------- */\ninterface DataListItemValueAbsProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemValueAbs = React.forwardRef<HTMLDivElement, DataListItemValueAbsProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('z-10 px-2 font-mono text-sm', className)}\n data-type=\"value-abs\"\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemValueAbs.displayName = 'DataListItemValueAbs';\n\n/* Value percentage value, e.g. 85%\n/* -------------------------------------------------------------------------- */\ninterface DataListItemValuePercProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n className?: string;\n}\n\nconst DataListItemValuePerc = React.forwardRef<HTMLDivElement, DataListItemValuePercProps>(\n ({ children, className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn('px-3 font-mono text-sm text-muted-foreground', className)}\n data-type=\"value-perc\"\n {...props}\n >\n {children}\n </div>\n );\n },\n);\n\nDataListItemValuePerc.displayName = 'DataListItemValuePerc';\n\n/* End of components\n/* -------------------------------------------------------------------------- */\nexport {\n DataList,\n DataListHeader,\n DataListHead,\n DataListBody,\n DataListRow,\n DataListBar,\n DataListItemContent,\n DataListItemValue,\n DataListItemValueAbs,\n DataListItemValuePerc,\n};\n"],"mappings":";;;;AAUA,IAAM,WAAW,MAAM,YACpB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,+BAA+B,SAAS;EAAG,GAAI;EACzE;CACE,CAAA;AAET,CACF;AAEA,SAAS,cAAc;AASvB,IAAM,iBAAiB,MAAM,YAC1B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,0HACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,eAAe,cAAc;AAS7B,IAAM,eAAe,MAAM,YACxB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,IAAI,SAAS;EAAG,GAAI;EAC9C;CACE,CAAA;AAET,CACF;AAEA,aAAa,cAAc;AAS3B,IAAM,eAAe,MAAM,YACxB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,sCAAsC,SAAS;EAAG,GAAI;EAChF;CACE,CAAA;AAET,CACF;AAEA,aAAa,cAAc;AAS3B,IAAM,cAAc,MAAM,YACvB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,2NACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,YAAY,cAAc;AAS1B,IAAM,cAAc,MAAM,YACvB,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,2LACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,YAAY,cAAc;AAS1B,IAAM,sBAAsB,MAAM,YAC/B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,yLACA,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,oBAAoB,cAAc;AASlC,IAAM,oBAAoB,MAAM,YAC7B,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAG1C,MAAM,sBADgB,MAAM,SAAS,QAAQ,QACjB,CAAA,CAAc,SAAS;CAEnD,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GACT,0BAEA,uBACE,oKACF,uBACE,0eACF,SACF;EACA,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,kBAAkB,cAAc;AAShC,IAAM,uBAAuB,MAAM,YAChC,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,+BAA+B,SAAS;EACtD,aAAU;EACV,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,qBAAqB,cAAc;AASnC,IAAM,wBAAwB,MAAM,YACjC,EAAE,UAAU,WAAW,GAAG,SAAS,QAAQ;CAC1C,OACE,oBAAC,OAAD;EACO;EACL,WAAW,GAAG,gDAAgD,SAAS;EACvE,aAAU;EACV,GAAI;EAEH;CACE,CAAA;AAET,CACF;AAEA,sBAAsB,cAAc"}
@@ -12,13 +12,11 @@ var dropzoneBaseVariants = cva("flex cursor-pointer flex-col items-center justif
12
12
  } },
13
13
  defaultVariants: { variant: "default" }
14
14
  });
15
- function dropzoneVariants(props = {}, isAdmin7 = true, shape = isAdmin7 ? "pill" : "rounded") {
15
+ function dropzoneVariants(props = {}, shape = "pill") {
16
16
  return cn(dropzoneBaseVariants(props), props.variant === "button" && buttonVariants({
17
- isAdmin7,
18
17
  shape,
19
18
  variant: "outline"
20
19
  }), props.variant === "buttonSecondary" && buttonVariants({
21
- isAdmin7,
22
20
  shape,
23
21
  size: "sm",
24
22
  variant: "secondary"
@@ -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 isAdmin7 = true,\n shape: ControlShape = isAdmin7 ? 'pill' : 'rounded',\n) {\n return cn(\n dropzoneBaseVariants(props),\n props.variant === 'button' && buttonVariants({ isAdmin7, shape, variant: 'outline' }),\n props.variant === 'buttonSecondary' &&\n buttonVariants({ isAdmin7, 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,WAAW,MACX,QAAsB,WAAW,SAAS,WAC1C;CACA,OAAO,GACL,qBAAqB,KAAK,GAC1B,MAAM,YAAY,YAAY,eAAe;EAAE;EAAU;EAAO,SAAS;CAAU,CAAC,GACpF,MAAM,YAAY,qBAChB,eAAe;EAAE;EAAU;EAAO,MAAM;EAAM,SAAS;CAAY,CAAC,GACtE,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 },\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"}
@@ -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, isAdmin7 } = useShade();
9
+ const { controlShape } = 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 }, isAdmin7, 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), 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, isAdmin7 } = 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 }, isAdmin7, 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,cAAc,aAAa,SAAS;CAC5C,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,UAAU,YAAY,GACpD,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 } = 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"}