@clicktap/ui 0.15.2 → 0.16.0

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 (86) hide show
  1. package/components/AssetRenderer/AssetRenderer.d.ts +74 -0
  2. package/components/AssetRenderer/AssetRenderer.js +1 -0
  3. package/components/AssetRenderer/index.d.ts +2 -0
  4. package/components/AssetRenderer/index.js +1 -0
  5. package/components/AssetRenderer/renderers/AudioRenderer.d.ts +50 -0
  6. package/components/AssetRenderer/renderers/AudioRenderer.js +1 -0
  7. package/components/AssetRenderer/renderers/DownloadLink.d.ts +40 -0
  8. package/components/AssetRenderer/renderers/DownloadLink.js +1 -0
  9. package/components/AssetRenderer/renderers/ImageRenderer.d.ts +32 -0
  10. package/components/AssetRenderer/renderers/ImageRenderer.js +1 -0
  11. package/components/AssetRenderer/renderers/PdfRenderer.d.ts +67 -0
  12. package/components/AssetRenderer/renderers/PdfRenderer.js +1 -0
  13. package/components/AssetRenderer/renderers/VideoRenderer.d.ts +61 -0
  14. package/components/AssetRenderer/renderers/VideoRenderer.js +1 -0
  15. package/components/AssetRenderer/renderers/index.d.ts +5 -0
  16. package/components/AssetRenderer/renderers/index.js +1 -0
  17. package/components/Collapsible/CollapsibleTrigger.js +1 -1
  18. package/components/FeatureGate/AccessDenied.d.ts +37 -0
  19. package/components/FeatureGate/AccessDenied.js +1 -0
  20. package/components/FeatureGate/FeatureGate.d.ts +62 -0
  21. package/components/FeatureGate/FeatureGate.js +1 -0
  22. package/components/FeatureGate/PermissionRequired.d.ts +32 -0
  23. package/components/FeatureGate/PermissionRequired.js +1 -0
  24. package/components/FeatureGate/PermissionsProvider.d.ts +61 -0
  25. package/components/FeatureGate/PermissionsProvider.js +1 -0
  26. package/components/FeatureGate/UpgradePrompt.d.ts +46 -0
  27. package/components/FeatureGate/UpgradePrompt.js +1 -0
  28. package/components/FeatureGate/index.d.ts +5 -0
  29. package/components/FeatureGate/index.js +1 -0
  30. package/components/Icon/ArrowLeftIcon.d.ts +7 -0
  31. package/components/Icon/ArrowLeftIcon.js +1 -0
  32. package/components/Icon/CloseIcon.d.ts +7 -0
  33. package/components/Icon/CloseIcon.js +1 -0
  34. package/components/Icon/CreateIcon.d.ts +7 -0
  35. package/components/Icon/CreateIcon.js +1 -0
  36. package/components/Icon/DeleteIcon.d.ts +7 -0
  37. package/components/Icon/DeleteIcon.js +1 -0
  38. package/components/Icon/GemIcon.d.ts +7 -0
  39. package/components/Icon/GemIcon.js +1 -0
  40. package/components/Icon/IncludedIcon.d.ts +11 -0
  41. package/components/Icon/IncludedIcon.js +1 -0
  42. package/components/Icon/InfoIcon.d.ts +7 -0
  43. package/components/Icon/InfoIcon.js +1 -0
  44. package/components/Icon/InvoiceIcon.d.ts +7 -0
  45. package/components/Icon/InvoiceIcon.js +1 -0
  46. package/components/Icon/LockIcon.d.ts +7 -0
  47. package/components/Icon/LockIcon.js +1 -0
  48. package/components/Icon/NoEntryIcon.d.ts +7 -0
  49. package/components/Icon/NoEntryIcon.js +1 -0
  50. package/components/Icon/NoteIcon.d.ts +7 -0
  51. package/components/Icon/NoteIcon.js +1 -0
  52. package/components/Icon/PencilIcon.d.ts +7 -0
  53. package/components/Icon/PencilIcon.js +1 -0
  54. package/components/Icon/PermissionIcon.d.ts +7 -0
  55. package/components/Icon/PermissionIcon.js +1 -0
  56. package/components/Icon/ProductBoxIcon.d.ts +7 -0
  57. package/components/Icon/ProductBoxIcon.js +1 -0
  58. package/components/Icon/ProductIcon.d.ts +7 -0
  59. package/components/Icon/ProductIcon.js +1 -0
  60. package/components/Icon/QuoteIcon.d.ts +7 -0
  61. package/components/Icon/QuoteIcon.js +1 -0
  62. package/components/Icon/ResetPasswordIcon.d.ts +7 -0
  63. package/components/Icon/ResetPasswordIcon.js +1 -0
  64. package/components/Icon/RoleIcon.d.ts +7 -0
  65. package/components/Icon/RoleIcon.js +1 -0
  66. package/components/Icon/ShieldUserIcon.d.ts +7 -0
  67. package/components/Icon/ShieldUserIcon.js +1 -0
  68. package/components/Icon/SyncIcon.d.ts +6 -0
  69. package/components/Icon/SyncIcon.js +1 -0
  70. package/components/Icon/UpdateIcon.d.ts +7 -0
  71. package/components/Icon/UpdateIcon.js +1 -0
  72. package/components/Icon/UserEditIcon.d.ts +7 -0
  73. package/components/Icon/UserEditIcon.js +1 -0
  74. package/components/Icon/UserIcon.d.ts +7 -0
  75. package/components/Icon/UserIcon.js +1 -0
  76. package/components/Icon/index.d.ts +23 -0
  77. package/components/Icon/index.js +1 -1
  78. package/components/Image/Image.d.ts +1 -1
  79. package/components/Image/Image.js +1 -1
  80. package/components/Radio/Radio.js +1 -1
  81. package/components/Select/Select.js +1 -1
  82. package/hooks/useAssetDownload.d.ts +14 -0
  83. package/hooks/useAssetDownload.js +1 -0
  84. package/package.json +2 -1
  85. package/utils/asset-url.d.ts +69 -0
  86. package/utils/asset-url.js +1 -0
@@ -0,0 +1,46 @@
1
+ import { ReactNode } from 'react';
2
+ export interface UpgradePromptProps {
3
+ /** Human-readable feature name for error message */
4
+ featureName?: string;
5
+ /** Custom icon to render instead of default */
6
+ icon?: ReactNode;
7
+ /** Custom content to render instead of default */
8
+ children?: ReactNode;
9
+ /** URL to navigate to for subscription management */
10
+ upgradeUrl?: string;
11
+ /** Callback when "Manage Subscription" is clicked (alternative to upgradeUrl) */
12
+ onManageSubscription?: () => void;
13
+ }
14
+ /**
15
+ * Shown when the account's subscription doesn't include a feature.
16
+ * Prompts user to upgrade their subscription.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * // With upgrade URL
21
+ * <UpgradePrompt
22
+ * featureName="Advanced Analytics"
23
+ * upgradeUrl="/settings/subscription"
24
+ * />
25
+ *
26
+ * // With callback
27
+ * <UpgradePrompt
28
+ * featureName="Advanced Analytics"
29
+ * onManageSubscription={() => router.push('/settings/subscription')}
30
+ * />
31
+ *
32
+ * // Custom icon
33
+ * <UpgradePrompt
34
+ * featureName="Reports"
35
+ * icon={<DiamondIcon size={24} className="text-purple-500" />}
36
+ * upgradeUrl="/upgrade"
37
+ * />
38
+ *
39
+ * // Custom content
40
+ * <UpgradePrompt>
41
+ * <CustomUpgradeCard />
42
+ * </UpgradePrompt>
43
+ * ```
44
+ */
45
+ export declare function UpgradePrompt({ featureName, icon, children, upgradeUrl, onManageSubscription, }: UpgradePromptProps): string | number | bigint | true | Iterable<ReactNode> | Promise<import('react').AwaitedReactNode> | import("react/jsx-runtime").JSX.Element;
46
+ export default UpgradePrompt;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Button as m}from"../Button/Button.js";import{Link as a}from"../Link/Link.js";import"../Link/LinkContext.js";import{GemIcon as c}from"../Icon/GemIcon.js";import"react";import"react-aria-components";import"../../utils/cn.js";import"../Link/utils.js";function y({featureName:t,icon:o,children:r,upgradeUrl:i,onManageSubscription:n}){return r||e("div",{className:"border border-slate-200 rounded-lg bg-white",children:s("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[e("div",{className:"w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center mb-4",children:o??e(c,{size:24})}),e("p",{className:"text-lg font-medium text-slate-600 mb-2",children:"Upgrade Your Account"}),s("p",{className:"text-sm text-slate-500 text-center max-w-md",children:[t?`Access to ${t} requires a premium subscription.`:"This feature requires a premium subscription."," ","Upgrade your account to unlock this and other powerful features."]}),i?e(a,{href:i,className:"mt-8 inline-flex items-center justify-center px-4 py-2 bg-slate-900 text-white font-medium rounded-lg hover:bg-slate-800 transition-colors",children:"Manage Subscription"}):e(m,{variant:"solid",className:"mt-8",onPress:n,children:"Manage Subscription"})]})})}export{y as UpgradePrompt,y as default};
@@ -0,0 +1,5 @@
1
+ export { AccessDenied, type AccessDeniedProps } from './AccessDenied';
2
+ export { FeatureGate, type FeatureGateProps } from './FeatureGate';
3
+ export { PermissionRequired, type PermissionRequiredProps, } from './PermissionRequired';
4
+ export { UpgradePrompt, type UpgradePromptProps } from './UpgradePrompt';
5
+ export { PermissionsProvider, type PermissionsProviderProps, usePermissions, useAccountPermissions, useAccount, IsAllowedTo, type IsAllowedToProps, } from './PermissionsProvider';
@@ -0,0 +1 @@
1
+ import{AccessDenied as d}from"./AccessDenied.js";import{FeatureGate as x}from"./FeatureGate.js";import{PermissionRequired as a}from"./PermissionRequired.js";import{UpgradePrompt as g}from"./UpgradePrompt.js";import{IsAllowedTo as v,PermissionsProvider as w,useAccount as D,useAccountPermissions as F,usePermissions as G}from"./PermissionsProvider.js";import"react/jsx-runtime";import"../Icon/LockIcon.js";import"../../utils/cn.js";import"../Button/Button.js";import"react";import"react-aria-components";import"../Link/Link.js";import"../Link/LinkContext.js";import"../Link/utils.js";import"../Icon/GemIcon.js";export{d as AccessDenied,x as FeatureGate,v as IsAllowedTo,a as PermissionRequired,w as PermissionsProvider,g as UpgradePrompt,D as useAccount,F as useAccountPermissions,G as usePermissions};
@@ -0,0 +1,7 @@
1
+ export interface ArrowLeftIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Arrow left icon for back navigation */
6
+ export declare function ArrowLeftIcon({ className, size }: ArrowLeftIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default ArrowLeftIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function h({className:t,size:r=16}){return e("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",t),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("path",{d:"M6 8L2 12L6 16"}),o("path",{d:"M2 12H22"})]})}export{h as ArrowLeftIcon,h as default};
@@ -0,0 +1,7 @@
1
+ export interface CloseIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Close icon (X) */
6
+ export declare function CloseIcon({ className, size }: CloseIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default CloseIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function h({className:t,size:o=20}){return e("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",t),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M18 6 6 18"}),r("path",{d:"m6 6 12 12"})]})}export{h as CloseIcon,h as default};
@@ -0,0 +1,7 @@
1
+ export interface CreateIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Create icon (file with plus) */
6
+ export declare function CreateIcon({ className, size }: CreateIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default CreateIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function s({className:o,size:r=16}){return e("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",o),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),t("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),t("path",{d:"M9 15h6"}),t("path",{d:"M12 18v-6"})]})}export{s as CreateIcon,s as default};
@@ -0,0 +1,7 @@
1
+ export interface DeleteIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Delete icon (trash) */
6
+ export declare function DeleteIcon({ className, size }: DeleteIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default DeleteIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function h({className:o,size:t=16}){return r("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",o),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e("path",{d:"M3 6h18"}),e("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),e("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),e("line",{x1:"10",x2:"10",y1:"11",y2:"17"}),e("line",{x1:"14",x2:"14",y1:"11",y2:"17"})]})}export{h as DeleteIcon,h as default};
@@ -0,0 +1,7 @@
1
+ import { IconProps } from './Icon.types';
2
+ export interface GemIconProps extends IconProps {
3
+ size?: number;
4
+ }
5
+ /** Gem icon for premium/upgrade features (from Lucide) */
6
+ export declare function GemIcon({ className, size, style }: GemIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default GemIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as t}from"react/jsx-runtime";import{cn as s}from"../../utils/cn.js";function l({className:r,size:o=24,style:e}){return n("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:s("text-purple-500",r),style:e,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M6 3h12l4 6-10 13L2 9z"}),t("path",{d:"M11 3 8 9l4 13 4-13-3-6"}),t("path",{d:"M2 9h20"})]})}export{l as GemIcon,l as default};
@@ -0,0 +1,11 @@
1
+ import { IconProps } from './Icon.types';
2
+ export interface IncludedIconProps extends IconProps {
3
+ size?: number;
4
+ }
5
+ /**
6
+ * Icon indicating a permission is already included/provided.
7
+ * Used to show that a permission is active through the product or baseline,
8
+ * even though it hasn't been directly assigned.
9
+ */
10
+ export declare function IncludedIcon({ className, size, style, }: IncludedIconProps): import("react/jsx-runtime").JSX.Element;
11
+ export default IncludedIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as o}from"react/jsx-runtime";import{cn as i}from"../../utils/cn.js";function l({className:e,size:r=16,style:n}){return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:i("flex-shrink-0",e),style:n,children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("path",{d:"m9 12 2 2 4-4"})]})}export{l as IncludedIcon,l as default};
@@ -0,0 +1,7 @@
1
+ export interface InfoIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Info icon (circle with i) */
6
+ export declare function InfoIcon({ className, size }: InfoIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default InfoIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as r}from"react/jsx-runtime";import{cn as e}from"../../utils/cn.js";function c({className:t,size:o=16}){return n("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e("flex-shrink-0",t),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"10"}),r("path",{d:"M12 16v-4"}),r("path",{d:"M12 8h.01"})]})}export{c as InfoIcon,c as default};
@@ -0,0 +1,7 @@
1
+ export interface InvoiceIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Invoice icon (credit card) */
6
+ export declare function InvoiceIcon({ className, size }: InvoiceIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default InvoiceIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as o}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function h({className:e,size:r=16}){return t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",e),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}),o("line",{x1:"2",x2:"22",y1:"10",y2:"10"})]})}export{h as InvoiceIcon,h as default};
@@ -0,0 +1,7 @@
1
+ import { IconProps } from './Icon.types';
2
+ export interface LockIconProps extends IconProps {
3
+ size?: number;
4
+ }
5
+ /** Lock icon for permission-restricted features (from Lucide) */
6
+ export declare function LockIcon({ className, size, style }: LockIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default LockIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as o}from"react/jsx-runtime";import{cn as i}from"../../utils/cn.js";function c({className:r,size:t=24,style:e}){return n("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("text-yellow-500",r),style:e,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),o("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}export{c as LockIcon,c as default};
@@ -0,0 +1,7 @@
1
+ import { IconProps } from './Icon.types';
2
+ export interface NoEntryIconProps extends IconProps {
3
+ size?: number;
4
+ }
5
+ /** No entry/ban icon for access denied states (from Lucide) */
6
+ export declare function NoEntryIcon({ className, size, style }: NoEntryIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default NoEntryIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as o}from"react/jsx-runtime";import{cn as i}from"../../utils/cn.js";function l({className:t,size:r=24,style:e}){return n("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i("text-red-500",t),style:e,stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("circle",{cx:"12",cy:"12",r:"10"}),o("line",{x1:"4.93",y1:"4.93",x2:"19.07",y2:"19.07"})]})}export{l as NoEntryIcon,l as default};
@@ -0,0 +1,7 @@
1
+ export interface NoteIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Note icon (notebook with pen) */
6
+ export declare function NoteIcon({ className, size }: NoteIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default NoteIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as a,jsx as t}from"react/jsx-runtime";import{cn as h}from"../../utils/cn.js";function s({className:r,size:o=16}){return a("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:h("flex-shrink-0",r),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4"}),t("path",{d:"M2 6h4"}),t("path",{d:"M2 10h4"}),t("path",{d:"M2 14h4"}),t("path",{d:"M2 18h4"}),t("path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"})]})}export{s as NoteIcon,s as default};
@@ -0,0 +1,7 @@
1
+ export interface PencilIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Pencil icon (simple edit pencil) */
6
+ export declare function PencilIcon({ className, size }: PencilIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default PencilIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as r}from"react/jsx-runtime";import{cn as e}from"../../utils/cn.js";function l({className:t,size:o=16}){return n("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e("flex-shrink-0",t),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),r("path",{d:"m15 5 4 4"})]})}export{l as PencilIcon,l as default};
@@ -0,0 +1,7 @@
1
+ export interface PermissionIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Permission icon (sliders horizontal) */
6
+ export declare function PermissionIcon({ className, size }: PermissionIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default PermissionIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as i,jsx as n}from"react/jsx-runtime";import{cn as o}from"../../utils/cn.js";function l({className:x,size:e=16}){return i("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o("flex-shrink-0",x),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n("line",{x1:"21",x2:"14",y1:"4",y2:"4"}),n("line",{x1:"10",x2:"3",y1:"4",y2:"4"}),n("line",{x1:"21",x2:"12",y1:"12",y2:"12"}),n("line",{x1:"8",x2:"3",y1:"12",y2:"12"}),n("line",{x1:"21",x2:"16",y1:"20",y2:"20"}),n("line",{x1:"12",x2:"3",y1:"20",y2:"20"}),n("line",{x1:"14",x2:"14",y1:"2",y2:"6"}),n("line",{x1:"8",x2:"8",y1:"10",y2:"14"}),n("line",{x1:"16",x2:"16",y1:"18",y2:"22"})]})}export{l as PermissionIcon,l as default};
@@ -0,0 +1,7 @@
1
+ export interface ProductBoxIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Product box/package icon */
6
+ export declare function ProductBoxIcon({ className, size }: ProductBoxIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default ProductBoxIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as o}from"react/jsx-runtime";import{cn as e}from"../../utils/cn.js";function i({className:r,size:t=16}){return n("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e("flex-shrink-0",r),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("path",{d:"m7.5 4.27 9 5.15"}),o("path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"}),o("path",{d:"m3.3 7 8.7 5 8.7-5"}),o("path",{d:"M12 22V12"})]})}export{i as ProductBoxIcon,i as default};
@@ -0,0 +1,7 @@
1
+ export interface ProductIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Product icon (package/box) from Lucide */
6
+ export declare function ProductIcon({ className, size }: ProductIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default ProductIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as t}from"react/jsx-runtime";import{cn as e}from"../../utils/cn.js";function i({className:r,size:o=16}){return n("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e("flex-shrink-0",r),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}),t("path",{d:"M12 22V12"}),t("path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7"}),t("path",{d:"m7.5 4.27 9 5.15"})]})}export{i as ProductIcon,i as default};
@@ -0,0 +1,7 @@
1
+ export interface QuoteIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Quote icon (file with plus) */
6
+ export declare function QuoteIcon({ className, size }: QuoteIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default QuoteIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function s({className:r,size:o=16}){return e("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",r),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),t("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),t("path",{d:"M9 15h6"}),t("path",{d:"M12 18v-6"})]})}export{s as QuoteIcon,s as default};
@@ -0,0 +1,7 @@
1
+ export interface ResetPasswordIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Reset password icon (key with refresh) */
6
+ export declare function ResetPasswordIcon({ className, size, }: ResetPasswordIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default ResetPasswordIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function h({className:o,size:t=16}){return e("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",o),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"m14.5 9.5 1 1"}),r("path",{d:"m15.5 8.5-4 4"}),r("path",{d:"M3 12a9 9 0 1 0 9-9 9.74 9.74 0 0 0-6.74 2.74L3 8"}),r("path",{d:"M3 3v5h5"}),r("circle",{cx:"10",cy:"14",r:"2"})]})}export{h as ResetPasswordIcon,h as default};
@@ -0,0 +1,7 @@
1
+ export interface RoleIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Role icon (credit card style) for role-related UI */
6
+ export declare function RoleIcon({ className, size }: RoleIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default RoleIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as o}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function h({className:e,size:r=16}){return t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",e),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}),o("line",{x1:"2",x2:"22",y1:"10",y2:"10"})]})}export{h as RoleIcon,h as default};
@@ -0,0 +1,7 @@
1
+ export interface ShieldUserIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Shield user icon (shield with user) for role-related UI */
6
+ export declare function ShieldUserIcon({ className, size }: ShieldUserIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default ShieldUserIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as r}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function i({className:e,size:o=16}){return t("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",e),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),r("circle",{cx:"12",cy:"11",r:"2"}),r("path",{d:"M16 16c0-1.7-1.3-3-4-3s-4 1.3-4 3"})]})}export{i as ShieldUserIcon,i as default};
@@ -0,0 +1,6 @@
1
+ export interface SyncIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ export declare function SyncIcon({ className, size }: SyncIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export default SyncIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as n,jsx as t}from"react/jsx-runtime";import{cn as e}from"../../utils/cn.js";function i({className:r,size:o=16}){return n("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e("flex-shrink-0",r),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),t("path",{d:"M3 3v5h5"}),t("path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}),t("path",{d:"M16 16h5v5"})]})}export{i as SyncIcon,i as default};
@@ -0,0 +1,7 @@
1
+ export interface UpdateIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** Update icon (file with pen) */
6
+ export declare function UpdateIcon({ className, size }: UpdateIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default UpdateIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as a,jsx as t}from"react/jsx-runtime";import{cn as e}from"../../utils/cn.js";function h({className:r,size:o=16}){return a("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e("flex-shrink-0",r),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[t("path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2"}),t("path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),t("path",{d:"M8 18h1"})]})}export{h as UpdateIcon,h as default};
@@ -0,0 +1,7 @@
1
+ export interface UserEditIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** User edit icon (user with pen) */
6
+ export declare function UserEditIcon({ className, size }: UserEditIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default UserEditIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function a({className:t,size:o=16}){return e("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("flex-shrink-0",t),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M2 21a8 8 0 0 1 10.821-7.487"}),r("path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z"}),r("circle",{cx:"10",cy:"8",r:"5"})]})}export{a as UserEditIcon,a as default};
@@ -0,0 +1,7 @@
1
+ export interface UserIconProps {
2
+ className?: string;
3
+ size?: number;
4
+ }
5
+ /** User icon (from Lucide) */
6
+ export declare function UserIcon({ className, size }: UserIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export default UserIcon;
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as o}from"react/jsx-runtime";import{cn as n}from"../../utils/cn.js";function c({className:t,size:r=16}){return e("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n("text-ffl-gray-500 flex-shrink-0",t),stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),o("circle",{cx:"12",cy:"7",r:"4"})]})}export{c as UserIcon,c as default};
@@ -10,4 +10,27 @@ export { Plus } from './Plus';
10
10
  export { Search } from './Search';
11
11
  export { Trash } from './Trash';
12
12
  export { Verified } from './Verified';
13
+ export { ArrowLeftIcon } from './ArrowLeftIcon';
14
+ export { CloseIcon } from './CloseIcon';
15
+ export { CreateIcon } from './CreateIcon';
16
+ export { DeleteIcon } from './DeleteIcon';
17
+ export { GemIcon, type GemIconProps } from './GemIcon';
18
+ export { IncludedIcon } from './IncludedIcon';
19
+ export { InfoIcon } from './InfoIcon';
20
+ export { InvoiceIcon } from './InvoiceIcon';
21
+ export { LockIcon, type LockIconProps } from './LockIcon';
22
+ export { NoEntryIcon, type NoEntryIconProps } from './NoEntryIcon';
23
+ export { NoteIcon } from './NoteIcon';
24
+ export { PencilIcon } from './PencilIcon';
25
+ export { PermissionIcon } from './PermissionIcon';
26
+ export { ProductBoxIcon } from './ProductBoxIcon';
27
+ export { ProductIcon } from './ProductIcon';
28
+ export { QuoteIcon } from './QuoteIcon';
29
+ export { ResetPasswordIcon } from './ResetPasswordIcon';
30
+ export { RoleIcon } from './RoleIcon';
31
+ export { ShieldUserIcon } from './ShieldUserIcon';
32
+ export { SyncIcon } from './SyncIcon';
33
+ export { UpdateIcon } from './UpdateIcon';
34
+ export { UserEditIcon } from './UserEditIcon';
35
+ export { UserIcon } from './UserIcon';
13
36
  export type { IconProps } from './Icon.types';
@@ -1 +1 @@
1
- import{Account as t}from"./Account.js";import{Cart as f}from"./Cart.js";import{Checkmark as i}from"./Checkmark.js";import{Cross as s}from"./Cross.js";import{DownArrow as n}from"./DownArrow.js";import{Hamburger as h}from"./Hamburger.js";import{LinkArrow as w}from"./LinkArrow.js";import{Minus as C}from"./Minus.js";import{Plus as d}from"./Plus.js";import{Search as l}from"./Search.js";import{Trash as H}from"./Trash.js";import{Verified as M}from"./Verified.js";import"react/jsx-runtime";import"../../utils/cn.js";export{t as Account,f as Cart,i as Checkmark,s as Cross,n as DownArrow,h as Hamburger,w as LinkArrow,C as Minus,d as Plus,l as Search,H as Trash,M as Verified};
1
+ import{Account as m}from"./Account.js";import{Cart as p}from"./Cart.js";import{Checkmark as c}from"./Checkmark.js";import{Cross as I}from"./Cross.js";import{DownArrow as i}from"./DownArrow.js";import{Hamburger as a}from"./Hamburger.js";import{LinkArrow as l}from"./LinkArrow.js";import{Minus as w}from"./Minus.js";import{Plus as h}from"./Plus.js";import{Search as A}from"./Search.js";import{Trash as L}from"./Trash.js";import{Verified as y}from"./Verified.js";import{ArrowLeftIcon as E}from"./ArrowLeftIcon.js";import{CloseIcon as R}from"./CloseIcon.js";import{CreateIcon as g}from"./CreateIcon.js";import{DeleteIcon as B}from"./DeleteIcon.js";import{GemIcon as H}from"./GemIcon.js";import{IncludedIcon as Q}from"./IncludedIcon.js";import{InfoIcon as V}from"./InfoIcon.js";import{InvoiceIcon as q}from"./InvoiceIcon.js";import{LockIcon as F}from"./LockIcon.js";import{NoEntryIcon as K}from"./NoEntryIcon.js";import{NoteIcon as W}from"./NoteIcon.js";import{PencilIcon as Y}from"./PencilIcon.js";import{PermissionIcon as _}from"./PermissionIcon.js";import{ProductBoxIcon as oo}from"./ProductBoxIcon.js";import{ProductIcon as eo}from"./ProductIcon.js";import{QuoteIcon as mo}from"./QuoteIcon.js";import{ResetPasswordIcon as po}from"./ResetPasswordIcon.js";import{RoleIcon as co}from"./RoleIcon.js";import{ShieldUserIcon as Io}from"./ShieldUserIcon.js";import{SyncIcon as io}from"./SyncIcon.js";import{UpdateIcon as uo}from"./UpdateIcon.js";import{UserEditIcon as Po}from"./UserEditIcon.js";import{UserIcon as Co}from"./UserIcon.js";import"react/jsx-runtime";import"../../utils/cn.js";export{m as Account,E as ArrowLeftIcon,p as Cart,c as Checkmark,R as CloseIcon,g as CreateIcon,I as Cross,B as DeleteIcon,i as DownArrow,H as GemIcon,a as Hamburger,Q as IncludedIcon,V as InfoIcon,q as InvoiceIcon,l as LinkArrow,F as LockIcon,w as Minus,K as NoEntryIcon,W as NoteIcon,Y as PencilIcon,_ as PermissionIcon,h as Plus,oo as ProductBoxIcon,eo as ProductIcon,mo as QuoteIcon,po as ResetPasswordIcon,co as RoleIcon,A as Search,Io as ShieldUserIcon,io as SyncIcon,L as Trash,uo as UpdateIcon,Po as UserEditIcon,Co as UserIcon,y as Verified};
@@ -1,3 +1,3 @@
1
1
  import { ImageProps } from 'next/image';
2
- export declare function Image({ src, className, ...rest }: ImageProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Image({ src, className, style, ...rest }: ImageProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default Image;
@@ -1 +1 @@
1
- import{jsx as g}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{N as p}from"../../assets/image-k0c3_NVg.js";import{cn as u}from"../../utils/cn.js";import"../../assets/_interop_require_wildcard-hxwiIWAf.js";import"react-dom";function C({src:e,className:a,...i}){const[m,s]=t(!0),[n,o]=t(e),[l,f]=t(!1);return r(()=>o(e),[e]),r(()=>f(!0),[]),g(p,{src:n,className:u("transition-[filter] ease-linear duration-200",l&&m&&"blur-md",a),onError:()=>o("/images/placeholder.jpg"),onLoad:()=>s(!1),...i})}export{C as Image,C as default};
1
+ import{jsx as p}from"react/jsx-runtime";import{useState as i,useEffect as n}from"react";import{N as u}from"../../assets/image-k0c3_NVg.js";import{cn as c}from"../../utils/cn.js";import"../../assets/_interop_require_wildcard-hxwiIWAf.js";import"react-dom";function z({src:e,className:r,style:o,...t}){const[s,m]=i(!0),[l,a]=i(e),[g,f]=i(!1);n(()=>a(e),[e]),n(()=>f(!0),[]);const d="width"in t&&"height"in t&&!("fill"in t)?{width:"auto",height:"auto",...o}:o;return p(u,{src:l,className:c("transition-[filter] ease-linear duration-200",g&&s&&"blur-md",r),style:d,onError:()=>a("/images/placeholder.jpg"),onLoad:()=>m(!1),...t})}export{z as Image,z as default};
@@ -1 +1 @@
1
- import{jsx as i,jsxs as c,Fragment as p}from"react/jsx-runtime";import{Radio as g}from"react-aria-components";import{cn as l}from"../../utils/cn.js";function x({control:e,classNames:a,isHovered:t,isFocused:r,isFocusVisible:u,isDisabled:d,isInvalid:o,isSelected:n,isPressed:b,isReadOnly:f,isRequired:s,defaultChildren:m,...h}){const v={isHovered:t,isFocused:r,isFocusVisible:u,isDisabled:d,isInvalid:o,isSelected:n,isPressed:b,isReadOnly:f,isRequired:s};return e?typeof e=="function"?e(v):e:i("div",{"data-hovered":t,"data-focused":r,"data-disabled":d,"data-invalid":o,"data-selected":n,"data-pressed":b,className:l("flex items-center justify-center w-6 h-6 border-solid border border-slate-300 ransition-all duration-300 ease rounded-full",'data-[hovered="true"]:border-slate-400','data-[focused="true"]:border-slate-400 data-[focused="true"]:outline-2 data-[focused="true"]:outline data-[focused="true"]:outline-slate-200','data-[disabled="true"]:border-slate-200 data-[disabled="true"]:bg-slate-100','data-[invalid="true"]:bg-red-100 data-[invalid="true"]:text-red-600 data-[invalid="true"]:border-red-500','data-[invalid="true"]:data-[disabled="true"]:border-red-200 data-[invalid="true"]:data-[disabled="true"]:bg-red-100','data-[invalid="true"]:data-[hovered="true"]:border-red-600','data-[invalid="true"]:data-[focused="true"]:border-red-600 data-[invalid="true"]:data-[focused="true"]:outline-red-200','data-[invalid="true"]:data-[selected="true"]:bg-red-100 data-[invalid="true"]:data-[selected="true"]:border-red-500','data-[invalid="true"]:data-[pressed="true"]:bg-red-600 data-[invalid="true"]:data-[pressed="true"]:border-red-600',a==null?void 0:a.control),children:i("div",{"data-invalid":o,className:l('w-3 h-3 rounded-full bg-slate-900 opacity-0 transition-all duration-300 ease data-[invalid="true"]:bg-red-500',{"opacity-100":n})})})}function w({children:e,slots:a,className:t,classNames:r,...u}){return i(g,{className:l("flex items-center gap-2 group","invalid:text-red-500 invalid:disabled:text-red-300","disabled:text-slate-400",t),...u,children:d=>c(p,{children:[i(x,{control:a==null?void 0:a.control,classNames:r,...d}),typeof e=="function"?e(d):e]})})}export{w as Radio,w as default};
1
+ import{jsx as i,jsxs as c,Fragment as p}from"react/jsx-runtime";import{Radio as g}from"react-aria-components";import{cn as l}from"../../utils/cn.js";function x({control:e,classNames:d,isHovered:t,isFocused:r,isFocusVisible:u,isDisabled:a,isInvalid:o,isSelected:n,isPressed:b,isReadOnly:f,isRequired:s,defaultChildren:m,...h}){const v={isHovered:t,isFocused:r,isFocusVisible:u,isDisabled:a,isInvalid:o,isSelected:n,isPressed:b,isReadOnly:f,isRequired:s};return e?typeof e=="function"?e(v):e:i("div",{"data-hovered":t,"data-focused":r,"data-disabled":a,"data-invalid":o,"data-selected":n,"data-pressed":b,className:l("flex items-center justify-center w-6 h-6 border-solid border border-slate-300 ransition-all duration-300 ease rounded-full",'data-[hovered="true"]:border-slate-400','data-[focused="true"]:border-slate-400 data-[focused="true"]:outline-2 data-[focused="true"]:outline data-[focused="true"]:outline-slate-200','data-[disabled="true"]:border-slate-200 data-[disabled="true"]:bg-slate-100','data-[invalid="true"]:bg-red-100 data-[invalid="true"]:text-red-600 data-[invalid="true"]:border-red-500','data-[invalid="true"]:data-[disabled="true"]:border-red-200 data-[invalid="true"]:data-[disabled="true"]:bg-red-100','data-[invalid="true"]:data-[hovered="true"]:border-red-600','data-[invalid="true"]:data-[focused="true"]:border-red-600 data-[invalid="true"]:data-[focused="true"]:outline-red-200','data-[invalid="true"]:data-[selected="true"]:bg-red-100 data-[invalid="true"]:data-[selected="true"]:border-red-500','data-[invalid="true"]:data-[pressed="true"]:bg-red-600 data-[invalid="true"]:data-[pressed="true"]:border-red-600',d==null?void 0:d.control),children:i("div",{"data-invalid":o,className:l('w-3 h-3 rounded-full bg-slate-900 opacity-0 transition-all duration-300 ease data-[invalid="true"]:bg-red-500',{"opacity-100":n})})})}function w({children:e,slots:d,className:t,classNames:r,...u}){return i(g,{className:l("flex items-center gap-2 group","invalid:text-red-500 invalid:disabled:text-red-300","disabled:text-slate-400",t),...u,children:a=>c(p,{children:[i(x,{control:d==null?void 0:d.control,classNames:r,...a}),typeof e=="function"?e(a):e]})})}export{w as Radio,w as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as f,Fragment as k}from"react/jsx-runtime";import{Popover as _,ComboBox as c,Label as L,Input as I,Button as S,Text as j,FieldError as y,ListBox as D}from"react-aria-components";import{forwardRef as F}from"react";import{cn as d}from"../../utils/cn.js";import"framer-motion";import{Pulse as M}from"../Loader/Pulse.js";function P({buttonIcon:i,...o}){return i?typeof i=="function"?i(o):i:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:d("transition-all ease-in-out duration-200",o.isOpen?"rotate-180":"rotate-0"),children:e("path",{d:"M6 9L12 15L18 9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d(["stroke-slate-900",o.isDisabled&&"stroke-slate-400",o.isInvalid&&"stroke-red-500"])})})}function E({listBoxComponent:i,children:o,...n}){return e(i||D,{...n,children:o})}function O({label:i,description:o,errorMessage:n,children:a,placeholder:b,isLoading:l,slots:r,popoverOffset:p,selectedKey:u,className:h,classNames:t,autoComplete:v,...x},w){const g=d("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-[var(--trigger-width)]","bg-white","border border-solid border-slate-300",t==null?void 0:t.listContainer),B=e(_,{offset:p,className:g,children:e(E,{listBoxComponent:r==null?void 0:r.listBoxComponent,className:d("max-h-80","overflow-y-scroll",t==null?void 0:t.list),children:a})});return e(c,{isDisabled:x.isDisabled||l,"data-has-value":!!u,selectedKey:u,...x,className:d("flex flex-col","w-full",h),children:C=>f(k,{children:[e(L,{className:d("flex","text-xs text-slate-500",t==null?void 0:t.label),children:i}),f("div",{className:d("flex","relative","w-full",t==null?void 0:t.comboBoxContainer),children:[e(I,{placeholder:b,className:d("border border-solid border-slate-300","text-sm text-slate-900","py-0 px-2","h-10 w-full","m-0","rounded-md","bg-white","transition-all ease-in-out duration-200","data-[hovered]:border-slate-400","data-[focused]:border-slate-400 data-[focused]:outline data-[focused]:outline-2 data-[focused]:outline-slate-200"," data-[disabled]:bg-slate-100 data-[disabled]:border-slate-300",l?"data-[disabled]:text-slate-900":"data-[disabled]:text-slate-500","data-[invalid]:border-red-500 data-[invalid]:bg-red-100 data-[invalid]:text-red-600","data-[invalid]:data-[hovered]:border-red-600","data-[invalid]:data-[focused]:border-red-600 data-[invalid]:data-[focused]:outline data-[invalid]:data-[focused]:outline-2 data-[invalid]:data-[focused]:outline-red-200","data-[invalid]:placeholder:text-slate-400",t==null?void 0:t.input),ref:w,autoComplete:v}),l?e("div",{className:d("absolute top-2 right-2","block",t==null?void 0:t.loader),children:(r==null?void 0:r.loadingIcon)||e(M,{})}):e(S,{className:d("absolute top-2 right-0","block","border-none","bg-none",t==null?void 0:t.arrowButton),children:e(P,{buttonIcon:r==null?void 0:r.buttonIcon,...C})})]}),o&&e(j,{slot:"description",className:d("flex","text-xs","text-slate-500",t==null?void 0:t.description),children:o}),e(y,{className:d("flex","text-xs","text-red-500",t==null?void 0:t.errorMessage),children:n}),B]})})}const G=F(O);export{G as Select,G as default};
1
+ import{jsx as e,jsxs as f,Fragment as _}from"react/jsx-runtime";import{Popover as c,ComboBox as L,Label as S,Input as y,Button as I,Text as j,FieldError as D,ListBox as F}from"react-aria-components";import{forwardRef as M}from"react";import{cn as d}from"../../utils/cn.js";import"framer-motion";import{Pulse as P}from"../Loader/Pulse.js";function z({buttonIcon:i,...o}){return i?typeof i=="function"?i(o):i:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:d("transition-all ease-in-out duration-200",o.isOpen?"rotate-180":"rotate-0"),children:e("path",{d:"M6 9L12 15L18 9",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d(["stroke-slate-900",o.isDisabled&&"stroke-slate-400",o.isInvalid&&"stroke-red-500"])})})}function E({listBoxComponent:i,children:o,...n}){return e(i||F,{...n,children:o})}function O({label:i,description:o,errorMessage:n,children:u,placeholder:b,isLoading:l,slots:r,popoverOffset:p,selectedKey:a,className:h,classNames:t,autoComplete:v,...x},w){const g=d("px-0 py-1.5","shadow-[0_10px_15px_-3px_rgba(0,0,0,0.1),0_4px_6px_-4px_rgba(0,0,0,0.1)]","rounded-md","w-[var(--trigger-width)]","bg-white","border border-solid border-slate-300",t==null?void 0:t.listContainer),B=e(c,{offset:p,className:g,children:e(E,{listBoxComponent:r==null?void 0:r.listBoxComponent,className:d("max-h-80","overflow-y-scroll",t==null?void 0:t.list),children:u})}),C=a===void 0?null:a;return e(L,{isDisabled:x.isDisabled||l,"data-has-value":!!a,selectedKey:C,...x,className:d("flex flex-col","w-full",h),children:k=>f(_,{children:[e(S,{className:d("flex","text-xs text-slate-500",t==null?void 0:t.label),children:i}),f("div",{className:d("flex","relative","w-full",t==null?void 0:t.comboBoxContainer),children:[e(y,{placeholder:b,className:d("border border-solid border-slate-300","text-sm text-slate-900","py-0 px-2","h-10 w-full","m-0","rounded-md","bg-white","transition-all ease-in-out duration-200","data-[hovered]:border-slate-400","data-[focused]:border-slate-400 data-[focused]:outline data-[focused]:outline-2 data-[focused]:outline-slate-200"," data-[disabled]:bg-slate-100 data-[disabled]:border-slate-300",l?"data-[disabled]:text-slate-900":"data-[disabled]:text-slate-500","data-[invalid]:border-red-500 data-[invalid]:bg-red-100 data-[invalid]:text-red-600","data-[invalid]:data-[hovered]:border-red-600","data-[invalid]:data-[focused]:border-red-600 data-[invalid]:data-[focused]:outline data-[invalid]:data-[focused]:outline-2 data-[invalid]:data-[focused]:outline-red-200","data-[invalid]:placeholder:text-slate-400",t==null?void 0:t.input),ref:w,autoComplete:v}),l?e("div",{className:d("absolute top-2 right-2","block",t==null?void 0:t.loader),children:(r==null?void 0:r.loadingIcon)||e(P,{})}):e(I,{className:d("absolute top-2 right-0","block","border-none","bg-none",t==null?void 0:t.arrowButton),children:e(z,{buttonIcon:r==null?void 0:r.buttonIcon,...k})})]}),o&&e(j,{slot:"description",className:d("flex","text-xs","text-slate-500",t==null?void 0:t.description),children:o}),e(D,{className:d("flex","text-xs","text-red-500",t==null?void 0:t.errorMessage),children:n}),B]})})}const H=M(O);export{H as Select,H as default};
@@ -0,0 +1,14 @@
1
+ interface UseAssetDownloadOptions {
2
+ url: string;
3
+ filename: string;
4
+ autoDownload?: boolean;
5
+ headers?: Record<string, string>;
6
+ }
7
+ interface UseAssetDownloadResult {
8
+ downloadStarted: boolean;
9
+ isDownloading: boolean;
10
+ error: Error | null;
11
+ triggerDownload: () => Promise<void>;
12
+ }
13
+ export declare function useAssetDownload({ url, filename, autoDownload, headers, }: UseAssetDownloadOptions): UseAssetDownloadResult;
14
+ export default useAssetDownload;
@@ -0,0 +1 @@
1
+ import{useState as a,useCallback as m,useEffect as D}from"react";function k({url:l,filename:s,autoDownload:c=!0,headers:d={}}){const[t,u]=a(!1),[n,i]=a(!1),[b,w]=a(null),r=m(async()=>{try{i(!0),w(null);const o=await fetch(l,{headers:d});if(!o.ok)throw new Error(`Download failed: ${o.status}`);const h=await o.blob(),f=window.URL.createObjectURL(h),e=document.createElement("a");e.href=f,e.download=s,document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(f),u(!0)}catch(o){w(o instanceof Error?o:new Error("Download failed"))}finally{i(!1)}},[l,s,d]);return D(()=>{c&&!t&&!n&&r().catch(()=>{})},[c,t,n,r]),{downloadStarted:t,isDownloading:n,error:b,triggerDownload:r}}export{k as default,k as useAssetDownload};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",
@@ -38,6 +38,7 @@
38
38
  "@react-aria/interactions": "^3.21.1",
39
39
  "@react-stately/utils": "^3.9.1",
40
40
  "clsx": "2.1.1",
41
+ "jwt-decode": "^4.0.0",
41
42
  "tailwind-merge": "2.5.2",
42
43
  "next": "^14.2.3",
43
44
  "react-number-format": "^5.4.0"
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Asset URL utility for generating authenticated asset download URLs.
3
+ *
4
+ * URL patterns:
5
+ * /media/assets/{uuid} - latest version
6
+ * /media/assets/{uuid}?v={version} - specific version
7
+ * /media/assets/{uuid}/{filename} - with filename for SEO/clarity
8
+ * /media/assets/{uuid}/{filename}?v={version} - specific version with filename
9
+ *
10
+ * Query params:
11
+ * - v={version}: Request specific version number
12
+ * - download: Force download (attachment) instead of inline display
13
+ * - token={jwt}: JWT token for authenticated access (for SSE, direct links, etc.)
14
+ */
15
+ export interface AssetUrlOptions {
16
+ /** Specific version number to request */
17
+ version?: number;
18
+ /** Filename to include in URL (for SEO/clarity, must match actual filename) */
19
+ filename?: string;
20
+ /** Force download (attachment) instead of inline display */
21
+ download?: boolean;
22
+ /** JWT token for authenticated access (for direct links, emails, etc.) */
23
+ token?: string;
24
+ }
25
+ /**
26
+ * Generate an asset download URL.
27
+ *
28
+ * @param uuid - Asset UUID
29
+ * @param options - Optional URL configuration
30
+ * @returns Asset download URL
31
+ *
32
+ * @example
33
+ * // Basic usage - latest version
34
+ * getAssetUrl('550e8400-e29b-41d4-a716-446655440000')
35
+ * // => '/media/assets/550e8400-e29b-41d4-a716-446655440000'
36
+ *
37
+ * @example
38
+ * // With specific version
39
+ * getAssetUrl('550e8400-e29b-41d4-a716-446655440000', { version: 2 })
40
+ * // => '/media/assets/550e8400-e29b-41d4-a716-446655440000?v=2'
41
+ *
42
+ * @example
43
+ * // With filename and download flag
44
+ * getAssetUrl('550e8400-e29b-41d4-a716-446655440000', {
45
+ * filename: 'company-logo.png',
46
+ * download: true
47
+ * })
48
+ * // => '/media/assets/550e8400-e29b-41d4-a716-446655440000/company-logo.png?download'
49
+ *
50
+ * @example
51
+ * // With JWT token for authenticated direct link
52
+ * getAssetUrl('550e8400-e29b-41d4-a716-446655440000', { token: 'eyJ...' })
53
+ * // => '/media/assets/550e8400-e29b-41d4-a716-446655440000?token=eyJ...'
54
+ */
55
+ export declare function getAssetUrl(uuid: string, options?: AssetUrlOptions): string;
56
+ /**
57
+ * Generate an absolute asset download URL with origin.
58
+ *
59
+ * @param uuid - Asset UUID
60
+ * @param origin - Base URL origin (e.g., 'https://example.com')
61
+ * @param options - Optional URL configuration
62
+ * @returns Absolute asset download URL
63
+ *
64
+ * @example
65
+ * getAbsoluteAssetUrl('550e8400-e29b-41d4-a716-446655440000', 'https://clicktap.com')
66
+ * // => 'https://clicktap.com/media/assets/550e8400-e29b-41d4-a716-446655440000'
67
+ */
68
+ export declare function getAbsoluteAssetUrl(uuid: string, origin: string, options?: AssetUrlOptions): string;
69
+ export default getAssetUrl;
@@ -0,0 +1 @@
1
+ function d(o,s={}){const{version:e,filename:t,download:c,token:a}=s;let r=`/media/assets/${encodeURIComponent(o)}`;t&&(r+=`/${encodeURIComponent(t)}`);const n=new URLSearchParams;e!==void 0&&n.set("v",String(e)),c&&n.set("download",""),a&&n.set("token",a);const i=n.toString();return i?`${r}?${i}`:r}function l(o,s,e={}){const t=d(o,e);return`${s.replace(/\/$/,"")}${t}`}export{d as default,l as getAbsoluteAssetUrl,d as getAssetUrl};