@hyddenlabs/hydn-ui 0.3.0-alpha.104 → 0.3.0-alpha.151

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.
package/dist/index.js CHANGED
@@ -1,151 +1,191 @@
1
+ import React6, { createContext, useId, useState, useRef, useEffect, createElement, isValidElement, cloneElement, useCallback, useLayoutEffect, useContext, useMemo } from 'react';
1
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
- import React5, { createContext, useId, useState, useRef, useEffect, isValidElement, cloneElement, useCallback, useLayoutEffect, useContext, useMemo, createElement } from 'react';
3
+ import * as TablerIcons from '@tabler/icons-react';
3
4
  import { IconX, IconChevronDown, IconCheck, IconCalendar, IconMenu2, IconLayoutSidebarRightExpand, IconLayoutSidebarRightCollapse, IconTrash, IconChevronRight, IconChevronLeft, IconSelector, IconChevronUp } from '@tabler/icons-react';
4
5
  import { Link, NavLink } from 'react-router-dom';
5
6
  import { createPortal } from 'react-dom';
6
7
 
7
8
  // src/components/forms/button/button.tsx
8
- function Button({
9
- children,
10
- onClick,
11
- ariaLabel,
12
- disabled = false,
13
- type = "button",
14
- className = "",
15
- icon,
16
- iconPosition = "left",
17
- variant = "neutral",
18
- style = "solid",
19
- size = "md",
20
- rounded = "default",
21
- loading = false,
22
- fullWidth = false,
23
- wide = false,
24
- active = false
25
- }) {
26
- const isIconOnly = icon && !children;
27
- if (isIconOnly && !ariaLabel) {
28
- console.warn("Button: Icon-only buttons require an ariaLabel for accessibility");
29
- }
30
- const solidVariantClasses = {
31
- neutral: "bg-neutral text-neutral-foreground hover:bg-neutral/90 active:bg-neutral/80",
32
- primary: "bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",
33
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/90 active:bg-secondary/80",
34
- accent: "bg-accent text-accent-foreground hover:bg-accent/90 active:bg-accent/80",
35
- info: "bg-info text-info-foreground hover:bg-info/90 active:bg-info/80",
36
- success: "bg-success text-success-foreground hover:bg-success/90 active:bg-success/80",
37
- warning: "bg-warning text-warning-foreground hover:bg-warning/90 active:bg-warning/80",
38
- error: "bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/80"
39
- };
40
- const outlineVariantClasses = {
41
- neutral: "border-2 border-neutral text-neutral bg-transparent hover:bg-neutral hover:text-neutral-foreground",
42
- primary: "border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-primary-foreground",
43
- secondary: "border-2 border-secondary text-secondary bg-transparent hover:bg-secondary hover:text-secondary-foreground",
44
- accent: "border-2 border-accent text-accent bg-transparent hover:bg-accent hover:text-accent-foreground",
45
- info: "border-2 border-info text-info bg-transparent hover:bg-info hover:text-info-foreground",
46
- success: "border-2 border-success text-success bg-transparent hover:bg-success hover:text-success-foreground",
47
- warning: "border-2 border-warning text-warning bg-transparent hover:bg-warning hover:text-warning-foreground",
48
- error: "border-2 border-destructive text-destructive bg-transparent hover:bg-destructive hover:text-destructive-foreground"
49
- };
50
- const ghostVariantClasses = {
51
- neutral: "bg-transparent text-foreground hover:bg-neutral/10 active:bg-neutral/20",
52
- primary: "bg-transparent text-primary hover:bg-primary/10 active:bg-primary/20",
53
- secondary: "bg-transparent text-secondary hover:bg-secondary/10 active:bg-secondary/20",
54
- accent: "bg-transparent text-accent hover:bg-accent/10 active:bg-accent/20",
55
- info: "bg-transparent text-info hover:bg-info/10 active:bg-info/20",
56
- success: "bg-transparent text-success hover:bg-success/10 active:bg-success/20",
57
- warning: "bg-transparent text-warning hover:bg-warning/10 active:bg-warning/20",
58
- error: "bg-transparent text-destructive hover:bg-destructive/10 active:bg-destructive/20"
59
- };
60
- const softVariantClasses = {
61
- neutral: "bg-neutral/20 text-foreground hover:bg-neutral/30 active:bg-neutral/40",
62
- primary: "bg-primary/20 text-primary hover:bg-primary/30 active:bg-primary/40",
63
- secondary: "bg-secondary/20 text-secondary hover:bg-secondary/30 active:bg-secondary/40",
64
- accent: "bg-accent/20 text-accent hover:bg-accent/30 active:bg-accent/40",
65
- info: "bg-info/20 text-info hover:bg-info/30 active:bg-info/40",
66
- success: "bg-success/20 text-success hover:bg-success/30 active:bg-success/40",
67
- warning: "bg-warning/20 text-warning hover:bg-warning/30 active:bg-warning/40",
68
- error: "bg-destructive/20 text-destructive hover:bg-destructive/30 active:bg-destructive/40"
69
- };
70
- const linkVariantClasses = {
71
- neutral: "bg-transparent text-foreground underline-offset-4 hover:underline",
72
- primary: "bg-transparent text-primary underline-offset-4 hover:underline",
73
- secondary: "bg-transparent text-secondary underline-offset-4 hover:underline",
74
- accent: "bg-transparent text-accent underline-offset-4 hover:underline",
75
- info: "bg-transparent text-info underline-offset-4 hover:underline",
76
- success: "bg-transparent text-success underline-offset-4 hover:underline",
77
- warning: "bg-transparent text-warning underline-offset-4 hover:underline",
78
- error: "bg-transparent text-destructive underline-offset-4 hover:underline"
79
- };
80
- const getStyleClasses = () => {
81
- const variantKey = variant;
82
- switch (style) {
83
- case "outline":
84
- return `${outlineVariantClasses[variantKey]} active:scale-95`;
85
- case "ghost":
86
- return ghostVariantClasses[variantKey];
87
- case "link":
88
- return linkVariantClasses[variantKey];
89
- case "soft":
90
- return softVariantClasses[variantKey];
91
- case "solid":
92
- default:
93
- return `${solidVariantClasses[variantKey]} shadow-sm hover:shadow-md`;
9
+ var Button = React6.forwardRef(
10
+ ({
11
+ children,
12
+ onClick,
13
+ ariaLabel,
14
+ disabled = false,
15
+ type = "button",
16
+ className = "",
17
+ icon,
18
+ iconPosition = "left",
19
+ variant = "neutral",
20
+ style = "solid",
21
+ size = "md",
22
+ rounded = "default",
23
+ loading = false,
24
+ fullWidth = false,
25
+ wide = false,
26
+ active = false
27
+ }, ref) => {
28
+ const isIconOnly = icon && !children;
29
+ if (isIconOnly && !ariaLabel) {
30
+ console.warn("Button: Icon-only buttons require an ariaLabel for accessibility");
94
31
  }
95
- };
96
- const sizeClasses2 = {
97
- xs: "h-8 sm:h-6 px-3 sm:px-2 text-sm sm:text-xs min-h-8 sm:min-h-6",
98
- sm: "h-10 sm:h-8 px-4 sm:px-3 text-base sm:text-sm min-h-10 sm:min-h-8",
99
- md: "h-12 sm:h-10 px-5 sm:px-4 text-base min-h-12 sm:min-h-10",
100
- lg: "h-14 sm:h-12 px-7 sm:px-6 text-lg min-h-14 sm:min-h-12",
101
- xl: "h-16 sm:h-14 px-9 sm:px-8 text-xl min-h-16 sm:min-h-14"
102
- };
103
- const roundedClasses = {
104
- default: "rounded-md",
105
- pill: "rounded-full",
106
- square: "rounded-none aspect-square",
107
- circle: "rounded-full aspect-square"
108
- };
109
- const displayIcon = loading ? /* @__PURE__ */ jsxs("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
110
- /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
111
- /* @__PURE__ */ jsx(
112
- "path",
32
+ const solidVariantClasses = {
33
+ neutral: "bg-neutral text-neutral-foreground hover:bg-neutral/90 active:bg-neutral/80",
34
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",
35
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/90 active:bg-secondary/80",
36
+ accent: "bg-accent text-accent-foreground hover:bg-accent/90 active:bg-accent/80",
37
+ info: "bg-info text-info-foreground hover:bg-info/90 active:bg-info/80",
38
+ success: "bg-success text-success-foreground hover:bg-success/90 active:bg-success/80",
39
+ warning: "bg-warning text-warning-foreground hover:bg-warning/90 active:bg-warning/80",
40
+ error: "bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/80"
41
+ };
42
+ const outlineVariantClasses = {
43
+ neutral: "border-2 border-neutral text-neutral bg-transparent hover:bg-neutral hover:text-neutral-foreground",
44
+ primary: "border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-primary-foreground",
45
+ secondary: "border-2 border-secondary text-secondary bg-transparent hover:bg-secondary hover:text-secondary-foreground",
46
+ accent: "border-2 border-accent text-accent bg-transparent hover:bg-accent hover:text-accent-foreground",
47
+ info: "border-2 border-info text-info bg-transparent hover:bg-info hover:text-info-foreground",
48
+ success: "border-2 border-success text-success bg-transparent hover:bg-success hover:text-success-foreground",
49
+ warning: "border-2 border-warning text-warning bg-transparent hover:bg-warning hover:text-warning-foreground",
50
+ error: "border-2 border-destructive text-destructive bg-transparent hover:bg-destructive hover:text-destructive-foreground"
51
+ };
52
+ const ghostVariantClasses = {
53
+ neutral: "bg-transparent text-foreground hover:bg-neutral/10 active:bg-neutral/20",
54
+ primary: "bg-transparent text-primary hover:bg-primary/10 active:bg-primary/20",
55
+ secondary: "bg-transparent text-secondary hover:bg-secondary/10 active:bg-secondary/20",
56
+ accent: "bg-transparent text-accent hover:bg-accent/10 active:bg-accent/20",
57
+ info: "bg-transparent text-info hover:bg-info/10 active:bg-info/20",
58
+ success: "bg-transparent text-success hover:bg-success/10 active:bg-success/20",
59
+ warning: "bg-transparent text-warning hover:bg-warning/10 active:bg-warning/20",
60
+ error: "bg-transparent text-destructive hover:bg-destructive/10 active:bg-destructive/20"
61
+ };
62
+ const softVariantClasses = {
63
+ neutral: "bg-neutral/20 text-foreground hover:bg-neutral/30 active:bg-neutral/40",
64
+ primary: "bg-primary/20 text-primary hover:bg-primary/30 active:bg-primary/40",
65
+ secondary: "bg-secondary/20 text-secondary hover:bg-secondary/30 active:bg-secondary/40",
66
+ accent: "bg-accent/20 text-accent hover:bg-accent/30 active:bg-accent/40",
67
+ info: "bg-info/20 text-info hover:bg-info/30 active:bg-info/40",
68
+ success: "bg-success/20 text-success hover:bg-success/30 active:bg-success/40",
69
+ warning: "bg-warning/20 text-warning hover:bg-warning/30 active:bg-warning/40",
70
+ error: "bg-destructive/20 text-destructive hover:bg-destructive/30 active:bg-destructive/40"
71
+ };
72
+ const linkVariantClasses = {
73
+ neutral: "bg-transparent text-foreground underline-offset-4 hover:underline",
74
+ primary: "bg-transparent text-primary underline-offset-4 hover:underline",
75
+ secondary: "bg-transparent text-secondary underline-offset-4 hover:underline",
76
+ accent: "bg-transparent text-accent underline-offset-4 hover:underline",
77
+ info: "bg-transparent text-info underline-offset-4 hover:underline",
78
+ success: "bg-transparent text-success underline-offset-4 hover:underline",
79
+ warning: "bg-transparent text-warning underline-offset-4 hover:underline",
80
+ error: "bg-transparent text-destructive underline-offset-4 hover:underline"
81
+ };
82
+ const getStyleClasses = () => {
83
+ const variantKey = variant;
84
+ switch (style) {
85
+ case "outline":
86
+ return `${outlineVariantClasses[variantKey]} active:scale-95`;
87
+ case "ghost":
88
+ return ghostVariantClasses[variantKey];
89
+ case "link":
90
+ return linkVariantClasses[variantKey];
91
+ case "soft":
92
+ return softVariantClasses[variantKey];
93
+ case "solid":
94
+ default:
95
+ return `${solidVariantClasses[variantKey]} shadow-sm hover:shadow-md`;
96
+ }
97
+ };
98
+ const sizeClasses2 = {
99
+ xs: "h-8 sm:h-6 px-3 sm:px-2 text-sm sm:text-xs min-h-8 sm:min-h-6",
100
+ sm: "h-10 sm:h-8 px-4 sm:px-3 text-base sm:text-sm min-h-10 sm:min-h-8",
101
+ md: "h-12 sm:h-10 px-5 sm:px-4 text-base min-h-12 sm:min-h-10",
102
+ lg: "h-14 sm:h-12 px-7 sm:px-6 text-lg min-h-14 sm:min-h-12",
103
+ xl: "h-16 sm:h-14 px-9 sm:px-8 text-xl min-h-16 sm:min-h-14"
104
+ };
105
+ const roundedClasses = {
106
+ default: "rounded-md",
107
+ pill: "rounded-full",
108
+ square: "rounded-none aspect-square",
109
+ circle: "rounded-full aspect-square"
110
+ };
111
+ const displayIcon = loading ? /* @__PURE__ */ jsxs("svg", { className: "animate-spin h-4 w-4", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
112
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
113
+ /* @__PURE__ */ jsx(
114
+ "path",
115
+ {
116
+ className: "opacity-75",
117
+ fill: "currentColor",
118
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
119
+ }
120
+ )
121
+ ] }) : icon;
122
+ const styleClasses = getStyleClasses();
123
+ const widthClasses = fullWidth ? "w-full" : wide ? "px-8" : "";
124
+ const activeClasses = active ? "active:scale-95" : "";
125
+ return /* @__PURE__ */ jsxs(
126
+ "button",
113
127
  {
114
- className: "opacity-75",
115
- fill: "currentColor",
116
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
128
+ ref,
129
+ type,
130
+ onClick,
131
+ "aria-label": ariaLabel,
132
+ disabled: disabled || loading,
133
+ className: `inline-flex items-center justify-center ${roundedClasses[rounded]} font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 ${styleClasses} ${sizeClasses2[size]} ${isIconOnly ? "p-0" : ""} ${widthClasses} ${activeClasses} ${className}`,
134
+ children: [
135
+ displayIcon && iconPosition === "left" && /* @__PURE__ */ jsx("span", { className: `inline-flex ${children ? "mr-2" : ""}`, children: displayIcon }),
136
+ children,
137
+ displayIcon && iconPosition === "right" && /* @__PURE__ */ jsx("span", { className: `inline-flex ${children ? "ml-2" : ""}`, children: displayIcon })
138
+ ]
117
139
  }
118
- )
119
- ] }) : icon;
120
- const styleClasses = getStyleClasses();
121
- const widthClasses = fullWidth ? "w-full" : wide ? "px-8" : "";
122
- const activeClasses = active ? "active:scale-95" : "";
123
- return /* @__PURE__ */ jsxs(
124
- "button",
140
+ );
141
+ }
142
+ );
143
+ Button.displayName = "Button";
144
+ var button_default = Button;
145
+ var sizeMap = {
146
+ xs: 16,
147
+ sm: 18,
148
+ md: 22,
149
+ lg: 26,
150
+ xl: 30,
151
+ "2xl": 36
152
+ };
153
+ var Icon = ({
154
+ name,
155
+ size = "md",
156
+ color = "currentColor",
157
+ strokeWidth = 2,
158
+ className = "",
159
+ onClick
160
+ }) => {
161
+ const pascalName = name.split(/[-_]/).filter((s) => s).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
162
+ const componentName = pascalName.startsWith("Icon") ? pascalName : "Icon" + pascalName;
163
+ const IconComponent = TablerIcons[componentName];
164
+ if (!IconComponent) return null;
165
+ const pixelSize = typeof size === "number" ? size : sizeMap[size] || sizeMap.md;
166
+ return /* @__PURE__ */ jsx(
167
+ IconComponent,
125
168
  {
126
- type,
169
+ size: pixelSize,
170
+ color,
171
+ strokeWidth,
172
+ className,
127
173
  onClick,
128
- "aria-label": ariaLabel,
129
- disabled: disabled || loading,
130
- className: `inline-flex items-center justify-center ${roundedClasses[rounded]} font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50 ${styleClasses} ${sizeClasses2[size]} ${isIconOnly ? "p-0" : ""} ${widthClasses} ${activeClasses} ${className}`,
131
- children: [
132
- displayIcon && iconPosition === "left" && /* @__PURE__ */ jsx("span", { className: `inline-flex ${children ? "mr-2" : ""}`, children: displayIcon }),
133
- children,
134
- displayIcon && iconPosition === "right" && /* @__PURE__ */ jsx("span", { className: `inline-flex ${children ? "ml-2" : ""}`, children: displayIcon })
135
- ]
174
+ "aria-hidden": "true"
136
175
  }
137
176
  );
138
- }
139
- Button.displayName = "Button";
140
- var button_default = Button;
177
+ };
178
+ Icon.displayName = "Icon";
141
179
  function Input({
142
180
  value,
143
181
  onChange,
182
+ onFocus,
144
183
  placeholder,
145
184
  disabled = false,
146
185
  type = "text",
147
186
  className = "",
148
187
  ariaLabel,
188
+ ref,
149
189
  id,
150
190
  name,
151
191
  required = false,
@@ -168,7 +208,9 @@ function Input({
168
208
  {
169
209
  type,
170
210
  value,
211
+ ref,
171
212
  onChange,
213
+ onFocus,
172
214
  placeholder,
173
215
  disabled,
174
216
  "aria-label": ariaLabel,
@@ -774,48 +816,153 @@ ButtonGroup.displayName = "ButtonGroup";
774
816
  var button_group_default = ButtonGroup;
775
817
  function Text({
776
818
  children,
819
+ as = "p",
777
820
  variant = "body",
778
821
  size,
779
822
  weight = "semibold",
780
- // elevated default weight
823
+ align,
824
+ leading,
825
+ tracking,
826
+ transform,
827
+ decoration,
828
+ italic = false,
829
+ truncate = false,
830
+ lineClamp,
831
+ wrap,
832
+ wordBreak,
833
+ opacity,
834
+ hasMargin = false,
835
+ selectable,
781
836
  className = "",
782
- noMargin = false
837
+ id,
838
+ htmlFor
783
839
  }) {
784
840
  const variantClasses = {
785
841
  body: "text-foreground",
786
842
  muted: "text-muted-foreground",
787
- small: "text-muted-foreground"
843
+ small: "text-muted-foreground",
844
+ primary: "text-primary",
845
+ secondary: "text-secondary-foreground",
846
+ success: "text-success",
847
+ warning: "text-warning",
848
+ error: "text-destructive",
849
+ inherit: "text-inherit"
788
850
  };
789
851
  const sizeClasses2 = {
790
852
  xs: "text-sm sm:text-xs",
791
853
  sm: "text-base sm:text-sm",
792
854
  base: "text-base",
793
855
  lg: "text-lg",
794
- xl: "text-xl"
856
+ xl: "text-xl",
857
+ "2xl": "text-2xl"
795
858
  };
796
859
  const weightClasses = {
860
+ light: "font-light",
797
861
  normal: "font-normal",
798
862
  medium: "font-medium",
799
863
  semibold: "font-semibold",
800
- bold: "font-bold"
864
+ bold: "font-bold",
865
+ extrabold: "font-extrabold"
866
+ };
867
+ const alignClasses = {
868
+ left: "text-left",
869
+ center: "text-center",
870
+ right: "text-right",
871
+ justify: "text-justify"
872
+ };
873
+ const leadingClasses = {
874
+ none: "leading-none",
875
+ tight: "leading-tight",
876
+ snug: "leading-snug",
877
+ normal: "leading-normal",
878
+ relaxed: "leading-relaxed",
879
+ loose: "leading-loose"
880
+ };
881
+ const trackingClasses = {
882
+ tighter: "tracking-tighter",
883
+ tight: "tracking-tight",
884
+ normal: "tracking-normal",
885
+ wide: "tracking-wide",
886
+ wider: "tracking-wider",
887
+ widest: "tracking-widest"
888
+ };
889
+ const transformClasses = {
890
+ uppercase: "uppercase",
891
+ lowercase: "lowercase",
892
+ capitalize: "capitalize",
893
+ normal: "normal-case"
894
+ };
895
+ const decorationClasses = {
896
+ underline: "underline",
897
+ "line-through": "line-through",
898
+ none: "no-underline"
899
+ };
900
+ const wrapClasses = {
901
+ wrap: "text-wrap",
902
+ nowrap: "text-nowrap",
903
+ balance: "text-balance",
904
+ pretty: "text-pretty"
905
+ };
906
+ const wordBreakClasses = {
907
+ normal: "break-normal",
908
+ words: "break-words",
909
+ all: "break-all",
910
+ keep: "break-keep"
911
+ };
912
+ const opacityClasses = {
913
+ 0: "opacity-0",
914
+ 25: "opacity-25",
915
+ 50: "opacity-50",
916
+ 75: "opacity-75",
917
+ 100: "opacity-100"
918
+ };
919
+ const lineClampClasses = {
920
+ 1: "line-clamp-1",
921
+ 2: "line-clamp-2",
922
+ 3: "line-clamp-3",
923
+ 4: "line-clamp-4",
924
+ 5: "line-clamp-5",
925
+ 6: "line-clamp-6"
801
926
  };
802
927
  const defaultSizes = {
803
928
  body: "lg",
804
- // bigger default body text
805
929
  muted: "base",
806
- // muted still readable
807
- small: "sm"
808
- // small bumped up slightly
930
+ small: "sm",
931
+ primary: "base",
932
+ secondary: "base",
933
+ success: "base",
934
+ warning: "base",
935
+ error: "base",
936
+ inherit: "base"
809
937
  };
810
938
  const finalSize = size || defaultSizes[variant];
811
- const margin = noMargin ? "" : "mb-4";
812
- return /* @__PURE__ */ jsx(
813
- "p",
814
- {
815
- className: `${variantClasses[variant]} ${sizeClasses2[finalSize]} ${weightClasses[weight]} ${margin} ${className}`,
816
- children
817
- }
818
- );
939
+ const margin = hasMargin ? "mb-3 sm:mb-4" : "";
940
+ const classes = [
941
+ variantClasses[variant],
942
+ sizeClasses2[finalSize],
943
+ weightClasses[weight],
944
+ margin,
945
+ align && alignClasses[align],
946
+ leading && leadingClasses[leading],
947
+ tracking && trackingClasses[tracking],
948
+ transform && transformClasses[transform],
949
+ decoration && decorationClasses[decoration],
950
+ italic && "italic",
951
+ truncate && "truncate",
952
+ lineClamp && lineClampClasses[lineClamp],
953
+ wrap && wrapClasses[wrap],
954
+ wordBreak && wordBreakClasses[wordBreak],
955
+ opacity !== void 0 && opacityClasses[opacity],
956
+ selectable === true && "select-all",
957
+ selectable === false && "select-none",
958
+ className
959
+ ].filter(Boolean).join(" ");
960
+ const elementProps = {
961
+ className: classes,
962
+ ...id && { id },
963
+ ...htmlFor && as === "label" && { htmlFor }
964
+ };
965
+ return createElement(as, elementProps, children);
819
966
  }
820
967
  Text.displayName = "Text";
821
968
  var text_default = Text;
@@ -853,7 +1000,7 @@ function Stack({
853
1000
  "div",
854
1001
  {
855
1002
  "data-component": "Stack",
856
- className: `flex ${directionClass} ${spacingClasses[spacing]} ${alignClasses[align]} ${justifyClass} ${className}`,
1003
+ className: `flex flex-wrap ${directionClass} ${spacingClasses[spacing]} ${alignClasses[align]} ${justifyClass} ${className}`,
857
1004
  children
858
1005
  }
859
1006
  );
@@ -875,13 +1022,13 @@ function FormField({
875
1022
  validationState: effectiveValidationState
876
1023
  }) : children;
877
1024
  return /* @__PURE__ */ jsxs(stack_default, { direction: "vertical", spacing: "sm", className, children: [
878
- label && /* @__PURE__ */ jsx("label", { htmlFor, children: /* @__PURE__ */ jsxs(text_default, { variant: "body", size: "sm", noMargin: true, className: "font-medium", children: [
1025
+ label && /* @__PURE__ */ jsx("label", { htmlFor, children: /* @__PURE__ */ jsxs(text_default, { variant: "body", size: "sm", className: "font-medium", children: [
879
1026
  label,
880
1027
  required && /* @__PURE__ */ jsx("span", { className: "text-destructive ml-1", children: "*" })
881
1028
  ] }) }),
882
1029
  childWithValidation,
883
- error && /* @__PURE__ */ jsx(text_default, { variant: "body", size: "sm", noMargin: true, className: "text-destructive", children: error }),
884
- !error && helperText && /* @__PURE__ */ jsx(text_default, { variant: "muted", size: "sm", noMargin: true, children: helperText })
1030
+ error && /* @__PURE__ */ jsx(text_default, { variant: "body", size: "sm", className: "text-destructive", children: error }),
1031
+ !error && helperText && /* @__PURE__ */ jsx(text_default, { variant: "muted", size: "sm", children: helperText })
885
1032
  ] });
886
1033
  }
887
1034
  FormField.displayName = "FormField";
@@ -1434,8 +1581,8 @@ var PageTransition = ({
1434
1581
  type = "fade",
1435
1582
  className = ""
1436
1583
  }) => {
1437
- const [isVisible, setIsVisible] = React5.useState(false);
1438
- React5.useEffect(() => {
1584
+ const [isVisible, setIsVisible] = React6.useState(false);
1585
+ React6.useEffect(() => {
1439
1586
  requestAnimationFrame(() => {
1440
1587
  requestAnimationFrame(() => {
1441
1588
  setIsVisible(true);
@@ -1504,12 +1651,15 @@ function Dropdown({
1504
1651
  align = "start",
1505
1652
  autoClose = true,
1506
1653
  size = "md",
1654
+ variant = "neutral",
1655
+ buttonStyle = "solid",
1507
1656
  minWidth,
1508
1657
  maxWidth,
1509
1658
  menuClassName = ""
1510
1659
  }) {
1511
1660
  const [isOpen, setIsOpen] = useState(false);
1512
1661
  const dropdownRef = useRef(null);
1662
+ const triggerRef = useRef(null);
1513
1663
  const menuRef = useRef(null);
1514
1664
  const itemsRef = useRef([]);
1515
1665
  const [activeIndex, setActiveIndex] = useState(-1);
@@ -1535,7 +1685,7 @@ function Dropdown({
1535
1685
  if (e.key === "Escape") {
1536
1686
  e.preventDefault();
1537
1687
  close();
1538
- dropdownRef.current?.querySelector('button[data-trigger="true"]')?.focus();
1688
+ triggerRef.current?.focus();
1539
1689
  }
1540
1690
  if (e.key === "Tab") {
1541
1691
  e.preventDefault();
@@ -1588,18 +1738,35 @@ function Dropdown({
1588
1738
  }
1589
1739
  if (!itemsRef.current.includes(el)) itemsRef.current.push(el);
1590
1740
  }, []);
1741
+ const { title, subtitle, icon, hideChevron } = trigger;
1742
+ const iconNode = icon ? /* @__PURE__ */ jsx(Icon, { name: icon, size: 16, color: "currentColor" }) : null;
1591
1743
  return /* @__PURE__ */ jsxs("div", { ref: dropdownRef, className: `relative ${className}`, children: [
1592
- /* @__PURE__ */ jsx(
1593
- "button",
1744
+ /* @__PURE__ */ jsxs(
1745
+ button_default,
1594
1746
  {
1595
- "data-trigger": "true",
1747
+ ref: triggerRef,
1748
+ variant,
1749
+ style: buttonStyle,
1596
1750
  onClick: () => isOpen ? close() : open(),
1597
- className: "bg-transparent border-0 p-0 cursor-pointer outline-none",
1598
- type: "button",
1599
1751
  "aria-expanded": isOpen,
1600
1752
  "aria-haspopup": "true",
1601
1753
  "aria-controls": isOpen ? "dropdown-menu" : void 0,
1602
- children: trigger
1754
+ children: [
1755
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
1756
+ iconNode && /* @__PURE__ */ jsx("span", { className: "shrink-0", children: iconNode }),
1757
+ /* @__PURE__ */ jsxs("span", { className: subtitle ? "text-left" : "", children: [
1758
+ /* @__PURE__ */ jsx("span", { className: subtitle ? "block font-semibold" : "", children: title }),
1759
+ subtitle && /* @__PURE__ */ jsx("span", { className: "block text-xs text-muted-foreground font-normal", children: subtitle })
1760
+ ] })
1761
+ ] }),
1762
+ !hideChevron && /* @__PURE__ */ jsx(
1763
+ IconChevronDown,
1764
+ {
1765
+ size: 14,
1766
+ className: `ml-1 transition-transform duration-200 ${isOpen ? "rotate-180" : ""}`
1767
+ }
1768
+ )
1769
+ ]
1603
1770
  }
1604
1771
  ),
1605
1772
  isOpen && /* @__PURE__ */ jsx(DropdownContext.Provider, { value: { requestClose: close, autoClose, registerItem, minWidth }, children: /* @__PURE__ */ jsx(
@@ -1607,7 +1774,7 @@ function Dropdown({
1607
1774
  {
1608
1775
  id: "dropdown-menu",
1609
1776
  ref: menuRef,
1610
- className: `absolute mt-2 bg-popover text-popover-foreground border border-border rounded-md shadow-lg z-50 ${size === "sm" ? "min-w-[140px] text-xs py-1" : "min-w-[180px]"} max-h-[320px] overflow-y-auto origin-top animate-scaleIn focus:outline-none ${align === "start" ? "left-0" : align === "end" ? "right-0" : "left-1/2 -translate-x-1/2"} ${menuClassName}`,
1777
+ className: `absolute mt-2 bg-popover text-popover-foreground border border-border rounded-md shadow-lg z-50 ${size === "sm" ? "min-w-[140px] text-xs py-1" : "min-w-[180px]"} max-h-80 overflow-y-auto origin-top animate-scaleIn focus:outline-none ${align === "start" ? "left-0" : align === "end" ? "right-0" : "left-1/2 -translate-x-1/2"} ${menuClassName}`,
1611
1778
  style: {
1612
1779
  minWidth: minWidth || void 0,
1613
1780
  maxWidth: maxWidth || void 0
@@ -1649,6 +1816,8 @@ function DropdownItem({
1649
1816
  };
1650
1817
  const variantClasses = palette[variant] || palette.default;
1651
1818
  const hasIcons = icon || endIcon;
1819
+ const iconNode = icon ? /* @__PURE__ */ jsx(Icon, { name: icon, size: 16, color: "currentColor" }) : null;
1820
+ const endIconNode = endIcon ? /* @__PURE__ */ jsx(Icon, { name: endIcon, size: 16, color: "currentColor" }) : null;
1652
1821
  return /* @__PURE__ */ jsxs(
1653
1822
  "button",
1654
1823
  {
@@ -1663,12 +1832,12 @@ function DropdownItem({
1663
1832
  },
1664
1833
  className: `${base} ${focus} ${variantClasses} ${hasIcons ? "flex flex-row items-center gap-2.5" : "flex flex-col"} ${className}`,
1665
1834
  children: [
1666
- icon && /* @__PURE__ */ jsx("span", { className: `flex-shrink-0 ${size === "sm" ? "text-[14px]" : "text-[16px]"}`, children: icon }),
1835
+ iconNode && /* @__PURE__ */ jsx("span", { className: `shrink-0 ${size === "sm" ? "text-[14px]" : "text-[16px]"}`, children: iconNode }),
1667
1836
  /* @__PURE__ */ jsxs("span", { className: "flex-1 min-w-0", children: [
1668
1837
  /* @__PURE__ */ jsx("span", { className: `block ${size === "sm" ? "font-medium" : "font-medium"} leading-snug`, children }),
1669
1838
  description && /* @__PURE__ */ jsx("span", { className: `block ${size === "sm" ? "text-[10px]" : "text-xs"} text-foreground/60 mt-0.5 line-clamp-2`, children: description })
1670
1839
  ] }),
1671
- endIcon && /* @__PURE__ */ jsx("span", { className: `flex-shrink-0 ${size === "sm" ? "text-[14px]" : "text-[16px]"}`, children: endIcon })
1840
+ endIconNode && /* @__PURE__ */ jsx("span", { className: `shrink-0 ${size === "sm" ? "text-[14px]" : "text-[16px]"}`, children: endIconNode })
1672
1841
  ]
1673
1842
  }
1674
1843
  );
@@ -1762,8 +1931,8 @@ Pagination.displayName = "Pagination";
1762
1931
  var pagination_default = Pagination;
1763
1932
  function Sidebar({ children, className = "", width = "16rem" }) {
1764
1933
  const widthClass = width === "16rem" ? "w-64" : width === "4rem" ? "w-16" : "";
1765
- const enhancedChildren = React5.Children.map(children, (child) => {
1766
- if (!React5.isValidElement(child)) return child;
1934
+ const enhancedChildren = React6.Children.map(children, (child) => {
1935
+ if (!React6.isValidElement(child)) return child;
1767
1936
  const childProps = child.props || {};
1768
1937
  if ("href" in childProps) {
1769
1938
  const existing = typeof childProps.className === "string" ? childProps.className : "";
@@ -1774,7 +1943,7 @@ function Sidebar({ children, className = "", width = "16rem" }) {
1774
1943
  ...child.props,
1775
1944
  className: `${existing} ${sidebarItemClasses}`.trim()
1776
1945
  };
1777
- return React5.cloneElement(child, newProps, wrappedChildren);
1946
+ return React6.cloneElement(child, newProps, wrappedChildren);
1778
1947
  }
1779
1948
  return child;
1780
1949
  });
@@ -2263,7 +2432,7 @@ function Modal({
2263
2432
  animationFrames: 2,
2264
2433
  restoreFocus: true
2265
2434
  });
2266
- React5.useEffect(() => {
2435
+ React6.useEffect(() => {
2267
2436
  if (!isOpen) return;
2268
2437
  const handleEscape = (e) => {
2269
2438
  if (e.key === "Escape") {
@@ -2571,13 +2740,7 @@ function Spinner({ size = "md", variant = "primary", className = "", speed, ...p
2571
2740
  }
2572
2741
  Spinner.displayName = "Spinner";
2573
2742
  var spinner_default = Spinner;
2574
- function ProgressBar({
2575
- value,
2576
- max = 100,
2577
- showLabel = false,
2578
- variant = "default",
2579
- className = ""
2580
- }) {
2743
+ function ProgressBar({ value, max = 100, showLabel, variant = "default", className = "" }) {
2581
2744
  const percentage = Math.min(value / max * 100, 100);
2582
2745
  const variantClasses = {
2583
2746
  default: "bg-primary",
@@ -2585,8 +2748,8 @@ function ProgressBar({
2585
2748
  warning: "bg-warning",
2586
2749
  error: "bg-destructive"
2587
2750
  };
2588
- return /* @__PURE__ */ jsxs("div", { className, children: [
2589
- /* @__PURE__ */ jsx("div", { className: "w-full bg-muted/30 rounded-full h-2.5 overflow-hidden shadow-inner", children: /* @__PURE__ */ jsx(
2751
+ return /* @__PURE__ */ jsxs("div", { className: `flex items-center gap-3 ${className}`, children: [
2752
+ /* @__PURE__ */ jsx("div", { className: "flex-1 bg-muted/30 rounded-full h-2.5 overflow-hidden shadow-inner", children: /* @__PURE__ */ jsx(
2590
2753
  "div",
2591
2754
  {
2592
2755
  role: "progressbar",
@@ -2597,7 +2760,7 @@ function ProgressBar({
2597
2760
  style: { width: `${percentage}%` }
2598
2761
  }
2599
2762
  ) }),
2600
- showLabel && /* @__PURE__ */ jsxs("div", { className: "text-sm text-muted-foreground mt-2 text-right font-medium", children: [
2763
+ showLabel && /* @__PURE__ */ jsxs(text_default, { variant: "muted", weight: "medium", size: "sm", children: [
2601
2764
  Math.round(percentage),
2602
2765
  "%"
2603
2766
  ] })
@@ -3393,7 +3556,7 @@ function Grid({
3393
3556
  }
3394
3557
  Grid.displayName = "Grid";
3395
3558
  var grid_default = Grid;
3396
- function Heading({ children, level = 1, className = "", noMargin = false }) {
3559
+ function Heading({ children, level = 1, className = "", hasMargin = false }) {
3397
3560
  const levelClasses = {
3398
3561
  1: "text-3xl sm:text-4xl lg:text-5xl font-bold",
3399
3562
  2: "text-2xl sm:text-3xl lg:text-4xl font-bold",
@@ -3403,14 +3566,14 @@ function Heading({ children, level = 1, className = "", noMargin = false }) {
3403
3566
  6: "text-sm sm:text-base font-medium"
3404
3567
  };
3405
3568
  const marginClasses = {
3406
- 1: "mb-4",
3407
- 2: "mb-3",
3408
- 3: "mb-3",
3409
- 4: "mb-2",
3410
- 5: "mb-2",
3411
- 6: "mb-2"
3412
- };
3413
- const margin = noMargin ? "" : marginClasses[level];
3569
+ 1: "mb-3 sm:mb-4",
3570
+ 2: "mb-2 sm:mb-3",
3571
+ 3: "mb-2 sm:mb-3",
3572
+ 4: "mb-1 sm:mb-2",
3573
+ 5: "mb-1 sm:mb-2",
3574
+ 6: "mb-1 sm:mb-2"
3575
+ };
3576
+ const margin = hasMargin ? marginClasses[level] : "";
3414
3577
  return createElement(
3415
3578
  `h${level}`,
3416
3579
  {
@@ -3424,8 +3587,8 @@ var heading_default = Heading;
3424
3587
  function PricingTable({ title, description, children, columns = 3, className = "" }) {
3425
3588
  return /* @__PURE__ */ jsx("section", { className: `py-16 md:py-20 ${className}`, children: /* @__PURE__ */ jsxs(container_default, { size: "xl", children: [
3426
3589
  (title || description) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-12 md:mb-16 max-w-3xl mx-auto", children: [
3427
- title && /* @__PURE__ */ jsx(heading_default, { level: 2, className: "text-3xl md:text-4xl font-bold mb-4", children: title }),
3428
- description && /* @__PURE__ */ jsx(text_default, { className: "text-lg md:text-xl text-muted", children: description })
3590
+ title && /* @__PURE__ */ jsx(heading_default, { level: 2, hasMargin: true, className: "text-3xl md:text-4xl font-bold", children: title }),
3591
+ description && /* @__PURE__ */ jsx(text_default, { hasMargin: true, className: "text-lg md:text-xl text-muted", children: description })
3429
3592
  ] }),
3430
3593
  /* @__PURE__ */ jsx(grid_default, { itemSize: "lg", maxCols: columns, gap: "lg", className: "items-stretch", children })
3431
3594
  ] }) });
@@ -3451,18 +3614,18 @@ function Card({
3451
3614
  filled: "bg-muted text-foreground"
3452
3615
  };
3453
3616
  const sizeClasses2 = {
3454
- xs: "w-full sm:w-36",
3455
- sm: "w-full sm:w-64",
3456
- md: "w-full sm:w-96",
3457
- lg: "w-full sm:w-[28rem]",
3458
- xl: "w-full sm:w-[32rem]"
3617
+ xs: "w-full sm:max-w-36",
3618
+ sm: "w-full sm:max-w-64",
3619
+ md: "w-full sm:max-w-96",
3620
+ lg: "w-full sm:max-w-[28rem]",
3621
+ xl: "w-full sm:max-w-[32rem]"
3459
3622
  };
3460
3623
  const widthClasses = {
3461
- auto: size !== "md" ? sizeClasses2[size] : "max-w-full",
3624
+ auto: size ? sizeClasses2[size] : "max-w-full",
3462
3625
  full: "w-full",
3463
3626
  fit: "w-fit"
3464
3627
  };
3465
- const hoverClasses = hoverable ? "transition-all duration-300 hover:shadow-xl hover:-translate-y-1 cursor-pointer" : "transition-shadow duration-200";
3628
+ const hoverClasses = hoverable ? "transition-all duration-300 hover:shadow-xl hover:-translate-y-1" : "transition-shadow duration-200";
3466
3629
  const imagePositionClasses = {
3467
3630
  top: "flex-col",
3468
3631
  bottom: "flex-col-reverse",
@@ -3569,8 +3732,10 @@ function PricingTier({
3569
3732
  children: [
3570
3733
  /* @__PURE__ */ jsxs(card_header_default, { className: `relative text-center border-none bg-transparent px-6 pt-12 pb-0`, children: [
3571
3734
  badge && /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsx(badge_default, { variant: "primary", className: "px-4 py-1 shadow-md", children: badge }) }),
3572
- /* @__PURE__ */ jsx(heading_default, { level: 3, className: "text-2xl font-bold mb-3 text-foreground", children: name }),
3573
- description && /* @__PURE__ */ jsx(text_default, { variant: "muted", className: "text-sm mb-1", children: description })
3735
+ /* @__PURE__ */ jsxs(stack_default, { direction: "horizontal", spacing: "sm", justify: "between", align: "center", className: "w-full", children: [
3736
+ /* @__PURE__ */ jsx(text_default, { size: "2xl", weight: "extrabold", variant: "body", children: name }),
3737
+ description && /* @__PURE__ */ jsx(text_default, { variant: "muted", className: "text-sm", children: description })
3738
+ ] })
3574
3739
  ] }),
3575
3740
  /* @__PURE__ */ jsx("div", { className: "pt-3 pb-8 text-center px-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-center gap-1", children: [
3576
3741
  /* @__PURE__ */ jsx("span", { className: "text-5xl font-bold text-foreground", children: price }),
@@ -3922,9 +4087,9 @@ function Hero({
3922
4087
  variant === "gradient" && /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent via-primary/20 to-transparent" }),
3923
4088
  /* @__PURE__ */ jsx("div", { className: "absolute inset-x-0 bottom-0 h-32 bg-gradient-to-t from-background to-transparent pointer-events-none" }),
3924
4089
  /* @__PURE__ */ jsx(container_default, { size: "lg", children: /* @__PURE__ */ jsxs("div", { className: centered ? "text-center mx-auto max-w-4xl" : "max-w-4xl", children: [
3925
- subtitle && /* @__PURE__ */ jsx(text_default, { className: "text-lg md:text-xl font-semibold text-primary mb-4", weight: "semibold", children: subtitle }),
4090
+ subtitle && /* @__PURE__ */ jsx(text_default, { hasMargin: true, className: "text-lg md:text-xl font-semibold text-primary", weight: "semibold", children: subtitle }),
3926
4091
  /* @__PURE__ */ jsx(heading_default, { level: 1, className: `${titleSizes[size]} font-extrabold mb-6 tracking-tight`, children: title }),
3927
- description && /* @__PURE__ */ jsx(text_default, { className: "text-lg md:text-xl mb-8 text-muted-foreground max-w-2xl mx-auto", children: description }),
4092
+ description && /* @__PURE__ */ jsx(text_default, { hasMargin: true, className: "text-lg md:text-xl mb-8 text-muted-foreground max-w-2xl mx-auto", children: description }),
3928
4093
  (primaryAction || secondaryAction) && /* @__PURE__ */ jsxs(stack_default, { direction: "horizontal", spacing: "md", className: `flex-wrap ${centered ? "justify-center" : ""}`, children: [
3929
4094
  primaryAction && /* @__PURE__ */ jsx(
3930
4095
  button_default,
@@ -3968,16 +4133,10 @@ function FeatureSection({
3968
4133
  className = ""
3969
4134
  }) {
3970
4135
  return /* @__PURE__ */ jsx("section", { className: `py-16 md:py-20 ${className}`, children: /* @__PURE__ */ jsxs(container_default, { size: "xl", children: [
3971
- (title || description) && /* @__PURE__ */ jsxs(
3972
- "div",
3973
- {
3974
- className: `mb-12 md:mb-16 ${centered ? "text-center" : ""} ${centered ? "max-w-3xl mx-auto" : "max-w-3xl"}`,
3975
- children: [
3976
- title && /* @__PURE__ */ jsx(heading_default, { level: 2, className: "text-3xl md:text-4xl font-bold mb-4", children: title }),
3977
- description && /* @__PURE__ */ jsx(text_default, { className: "text-lg md:text-xl", children: description })
3978
- ]
3979
- }
3980
- ),
4136
+ (title || description) && /* @__PURE__ */ jsxs(stack_default, { spacing: "md", className: `mb-12 md:mb-16 ${centered ? "text-center max-w-3xl mx-auto" : "max-w-3xl"}`, children: [
4137
+ title && /* @__PURE__ */ jsx(heading_default, { level: 2, hasMargin: true, children: title }),
4138
+ description && /* @__PURE__ */ jsx(text_default, { className: "text-lg md:text-xl", children: description })
4139
+ ] }),
3981
4140
  /* @__PURE__ */ jsx(grid_default, { itemSize: "md", maxCols: columns, gap: "lg", children: features.map((feature, index) => /* @__PURE__ */ jsxs("article", { className: centered ? "text-center" : "", children: [
3982
4141
  /* @__PURE__ */ jsx(
3983
4142
  "span",
@@ -4078,7 +4237,7 @@ function Footer({ sections, copyright, social, className = "" }) {
4078
4237
  {
4079
4238
  className: `${sections && sections.length > 0 ? "border-t border-border" : ""} py-6 flex flex-col md:flex-row items-center justify-between gap-4`,
4080
4239
  children: [
4081
- copyright && /* @__PURE__ */ jsx(text_default, { variant: "muted", className: "text-sm text-center md:text-left", children: copyright }),
4240
+ copyright && /* @__PURE__ */ jsx(text_default, { hasMargin: true, variant: "muted", className: "text-sm text-center md:text-left", children: copyright }),
4082
4241
  social && /* @__PURE__ */ jsx("div", { className: "flex items-center space-x-4", children: social })
4083
4242
  ]
4084
4243
  }
@@ -4097,6 +4256,23 @@ function useScrollReset(deps, container) {
4097
4256
  };
4098
4257
  const setAllScrollTop = () => {
4099
4258
  if (cancelled) return;
4259
+ try {
4260
+ const hash = typeof window !== "undefined" ? window.location.hash : "";
4261
+ if (hash && hash.startsWith("#")) {
4262
+ const id = decodeURIComponent(hash.slice(1));
4263
+ const resolved2 = isRef(container) ? container.current : container;
4264
+ const root = resolved2 ?? document;
4265
+ const target = root.querySelector ? root.querySelector(`#${CSS.escape(id)}`) : null;
4266
+ if (target) {
4267
+ try {
4268
+ target.scrollIntoView({ block: "start" });
4269
+ } catch (e) {
4270
+ }
4271
+ return;
4272
+ }
4273
+ }
4274
+ } catch (e) {
4275
+ }
4100
4276
  window.scrollTo(0, 0);
4101
4277
  const resolved = isRef(container) ? container.current : container;
4102
4278
  if (resolved) resolved.scrollTop = 0;