@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/api-reference.json +1 -1
- package/dist/index.cjs +43 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/api-reference.json
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -210,6 +210,39 @@ module.exports = __toCommonJS(index_exports);
|
|
|
210
210
|
// src/components/Button.tsx
|
|
211
211
|
var import_react = require("react");
|
|
212
212
|
|
|
213
|
+
// src/constants/form-control-size.ts
|
|
214
|
+
var formControlSizeStyles = {
|
|
215
|
+
sm: {
|
|
216
|
+
control: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
|
|
217
|
+
compactControl: "h-8 px-2.5 text-sm leading-none md:h-7 md:text-xs",
|
|
218
|
+
input: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
|
|
219
|
+
label: "text-xs",
|
|
220
|
+
icon: "h-4 w-4 md:h-3.5 md:w-3.5",
|
|
221
|
+
iconButton: "h-7 w-7 md:h-6 md:w-6",
|
|
222
|
+
tag: "h-5 max-w-24 px-2 text-[10px] leading-none"
|
|
223
|
+
},
|
|
224
|
+
md: {
|
|
225
|
+
control: "h-10 px-3 text-sm leading-none",
|
|
226
|
+
compactControl: "h-10 px-3 text-sm leading-none",
|
|
227
|
+
input: "h-10 px-4 text-sm leading-none",
|
|
228
|
+
label: "text-sm",
|
|
229
|
+
icon: "h-4 w-4",
|
|
230
|
+
iconButton: "h-8 w-8",
|
|
231
|
+
tag: "h-6 max-w-28 px-2 text-xs leading-none"
|
|
232
|
+
},
|
|
233
|
+
lg: {
|
|
234
|
+
control: "h-12 px-4 text-base leading-none",
|
|
235
|
+
compactControl: "h-12 px-4 text-base leading-none",
|
|
236
|
+
input: "h-12 px-5 text-base leading-none",
|
|
237
|
+
label: "text-base",
|
|
238
|
+
icon: "h-5 w-5",
|
|
239
|
+
iconButton: "h-10 w-10",
|
|
240
|
+
tag: "h-7 max-w-32 px-2.5 text-sm leading-none"
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
var formControlFixedClass = "min-h-0 overflow-hidden";
|
|
244
|
+
var formControlValueClass = "max-h-full min-w-0 flex-1 truncate whitespace-nowrap";
|
|
245
|
+
|
|
213
246
|
// src/constants/button.ts
|
|
214
247
|
var VARIANT_STYLES_BTN = {
|
|
215
248
|
// Mặc định: tối giản, rõ ràng, dùng tokens hệ màu
|
|
@@ -233,10 +266,10 @@ var VARIANT_STYLES_BTN = {
|
|
|
233
266
|
gradient: "bg-linear-to-r from-primary via-primary/80 to-secondary text-primary-foreground hover:opacity-90 shadow-md border-0"
|
|
234
267
|
};
|
|
235
268
|
var SIZE_STYLES_BTN = {
|
|
236
|
-
sm:
|
|
237
|
-
md:
|
|
238
|
-
lg:
|
|
239
|
-
smx: "
|
|
269
|
+
sm: `${formControlSizeStyles.sm.control} min-w-8`,
|
|
270
|
+
md: `${formControlSizeStyles.md.input} min-w-10`,
|
|
271
|
+
lg: `${formControlSizeStyles.lg.input} min-w-12`,
|
|
272
|
+
smx: "h-9 min-w-9 px-3.5 text-[13px] leading-none md:h-8 md:text-xs",
|
|
240
273
|
icon: "w-11 h-11 p-0 rounded-full flex items-center justify-center md:w-10 md:h-10"
|
|
241
274
|
};
|
|
242
275
|
|
|
@@ -321,6 +354,7 @@ var Button = (0, import_react.forwardRef)(
|
|
|
321
354
|
const finalVariant = gradient ? "gradient" : variant;
|
|
322
355
|
const variantStyle = VARIANT_STYLES_BTN[finalVariant] || VARIANT_STYLES_BTN.default;
|
|
323
356
|
const sizeStyle = SIZE_STYLES_BTN[size] || SIZE_STYLES_BTN.md;
|
|
357
|
+
const iconSizeStyle = size === "sm" ? formControlSizeStyles.sm.icon : size === "lg" || size === "icon" ? formControlSizeStyles.lg.icon : formControlSizeStyles.md.icon;
|
|
324
358
|
const globalConfig = useUnderverseUIConfig();
|
|
325
359
|
const resolvedBorderMode = borderMode ?? globalConfig.button?.borderMode ?? "full";
|
|
326
360
|
const SpinnerIcon = Spinner ?? import_lucide_react.Activity;
|
|
@@ -385,13 +419,13 @@ var Button = (0, import_react.forwardRef)(
|
|
|
385
419
|
children: [
|
|
386
420
|
!noHoverOverlay ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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,
|
|
387
421
|
loading2 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
388
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SpinnerIcon, { className: "
|
|
422
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SpinnerIcon, { className: cn(iconSizeStyle, "shrink-0 animate-spin"), "aria-hidden": "true" }),
|
|
389
423
|
loadingText ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ml-2", "aria-live": "polite", children: loadingText }) : null,
|
|
390
424
|
preserveChildrenOnLoading && !loadingText ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "ml-2 opacity-70", "aria-hidden": true, children }) : null
|
|
391
425
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
392
|
-
Icon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { className: cn("transition-transform duration-200", iConClassName ? iConClassName :
|
|
426
|
+
Icon ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { className: cn("shrink-0 transition-transform duration-200", iConClassName ? iConClassName : iconSizeStyle) }) : null,
|
|
393
427
|
children,
|
|
394
|
-
IconRight ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IconRight, { className: "
|
|
428
|
+
IconRight ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IconRight, { className: cn(iconSizeStyle, "shrink-0 transition-transform duration-200") }) : null
|
|
395
429
|
] })
|
|
396
430
|
]
|
|
397
431
|
}
|
|
@@ -3112,39 +3146,6 @@ function useOverlayScrollbarTarget(targetRef, options = {}) {
|
|
|
3112
3146
|
}
|
|
3113
3147
|
var OverlayScrollbarProvider_default = OverlayScrollbarProvider;
|
|
3114
3148
|
|
|
3115
|
-
// src/components/form-control-size.ts
|
|
3116
|
-
var formControlSizeStyles = {
|
|
3117
|
-
sm: {
|
|
3118
|
-
control: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
|
|
3119
|
-
compactControl: "h-8 px-2.5 text-sm leading-none md:h-7 md:text-xs",
|
|
3120
|
-
input: "h-8 px-3 text-sm leading-none md:h-7 md:text-xs",
|
|
3121
|
-
label: "text-xs",
|
|
3122
|
-
icon: "h-4 w-4 md:h-3.5 md:w-3.5",
|
|
3123
|
-
iconButton: "h-7 w-7 md:h-6 md:w-6",
|
|
3124
|
-
tag: "h-5 max-w-24 px-2 text-[10px] leading-none"
|
|
3125
|
-
},
|
|
3126
|
-
md: {
|
|
3127
|
-
control: "h-10 px-3 text-sm leading-none",
|
|
3128
|
-
compactControl: "h-10 px-3 text-sm leading-none",
|
|
3129
|
-
input: "h-10 px-4 text-sm leading-none",
|
|
3130
|
-
label: "text-sm",
|
|
3131
|
-
icon: "h-4 w-4",
|
|
3132
|
-
iconButton: "h-8 w-8",
|
|
3133
|
-
tag: "h-6 max-w-28 px-2 text-xs leading-none"
|
|
3134
|
-
},
|
|
3135
|
-
lg: {
|
|
3136
|
-
control: "h-12 px-4 text-base leading-none",
|
|
3137
|
-
compactControl: "h-12 px-4 text-base leading-none",
|
|
3138
|
-
input: "h-12 px-5 text-base leading-none",
|
|
3139
|
-
label: "text-base",
|
|
3140
|
-
icon: "h-5 w-5",
|
|
3141
|
-
iconButton: "h-10 w-10",
|
|
3142
|
-
tag: "h-7 max-w-32 px-2.5 text-sm leading-none"
|
|
3143
|
-
}
|
|
3144
|
-
};
|
|
3145
|
-
var formControlFixedClass = "min-h-0 overflow-hidden";
|
|
3146
|
-
var formControlValueClass = "max-h-full min-w-0 flex-1 truncate whitespace-nowrap";
|
|
3147
|
-
|
|
3148
3149
|
// src/components/Input.tsx
|
|
3149
3150
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3150
3151
|
var Input = (0, import_react4.forwardRef)(
|
|
@@ -33959,7 +33960,7 @@ var EditorToolbar = ({
|
|
|
33959
33960
|
"div",
|
|
33960
33961
|
{
|
|
33961
33962
|
role: "toolbar",
|
|
33962
|
-
className: "flex min-h-
|
|
33963
|
+
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",
|
|
33963
33964
|
children: [
|
|
33964
33965
|
isFull && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
33965
33966
|
DropdownMenu,
|
|
@@ -33970,7 +33971,7 @@ var EditorToolbar = ({
|
|
|
33970
33971
|
onClick: () => {
|
|
33971
33972
|
},
|
|
33972
33973
|
title: t("toolbar.fontFamily"),
|
|
33973
|
-
className: "h-9 w-
|
|
33974
|
+
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",
|
|
33974
33975
|
children: [
|
|
33975
33976
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "min-w-0 flex-1 truncate text-left text-sm font-normal", style: { fontFamily: displayedFontFamilyValue || void 0 }, children: displayedFontFamilyLabel }),
|
|
33976
33977
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(FigmaChevronDownIcon, { className: "h-3 w-3 shrink-0 text-[#7B8184]" })
|