@streamoid/ui 0.6.22 → 0.6.24
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/docs/ScWorkspaceAccountMenu.md +5 -0
- package/dist/index.css +7 -3
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +22 -5
- package/dist/index.mjs +22 -5
- package/package.json +1 -1
|
@@ -92,6 +92,11 @@ Render the panel beside the top workspace trigger. Render the app identity at
|
|
|
92
92
|
the bottom of the sidebar and open `ScAppSwitchPanel` from that row. Apply the
|
|
93
93
|
corresponding shared popover-position style to each portalled panel.
|
|
94
94
|
|
|
95
|
+
Collapsed app identities use the Streamoid mascot for Streamoid and readable
|
|
96
|
+
two-letter product marks (`Ta`, `Ar`, `Ca`, `Ph`) for the other apps. Pass
|
|
97
|
+
`collapsedMark` when a product has an approved compact logo, or
|
|
98
|
+
`collapsedLabel` to override the default abbreviation.
|
|
99
|
+
|
|
95
100
|
## 3. When to use it
|
|
96
101
|
|
|
97
102
|
Use it in authenticated application shells. Login pages, standalone settings
|
package/dist/index.css
CHANGED
|
@@ -3924,9 +3924,13 @@
|
|
|
3924
3924
|
align-items: center;
|
|
3925
3925
|
justify-content: center;
|
|
3926
3926
|
overflow: hidden;
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3927
|
+
border-radius: var(--radius-xl, 12px);
|
|
3928
|
+
background: var(--alias-fill-neutral-neutral, #1a1a1a);
|
|
3929
|
+
color: var(--alias-text---icons-primary, #f5f5f5);
|
|
3930
|
+
font-size: 14px;
|
|
3931
|
+
line-height: 20px;
|
|
3932
|
+
font-weight: 600;
|
|
3933
|
+
letter-spacing: -0.02em;
|
|
3930
3934
|
}
|
|
3931
3935
|
.ScSidebarShell_menu {
|
|
3932
3936
|
display: flex;
|
package/dist/index.d.mts
CHANGED
|
@@ -625,11 +625,14 @@ declare function ScSidebarSearchTrigger({ expanded, label, shortcut, onClick, cl
|
|
|
625
625
|
interface ScSidebarAppIdentityProps {
|
|
626
626
|
expanded: boolean;
|
|
627
627
|
product?: AppcardProduct | "streamoid";
|
|
628
|
+
/** Optional compact label for collapsed rails. A supplied mark takes
|
|
629
|
+
* precedence; otherwise product-specific defaults such as Ar and Ca apply. */
|
|
630
|
+
collapsedLabel?: string;
|
|
628
631
|
collapsedMark?: ReactNode;
|
|
629
632
|
label?: string;
|
|
630
633
|
className?: string;
|
|
631
634
|
}
|
|
632
|
-
declare function ScSidebarAppIdentity({ expanded, product, collapsedMark, label, className, }: ScSidebarAppIdentityProps): JSX.Element;
|
|
635
|
+
declare function ScSidebarAppIdentity({ expanded, product, collapsedLabel, collapsedMark, label, className, }: ScSidebarAppIdentityProps): JSX.Element;
|
|
633
636
|
interface ScWorkspaceAccountMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
634
637
|
workspaceName: string;
|
|
635
638
|
workspaceRole?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -625,11 +625,14 @@ declare function ScSidebarSearchTrigger({ expanded, label, shortcut, onClick, cl
|
|
|
625
625
|
interface ScSidebarAppIdentityProps {
|
|
626
626
|
expanded: boolean;
|
|
627
627
|
product?: AppcardProduct | "streamoid";
|
|
628
|
+
/** Optional compact label for collapsed rails. A supplied mark takes
|
|
629
|
+
* precedence; otherwise product-specific defaults such as Ar and Ca apply. */
|
|
630
|
+
collapsedLabel?: string;
|
|
628
631
|
collapsedMark?: ReactNode;
|
|
629
632
|
label?: string;
|
|
630
633
|
className?: string;
|
|
631
634
|
}
|
|
632
|
-
declare function ScSidebarAppIdentity({ expanded, product, collapsedMark, label, className, }: ScSidebarAppIdentityProps): JSX.Element;
|
|
635
|
+
declare function ScSidebarAppIdentity({ expanded, product, collapsedLabel, collapsedMark, label, className, }: ScSidebarAppIdentityProps): JSX.Element;
|
|
633
636
|
interface ScWorkspaceAccountMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
634
637
|
workspaceName: string;
|
|
635
638
|
workspaceRole?: string;
|
package/dist/index.js
CHANGED
|
@@ -5121,9 +5121,16 @@ function ScSidebarSearchTrigger({
|
|
|
5121
5121
|
function AppGridIcon() {
|
|
5122
5122
|
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": true, className: ScSidebarShell_default.appGridIcon, children: Array.from({ length: 9 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", {}, index)) });
|
|
5123
5123
|
}
|
|
5124
|
+
var COMPACT_APP_LABELS = {
|
|
5125
|
+
tactix: "Ta",
|
|
5126
|
+
artifax: "Ar",
|
|
5127
|
+
catalogix: "Ca",
|
|
5128
|
+
photogenix: "Ph"
|
|
5129
|
+
};
|
|
5124
5130
|
function ScSidebarAppIdentity({
|
|
5125
5131
|
expanded,
|
|
5126
5132
|
product = "streamoid",
|
|
5133
|
+
collapsedLabel,
|
|
5127
5134
|
collapsedMark,
|
|
5128
5135
|
label,
|
|
5129
5136
|
className
|
|
@@ -5138,7 +5145,7 @@ function ScSidebarAppIdentity({
|
|
|
5138
5145
|
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
5139
5146
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: ScSidebarShell_default.appWordmark, children: product === "streamoid" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ScStreamoidWordmark, { width: 110, height: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ScAppcardLogos, { product }) }),
|
|
5140
5147
|
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(AppGridIcon, {})
|
|
5141
|
-
] }) : collapsedMark ?? (product === "streamoid" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ScStreamoidMascot, { size: 40 }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: ScSidebarShell_default.collapsedProductMark, children:
|
|
5148
|
+
] }) : collapsedMark ?? (product === "streamoid" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(ScStreamoidMascot, { size: 40 }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { "aria-hidden": true, className: ScSidebarShell_default.collapsedProductMark, children: collapsedLabel ?? COMPACT_APP_LABELS[product] }))
|
|
5142
5149
|
}
|
|
5143
5150
|
);
|
|
5144
5151
|
}
|
|
@@ -5551,10 +5558,18 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5551
5558
|
(0, import_react14.useLayoutEffect)(() => {
|
|
5552
5559
|
const sidebar = sidebarRef.current;
|
|
5553
5560
|
if (!sidebar || typeof window === "undefined") return;
|
|
5554
|
-
const
|
|
5561
|
+
const findCard = () => (sidebar.matches("[data-streamoid-sidebar-card]") ? sidebar : sidebar.querySelector(
|
|
5555
5562
|
"[data-streamoid-sidebar-card]"
|
|
5556
5563
|
)) ?? sidebar;
|
|
5564
|
+
let observedCard = null;
|
|
5565
|
+
let resizeObserver = null;
|
|
5557
5566
|
const measure = () => {
|
|
5567
|
+
const card = findCard();
|
|
5568
|
+
if (resizeObserver && observedCard !== card) {
|
|
5569
|
+
if (observedCard) resizeObserver.unobserve(observedCard);
|
|
5570
|
+
resizeObserver.observe(card);
|
|
5571
|
+
observedCard = card;
|
|
5572
|
+
}
|
|
5558
5573
|
const bounds = card.getBoundingClientRect();
|
|
5559
5574
|
const availableWidth = Math.max(0, window.innerWidth - VIEWPORT_INSET * 2);
|
|
5560
5575
|
const panelWidth = Math.min(width, availableWidth);
|
|
@@ -5583,13 +5598,15 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5583
5598
|
...vertical
|
|
5584
5599
|
});
|
|
5585
5600
|
};
|
|
5601
|
+
resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
5586
5602
|
measure();
|
|
5587
5603
|
window.addEventListener("resize", measure);
|
|
5588
|
-
const
|
|
5589
|
-
|
|
5604
|
+
const mutationObserver = typeof MutationObserver === "undefined" ? null : new MutationObserver(measure);
|
|
5605
|
+
mutationObserver?.observe(sidebar, { childList: true, subtree: true });
|
|
5590
5606
|
return () => {
|
|
5591
5607
|
window.removeEventListener("resize", measure);
|
|
5592
|
-
|
|
5608
|
+
resizeObserver?.disconnect();
|
|
5609
|
+
mutationObserver?.disconnect();
|
|
5593
5610
|
};
|
|
5594
5611
|
}, [gap, inset, placement, sidebarRef, width]);
|
|
5595
5612
|
return position;
|
package/dist/index.mjs
CHANGED
|
@@ -4962,9 +4962,16 @@ function ScSidebarSearchTrigger({
|
|
|
4962
4962
|
function AppGridIcon() {
|
|
4963
4963
|
return /* @__PURE__ */ jsx50("span", { "aria-hidden": true, className: ScSidebarShell_default.appGridIcon, children: Array.from({ length: 9 }, (_, index) => /* @__PURE__ */ jsx50("span", {}, index)) });
|
|
4964
4964
|
}
|
|
4965
|
+
var COMPACT_APP_LABELS = {
|
|
4966
|
+
tactix: "Ta",
|
|
4967
|
+
artifax: "Ar",
|
|
4968
|
+
catalogix: "Ca",
|
|
4969
|
+
photogenix: "Ph"
|
|
4970
|
+
};
|
|
4965
4971
|
function ScSidebarAppIdentity({
|
|
4966
4972
|
expanded,
|
|
4967
4973
|
product = "streamoid",
|
|
4974
|
+
collapsedLabel,
|
|
4968
4975
|
collapsedMark,
|
|
4969
4976
|
label,
|
|
4970
4977
|
className
|
|
@@ -4979,7 +4986,7 @@ function ScSidebarAppIdentity({
|
|
|
4979
4986
|
children: expanded ? /* @__PURE__ */ jsxs41(Fragment15, { children: [
|
|
4980
4987
|
/* @__PURE__ */ jsx50("span", { className: ScSidebarShell_default.appWordmark, children: product === "streamoid" ? /* @__PURE__ */ jsx50(ScStreamoidWordmark, { width: 110, height: 16 }) : /* @__PURE__ */ jsx50(ScAppcardLogos, { product }) }),
|
|
4981
4988
|
/* @__PURE__ */ jsx50(AppGridIcon, {})
|
|
4982
|
-
] }) : collapsedMark ?? (product === "streamoid" ? /* @__PURE__ */ jsx50(ScStreamoidMascot, { size: 40 }) : /* @__PURE__ */ jsx50("span", { className: ScSidebarShell_default.collapsedProductMark, children:
|
|
4989
|
+
] }) : collapsedMark ?? (product === "streamoid" ? /* @__PURE__ */ jsx50(ScStreamoidMascot, { size: 40 }) : /* @__PURE__ */ jsx50("span", { "aria-hidden": true, className: ScSidebarShell_default.collapsedProductMark, children: collapsedLabel ?? COMPACT_APP_LABELS[product] }))
|
|
4983
4990
|
}
|
|
4984
4991
|
);
|
|
4985
4992
|
}
|
|
@@ -5395,10 +5402,18 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5395
5402
|
useLayoutEffect(() => {
|
|
5396
5403
|
const sidebar = sidebarRef.current;
|
|
5397
5404
|
if (!sidebar || typeof window === "undefined") return;
|
|
5398
|
-
const
|
|
5405
|
+
const findCard = () => (sidebar.matches("[data-streamoid-sidebar-card]") ? sidebar : sidebar.querySelector(
|
|
5399
5406
|
"[data-streamoid-sidebar-card]"
|
|
5400
5407
|
)) ?? sidebar;
|
|
5408
|
+
let observedCard = null;
|
|
5409
|
+
let resizeObserver = null;
|
|
5401
5410
|
const measure = () => {
|
|
5411
|
+
const card = findCard();
|
|
5412
|
+
if (resizeObserver && observedCard !== card) {
|
|
5413
|
+
if (observedCard) resizeObserver.unobserve(observedCard);
|
|
5414
|
+
resizeObserver.observe(card);
|
|
5415
|
+
observedCard = card;
|
|
5416
|
+
}
|
|
5402
5417
|
const bounds = card.getBoundingClientRect();
|
|
5403
5418
|
const availableWidth = Math.max(0, window.innerWidth - VIEWPORT_INSET * 2);
|
|
5404
5419
|
const panelWidth = Math.min(width, availableWidth);
|
|
@@ -5427,13 +5442,15 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5427
5442
|
...vertical
|
|
5428
5443
|
});
|
|
5429
5444
|
};
|
|
5445
|
+
resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
5430
5446
|
measure();
|
|
5431
5447
|
window.addEventListener("resize", measure);
|
|
5432
|
-
const
|
|
5433
|
-
|
|
5448
|
+
const mutationObserver = typeof MutationObserver === "undefined" ? null : new MutationObserver(measure);
|
|
5449
|
+
mutationObserver?.observe(sidebar, { childList: true, subtree: true });
|
|
5434
5450
|
return () => {
|
|
5435
5451
|
window.removeEventListener("resize", measure);
|
|
5436
|
-
|
|
5452
|
+
resizeObserver?.disconnect();
|
|
5453
|
+
mutationObserver?.disconnect();
|
|
5437
5454
|
};
|
|
5438
5455
|
}, [gap, inset, placement, sidebarRef, width]);
|
|
5439
5456
|
return position;
|