@streamoid/ui 0.2.1 → 0.2.2

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
@@ -1279,7 +1279,8 @@
1279
1279
  .ScButton_scButton.ScButton_state-disabled.ScButton_type-primary.ScButton_variant-error {
1280
1280
  background: var(--alias-fill-error-solidactive, #b01717);
1281
1281
  }
1282
- .ScButton_scButton.ScButton_type-primary.ScButton_variant-error .ScButton_label {
1282
+ .ScButton_scButton.ScButton_type-primary.ScButton_variant-error .ScButton_label,
1283
+ .ScButton_scButton.ScButton_type-primary.ScButton_variant-error .ScButton_container {
1283
1284
  color: var(--alias-text-and-icons-fullwhite, #ffffff);
1284
1285
  }
1285
1286
  .ScButton_scButton.ScButton_type-secondary {
@@ -1291,7 +1292,8 @@
1291
1292
  .ScButton_scButton.ScButton_state-disabled.ScButton_type-secondary {
1292
1293
  background: var(--alias-fill-error-secondary, #1c0404);
1293
1294
  }
1294
- .ScButton_scButton.ScButton_type-secondary .ScButton_label {
1295
+ .ScButton_scButton.ScButton_type-secondary .ScButton_label,
1296
+ .ScButton_scButton.ScButton_type-secondary .ScButton_container {
1295
1297
  color: var(--alias-text-and-icons-errorcont, #eb6b6b);
1296
1298
  }
1297
1299
  .ScButton_scButton.ScButton_type-secondary:hover,
@@ -1313,7 +1315,9 @@
1313
1315
  color: var(--alias-text-and-icons-inverse, #101010);
1314
1316
  }
1315
1317
  .ScButton_scButton.ScButton_variant-tertiary .ScButton_label,
1316
- .ScButton_scButton.ScButton_variant-outline .ScButton_label {
1318
+ .ScButton_scButton.ScButton_variant-outline .ScButton_label,
1319
+ .ScButton_scButton.ScButton_variant-tertiary .ScButton_container,
1320
+ .ScButton_scButton.ScButton_variant-outline .ScButton_container {
1317
1321
  color: var(--alias-text-and-icons-primary, #f5f5f5);
1318
1322
  }
1319
1323
  .ScButton_scButton.ScButton_state-default.ScButton_variant-tertiary,
@@ -1324,7 +1328,8 @@
1324
1328
  .ScButton_scButton.ScButton_state-disabled.ScButton_variant-outline {
1325
1329
  background: unset;
1326
1330
  }
1327
- .ScButton_scButton.ScButton_type-tertiary .ScButton_label {
1331
+ .ScButton_scButton.ScButton_type-tertiary .ScButton_label,
1332
+ .ScButton_scButton.ScButton_type-tertiary .ScButton_container {
1328
1333
  color: var(--alias-text-and-icons-error, #d11a1a);
1329
1334
  }
1330
1335
  .ScButton_scButton.ScButton_type-tertiary:hover,
@@ -1576,11 +1581,15 @@
1576
1581
  background-repeat: repeat;
1577
1582
  }
1578
1583
  .ScButton_scButton.ScButton_state-default.ScButton_variant-primary.ScButton_type-primary .ScButton_label,
1579
- .ScButton_scButton.ScButton_state-disabled.ScButton_variant-primary.ScButton_type-primary .ScButton_label {
1584
+ .ScButton_scButton.ScButton_state-disabled.ScButton_variant-primary.ScButton_type-primary .ScButton_label,
1585
+ .ScButton_scButton.ScButton_state-default.ScButton_variant-primary.ScButton_type-primary .ScButton_container,
1586
+ .ScButton_scButton.ScButton_state-disabled.ScButton_variant-primary.ScButton_type-primary .ScButton_container {
1580
1587
  color: #fffafa;
1581
1588
  }
1582
1589
  .ScButton_scButton.ScButton_variant-primary.ScButton_type-primary:hover .ScButton_label,
1583
- .ScButton_scButton.ScButton_state-hover.ScButton_variant-primary.ScButton_type-primary .ScButton_label {
1590
+ .ScButton_scButton.ScButton_state-hover.ScButton_variant-primary.ScButton_type-primary .ScButton_label,
1591
+ .ScButton_scButton.ScButton_variant-primary.ScButton_type-primary:hover .ScButton_container,
1592
+ .ScButton_scButton.ScButton_state-hover.ScButton_variant-primary.ScButton_type-primary .ScButton_container {
1584
1593
  color: #fffafa;
1585
1594
  }
1586
1595
  .ScButton_scButton.ScButton_variant-primary.ScButton_type-primary:hover,
@@ -1991,6 +2000,64 @@
1991
2000
  position: relative;
1992
2001
  }
1993
2002
 
2003
+ /* src/SC-Dp/ScDp.module.css */
2004
+ .ScDp_scDp,
2005
+ .ScDp_scDp * {
2006
+ box-sizing: border-box;
2007
+ }
2008
+ .ScDp_scDp {
2009
+ position: relative;
2010
+ overflow: hidden;
2011
+ flex-shrink: 0;
2012
+ aspect-ratio: 1;
2013
+ }
2014
+ .ScDp_variantWorkspace {
2015
+ border-radius: var(--radius-md, 8px);
2016
+ }
2017
+ .ScDp_variantProfile {
2018
+ border-radius: var(--radius-full, 999px);
2019
+ }
2020
+ .ScDp_typeInitial {
2021
+ background: var(--alias-fill-neutral-neutralselected, #242424);
2022
+ display: flex;
2023
+ align-items: center;
2024
+ justify-content: center;
2025
+ padding: var(--spacing-none, 0px);
2026
+ }
2027
+ .ScDp_initials {
2028
+ flex: 1;
2029
+ min-width: 0;
2030
+ min-height: 1px;
2031
+ height: 100%;
2032
+ display: flex;
2033
+ flex-direction: column;
2034
+ align-items: center;
2035
+ justify-content: center;
2036
+ overflow: hidden;
2037
+ text-overflow: ellipsis;
2038
+ white-space: nowrap;
2039
+ text-align: center;
2040
+ color: var(--alias-text-and-icons-primary, #f5f5f5);
2041
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
2042
+ font-size: var(--font-size-font-size-md, 1rem);
2043
+ font-weight: 500;
2044
+ line-height: var(--line-height-line-height-md, 1.5rem);
2045
+ }
2046
+ .ScDp_image {
2047
+ position: absolute;
2048
+ inset: 0;
2049
+ width: 100%;
2050
+ height: 100%;
2051
+ object-fit: cover;
2052
+ pointer-events: none;
2053
+ }
2054
+ .ScDp_imageWorkspace {
2055
+ border-radius: var(--radius-md, 8px);
2056
+ }
2057
+ .ScDp_imageProfile {
2058
+ border-radius: var(--radius-full, 999px);
2059
+ }
2060
+
1994
2061
  /* src/SC-Google sign in/ScGoogleSignIn.module.css */
1995
2062
  .ScGoogleSignIn_scGoogleSignIn,
1996
2063
  .ScGoogleSignIn_scGoogleSignIn * {
@@ -4649,55 +4716,55 @@
4649
4716
  width: 100%;
4650
4717
  display: flex;
4651
4718
  align-items: center;
4652
- background: var(--alias-surface-base, #101010);
4653
4719
  border-radius: var(--radius-3xl, 1rem);
4654
- border: 0.5px solid var(--alias-border-subtle, #242424);
4720
+ border-style: solid;
4721
+ border-width: 0.5px;
4655
4722
  padding: var(--spacing-xs, 4px) var(--spacing-3xl, 16px) var(--spacing-xs, 4px) var(--spacing-xs, 4px);
4656
4723
  gap: var(--spacing-3xl, 16px);
4657
4724
  transition: background-color 0.15s ease;
4658
- cursor: pointer;
4659
4725
  }
4660
4726
  .ScWorkspaceSwitchCard_cardCurrent {
4727
+ background: var(--alias-surface-raised, #242424);
4728
+ border-color: var(--alias-border-default, #3e3e3e);
4661
4729
  cursor: default;
4662
4730
  }
4663
- .ScWorkspaceSwitchCard_cardHover {
4731
+ .ScWorkspaceSwitchCard_cardOther {
4732
+ background: var(--alias-surface-base, #101010);
4733
+ border-color: var(--alias-border-subtle, #242424);
4734
+ cursor: pointer;
4735
+ }
4736
+ .ScWorkspaceSwitchCard_cardOtherHover {
4664
4737
  background: var(--alias-surface-basesubtle, #151515);
4665
4738
  }
4666
- .ScWorkspaceSwitchCard_workspaceInfo {
4739
+ .ScWorkspaceSwitchCard_wsInfo {
4667
4740
  display: flex;
4741
+ flex: 1 0 0;
4668
4742
  align-items: center;
4669
- flex: 1;
4670
- min-width: 0;
4671
4743
  gap: var(--spacing-3xl, 16px);
4744
+ min-width: 0;
4745
+ min-height: 1px;
4672
4746
  }
4673
- .ScWorkspaceSwitchCard_avatarWrap {
4674
- flex-shrink: 0;
4675
- display: flex;
4676
- align-items: center;
4677
- }
4678
- .ScWorkspaceSwitchCard_avatarCover {
4679
- flex-shrink: 0 !important;
4680
- }
4681
- .ScWorkspaceSwitchCard_avatarImg {
4682
- width: 60px;
4683
- height: 60px;
4684
- border-radius: var(--radius-xl, 12px);
4685
- object-fit: cover;
4747
+ .ScWorkspaceSwitchCard_dp {
4748
+ width: 90px !important;
4749
+ height: 90px !important;
4686
4750
  }
4687
4751
  .ScWorkspaceSwitchCard_infoCol {
4688
4752
  display: flex;
4689
4753
  flex-direction: column;
4690
- flex: 1;
4754
+ flex: 1 0 0;
4691
4755
  min-width: 0;
4756
+ min-height: 1px;
4757
+ align-items: flex-start;
4692
4758
  padding: var(--spacing-md, 8px) 0;
4693
- gap: var(--spacing-md, 8px);
4759
+ gap: var(--spacing-xl, 12px);
4694
4760
  }
4695
4761
  .ScWorkspaceSwitchCard_wsName {
4696
4762
  margin: 0;
4763
+ width: 100%;
4764
+ flex-shrink: 0;
4697
4765
  overflow: hidden;
4698
4766
  text-overflow: ellipsis;
4699
4767
  white-space: nowrap;
4700
- width: 100%;
4701
4768
  color: var(--alias-text-and-icons-primary, #f5f5f5);
4702
4769
  font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4703
4770
  font-size: var(--font-size-font-size-md, 1rem);
@@ -4708,19 +4775,25 @@
4708
4775
  display: flex;
4709
4776
  align-items: center;
4710
4777
  width: 100%;
4778
+ flex-shrink: 0;
4711
4779
  gap: var(--spacing-5xl, 20px);
4712
4780
  }
4713
4781
  .ScWorkspaceSwitchCard_detailItem {
4714
4782
  display: flex;
4715
4783
  flex-direction: column;
4784
+ align-items: flex-start;
4785
+ justify-content: center;
4716
4786
  flex-shrink: 0;
4717
4787
  white-space: nowrap;
4718
4788
  }
4719
4789
  .ScWorkspaceSwitchCard_detailItemFlex {
4720
4790
  display: flex;
4721
4791
  flex-direction: column;
4722
- flex: 1;
4792
+ align-items: flex-start;
4793
+ justify-content: center;
4794
+ flex: 1 0 0;
4723
4795
  min-width: 0;
4796
+ min-height: 1px;
4724
4797
  white-space: nowrap;
4725
4798
  }
4726
4799
  .ScWorkspaceSwitchCard_detailLabel {
@@ -4732,7 +4805,7 @@
4732
4805
  overflow: hidden;
4733
4806
  text-overflow: ellipsis;
4734
4807
  }
4735
- .ScWorkspaceSwitchCard_detailValueWarning {
4808
+ .ScWorkspaceSwitchCard_detailValueRole {
4736
4809
  color: var(--alias-text-and-icons-warning, #db8b00);
4737
4810
  font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4738
4811
  font-size: var(--font-size-font-size-sm, 0.875rem);
@@ -4747,8 +4820,10 @@
4747
4820
  line-height: var(--line-height-line-height-sm, 1.25rem);
4748
4821
  overflow: hidden;
4749
4822
  text-overflow: ellipsis;
4823
+ width: 100%;
4750
4824
  }
4751
4825
  .ScWorkspaceSwitchCard_vDivider {
4826
+ width: 1px !important;
4752
4827
  height: 24px !important;
4753
4828
  flex-shrink: 0 !important;
4754
4829
  }
package/dist/index.d.mts CHANGED
@@ -91,9 +91,9 @@ interface IScCreditsUsageCardProps extends React.HTMLAttributes<HTMLDivElement>
91
91
  declare const ScCreditsUsageCard: ({ usageLabel, usageText, remainingText, buyButtonText, buyButtonState, onBuyClick, progress, className, ...props }: IScCreditsUsageCardProps) => JSX.Element;
92
92
 
93
93
  interface ScDpProps {
94
- /** Show initials text or an image. Defaults to "initial". */
94
+ /** "initial" shows initials text, "image" shows an image. */
95
95
  type?: "initial" | "image";
96
- /** Circle for profile, rounded rect for workspace. Defaults to "workspace". */
96
+ /** "workspace" = rounded rect, "profile" = circle. */
97
97
  variant?: "workspace" | "profile";
98
98
  /** Initials text (used when type="initial", or as fallback when image fails). */
99
99
  initial?: string;
@@ -566,18 +566,21 @@ interface IScWorkspaceCardProps extends React.HTMLAttributes<HTMLDivElement> {
566
566
  }
567
567
  declare const ScWorkspaceCard: ({ workspaceName, role, userCount, ownerEmail, buttonText, className, ...props }: IScWorkspaceCardProps) => JSX.Element;
568
568
 
569
- interface ScWorkspaceSwitchCardProps {
570
- name: string;
571
- initials?: string;
572
- imageUrl?: string;
569
+ interface NscWorkspaceSwitchProps {
570
+ wsName?: string;
573
571
  role?: string;
574
572
  plan?: string;
575
- ownerEmail?: string;
576
- isCurrent?: boolean;
573
+ ownerId?: string;
574
+ initials?: string;
575
+ imageUrl?: string;
576
+ type?: "currentWS" | "otherWS";
577
577
  variant?: "switch" | "settings";
578
+ hover?: boolean;
579
+ className?: string;
578
580
  onSwitch?: () => void;
579
581
  onSettings?: () => void;
580
582
  }
581
- declare function ScWorkspaceSwitchCard({ name, initials, imageUrl, role, plan, ownerEmail, isCurrent, variant, onSwitch, onSettings, }: ScWorkspaceSwitchCardProps): react_jsx_runtime.JSX.Element;
583
+ declare function NscWorkspaceSwitch({ wsName, role, plan, ownerId, initials, imageUrl, type, variant, hover, className, onSwitch, onSettings, }: NscWorkspaceSwitchProps): react_jsx_runtime.JSX.Element;
584
+ declare const ScWorkspaceSwitchCard: typeof NscWorkspaceSwitch;
582
585
 
583
- 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, 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 ScWorkspaceSwitchCardProps, type SidebarConfig, type SidebarIconContext, type SidebarIconMap, type SidebarIconRenderer, type SidebarMenuItemConfig, type SidebarProfileConfig, type SidebarSectionConfig, StreamoidSidebar, type StreamoidSidebarProps, StreamoidWorkspaceSwitcher, type StreamoidWorkspaceSwitcherProps, type WorkspaceSwitcherConfig, type WorkspaceSwitcherItem };
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
@@ -91,9 +91,9 @@ interface IScCreditsUsageCardProps extends React.HTMLAttributes<HTMLDivElement>
91
91
  declare const ScCreditsUsageCard: ({ usageLabel, usageText, remainingText, buyButtonText, buyButtonState, onBuyClick, progress, className, ...props }: IScCreditsUsageCardProps) => JSX.Element;
92
92
 
93
93
  interface ScDpProps {
94
- /** Show initials text or an image. Defaults to "initial". */
94
+ /** "initial" shows initials text, "image" shows an image. */
95
95
  type?: "initial" | "image";
96
- /** Circle for profile, rounded rect for workspace. Defaults to "workspace". */
96
+ /** "workspace" = rounded rect, "profile" = circle. */
97
97
  variant?: "workspace" | "profile";
98
98
  /** Initials text (used when type="initial", or as fallback when image fails). */
99
99
  initial?: string;
@@ -566,18 +566,21 @@ interface IScWorkspaceCardProps extends React.HTMLAttributes<HTMLDivElement> {
566
566
  }
567
567
  declare const ScWorkspaceCard: ({ workspaceName, role, userCount, ownerEmail, buttonText, className, ...props }: IScWorkspaceCardProps) => JSX.Element;
568
568
 
569
- interface ScWorkspaceSwitchCardProps {
570
- name: string;
571
- initials?: string;
572
- imageUrl?: string;
569
+ interface NscWorkspaceSwitchProps {
570
+ wsName?: string;
573
571
  role?: string;
574
572
  plan?: string;
575
- ownerEmail?: string;
576
- isCurrent?: boolean;
573
+ ownerId?: string;
574
+ initials?: string;
575
+ imageUrl?: string;
576
+ type?: "currentWS" | "otherWS";
577
577
  variant?: "switch" | "settings";
578
+ hover?: boolean;
579
+ className?: string;
578
580
  onSwitch?: () => void;
579
581
  onSettings?: () => void;
580
582
  }
581
- declare function ScWorkspaceSwitchCard({ name, initials, imageUrl, role, plan, ownerEmail, isCurrent, variant, onSwitch, onSettings, }: ScWorkspaceSwitchCardProps): react_jsx_runtime.JSX.Element;
583
+ declare function NscWorkspaceSwitch({ wsName, role, plan, ownerId, initials, imageUrl, type, variant, hover, className, onSwitch, onSettings, }: NscWorkspaceSwitchProps): react_jsx_runtime.JSX.Element;
584
+ declare const ScWorkspaceSwitchCard: typeof NscWorkspaceSwitch;
582
585
 
583
- 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, 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 ScWorkspaceSwitchCardProps, type SidebarConfig, type SidebarIconContext, type SidebarIconMap, type SidebarIconRenderer, type SidebarMenuItemConfig, type SidebarProfileConfig, type SidebarSectionConfig, StreamoidSidebar, type StreamoidSidebarProps, StreamoidWorkspaceSwitcher, type StreamoidWorkspaceSwitcherProps, type WorkspaceSwitcherConfig, type WorkspaceSwitcherItem };
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
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ NscWorkspaceSwitch: () => NscWorkspaceSwitch,
23
24
  ScAccess: () => ScAccess,
24
25
  ScAppCard: () => ScAppCard,
25
26
  ScAppField: () => ScAppField,
@@ -621,6 +622,8 @@ var ScButton = ({
621
622
  ctx.putImageData(imageData, 0, 0);
622
623
  return canvas.toDataURL("image/png");
623
624
  }, [variant, type, state]);
625
+ const strokeWidth = size === "sm" ? 1.25 : 1.5;
626
+ const styledIcon = (0, import_react.isValidElement)(icon) ? (0, import_react.cloneElement)(icon, { color: "currentColor", strokeWidth }) : icon;
624
627
  const variantsClassName = ScButton_default["style-variant-" + styleVariant] + " " + ScButton_default["state-" + state] + " " + ScButton_default["variant-" + variant] + " " + ScButton_default["type-" + type] + " " + ScButton_default["size-" + size];
625
628
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
626
629
  "div",
@@ -636,12 +639,12 @@ var ScButton = ({
636
639
  }
637
640
  ),
638
641
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: ScButton_default.container, children: [
639
- (styleVariant === "icon-left" || styleVariant === "icon-only") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: icon }),
642
+ (styleVariant === "icon-left" || styleVariant === "icon-only") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: styledIcon }),
640
643
  (styleVariant === "default" || styleVariant === "icon-right" || styleVariant === "icon-left") && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: ScButton_default.label, children: [
641
644
  text,
642
645
  " "
643
646
  ] }) }),
644
- styleVariant === "icon-right" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: icon })
647
+ styleVariant === "icon-right" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: styledIcon })
645
648
  ] })
646
649
  ]
647
650
  }
@@ -960,6 +963,20 @@ var ScCreditsUsageCard = ({
960
963
 
961
964
  // src/SC-Dp/ScDp.tsx
962
965
  var import_react2 = require("react");
966
+
967
+ // src/SC-Dp/ScDp.module.css
968
+ var ScDp_default = {
969
+ scDp: "ScDp_scDp",
970
+ variantWorkspace: "ScDp_variantWorkspace",
971
+ variantProfile: "ScDp_variantProfile",
972
+ typeInitial: "ScDp_typeInitial",
973
+ initials: "ScDp_initials",
974
+ image: "ScDp_image",
975
+ imageWorkspace: "ScDp_imageWorkspace",
976
+ imageProfile: "ScDp_imageProfile"
977
+ };
978
+
979
+ // src/SC-Dp/ScDp.tsx
963
980
  var import_jsx_runtime16 = require("react/jsx-runtime");
964
981
  function ScDp({
965
982
  type = "initial",
@@ -972,61 +989,27 @@ function ScDp({
972
989
  }) {
973
990
  const [imageFailed, setImageFailed] = (0, import_react2.useState)(false);
974
991
  const isProfile = variant === "profile";
975
- const borderRadius = isProfile ? "var(--radius-full)" : "var(--radius-md)";
976
992
  const showImage = type === "image" && imageUrl && !imageFailed;
977
- const containerStyle = {
993
+ const containerClass = [
994
+ ScDp_default.scDp,
995
+ isProfile ? ScDp_default.variantProfile : ScDp_default.variantWorkspace,
996
+ !showImage ? ScDp_default.typeInitial : "",
997
+ className || ""
998
+ ].filter(Boolean).join(" ");
999
+ const sizeStyle = {
978
1000
  width: size,
979
1001
  height: size,
980
- borderRadius,
981
- position: "relative",
982
- overflow: "hidden",
983
- flexShrink: 0,
984
- ...showImage ? {} : {
985
- backgroundColor: "var(--alias-fill-neutral-neutralselected)",
986
- display: "flex",
987
- alignItems: "center",
988
- justifyContent: "center"
989
- },
990
1002
  ...style
991
1003
  };
992
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className, style: containerStyle, children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1004
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: containerClass, style: sizeStyle, children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
993
1005
  "img",
994
1006
  {
995
1007
  src: imageUrl,
996
1008
  alt: "",
997
- style: {
998
- position: "absolute",
999
- inset: 0,
1000
- width: "100%",
1001
- height: "100%",
1002
- objectFit: "cover",
1003
- pointerEvents: "none"
1004
- },
1009
+ className: ScDp_default.image + " " + (isProfile ? ScDp_default.imageProfile : ScDp_default.imageWorkspace),
1005
1010
  onError: () => setImageFailed(true)
1006
1011
  }
1007
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1008
- "div",
1009
- {
1010
- style: {
1011
- flex: 1,
1012
- minWidth: 0,
1013
- minHeight: 0,
1014
- display: "flex",
1015
- alignItems: "center",
1016
- justifyContent: "center",
1017
- overflow: "hidden",
1018
- textOverflow: "ellipsis",
1019
- whiteSpace: "nowrap",
1020
- color: "var(--alias-text---icons-primary)",
1021
- fontFamily: "var(--font-family-font-family-body)",
1022
- fontSize: size <= 32 ? `${size * 0.4}px` : "var(--font-size-font-size-md)",
1023
- fontWeight: 500,
1024
- lineHeight: 1,
1025
- textAlign: "center"
1026
- },
1027
- children: initial
1028
- }
1029
- ) });
1012
+ ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: ScDp_default.initials, children: initial }) });
1030
1013
  }
1031
1014
 
1032
1015
  // src/SC-Google sign in/ScGoogleSignIn.module.css
@@ -4450,18 +4433,17 @@ var import_icons53 = require("@streamoid/icons");
4450
4433
  var ScWorkspaceSwitchCard_default = {
4451
4434
  card: "ScWorkspaceSwitchCard_card",
4452
4435
  cardCurrent: "ScWorkspaceSwitchCard_cardCurrent",
4453
- cardHover: "ScWorkspaceSwitchCard_cardHover",
4454
- workspaceInfo: "ScWorkspaceSwitchCard_workspaceInfo",
4455
- avatarWrap: "ScWorkspaceSwitchCard_avatarWrap",
4456
- avatarCover: "ScWorkspaceSwitchCard_avatarCover",
4457
- avatarImg: "ScWorkspaceSwitchCard_avatarImg",
4436
+ cardOther: "ScWorkspaceSwitchCard_cardOther",
4437
+ cardOtherHover: "ScWorkspaceSwitchCard_cardOtherHover",
4438
+ wsInfo: "ScWorkspaceSwitchCard_wsInfo",
4439
+ dp: "ScWorkspaceSwitchCard_dp",
4458
4440
  infoCol: "ScWorkspaceSwitchCard_infoCol",
4459
4441
  wsName: "ScWorkspaceSwitchCard_wsName",
4460
4442
  detailsRow: "ScWorkspaceSwitchCard_detailsRow",
4461
4443
  detailItem: "ScWorkspaceSwitchCard_detailItem",
4462
4444
  detailItemFlex: "ScWorkspaceSwitchCard_detailItemFlex",
4463
4445
  detailLabel: "ScWorkspaceSwitchCard_detailLabel",
4464
- detailValueWarning: "ScWorkspaceSwitchCard_detailValueWarning",
4446
+ detailValueRole: "ScWorkspaceSwitchCard_detailValueRole",
4465
4447
  detailValueSecondary: "ScWorkspaceSwitchCard_detailValueSecondary",
4466
4448
  vDivider: "ScWorkspaceSwitchCard_vDivider",
4467
4449
  btnIcon: "ScWorkspaceSwitchCard_btnIcon"
@@ -4469,67 +4451,70 @@ var ScWorkspaceSwitchCard_default = {
4469
4451
 
4470
4452
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4471
4453
  var import_jsx_runtime63 = require("react/jsx-runtime");
4472
- function deriveInitials2(name) {
4473
- return name.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4474
- }
4475
- function ScWorkspaceSwitchCard({
4476
- name,
4454
+ function NscWorkspaceSwitch({
4455
+ wsName = "Workspace name is kepler",
4456
+ role = "Admin",
4457
+ plan = "Free",
4458
+ ownerId = "rohan@streamoid.com",
4477
4459
  initials,
4478
4460
  imageUrl,
4479
- role,
4480
- plan,
4481
- ownerEmail,
4482
- isCurrent = false,
4461
+ type = "currentWS",
4483
4462
  variant = "switch",
4463
+ hover,
4464
+ className,
4484
4465
  onSwitch,
4485
4466
  onSettings
4486
4467
  }) {
4487
- const [hovered, setHovered] = (0, import_react5.useState)(false);
4488
- const showButtons = !isCurrent && hovered;
4489
- const displayInitials = initials || deriveInitials2(name);
4490
- const isAdmin = role?.toLowerCase() === "admin";
4491
- const roleText = isAdmin ? "Admin" : "Member";
4468
+ const [internalHover, setInternalHover] = (0, import_react5.useState)(false);
4469
+ const isHover = hover !== void 0 ? hover : internalHover;
4470
+ const isCurrent = type === "currentWS";
4471
+ const isOther = type === "otherWS";
4472
+ const showButtons = isHover && isOther;
4473
+ const displayInitials = initials || wsName.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4492
4474
  const cardClass = [
4493
4475
  ScWorkspaceSwitchCard_default.card,
4494
- isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : "",
4495
- hovered && !isCurrent ? ScWorkspaceSwitchCard_default.cardHover : ""
4476
+ isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : ScWorkspaceSwitchCard_default.cardOther,
4477
+ showButtons ? ScWorkspaceSwitchCard_default.cardOtherHover : "",
4478
+ className || ""
4496
4479
  ].filter(Boolean).join(" ");
4480
+ const dpBg = isCurrent ? "var(--alias-fill-neutral-neutralactive, #313131)" : "var(--alias-fill-neutral-neutralselected, #242424)";
4497
4481
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4498
4482
  "div",
4499
4483
  {
4500
4484
  className: cardClass,
4501
- onMouseEnter: () => !isCurrent && setHovered(true),
4502
- onMouseLeave: () => setHovered(false),
4503
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.workspaceInfo, children: [
4504
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: ScWorkspaceSwitchCard_default.avatarWrap, children: imageUrl ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("img", { src: imageUrl, alt: name, className: ScWorkspaceSwitchCard_default.avatarImg }) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4505
- ScIntialProfileCover,
4485
+ onMouseEnter: () => isOther && setInternalHover(true),
4486
+ onMouseLeave: () => setInternalHover(false),
4487
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.wsInfo, children: [
4488
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4489
+ ScDp,
4506
4490
  {
4507
- intial: displayInitials,
4508
- className: ScWorkspaceSwitchCard_default.avatarCover
4491
+ type: imageUrl ? "image" : "initial",
4492
+ variant: "workspace",
4493
+ initial: displayInitials,
4494
+ imageUrl,
4495
+ className: ScWorkspaceSwitchCard_default.dp,
4496
+ style: {
4497
+ backgroundColor: dpBg,
4498
+ borderRadius: "var(--radius-xl, 12px)"
4499
+ }
4509
4500
  }
4510
- ) }),
4501
+ ),
4511
4502
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.infoCol, children: [
4512
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: ScWorkspaceSwitchCard_default.wsName, children: name }),
4503
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: ScWorkspaceSwitchCard_default.wsName, children: wsName }),
4513
4504
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailsRow, children: [
4514
4505
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4515
4506
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Role" }),
4516
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4517
- "span",
4518
- {
4519
- className: isAdmin ? ScWorkspaceSwitchCard_default.detailValueWarning : ScWorkspaceSwitchCard_default.detailValueSecondary,
4520
- children: roleText
4521
- }
4522
- )
4507
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailValueRole, children: role })
4523
4508
  ] }),
4524
4509
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4525
4510
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4526
4511
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Plan" }),
4527
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: plan || "\u2013" })
4512
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: plan })
4528
4513
  ] }),
4529
4514
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4530
4515
  /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItemFlex, children: [
4531
4516
  /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Workspace Owner" }),
4532
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: ownerEmail || "\u2013" })
4517
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: ownerId })
4533
4518
  ] })
4534
4519
  ] })
4535
4520
  ] }),
@@ -4537,6 +4522,7 @@ function ScWorkspaceSwitchCard({
4537
4522
  ScButton,
4538
4523
  {
4539
4524
  text: "Switch Workspace",
4525
+ variant: "secondary",
4540
4526
  size: "sm",
4541
4527
  styleVariant: "icon-left",
4542
4528
  icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSwitch, { className: ScWorkspaceSwitchCard_default.btnIcon }),
@@ -4563,3 +4549,4 @@ function ScWorkspaceSwitchCard({
4563
4549
  }
4564
4550
  );
4565
4551
  }
4552
+ var ScWorkspaceSwitchCard = NscWorkspaceSwitch;
package/dist/index.mjs CHANGED
@@ -455,7 +455,7 @@ var ScButton_default = {
455
455
 
456
456
  // src/SC-Button/ScButton.tsx
457
457
  import { SiconHome as SiconHome2 } from "@streamoid/icons";
458
- import { useMemo } from "react";
458
+ import { useMemo, isValidElement, cloneElement } from "react";
459
459
  import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
460
460
  if (typeof window !== "undefined" && CSS.registerProperty) {
461
461
  const props = [
@@ -534,6 +534,8 @@ var ScButton = ({
534
534
  ctx.putImageData(imageData, 0, 0);
535
535
  return canvas.toDataURL("image/png");
536
536
  }, [variant, type, state]);
537
+ const strokeWidth = size === "sm" ? 1.25 : 1.5;
538
+ const styledIcon = isValidElement(icon) ? cloneElement(icon, { color: "currentColor", strokeWidth }) : icon;
537
539
  const variantsClassName = ScButton_default["style-variant-" + styleVariant] + " " + ScButton_default["state-" + state] + " " + ScButton_default["variant-" + variant] + " " + ScButton_default["type-" + type] + " " + ScButton_default["size-" + size];
538
540
  return /* @__PURE__ */ jsxs8(
539
541
  "div",
@@ -549,12 +551,12 @@ var ScButton = ({
549
551
  }
550
552
  ),
551
553
  /* @__PURE__ */ jsxs8("div", { className: ScButton_default.container, children: [
552
- (styleVariant === "icon-left" || styleVariant === "icon-only") && /* @__PURE__ */ jsx9(Fragment3, { children: icon }),
554
+ (styleVariant === "icon-left" || styleVariant === "icon-only") && /* @__PURE__ */ jsx9(Fragment3, { children: styledIcon }),
553
555
  (styleVariant === "default" || styleVariant === "icon-right" || styleVariant === "icon-left") && /* @__PURE__ */ jsx9(Fragment3, { children: /* @__PURE__ */ jsxs8("div", { className: ScButton_default.label, children: [
554
556
  text,
555
557
  " "
556
558
  ] }) }),
557
- styleVariant === "icon-right" && /* @__PURE__ */ jsx9(Fragment3, { children: icon })
559
+ styleVariant === "icon-right" && /* @__PURE__ */ jsx9(Fragment3, { children: styledIcon })
558
560
  ] })
559
561
  ]
560
562
  }
@@ -873,6 +875,20 @@ var ScCreditsUsageCard = ({
873
875
 
874
876
  // src/SC-Dp/ScDp.tsx
875
877
  import { useState } from "react";
878
+
879
+ // src/SC-Dp/ScDp.module.css
880
+ var ScDp_default = {
881
+ scDp: "ScDp_scDp",
882
+ variantWorkspace: "ScDp_variantWorkspace",
883
+ variantProfile: "ScDp_variantProfile",
884
+ typeInitial: "ScDp_typeInitial",
885
+ initials: "ScDp_initials",
886
+ image: "ScDp_image",
887
+ imageWorkspace: "ScDp_imageWorkspace",
888
+ imageProfile: "ScDp_imageProfile"
889
+ };
890
+
891
+ // src/SC-Dp/ScDp.tsx
876
892
  import { jsx as jsx15 } from "react/jsx-runtime";
877
893
  function ScDp({
878
894
  type = "initial",
@@ -885,61 +901,27 @@ function ScDp({
885
901
  }) {
886
902
  const [imageFailed, setImageFailed] = useState(false);
887
903
  const isProfile = variant === "profile";
888
- const borderRadius = isProfile ? "var(--radius-full)" : "var(--radius-md)";
889
904
  const showImage = type === "image" && imageUrl && !imageFailed;
890
- const containerStyle = {
905
+ const containerClass = [
906
+ ScDp_default.scDp,
907
+ isProfile ? ScDp_default.variantProfile : ScDp_default.variantWorkspace,
908
+ !showImage ? ScDp_default.typeInitial : "",
909
+ className || ""
910
+ ].filter(Boolean).join(" ");
911
+ const sizeStyle = {
891
912
  width: size,
892
913
  height: size,
893
- borderRadius,
894
- position: "relative",
895
- overflow: "hidden",
896
- flexShrink: 0,
897
- ...showImage ? {} : {
898
- backgroundColor: "var(--alias-fill-neutral-neutralselected)",
899
- display: "flex",
900
- alignItems: "center",
901
- justifyContent: "center"
902
- },
903
914
  ...style
904
915
  };
905
- return /* @__PURE__ */ jsx15("div", { className, style: containerStyle, children: showImage ? /* @__PURE__ */ jsx15(
916
+ return /* @__PURE__ */ jsx15("div", { className: containerClass, style: sizeStyle, children: showImage ? /* @__PURE__ */ jsx15(
906
917
  "img",
907
918
  {
908
919
  src: imageUrl,
909
920
  alt: "",
910
- style: {
911
- position: "absolute",
912
- inset: 0,
913
- width: "100%",
914
- height: "100%",
915
- objectFit: "cover",
916
- pointerEvents: "none"
917
- },
921
+ className: ScDp_default.image + " " + (isProfile ? ScDp_default.imageProfile : ScDp_default.imageWorkspace),
918
922
  onError: () => setImageFailed(true)
919
923
  }
920
- ) : /* @__PURE__ */ jsx15(
921
- "div",
922
- {
923
- style: {
924
- flex: 1,
925
- minWidth: 0,
926
- minHeight: 0,
927
- display: "flex",
928
- alignItems: "center",
929
- justifyContent: "center",
930
- overflow: "hidden",
931
- textOverflow: "ellipsis",
932
- whiteSpace: "nowrap",
933
- color: "var(--alias-text---icons-primary)",
934
- fontFamily: "var(--font-family-font-family-body)",
935
- fontSize: size <= 32 ? `${size * 0.4}px` : "var(--font-size-font-size-md)",
936
- fontWeight: 500,
937
- lineHeight: 1,
938
- textAlign: "center"
939
- },
940
- children: initial
941
- }
942
- ) });
924
+ ) : /* @__PURE__ */ jsx15("div", { className: ScDp_default.initials, children: initial }) });
943
925
  }
944
926
 
945
927
  // src/SC-Google sign in/ScGoogleSignIn.module.css
@@ -4373,18 +4355,17 @@ import { SiconSwitch as SiconSwitch3, SiconSettings as SiconSettings3 } from "@s
4373
4355
  var ScWorkspaceSwitchCard_default = {
4374
4356
  card: "ScWorkspaceSwitchCard_card",
4375
4357
  cardCurrent: "ScWorkspaceSwitchCard_cardCurrent",
4376
- cardHover: "ScWorkspaceSwitchCard_cardHover",
4377
- workspaceInfo: "ScWorkspaceSwitchCard_workspaceInfo",
4378
- avatarWrap: "ScWorkspaceSwitchCard_avatarWrap",
4379
- avatarCover: "ScWorkspaceSwitchCard_avatarCover",
4380
- avatarImg: "ScWorkspaceSwitchCard_avatarImg",
4358
+ cardOther: "ScWorkspaceSwitchCard_cardOther",
4359
+ cardOtherHover: "ScWorkspaceSwitchCard_cardOtherHover",
4360
+ wsInfo: "ScWorkspaceSwitchCard_wsInfo",
4361
+ dp: "ScWorkspaceSwitchCard_dp",
4381
4362
  infoCol: "ScWorkspaceSwitchCard_infoCol",
4382
4363
  wsName: "ScWorkspaceSwitchCard_wsName",
4383
4364
  detailsRow: "ScWorkspaceSwitchCard_detailsRow",
4384
4365
  detailItem: "ScWorkspaceSwitchCard_detailItem",
4385
4366
  detailItemFlex: "ScWorkspaceSwitchCard_detailItemFlex",
4386
4367
  detailLabel: "ScWorkspaceSwitchCard_detailLabel",
4387
- detailValueWarning: "ScWorkspaceSwitchCard_detailValueWarning",
4368
+ detailValueRole: "ScWorkspaceSwitchCard_detailValueRole",
4388
4369
  detailValueSecondary: "ScWorkspaceSwitchCard_detailValueSecondary",
4389
4370
  vDivider: "ScWorkspaceSwitchCard_vDivider",
4390
4371
  btnIcon: "ScWorkspaceSwitchCard_btnIcon"
@@ -4392,67 +4373,70 @@ var ScWorkspaceSwitchCard_default = {
4392
4373
 
4393
4374
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4394
4375
  import { jsx as jsx62, jsxs as jsxs53 } from "react/jsx-runtime";
4395
- function deriveInitials2(name) {
4396
- return name.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4397
- }
4398
- function ScWorkspaceSwitchCard({
4399
- name,
4376
+ function NscWorkspaceSwitch({
4377
+ wsName = "Workspace name is kepler",
4378
+ role = "Admin",
4379
+ plan = "Free",
4380
+ ownerId = "rohan@streamoid.com",
4400
4381
  initials,
4401
4382
  imageUrl,
4402
- role,
4403
- plan,
4404
- ownerEmail,
4405
- isCurrent = false,
4383
+ type = "currentWS",
4406
4384
  variant = "switch",
4385
+ hover,
4386
+ className,
4407
4387
  onSwitch,
4408
4388
  onSettings
4409
4389
  }) {
4410
- const [hovered, setHovered] = useState2(false);
4411
- const showButtons = !isCurrent && hovered;
4412
- const displayInitials = initials || deriveInitials2(name);
4413
- const isAdmin = role?.toLowerCase() === "admin";
4414
- const roleText = isAdmin ? "Admin" : "Member";
4390
+ const [internalHover, setInternalHover] = useState2(false);
4391
+ const isHover = hover !== void 0 ? hover : internalHover;
4392
+ const isCurrent = type === "currentWS";
4393
+ const isOther = type === "otherWS";
4394
+ const showButtons = isHover && isOther;
4395
+ const displayInitials = initials || wsName.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4415
4396
  const cardClass = [
4416
4397
  ScWorkspaceSwitchCard_default.card,
4417
- isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : "",
4418
- hovered && !isCurrent ? ScWorkspaceSwitchCard_default.cardHover : ""
4398
+ isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : ScWorkspaceSwitchCard_default.cardOther,
4399
+ showButtons ? ScWorkspaceSwitchCard_default.cardOtherHover : "",
4400
+ className || ""
4419
4401
  ].filter(Boolean).join(" ");
4402
+ const dpBg = isCurrent ? "var(--alias-fill-neutral-neutralactive, #313131)" : "var(--alias-fill-neutral-neutralselected, #242424)";
4420
4403
  return /* @__PURE__ */ jsx62(
4421
4404
  "div",
4422
4405
  {
4423
4406
  className: cardClass,
4424
- onMouseEnter: () => !isCurrent && setHovered(true),
4425
- onMouseLeave: () => setHovered(false),
4426
- children: /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.workspaceInfo, children: [
4427
- /* @__PURE__ */ jsx62("div", { className: ScWorkspaceSwitchCard_default.avatarWrap, children: imageUrl ? /* @__PURE__ */ jsx62("img", { src: imageUrl, alt: name, className: ScWorkspaceSwitchCard_default.avatarImg }) : /* @__PURE__ */ jsx62(
4428
- ScIntialProfileCover,
4407
+ onMouseEnter: () => isOther && setInternalHover(true),
4408
+ onMouseLeave: () => setInternalHover(false),
4409
+ children: /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.wsInfo, children: [
4410
+ /* @__PURE__ */ jsx62(
4411
+ ScDp,
4429
4412
  {
4430
- intial: displayInitials,
4431
- className: ScWorkspaceSwitchCard_default.avatarCover
4413
+ type: imageUrl ? "image" : "initial",
4414
+ variant: "workspace",
4415
+ initial: displayInitials,
4416
+ imageUrl,
4417
+ className: ScWorkspaceSwitchCard_default.dp,
4418
+ style: {
4419
+ backgroundColor: dpBg,
4420
+ borderRadius: "var(--radius-xl, 12px)"
4421
+ }
4432
4422
  }
4433
- ) }),
4423
+ ),
4434
4424
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.infoCol, children: [
4435
- /* @__PURE__ */ jsx62("p", { className: ScWorkspaceSwitchCard_default.wsName, children: name }),
4425
+ /* @__PURE__ */ jsx62("p", { className: ScWorkspaceSwitchCard_default.wsName, children: wsName }),
4436
4426
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailsRow, children: [
4437
4427
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4438
4428
  /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Role" }),
4439
- /* @__PURE__ */ jsx62(
4440
- "span",
4441
- {
4442
- className: isAdmin ? ScWorkspaceSwitchCard_default.detailValueWarning : ScWorkspaceSwitchCard_default.detailValueSecondary,
4443
- children: roleText
4444
- }
4445
- )
4429
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueRole, children: role })
4446
4430
  ] }),
4447
4431
  /* @__PURE__ */ jsx62(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4448
4432
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4449
4433
  /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Plan" }),
4450
- /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: plan || "\u2013" })
4434
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: plan })
4451
4435
  ] }),
4452
4436
  /* @__PURE__ */ jsx62(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4453
4437
  /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItemFlex, children: [
4454
4438
  /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Workspace Owner" }),
4455
- /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: ownerEmail || "\u2013" })
4439
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: ownerId })
4456
4440
  ] })
4457
4441
  ] })
4458
4442
  ] }),
@@ -4460,6 +4444,7 @@ function ScWorkspaceSwitchCard({
4460
4444
  ScButton,
4461
4445
  {
4462
4446
  text: "Switch Workspace",
4447
+ variant: "secondary",
4463
4448
  size: "sm",
4464
4449
  styleVariant: "icon-left",
4465
4450
  icon: /* @__PURE__ */ jsx62(SiconSwitch3, { className: ScWorkspaceSwitchCard_default.btnIcon }),
@@ -4486,7 +4471,9 @@ function ScWorkspaceSwitchCard({
4486
4471
  }
4487
4472
  );
4488
4473
  }
4474
+ var ScWorkspaceSwitchCard = NscWorkspaceSwitch;
4489
4475
  export {
4476
+ NscWorkspaceSwitch,
4490
4477
  ScAccess,
4491
4478
  ScAppCard,
4492
4479
  ScAppField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/ui",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "react-dom": "^18.0.0"
24
24
  },
25
25
  "dependencies": {
26
- "@streamoid/icons": "^0.1.2"
26
+ "@streamoid/icons": "^0.2.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/react": "^18.0.0",