@streamoid/ui 0.2.2 → 0.2.4

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.css CHANGED
@@ -1972,6 +1972,31 @@
1972
1972
  flex-shrink: 0 !important;
1973
1973
  width: 7.5rem !important;
1974
1974
  }
1975
+ .ScCreditsUsageCard_buttonTooltipWrap {
1976
+ position: relative;
1977
+ flex-shrink: 0;
1978
+ }
1979
+ .ScCreditsUsageCard_buttonTooltip {
1980
+ position: absolute;
1981
+ bottom: calc(100% + 6px);
1982
+ left: 50%;
1983
+ transform: translateX(-50%);
1984
+ background: var(--alias-surface-raised, #242424);
1985
+ color: var(--alias-text-and-icons-primary, #f5f5f5);
1986
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
1987
+ font-size: var(--font-size-font-size-xs, 0.75rem);
1988
+ line-height: var(--line-height-line-height-xs, 1.125rem);
1989
+ padding: var(--spacing-sm, 4px) var(--spacing-lg, 10px);
1990
+ border-radius: var(--radius-md, 8px);
1991
+ white-space: nowrap;
1992
+ opacity: 0;
1993
+ pointer-events: none;
1994
+ transition: opacity 0.15s;
1995
+ z-index: 10;
1996
+ }
1997
+ .ScCreditsUsageCard_buttonTooltipWrap:hover .ScCreditsUsageCard_buttonTooltip {
1998
+ opacity: 1;
1999
+ }
1975
2000
 
1976
2001
  /* src/SC-Progress bar/ScProgressBar.module.css */
1977
2002
  .ScProgressBar_scProgressBar,
@@ -2442,7 +2467,7 @@
2442
2467
  flex-shrink: 0;
2443
2468
  }
2444
2469
  .ScPlanCard_featureText {
2445
- color: #9e9e9e;
2470
+ color: var(--alias-text-and-icons-tertiary, #9e9e9e);
2446
2471
  text-align: left;
2447
2472
  font-family: var( --text-text-sm-regular-font-family, "Inter-Regular", sans-serif );
2448
2473
  font-size: var(--text-text-sm-regular-font-size, 0.875rem);
@@ -2450,7 +2475,7 @@
2450
2475
  font-weight: var(--text-text-sm-regular-font-weight, 400);
2451
2476
  }
2452
2477
  .ScPlanCard_description {
2453
- color: #9e9e9e;
2478
+ color: var(--alias-text-and-icons-tertiary, #9e9e9e);
2454
2479
  text-align: left;
2455
2480
  font-family: var( --lead-text-lead-text-xs-regular-font-family, "Inter-Regular", sans-serif );
2456
2481
  font-size: var(--lead-text-lead-text-xs-regular-font-size, 1.125rem);
@@ -4812,6 +4837,13 @@
4812
4837
  font-weight: 500;
4813
4838
  line-height: var(--line-height-line-height-sm, 1.25rem);
4814
4839
  }
4840
+ .ScWorkspaceSwitchCard_detailValueInfo {
4841
+ color: var(--alias-text-and-icons-info, #2d8fe6);
4842
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4843
+ font-size: var(--font-size-font-size-sm, 0.875rem);
4844
+ font-weight: 500;
4845
+ line-height: var(--line-height-line-height-sm, 1.25rem);
4846
+ }
4815
4847
  .ScWorkspaceSwitchCard_detailValueSecondary {
4816
4848
  color: var(--alias-text-and-icons-secondary, #dadada);
4817
4849
  font-family: var(--font-family-font-family-body, "Inter", sans-serif);
package/dist/index.d.mts CHANGED
@@ -84,11 +84,12 @@ interface IScCreditsUsageCardProps extends React.HTMLAttributes<HTMLDivElement>
84
84
  remainingText?: string;
85
85
  buyButtonText?: string;
86
86
  buyButtonState?: "default" | "disabled";
87
+ buyButtonHoverText?: string;
87
88
  onBuyClick?: () => void;
88
89
  progress?: number;
89
90
  className?: string;
90
91
  }
91
- declare const ScCreditsUsageCard: ({ usageLabel, usageText, remainingText, buyButtonText, buyButtonState, onBuyClick, progress, className, ...props }: IScCreditsUsageCardProps) => JSX.Element;
92
+ declare const ScCreditsUsageCard: ({ usageLabel, usageText, remainingText, buyButtonText, buyButtonState, buyButtonHoverText, onBuyClick, progress, className, ...props }: IScCreditsUsageCardProps) => JSX.Element;
92
93
 
93
94
  interface ScDpProps {
94
95
  /** "initial" shows initials text, "image" shows an image. */
@@ -574,13 +575,12 @@ interface NscWorkspaceSwitchProps {
574
575
  initials?: string;
575
576
  imageUrl?: string;
576
577
  type?: "currentWS" | "otherWS";
577
- variant?: "switch" | "settings";
578
578
  hover?: boolean;
579
579
  className?: string;
580
580
  onSwitch?: () => void;
581
581
  onSettings?: () => void;
582
582
  }
583
- declare function NscWorkspaceSwitch({ wsName, role, plan, ownerId, initials, imageUrl, type, variant, hover, className, onSwitch, onSettings, }: NscWorkspaceSwitchProps): react_jsx_runtime.JSX.Element;
583
+ declare function NscWorkspaceSwitch({ wsName, role, plan, ownerId, initials, imageUrl, type, hover, className, onSwitch, onSettings, }: NscWorkspaceSwitchProps): react_jsx_runtime.JSX.Element;
584
584
  declare const ScWorkspaceSwitchCard: typeof NscWorkspaceSwitch;
585
585
 
586
586
  export { type IScAccessProps, type IScAppCardProps, type IScAppFieldProps, type IScAppListingCardProps, type IScArtifaxInviteProps, type IScBadgesProps, type IScBillingHistoryHeaderProps, type IScBillingHistoryTableListProps, type IScBillingLogsTableHeaderProps, type IScBillingLogsTableListProps, type IScButtonProps, type IScCalendarDateCompsProps, type IScCalendarProps, type IScCatalogixInviteProps, type IScCheckFieldProps, type IScCheckboxProps, type IScCreditsUsageCardProps, type IScFieldButtonProps, type IScGoogleSignInProps, type IScHDividerProps, type IScHeaderProps, type IScIntialProfileCoverProps, type IScLogoUnitProps, type IScMenuOptionsProps, type IScOnlyFieldProps, type IScOnlyIconProps, type IScPairtextProps, type IScPendingActionProps, type IScPhtogenixInviteProps, type IScPlanCardProps, type IScPlanDetailsCardProps, type IScProfileImageUpdateProps, type IScProfileOptionsProps, type IScProfileProps, type IScProfileSettingsCompProps, type IScProgressBarProps, type IScQuickPromptProps, type IScRadioProps, type IScReferralTableHeaderProps, type IScReferralTableListProps, type IScRoleProps, type IScSettingsNavProps, type IScSidebarIconsProps, type IScSidebarMenuProps, type IScSidebarProfileProps, type IScSidebarProps, type IScSliderProps, type IScStrLogoProps, type IScTabCompProps, type IScTabFieldProps, type IScTabSwitcherProps, type IScTableHeaderProps, type IScTableListProps, type IScTextFieldProps, type IScToggleSwitchProps, type IScVDividerProps, type IScVersionProps, type IScWorkspaceCardProps, NscWorkspaceSwitch, type NscWorkspaceSwitchProps, type PlanFeatureSection, ScAccess, ScAppCard, ScAppField, ScAppListingCard, ScArtifaxInvite, ScBadges, ScBillingHistoryHeader, ScBillingHistoryTableList, ScBillingLogsTableHeader, ScBillingLogsTableList, ScButton, ScCalendar, ScCalendarDateComps, ScCatalogixInvite, ScCheckField, ScCheckbox, ScCreditsUsageCard, ScDp, type ScDpProps, ScFieldButton, ScGoogleSignIn, ScHDivider, ScHeader, ScIntialProfileCover, ScLogoUnit, ScMenuOptions, ScOnlyField, ScOnlyIcon, ScPairtext, ScPendingAction, ScPhtogenixInvite, ScPlanCard, ScPlanDetailsCard, ScProfile, ScProfileImageUpdate, ScProfileOptions, ScProfileSettingsComp, ScProgressBar, ScQuickPrompt, ScRadio, ScReferralTableHeader, ScReferralTableList, ScRole, ScSettingsNav, ScSidebar, ScSidebarIcons, ScSidebarMenu, ScSidebarProfile, ScSlider, ScStrLogo, ScTabComp, ScTabField, ScTabSwitcher, ScTableHeader, ScTableList, ScTextField, ScToggleSwitch, ScVDivider, ScVersion, ScWorkspaceCard, ScWorkspaceSwitchCard, type SidebarConfig, type SidebarIconContext, type SidebarIconMap, type SidebarIconRenderer, type SidebarMenuItemConfig, type SidebarProfileConfig, type SidebarSectionConfig, StreamoidSidebar, type StreamoidSidebarProps, StreamoidWorkspaceSwitcher, type StreamoidWorkspaceSwitcherProps, type WorkspaceSwitcherConfig, type WorkspaceSwitcherItem };
package/dist/index.d.ts CHANGED
@@ -84,11 +84,12 @@ interface IScCreditsUsageCardProps extends React.HTMLAttributes<HTMLDivElement>
84
84
  remainingText?: string;
85
85
  buyButtonText?: string;
86
86
  buyButtonState?: "default" | "disabled";
87
+ buyButtonHoverText?: string;
87
88
  onBuyClick?: () => void;
88
89
  progress?: number;
89
90
  className?: string;
90
91
  }
91
- declare const ScCreditsUsageCard: ({ usageLabel, usageText, remainingText, buyButtonText, buyButtonState, onBuyClick, progress, className, ...props }: IScCreditsUsageCardProps) => JSX.Element;
92
+ declare const ScCreditsUsageCard: ({ usageLabel, usageText, remainingText, buyButtonText, buyButtonState, buyButtonHoverText, onBuyClick, progress, className, ...props }: IScCreditsUsageCardProps) => JSX.Element;
92
93
 
93
94
  interface ScDpProps {
94
95
  /** "initial" shows initials text, "image" shows an image. */
@@ -574,13 +575,12 @@ interface NscWorkspaceSwitchProps {
574
575
  initials?: string;
575
576
  imageUrl?: string;
576
577
  type?: "currentWS" | "otherWS";
577
- variant?: "switch" | "settings";
578
578
  hover?: boolean;
579
579
  className?: string;
580
580
  onSwitch?: () => void;
581
581
  onSettings?: () => void;
582
582
  }
583
- declare function NscWorkspaceSwitch({ wsName, role, plan, ownerId, initials, imageUrl, type, variant, hover, className, onSwitch, onSettings, }: NscWorkspaceSwitchProps): react_jsx_runtime.JSX.Element;
583
+ declare function NscWorkspaceSwitch({ wsName, role, plan, ownerId, initials, imageUrl, type, hover, className, onSwitch, onSettings, }: NscWorkspaceSwitchProps): react_jsx_runtime.JSX.Element;
584
584
  declare const ScWorkspaceSwitchCard: typeof NscWorkspaceSwitch;
585
585
 
586
586
  export { type IScAccessProps, type IScAppCardProps, type IScAppFieldProps, type IScAppListingCardProps, type IScArtifaxInviteProps, type IScBadgesProps, type IScBillingHistoryHeaderProps, type IScBillingHistoryTableListProps, type IScBillingLogsTableHeaderProps, type IScBillingLogsTableListProps, type IScButtonProps, type IScCalendarDateCompsProps, type IScCalendarProps, type IScCatalogixInviteProps, type IScCheckFieldProps, type IScCheckboxProps, type IScCreditsUsageCardProps, type IScFieldButtonProps, type IScGoogleSignInProps, type IScHDividerProps, type IScHeaderProps, type IScIntialProfileCoverProps, type IScLogoUnitProps, type IScMenuOptionsProps, type IScOnlyFieldProps, type IScOnlyIconProps, type IScPairtextProps, type IScPendingActionProps, type IScPhtogenixInviteProps, type IScPlanCardProps, type IScPlanDetailsCardProps, type IScProfileImageUpdateProps, type IScProfileOptionsProps, type IScProfileProps, type IScProfileSettingsCompProps, type IScProgressBarProps, type IScQuickPromptProps, type IScRadioProps, type IScReferralTableHeaderProps, type IScReferralTableListProps, type IScRoleProps, type IScSettingsNavProps, type IScSidebarIconsProps, type IScSidebarMenuProps, type IScSidebarProfileProps, type IScSidebarProps, type IScSliderProps, type IScStrLogoProps, type IScTabCompProps, type IScTabFieldProps, type IScTabSwitcherProps, type IScTableHeaderProps, type IScTableListProps, type IScTextFieldProps, type IScToggleSwitchProps, type IScVDividerProps, type IScVersionProps, type IScWorkspaceCardProps, NscWorkspaceSwitch, type NscWorkspaceSwitchProps, type PlanFeatureSection, ScAccess, ScAppCard, ScAppField, ScAppListingCard, ScArtifaxInvite, ScBadges, ScBillingHistoryHeader, ScBillingHistoryTableList, ScBillingLogsTableHeader, ScBillingLogsTableList, ScButton, ScCalendar, ScCalendarDateComps, ScCatalogixInvite, ScCheckField, ScCheckbox, ScCreditsUsageCard, ScDp, type ScDpProps, ScFieldButton, ScGoogleSignIn, ScHDivider, ScHeader, ScIntialProfileCover, ScLogoUnit, ScMenuOptions, ScOnlyField, ScOnlyIcon, ScPairtext, ScPendingAction, ScPhtogenixInvite, ScPlanCard, ScPlanDetailsCard, ScProfile, ScProfileImageUpdate, ScProfileOptions, ScProfileSettingsComp, ScProgressBar, ScQuickPrompt, ScRadio, ScReferralTableHeader, ScReferralTableList, ScRole, ScSettingsNav, ScSidebar, ScSidebarIcons, ScSidebarMenu, ScSidebarProfile, ScSlider, ScStrLogo, ScTabComp, ScTabField, ScTabSwitcher, ScTableHeader, ScTableList, ScTextField, ScToggleSwitch, ScVDivider, ScVersion, ScWorkspaceCard, ScWorkspaceSwitchCard, type SidebarConfig, type SidebarIconContext, type SidebarIconMap, type SidebarIconRenderer, type SidebarMenuItemConfig, type SidebarProfileConfig, type SidebarSectionConfig, StreamoidSidebar, type StreamoidSidebarProps, StreamoidWorkspaceSwitcher, type StreamoidWorkspaceSwitcherProps, type WorkspaceSwitcherConfig, type WorkspaceSwitcherItem };
package/dist/index.js CHANGED
@@ -864,6 +864,9 @@ var ScCalendar = ({
864
864
  ] });
865
865
  };
866
866
 
867
+ // src/SC-Credits usage card/ScCreditsUsageCard.tsx
868
+ var import_react2 = require("react");
869
+
867
870
  // src/SC-Credits usage card/ScCreditsUsageCard.module.css
868
871
  var ScCreditsUsageCard_default = {
869
872
  scCreditsUsageCard: "ScCreditsUsageCard_scCreditsUsageCard",
@@ -874,7 +877,9 @@ var ScCreditsUsageCard_default = {
874
877
  progressContainer: "ScCreditsUsageCard_progressContainer",
875
878
  scProgressBarInstance: "ScCreditsUsageCard_scProgressBarInstance",
876
879
  remainingText: "ScCreditsUsageCard_remainingText",
877
- scButtonInstance: "ScCreditsUsageCard_scButtonInstance"
880
+ scButtonInstance: "ScCreditsUsageCard_scButtonInstance",
881
+ buttonTooltipWrap: "ScCreditsUsageCard_buttonTooltipWrap",
882
+ buttonTooltip: "ScCreditsUsageCard_buttonTooltip"
878
883
  };
879
884
 
880
885
  // src/SC-Credits usage card/ScCreditsUsageCard.tsx
@@ -912,11 +917,14 @@ var ScCreditsUsageCard = ({
912
917
  remainingText = "60% Remaining",
913
918
  buyButtonText = "Buy credits",
914
919
  buyButtonState = "default",
920
+ buyButtonHoverText,
915
921
  onBuyClick,
916
922
  progress = 60,
917
923
  className,
918
924
  ...props
919
925
  }) => {
926
+ const [btnHovered, setBtnHovered] = (0, import_react2.useState)(false);
927
+ const displayText = btnHovered && buyButtonHoverText ? buyButtonHoverText : buyButtonText;
920
928
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: ScCreditsUsageCard_default.scCreditsUsageCard + " " + className, ...props, children: [
921
929
  /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: ScCreditsUsageCard_default.header, children: [
922
930
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
@@ -946,15 +954,23 @@ var ScCreditsUsageCard = ({
946
954
  " "
947
955
  ] }),
948
956
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
949
- ScButton,
957
+ "div",
950
958
  {
951
- icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons8.SiconHome, { className: ScCreditsUsageCard_default.siconHomeInstance }),
952
- text: buyButtonText,
953
- variant: "secondary",
954
- size: "md",
955
- state: buyButtonState,
956
- className: ScCreditsUsageCard_default.scButtonInstance,
957
- onClick: onBuyClick
959
+ className: ScCreditsUsageCard_default.buttonTooltipWrap,
960
+ onMouseEnter: () => setBtnHovered(true),
961
+ onMouseLeave: () => setBtnHovered(false),
962
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
963
+ ScButton,
964
+ {
965
+ icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons8.SiconHome, { className: ScCreditsUsageCard_default.siconHomeInstance }),
966
+ text: displayText,
967
+ variant: "secondary",
968
+ size: "md",
969
+ state: buyButtonState,
970
+ className: ScCreditsUsageCard_default.scButtonInstance,
971
+ onClick: onBuyClick
972
+ }
973
+ )
958
974
  }
959
975
  )
960
976
  ] })
@@ -962,7 +978,7 @@ var ScCreditsUsageCard = ({
962
978
  };
963
979
 
964
980
  // src/SC-Dp/ScDp.tsx
965
- var import_react2 = require("react");
981
+ var import_react3 = require("react");
966
982
 
967
983
  // src/SC-Dp/ScDp.module.css
968
984
  var ScDp_default = {
@@ -987,7 +1003,7 @@ function ScDp({
987
1003
  className,
988
1004
  style
989
1005
  }) {
990
- const [imageFailed, setImageFailed] = (0, import_react2.useState)(false);
1006
+ const [imageFailed, setImageFailed] = (0, import_react3.useState)(false);
991
1007
  const isProfile = variant === "profile";
992
1008
  const showImage = type === "image" && imageUrl && !imageFailed;
993
1009
  const containerClass = [
@@ -1312,7 +1328,7 @@ var ScOnlyIcon = ({
1312
1328
  };
1313
1329
 
1314
1330
  // src/SC-Plan card/ScPlanCard.tsx
1315
- var import_react3 = require("react");
1331
+ var import_react4 = require("react");
1316
1332
 
1317
1333
  // src/SC-Plan card/ScPlanCard.module.css
1318
1334
  var ScPlanCard_default = {
@@ -1382,7 +1398,7 @@ var ScPlanCard = ({
1382
1398
  import_icons11.SiconCredits,
1383
1399
  {
1384
1400
  className: ScPlanCard_default.siconCreditsInstance,
1385
- color: "#f5f5f5",
1401
+ color: "var(--alias-text-and-icons-primary, #f5f5f5)",
1386
1402
  size: 24,
1387
1403
  strokeWidth: 1.5
1388
1404
  }
@@ -1409,7 +1425,7 @@ var ScPlanCard = ({
1409
1425
  "path",
1410
1426
  {
1411
1427
  d: "M3 4.5L6 7.5L9 4.5",
1412
- stroke: "#f5f5f5",
1428
+ stroke: "var(--alias-text-and-icons-primary, #f5f5f5)",
1413
1429
  strokeWidth: "1.5",
1414
1430
  strokeLinecap: "round",
1415
1431
  strokeLinejoin: "round"
@@ -1437,12 +1453,12 @@ var ScPlanCard = ({
1437
1453
  ),
1438
1454
  isCustom && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScHDivider, { className: ScPlanCard_default.scHDividerInstance }),
1439
1455
  isCustom && description && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: ScPlanCard_default.description, children: description }),
1440
- isFreeOrPopular && features.map((section, sIdx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react3.Fragment, { children: [
1456
+ isFreeOrPopular && features.map((section, sIdx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react4.Fragment, { children: [
1441
1457
  sIdx > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ScHDivider, { className: ScPlanCard_default.scHDividerInstance }),
1442
1458
  /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: ScPlanCard_default.featuresSection, children: [
1443
1459
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: ScPlanCard_default.sectionTitle, children: section.section }),
1444
1460
  section.features.map((feature, fIdx) => /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: ScPlanCard_default.featureRow, children: [
1445
- section.icon || /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons11.SiconHome, { color: "#9e9e9e", size: 24, strokeWidth: 1.5 }),
1461
+ section.icon || /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_icons11.SiconHome, { color: "var(--alias-text-and-icons-tertiary, #9e9e9e)", size: 24, strokeWidth: 1.5 }),
1446
1462
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: ScPlanCard_default.featureText, children: feature })
1447
1463
  ] }, fIdx))
1448
1464
  ] })
@@ -3027,7 +3043,7 @@ var ScSlider = ({
3027
3043
  };
3028
3044
 
3029
3045
  // src/SC-WorkspaceSwitcher/streamoid-workspace-switcher.tsx
3030
- var import_react4 = require("react");
3046
+ var import_react5 = require("react");
3031
3047
  var import_icons34 = require("@streamoid/icons");
3032
3048
  var import_jsx_runtime42 = require("react/jsx-runtime");
3033
3049
  var PRIMARY_ICON = "var(--alias-text---icons-primary)";
@@ -3218,12 +3234,12 @@ function StreamoidWorkspaceSwitcher({
3218
3234
  onSwitchWorkspace,
3219
3235
  config
3220
3236
  }) {
3221
- const modalRef = (0, import_react4.useRef)(null);
3237
+ const modalRef = (0, import_react5.useRef)(null);
3222
3238
  const title = config?.title || "Switch workspace";
3223
3239
  const loadingText = config?.loadingText || "Loading workspaces\u2026";
3224
3240
  const currentWorkspaceText = config?.currentWorkspaceText || "Current workspace";
3225
3241
  const switchWorkspaceText = config?.switchWorkspaceText || "Switch workspace";
3226
- (0, import_react4.useEffect)(() => {
3242
+ (0, import_react5.useEffect)(() => {
3227
3243
  if (!open) return;
3228
3244
  function handleKeyDown(e) {
3229
3245
  if (e.key === "Escape") onClose();
@@ -4426,7 +4442,7 @@ var ScWorkspaceCard = ({
4426
4442
  };
4427
4443
 
4428
4444
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4429
- var import_react5 = require("react");
4445
+ var import_react6 = require("react");
4430
4446
  var import_icons53 = require("@streamoid/icons");
4431
4447
 
4432
4448
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css
@@ -4444,6 +4460,7 @@ var ScWorkspaceSwitchCard_default = {
4444
4460
  detailItemFlex: "ScWorkspaceSwitchCard_detailItemFlex",
4445
4461
  detailLabel: "ScWorkspaceSwitchCard_detailLabel",
4446
4462
  detailValueRole: "ScWorkspaceSwitchCard_detailValueRole",
4463
+ detailValueInfo: "ScWorkspaceSwitchCard_detailValueInfo",
4447
4464
  detailValueSecondary: "ScWorkspaceSwitchCard_detailValueSecondary",
4448
4465
  vDivider: "ScWorkspaceSwitchCard_vDivider",
4449
4466
  btnIcon: "ScWorkspaceSwitchCard_btnIcon"
@@ -4459,30 +4476,31 @@ function NscWorkspaceSwitch({
4459
4476
  initials,
4460
4477
  imageUrl,
4461
4478
  type = "currentWS",
4462
- variant = "switch",
4463
4479
  hover,
4464
4480
  className,
4465
4481
  onSwitch,
4466
4482
  onSettings
4467
4483
  }) {
4468
- const [internalHover, setInternalHover] = (0, import_react5.useState)(false);
4484
+ const [internalHover, setInternalHover] = (0, import_react6.useState)(false);
4469
4485
  const isHover = hover !== void 0 ? hover : internalHover;
4470
4486
  const isCurrent = type === "currentWS";
4471
4487
  const isOther = type === "otherWS";
4472
- const showButtons = isHover && isOther;
4488
+ const isAdmin = role?.toLowerCase() === "admin";
4489
+ const displayRole = role ? role.charAt(0).toUpperCase() + role.slice(1).toLowerCase() : role;
4473
4490
  const displayInitials = initials || wsName.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4474
4491
  const cardClass = [
4475
4492
  ScWorkspaceSwitchCard_default.card,
4476
4493
  isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : ScWorkspaceSwitchCard_default.cardOther,
4477
- showButtons ? ScWorkspaceSwitchCard_default.cardOtherHover : "",
4494
+ isHover && isOther ? ScWorkspaceSwitchCard_default.cardOtherHover : "",
4478
4495
  className || ""
4479
4496
  ].filter(Boolean).join(" ");
4480
4497
  const dpBg = isCurrent ? "var(--alias-fill-neutral-neutralactive, #313131)" : "var(--alias-fill-neutral-neutralselected, #242424)";
4498
+ const roleColorClass = isAdmin ? ScWorkspaceSwitchCard_default.detailValueRole : ScWorkspaceSwitchCard_default.detailValueInfo;
4481
4499
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4482
4500
  "div",
4483
4501
  {
4484
4502
  className: cardClass,
4485
- onMouseEnter: () => isOther && setInternalHover(true),
4503
+ onMouseEnter: () => setInternalHover(true),
4486
4504
  onMouseLeave: () => setInternalHover(false),
4487
4505
  children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.wsInfo, children: [
4488
4506
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
@@ -4504,7 +4522,7 @@ function NscWorkspaceSwitch({
4504
4522
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailsRow, children: [
4505
4523
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4506
4524
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Role" }),
4507
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailValueRole, children: role })
4525
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: roleColorClass, children: displayRole })
4508
4526
  ] }),
4509
4527
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4510
4528
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
@@ -4518,31 +4536,43 @@ function NscWorkspaceSwitch({
4518
4536
  ] })
4519
4537
  ] })
4520
4538
  ] }),
4521
- showButtons && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4522
- ScButton,
4539
+ isHover && isOther && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4540
+ "div",
4523
4541
  {
4524
- text: "Switch Workspace",
4525
- variant: "secondary",
4526
- size: "sm",
4527
- styleVariant: "icon-left",
4528
- icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSwitch, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4529
4542
  onClick: (e) => {
4530
4543
  e.stopPropagation();
4531
4544
  onSwitch?.();
4532
- }
4545
+ },
4546
+ style: { cursor: "pointer" },
4547
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4548
+ ScButton,
4549
+ {
4550
+ text: "Switch Workspace",
4551
+ variant: "secondary",
4552
+ size: "sm",
4553
+ styleVariant: "icon-left",
4554
+ icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSwitch, { className: ScWorkspaceSwitchCard_default.btnIcon })
4555
+ }
4556
+ )
4533
4557
  }
4534
4558
  ),
4535
- showButtons && variant === "settings" && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4536
- ScButton,
4559
+ isHover && isAdmin && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4560
+ "div",
4537
4561
  {
4538
- styleVariant: "icon-only",
4539
- variant: "outline",
4540
- size: "sm",
4541
- icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSettings, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4542
4562
  onClick: (e) => {
4543
4563
  e.stopPropagation();
4544
4564
  onSettings?.();
4545
- }
4565
+ },
4566
+ style: { cursor: "pointer" },
4567
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4568
+ ScButton,
4569
+ {
4570
+ styleVariant: "icon-only",
4571
+ variant: "outline",
4572
+ size: "sm",
4573
+ icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSettings, { className: ScWorkspaceSwitchCard_default.btnIcon })
4574
+ }
4575
+ )
4546
4576
  }
4547
4577
  )
4548
4578
  ] })
package/dist/index.mjs CHANGED
@@ -776,6 +776,9 @@ var ScCalendar = ({
776
776
  ] });
777
777
  };
778
778
 
779
+ // src/SC-Credits usage card/ScCreditsUsageCard.tsx
780
+ import { useState } from "react";
781
+
779
782
  // src/SC-Credits usage card/ScCreditsUsageCard.module.css
780
783
  var ScCreditsUsageCard_default = {
781
784
  scCreditsUsageCard: "ScCreditsUsageCard_scCreditsUsageCard",
@@ -786,7 +789,9 @@ var ScCreditsUsageCard_default = {
786
789
  progressContainer: "ScCreditsUsageCard_progressContainer",
787
790
  scProgressBarInstance: "ScCreditsUsageCard_scProgressBarInstance",
788
791
  remainingText: "ScCreditsUsageCard_remainingText",
789
- scButtonInstance: "ScCreditsUsageCard_scButtonInstance"
792
+ scButtonInstance: "ScCreditsUsageCard_scButtonInstance",
793
+ buttonTooltipWrap: "ScCreditsUsageCard_buttonTooltipWrap",
794
+ buttonTooltip: "ScCreditsUsageCard_buttonTooltip"
790
795
  };
791
796
 
792
797
  // src/SC-Credits usage card/ScCreditsUsageCard.tsx
@@ -824,11 +829,14 @@ var ScCreditsUsageCard = ({
824
829
  remainingText = "60% Remaining",
825
830
  buyButtonText = "Buy credits",
826
831
  buyButtonState = "default",
832
+ buyButtonHoverText,
827
833
  onBuyClick,
828
834
  progress = 60,
829
835
  className,
830
836
  ...props
831
837
  }) => {
838
+ const [btnHovered, setBtnHovered] = useState(false);
839
+ const displayText = btnHovered && buyButtonHoverText ? buyButtonHoverText : buyButtonText;
832
840
  return /* @__PURE__ */ jsxs11("div", { className: ScCreditsUsageCard_default.scCreditsUsageCard + " " + className, ...props, children: [
833
841
  /* @__PURE__ */ jsxs11("div", { className: ScCreditsUsageCard_default.header, children: [
834
842
  /* @__PURE__ */ jsx14(
@@ -858,15 +866,23 @@ var ScCreditsUsageCard = ({
858
866
  " "
859
867
  ] }),
860
868
  /* @__PURE__ */ jsx14(
861
- ScButton,
869
+ "div",
862
870
  {
863
- icon: /* @__PURE__ */ jsx14(SiconHome3, { className: ScCreditsUsageCard_default.siconHomeInstance }),
864
- text: buyButtonText,
865
- variant: "secondary",
866
- size: "md",
867
- state: buyButtonState,
868
- className: ScCreditsUsageCard_default.scButtonInstance,
869
- onClick: onBuyClick
871
+ className: ScCreditsUsageCard_default.buttonTooltipWrap,
872
+ onMouseEnter: () => setBtnHovered(true),
873
+ onMouseLeave: () => setBtnHovered(false),
874
+ children: /* @__PURE__ */ jsx14(
875
+ ScButton,
876
+ {
877
+ icon: /* @__PURE__ */ jsx14(SiconHome3, { className: ScCreditsUsageCard_default.siconHomeInstance }),
878
+ text: displayText,
879
+ variant: "secondary",
880
+ size: "md",
881
+ state: buyButtonState,
882
+ className: ScCreditsUsageCard_default.scButtonInstance,
883
+ onClick: onBuyClick
884
+ }
885
+ )
870
886
  }
871
887
  )
872
888
  ] })
@@ -874,7 +890,7 @@ var ScCreditsUsageCard = ({
874
890
  };
875
891
 
876
892
  // src/SC-Dp/ScDp.tsx
877
- import { useState } from "react";
893
+ import { useState as useState2 } from "react";
878
894
 
879
895
  // src/SC-Dp/ScDp.module.css
880
896
  var ScDp_default = {
@@ -899,7 +915,7 @@ function ScDp({
899
915
  className,
900
916
  style
901
917
  }) {
902
- const [imageFailed, setImageFailed] = useState(false);
918
+ const [imageFailed, setImageFailed] = useState2(false);
903
919
  const isProfile = variant === "profile";
904
920
  const showImage = type === "image" && imageUrl && !imageFailed;
905
921
  const containerClass = [
@@ -1294,7 +1310,7 @@ var ScPlanCard = ({
1294
1310
  SiconCredits2,
1295
1311
  {
1296
1312
  className: ScPlanCard_default.siconCreditsInstance,
1297
- color: "#f5f5f5",
1313
+ color: "var(--alias-text-and-icons-primary, #f5f5f5)",
1298
1314
  size: 24,
1299
1315
  strokeWidth: 1.5
1300
1316
  }
@@ -1321,7 +1337,7 @@ var ScPlanCard = ({
1321
1337
  "path",
1322
1338
  {
1323
1339
  d: "M3 4.5L6 7.5L9 4.5",
1324
- stroke: "#f5f5f5",
1340
+ stroke: "var(--alias-text-and-icons-primary, #f5f5f5)",
1325
1341
  strokeWidth: "1.5",
1326
1342
  strokeLinecap: "round",
1327
1343
  strokeLinejoin: "round"
@@ -1354,7 +1370,7 @@ var ScPlanCard = ({
1354
1370
  /* @__PURE__ */ jsxs16("div", { className: ScPlanCard_default.featuresSection, children: [
1355
1371
  /* @__PURE__ */ jsx22("div", { className: ScPlanCard_default.sectionTitle, children: section.section }),
1356
1372
  section.features.map((feature, fIdx) => /* @__PURE__ */ jsxs16("div", { className: ScPlanCard_default.featureRow, children: [
1357
- section.icon || /* @__PURE__ */ jsx22(SiconHome4, { color: "#9e9e9e", size: 24, strokeWidth: 1.5 }),
1373
+ section.icon || /* @__PURE__ */ jsx22(SiconHome4, { color: "var(--alias-text-and-icons-tertiary, #9e9e9e)", size: 24, strokeWidth: 1.5 }),
1358
1374
  /* @__PURE__ */ jsx22("span", { className: ScPlanCard_default.featureText, children: feature })
1359
1375
  ] }, fIdx))
1360
1376
  ] })
@@ -4348,7 +4364,7 @@ var ScWorkspaceCard = ({
4348
4364
  };
4349
4365
 
4350
4366
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4351
- import { useState as useState2 } from "react";
4367
+ import { useState as useState3 } from "react";
4352
4368
  import { SiconSwitch as SiconSwitch3, SiconSettings as SiconSettings3 } from "@streamoid/icons";
4353
4369
 
4354
4370
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css
@@ -4366,6 +4382,7 @@ var ScWorkspaceSwitchCard_default = {
4366
4382
  detailItemFlex: "ScWorkspaceSwitchCard_detailItemFlex",
4367
4383
  detailLabel: "ScWorkspaceSwitchCard_detailLabel",
4368
4384
  detailValueRole: "ScWorkspaceSwitchCard_detailValueRole",
4385
+ detailValueInfo: "ScWorkspaceSwitchCard_detailValueInfo",
4369
4386
  detailValueSecondary: "ScWorkspaceSwitchCard_detailValueSecondary",
4370
4387
  vDivider: "ScWorkspaceSwitchCard_vDivider",
4371
4388
  btnIcon: "ScWorkspaceSwitchCard_btnIcon"
@@ -4381,30 +4398,31 @@ function NscWorkspaceSwitch({
4381
4398
  initials,
4382
4399
  imageUrl,
4383
4400
  type = "currentWS",
4384
- variant = "switch",
4385
4401
  hover,
4386
4402
  className,
4387
4403
  onSwitch,
4388
4404
  onSettings
4389
4405
  }) {
4390
- const [internalHover, setInternalHover] = useState2(false);
4406
+ const [internalHover, setInternalHover] = useState3(false);
4391
4407
  const isHover = hover !== void 0 ? hover : internalHover;
4392
4408
  const isCurrent = type === "currentWS";
4393
4409
  const isOther = type === "otherWS";
4394
- const showButtons = isHover && isOther;
4410
+ const isAdmin = role?.toLowerCase() === "admin";
4411
+ const displayRole = role ? role.charAt(0).toUpperCase() + role.slice(1).toLowerCase() : role;
4395
4412
  const displayInitials = initials || wsName.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4396
4413
  const cardClass = [
4397
4414
  ScWorkspaceSwitchCard_default.card,
4398
4415
  isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : ScWorkspaceSwitchCard_default.cardOther,
4399
- showButtons ? ScWorkspaceSwitchCard_default.cardOtherHover : "",
4416
+ isHover && isOther ? ScWorkspaceSwitchCard_default.cardOtherHover : "",
4400
4417
  className || ""
4401
4418
  ].filter(Boolean).join(" ");
4402
4419
  const dpBg = isCurrent ? "var(--alias-fill-neutral-neutralactive, #313131)" : "var(--alias-fill-neutral-neutralselected, #242424)";
4420
+ const roleColorClass = isAdmin ? ScWorkspaceSwitchCard_default.detailValueRole : ScWorkspaceSwitchCard_default.detailValueInfo;
4403
4421
  return /* @__PURE__ */ jsx62(
4404
4422
  "div",
4405
4423
  {
4406
4424
  className: cardClass,
4407
- onMouseEnter: () => isOther && setInternalHover(true),
4425
+ onMouseEnter: () => setInternalHover(true),
4408
4426
  onMouseLeave: () => setInternalHover(false),
4409
4427
  children: /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.wsInfo, children: [
4410
4428
  /* @__PURE__ */ jsx62(
@@ -4426,7 +4444,7 @@ function NscWorkspaceSwitch({
4426
4444
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailsRow, children: [
4427
4445
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4428
4446
  /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Role" }),
4429
- /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueRole, children: role })
4447
+ /* @__PURE__ */ jsx62("span", { className: roleColorClass, children: displayRole })
4430
4448
  ] }),
4431
4449
  /* @__PURE__ */ jsx62(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4432
4450
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
@@ -4440,31 +4458,43 @@ function NscWorkspaceSwitch({
4440
4458
  ] })
4441
4459
  ] })
4442
4460
  ] }),
4443
- showButtons && /* @__PURE__ */ jsx62(
4444
- ScButton,
4461
+ isHover && isOther && /* @__PURE__ */ jsx62(
4462
+ "div",
4445
4463
  {
4446
- text: "Switch Workspace",
4447
- variant: "secondary",
4448
- size: "sm",
4449
- styleVariant: "icon-left",
4450
- icon: /* @__PURE__ */ jsx62(SiconSwitch3, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4451
4464
  onClick: (e) => {
4452
4465
  e.stopPropagation();
4453
4466
  onSwitch?.();
4454
- }
4467
+ },
4468
+ style: { cursor: "pointer" },
4469
+ children: /* @__PURE__ */ jsx62(
4470
+ ScButton,
4471
+ {
4472
+ text: "Switch Workspace",
4473
+ variant: "secondary",
4474
+ size: "sm",
4475
+ styleVariant: "icon-left",
4476
+ icon: /* @__PURE__ */ jsx62(SiconSwitch3, { className: ScWorkspaceSwitchCard_default.btnIcon })
4477
+ }
4478
+ )
4455
4479
  }
4456
4480
  ),
4457
- showButtons && variant === "settings" && /* @__PURE__ */ jsx62(
4458
- ScButton,
4481
+ isHover && isAdmin && /* @__PURE__ */ jsx62(
4482
+ "div",
4459
4483
  {
4460
- styleVariant: "icon-only",
4461
- variant: "outline",
4462
- size: "sm",
4463
- icon: /* @__PURE__ */ jsx62(SiconSettings3, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4464
4484
  onClick: (e) => {
4465
4485
  e.stopPropagation();
4466
4486
  onSettings?.();
4467
- }
4487
+ },
4488
+ style: { cursor: "pointer" },
4489
+ children: /* @__PURE__ */ jsx62(
4490
+ ScButton,
4491
+ {
4492
+ styleVariant: "icon-only",
4493
+ variant: "outline",
4494
+ size: "sm",
4495
+ icon: /* @__PURE__ */ jsx62(SiconSettings3, { className: ScWorkspaceSwitchCard_default.btnIcon })
4496
+ }
4497
+ )
4468
4498
  }
4469
4499
  )
4470
4500
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/ui",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",