@streamoid/ui 0.2.0 → 0.2.1

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
@@ -4639,3 +4639,120 @@
4639
4639
  .ScWorkspaceCard_scWorkspaceCard.ScWorkspaceCard_current-workspace-false .ScWorkspaceCard_scButtonInstance2 {
4640
4640
  width: unset !important;
4641
4641
  }
4642
+
4643
+ /* src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css */
4644
+ .ScWorkspaceSwitchCard_card,
4645
+ .ScWorkspaceSwitchCard_card * {
4646
+ box-sizing: border-box;
4647
+ }
4648
+ .ScWorkspaceSwitchCard_card {
4649
+ width: 100%;
4650
+ display: flex;
4651
+ align-items: center;
4652
+ background: var(--alias-surface-base, #101010);
4653
+ border-radius: var(--radius-3xl, 1rem);
4654
+ border: 0.5px solid var(--alias-border-subtle, #242424);
4655
+ padding: var(--spacing-xs, 4px) var(--spacing-3xl, 16px) var(--spacing-xs, 4px) var(--spacing-xs, 4px);
4656
+ gap: var(--spacing-3xl, 16px);
4657
+ transition: background-color 0.15s ease;
4658
+ cursor: pointer;
4659
+ }
4660
+ .ScWorkspaceSwitchCard_cardCurrent {
4661
+ cursor: default;
4662
+ }
4663
+ .ScWorkspaceSwitchCard_cardHover {
4664
+ background: var(--alias-surface-basesubtle, #151515);
4665
+ }
4666
+ .ScWorkspaceSwitchCard_workspaceInfo {
4667
+ display: flex;
4668
+ align-items: center;
4669
+ flex: 1;
4670
+ min-width: 0;
4671
+ gap: var(--spacing-3xl, 16px);
4672
+ }
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;
4686
+ }
4687
+ .ScWorkspaceSwitchCard_infoCol {
4688
+ display: flex;
4689
+ flex-direction: column;
4690
+ flex: 1;
4691
+ min-width: 0;
4692
+ padding: var(--spacing-md, 8px) 0;
4693
+ gap: var(--spacing-md, 8px);
4694
+ }
4695
+ .ScWorkspaceSwitchCard_wsName {
4696
+ margin: 0;
4697
+ overflow: hidden;
4698
+ text-overflow: ellipsis;
4699
+ white-space: nowrap;
4700
+ width: 100%;
4701
+ color: var(--alias-text-and-icons-primary, #f5f5f5);
4702
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4703
+ font-size: var(--font-size-font-size-md, 1rem);
4704
+ font-weight: 500;
4705
+ line-height: var(--line-height-line-height-md, 1.5rem);
4706
+ }
4707
+ .ScWorkspaceSwitchCard_detailsRow {
4708
+ display: flex;
4709
+ align-items: center;
4710
+ width: 100%;
4711
+ gap: var(--spacing-5xl, 20px);
4712
+ }
4713
+ .ScWorkspaceSwitchCard_detailItem {
4714
+ display: flex;
4715
+ flex-direction: column;
4716
+ flex-shrink: 0;
4717
+ white-space: nowrap;
4718
+ }
4719
+ .ScWorkspaceSwitchCard_detailItemFlex {
4720
+ display: flex;
4721
+ flex-direction: column;
4722
+ flex: 1;
4723
+ min-width: 0;
4724
+ white-space: nowrap;
4725
+ }
4726
+ .ScWorkspaceSwitchCard_detailLabel {
4727
+ color: var(--alias-text-and-icons-disabled, #5c5c5c);
4728
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4729
+ font-size: var(--font-size-font-size-xs, 0.75rem);
4730
+ font-weight: 400;
4731
+ line-height: var(--line-height-line-height-xs, 1.125rem);
4732
+ overflow: hidden;
4733
+ text-overflow: ellipsis;
4734
+ }
4735
+ .ScWorkspaceSwitchCard_detailValueWarning {
4736
+ color: var(--alias-text-and-icons-warning, #db8b00);
4737
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4738
+ font-size: var(--font-size-font-size-sm, 0.875rem);
4739
+ font-weight: 500;
4740
+ line-height: var(--line-height-line-height-sm, 1.25rem);
4741
+ }
4742
+ .ScWorkspaceSwitchCard_detailValueSecondary {
4743
+ color: var(--alias-text-and-icons-secondary, #dadada);
4744
+ font-family: var(--font-family-font-family-body, "Inter", sans-serif);
4745
+ font-size: var(--font-size-font-size-sm, 0.875rem);
4746
+ font-weight: 400;
4747
+ line-height: var(--line-height-line-height-sm, 1.25rem);
4748
+ overflow: hidden;
4749
+ text-overflow: ellipsis;
4750
+ }
4751
+ .ScWorkspaceSwitchCard_vDivider {
4752
+ height: 24px !important;
4753
+ flex-shrink: 0 !important;
4754
+ }
4755
+ .ScWorkspaceSwitchCard_btnIcon {
4756
+ width: 1rem !important;
4757
+ height: 1rem !important;
4758
+ }
package/dist/index.js CHANGED
@@ -4445,29 +4445,33 @@ var ScWorkspaceCard = ({
4445
4445
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4446
4446
  var import_react5 = require("react");
4447
4447
  var import_icons53 = require("@streamoid/icons");
4448
+
4449
+ // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css
4450
+ var ScWorkspaceSwitchCard_default = {
4451
+ card: "ScWorkspaceSwitchCard_card",
4452
+ cardCurrent: "ScWorkspaceSwitchCard_cardCurrent",
4453
+ cardHover: "ScWorkspaceSwitchCard_cardHover",
4454
+ workspaceInfo: "ScWorkspaceSwitchCard_workspaceInfo",
4455
+ avatarWrap: "ScWorkspaceSwitchCard_avatarWrap",
4456
+ avatarCover: "ScWorkspaceSwitchCard_avatarCover",
4457
+ avatarImg: "ScWorkspaceSwitchCard_avatarImg",
4458
+ infoCol: "ScWorkspaceSwitchCard_infoCol",
4459
+ wsName: "ScWorkspaceSwitchCard_wsName",
4460
+ detailsRow: "ScWorkspaceSwitchCard_detailsRow",
4461
+ detailItem: "ScWorkspaceSwitchCard_detailItem",
4462
+ detailItemFlex: "ScWorkspaceSwitchCard_detailItemFlex",
4463
+ detailLabel: "ScWorkspaceSwitchCard_detailLabel",
4464
+ detailValueWarning: "ScWorkspaceSwitchCard_detailValueWarning",
4465
+ detailValueSecondary: "ScWorkspaceSwitchCard_detailValueSecondary",
4466
+ vDivider: "ScWorkspaceSwitchCard_vDivider",
4467
+ btnIcon: "ScWorkspaceSwitchCard_btnIcon"
4468
+ };
4469
+
4470
+ // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4448
4471
  var import_jsx_runtime63 = require("react/jsx-runtime");
4449
4472
  function deriveInitials2(name) {
4450
4473
  return name.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4451
4474
  }
4452
- function DotSeparator() {
4453
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4454
- "div",
4455
- {
4456
- style: { width: 24, height: 24, display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
4457
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4458
- "div",
4459
- {
4460
- style: {
4461
- width: 4,
4462
- height: 4,
4463
- borderRadius: "50%",
4464
- backgroundColor: "var(--alias-text---icons-disabled)"
4465
- }
4466
- }
4467
- )
4468
- }
4469
- );
4470
- }
4471
4475
  function ScWorkspaceSwitchCard({
4472
4476
  name,
4473
4477
  initials,
@@ -4482,183 +4486,80 @@ function ScWorkspaceSwitchCard({
4482
4486
  }) {
4483
4487
  const [hovered, setHovered] = (0, import_react5.useState)(false);
4484
4488
  const showButtons = !isCurrent && hovered;
4485
- const cardBg = isCurrent ? "var(--alias-surface-raised)" : hovered ? "var(--alias-surface-basesubtle)" : "var(--alias-surface-base)";
4486
4489
  const displayInitials = initials || deriveInitials2(name);
4487
4490
  const isAdmin = role?.toLowerCase() === "admin";
4488
4491
  const roleText = isAdmin ? "Admin" : "Member";
4489
- const roleColor = isAdmin ? "var(--alias-text---icons-warning)" : "var(--alias-text---icons-infocont)";
4492
+ const cardClass = [
4493
+ ScWorkspaceSwitchCard_default.card,
4494
+ isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : "",
4495
+ hovered && !isCurrent ? ScWorkspaceSwitchCard_default.cardHover : ""
4496
+ ].filter(Boolean).join(" ");
4490
4497
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4491
4498
  "div",
4492
4499
  {
4493
- style: {
4494
- flexShrink: 0,
4495
- width: "100%",
4496
- display: "flex",
4497
- alignItems: "center",
4498
- backgroundColor: cardBg,
4499
- borderRadius: "var(--radius-3xl)",
4500
- backdropFilter: "blur(4px)",
4501
- border: "0.5px solid var(--alias-border-subtle)",
4502
- padding: "var(--spacing-3xl)",
4503
- gap: "var(--spacing-3xl)",
4504
- transition: "background-color 0.15s ease",
4505
- cursor: isCurrent ? "default" : "pointer",
4506
- boxSizing: "border-box"
4507
- },
4500
+ className: cardClass,
4508
4501
  onMouseEnter: () => !isCurrent && setHovered(true),
4509
4502
  onMouseLeave: () => setHovered(false),
4510
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4511
- "div",
4512
- {
4513
- style: {
4514
- display: "flex",
4515
- alignItems: "center",
4516
- flex: 1,
4517
- minWidth: 0,
4518
- gap: "var(--spacing-3xl)"
4519
- },
4520
- children: [
4521
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4522
- ScDp,
4523
- {
4524
- type: imageUrl ? "image" : "initial",
4525
- variant: "workspace",
4526
- initial: displayInitials,
4527
- imageUrl,
4528
- size: 64
4529
- }
4530
- ),
4531
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
4532
- "div",
4533
- {
4534
- style: {
4535
- display: "flex",
4536
- flexDirection: "column",
4537
- minWidth: 0,
4538
- flex: 1,
4539
- gap: "var(--spacing-md)"
4540
- },
4541
- children: [
4542
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4543
- "p",
4544
- {
4545
- style: {
4546
- overflow: "hidden",
4547
- textOverflow: "ellipsis",
4548
- whiteSpace: "nowrap",
4549
- width: "100%",
4550
- flexShrink: 0,
4551
- color: "var(--alias-text---icons-primary)",
4552
- fontFamily: "var(--font-family-font-family-body)",
4553
- fontSize: "var(--font-size-font-size-md)",
4554
- fontWeight: 500,
4555
- lineHeight: "var(--line-height-line-height-md)",
4556
- margin: 0
4557
- },
4558
- children: name
4559
- }
4560
- ),
4561
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { style: { display: "flex", alignItems: "center", width: "100%", flexShrink: 0, gap: "var(--spacing-xs)" }, children: [
4562
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4563
- "span",
4564
- {
4565
- style: {
4566
- flexShrink: 0,
4567
- whiteSpace: "nowrap",
4568
- color: roleColor,
4569
- fontFamily: "var(--font-family-font-family-body)",
4570
- fontSize: "var(--font-size-font-size-sm)",
4571
- fontWeight: 500,
4572
- lineHeight: "var(--line-height-line-height-sm)"
4573
- },
4574
- children: roleText
4575
- }
4576
- ),
4577
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DotSeparator, {}),
4578
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { style: { display: "flex", alignItems: "center", flexShrink: 0, gap: "var(--spacing-xs)" }, children: [
4579
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconBolt, { style: { flexShrink: 0, width: 18, height: 18 }, color: "var(--alias-text---icons-tertiary)" }),
4580
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4581
- "span",
4582
- {
4583
- style: {
4584
- flexShrink: 0,
4585
- whiteSpace: "nowrap",
4586
- color: "var(--alias-text---icons-tertiary)",
4587
- fontFamily: "var(--font-family-font-family-body)",
4588
- fontSize: "var(--font-size-font-size-sm)",
4589
- fontWeight: 400,
4590
- lineHeight: "var(--line-height-line-height-sm)"
4591
- },
4592
- children: plan || "\u2013"
4593
- }
4594
- )
4595
- ] }),
4596
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(DotSeparator, {}),
4597
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { style: { display: "flex", alignItems: "center", minWidth: 0, flex: 1, gap: "var(--spacing-xs)" }, children: [
4598
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconReferral, { style: { flexShrink: 0, width: 18, height: 18 }, color: "var(--alias-text---icons-tertiary)" }),
4599
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4600
- "span",
4601
- {
4602
- style: {
4603
- overflow: "hidden",
4604
- textOverflow: "ellipsis",
4605
- whiteSpace: "nowrap",
4606
- flex: 1,
4607
- minWidth: 0,
4608
- color: "var(--alias-text---icons-tertiary)",
4609
- fontFamily: "var(--font-family-font-family-body)",
4610
- fontSize: "var(--font-size-font-size-sm)",
4611
- fontWeight: 400,
4612
- lineHeight: "var(--line-height-line-height-sm)"
4613
- },
4614
- children: ownerEmail || "\u2013"
4615
- }
4616
- )
4617
- ] })
4618
- ] })
4619
- ]
4620
- }
4621
- ),
4622
- showButtons && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4623
- ScButton,
4624
- {
4625
- text: "Switch Workspace",
4626
- variant: "secondary",
4627
- size: "sm",
4628
- styleVariant: "icon-left",
4629
- icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSwitch, { style: { width: 16, height: 16 }, color: "var(--alias-text---icons-primary)" }),
4630
- onClick: (e) => {
4631
- e.stopPropagation();
4632
- onSwitch?.();
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,
4506
+ {
4507
+ intial: displayInitials,
4508
+ className: ScWorkspaceSwitchCard_default.avatarCover
4509
+ }
4510
+ ) }),
4511
+ /* @__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 }),
4513
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailsRow, children: [
4514
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4515
+ /* @__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
4633
4521
  }
4634
- }
4635
- ),
4636
- showButtons && variant === "settings" && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4637
- "button",
4638
- {
4639
- style: {
4640
- flexShrink: 0,
4641
- display: "flex",
4642
- alignItems: "center",
4643
- justifyContent: "center",
4644
- width: 32,
4645
- height: 32,
4646
- padding: "var(--spacing-xs)",
4647
- borderRadius: 12,
4648
- border: "1.25px solid var(--alias-border-default)",
4649
- backgroundColor: "transparent",
4650
- cursor: "pointer"
4651
- },
4652
- onClick: (e) => {
4653
- e.stopPropagation();
4654
- onSettings?.();
4655
- },
4656
- children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSettings, { style: { width: 16, height: 16 }, color: "var(--alias-text---icons-primary)" })
4657
- }
4658
- )
4659
- ]
4660
- }
4661
- )
4522
+ )
4523
+ ] }),
4524
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4525
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4526
+ /* @__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" })
4528
+ ] }),
4529
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4530
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: ScWorkspaceSwitchCard_default.detailItemFlex, children: [
4531
+ /* @__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" })
4533
+ ] })
4534
+ ] })
4535
+ ] }),
4536
+ showButtons && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4537
+ ScButton,
4538
+ {
4539
+ text: "Switch Workspace",
4540
+ size: "sm",
4541
+ styleVariant: "icon-left",
4542
+ icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSwitch, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4543
+ onClick: (e) => {
4544
+ e.stopPropagation();
4545
+ onSwitch?.();
4546
+ }
4547
+ }
4548
+ ),
4549
+ showButtons && variant === "settings" && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
4550
+ ScButton,
4551
+ {
4552
+ styleVariant: "icon-only",
4553
+ variant: "outline",
4554
+ size: "sm",
4555
+ icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons53.SiconSettings, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4556
+ onClick: (e) => {
4557
+ e.stopPropagation();
4558
+ onSettings?.();
4559
+ }
4560
+ }
4561
+ )
4562
+ ] })
4662
4563
  }
4663
4564
  );
4664
4565
  }
package/dist/index.mjs CHANGED
@@ -4367,30 +4367,34 @@ var ScWorkspaceCard = ({
4367
4367
 
4368
4368
  // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4369
4369
  import { useState as useState2 } from "react";
4370
- import { SiconBolt as SiconBolt6, SiconSwitch as SiconSwitch3, SiconReferral as SiconReferral2, SiconSettings as SiconSettings3 } from "@streamoid/icons";
4370
+ import { SiconSwitch as SiconSwitch3, SiconSettings as SiconSettings3 } from "@streamoid/icons";
4371
+
4372
+ // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css
4373
+ var ScWorkspaceSwitchCard_default = {
4374
+ card: "ScWorkspaceSwitchCard_card",
4375
+ cardCurrent: "ScWorkspaceSwitchCard_cardCurrent",
4376
+ cardHover: "ScWorkspaceSwitchCard_cardHover",
4377
+ workspaceInfo: "ScWorkspaceSwitchCard_workspaceInfo",
4378
+ avatarWrap: "ScWorkspaceSwitchCard_avatarWrap",
4379
+ avatarCover: "ScWorkspaceSwitchCard_avatarCover",
4380
+ avatarImg: "ScWorkspaceSwitchCard_avatarImg",
4381
+ infoCol: "ScWorkspaceSwitchCard_infoCol",
4382
+ wsName: "ScWorkspaceSwitchCard_wsName",
4383
+ detailsRow: "ScWorkspaceSwitchCard_detailsRow",
4384
+ detailItem: "ScWorkspaceSwitchCard_detailItem",
4385
+ detailItemFlex: "ScWorkspaceSwitchCard_detailItemFlex",
4386
+ detailLabel: "ScWorkspaceSwitchCard_detailLabel",
4387
+ detailValueWarning: "ScWorkspaceSwitchCard_detailValueWarning",
4388
+ detailValueSecondary: "ScWorkspaceSwitchCard_detailValueSecondary",
4389
+ vDivider: "ScWorkspaceSwitchCard_vDivider",
4390
+ btnIcon: "ScWorkspaceSwitchCard_btnIcon"
4391
+ };
4392
+
4393
+ // src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
4371
4394
  import { jsx as jsx62, jsxs as jsxs53 } from "react/jsx-runtime";
4372
4395
  function deriveInitials2(name) {
4373
4396
  return name.split(/\s+/).slice(0, 2).map((w) => w[0]?.toUpperCase() ?? "").join("") || "WS";
4374
4397
  }
4375
- function DotSeparator() {
4376
- return /* @__PURE__ */ jsx62(
4377
- "div",
4378
- {
4379
- style: { width: 24, height: 24, display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 },
4380
- children: /* @__PURE__ */ jsx62(
4381
- "div",
4382
- {
4383
- style: {
4384
- width: 4,
4385
- height: 4,
4386
- borderRadius: "50%",
4387
- backgroundColor: "var(--alias-text---icons-disabled)"
4388
- }
4389
- }
4390
- )
4391
- }
4392
- );
4393
- }
4394
4398
  function ScWorkspaceSwitchCard({
4395
4399
  name,
4396
4400
  initials,
@@ -4405,183 +4409,80 @@ function ScWorkspaceSwitchCard({
4405
4409
  }) {
4406
4410
  const [hovered, setHovered] = useState2(false);
4407
4411
  const showButtons = !isCurrent && hovered;
4408
- const cardBg = isCurrent ? "var(--alias-surface-raised)" : hovered ? "var(--alias-surface-basesubtle)" : "var(--alias-surface-base)";
4409
4412
  const displayInitials = initials || deriveInitials2(name);
4410
4413
  const isAdmin = role?.toLowerCase() === "admin";
4411
4414
  const roleText = isAdmin ? "Admin" : "Member";
4412
- const roleColor = isAdmin ? "var(--alias-text---icons-warning)" : "var(--alias-text---icons-infocont)";
4415
+ const cardClass = [
4416
+ ScWorkspaceSwitchCard_default.card,
4417
+ isCurrent ? ScWorkspaceSwitchCard_default.cardCurrent : "",
4418
+ hovered && !isCurrent ? ScWorkspaceSwitchCard_default.cardHover : ""
4419
+ ].filter(Boolean).join(" ");
4413
4420
  return /* @__PURE__ */ jsx62(
4414
4421
  "div",
4415
4422
  {
4416
- style: {
4417
- flexShrink: 0,
4418
- width: "100%",
4419
- display: "flex",
4420
- alignItems: "center",
4421
- backgroundColor: cardBg,
4422
- borderRadius: "var(--radius-3xl)",
4423
- backdropFilter: "blur(4px)",
4424
- border: "0.5px solid var(--alias-border-subtle)",
4425
- padding: "var(--spacing-3xl)",
4426
- gap: "var(--spacing-3xl)",
4427
- transition: "background-color 0.15s ease",
4428
- cursor: isCurrent ? "default" : "pointer",
4429
- boxSizing: "border-box"
4430
- },
4423
+ className: cardClass,
4431
4424
  onMouseEnter: () => !isCurrent && setHovered(true),
4432
4425
  onMouseLeave: () => setHovered(false),
4433
- children: /* @__PURE__ */ jsxs53(
4434
- "div",
4435
- {
4436
- style: {
4437
- display: "flex",
4438
- alignItems: "center",
4439
- flex: 1,
4440
- minWidth: 0,
4441
- gap: "var(--spacing-3xl)"
4442
- },
4443
- children: [
4444
- /* @__PURE__ */ jsx62(
4445
- ScDp,
4446
- {
4447
- type: imageUrl ? "image" : "initial",
4448
- variant: "workspace",
4449
- initial: displayInitials,
4450
- imageUrl,
4451
- size: 64
4452
- }
4453
- ),
4454
- /* @__PURE__ */ jsxs53(
4455
- "div",
4456
- {
4457
- style: {
4458
- display: "flex",
4459
- flexDirection: "column",
4460
- minWidth: 0,
4461
- flex: 1,
4462
- gap: "var(--spacing-md)"
4463
- },
4464
- children: [
4465
- /* @__PURE__ */ jsx62(
4466
- "p",
4467
- {
4468
- style: {
4469
- overflow: "hidden",
4470
- textOverflow: "ellipsis",
4471
- whiteSpace: "nowrap",
4472
- width: "100%",
4473
- flexShrink: 0,
4474
- color: "var(--alias-text---icons-primary)",
4475
- fontFamily: "var(--font-family-font-family-body)",
4476
- fontSize: "var(--font-size-font-size-md)",
4477
- fontWeight: 500,
4478
- lineHeight: "var(--line-height-line-height-md)",
4479
- margin: 0
4480
- },
4481
- children: name
4482
- }
4483
- ),
4484
- /* @__PURE__ */ jsxs53("div", { style: { display: "flex", alignItems: "center", width: "100%", flexShrink: 0, gap: "var(--spacing-xs)" }, children: [
4485
- /* @__PURE__ */ jsx62(
4486
- "span",
4487
- {
4488
- style: {
4489
- flexShrink: 0,
4490
- whiteSpace: "nowrap",
4491
- color: roleColor,
4492
- fontFamily: "var(--font-family-font-family-body)",
4493
- fontSize: "var(--font-size-font-size-sm)",
4494
- fontWeight: 500,
4495
- lineHeight: "var(--line-height-line-height-sm)"
4496
- },
4497
- children: roleText
4498
- }
4499
- ),
4500
- /* @__PURE__ */ jsx62(DotSeparator, {}),
4501
- /* @__PURE__ */ jsxs53("div", { style: { display: "flex", alignItems: "center", flexShrink: 0, gap: "var(--spacing-xs)" }, children: [
4502
- /* @__PURE__ */ jsx62(SiconBolt6, { style: { flexShrink: 0, width: 18, height: 18 }, color: "var(--alias-text---icons-tertiary)" }),
4503
- /* @__PURE__ */ jsx62(
4504
- "span",
4505
- {
4506
- style: {
4507
- flexShrink: 0,
4508
- whiteSpace: "nowrap",
4509
- color: "var(--alias-text---icons-tertiary)",
4510
- fontFamily: "var(--font-family-font-family-body)",
4511
- fontSize: "var(--font-size-font-size-sm)",
4512
- fontWeight: 400,
4513
- lineHeight: "var(--line-height-line-height-sm)"
4514
- },
4515
- children: plan || "\u2013"
4516
- }
4517
- )
4518
- ] }),
4519
- /* @__PURE__ */ jsx62(DotSeparator, {}),
4520
- /* @__PURE__ */ jsxs53("div", { style: { display: "flex", alignItems: "center", minWidth: 0, flex: 1, gap: "var(--spacing-xs)" }, children: [
4521
- /* @__PURE__ */ jsx62(SiconReferral2, { style: { flexShrink: 0, width: 18, height: 18 }, color: "var(--alias-text---icons-tertiary)" }),
4522
- /* @__PURE__ */ jsx62(
4523
- "span",
4524
- {
4525
- style: {
4526
- overflow: "hidden",
4527
- textOverflow: "ellipsis",
4528
- whiteSpace: "nowrap",
4529
- flex: 1,
4530
- minWidth: 0,
4531
- color: "var(--alias-text---icons-tertiary)",
4532
- fontFamily: "var(--font-family-font-family-body)",
4533
- fontSize: "var(--font-size-font-size-sm)",
4534
- fontWeight: 400,
4535
- lineHeight: "var(--line-height-line-height-sm)"
4536
- },
4537
- children: ownerEmail || "\u2013"
4538
- }
4539
- )
4540
- ] })
4541
- ] })
4542
- ]
4543
- }
4544
- ),
4545
- showButtons && /* @__PURE__ */ jsx62(
4546
- ScButton,
4547
- {
4548
- text: "Switch Workspace",
4549
- variant: "secondary",
4550
- size: "sm",
4551
- styleVariant: "icon-left",
4552
- icon: /* @__PURE__ */ jsx62(SiconSwitch3, { style: { width: 16, height: 16 }, color: "var(--alias-text---icons-primary)" }),
4553
- onClick: (e) => {
4554
- e.stopPropagation();
4555
- onSwitch?.();
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,
4429
+ {
4430
+ intial: displayInitials,
4431
+ className: ScWorkspaceSwitchCard_default.avatarCover
4432
+ }
4433
+ ) }),
4434
+ /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.infoCol, children: [
4435
+ /* @__PURE__ */ jsx62("p", { className: ScWorkspaceSwitchCard_default.wsName, children: name }),
4436
+ /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailsRow, children: [
4437
+ /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4438
+ /* @__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
4556
4444
  }
4557
- }
4558
- ),
4559
- showButtons && variant === "settings" && /* @__PURE__ */ jsx62(
4560
- "button",
4561
- {
4562
- style: {
4563
- flexShrink: 0,
4564
- display: "flex",
4565
- alignItems: "center",
4566
- justifyContent: "center",
4567
- width: 32,
4568
- height: 32,
4569
- padding: "var(--spacing-xs)",
4570
- borderRadius: 12,
4571
- border: "1.25px solid var(--alias-border-default)",
4572
- backgroundColor: "transparent",
4573
- cursor: "pointer"
4574
- },
4575
- onClick: (e) => {
4576
- e.stopPropagation();
4577
- onSettings?.();
4578
- },
4579
- children: /* @__PURE__ */ jsx62(SiconSettings3, { style: { width: 16, height: 16 }, color: "var(--alias-text---icons-primary)" })
4580
- }
4581
- )
4582
- ]
4583
- }
4584
- )
4445
+ )
4446
+ ] }),
4447
+ /* @__PURE__ */ jsx62(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4448
+ /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItem, children: [
4449
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Plan" }),
4450
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: plan || "\u2013" })
4451
+ ] }),
4452
+ /* @__PURE__ */ jsx62(ScVDivider, { className: ScWorkspaceSwitchCard_default.vDivider }),
4453
+ /* @__PURE__ */ jsxs53("div", { className: ScWorkspaceSwitchCard_default.detailItemFlex, children: [
4454
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailLabel, children: "Workspace Owner" }),
4455
+ /* @__PURE__ */ jsx62("span", { className: ScWorkspaceSwitchCard_default.detailValueSecondary, children: ownerEmail || "\u2013" })
4456
+ ] })
4457
+ ] })
4458
+ ] }),
4459
+ showButtons && /* @__PURE__ */ jsx62(
4460
+ ScButton,
4461
+ {
4462
+ text: "Switch Workspace",
4463
+ size: "sm",
4464
+ styleVariant: "icon-left",
4465
+ icon: /* @__PURE__ */ jsx62(SiconSwitch3, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4466
+ onClick: (e) => {
4467
+ e.stopPropagation();
4468
+ onSwitch?.();
4469
+ }
4470
+ }
4471
+ ),
4472
+ showButtons && variant === "settings" && /* @__PURE__ */ jsx62(
4473
+ ScButton,
4474
+ {
4475
+ styleVariant: "icon-only",
4476
+ variant: "outline",
4477
+ size: "sm",
4478
+ icon: /* @__PURE__ */ jsx62(SiconSettings3, { className: ScWorkspaceSwitchCard_default.btnIcon }),
4479
+ onClick: (e) => {
4480
+ e.stopPropagation();
4481
+ onSettings?.();
4482
+ }
4483
+ }
4484
+ )
4485
+ ] })
4585
4486
  }
4586
4487
  );
4587
4488
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoid/ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",