shadcn-glass-ui 1.0.11 → 2.0.1

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 (215) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/README.md +174 -17
  3. package/context7.json +58 -0
  4. package/dist/cli/index.cjs +470 -0
  5. package/dist/cli/index.cjs.map +1 -0
  6. package/dist/cli/index.d.ts +18 -0
  7. package/dist/cli/index.js +469 -0
  8. package/dist/cli/index.js.map +1 -0
  9. package/dist/components.cjs +4 -4
  10. package/dist/components.d.ts +153 -22
  11. package/dist/components.js +2 -2
  12. package/dist/hooks.cjs +2 -2
  13. package/dist/index.cjs +872 -5
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +0 -2390
  16. package/dist/index.js +844 -3
  17. package/dist/index.js.map +1 -1
  18. package/dist/r/ai-card-glass.json +1 -1
  19. package/dist/r/avatar-glass.json +1 -1
  20. package/dist/r/circular-metric-glass.json +1 -1
  21. package/dist/r/circular-progress-glass.json +1 -1
  22. package/dist/r/combobox-glass.json +1 -1
  23. package/dist/r/flag-alert-glass.json +1 -1
  24. package/dist/r/flags-section-glass.json +1 -1
  25. package/dist/r/insight-card-glass.json +26 -0
  26. package/dist/r/interactive-card.json +1 -1
  27. package/dist/r/language-bar-glass.json +1 -1
  28. package/dist/r/metric-card-glass.json +3 -2
  29. package/dist/r/metrics-grid-glass.json +1 -1
  30. package/dist/r/modal-glass.json +1 -1
  31. package/dist/r/progress-glass.json +1 -1
  32. package/dist/r/registry.json +19 -1
  33. package/dist/r/segmented-control-glass.json +1 -1
  34. package/dist/r/sparkline-glass.json +26 -0
  35. package/dist/r/stepper-glass.json +41 -0
  36. package/dist/r/tabs-glass.json +1 -1
  37. package/dist/r/trust-score-card-glass.json +1 -1
  38. package/dist/r/year-card-glass.json +1 -1
  39. package/dist/shadcn-glass-ui.css +1 -1
  40. package/dist/{theme-context-XtasSxRT.cjs → theme-context-CVW50BKW.cjs} +2 -2
  41. package/dist/{theme-context-XtasSxRT.cjs.map → theme-context-CVW50BKW.cjs.map} +1 -1
  42. package/dist/themes.cjs +1 -1
  43. package/dist/trust-score-card-glass-BcZbul0P.js +26895 -0
  44. package/dist/trust-score-card-glass-BcZbul0P.js.map +1 -0
  45. package/dist/trust-score-card-glass-r3qM09Jp.cjs +27689 -0
  46. package/dist/trust-score-card-glass-r3qM09Jp.cjs.map +1 -0
  47. package/dist/{use-focus-BbpE2qGq.cjs → use-focus-ZE8ozmZE.cjs} +2 -2
  48. package/dist/{use-focus-BbpE2qGq.cjs.map → use-focus-ZE8ozmZE.cjs.map} +1 -1
  49. package/dist/{use-wallpaper-tint-CIqtoETa.cjs → use-wallpaper-tint-BuS80tbN.cjs} +2 -2
  50. package/dist/{use-wallpaper-tint-CIqtoETa.cjs.map → use-wallpaper-tint-BuS80tbN.cjs.map} +1 -1
  51. package/dist/{utils-CGCOTvxT.js → utils-CcyeqpKQ.js} +1 -1
  52. package/dist/{utils-CGCOTvxT.js.map → utils-CcyeqpKQ.js.map} +1 -1
  53. package/dist/{utils-CriE74ig.cjs → utils-DLXayspX.cjs} +2 -2
  54. package/dist/{utils-CriE74ig.cjs.map → utils-DLXayspX.cjs.map} +1 -1
  55. package/dist/utils.cjs +1 -1
  56. package/dist/utils.js +1 -1
  57. package/docs/AI_IMPROVEMENTS_COMPLETE.md +574 -0
  58. package/docs/AI_USAGE.md +1328 -0
  59. package/docs/API_PATTERNS_COMPARISON.md +418 -0
  60. package/docs/BEST_PRACTICES.md +800 -0
  61. package/docs/COMPLIANCE_CHECKLIST.md +307 -0
  62. package/docs/COMPLIANCE_TESTING.md +436 -0
  63. package/docs/COMPONENTS_CATALOG.md +1076 -0
  64. package/docs/CSS_VARIABLES_AUDIT.md +306 -0
  65. package/docs/CSS_VARIABLES_REFACTORING_PLAN.md +330 -0
  66. package/docs/EXPORTS_MAP.json +875 -0
  67. package/docs/EXPORTS_STRUCTURE.md +729 -0
  68. package/docs/GETTING_STARTED.md +655 -0
  69. package/docs/METRIC_CARD_API_REDESIGN.md +354 -0
  70. package/docs/PRIMITIVE_MAPPING.md +404 -0
  71. package/docs/PUBLISHING.md +593 -0
  72. package/docs/REGISTRY_SUMMARY.md +96 -0
  73. package/docs/REGISTRY_USAGE.md +339 -0
  74. package/docs/SECURITY.md +117 -0
  75. package/docs/THEME_CREATION_GUIDE.md +455 -0
  76. package/docs/TOKEN_ARCHITECTURE.md +365 -0
  77. package/docs/announcements/v1.0.5-devto.md +363 -0
  78. package/docs/announcements/v1.0.5-reddit.md +115 -0
  79. package/docs/announcements/v1.0.5-twitter.md +70 -0
  80. package/docs/api/README.md +725 -0
  81. package/docs/api/functions/ThemeProvider.md +21 -0
  82. package/docs/api/functions/cn.md +27 -0
  83. package/docs/api/functions/getNextTheme.md +21 -0
  84. package/docs/api/functions/getThemeConfig.md +21 -0
  85. package/docs/api/functions/useFocus.md +53 -0
  86. package/docs/api/functions/useHover.md +47 -0
  87. package/docs/api/functions/useResponsive.md +31 -0
  88. package/docs/api/functions/useTheme.md +15 -0
  89. package/docs/api/functions/useWallpaperTint.md +36 -0
  90. package/docs/api/globals.md +139 -0
  91. package/docs/api/interfaces/AlertGlassProps.md +131 -0
  92. package/docs/api/interfaces/AvatarGlassProps.md +114 -0
  93. package/docs/api/interfaces/BadgeGlassProps.md +118 -0
  94. package/docs/api/interfaces/ButtonGlassProps.md +179 -0
  95. package/docs/api/interfaces/CheckboxGlassProps.md +125 -0
  96. package/docs/api/interfaces/DropdownGlassProps.md +123 -0
  97. package/docs/api/interfaces/DropdownItem.md +53 -0
  98. package/docs/api/interfaces/GlassCardProps.md +151 -0
  99. package/docs/api/interfaces/InputGlassProps.md +169 -0
  100. package/docs/api/interfaces/NotificationGlassProps.md +67 -0
  101. package/docs/api/interfaces/ProgressGlassProps.md +49 -0
  102. package/docs/api/interfaces/SkeletonGlassProps.md +41 -0
  103. package/docs/api/interfaces/SliderGlassProps.md +107 -0
  104. package/docs/api/interfaces/TabItem.md +25 -0
  105. package/docs/api/interfaces/ThemeConfig.md +25 -0
  106. package/docs/api/interfaces/ThemeContextValue.md +47 -0
  107. package/docs/api/interfaces/ToggleGlassProps.md +59 -0
  108. package/docs/api/interfaces/TooltipGlassProps.md +119 -0
  109. package/docs/api/type-aliases/AlertType.md +11 -0
  110. package/docs/api/type-aliases/AlertVariant.md +11 -0
  111. package/docs/api/type-aliases/AvatarSize.md +11 -0
  112. package/docs/api/type-aliases/AvatarStatus.md +13 -0
  113. package/docs/api/type-aliases/BadgeSize.md +11 -0
  114. package/docs/api/type-aliases/BadgeVariant.md +11 -0
  115. package/docs/api/type-aliases/ButtonGlassSize.md +11 -0
  116. package/docs/api/type-aliases/ButtonGlassVariant.md +11 -0
  117. package/docs/api/type-aliases/DropdownAlign.md +11 -0
  118. package/docs/api/type-aliases/GlowType.md +11 -0
  119. package/docs/api/type-aliases/InputGlassSize.md +11 -0
  120. package/docs/api/type-aliases/IntensityType.md +11 -0
  121. package/docs/api/type-aliases/ModalSize.md +11 -0
  122. package/docs/api/type-aliases/NotificationType.md +11 -0
  123. package/docs/api/type-aliases/PaddingType.md +11 -0
  124. package/docs/api/type-aliases/ProgressGradient.md +11 -0
  125. package/docs/api/type-aliases/ProgressSize.md +11 -0
  126. package/docs/api/type-aliases/SkeletonVariant.md +11 -0
  127. package/docs/api/type-aliases/Theme.md +11 -0
  128. package/docs/api/type-aliases/ToggleGlassSize.md +11 -0
  129. package/docs/api/type-aliases/TooltipPosition.md +11 -0
  130. package/docs/api/variables/AICardGlass.md +11 -0
  131. package/docs/api/variables/AlertGlass.md +11 -0
  132. package/docs/api/variables/AvatarGlass.md +11 -0
  133. package/docs/api/variables/BadgeGlass.md +11 -0
  134. package/docs/api/variables/BaseProgressGlass.md +11 -0
  135. package/docs/api/variables/ButtonGlass.md +11 -0
  136. package/docs/api/variables/CareerStatsGlass.md +11 -0
  137. package/docs/api/variables/CareerStatsHeaderGlass.md +11 -0
  138. package/docs/api/variables/CheckboxGlass.md +11 -0
  139. package/docs/api/variables/CircularMetricGlass.md +22 -0
  140. package/docs/api/variables/CircularProgressGlass.md +11 -0
  141. package/docs/api/variables/ComboBoxGlass.md +27 -0
  142. package/docs/api/variables/ContributionMetricsGlass.md +11 -0
  143. package/docs/api/variables/DropdownGlass.md +11 -0
  144. package/docs/api/variables/ExpandableHeaderGlass.md +11 -0
  145. package/docs/api/variables/FlagAlertGlass.md +11 -0
  146. package/docs/api/variables/FlagsSectionGlass.md +11 -0
  147. package/docs/api/variables/FormFieldWrapper.md +44 -0
  148. package/docs/api/variables/GlassCard.md +11 -0
  149. package/docs/api/variables/HeaderBrandingGlass.md +11 -0
  150. package/docs/api/variables/HeaderNavGlass.md +11 -0
  151. package/docs/api/variables/IconButtonGlass.md +11 -0
  152. package/docs/api/variables/InputGlass.md +11 -0
  153. package/docs/api/variables/InteractiveCard.md +45 -0
  154. package/docs/api/variables/LanguageBarGlass.md +11 -0
  155. package/docs/api/variables/MetricCardGlass.md +11 -0
  156. package/docs/api/variables/MetricsGridGlass.md +11 -0
  157. package/docs/api/variables/ModalGlass.md +72 -0
  158. package/docs/api/variables/NotificationGlass.md +11 -0
  159. package/docs/api/variables/PopoverGlass.md +11 -0
  160. package/docs/api/variables/ProfileAvatarGlass.md +11 -0
  161. package/docs/api/variables/ProfileHeaderGlass.md +11 -0
  162. package/docs/api/variables/ProgressGlass.md +11 -0
  163. package/docs/api/variables/ProjectsListGlass.md +11 -0
  164. package/docs/api/variables/RainbowProgressGlass.md +11 -0
  165. package/docs/api/variables/RepositoryCardGlass.md +11 -0
  166. package/docs/api/variables/RepositoryHeaderGlass.md +11 -0
  167. package/docs/api/variables/RepositoryMetadataGlass.md +11 -0
  168. package/docs/api/variables/SearchBoxGlass.md +11 -0
  169. package/docs/api/variables/SegmentedControlGlass.md +11 -0
  170. package/docs/api/variables/SkeletonGlass.md +11 -0
  171. package/docs/api/variables/SliderGlass.md +11 -0
  172. package/docs/api/variables/SortDropdownGlass.md +11 -0
  173. package/docs/api/variables/StatItemGlass.md +11 -0
  174. package/docs/api/variables/StatusIndicatorGlass.md +11 -0
  175. package/docs/api/variables/THEMES.md +11 -0
  176. package/docs/api/variables/THEME_CONFIG.md +11 -0
  177. package/docs/api/variables/TabsGlass.md +52 -0
  178. package/docs/api/variables/ThemeToggleGlass.md +11 -0
  179. package/docs/api/variables/ToggleGlass.md +11 -0
  180. package/docs/api/variables/TooltipGlass.md +11 -0
  181. package/docs/api/variables/TouchTarget.md +35 -0
  182. package/docs/api/variables/TrustScoreCardGlass.md +11 -0
  183. package/docs/api/variables/TrustScoreDisplayGlass.md +11 -0
  184. package/docs/api/variables/UserInfoGlass.md +11 -0
  185. package/docs/api/variables/UserStatsLineGlass.md +11 -0
  186. package/docs/api/variables/YearCardGlass.md +11 -0
  187. package/docs/api/variables/alertVariants.md +21 -0
  188. package/docs/api/variables/avatarSizes.md +21 -0
  189. package/docs/api/variables/badgeVariants.md +21 -0
  190. package/docs/api/variables/buttonGlassVariants.md +21 -0
  191. package/docs/api/variables/cardIntensity.md +21 -0
  192. package/docs/api/variables/dropdownAlign.md +21 -0
  193. package/docs/api/variables/inputVariants.md +21 -0
  194. package/docs/api/variables/modalSizes.md +21 -0
  195. package/docs/api/variables/notificationVariants.md +21 -0
  196. package/docs/api/variables/progressSizes.md +21 -0
  197. package/docs/api/variables/shadcnAlertVariants.md +21 -0
  198. package/docs/api/variables/shadcnBadgeVariants.md +21 -0
  199. package/docs/api/variables/shadcnButtonVariants.md +21 -0
  200. package/docs/api/variables/skeletonVariants.md +21 -0
  201. package/docs/api/variables/statusSizes.md +21 -0
  202. package/docs/api/variables/toggleSizes.md +21 -0
  203. package/docs/api/variables/tooltipPositions.md +21 -0
  204. package/docs/design-system/UI_DESIGN.md +628 -0
  205. package/docs/migration/CSS_VARIABLES_MIGRATION_2.0.md +325 -0
  206. package/docs/migration/modal-glass-compound-api.md +458 -0
  207. package/docs/migration/select-to-combobox.md +386 -0
  208. package/docs/migration/tabs-glass-compound-api.md +579 -0
  209. package/docs/technical/DEPENDENCIES.md +291 -0
  210. package/docs/visual-testing-guide.md +324 -0
  211. package/package.json +20 -3
  212. package/dist/trust-score-card-glass-CNcQveNY.cjs +0 -8231
  213. package/dist/trust-score-card-glass-CNcQveNY.cjs.map +0 -1
  214. package/dist/trust-score-card-glass-CowcDyxH.js +0 -7795
  215. package/dist/trust-score-card-glass-CowcDyxH.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,9 +1,850 @@
1
- const require_trust_score_card_glass = require("./trust-score-card-glass-CNcQveNY.cjs");
2
- const require_utils = require("./utils-CriE74ig.cjs");
3
- const require_use_focus = require("./use-focus-BbpE2qGq.cjs");
4
- const require_theme_context = require("./theme-context-XtasSxRT.cjs");
5
- const require_use_wallpaper_tint = require("./use-wallpaper-tint-CIqtoETa.cjs");
1
+ const require_trust_score_card_glass = require("./trust-score-card-glass-r3qM09Jp.cjs");
2
+ const require_utils = require("./utils-DLXayspX.cjs");
3
+ const require_use_focus = require("./use-focus-ZE8ozmZE.cjs");
4
+ const require_theme_context = require("./theme-context-CVW50BKW.cjs");
5
+ const require_use_wallpaper_tint = require("./use-wallpaper-tint-BuS80tbN.cjs");
6
+ let react = require("react");
7
+ react = require_trust_score_card_glass.__toESM(react);
8
+ let lucide_react = require("lucide-react");
9
+ let clsx = require("clsx");
6
10
  let class_variance_authority = require("class-variance-authority");
11
+ let react_jsx_runtime = require("react/jsx-runtime");
12
+ let react_dom = require("react-dom");
13
+ const stepperRootVariants = (0, class_variance_authority.cva)("flex w-full", {
14
+ variants: { orientation: {
15
+ horizontal: "flex-col",
16
+ vertical: "flex-col"
17
+ } },
18
+ defaultVariants: { orientation: "horizontal" }
19
+ });
20
+ const stepperListVariants = (0, class_variance_authority.cva)("flex", {
21
+ variants: { orientation: {
22
+ horizontal: "flex-row items-center w-full",
23
+ vertical: "flex-col gap-0"
24
+ } },
25
+ defaultVariants: { orientation: "horizontal" }
26
+ });
27
+ const stepperStepContainerVariants = (0, class_variance_authority.cva)("relative flex transition-all duration-300", {
28
+ variants: { orientation: {
29
+ horizontal: "flex-col items-center flex-1",
30
+ vertical: "flex-row items-start gap-3"
31
+ } },
32
+ defaultVariants: { orientation: "horizontal" }
33
+ });
34
+ const stepperIndicatorVariants = (0, class_variance_authority.cva)("relative flex items-center justify-center rounded-full font-medium transition-all duration-300 shrink-0", {
35
+ variants: {
36
+ size: {
37
+ sm: "w-8 h-8 text-xs",
38
+ md: "w-10 h-10 text-sm",
39
+ lg: "w-12 h-12 text-base"
40
+ },
41
+ variant: {
42
+ numbered: "",
43
+ icon: "",
44
+ dots: ""
45
+ }
46
+ },
47
+ defaultVariants: {
48
+ size: "md",
49
+ variant: "numbered"
50
+ },
51
+ compoundVariants: [
52
+ {
53
+ variant: "dots",
54
+ size: "sm",
55
+ className: "!w-2.5 !h-2.5"
56
+ },
57
+ {
58
+ variant: "dots",
59
+ size: "md",
60
+ className: "!w-3 !h-3"
61
+ },
62
+ {
63
+ variant: "dots",
64
+ size: "lg",
65
+ className: "!w-4 !h-4"
66
+ }
67
+ ]
68
+ });
69
+ const stepperConnectorVariants = (0, class_variance_authority.cva)("transition-all duration-500 ease-out", {
70
+ variants: { orientation: {
71
+ horizontal: "h-0.5 flex-1 mx-2 md:mx-3",
72
+ vertical: "w-0.5 min-h-6 ml-5 my-1"
73
+ } },
74
+ defaultVariants: { orientation: "horizontal" }
75
+ });
76
+ const stepperLabelVariants = (0, class_variance_authority.cva)("font-medium transition-colors duration-300 whitespace-nowrap", {
77
+ variants: {
78
+ size: {
79
+ sm: "text-xs",
80
+ md: "text-sm",
81
+ lg: "text-base"
82
+ },
83
+ orientation: {
84
+ horizontal: "mt-2 text-center",
85
+ vertical: ""
86
+ }
87
+ },
88
+ defaultVariants: {
89
+ size: "md",
90
+ orientation: "horizontal"
91
+ }
92
+ });
93
+ const stepperDescriptionVariants = (0, class_variance_authority.cva)("transition-colors duration-300", {
94
+ variants: {
95
+ size: {
96
+ sm: "text-[10px]",
97
+ md: "text-xs",
98
+ lg: "text-sm"
99
+ },
100
+ orientation: {
101
+ horizontal: "text-center max-w-[100px] md:max-w-[120px]",
102
+ vertical: "max-w-[200px]"
103
+ }
104
+ },
105
+ defaultVariants: {
106
+ size: "md",
107
+ orientation: "horizontal"
108
+ }
109
+ });
110
+ const stepperContentVariants = (0, class_variance_authority.cva)("animate-in fade-in-0 duration-200", {
111
+ variants: { orientation: {
112
+ horizontal: "mt-6",
113
+ vertical: "mt-4"
114
+ } },
115
+ defaultVariants: { orientation: "horizontal" }
116
+ });
117
+ var StepperContext = (0, react.createContext)(null);
118
+ var useStepperContext = () => {
119
+ const context = (0, react.useContext)(StepperContext);
120
+ if (!context) throw new Error("Stepper compound components must be used within StepperGlass.Root");
121
+ return context;
122
+ };
123
+ function getStepStatus(stepValue, currentValue, steps, linear, disabled) {
124
+ if (disabled) return "disabled";
125
+ const stepIndex = steps.indexOf(stepValue);
126
+ const currentIndex = steps.indexOf(currentValue);
127
+ if (stepIndex === -1 || currentIndex === -1) return "pending";
128
+ if (stepIndex === currentIndex) return "active";
129
+ if (stepIndex < currentIndex) return "completed";
130
+ if (linear && stepIndex > currentIndex) return "disabled";
131
+ return "pending";
132
+ }
133
+ var StepperRoot = ({ value, onValueChange, orientation = "horizontal", variant = "numbered", size = "md", linear = false, children, className }) => {
134
+ const [steps, setSteps] = (0, react.useState)([]);
135
+ const registerStep = (0, react.useCallback)((stepValue, index) => {
136
+ setSteps((prev) => {
137
+ if (prev.includes(stepValue)) return prev;
138
+ const newSteps = [...prev];
139
+ newSteps.splice(index, 0, stepValue);
140
+ return newSteps;
141
+ });
142
+ }, []);
143
+ const unregisterStep = (0, react.useCallback)((stepValue) => {
144
+ setSteps((prev) => prev.filter((s) => s !== stepValue));
145
+ }, []);
146
+ const contextValue = (0, react.useMemo)(() => ({
147
+ value,
148
+ onValueChange,
149
+ orientation,
150
+ variant,
151
+ size,
152
+ linear,
153
+ steps,
154
+ registerStep,
155
+ unregisterStep
156
+ }), [
157
+ value,
158
+ onValueChange,
159
+ orientation,
160
+ variant,
161
+ size,
162
+ linear,
163
+ steps,
164
+ registerStep,
165
+ unregisterStep
166
+ ]);
167
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepperContext.Provider, {
168
+ value: contextValue,
169
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
170
+ className: require_utils.cn(stepperRootVariants({ orientation }), className),
171
+ "aria-label": "Progress steps",
172
+ children
173
+ })
174
+ });
175
+ };
176
+ var StepperList = (0, react.forwardRef)(({ children, className, ...props }, ref) => {
177
+ const { orientation } = useStepperContext();
178
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
179
+ ref,
180
+ role: "tablist",
181
+ "aria-orientation": orientation,
182
+ className: require_utils.cn(stepperListVariants({ orientation }), className),
183
+ ...props,
184
+ children
185
+ });
186
+ });
187
+ StepperList.displayName = "StepperList";
188
+ var StepperStep = (0, react.forwardRef)(({ value: stepValue, label, description, icon, completedIcon, disabled: forcedDisabled, className, index: providedIndex }, ref) => {
189
+ const { value: currentValue, onValueChange, orientation, variant, size, linear, steps, registerStep, unregisterStep } = useStepperContext();
190
+ const { isFocusVisible, focusProps } = require_use_focus.useFocus({ focusVisible: true });
191
+ const [mountIndex] = (0, react.useState)(() => providedIndex ?? Date.now());
192
+ (0, react.useLayoutEffect)(() => {
193
+ registerStep(stepValue, mountIndex);
194
+ return () => unregisterStep(stepValue);
195
+ }, [
196
+ stepValue,
197
+ mountIndex,
198
+ registerStep,
199
+ unregisterStep
200
+ ]);
201
+ const status = getStepStatus(stepValue, currentValue, steps, linear, forcedDisabled);
202
+ const stepIndex = steps.indexOf(stepValue);
203
+ const isLast = stepIndex === steps.length - 1;
204
+ const isClickable = status !== "disabled";
205
+ const indicatorStyles = {
206
+ background: status === "completed" ? "var(--stepper-step-completed-bg)" : status === "active" ? "var(--stepper-step-active-bg)" : status === "disabled" ? "var(--stepper-step-disabled-bg)" : "var(--stepper-step-bg)",
207
+ border: `2px solid ${status === "completed" ? "var(--stepper-step-completed-border)" : status === "active" ? "var(--stepper-step-active-border)" : status === "disabled" ? "var(--stepper-step-disabled-border)" : "var(--stepper-step-border)"}`,
208
+ color: status === "completed" ? "var(--stepper-step-completed-text)" : status === "active" ? "var(--stepper-step-active-text)" : status === "disabled" ? "var(--stepper-step-disabled-text)" : "var(--stepper-step-text)",
209
+ boxShadow: status === "active" ? "var(--stepper-step-active-glow)" : status === "completed" ? "var(--stepper-step-glow)" : isFocusVisible ? "var(--focus-glow)" : "none",
210
+ backdropFilter: "blur(var(--blur-sm))"
211
+ };
212
+ const connectorStyles = { background: stepIndex < steps.indexOf(currentValue) ? "var(--stepper-connector-active-bg)" : "var(--stepper-connector-bg)" };
213
+ const labelStyles = { color: status === "active" || status === "completed" ? "var(--stepper-label-text)" : "var(--stepper-description-text)" };
214
+ const descriptionStyles = { color: "var(--stepper-description-text)" };
215
+ const renderIndicatorContent = () => {
216
+ if (status === "completed") {
217
+ if (completedIcon) return completedIcon;
218
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, { className: "w-4 h-4" });
219
+ }
220
+ if (variant === "icon" && icon) return icon;
221
+ if (variant === "dots") return null;
222
+ return stepIndex >= 0 ? stepIndex + 1 : "";
223
+ };
224
+ const handleClick = () => {
225
+ if (isClickable && onValueChange) onValueChange(stepValue);
226
+ };
227
+ const handleKeyDown = (e) => {
228
+ if (!isClickable) return;
229
+ const stepList = e.currentTarget.closest("[role=\"tablist\"]");
230
+ if (!stepList) return;
231
+ const allSteps = Array.from(stepList.querySelectorAll("[role=\"tab\"]:not([aria-disabled=\"true\"])"));
232
+ const currentIdx = allSteps.indexOf(e.currentTarget);
233
+ let nextIdx = currentIdx;
234
+ const isHorizontal = orientation === "horizontal";
235
+ switch (e.key) {
236
+ case isHorizontal ? "ArrowRight" : "ArrowDown":
237
+ e.preventDefault();
238
+ nextIdx = (currentIdx + 1) % allSteps.length;
239
+ break;
240
+ case isHorizontal ? "ArrowLeft" : "ArrowUp":
241
+ e.preventDefault();
242
+ nextIdx = currentIdx - 1 < 0 ? allSteps.length - 1 : currentIdx - 1;
243
+ break;
244
+ case "Home":
245
+ e.preventDefault();
246
+ nextIdx = 0;
247
+ break;
248
+ case "End":
249
+ e.preventDefault();
250
+ nextIdx = allSteps.length - 1;
251
+ break;
252
+ default: return;
253
+ }
254
+ const nextStep = allSteps[nextIdx];
255
+ if (nextStep) {
256
+ nextStep.focus();
257
+ const nextValue = nextStep.getAttribute("data-value");
258
+ if (nextValue && onValueChange) onValueChange(nextValue);
259
+ }
260
+ };
261
+ if (orientation === "horizontal") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
262
+ className: require_utils.cn(stepperStepContainerVariants({ orientation }), className),
263
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
264
+ ref,
265
+ type: "button",
266
+ role: "tab",
267
+ "aria-selected": status === "active",
268
+ "aria-disabled": !isClickable,
269
+ "aria-current": status === "active" ? "step" : void 0,
270
+ "data-value": stepValue,
271
+ "data-status": status,
272
+ onClick: handleClick,
273
+ onKeyDown: handleKeyDown,
274
+ onFocus: focusProps.onFocus,
275
+ onBlur: focusProps.onBlur,
276
+ disabled: !isClickable,
277
+ className: require_utils.cn(stepperIndicatorVariants({
278
+ size,
279
+ variant
280
+ }), !isClickable && "cursor-not-allowed opacity-60", isClickable && "cursor-pointer hover:scale-105", "min-w-[44px] min-h-[44px]"),
281
+ style: indicatorStyles,
282
+ children: renderIndicatorContent()
283
+ }), label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
284
+ className: "flex flex-col items-center",
285
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
286
+ className: require_utils.cn(stepperLabelVariants({
287
+ size,
288
+ orientation
289
+ })),
290
+ style: labelStyles,
291
+ children: label
292
+ }), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
293
+ className: require_utils.cn(stepperDescriptionVariants({
294
+ size,
295
+ orientation
296
+ })),
297
+ style: descriptionStyles,
298
+ children: description
299
+ })]
300
+ })]
301
+ }), !isLast && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
302
+ className: require_utils.cn(stepperConnectorVariants({ orientation })),
303
+ style: connectorStyles,
304
+ "aria-hidden": "true"
305
+ })] });
306
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
307
+ className: "flex flex-col",
308
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
309
+ className: require_utils.cn(stepperStepContainerVariants({ orientation }), className),
310
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
311
+ ref,
312
+ type: "button",
313
+ role: "tab",
314
+ "aria-selected": status === "active",
315
+ "aria-disabled": !isClickable,
316
+ "aria-current": status === "active" ? "step" : void 0,
317
+ "data-value": stepValue,
318
+ "data-status": status,
319
+ onClick: handleClick,
320
+ onKeyDown: handleKeyDown,
321
+ onFocus: focusProps.onFocus,
322
+ onBlur: focusProps.onBlur,
323
+ disabled: !isClickable,
324
+ className: require_utils.cn(stepperIndicatorVariants({
325
+ size,
326
+ variant
327
+ }), !isClickable && "cursor-not-allowed opacity-60", isClickable && "cursor-pointer hover:scale-105", "min-w-[44px] min-h-[44px]"),
328
+ style: indicatorStyles,
329
+ children: renderIndicatorContent()
330
+ }), label && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
331
+ className: "flex flex-col justify-center",
332
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
333
+ className: require_utils.cn(stepperLabelVariants({
334
+ size,
335
+ orientation
336
+ })),
337
+ style: labelStyles,
338
+ children: label
339
+ }), description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
340
+ className: require_utils.cn(stepperDescriptionVariants({
341
+ size,
342
+ orientation
343
+ })),
344
+ style: descriptionStyles,
345
+ children: description
346
+ })]
347
+ })]
348
+ }), !isLast && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
349
+ className: require_utils.cn(stepperConnectorVariants({ orientation })),
350
+ style: connectorStyles,
351
+ "aria-hidden": "true"
352
+ })]
353
+ });
354
+ });
355
+ StepperStep.displayName = "StepperStep";
356
+ var StepperContent = ({ value, children, className }) => {
357
+ const { value: currentValue, orientation } = useStepperContext();
358
+ const isActive = currentValue === value;
359
+ if (!isActive) return null;
360
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
361
+ role: "tabpanel",
362
+ "aria-hidden": !isActive,
363
+ className: require_utils.cn(stepperContentVariants({ orientation }), className),
364
+ children
365
+ });
366
+ };
367
+ const StepperGlass = {
368
+ Root: StepperRoot,
369
+ List: StepperList,
370
+ Step: StepperStep,
371
+ Content: StepperContent
372
+ };
373
+ function _extends$1() {
374
+ return _extends$1 = Object.assign ? Object.assign.bind() : function(n) {
375
+ for (var e = 1; e < arguments.length; e++) {
376
+ var t = arguments[e];
377
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
378
+ }
379
+ return n;
380
+ }, _extends$1.apply(null, arguments);
381
+ }
382
+ function ownKeys$1(e, r) {
383
+ var t = Object.keys(e);
384
+ if (Object.getOwnPropertySymbols) {
385
+ var o = Object.getOwnPropertySymbols(e);
386
+ r && (o = o.filter(function(r$1) {
387
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
388
+ })), t.push.apply(t, o);
389
+ }
390
+ return t;
391
+ }
392
+ function _objectSpread$1(e) {
393
+ for (var r = 1; r < arguments.length; r++) {
394
+ var t = null != arguments[r] ? arguments[r] : {};
395
+ r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r$1) {
396
+ _defineProperty$1(e, r$1, t[r$1]);
397
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r$1) {
398
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
399
+ });
400
+ }
401
+ return e;
402
+ }
403
+ function _defineProperty$1(e, r, t) {
404
+ return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, {
405
+ value: t,
406
+ enumerable: !0,
407
+ configurable: !0,
408
+ writable: !0
409
+ }) : e[r] = t, e;
410
+ }
411
+ function _toPropertyKey$1(t) {
412
+ var i = _toPrimitive$1(t, "string");
413
+ return "symbol" == typeof i ? i : i + "";
414
+ }
415
+ function _toPrimitive$1(t, r) {
416
+ if ("object" != typeof t || !t) return t;
417
+ var e = t[Symbol.toPrimitive];
418
+ if (void 0 !== e) {
419
+ var i = e.call(t, r || "default");
420
+ if ("object" != typeof i) return i;
421
+ throw new TypeError("@@toPrimitive must return a primitive value.");
422
+ }
423
+ return ("string" === r ? String : Number)(t);
424
+ }
425
+ var SIZE = 32;
426
+ var defaultLegendContentDefaultProps = {
427
+ align: "center",
428
+ iconSize: 14,
429
+ inactiveColor: "#ccc",
430
+ layout: "horizontal",
431
+ verticalAlign: "middle"
432
+ };
433
+ function Icon(_ref) {
434
+ var { data, iconType, inactiveColor } = _ref;
435
+ var halfSize = SIZE / 2;
436
+ var sixthSize = SIZE / 6;
437
+ var thirdSize = SIZE / 3;
438
+ var color = data.inactive ? inactiveColor : data.color;
439
+ var preferredIcon = iconType !== null && iconType !== void 0 ? iconType : data.type;
440
+ if (preferredIcon === "none") return null;
441
+ if (preferredIcon === "plainline") {
442
+ var _data$payload;
443
+ return /* @__PURE__ */ react.createElement("line", {
444
+ strokeWidth: 4,
445
+ fill: "none",
446
+ stroke: color,
447
+ strokeDasharray: (_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.strokeDasharray,
448
+ x1: 0,
449
+ y1: halfSize,
450
+ x2: SIZE,
451
+ y2: halfSize,
452
+ className: "recharts-legend-icon"
453
+ });
454
+ }
455
+ if (preferredIcon === "line") return /* @__PURE__ */ react.createElement("path", {
456
+ strokeWidth: 4,
457
+ fill: "none",
458
+ stroke: color,
459
+ d: "M0,".concat(halfSize, "h").concat(thirdSize, "\n A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(2 * thirdSize, ",").concat(halfSize, "\n H").concat(SIZE, "M").concat(2 * thirdSize, ",").concat(halfSize, "\n A").concat(sixthSize, ",").concat(sixthSize, ",0,1,1,").concat(thirdSize, ",").concat(halfSize),
460
+ className: "recharts-legend-icon"
461
+ });
462
+ if (preferredIcon === "rect") return /* @__PURE__ */ react.createElement("path", {
463
+ stroke: "none",
464
+ fill: color,
465
+ d: "M0,".concat(SIZE / 8, "h").concat(SIZE, "v").concat(SIZE * 3 / 4, "h").concat(-SIZE, "z"),
466
+ className: "recharts-legend-icon"
467
+ });
468
+ if (/* @__PURE__ */ react.isValidElement(data.legendIcon)) {
469
+ var iconProps = _objectSpread$1({}, data);
470
+ delete iconProps.legendIcon;
471
+ return /* @__PURE__ */ react.cloneElement(data.legendIcon, iconProps);
472
+ }
473
+ return /* @__PURE__ */ react.createElement(require_trust_score_card_glass.Symbols, {
474
+ fill: color,
475
+ cx: halfSize,
476
+ cy: halfSize,
477
+ size: SIZE,
478
+ sizeType: "diameter",
479
+ type: preferredIcon
480
+ });
481
+ }
482
+ function Items(props) {
483
+ var { payload, iconSize, layout, formatter, inactiveColor, iconType } = props;
484
+ var viewBox = {
485
+ x: 0,
486
+ y: 0,
487
+ width: SIZE,
488
+ height: SIZE
489
+ };
490
+ var itemStyle = {
491
+ display: layout === "horizontal" ? "inline-block" : "block",
492
+ marginRight: 10
493
+ };
494
+ var svgStyle = {
495
+ display: "inline-block",
496
+ verticalAlign: "middle",
497
+ marginRight: 4
498
+ };
499
+ return payload.map((entry, i) => {
500
+ var finalFormatter = entry.formatter || formatter;
501
+ var className = (0, clsx.clsx)({
502
+ "recharts-legend-item": true,
503
+ ["legend-item-".concat(i)]: true,
504
+ inactive: entry.inactive
505
+ });
506
+ if (entry.type === "none") return null;
507
+ var color = entry.inactive ? inactiveColor : entry.color;
508
+ var finalValue = finalFormatter ? finalFormatter(entry.value, entry, i) : entry.value;
509
+ return /* @__PURE__ */ react.createElement("li", _extends$1({
510
+ className,
511
+ style: itemStyle,
512
+ key: "legend-item-".concat(i)
513
+ }, require_trust_score_card_glass.adaptEventsOfChild(props, entry, i)), /* @__PURE__ */ react.createElement(require_trust_score_card_glass.Surface, {
514
+ width: iconSize,
515
+ height: iconSize,
516
+ viewBox,
517
+ style: svgStyle,
518
+ "aria-label": "".concat(finalValue, " legend icon")
519
+ }, /* @__PURE__ */ react.createElement(Icon, {
520
+ data: entry,
521
+ iconType,
522
+ inactiveColor
523
+ })), /* @__PURE__ */ react.createElement("span", {
524
+ className: "recharts-legend-item-text",
525
+ style: { color }
526
+ }, finalValue));
527
+ });
528
+ }
529
+ var DefaultLegendContent = (outsideProps) => {
530
+ var props = require_trust_score_card_glass.resolveDefaultProps(outsideProps, defaultLegendContentDefaultProps);
531
+ var { payload, layout, align } = props;
532
+ if (!payload || !payload.length) return null;
533
+ var finalStyle = {
534
+ padding: 0,
535
+ margin: 0,
536
+ textAlign: layout === "horizontal" ? align : "left"
537
+ };
538
+ return /* @__PURE__ */ react.createElement("ul", {
539
+ className: "recharts-default-legend",
540
+ style: finalStyle
541
+ }, /* @__PURE__ */ react.createElement(Items, _extends$1({}, props, { payload })));
542
+ };
543
+ function useLegendPayload() {
544
+ return require_trust_score_card_glass.useAppSelector(require_trust_score_card_glass.selectLegendPayload);
545
+ }
546
+ var _excluded = ["contextPayload"];
547
+ function _extends() {
548
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
549
+ for (var e = 1; e < arguments.length; e++) {
550
+ var t = arguments[e];
551
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
552
+ }
553
+ return n;
554
+ }, _extends.apply(null, arguments);
555
+ }
556
+ function ownKeys(e, r) {
557
+ var t = Object.keys(e);
558
+ if (Object.getOwnPropertySymbols) {
559
+ var o = Object.getOwnPropertySymbols(e);
560
+ r && (o = o.filter(function(r$1) {
561
+ return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
562
+ })), t.push.apply(t, o);
563
+ }
564
+ return t;
565
+ }
566
+ function _objectSpread(e) {
567
+ for (var r = 1; r < arguments.length; r++) {
568
+ var t = null != arguments[r] ? arguments[r] : {};
569
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {
570
+ _defineProperty(e, r$1, t[r$1]);
571
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
572
+ Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
573
+ });
574
+ }
575
+ return e;
576
+ }
577
+ function _defineProperty(e, r, t) {
578
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
579
+ value: t,
580
+ enumerable: !0,
581
+ configurable: !0,
582
+ writable: !0
583
+ }) : e[r] = t, e;
584
+ }
585
+ function _toPropertyKey(t) {
586
+ var i = _toPrimitive(t, "string");
587
+ return "symbol" == typeof i ? i : i + "";
588
+ }
589
+ function _toPrimitive(t, r) {
590
+ if ("object" != typeof t || !t) return t;
591
+ var e = t[Symbol.toPrimitive];
592
+ if (void 0 !== e) {
593
+ var i = e.call(t, r || "default");
594
+ if ("object" != typeof i) return i;
595
+ throw new TypeError("@@toPrimitive must return a primitive value.");
596
+ }
597
+ return ("string" === r ? String : Number)(t);
598
+ }
599
+ function _objectWithoutProperties(e, t) {
600
+ if (null == e) return {};
601
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
602
+ if (Object.getOwnPropertySymbols) {
603
+ var n = Object.getOwnPropertySymbols(e);
604
+ for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
605
+ }
606
+ return i;
607
+ }
608
+ function _objectWithoutPropertiesLoose(r, e) {
609
+ if (null == r) return {};
610
+ var t = {};
611
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
612
+ if (-1 !== e.indexOf(n)) continue;
613
+ t[n] = r[n];
614
+ }
615
+ return t;
616
+ }
617
+ function defaultUniqBy(entry) {
618
+ return entry.value;
619
+ }
620
+ function LegendContent(props) {
621
+ var { contextPayload } = props, otherProps = _objectWithoutProperties(props, _excluded);
622
+ var finalPayload = require_trust_score_card_glass.getUniqPayload(contextPayload, props.payloadUniqBy, defaultUniqBy);
623
+ var contentProps = _objectSpread(_objectSpread({}, otherProps), {}, { payload: finalPayload });
624
+ if (/* @__PURE__ */ react.isValidElement(props.content)) return /* @__PURE__ */ react.cloneElement(props.content, contentProps);
625
+ if (typeof props.content === "function") return /* @__PURE__ */ react.createElement(props.content, contentProps);
626
+ return /* @__PURE__ */ react.createElement(DefaultLegendContent, contentProps);
627
+ }
628
+ function getDefaultPosition(style, props, margin, chartWidth, chartHeight, box) {
629
+ var { layout, align, verticalAlign } = props;
630
+ var hPos, vPos;
631
+ if (!style || (style.left === void 0 || style.left === null) && (style.right === void 0 || style.right === null)) if (align === "center" && layout === "vertical") hPos = { left: ((chartWidth || 0) - box.width) / 2 };
632
+ else hPos = align === "right" ? { right: margin && margin.right || 0 } : { left: margin && margin.left || 0 };
633
+ if (!style || (style.top === void 0 || style.top === null) && (style.bottom === void 0 || style.bottom === null)) if (verticalAlign === "middle") vPos = { top: ((chartHeight || 0) - box.height) / 2 };
634
+ else vPos = verticalAlign === "bottom" ? { bottom: margin && margin.bottom || 0 } : { top: margin && margin.top || 0 };
635
+ return _objectSpread(_objectSpread({}, hPos), vPos);
636
+ }
637
+ function LegendSettingsDispatcher(props) {
638
+ var dispatch = require_trust_score_card_glass.useAppDispatch();
639
+ (0, react.useEffect)(() => {
640
+ dispatch(require_trust_score_card_glass.setLegendSettings(props));
641
+ }, [dispatch, props]);
642
+ return null;
643
+ }
644
+ function LegendSizeDispatcher(props) {
645
+ var dispatch = require_trust_score_card_glass.useAppDispatch();
646
+ (0, react.useEffect)(() => {
647
+ dispatch(require_trust_score_card_glass.setLegendSize(props));
648
+ return () => {
649
+ dispatch(require_trust_score_card_glass.setLegendSize({
650
+ width: 0,
651
+ height: 0
652
+ }));
653
+ };
654
+ }, [dispatch, props]);
655
+ return null;
656
+ }
657
+ function getWidthOrHeight(layout, height, width, maxWidth) {
658
+ if (layout === "vertical" && require_trust_score_card_glass.isNumber(height)) return { height };
659
+ if (layout === "horizontal") return { width: width || maxWidth };
660
+ return null;
661
+ }
662
+ var legendDefaultProps = {
663
+ align: "center",
664
+ iconSize: 14,
665
+ itemSorter: "value",
666
+ layout: "horizontal",
667
+ verticalAlign: "bottom"
668
+ };
669
+ function Legend(outsideProps) {
670
+ var props = require_trust_score_card_glass.resolveDefaultProps(outsideProps, legendDefaultProps);
671
+ var contextPayload = useLegendPayload();
672
+ var legendPortalFromContext = require_trust_score_card_glass.useLegendPortal();
673
+ var margin = require_trust_score_card_glass.useMargin();
674
+ var { width: widthFromProps, height: heightFromProps, wrapperStyle, portal: portalFromProps } = props;
675
+ var [lastBoundingBox, updateBoundingBox] = require_trust_score_card_glass.useElementOffset([contextPayload]);
676
+ var chartWidth = require_trust_score_card_glass.useChartWidth();
677
+ var chartHeight = require_trust_score_card_glass.useChartHeight();
678
+ if (chartWidth == null || chartHeight == null) return null;
679
+ var maxWidth = chartWidth - ((margin === null || margin === void 0 ? void 0 : margin.left) || 0) - ((margin === null || margin === void 0 ? void 0 : margin.right) || 0);
680
+ var widthOrHeight = getWidthOrHeight(props.layout, heightFromProps, widthFromProps, maxWidth);
681
+ var outerStyle = portalFromProps ? wrapperStyle : _objectSpread(_objectSpread({
682
+ position: "absolute",
683
+ width: (widthOrHeight === null || widthOrHeight === void 0 ? void 0 : widthOrHeight.width) || widthFromProps || "auto",
684
+ height: (widthOrHeight === null || widthOrHeight === void 0 ? void 0 : widthOrHeight.height) || heightFromProps || "auto"
685
+ }, getDefaultPosition(wrapperStyle, props, margin, chartWidth, chartHeight, lastBoundingBox)), wrapperStyle);
686
+ var legendPortal = portalFromProps !== null && portalFromProps !== void 0 ? portalFromProps : legendPortalFromContext;
687
+ if (legendPortal == null || contextPayload == null) return null;
688
+ return /* @__PURE__ */ (0, react_dom.createPortal)(/* @__PURE__ */ react.createElement("div", {
689
+ className: "recharts-legend-wrapper",
690
+ style: outerStyle,
691
+ ref: updateBoundingBox
692
+ }, /* @__PURE__ */ react.createElement(LegendSettingsDispatcher, {
693
+ layout: props.layout,
694
+ align: props.align,
695
+ verticalAlign: props.verticalAlign,
696
+ itemSorter: props.itemSorter
697
+ }), !portalFromProps && /* @__PURE__ */ react.createElement(LegendSizeDispatcher, {
698
+ width: lastBoundingBox.width,
699
+ height: lastBoundingBox.height
700
+ }), /* @__PURE__ */ react.createElement(LegendContent, _extends({}, props, widthOrHeight, {
701
+ margin,
702
+ chartWidth,
703
+ chartHeight,
704
+ contextPayload
705
+ }))), legendPortal);
706
+ }
707
+ Legend.displayName = "Legend";
708
+ var ChartContext = react.createContext(null);
709
+ function useChart() {
710
+ const context = react.useContext(ChartContext);
711
+ if (!context) throw new Error("useChart must be used within a <ChartContainer />");
712
+ return context;
713
+ }
714
+ var ChartContainer = react.forwardRef(({ id, className, children, config, ...props }, ref) => {
715
+ const uniqueId = react.useId();
716
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
717
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartContext.Provider, {
718
+ value: { config },
719
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
720
+ "data-chart": chartId,
721
+ ref,
722
+ className: require_utils.cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-[var(--text-muted)] [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-[var(--glass-border)] [&_.recharts-curve.recharts-tooltip-cursor]:stroke-[var(--glass-border)] [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-[var(--glass-border)] [&_.recharts-radial-bar-background-sector]:fill-[var(--glass-frost-5)] [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-[var(--glass-frost-10)] [&_.recharts-reference-line_[stroke='#ccc']]:stroke-[var(--glass-border)] [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none", className),
723
+ ...props,
724
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartStyle, {
725
+ id: chartId,
726
+ config
727
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_trust_score_card_glass.ResponsiveContainer, { children })]
728
+ })
729
+ });
730
+ });
731
+ ChartContainer.displayName = "ChartContainer";
732
+ var ChartStyle = ({ id, config }) => {
733
+ const colorConfig = Object.entries(config).filter(([, itemConfig]) => itemConfig.color || itemConfig.theme);
734
+ if (!colorConfig.length) return null;
735
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { dangerouslySetInnerHTML: { __html: `
736
+ [data-chart="${id}"] {
737
+ ${colorConfig.map(([key, itemConfig]) => {
738
+ const color = itemConfig.color || itemConfig.theme?.light;
739
+ return color ? ` --color-${key}: ${color};` : null;
740
+ }).filter(Boolean).join("\n")}
741
+ }
742
+
743
+ [data-theme="glass"] [data-chart="${id}"],
744
+ .dark [data-chart="${id}"] {
745
+ ${colorConfig.map(([key, itemConfig]) => {
746
+ const color = itemConfig.theme?.dark || itemConfig.color;
747
+ return color ? ` --color-${key}: ${color};` : null;
748
+ }).filter(Boolean).join("\n")}
749
+ }
750
+ ` } });
751
+ };
752
+ var ChartTooltip = require_trust_score_card_glass.Tooltip;
753
+ var ChartTooltipContent = react.forwardRef(({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, nameKey, labelKey, valueFormatter }, ref) => {
754
+ const { config } = useChart();
755
+ const tooltipLabel = react.useMemo(() => {
756
+ if (hideLabel || !payload?.length) return null;
757
+ const [item] = payload;
758
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${labelKey || item?.dataKey || item?.name || "value"}`);
759
+ const value = !labelKey && typeof label === "string" ? config[label]?.label || label : itemConfig?.label;
760
+ if (labelFormatter && typeof label === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
761
+ className: require_utils.cn("font-medium", labelClassName),
762
+ children: labelFormatter(label, payload)
763
+ });
764
+ if (!value) return null;
765
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
766
+ className: require_utils.cn("font-medium", labelClassName),
767
+ children: value
768
+ });
769
+ }, [
770
+ label,
771
+ labelFormatter,
772
+ payload,
773
+ hideLabel,
774
+ labelClassName,
775
+ config,
776
+ labelKey
777
+ ]);
778
+ if (!active || !payload?.length) return null;
779
+ const nestLabel = payload.length === 1 && indicator !== "dot";
780
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
781
+ ref,
782
+ className: require_utils.cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-[var(--glass-border)] bg-[var(--glass-bg)] px-2.5 py-1.5 text-xs shadow-xl backdrop-blur-md", className),
783
+ children: [!nestLabel ? tooltipLabel : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
784
+ className: "grid gap-1.5",
785
+ children: payload.map((item, index) => {
786
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey || item.name || item.dataKey || "value"}`);
787
+ const indicatorColor = item.fill || item.color;
788
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
789
+ className: require_utils.cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-[var(--text-muted)]", indicator === "dot" && "items-center"),
790
+ children: [itemConfig?.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
791
+ className: require_utils.cn("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
792
+ "h-2.5 w-2.5": indicator === "dot",
793
+ "w-1": indicator === "line",
794
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
795
+ "my-0.5": nestLabel && indicator === "dashed"
796
+ }),
797
+ style: {
798
+ "--color-bg": indicatorColor,
799
+ "--color-border": indicatorColor
800
+ }
801
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
802
+ className: require_utils.cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
803
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
804
+ className: "grid gap-1.5",
805
+ children: [nestLabel ? tooltipLabel : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
806
+ className: "text-[var(--text-muted)]",
807
+ children: itemConfig?.label || item.name
808
+ })]
809
+ }), item.value !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
810
+ className: "font-mono font-medium tabular-nums text-[var(--text-primary)]",
811
+ children: valueFormatter ? valueFormatter(item.value) : item.value.toLocaleString()
812
+ })]
813
+ })]
814
+ }, `${item.dataKey}-${index}`);
815
+ })
816
+ })]
817
+ });
818
+ });
819
+ ChartTooltipContent.displayName = "ChartTooltipContent";
820
+ var ChartLegend = Legend;
821
+ var ChartLegendContent = react.forwardRef(({ className, hideIcon = false, payload, verticalAlign = "bottom", nameKey }, ref) => {
822
+ const { config } = useChart();
823
+ if (!payload?.length) return null;
824
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
825
+ ref,
826
+ className: require_utils.cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className),
827
+ children: payload.map((item) => {
828
+ const itemConfig = getPayloadConfigFromPayload(config, item, `${nameKey || item.dataKey || "value"}`);
829
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
830
+ className: require_utils.cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-[var(--text-muted)]"),
831
+ children: [itemConfig?.icon && !hideIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(itemConfig.icon, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
832
+ className: "h-2 w-2 shrink-0 rounded-[2px]",
833
+ style: { backgroundColor: item.color }
834
+ }), itemConfig?.label]
835
+ }, item.value);
836
+ })
837
+ });
838
+ });
839
+ ChartLegendContent.displayName = "ChartLegendContent";
840
+ function getPayloadConfigFromPayload(config, payload, key) {
841
+ if (typeof payload !== "object" || payload === null) return;
842
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
843
+ let configLabelKey = key;
844
+ if (key in config) return config[key];
845
+ if (payloadPayload && key in payloadPayload) configLabelKey = payloadPayload[key];
846
+ return configLabelKey in config ? config[configLabelKey] : config[key];
847
+ }
7
848
  const dropdownAlign = (0, class_variance_authority.cva)("absolute mt-2 min-w-[160px] md:min-w-[200px] rounded-2xl py-1.5 md:py-2", {
8
849
  variants: { align: {
9
850
  left: "left-0",
@@ -55,10 +896,19 @@ exports.AICardGlass = require_trust_score_card_glass.AICardGlass;
55
896
  exports.AlertGlass = require_trust_score_card_glass.AlertGlass;
56
897
  exports.AvatarGlass = require_trust_score_card_glass.AvatarGlass;
57
898
  exports.BadgeGlass = require_trust_score_card_glass.BadgeGlass;
899
+ exports.Bar = require_trust_score_card_glass.Bar;
900
+ exports.BarChart = require_trust_score_card_glass.BarChart;
58
901
  exports.BaseProgressGlass = require_trust_score_card_glass.BaseProgressGlass;
59
902
  exports.ButtonGlass = require_trust_score_card_glass.ButtonGlass;
60
903
  exports.CareerStatsGlass = require_trust_score_card_glass.CareerStatsGlass;
61
904
  exports.CareerStatsHeaderGlass = require_trust_score_card_glass.CareerStatsHeaderGlass;
905
+ exports.Cell = require_trust_score_card_glass.Cell;
906
+ exports.ChartContainer = ChartContainer;
907
+ exports.ChartLegend = ChartLegend;
908
+ exports.ChartLegendContent = ChartLegendContent;
909
+ exports.ChartStyle = ChartStyle;
910
+ exports.ChartTooltip = ChartTooltip;
911
+ exports.ChartTooltipContent = ChartTooltipContent;
62
912
  exports.CheckboxGlass = require_trust_score_card_glass.CheckboxGlass;
63
913
  exports.CircularMetricGlass = require_trust_score_card_glass.CircularMetricGlass;
64
914
  exports.CircularProgressGlass = require_trust_score_card_glass.CircularProgressGlass;
@@ -74,6 +924,7 @@ exports.HeaderBrandingGlass = require_trust_score_card_glass.HeaderBrandingGlass
74
924
  exports.HeaderNavGlass = require_trust_score_card_glass.HeaderNavGlass;
75
925
  exports.IconButtonGlass = require_trust_score_card_glass.IconButtonGlass;
76
926
  exports.InputGlass = require_trust_score_card_glass.InputGlass;
927
+ exports.InsightCardGlass = require_trust_score_card_glass.InsightCardGlass;
77
928
  exports.InteractiveCard = require_trust_score_card_glass.InteractiveCard;
78
929
  exports.LanguageBarGlass = require_trust_score_card_glass.LanguageBarGlass;
79
930
  exports.MetricCardGlass = require_trust_score_card_glass.MetricCardGlass;
@@ -89,13 +940,16 @@ exports.RainbowProgressGlass = require_trust_score_card_glass.RainbowProgressGla
89
940
  exports.RepositoryCardGlass = require_trust_score_card_glass.RepositoryCardGlass;
90
941
  exports.RepositoryHeaderGlass = require_trust_score_card_glass.RepositoryHeaderGlass;
91
942
  exports.RepositoryMetadataGlass = require_trust_score_card_glass.RepositoryMetadataGlass;
943
+ exports.ResponsiveContainer = require_trust_score_card_glass.ResponsiveContainer;
92
944
  exports.SearchBoxGlass = require_trust_score_card_glass.SearchBoxGlass;
93
945
  exports.SegmentedControlGlass = require_trust_score_card_glass.SegmentedControlGlass;
94
946
  exports.SkeletonGlass = require_trust_score_card_glass.SkeletonGlass;
95
947
  exports.SliderGlass = require_trust_score_card_glass.SliderGlass;
96
948
  exports.SortDropdownGlass = require_trust_score_card_glass.SortDropdownGlass;
949
+ exports.SparklineGlass = require_trust_score_card_glass.SparklineGlass;
97
950
  exports.StatItemGlass = require_trust_score_card_glass.StatItemGlass;
98
951
  exports.StatusIndicatorGlass = require_trust_score_card_glass.StatusIndicatorGlass;
952
+ exports.StepperGlass = StepperGlass;
99
953
  exports.THEMES = require_theme_context.THEMES;
100
954
  exports.THEME_CONFIG = require_theme_context.THEME_CONFIG;
101
955
  exports.TabsGlass = require_trust_score_card_glass.TabsGlass;
@@ -119,6 +973,8 @@ exports.dropdownAlign = dropdownAlign;
119
973
  exports.getNextTheme = require_theme_context.getNextTheme;
120
974
  exports.getThemeConfig = require_theme_context.getThemeConfig;
121
975
  exports.inputVariants = require_trust_score_card_glass.inputVariants;
976
+ exports.insightCardVariants = require_trust_score_card_glass.insightCardVariants;
977
+ exports.insightVariantConfig = require_trust_score_card_glass.insightVariantConfig;
122
978
  exports.modalSizes = require_trust_score_card_glass.modalSizes;
123
979
  exports.notificationVariants = require_trust_score_card_glass.notificationVariants;
124
980
  exports.progressSizes = require_trust_score_card_glass.progressSizes;
@@ -126,9 +982,20 @@ exports.shadcnAlertVariants = alertVariants$1;
126
982
  exports.shadcnBadgeVariants = badgeVariants$1;
127
983
  exports.shadcnButtonVariants = buttonVariants;
128
984
  exports.skeletonVariants = require_trust_score_card_glass.skeletonVariants;
985
+ exports.sparklineBarVariants = require_trust_score_card_glass.sparklineBarVariants;
986
+ exports.sparklineContainerVariants = require_trust_score_card_glass.sparklineContainerVariants;
129
987
  exports.statusSizes = require_trust_score_card_glass.statusSizes;
988
+ exports.stepperConnectorVariants = stepperConnectorVariants;
989
+ exports.stepperContentVariants = stepperContentVariants;
990
+ exports.stepperDescriptionVariants = stepperDescriptionVariants;
991
+ exports.stepperIndicatorVariants = stepperIndicatorVariants;
992
+ exports.stepperLabelVariants = stepperLabelVariants;
993
+ exports.stepperListVariants = stepperListVariants;
994
+ exports.stepperRootVariants = stepperRootVariants;
995
+ exports.stepperStepContainerVariants = stepperStepContainerVariants;
130
996
  exports.toggleSizes = require_trust_score_card_glass.toggleSizes;
131
997
  exports.tooltipPositions = require_trust_score_card_glass.tooltipPositions;
998
+ exports.useChart = useChart;
132
999
  exports.useFocus = require_use_focus.useFocus;
133
1000
  exports.useHover = require_use_focus.useHover;
134
1001
  exports.useResponsive = require_use_wallpaper_tint.useResponsive;