@underverse-ui/underverse 1.0.199 → 1.0.200

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
@@ -13,6 +13,39 @@ var __export = (target, all) => {
13
13
  // src/components/Button.tsx
14
14
  import { forwardRef, useCallback, useRef, useState } from "react";
15
15
 
16
+ // src/constants/form-control-size.ts
17
+ var formControlSizeStyles = {
18
+ sm: {
19
+ control: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
20
+ compactControl: "h-8 px-2.5 text-sm leading-none md:h-7 md:text-xs",
21
+ input: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
22
+ label: "text-xs",
23
+ icon: "h-4 w-4 md:h-3.5 md:w-3.5",
24
+ iconButton: "h-7 w-7 md:h-6 md:w-6",
25
+ tag: "h-5 max-w-24 px-2 text-[10px] leading-none"
26
+ },
27
+ md: {
28
+ control: "h-10 px-3 text-sm leading-none",
29
+ compactControl: "h-10 px-3 text-sm leading-none",
30
+ input: "h-10 px-4 text-sm leading-none",
31
+ label: "text-sm",
32
+ icon: "h-4 w-4",
33
+ iconButton: "h-8 w-8",
34
+ tag: "h-6 max-w-28 px-2 text-xs leading-none"
35
+ },
36
+ lg: {
37
+ control: "h-12 px-4 text-base leading-none",
38
+ compactControl: "h-12 px-4 text-base leading-none",
39
+ input: "h-12 px-5 text-base leading-none",
40
+ label: "text-base",
41
+ icon: "h-5 w-5",
42
+ iconButton: "h-10 w-10",
43
+ tag: "h-7 max-w-32 px-2.5 text-sm leading-none"
44
+ }
45
+ };
46
+ var formControlFixedClass = "min-h-0 overflow-hidden";
47
+ var formControlValueClass = "max-h-full min-w-0 flex-1 truncate whitespace-nowrap";
48
+
16
49
  // src/constants/button.ts
17
50
  var VARIANT_STYLES_BTN = {
18
51
  // Mặc định: tối giản, rõ ràng, dùng tokens hệ màu
@@ -36,10 +69,10 @@ var VARIANT_STYLES_BTN = {
36
69
  gradient: "bg-linear-to-r from-primary via-primary/80 to-secondary text-primary-foreground hover:opacity-90 shadow-md border-0"
37
70
  };
38
71
  var SIZE_STYLES_BTN = {
39
- sm: "px-3 py-1.5 text-sm h-8 min-w-8 md:px-2.5 md:py-1 md:h-7 md:text-xs",
40
- md: "px-4 py-2 text-sm h-10 min-w-10 md:px-3 md:py-1.5 md:h-9",
41
- lg: "px-6 py-3 text-base h-12 min-w-12 md:px-4 md:py-2 md:h-10 md:text-sm",
42
- smx: "px-3.5 py-1.5 text-[13px] h-9 min-w-9 md:px-3 md:py-1 md:h-8 md:text-xs",
72
+ sm: `${formControlSizeStyles.sm.control} min-w-8`,
73
+ md: `${formControlSizeStyles.md.input} min-w-10`,
74
+ lg: `${formControlSizeStyles.lg.input} min-w-12`,
75
+ smx: "h-9 min-w-9 px-3.5 text-[13px] leading-none md:h-8 md:text-xs",
43
76
  icon: "w-11 h-11 p-0 rounded-full flex items-center justify-center md:w-10 md:h-10"
44
77
  };
45
78
 
@@ -124,6 +157,7 @@ var Button = forwardRef(
124
157
  const finalVariant = gradient ? "gradient" : variant;
125
158
  const variantStyle = VARIANT_STYLES_BTN[finalVariant] || VARIANT_STYLES_BTN.default;
126
159
  const sizeStyle = SIZE_STYLES_BTN[size] || SIZE_STYLES_BTN.md;
160
+ const iconSizeStyle = size === "sm" ? formControlSizeStyles.sm.icon : size === "lg" || size === "icon" ? formControlSizeStyles.lg.icon : formControlSizeStyles.md.icon;
127
161
  const globalConfig = useUnderverseUIConfig();
128
162
  const resolvedBorderMode = borderMode ?? globalConfig.button?.borderMode ?? "full";
129
163
  const SpinnerIcon = Spinner ?? Activity;
@@ -188,13 +222,13 @@ var Button = forwardRef(
188
222
  children: [
189
223
  !noHoverOverlay ? /* @__PURE__ */ jsx2("span", { className: "absolute inset-0 bg-linear-to-r from-primary-foreground/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-200 dark:hidden" }) : null,
190
224
  loading2 ? /* @__PURE__ */ jsxs(Fragment2, { children: [
191
- /* @__PURE__ */ jsx2(SpinnerIcon, { className: "w-4 h-4 animate-spin", "aria-hidden": "true" }),
225
+ /* @__PURE__ */ jsx2(SpinnerIcon, { className: cn(iconSizeStyle, "shrink-0 animate-spin"), "aria-hidden": "true" }),
192
226
  loadingText ? /* @__PURE__ */ jsx2("span", { className: "ml-2", "aria-live": "polite", children: loadingText }) : null,
193
227
  preserveChildrenOnLoading && !loadingText ? /* @__PURE__ */ jsx2("span", { className: "ml-2 opacity-70", "aria-hidden": true, children }) : null
194
228
  ] }) : /* @__PURE__ */ jsxs(Fragment2, { children: [
195
- Icon ? /* @__PURE__ */ jsx2(Icon, { className: cn("transition-transform duration-200", iConClassName ? iConClassName : "w-5 h-5") }) : null,
229
+ Icon ? /* @__PURE__ */ jsx2(Icon, { className: cn("shrink-0 transition-transform duration-200", iConClassName ? iConClassName : iconSizeStyle) }) : null,
196
230
  children,
197
- IconRight ? /* @__PURE__ */ jsx2(IconRight, { className: "w-4 h-4 transition-transform duration-200" }) : null
231
+ IconRight ? /* @__PURE__ */ jsx2(IconRight, { className: cn(iconSizeStyle, "shrink-0 transition-transform duration-200") }) : null
198
232
  ] })
199
233
  ]
200
234
  }
@@ -2915,39 +2949,6 @@ function useOverlayScrollbarTarget(targetRef, options = {}) {
2915
2949
  }
2916
2950
  var OverlayScrollbarProvider_default = OverlayScrollbarProvider;
2917
2951
 
2918
- // src/components/form-control-size.ts
2919
- var formControlSizeStyles = {
2920
- sm: {
2921
- control: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
2922
- compactControl: "h-8 px-2.5 text-sm leading-none md:h-7 md:text-xs",
2923
- input: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
2924
- label: "text-xs",
2925
- icon: "h-4 w-4 md:h-3.5 md:w-3.5",
2926
- iconButton: "h-7 w-7 md:h-6 md:w-6",
2927
- tag: "h-5 max-w-24 px-2 text-[10px] leading-none"
2928
- },
2929
- md: {
2930
- control: "h-10 px-3 text-sm leading-none",
2931
- compactControl: "h-10 px-3 text-sm leading-none",
2932
- input: "h-10 px-4 text-sm leading-none",
2933
- label: "text-sm",
2934
- icon: "h-4 w-4",
2935
- iconButton: "h-8 w-8",
2936
- tag: "h-6 max-w-28 px-2 text-xs leading-none"
2937
- },
2938
- lg: {
2939
- control: "h-12 px-4 text-base leading-none",
2940
- compactControl: "h-12 px-4 text-base leading-none",
2941
- input: "h-12 px-5 text-base leading-none",
2942
- label: "text-base",
2943
- icon: "h-5 w-5",
2944
- iconButton: "h-10 w-10",
2945
- tag: "h-7 max-w-32 px-2.5 text-sm leading-none"
2946
- }
2947
- };
2948
- var formControlFixedClass = "min-h-0 overflow-hidden";
2949
- var formControlValueClass = "max-h-full min-w-0 flex-1 truncate whitespace-nowrap";
2950
-
2951
2952
  // src/components/Input.tsx
2952
2953
  import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
2953
2954
  var Input = forwardRef3(
@@ -33835,7 +33836,7 @@ var EditorToolbar = ({
33835
33836
  "div",
33836
33837
  {
33837
33838
  role: "toolbar",
33838
- className: "flex min-h-[60px] flex-nowrap items-center gap-1 overflow-x-auto border-b border-[rgba(196,197,213,0.6)] bg-[#F4F4F4] px-3 py-3 dark:bg-muted/60",
33839
+ className: "flex min-h-15 flex-nowrap items-center gap-1 overflow-x-auto border-b border-[rgba(196,197,213,0.6)] bg-[#F4F4F4] px-3 py-3 dark:bg-muted/60",
33839
33840
  children: [
33840
33841
  isFull && /* @__PURE__ */ jsx93(
33841
33842
  DropdownMenu,
@@ -33846,7 +33847,7 @@ var EditorToolbar = ({
33846
33847
  onClick: () => {
33847
33848
  },
33848
33849
  title: t("toolbar.fontFamily"),
33849
- className: "h-9 w-[200px] max-w-[200px] justify-between gap-3 rounded-lg border border-[rgba(196,197,213,0.6)] bg-white px-3 text-[#404040] shadow-[0_1px_2px_rgba(0,0,0,0.07)] hover:bg-white hover:text-[#404040] dark:bg-background dark:text-foreground",
33850
+ className: "h-9 w-50 max-w-50 justify-between gap-3 rounded-lg border border-[rgba(196,197,213,0.6)] bg-white px-3 text-[#404040] shadow-[0_1px_2px_rgba(0,0,0,0.07)] hover:bg-white hover:text-[#404040] dark:bg-background dark:text-foreground",
33850
33851
  children: [
33851
33852
  /* @__PURE__ */ jsx93("span", { className: "min-w-0 flex-1 truncate text-left text-sm font-normal", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
33852
33853
  /* @__PURE__ */ jsx93(FigmaChevronDownIcon, { className: "h-3 w-3 shrink-0 text-[#7B8184]" })