shadcn-glass-ui 2.1.5 → 2.2.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 (28) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +11 -11
  3. package/context7.json +14 -3
  4. package/dist/cli/index.cjs +1 -1
  5. package/dist/components.cjs +4 -4
  6. package/dist/components.d.ts +18 -4
  7. package/dist/components.js +1 -1
  8. package/dist/hooks.cjs +2 -2
  9. package/dist/index.cjs +2320 -997
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +2284 -996
  12. package/dist/index.js.map +1 -1
  13. package/dist/shadcn-glass-ui.css +1 -1
  14. package/dist/{theme-context-Y98bGvcm.cjs → theme-context-D_cb9KzA.cjs} +2 -2
  15. package/dist/{theme-context-Y98bGvcm.cjs.map → theme-context-D_cb9KzA.cjs.map} +1 -1
  16. package/dist/themes.cjs +1 -1
  17. package/dist/{trust-score-card-glass-2rjz00d_.cjs → trust-score-card-glass-CTsEVRD3.cjs} +178 -35
  18. package/dist/{trust-score-card-glass-2rjz00d_.cjs.map → trust-score-card-glass-CTsEVRD3.cjs.map} +1 -1
  19. package/dist/{trust-score-card-glass-zjkx4OC2.js → trust-score-card-glass-CUStm4o_.js} +86 -15
  20. package/dist/{trust-score-card-glass-zjkx4OC2.js.map → trust-score-card-glass-CUStm4o_.js.map} +1 -1
  21. package/dist/{use-focus-DbpBEuee.cjs → use-focus--Hw2nevi.cjs} +2 -2
  22. package/dist/{use-focus-DbpBEuee.cjs.map → use-focus--Hw2nevi.cjs.map} +1 -1
  23. package/dist/{use-wallpaper-tint-DbawS9zh.cjs → use-wallpaper-tint-B4oMQsXQ.cjs} +2 -2
  24. package/dist/{use-wallpaper-tint-DbawS9zh.cjs.map → use-wallpaper-tint-B4oMQsXQ.cjs.map} +1 -1
  25. package/dist/{utils-XlyXIhuP.cjs → utils-BqeJ4aco.cjs} +2 -2
  26. package/dist/{utils-XlyXIhuP.cjs.map → utils-BqeJ4aco.cjs.map} +1 -1
  27. package/dist/utils.cjs +1 -1
  28. package/package.json +4 -2
@@ -1,4 +1,4 @@
1
- const require_trust_score_card_glass = require("./trust-score-card-glass-2rjz00d_.cjs");
1
+ const require_trust_score_card_glass = require("./trust-score-card-glass-CTsEVRD3.cjs");
2
2
  let react = require("react");
3
3
  let lucide_react = require("lucide-react");
4
4
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -99,4 +99,4 @@ Object.defineProperty(exports, "useTheme", {
99
99
  }
100
100
  });
101
101
 
102
- //# sourceMappingURL=theme-context-Y98bGvcm.cjs.map
102
+ //# sourceMappingURL=theme-context-D_cb9KzA.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme-context-Y98bGvcm.cjs","names":["THEMES: readonly Theme[]","THEME_CONFIG: Record<Theme, ThemeConfig>","DEFAULT_THEME: Theme","value: ThemeContextValue"],"sources":["../src/lib/theme-context.tsx"],"sourcesContent":["/**\n * Theme System for Glass UI Components\n *\n * Multi-theme support with CSS variables for glass, light, and aurora themes.\n * Provides ThemeProvider context and useTheme hook for theme management.\n *\n * @module theme-context\n *\n * @example\n * ```tsx\n * // Wrap your app with ThemeProvider\n * import { ThemeProvider } from 'shadcn-glass-ui';\n *\n * function App() {\n * return (\n * <ThemeProvider defaultTheme=\"glass\">\n * <YourApp />\n * </ThemeProvider>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Use the theme hook in components\n * import { useTheme } from 'shadcn-glass-ui';\n *\n * function ThemeSwitcher() {\n * const { theme, setTheme, cycleTheme } = useTheme();\n *\n * return (\n * <div>\n * <p>Current theme: {theme}</p>\n * <button onClick={cycleTheme}>Cycle Theme</button>\n * <button onClick={() => setTheme('glass')}>Set Glass</button>\n * </div>\n * );\n * }\n * ```\n *\n * @see {@link docs/THEME_CREATION_GUIDE.md} for creating custom themes\n * @see {@link docs/TOKEN_ARCHITECTURE.md} for CSS variable system\n */\n\nimport { createContext, useContext, useState, useEffect, useCallback, type ReactNode } from 'react';\nimport { Sun, Moon, Palette, type LucideIcon } from 'lucide-react';\n\n// ========================================\n// TYPES\n// ========================================\n\n/**\n * Available theme options for Glass UI components.\n * - `light` - Light theme with subtle glass effects\n * - `aurora` - Gradient theme with aurora/northern lights effects\n * - `glass` - Dark glassmorphism theme (default)\n */\nexport type Theme = 'light' | 'aurora' | 'glass';\n\n/** @deprecated Use Theme instead */\nexport type ThemeName = Theme;\n\n/**\n * Configuration for a single theme including display label and icon.\n */\nexport interface ThemeConfig {\n /** Human-readable theme name for UI display */\n readonly label: string;\n /** Lucide icon component for theme toggle buttons */\n readonly icon: LucideIcon;\n}\n\n/**\n * Context value returned by useTheme hook.\n */\nexport interface ThemeContextValue {\n /** Current active theme */\n readonly theme: Theme;\n /** Set a specific theme */\n readonly setTheme: (theme: Theme) => void;\n /** Cycle to next theme in order: light → aurora → glass → light */\n readonly cycleTheme: () => void;\n}\n\n// ========================================\n// CONSTANTS\n// ========================================\n\n/** Array of all available themes in cycle order */\nexport const THEMES: readonly Theme[] = ['light', 'aurora', 'glass'] as const;\n\n/**\n * Theme configuration map with labels and icons.\n * Used by ThemeToggleGlass and other theme switching components.\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport const THEME_CONFIG: Record<Theme, ThemeConfig> = {\n light: { label: 'Light', icon: Sun },\n aurora: { label: 'Aurora', icon: Moon },\n glass: { label: 'Glass', icon: Palette },\n} as const;\n\nconst STORAGE_KEY = 'glass-ui-theme';\nconst DEFAULT_THEME: Theme = 'glass';\n\n// ========================================\n// CONTEXT\n// ========================================\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\n// ========================================\n// PROVIDER\n// ========================================\n\ninterface ThemeProviderProps {\n /** Child components to wrap with theme context */\n readonly children: ReactNode;\n /** Initial theme to use (default: \"glass\") */\n readonly defaultTheme?: Theme;\n /** localStorage key for persistence (default: \"glass-ui-theme\") */\n readonly storageKey?: string;\n}\n\n/**\n * Theme provider component that manages theme state and persistence.\n *\n * Wraps your application to provide theme context to all child components.\n * Theme is automatically persisted to localStorage and applied to document.\n *\n * @param props - Provider configuration\n * @param props.children - Child components to wrap\n * @param props.defaultTheme - Initial theme (default: \"glass\")\n * @param props.storageKey - localStorage key (default: \"glass-ui-theme\")\n *\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"glass\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = DEFAULT_THEME,\n storageKey = STORAGE_KEY,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<Theme>(() => {\n if (typeof window === 'undefined') {\n return defaultTheme;\n }\n\n const stored = localStorage.getItem(storageKey);\n if (stored && THEMES.includes(stored as Theme)) {\n return stored as Theme;\n }\n\n return defaultTheme;\n });\n\n // Apply theme to document\n useEffect(() => {\n const root = document.documentElement;\n root.setAttribute('data-theme', theme);\n localStorage.setItem(storageKey, theme);\n }, [theme, storageKey]);\n\n const setTheme = useCallback((newTheme: Theme) => {\n if (THEMES.includes(newTheme)) {\n setThemeState(newTheme);\n }\n }, []);\n\n const cycleTheme = useCallback(() => {\n setThemeState((current) => {\n const currentIndex = THEMES.indexOf(current);\n const nextIndex = (currentIndex + 1) % THEMES.length;\n return THEMES[nextIndex];\n });\n }, []);\n\n const value: ThemeContextValue = {\n theme,\n setTheme,\n cycleTheme,\n };\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n// ========================================\n// HOOK\n// ========================================\n\n/**\n * Hook to access theme context values.\n *\n * Must be used within a ThemeProvider. Returns the current theme,\n * a setter function, and a cycle function.\n *\n * @returns Theme context value with theme, setTheme, and cycleTheme\n * @throws Error if used outside of ThemeProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, setTheme, cycleTheme } = useTheme();\n *\n * return (\n * <button onClick={cycleTheme}>\n * Current: {theme}\n * </button>\n * );\n * }\n * ```\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useTheme(): ThemeContextValue {\n const context = useContext(ThemeContext);\n\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n\n return context;\n}\n\n// ========================================\n// UTILITIES\n// ========================================\n\n/**\n * Get the next theme in the cycle order.\n *\n * @param current - Current theme\n * @returns Next theme in cycle (light → aurora → glass → light)\n *\n * @example\n * ```tsx\n * const next = getNextTheme('glass'); // returns 'light'\n * ```\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport function getNextTheme(current: Theme): Theme {\n const currentIndex = THEMES.indexOf(current);\n const nextIndex = (currentIndex + 1) % THEMES.length;\n return THEMES[nextIndex];\n}\n\n/**\n * Get configuration for a specific theme.\n *\n * @param theme - Theme to get configuration for\n * @returns Theme configuration with label and icon\n *\n * @example\n * ```tsx\n * const config = getThemeConfig('glass');\n * // { label: 'Glass', icon: Palette }\n * ```\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport function getThemeConfig(theme: Theme): ThemeConfig {\n return THEME_CONFIG[theme];\n}\n"],"mappings":";;;;AAyFA,MAAaA,SAA2B;CAAC;CAAS;CAAU;CAAQ;AAOpE,MAAaC,eAA2C;CACtD,OAAO;EAAE,OAAO;EAAS,MAAM,aAAA;EAAK;CACpC,QAAQ;EAAE,OAAO;EAAU,MAAM,aAAA;EAAM;CACvC,OAAO;EAAE,OAAO;EAAS,MAAM,aAAA;EAAS;CACzC;AAED,IAAM,cAAc;AACpB,IAAMC,gBAAuB;AAM7B,IAAM,gBAAA,GAAA,MAAA,eAAuD,KAAK;AAiClE,SAAgB,cAAc,EAC5B,UACA,eAAe,eACf,aAAa,eACQ;CACrB,MAAM,CAAC,OAAO,kBAAA,GAAA,MAAA,gBAAuC;AACnD,MAAI,OAAO,WAAW,YACpB,QAAO;EAGT,MAAM,SAAS,aAAa,QAAQ,WAAW;AAC/C,MAAI,UAAU,OAAO,SAAS,OAAgB,CAC5C,QAAO;AAGT,SAAO;GACP;AAGF,EAAA,GAAA,MAAA,iBAAgB;AACD,WAAS,gBACjB,aAAa,cAAc,MAAM;AACtC,eAAa,QAAQ,YAAY,MAAM;IACtC,CAAC,OAAO,WAAW,CAAC;CAgBvB,MAAMC,QAA2B;EAC/B;EACA,WAAA,GAAA,MAAA,cAhB4B,aAAoB;AAChD,OAAI,OAAO,SAAS,SAAS,CAC3B,eAAc,SAAS;KAExB,EAAE,CAAC;EAaJ,aAAA,GAAA,MAAA,mBAXmC;AACnC,kBAAe,YAAY;AAGzB,WAAO,QAFc,OAAO,QAAQ,QAAQ,GACV,KAAK,OAAO;KAE9C;KACD,EAAE,CAAC;EAML;AAED,QAAO,iBAAA,GAAA,kBAAA,KAAC,aAAa,UAAA;EAAgB;EAAQ;GAAiC;;AA8BhF,SAAgB,WAA8B;CAC5C,MAAM,WAAA,GAAA,MAAA,YAAqB,aAAa;AAExC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,+CAA+C;AAGjE,QAAO;;AAmBT,SAAgB,aAAa,SAAuB;AAGlD,QAAO,QAFc,OAAO,QAAQ,QAAQ,GACV,KAAK,OAAO;;AAiBhD,SAAgB,eAAe,OAA2B;AACxD,QAAO,aAAa"}
1
+ {"version":3,"file":"theme-context-D_cb9KzA.cjs","names":["THEMES: readonly Theme[]","THEME_CONFIG: Record<Theme, ThemeConfig>","DEFAULT_THEME: Theme","value: ThemeContextValue"],"sources":["../src/lib/theme-context.tsx"],"sourcesContent":["/**\n * Theme System for Glass UI Components\n *\n * Multi-theme support with CSS variables for glass, light, and aurora themes.\n * Provides ThemeProvider context and useTheme hook for theme management.\n *\n * @module theme-context\n *\n * @example\n * ```tsx\n * // Wrap your app with ThemeProvider\n * import { ThemeProvider } from 'shadcn-glass-ui';\n *\n * function App() {\n * return (\n * <ThemeProvider defaultTheme=\"glass\">\n * <YourApp />\n * </ThemeProvider>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Use the theme hook in components\n * import { useTheme } from 'shadcn-glass-ui';\n *\n * function ThemeSwitcher() {\n * const { theme, setTheme, cycleTheme } = useTheme();\n *\n * return (\n * <div>\n * <p>Current theme: {theme}</p>\n * <button onClick={cycleTheme}>Cycle Theme</button>\n * <button onClick={() => setTheme('glass')}>Set Glass</button>\n * </div>\n * );\n * }\n * ```\n *\n * @see {@link docs/THEME_CREATION_GUIDE.md} for creating custom themes\n * @see {@link docs/TOKEN_ARCHITECTURE.md} for CSS variable system\n */\n\nimport { createContext, useContext, useState, useEffect, useCallback, type ReactNode } from 'react';\nimport { Sun, Moon, Palette, type LucideIcon } from 'lucide-react';\n\n// ========================================\n// TYPES\n// ========================================\n\n/**\n * Available theme options for Glass UI components.\n * - `light` - Light theme with subtle glass effects\n * - `aurora` - Gradient theme with aurora/northern lights effects\n * - `glass` - Dark glassmorphism theme (default)\n */\nexport type Theme = 'light' | 'aurora' | 'glass';\n\n/** @deprecated Use Theme instead */\nexport type ThemeName = Theme;\n\n/**\n * Configuration for a single theme including display label and icon.\n */\nexport interface ThemeConfig {\n /** Human-readable theme name for UI display */\n readonly label: string;\n /** Lucide icon component for theme toggle buttons */\n readonly icon: LucideIcon;\n}\n\n/**\n * Context value returned by useTheme hook.\n */\nexport interface ThemeContextValue {\n /** Current active theme */\n readonly theme: Theme;\n /** Set a specific theme */\n readonly setTheme: (theme: Theme) => void;\n /** Cycle to next theme in order: light → aurora → glass → light */\n readonly cycleTheme: () => void;\n}\n\n// ========================================\n// CONSTANTS\n// ========================================\n\n/** Array of all available themes in cycle order */\nexport const THEMES: readonly Theme[] = ['light', 'aurora', 'glass'] as const;\n\n/**\n * Theme configuration map with labels and icons.\n * Used by ThemeToggleGlass and other theme switching components.\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport const THEME_CONFIG: Record<Theme, ThemeConfig> = {\n light: { label: 'Light', icon: Sun },\n aurora: { label: 'Aurora', icon: Moon },\n glass: { label: 'Glass', icon: Palette },\n} as const;\n\nconst STORAGE_KEY = 'glass-ui-theme';\nconst DEFAULT_THEME: Theme = 'glass';\n\n// ========================================\n// CONTEXT\n// ========================================\n\nconst ThemeContext = createContext<ThemeContextValue | null>(null);\n\n// ========================================\n// PROVIDER\n// ========================================\n\ninterface ThemeProviderProps {\n /** Child components to wrap with theme context */\n readonly children: ReactNode;\n /** Initial theme to use (default: \"glass\") */\n readonly defaultTheme?: Theme;\n /** localStorage key for persistence (default: \"glass-ui-theme\") */\n readonly storageKey?: string;\n}\n\n/**\n * Theme provider component that manages theme state and persistence.\n *\n * Wraps your application to provide theme context to all child components.\n * Theme is automatically persisted to localStorage and applied to document.\n *\n * @param props - Provider configuration\n * @param props.children - Child components to wrap\n * @param props.defaultTheme - Initial theme (default: \"glass\")\n * @param props.storageKey - localStorage key (default: \"glass-ui-theme\")\n *\n * @example\n * ```tsx\n * <ThemeProvider defaultTheme=\"glass\">\n * <App />\n * </ThemeProvider>\n * ```\n */\nexport function ThemeProvider({\n children,\n defaultTheme = DEFAULT_THEME,\n storageKey = STORAGE_KEY,\n}: ThemeProviderProps) {\n const [theme, setThemeState] = useState<Theme>(() => {\n if (typeof window === 'undefined') {\n return defaultTheme;\n }\n\n const stored = localStorage.getItem(storageKey);\n if (stored && THEMES.includes(stored as Theme)) {\n return stored as Theme;\n }\n\n return defaultTheme;\n });\n\n // Apply theme to document\n useEffect(() => {\n const root = document.documentElement;\n root.setAttribute('data-theme', theme);\n localStorage.setItem(storageKey, theme);\n }, [theme, storageKey]);\n\n const setTheme = useCallback((newTheme: Theme) => {\n if (THEMES.includes(newTheme)) {\n setThemeState(newTheme);\n }\n }, []);\n\n const cycleTheme = useCallback(() => {\n setThemeState((current) => {\n const currentIndex = THEMES.indexOf(current);\n const nextIndex = (currentIndex + 1) % THEMES.length;\n return THEMES[nextIndex];\n });\n }, []);\n\n const value: ThemeContextValue = {\n theme,\n setTheme,\n cycleTheme,\n };\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\n// ========================================\n// HOOK\n// ========================================\n\n/**\n * Hook to access theme context values.\n *\n * Must be used within a ThemeProvider. Returns the current theme,\n * a setter function, and a cycle function.\n *\n * @returns Theme context value with theme, setTheme, and cycleTheme\n * @throws Error if used outside of ThemeProvider\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { theme, setTheme, cycleTheme } = useTheme();\n *\n * return (\n * <button onClick={cycleTheme}>\n * Current: {theme}\n * </button>\n * );\n * }\n * ```\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport function useTheme(): ThemeContextValue {\n const context = useContext(ThemeContext);\n\n if (!context) {\n throw new Error('useTheme must be used within a ThemeProvider');\n }\n\n return context;\n}\n\n// ========================================\n// UTILITIES\n// ========================================\n\n/**\n * Get the next theme in the cycle order.\n *\n * @param current - Current theme\n * @returns Next theme in cycle (light → aurora → glass → light)\n *\n * @example\n * ```tsx\n * const next = getNextTheme('glass'); // returns 'light'\n * ```\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport function getNextTheme(current: Theme): Theme {\n const currentIndex = THEMES.indexOf(current);\n const nextIndex = (currentIndex + 1) % THEMES.length;\n return THEMES[nextIndex];\n}\n\n/**\n * Get configuration for a specific theme.\n *\n * @param theme - Theme to get configuration for\n * @returns Theme configuration with label and icon\n *\n * @example\n * ```tsx\n * const config = getThemeConfig('glass');\n * // { label: 'Glass', icon: Palette }\n * ```\n */\n// eslint-disable-next-line react-refresh/only-export-components\nexport function getThemeConfig(theme: Theme): ThemeConfig {\n return THEME_CONFIG[theme];\n}\n"],"mappings":";;;;AAyFA,MAAaA,SAA2B;CAAC;CAAS;CAAU;CAAQ;AAOpE,MAAaC,eAA2C;CACtD,OAAO;EAAE,OAAO;EAAS,MAAM,aAAA;EAAK;CACpC,QAAQ;EAAE,OAAO;EAAU,MAAM,aAAA;EAAM;CACvC,OAAO;EAAE,OAAO;EAAS,MAAM,aAAA;EAAS;CACzC;AAED,IAAM,cAAc;AACpB,IAAMC,gBAAuB;AAM7B,IAAM,gBAAA,GAAA,MAAA,eAAuD,KAAK;AAiClE,SAAgB,cAAc,EAC5B,UACA,eAAe,eACf,aAAa,eACQ;CACrB,MAAM,CAAC,OAAO,kBAAA,GAAA,MAAA,gBAAuC;AACnD,MAAI,OAAO,WAAW,YACpB,QAAO;EAGT,MAAM,SAAS,aAAa,QAAQ,WAAW;AAC/C,MAAI,UAAU,OAAO,SAAS,OAAgB,CAC5C,QAAO;AAGT,SAAO;GACP;AAGF,EAAA,GAAA,MAAA,iBAAgB;AACD,WAAS,gBACjB,aAAa,cAAc,MAAM;AACtC,eAAa,QAAQ,YAAY,MAAM;IACtC,CAAC,OAAO,WAAW,CAAC;CAgBvB,MAAMC,QAA2B;EAC/B;EACA,WAAA,GAAA,MAAA,cAhB4B,aAAoB;AAChD,OAAI,OAAO,SAAS,SAAS,CAC3B,eAAc,SAAS;KAExB,EAAE,CAAC;EAaJ,aAAA,GAAA,MAAA,mBAXmC;AACnC,kBAAe,YAAY;AAGzB,WAAO,QAFc,OAAO,QAAQ,QAAQ,GACV,KAAK,OAAO;KAE9C;KACD,EAAE,CAAC;EAML;AAED,QAAO,iBAAA,GAAA,kBAAA,KAAC,aAAa,UAAA;EAAgB;EAAQ;GAAiC;;AA8BhF,SAAgB,WAA8B;CAC5C,MAAM,WAAA,GAAA,MAAA,YAAqB,aAAa;AAExC,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,+CAA+C;AAGjE,QAAO;;AAmBT,SAAgB,aAAa,SAAuB;AAGlD,QAAO,QAFc,OAAO,QAAQ,QAAQ,GACV,KAAK,OAAO;;AAiBhD,SAAgB,eAAe,OAA2B;AACxD,QAAO,aAAa"}
package/dist/themes.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_theme_context = require("./theme-context-Y98bGvcm.cjs");
1
+ const require_theme_context = require("./theme-context-D_cb9KzA.cjs");
2
2
  exports.THEMES = require_theme_context.THEMES;
3
3
  exports.THEME_CONFIG = require_theme_context.THEME_CONFIG;
4
4
  exports.ThemeProvider = require_theme_context.ThemeProvider;
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  value: mod,
28
28
  enumerable: true
29
29
  }) : target, mod));
30
- const require_utils = require("./utils-XlyXIhuP.cjs");
31
- const require_use_focus = require("./use-focus-DbpBEuee.cjs");
32
- const require_theme_context = require("./theme-context-Y98bGvcm.cjs");
30
+ const require_utils = require("./utils-BqeJ4aco.cjs");
31
+ const require_use_focus = require("./use-focus--Hw2nevi.cjs");
32
+ const require_theme_context = require("./theme-context-D_cb9KzA.cjs");
33
33
  let react = require("react");
34
34
  react = __toESM(react);
35
35
  let lucide_react = require("lucide-react");
@@ -876,10 +876,10 @@ var Primitive$7 = [
876
876
  "svg",
877
877
  "ul"
878
878
  ].reduce((primitive, node) => {
879
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
879
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
880
880
  const Node$1 = react.forwardRef((props, forwardedRef) => {
881
881
  const { asChild, ...primitiveProps } = props;
882
- const Comp = asChild ? Slot$3 : node;
882
+ const Comp = asChild ? Slot$4 : node;
883
883
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
884
884
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
885
885
  ...primitiveProps,
@@ -1126,10 +1126,10 @@ var Primitive$6 = [
1126
1126
  "svg",
1127
1127
  "ul"
1128
1128
  ].reduce((primitive, node) => {
1129
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
1129
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
1130
1130
  const Node$1 = react.forwardRef((props, forwardedRef) => {
1131
1131
  const { asChild, ...primitiveProps } = props;
1132
- const Comp = asChild ? Slot$3 : node;
1132
+ const Comp = asChild ? Slot$4 : node;
1133
1133
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
1134
1134
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
1135
1135
  ...primitiveProps,
@@ -2850,10 +2850,10 @@ var Primitive$5 = [
2850
2850
  "svg",
2851
2851
  "ul"
2852
2852
  ].reduce((primitive, node) => {
2853
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
2853
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
2854
2854
  const Node$1 = react.forwardRef((props, forwardedRef) => {
2855
2855
  const { asChild, ...primitiveProps } = props;
2856
- const Comp = asChild ? Slot$3 : node;
2856
+ const Comp = asChild ? Slot$4 : node;
2857
2857
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
2858
2858
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
2859
2859
  ...primitiveProps,
@@ -2962,10 +2962,10 @@ var Primitive$4 = [
2962
2962
  "svg",
2963
2963
  "ul"
2964
2964
  ].reduce((primitive, node) => {
2965
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
2965
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
2966
2966
  const Node$1 = react.forwardRef((props, forwardedRef) => {
2967
2967
  const { asChild, ...primitiveProps } = props;
2968
- const Comp = asChild ? Slot$3 : node;
2968
+ const Comp = asChild ? Slot$4 : node;
2969
2969
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
2970
2970
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
2971
2971
  ...primitiveProps,
@@ -3272,10 +3272,10 @@ var Primitive$3 = [
3272
3272
  "svg",
3273
3273
  "ul"
3274
3274
  ].reduce((primitive, node) => {
3275
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
3275
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
3276
3276
  const Node$1 = react.forwardRef((props, forwardedRef) => {
3277
3277
  const { asChild, ...primitiveProps } = props;
3278
- const Comp = asChild ? Slot$3 : node;
3278
+ const Comp = asChild ? Slot$4 : node;
3279
3279
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
3280
3280
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
3281
3281
  ...primitiveProps,
@@ -3416,10 +3416,10 @@ var Primitive$2 = [
3416
3416
  "svg",
3417
3417
  "ul"
3418
3418
  ].reduce((primitive, node) => {
3419
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
3419
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
3420
3420
  const Node$1 = react.forwardRef((props, forwardedRef) => {
3421
3421
  const { asChild, ...primitiveProps } = props;
3422
- const Comp = asChild ? Slot$3 : node;
3422
+ const Comp = asChild ? Slot$4 : node;
3423
3423
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
3424
3424
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
3425
3425
  ...primitiveProps,
@@ -4284,7 +4284,7 @@ var PopoverContent$1 = react.forwardRef((props, forwardedRef) => {
4284
4284
  });
4285
4285
  });
4286
4286
  PopoverContent$1.displayName = CONTENT_NAME;
4287
- var Slot$1 = (0, __radix_ui_react_slot.createSlot)("PopoverContent.RemoveScroll");
4287
+ var Slot$2 = (0, __radix_ui_react_slot.createSlot)("PopoverContent.RemoveScroll");
4288
4288
  var PopoverContentModal = react.forwardRef((props, forwardedRef) => {
4289
4289
  const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
4290
4290
  const contentRef = react.useRef(null);
@@ -4295,7 +4295,7 @@ var PopoverContentModal = react.forwardRef((props, forwardedRef) => {
4295
4295
  if (content) return hideOthers(content);
4296
4296
  }, []);
4297
4297
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Combination_default, {
4298
- as: Slot$1,
4298
+ as: Slot$2,
4299
4299
  allowPinchZoom: true,
4300
4300
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContentImpl, {
4301
4301
  ...props,
@@ -4470,10 +4470,10 @@ var Primitive$1 = [
4470
4470
  "svg",
4471
4471
  "ul"
4472
4472
  ].reduce((primitive, node) => {
4473
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
4473
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
4474
4474
  const Node$1 = react.forwardRef((props, forwardedRef) => {
4475
4475
  const { asChild, ...primitiveProps } = props;
4476
- const Comp = asChild ? Slot$3 : node;
4476
+ const Comp = asChild ? Slot$4 : node;
4477
4477
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
4478
4478
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
4479
4479
  ...primitiveProps,
@@ -5271,6 +5271,48 @@ const GlassCard = (0, react.forwardRef)(({ asChild = false, children, className,
5271
5271
  });
5272
5272
  });
5273
5273
  GlassCard.displayName = "GlassCard";
5274
+ const GlassCardHeader = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5275
+ ref,
5276
+ "data-slot": "card-header",
5277
+ className: require_utils.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className),
5278
+ ...props
5279
+ }));
5280
+ GlassCardHeader.displayName = "GlassCardHeader";
5281
+ const GlassCardTitle = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5282
+ ref,
5283
+ "data-slot": "card-title",
5284
+ className: require_utils.cn("leading-none font-semibold tracking-tight", className),
5285
+ ...props
5286
+ }));
5287
+ GlassCardTitle.displayName = "GlassCardTitle";
5288
+ const GlassCardDescription = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5289
+ ref,
5290
+ "data-slot": "card-description",
5291
+ className: require_utils.cn("text-muted-foreground text-sm", className),
5292
+ ...props
5293
+ }));
5294
+ GlassCardDescription.displayName = "GlassCardDescription";
5295
+ const GlassCardAction = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5296
+ ref,
5297
+ "data-slot": "card-action",
5298
+ className: require_utils.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
5299
+ ...props
5300
+ }));
5301
+ GlassCardAction.displayName = "GlassCardAction";
5302
+ const GlassCardContent = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5303
+ ref,
5304
+ "data-slot": "card-content",
5305
+ className: require_utils.cn("px-6", className),
5306
+ ...props
5307
+ }));
5308
+ GlassCardContent.displayName = "GlassCardContent";
5309
+ const GlassCardFooter = (0, react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5310
+ ref,
5311
+ "data-slot": "card-footer",
5312
+ className: require_utils.cn("flex items-center px-6 [.border-t]:pt-6", className),
5313
+ ...props
5314
+ }));
5315
+ GlassCardFooter.displayName = "GlassCardFooter";
5274
5316
  var getInputStyles = (isFocused, error, success) => {
5275
5317
  let borderColor = "var(--input-border)";
5276
5318
  if (error) borderColor = "var(--alert-danger-text)";
@@ -5357,14 +5399,22 @@ var useModalContext = () => {
5357
5399
  if (!context) throw new Error("Modal compound components must be used within ModalGlass.Root");
5358
5400
  return context;
5359
5401
  };
5360
- var ModalRoot = ({ open, onOpenChange, size: size$3 = "md", children, ...props }) => {
5402
+ var ModalRoot = ({ open: controlledOpen, defaultOpen = false, onOpenChange, size: size$3 = "md", children }) => {
5403
+ const [uncontrolledOpen, setUncontrolledOpen] = (0, react.useState)(defaultOpen);
5361
5404
  const [isClosing, setIsClosing] = (0, react.useState)(false);
5405
+ const isControlled = controlledOpen !== void 0;
5406
+ const open = isControlled ? controlledOpen : uncontrolledOpen;
5407
+ const handleOpen = (0, react.useCallback)(() => {
5408
+ if (isControlled) onOpenChange?.(true);
5409
+ else setUncontrolledOpen(true);
5410
+ }, [isControlled, onOpenChange]);
5362
5411
  const handleClose = (0, react.useCallback)(async () => {
5363
5412
  setIsClosing(true);
5364
5413
  await delay(MODAL_ANIMATION_DURATION);
5365
5414
  setIsClosing(false);
5366
- onOpenChange?.(false);
5367
- }, [onOpenChange]);
5415
+ if (isControlled) onOpenChange?.(false);
5416
+ else setUncontrolledOpen(false);
5417
+ }, [isControlled, onOpenChange]);
5368
5418
  (0, react.useEffect)(() => {
5369
5419
  if (open) lockBodyScroll();
5370
5420
  else unlockBodyScroll();
@@ -5382,23 +5432,42 @@ var ModalRoot = ({ open, onOpenChange, size: size$3 = "md", children, ...props }
5382
5432
  document.removeEventListener("keydown", handleEscape);
5383
5433
  };
5384
5434
  }, [open, handleClose]);
5385
- if (!open) return null;
5386
5435
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalContext.Provider, {
5387
5436
  value: {
5388
5437
  isOpen: open,
5438
+ onOpen: handleOpen,
5389
5439
  onClose: handleClose,
5390
5440
  size: size$3,
5391
5441
  isClosing
5392
5442
  },
5393
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5394
- className: "fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-4",
5395
- role: "dialog",
5396
- "aria-modal": "true",
5397
- "aria-labelledby": "modal-title",
5398
- "aria-describedby": "modal-description",
5399
- ...props,
5400
- children
5401
- })
5443
+ children
5444
+ });
5445
+ };
5446
+ var ModalTrigger = (0, react.forwardRef)(({ asChild = false, children, onClick, ...props }, ref) => {
5447
+ const { onOpen } = useModalContext();
5448
+ const handleClick = (event) => {
5449
+ onClick?.(event);
5450
+ if (!event.defaultPrevented) onOpen();
5451
+ };
5452
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? __radix_ui_react_slot.Slot : "button", {
5453
+ ref,
5454
+ type: "button",
5455
+ onClick: handleClick,
5456
+ ...props,
5457
+ children
5458
+ });
5459
+ });
5460
+ ModalTrigger.displayName = "ModalTrigger";
5461
+ var ModalPortal = ({ children }) => {
5462
+ const { isOpen } = useModalContext();
5463
+ if (!isOpen) return null;
5464
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
5465
+ className: "fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-4",
5466
+ role: "dialog",
5467
+ "aria-modal": "true",
5468
+ "aria-labelledby": "modal-title",
5469
+ "aria-describedby": "modal-description",
5470
+ children
5402
5471
  });
5403
5472
  };
5404
5473
  var ModalOverlay = ({ className }) => {
@@ -5501,6 +5570,8 @@ var ModalClose = ({ className }) => {
5501
5570
  };
5502
5571
  const ModalGlass = {
5503
5572
  Root: ModalRoot,
5573
+ Trigger: ModalTrigger,
5574
+ Portal: ModalPortal,
5504
5575
  Overlay: ModalOverlay,
5505
5576
  Content: ModalContent,
5506
5577
  Header: ModalHeader,
@@ -5793,10 +5864,10 @@ var Primitive = [
5793
5864
  "svg",
5794
5865
  "ul"
5795
5866
  ].reduce((primitive, node) => {
5796
- const Slot$3 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
5867
+ const Slot$4 = (0, __radix_ui_react_slot.createSlot)(`Primitive.${node}`);
5797
5868
  const Node$1 = react.forwardRef((props, forwardedRef) => {
5798
5869
  const { asChild, ...primitiveProps } = props;
5799
- const Comp = asChild ? Slot$3 : node;
5870
+ const Comp = asChild ? Slot$4 : node;
5800
5871
  if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
5801
5872
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Comp, {
5802
5873
  ...primitiveProps,
@@ -28137,6 +28208,42 @@ Object.defineProperty(exports, "GlassCard", {
28137
28208
  return GlassCard;
28138
28209
  }
28139
28210
  });
28211
+ Object.defineProperty(exports, "GlassCardAction", {
28212
+ enumerable: true,
28213
+ get: function() {
28214
+ return GlassCardAction;
28215
+ }
28216
+ });
28217
+ Object.defineProperty(exports, "GlassCardContent", {
28218
+ enumerable: true,
28219
+ get: function() {
28220
+ return GlassCardContent;
28221
+ }
28222
+ });
28223
+ Object.defineProperty(exports, "GlassCardDescription", {
28224
+ enumerable: true,
28225
+ get: function() {
28226
+ return GlassCardDescription;
28227
+ }
28228
+ });
28229
+ Object.defineProperty(exports, "GlassCardFooter", {
28230
+ enumerable: true,
28231
+ get: function() {
28232
+ return GlassCardFooter;
28233
+ }
28234
+ });
28235
+ Object.defineProperty(exports, "GlassCardHeader", {
28236
+ enumerable: true,
28237
+ get: function() {
28238
+ return GlassCardHeader;
28239
+ }
28240
+ });
28241
+ Object.defineProperty(exports, "GlassCardTitle", {
28242
+ enumerable: true,
28243
+ get: function() {
28244
+ return GlassCardTitle;
28245
+ }
28246
+ });
28140
28247
  Object.defineProperty(exports, "HeaderBrandingGlass", {
28141
28248
  enumerable: true,
28142
28249
  get: function() {
@@ -28239,6 +28346,12 @@ Object.defineProperty(exports, "Presence", {
28239
28346
  return Presence;
28240
28347
  }
28241
28348
  });
28349
+ Object.defineProperty(exports, "Primitive", {
28350
+ enumerable: true,
28351
+ get: function() {
28352
+ return Primitive$1;
28353
+ }
28354
+ });
28242
28355
  Object.defineProperty(exports, "ProfileAvatarGlass", {
28243
28356
  enumerable: true,
28244
28357
  get: function() {
@@ -28497,6 +28610,12 @@ Object.defineProperty(exports, "composeEventHandlers", {
28497
28610
  return composeEventHandlers;
28498
28611
  }
28499
28612
  });
28613
+ Object.defineProperty(exports, "createCollection", {
28614
+ enumerable: true,
28615
+ get: function() {
28616
+ return createCollection;
28617
+ }
28618
+ });
28500
28619
  Object.defineProperty(exports, "getUniqPayload", {
28501
28620
  enumerable: true,
28502
28621
  get: function() {
@@ -28635,6 +28754,12 @@ Object.defineProperty(exports, "useComposedRefs", {
28635
28754
  return useComposedRefs;
28636
28755
  }
28637
28756
  });
28757
+ Object.defineProperty(exports, "useControllableState", {
28758
+ enumerable: true,
28759
+ get: function() {
28760
+ return useControllableState;
28761
+ }
28762
+ });
28638
28763
  Object.defineProperty(exports, "useDirection", {
28639
28764
  enumerable: true,
28640
28765
  get: function() {
@@ -28647,6 +28772,12 @@ Object.defineProperty(exports, "useElementOffset", {
28647
28772
  return useElementOffset;
28648
28773
  }
28649
28774
  });
28775
+ Object.defineProperty(exports, "useId", {
28776
+ enumerable: true,
28777
+ get: function() {
28778
+ return useId$2;
28779
+ }
28780
+ });
28650
28781
  Object.defineProperty(exports, "useLayoutEffect2", {
28651
28782
  enumerable: true,
28652
28783
  get: function() {
@@ -28665,5 +28796,17 @@ Object.defineProperty(exports, "useMargin", {
28665
28796
  return useMargin;
28666
28797
  }
28667
28798
  });
28799
+ Object.defineProperty(exports, "usePrevious", {
28800
+ enumerable: true,
28801
+ get: function() {
28802
+ return usePrevious;
28803
+ }
28804
+ });
28805
+ Object.defineProperty(exports, "useSize", {
28806
+ enumerable: true,
28807
+ get: function() {
28808
+ return useSize;
28809
+ }
28810
+ });
28668
28811
 
28669
- //# sourceMappingURL=trust-score-card-glass-2rjz00d_.cjs.map
28812
+ //# sourceMappingURL=trust-score-card-glass-CTsEVRD3.cjs.map