myshell-react-lib 0.1.19 → 0.1.20
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.cjs +99 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -10
- package/dist/index.d.ts +52 -10
- package/dist/index.js +99 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5738,8 +5738,9 @@ var iconVariants2 = (0, import_class_variance_authority5.cva)("relative shrink-0
|
|
|
5738
5738
|
});
|
|
5739
5739
|
// src/components/button/button.tsx
|
|
5740
5740
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
5741
|
-
|
|
5742
|
-
var
|
|
5741
|
+
function createButtonWithVariant(props, ref) {
|
|
5742
|
+
var _props_className = props.className, className = _props_className === void 0 ? "" : _props_className, iconClassName = props.iconClassName, _props_variant = props.variant, variant = _props_variant === void 0 ? "primary" : _props_variant, // 设置默认值为primary
|
|
5743
|
+
userProvidedColor = props.color, icon = props.icon, _props_iconDirection = props.iconDirection, iconDirection = _props_iconDirection === void 0 ? "left" : _props_iconDirection, _props_size = props.size, size = _props_size === void 0 ? "lg" : _props_size, _props_asChild = props.asChild, asChild = _props_asChild === void 0 ? false : _props_asChild, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, _props_noStyle = props.noStyle, noStyle = _props_noStyle === void 0 ? false : _props_noStyle, _props_iconOutBox = props.iconOutBox, iconOutBox = _props_iconOutBox === void 0 ? false : _props_iconOutBox, _props_isBlock = props.isBlock, isBlock = _props_isBlock === void 0 ? false : _props_isBlock, disabled = props.disabled, children = props.children, autoFocus = props.autoFocus, asset = props.asset, _props_assetNumber = props.assetNumber, assetNumber = _props_assetNumber === void 0 ? 0 : _props_assetNumber, passProps = _object_without_properties(props, [
|
|
5743
5744
|
"className",
|
|
5744
5745
|
"iconClassName",
|
|
5745
5746
|
"variant",
|
|
@@ -5758,6 +5759,7 @@ var Button = React6.forwardRef(function(_param, ref) {
|
|
|
5758
5759
|
"asset",
|
|
5759
5760
|
"assetNumber"
|
|
5760
5761
|
]);
|
|
5762
|
+
var color = userProvidedColor || "default";
|
|
5761
5763
|
var Comp = asChild ? import_react_slot.Slot : "button";
|
|
5762
5764
|
var disable = disabled || loading;
|
|
5763
5765
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Comp, _object_spread_props(_object_spread({
|
|
@@ -5770,7 +5772,7 @@ var Button = React6.forwardRef(function(_param, ref) {
|
|
|
5770
5772
|
ref: ref,
|
|
5771
5773
|
disabled: disable,
|
|
5772
5774
|
autoFocus: autoFocus
|
|
5773
|
-
},
|
|
5775
|
+
}, passProps), {
|
|
5774
5776
|
children: [
|
|
5775
5777
|
loading && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", {
|
|
5776
5778
|
className: "absolute left-1/2 top-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center",
|
|
@@ -5841,9 +5843,12 @@ var Button = React6.forwardRef(function(_param, ref) {
|
|
|
5841
5843
|
})
|
|
5842
5844
|
]
|
|
5843
5845
|
}));
|
|
5846
|
+
}
|
|
5847
|
+
var Button = React6.forwardRef(function(props, ref) {
|
|
5848
|
+
return createButtonWithVariant(props, ref);
|
|
5844
5849
|
});
|
|
5845
|
-
var renderIcon = function(icon, direction,
|
|
5846
|
-
var loading =
|
|
5850
|
+
var renderIcon = function(icon, direction, props) {
|
|
5851
|
+
var loading = props.loading, noStyle = props.noStyle, iconClassName = props.iconClassName, variant = props.variant, size = props.size;
|
|
5847
5852
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, {
|
|
5848
5853
|
component: icon,
|
|
5849
5854
|
className: noStyle ? iconClassName : cn(iconVariants2({
|
|
@@ -6386,87 +6391,83 @@ var TooltipContent = React9.forwardRef(function(_param, ref) {
|
|
|
6386
6391
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
6387
6392
|
// src/components/button/icon-button.styles.ts
|
|
6388
6393
|
var import_class_variance_authority6 = require("class-variance-authority");
|
|
6389
|
-
var
|
|
6390
|
-
|
|
6391
|
-
|
|
6392
|
-
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6402
|
-
|
|
6403
|
-
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
compoundVariants: [
|
|
6414
|
-
{
|
|
6415
|
-
variant: "primary",
|
|
6416
|
-
color: "default",
|
|
6417
|
-
className: "bg-cc-Button-Primary-bg-default text-cc-Button-Primary-fg-default hover:bg-cc-Button-Primary-bg-hover active:bg-cc-Button-Primary-bg-active disabled:bg-cc-Button-Primary-bg-disabled"
|
|
6418
|
-
},
|
|
6419
|
-
{
|
|
6420
|
-
variant: "primary",
|
|
6421
|
-
color: "brand",
|
|
6422
|
-
className: "text-cc-Icon-Button-Brand-fg-default bg-cc-Icon-Button-Brand-bg-default hover:bg-cc-Icon-Button-Brand-bg-hover active:bg-cc-Icon-Button-Brand-bg-active disabled:bg-cc-Icon-Button-Brand-bg-disabled disabled:text-cc-Icon-Button-Brand-fg-alt"
|
|
6423
|
-
},
|
|
6424
|
-
{
|
|
6425
|
-
variant: "primary",
|
|
6426
|
-
color: "error",
|
|
6427
|
-
className: "text-cc-Button-Error-Primary-fg-default bg-cc-Button-Error-Primary-bg-default hover:bg-cc-Button-Error-Primary-bg-hover active:bg-cc-Button-Error-Primary-bg-active disabled:bg-cc-Button-Error-Primary-bg-disabled"
|
|
6428
|
-
},
|
|
6429
|
-
{
|
|
6430
|
-
variant: "secondary",
|
|
6431
|
-
color: "default",
|
|
6432
|
-
className: "border-cc-Button-Secondary-border-default text-cc-Button-Secondary-fg-default bg-cc-Button-Secondary-bg-default hover:bg-cc-Button-Secondary-bg-hover active:bg-cc-Button-Secondary-bg-active disabled:text-cc-Button-Secondary-fg-alt disabled:border-cc-Button-Secondary-border-disabled"
|
|
6433
|
-
},
|
|
6434
|
-
{
|
|
6435
|
-
variant: "tertiary",
|
|
6436
|
-
color: "default",
|
|
6437
|
-
className: "border-cc-Button-Tertiary-border-default text-cc-Button-Tertiary-fg-default bg-cc-Button-Tertiary-bg-default hover:bg-cc-Button-Tertiary-bg-hover hover:border-cc-Button-Tertiary-border-alt focus:shadow-button-tertiary-shadow active:bg-cc-Button-Tertiary-bg-active disabled:text-cc-Button-Tertiary-fg-alt"
|
|
6438
|
-
},
|
|
6439
|
-
{
|
|
6440
|
-
variant: "secondary",
|
|
6441
|
-
color: "error",
|
|
6442
|
-
className: "border-cc-Button-Error-Secondary-border-default text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Error-Secondary-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Error-Secondary-fg-alt disabled:border-cc-Button-Error-Secondary-border-disabled"
|
|
6443
|
-
},
|
|
6444
|
-
{
|
|
6445
|
-
variant: "secondary",
|
|
6446
|
-
color: "gray",
|
|
6447
|
-
className: "text-Colors-Foreground-Subtle hover:bg-Colors-Background-Normal-Primary-Hover"
|
|
6448
|
-
},
|
|
6449
|
-
{
|
|
6450
|
-
variant: "plain",
|
|
6451
|
-
color: "default",
|
|
6452
|
-
className: "text-cc-Button-Plain-fg-default hover:bg-cc-Button-Plain-bg-hover focus:shadow-rings-brand active:bg-cc-Button-Plain-bg-active disabled:text-cc-Button-Plain-fg-alt"
|
|
6453
|
-
},
|
|
6454
|
-
{
|
|
6455
|
-
variant: "plain",
|
|
6456
|
-
color: "gray",
|
|
6457
|
-
className: "text-cc-Icon-Button-Plain-Gray-fg-default bg-cc-Button-Plain-Brand-bg-default hover:bg-cc-Button-Plain-Brand-bg-hover active:bg-cc-Button-Plain-Brand-bg-active disabled:text-cc-Button-Plain-Gray-fg-alt"
|
|
6458
|
-
},
|
|
6459
|
-
{
|
|
6460
|
-
variant: "plain",
|
|
6461
|
-
color: "error",
|
|
6462
|
-
className: "text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Plain-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Plain-fg-default"
|
|
6463
|
-
}
|
|
6464
|
-
],
|
|
6465
|
-
defaultVariants: {
|
|
6394
|
+
var BASE_STYLES = "shrink-0 inline-flex items-center justify-center whitespace-nowrap rounded-sm font-medium transition-colors focus-visible:outline-none focus-visible:shadow-none focus-visible:ring-2 focus-visible:ring-cc-Focus-Rings-Brand-default focus-visible:ring-offset-1 disabled:pointer-events-none disabled:opacity-30 disabled:shadow-none";
|
|
6395
|
+
var VARIANT_STYLES = {
|
|
6396
|
+
primary: "",
|
|
6397
|
+
secondary: "border shadow-none",
|
|
6398
|
+
tertiary: "border shadow-none",
|
|
6399
|
+
plain: "",
|
|
6400
|
+
opacity: "backdrop-blur-2xl text-Colors-Text-Static-White bg-Colors-Beta-White-30 border border-Colors-Beta-White-12 shadow-none hover:bg-Colors-Beta-White-40 focus:shadow-cc-Focus-Rings-Brand-default active:bg-Colors-Beta-White-50 disabled:bg-Colors-Beta-White-60 disabled:text-Colors-Beta-White-80",
|
|
6401
|
+
solid: "shadow-none text-Colors-Text-Subtle bg-cc-Button-Solid-bg-default border border-cc-Button-Solid-border-default hover:bg-cc-Button-Solid-bg-hover hover:border-cc-Button-Solid-border-alt active:bg-cc-Button-Solid-bg-active disabled:text-cc-Button-Solid-fg-alt",
|
|
6402
|
+
static: "text-cc-Button-Static-fg-default border-cc-Button-Static-border-default bg-cc-Button-Static-bg-default hover:bg-cc-Button-Static-bg-hover active:bg-cc-Button-Static-bg-active disabled:bg-cc-Button-Static-bg-disabled disabled:text-cc-Button-Static-fg-alt"
|
|
6403
|
+
};
|
|
6404
|
+
var COLOR_STYLES = {
|
|
6405
|
+
default: "",
|
|
6406
|
+
brand: "",
|
|
6407
|
+
error: "",
|
|
6408
|
+
gray: ""
|
|
6409
|
+
};
|
|
6410
|
+
var SIZE_STYLES = {
|
|
6411
|
+
xs: "h-5 w-5 text-xs",
|
|
6412
|
+
sm: "h-7 w-7 text-sm",
|
|
6413
|
+
md: "h-9 w-9 text-sm",
|
|
6414
|
+
lg: "h-11 w-11"
|
|
6415
|
+
};
|
|
6416
|
+
var COMPOUND_VARIANTS = [
|
|
6417
|
+
{
|
|
6466
6418
|
variant: "primary",
|
|
6467
6419
|
color: "brand",
|
|
6468
|
-
|
|
6420
|
+
className: "text-cc-Icon-Button-Brand-fg-default bg-cc-Icon-Button-Brand-bg-default hover:bg-cc-Icon-Button-Brand-bg-hover active:bg-cc-Icon-Button-Brand-bg-active disabled:bg-cc-Icon-Button-Brand-bg-disabled disabled:text-cc-Icon-Button-Brand-fg-alt"
|
|
6421
|
+
},
|
|
6422
|
+
{
|
|
6423
|
+
variant: "primary",
|
|
6424
|
+
color: "error",
|
|
6425
|
+
className: "text-cc-Button-Error-Primary-fg-default bg-cc-Button-Error-Primary-bg-default hover:bg-cc-Button-Error-Primary-bg-hover active:bg-cc-Button-Error-Primary-bg-active disabled:bg-cc-Button-Error-Primary-bg-disabled"
|
|
6426
|
+
},
|
|
6427
|
+
{
|
|
6428
|
+
variant: "secondary",
|
|
6429
|
+
color: "default",
|
|
6430
|
+
className: "border-cc-Button-Secondary-border-default text-cc-Button-Secondary-fg-default bg-cc-Button-Secondary-bg-default hover:bg-cc-Button-Secondary-bg-hover active:bg-cc-Button-Secondary-bg-active disabled:text-cc-Button-Secondary-fg-alt disabled:border-cc-Button-Secondary-border-disabled"
|
|
6431
|
+
},
|
|
6432
|
+
{
|
|
6433
|
+
variant: "secondary",
|
|
6434
|
+
color: "error",
|
|
6435
|
+
className: "border-cc-Button-Error-Secondary-border-default text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Error-Secondary-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Error-Secondary-fg-alt disabled:border-cc-Button-Error-Secondary-border-disabled"
|
|
6436
|
+
},
|
|
6437
|
+
{
|
|
6438
|
+
variant: "tertiary",
|
|
6439
|
+
color: "default",
|
|
6440
|
+
className: "border-cc-Button-Tertiary-border-default text-cc-Button-Tertiary-fg-default bg-cc-Button-Tertiary-bg-default hover:bg-cc-Button-Tertiary-bg-hover hover:border-cc-Button-Tertiary-border-alt focus:shadow-button-tertiary-shadow active:bg-cc-Button-Tertiary-bg-active disabled:text-cc-Button-Tertiary-fg-alt"
|
|
6441
|
+
},
|
|
6442
|
+
{
|
|
6443
|
+
variant: "plain",
|
|
6444
|
+
color: "default",
|
|
6445
|
+
className: "text-cc-Button-Plain-fg-default hover:bg-cc-Button-Plain-bg-hover focus:shadow-rings-brand active:bg-cc-Button-Plain-bg-active disabled:text-cc-Button-Plain-fg-alt"
|
|
6446
|
+
},
|
|
6447
|
+
{
|
|
6448
|
+
variant: "plain",
|
|
6449
|
+
color: "gray",
|
|
6450
|
+
className: "text-cc-Icon-Button-Plain-Gray-fg-default bg-cc-Button-Plain-Brand-bg-default hover:bg-cc-Button-Plain-Brand-bg-hover active:bg-cc-Button-Plain-Brand-bg-active disabled:text-cc-Button-Plain-Gray-fg-alt"
|
|
6451
|
+
},
|
|
6452
|
+
{
|
|
6453
|
+
variant: "plain",
|
|
6454
|
+
color: "error",
|
|
6455
|
+
className: "text-cc-Button-Error-Secondary-fg-default bg-cc-Button-Plain-bg-default hover:bg-cc-Button-Error-Secondary-bg-hover active:bg-cc-Button-Error-Secondary-bg-active disabled:text-cc-Button-Plain-fg-default"
|
|
6469
6456
|
}
|
|
6457
|
+
];
|
|
6458
|
+
var DEFAULT_VARIANTS = {
|
|
6459
|
+
variant: "primary",
|
|
6460
|
+
color: "default",
|
|
6461
|
+
size: "lg"
|
|
6462
|
+
};
|
|
6463
|
+
var iconButtonVariants = (0, import_class_variance_authority6.cva)(BASE_STYLES, {
|
|
6464
|
+
variants: {
|
|
6465
|
+
variant: VARIANT_STYLES,
|
|
6466
|
+
color: COLOR_STYLES,
|
|
6467
|
+
size: SIZE_STYLES
|
|
6468
|
+
},
|
|
6469
|
+
compoundVariants: COMPOUND_VARIANTS,
|
|
6470
|
+
defaultVariants: DEFAULT_VARIANTS
|
|
6470
6471
|
});
|
|
6471
6472
|
var iconSizeVariants = {
|
|
6472
6473
|
xs: "w-3 h-3",
|
|
@@ -6476,8 +6477,16 @@ var iconSizeVariants = {
|
|
|
6476
6477
|
};
|
|
6477
6478
|
// src/components/button/icon-button.tsx
|
|
6478
6479
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
6479
|
-
|
|
6480
|
-
|
|
6480
|
+
function getDefaultColorForVariant(variant) {
|
|
6481
|
+
switch(variant){
|
|
6482
|
+
case "primary":
|
|
6483
|
+
return "brand";
|
|
6484
|
+
default:
|
|
6485
|
+
return "default";
|
|
6486
|
+
}
|
|
6487
|
+
}
|
|
6488
|
+
function createIconButtonWithVariant(props, ref) {
|
|
6489
|
+
var iconClassName = props.iconClassName, className = props.className, _props_variant = props.variant, variant = _props_variant === void 0 ? "primary" : _props_variant, _props_size = props.size, size = _props_size === void 0 ? "lg" : _props_size, userProvidedColor = props.color, _props_asChild = props.asChild, asChild = _props_asChild === void 0 ? false : _props_asChild, _props_loading = props.loading, loading = _props_loading === void 0 ? false : _props_loading, children = props.children, IconEle = props.icon, disabled = props.disabled, hoverText = props.hoverText, hoverSide = props.hoverSide, passProps = _object_without_properties(props, [
|
|
6481
6490
|
"iconClassName",
|
|
6482
6491
|
"className",
|
|
6483
6492
|
"variant",
|
|
@@ -6491,6 +6500,7 @@ var IconButton = React10.forwardRef(function(_param, ref) {
|
|
|
6491
6500
|
"hoverText",
|
|
6492
6501
|
"hoverSide"
|
|
6493
6502
|
]);
|
|
6503
|
+
var color = userProvidedColor || getDefaultColorForVariant(variant);
|
|
6494
6504
|
var isMobile2 = (0, import_react_use2.useMedia)("(max-width: 768px)");
|
|
6495
6505
|
var Comp = asChild ? import_react_slot2.Slot : "button";
|
|
6496
6506
|
var iconCls = cn(iconSizeVariants[size], iconClassName);
|
|
@@ -6519,6 +6529,9 @@ var IconButton = React10.forwardRef(function(_param, ref) {
|
|
|
6519
6529
|
}) : null
|
|
6520
6530
|
}))
|
|
6521
6531
|
});
|
|
6532
|
+
}
|
|
6533
|
+
var IconButton = React10.forwardRef(function(props, ref) {
|
|
6534
|
+
return createIconButtonWithVariant(props, ref);
|
|
6522
6535
|
});
|
|
6523
6536
|
// src/components/audio-playing.tsx
|
|
6524
6537
|
var import_lottie_web = __toESM(require("lottie-web"), 1);
|
|
@@ -11692,7 +11705,7 @@ function SecondaryNavigationBar(param) {
|
|
|
11692
11705
|
icons && icons.map(function(icon, index) {
|
|
11693
11706
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(IconButton, {
|
|
11694
11707
|
variant: !hasBackground ? "tertiary" : "plain",
|
|
11695
|
-
color:
|
|
11708
|
+
color: "default",
|
|
11696
11709
|
size: "md",
|
|
11697
11710
|
icon: icon.icon,
|
|
11698
11711
|
onClick: icon.onClick
|
|
@@ -11745,7 +11758,6 @@ function SecondaryNavigationBar(param) {
|
|
|
11745
11758
|
"aria-label": clearText || "Clear Filters",
|
|
11746
11759
|
size: "md",
|
|
11747
11760
|
variant: "primary",
|
|
11748
|
-
color: "default",
|
|
11749
11761
|
onClick: onClear,
|
|
11750
11762
|
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", {
|
|
11751
11763
|
className: "relative",
|