@streamoid/ui 0.6.30 → 0.6.31
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/AGENTS.md +3 -3
- package/dist/docs/ScAppSwitchPanel.md +17 -4
- package/dist/docs/ScWorkspaceAccountMenu.md +34 -7
- package/dist/docs/components.json +17 -2
- package/dist/index.d.mts +87 -5
- package/dist/index.d.ts +87 -5
- package/dist/index.js +151 -51
- package/dist/index.mjs +137 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -165,10 +165,13 @@ __export(index_exports, {
|
|
|
165
165
|
createStreamoidAppSwitchUtilities: () => createStreamoidAppSwitchUtilities,
|
|
166
166
|
formatSubAgentLabel: () => formatSubAgentLabel,
|
|
167
167
|
hasCollapsedMark: () => hasCollapsedMark,
|
|
168
|
+
resolveAnchoredPopoverPosition: () => resolveAnchoredPopoverPosition,
|
|
168
169
|
resolvePanelResize: () => resolvePanelResize,
|
|
169
170
|
resolvePanelResizeKey: () => resolvePanelResizeKey,
|
|
171
|
+
scAppSwitchOrder: () => scAppSwitchOrder,
|
|
170
172
|
streamoidAppSwitchTagline: () => streamoidAppSwitchTagline,
|
|
171
173
|
streamoidChangelogUrl: () => streamoidChangelogUrl,
|
|
174
|
+
useStreamoidAnchoredPopoverPosition: () => useStreamoidAnchoredPopoverPosition,
|
|
172
175
|
useStreamoidPanelWidth: () => useStreamoidPanelWidth,
|
|
173
176
|
useStreamoidSidebarPopoverPosition: () => useStreamoidSidebarPopoverPosition,
|
|
174
177
|
useStreamoidSidebarPreference: () => useStreamoidSidebarPreference,
|
|
@@ -399,21 +402,27 @@ function orderIndex(item) {
|
|
|
399
402
|
const index = productBrandIndex(item.key, item.name);
|
|
400
403
|
return index === -1 ? PRODUCT_BRANDS.length : index;
|
|
401
404
|
}
|
|
405
|
+
function scAppSwitchOrder(apps) {
|
|
406
|
+
return [...apps].sort((a, b) => orderIndex(a) - orderIndex(b));
|
|
407
|
+
}
|
|
402
408
|
var ScAppSwitchRow = ({
|
|
403
409
|
item
|
|
404
410
|
}) => {
|
|
405
411
|
const [hover, setHover] = (0, import_react.useState)(false);
|
|
406
412
|
const [focused, setFocused] = (0, import_react.useState)(false);
|
|
407
|
-
const
|
|
413
|
+
const current = item.current === true;
|
|
414
|
+
const interactive = !current && (hover || focused);
|
|
408
415
|
const brand = matchProductBrand(item.key, item.name);
|
|
409
416
|
const description = rowDescription(item, brand);
|
|
410
|
-
const labelColor = interactive ? T.primary : T.secondary;
|
|
417
|
+
const labelColor = interactive || current ? T.primary : T.secondary;
|
|
411
418
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
412
419
|
"button",
|
|
413
420
|
{
|
|
414
421
|
type: "button",
|
|
415
|
-
"aria-label": `Switch to ${item.name}`,
|
|
416
|
-
|
|
422
|
+
"aria-label": current ? `${item.name}, current app` : `Switch to ${item.name}`,
|
|
423
|
+
"aria-current": current ? "true" : void 0,
|
|
424
|
+
"aria-disabled": current ? true : void 0,
|
|
425
|
+
onClick: current ? void 0 : item.onSelect,
|
|
417
426
|
onMouseEnter: () => setHover(true),
|
|
418
427
|
onMouseLeave: () => setHover(false),
|
|
419
428
|
onFocus: () => setFocused(true),
|
|
@@ -425,12 +434,16 @@ var ScAppSwitchRow = ({
|
|
|
425
434
|
width: "100%",
|
|
426
435
|
height: 60,
|
|
427
436
|
padding: "var(--spacing-md, 8px) var(--spacing-xl, 12px) var(--spacing-md, 8px) var(--spacing-3xl, 16px)",
|
|
428
|
-
|
|
437
|
+
/* A FILL, NOT A SURFACE, for the selected row: every
|
|
438
|
+
`--alias-surface-*` token is #ffffff in the light theme (elevation
|
|
439
|
+
there is shadow and border, which a 60px row inside a flyout has
|
|
440
|
+
neither of), so a surface token would make it invisible on light. */
|
|
441
|
+
background: current ? "var(--alias-fill-neutral-neutralselected, #ededed)" : interactive ? "var(--alias-fill-neutral-neutral, #f5f5f5)" : "transparent",
|
|
429
442
|
border: "1px solid transparent",
|
|
430
443
|
borderRadius: "var(--radius-xl, 12px)",
|
|
431
444
|
boxShadow: focused ? "inset 0 0 0 1px var(--alias-border-default, #cfcfcf)" : "none",
|
|
432
445
|
outline: "none",
|
|
433
|
-
cursor: "pointer",
|
|
446
|
+
cursor: current ? "default" : "pointer",
|
|
434
447
|
fontFamily: T.font,
|
|
435
448
|
transition: "background-color 120ms ease, box-shadow 120ms ease"
|
|
436
449
|
},
|
|
@@ -528,10 +541,10 @@ var ScAppSwitchRow = ({
|
|
|
528
541
|
alignItems: "center",
|
|
529
542
|
justifyContent: "center",
|
|
530
543
|
flexShrink: 0,
|
|
531
|
-
opacity: interactive ? 1 : 0.45,
|
|
544
|
+
opacity: current || interactive ? 1 : 0.45,
|
|
532
545
|
transition: "opacity 120ms ease"
|
|
533
546
|
},
|
|
534
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.SiconRight, { size: 24, color: "var(--alias-text---icons-primary)" })
|
|
547
|
+
children: current ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.SiconCheck, { size: 24, color: "var(--alias-text---icons-primary)" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.SiconRight, { size: 24, color: "var(--alias-text---icons-primary)" })
|
|
535
548
|
}
|
|
536
549
|
)
|
|
537
550
|
]
|
|
@@ -598,7 +611,7 @@ var ScAppSwitchPanel = ({
|
|
|
598
611
|
className,
|
|
599
612
|
style
|
|
600
613
|
}) => {
|
|
601
|
-
const ordered =
|
|
614
|
+
const ordered = scAppSwitchOrder(apps);
|
|
602
615
|
const resolvedSystemItems = systemItems ?? (utilities ? createStreamoidAppSwitchUtilities(utilities) : []);
|
|
603
616
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
604
617
|
"div",
|
|
@@ -5829,8 +5842,95 @@ function useStreamoidSidebarPreference(options = {}) {
|
|
|
5829
5842
|
return { expanded, setExpanded, toggle };
|
|
5830
5843
|
}
|
|
5831
5844
|
|
|
5832
|
-
// src/SC-SidebarShell/
|
|
5845
|
+
// src/SC-SidebarShell/useStreamoidAnchoredPopoverPosition.ts
|
|
5833
5846
|
var import_react16 = require("react");
|
|
5847
|
+
var DEFAULT_GAP = 8;
|
|
5848
|
+
var DEFAULT_INSET = 16;
|
|
5849
|
+
function resolveAnchoredPopoverPosition({
|
|
5850
|
+
anchor,
|
|
5851
|
+
viewportWidth,
|
|
5852
|
+
viewportHeight,
|
|
5853
|
+
width,
|
|
5854
|
+
height,
|
|
5855
|
+
gap,
|
|
5856
|
+
inset
|
|
5857
|
+
}) {
|
|
5858
|
+
const available = Math.max(0, viewportWidth - inset * 2);
|
|
5859
|
+
const panelWidth = Math.min(width, available);
|
|
5860
|
+
const rightOfAnchor = anchor.right + gap;
|
|
5861
|
+
const leftOfAnchor = anchor.left - gap - panelWidth;
|
|
5862
|
+
const fitsRight = rightOfAnchor + panelWidth <= viewportWidth - inset;
|
|
5863
|
+
const preferredLeft = fitsRight ? rightOfAnchor : leftOfAnchor >= inset ? leftOfAnchor : rightOfAnchor;
|
|
5864
|
+
const left = Math.max(
|
|
5865
|
+
inset,
|
|
5866
|
+
Math.min(preferredLeft, Math.max(inset, viewportWidth - panelWidth - inset))
|
|
5867
|
+
);
|
|
5868
|
+
const panelHeight = height ?? 0;
|
|
5869
|
+
const downwardTop = anchor.top;
|
|
5870
|
+
const fitsDown = downwardTop + panelHeight <= viewportHeight - inset;
|
|
5871
|
+
const upwardTop = anchor.bottom - panelHeight;
|
|
5872
|
+
const preferredTop = fitsDown ? downwardTop : upwardTop;
|
|
5873
|
+
const top = Math.max(
|
|
5874
|
+
inset,
|
|
5875
|
+
Math.min(preferredTop, Math.max(inset, viewportHeight - panelHeight - inset))
|
|
5876
|
+
);
|
|
5877
|
+
return { left, top, width: panelWidth };
|
|
5878
|
+
}
|
|
5879
|
+
function useStreamoidAnchoredPopoverPosition(anchorRef, panelRef, { width, gap = DEFAULT_GAP, inset = DEFAULT_INSET }) {
|
|
5880
|
+
const [position, setPosition] = (0, import_react16.useState)({
|
|
5881
|
+
position: "fixed",
|
|
5882
|
+
left: 0,
|
|
5883
|
+
top: 0,
|
|
5884
|
+
width,
|
|
5885
|
+
maxWidth: `calc(100vw - ${inset * 2}px)`,
|
|
5886
|
+
maxHeight: `calc(100dvh - ${inset * 2}px)`,
|
|
5887
|
+
visibility: "hidden"
|
|
5888
|
+
});
|
|
5889
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
5890
|
+
const anchor = anchorRef.current;
|
|
5891
|
+
if (!anchor || typeof window === "undefined") return;
|
|
5892
|
+
const measure = () => {
|
|
5893
|
+
const bounds = anchor.getBoundingClientRect();
|
|
5894
|
+
const panelHeight = panelRef.current?.offsetHeight;
|
|
5895
|
+
const { left, top, width: panelWidth } = resolveAnchoredPopoverPosition({
|
|
5896
|
+
anchor: bounds,
|
|
5897
|
+
viewportWidth: window.innerWidth,
|
|
5898
|
+
viewportHeight: window.innerHeight,
|
|
5899
|
+
width,
|
|
5900
|
+
height: panelHeight,
|
|
5901
|
+
gap,
|
|
5902
|
+
inset
|
|
5903
|
+
});
|
|
5904
|
+
const next = {
|
|
5905
|
+
position: "fixed",
|
|
5906
|
+
left,
|
|
5907
|
+
top,
|
|
5908
|
+
width: panelWidth,
|
|
5909
|
+
maxWidth: `calc(100vw - ${inset * 2}px)`,
|
|
5910
|
+
maxHeight: `calc(100dvh - ${inset * 2}px)`,
|
|
5911
|
+
visibility: "visible"
|
|
5912
|
+
};
|
|
5913
|
+
setPosition(
|
|
5914
|
+
(prev) => prev.left === next.left && prev.top === next.top && prev.width === next.width && prev.visibility === next.visibility ? prev : next
|
|
5915
|
+
);
|
|
5916
|
+
};
|
|
5917
|
+
measure();
|
|
5918
|
+
window.addEventListener("resize", measure);
|
|
5919
|
+
window.addEventListener("scroll", measure, true);
|
|
5920
|
+
const resizeObserver = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(measure);
|
|
5921
|
+
resizeObserver?.observe(anchor);
|
|
5922
|
+
if (panelRef.current) resizeObserver?.observe(panelRef.current);
|
|
5923
|
+
return () => {
|
|
5924
|
+
window.removeEventListener("resize", measure);
|
|
5925
|
+
window.removeEventListener("scroll", measure, true);
|
|
5926
|
+
resizeObserver?.disconnect();
|
|
5927
|
+
};
|
|
5928
|
+
}, [anchorRef, panelRef, width, gap, inset]);
|
|
5929
|
+
return position;
|
|
5930
|
+
}
|
|
5931
|
+
|
|
5932
|
+
// src/SC-SidebarShell/useStreamoidSidebarPopoverPosition.ts
|
|
5933
|
+
var import_react17 = require("react");
|
|
5834
5934
|
var VIEWPORT_INSET = 16;
|
|
5835
5935
|
function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
5836
5936
|
placement,
|
|
@@ -5838,7 +5938,7 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5838
5938
|
gap = 8,
|
|
5839
5939
|
inset = 0
|
|
5840
5940
|
}) {
|
|
5841
|
-
const [position, setPosition] = (0,
|
|
5941
|
+
const [position, setPosition] = (0, import_react17.useState)({
|
|
5842
5942
|
position: "fixed",
|
|
5843
5943
|
left: 0,
|
|
5844
5944
|
top: 0,
|
|
@@ -5847,7 +5947,7 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5847
5947
|
maxHeight: `calc(100dvh - ${VIEWPORT_INSET * 2}px)`,
|
|
5848
5948
|
visibility: "hidden"
|
|
5849
5949
|
});
|
|
5850
|
-
(0,
|
|
5950
|
+
(0, import_react17.useLayoutEffect)(() => {
|
|
5851
5951
|
const sidebar = sidebarRef.current;
|
|
5852
5952
|
if (!sidebar || typeof window === "undefined") return;
|
|
5853
5953
|
const findCard = () => (sidebar.matches("[data-streamoid-sidebar-card]") ? sidebar : sidebar.querySelector(
|
|
@@ -5908,7 +6008,7 @@ function useStreamoidSidebarPopoverPosition(sidebarRef, {
|
|
|
5908
6008
|
}
|
|
5909
6009
|
|
|
5910
6010
|
// src/SC-Artifax-Sidebar/ScArtifaxSidebar.tsx
|
|
5911
|
-
var
|
|
6011
|
+
var import_react18 = require("react");
|
|
5912
6012
|
|
|
5913
6013
|
// src/SC-Artifax-Sidebar/ScArtifaxSidebar.module.css
|
|
5914
6014
|
var ScArtifaxSidebar_default = {
|
|
@@ -6015,7 +6115,7 @@ var ScArtifaxSidebar = ({
|
|
|
6015
6115
|
}
|
|
6016
6116
|
};
|
|
6017
6117
|
const isControlled = !!openSections;
|
|
6018
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
6118
|
+
const [internalOpen, setInternalOpen] = (0, import_react18.useState)(
|
|
6019
6119
|
() => {
|
|
6020
6120
|
const init = {};
|
|
6021
6121
|
sections.forEach((s) => {
|
|
@@ -6025,7 +6125,7 @@ var ScArtifaxSidebar = ({
|
|
|
6025
6125
|
}
|
|
6026
6126
|
);
|
|
6027
6127
|
const isSectionOpen = (id) => isControlled ? !!openSections?.[id] : !!internalOpen[id];
|
|
6028
|
-
const handleSectionToggle = (0,
|
|
6128
|
+
const handleSectionToggle = (0, import_react18.useCallback)(
|
|
6029
6129
|
(id) => {
|
|
6030
6130
|
const next = !isSectionOpen(id);
|
|
6031
6131
|
if (isControlled) {
|
|
@@ -6232,7 +6332,7 @@ var ScArtifaxSidebar = ({
|
|
|
6232
6332
|
};
|
|
6233
6333
|
|
|
6234
6334
|
// src/SC-Catalogix-Sidebar/ScCatalogixSidebar.tsx
|
|
6235
|
-
var
|
|
6335
|
+
var import_react19 = require("react");
|
|
6236
6336
|
|
|
6237
6337
|
// src/SC-Sidebar Switch menu/ScSidebarSwitchMenu.module.css
|
|
6238
6338
|
var ScSidebarSwitchMenu_default = {
|
|
@@ -6874,7 +6974,7 @@ var ScCatalogixSidebar = ({
|
|
|
6874
6974
|
className,
|
|
6875
6975
|
style
|
|
6876
6976
|
}) => {
|
|
6877
|
-
const [appListOpen, setAppListOpen] = (0,
|
|
6977
|
+
const [appListOpen, setAppListOpen] = (0, import_react19.useState)(false);
|
|
6878
6978
|
const handleSwitch = () => {
|
|
6879
6979
|
setAppListOpen((prev) => !prev);
|
|
6880
6980
|
onLogoClick?.();
|
|
@@ -7117,7 +7217,7 @@ var ScSlider = ({
|
|
|
7117
7217
|
};
|
|
7118
7218
|
|
|
7119
7219
|
// src/SC-WorkspaceSwitcher/streamoid-workspace-switcher.tsx
|
|
7120
|
-
var
|
|
7220
|
+
var import_react20 = require("react");
|
|
7121
7221
|
var import_icons42 = require("@streamoid/icons");
|
|
7122
7222
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7123
7223
|
var PRIMARY_ICON = "var(--alias-text---icons-primary)";
|
|
@@ -7308,12 +7408,12 @@ function StreamoidWorkspaceSwitcher({
|
|
|
7308
7408
|
onSwitchWorkspace,
|
|
7309
7409
|
config
|
|
7310
7410
|
}) {
|
|
7311
|
-
const modalRef = (0,
|
|
7411
|
+
const modalRef = (0, import_react20.useRef)(null);
|
|
7312
7412
|
const title = config?.title || "Switch workspace";
|
|
7313
7413
|
const loadingText = config?.loadingText || "Loading workspaces\u2026";
|
|
7314
7414
|
const currentWorkspaceText = config?.currentWorkspaceText || "Current workspace";
|
|
7315
7415
|
const switchWorkspaceText = config?.switchWorkspaceText || "Switch workspace";
|
|
7316
|
-
(0,
|
|
7416
|
+
(0, import_react20.useEffect)(() => {
|
|
7317
7417
|
if (!open) return;
|
|
7318
7418
|
function handleKeyDown(e) {
|
|
7319
7419
|
if (e.key === "Escape") onClose();
|
|
@@ -8724,7 +8824,7 @@ var ScWorkspaceCard = ({
|
|
|
8724
8824
|
};
|
|
8725
8825
|
|
|
8726
8826
|
// src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.tsx
|
|
8727
|
-
var
|
|
8827
|
+
var import_react21 = require("react");
|
|
8728
8828
|
var import_icons62 = require("@streamoid/icons");
|
|
8729
8829
|
|
|
8730
8830
|
// src/SC-WorkspaceSwitchCard/ScWorkspaceSwitchCard.module.css
|
|
@@ -8765,7 +8865,7 @@ function ScWorkspaceSwitchCard({
|
|
|
8765
8865
|
onSettings,
|
|
8766
8866
|
onLeave
|
|
8767
8867
|
}) {
|
|
8768
|
-
const [internalHover, setInternalHover] = (0,
|
|
8868
|
+
const [internalHover, setInternalHover] = (0, import_react21.useState)(false);
|
|
8769
8869
|
const isHover = hover !== void 0 ? hover : internalHover;
|
|
8770
8870
|
const isCurrent = type === "currentWS";
|
|
8771
8871
|
const isOther = type === "otherWS";
|
|
@@ -8893,7 +8993,7 @@ function ScWorkspaceSwitchCard({
|
|
|
8893
8993
|
var NscWorkspaceSwitch = ScWorkspaceSwitchCard;
|
|
8894
8994
|
|
|
8895
8995
|
// src/SC-Modal/ScModal.tsx
|
|
8896
|
-
var
|
|
8996
|
+
var import_react22 = require("react");
|
|
8897
8997
|
var import_react_dom = require("react-dom");
|
|
8898
8998
|
|
|
8899
8999
|
// src/SC-Modal/ScModal.module.css
|
|
@@ -8915,7 +9015,7 @@ var ScModal = ({
|
|
|
8915
9015
|
closeOnBackdrop = true,
|
|
8916
9016
|
closeOnEsc = true
|
|
8917
9017
|
}) => {
|
|
8918
|
-
(0,
|
|
9018
|
+
(0, import_react22.useEffect)(() => {
|
|
8919
9019
|
if (!open || !closeOnEsc) return;
|
|
8920
9020
|
const onKey = (e) => {
|
|
8921
9021
|
if (e.key === "Escape") onClose?.();
|
|
@@ -8948,7 +9048,7 @@ var ScModal = ({
|
|
|
8948
9048
|
};
|
|
8949
9049
|
|
|
8950
9050
|
// src/SC-Drawer/ScDrawer.tsx
|
|
8951
|
-
var
|
|
9051
|
+
var import_react23 = require("react");
|
|
8952
9052
|
var import_react_dom2 = require("react-dom");
|
|
8953
9053
|
|
|
8954
9054
|
// src/SC-Drawer/ScDrawer.module.css
|
|
@@ -8976,8 +9076,8 @@ var ScDrawer = ({
|
|
|
8976
9076
|
backdrop = false,
|
|
8977
9077
|
zIndex
|
|
8978
9078
|
}) => {
|
|
8979
|
-
const panelRef = (0,
|
|
8980
|
-
(0,
|
|
9079
|
+
const panelRef = (0, import_react23.useRef)(null);
|
|
9080
|
+
(0, import_react23.useEffect)(() => {
|
|
8981
9081
|
if (!open) return;
|
|
8982
9082
|
const onKey = (e) => {
|
|
8983
9083
|
if (closeOnEsc && e.key === "Escape") onClose?.();
|
|
@@ -9075,7 +9175,7 @@ var ScTabs = ({
|
|
|
9075
9175
|
};
|
|
9076
9176
|
|
|
9077
9177
|
// src/SC-Counter/ScCounter.tsx
|
|
9078
|
-
var
|
|
9178
|
+
var import_react24 = require("react");
|
|
9079
9179
|
var import_icons63 = require("@streamoid/icons");
|
|
9080
9180
|
|
|
9081
9181
|
// src/SC-Counter/ScCounter.module.css
|
|
@@ -9097,7 +9197,7 @@ var ScCounter = ({
|
|
|
9097
9197
|
className,
|
|
9098
9198
|
style
|
|
9099
9199
|
}) => {
|
|
9100
|
-
const [showInput, setShowInput] = (0,
|
|
9200
|
+
const [showInput, setShowInput] = (0, import_react24.useState)(false);
|
|
9101
9201
|
const set = (n) => {
|
|
9102
9202
|
let v = n;
|
|
9103
9203
|
if (min !== void 0) v = Math.max(min, v);
|
|
@@ -10186,7 +10286,7 @@ var ScSelectionList = ({
|
|
|
10186
10286
|
};
|
|
10187
10287
|
|
|
10188
10288
|
// src/SC-textArea/ScTextArea.tsx
|
|
10189
|
-
var
|
|
10289
|
+
var import_react25 = require("react");
|
|
10190
10290
|
|
|
10191
10291
|
// src/SC-textArea/ScTextArea.module.css
|
|
10192
10292
|
var ScTextArea_default = {
|
|
@@ -10216,7 +10316,7 @@ var ScTextArea = ({
|
|
|
10216
10316
|
style,
|
|
10217
10317
|
...props
|
|
10218
10318
|
}) => {
|
|
10219
|
-
const [focused, setFocused] = (0,
|
|
10319
|
+
const [focused, setFocused] = (0, import_react25.useState)(false);
|
|
10220
10320
|
const derivedState = state ?? (props.disabled ? "disabled" : focused ? "active" : (props.value !== void 0 ? String(props.value).length > 0 : false) ? "filled" : "default");
|
|
10221
10321
|
const stateClass = ScTextArea_default["state-" + derivedState];
|
|
10222
10322
|
const labelGroupClass = ScTextArea_default["label-group-" + (labelGroup || "none")];
|
|
@@ -10258,7 +10358,7 @@ var ScTextArea = ({
|
|
|
10258
10358
|
};
|
|
10259
10359
|
|
|
10260
10360
|
// src/SC-select/ScSelect.tsx
|
|
10261
|
-
var
|
|
10361
|
+
var import_react26 = require("react");
|
|
10262
10362
|
|
|
10263
10363
|
// src/SC-select/ScSelect.module.css
|
|
10264
10364
|
var ScSelect_default = {
|
|
@@ -10295,9 +10395,9 @@ var ScSelect = (props) => {
|
|
|
10295
10395
|
disabled = false,
|
|
10296
10396
|
className
|
|
10297
10397
|
} = props;
|
|
10298
|
-
const [open, setOpen] = (0,
|
|
10299
|
-
const rootRef = (0,
|
|
10300
|
-
(0,
|
|
10398
|
+
const [open, setOpen] = (0, import_react26.useState)(false);
|
|
10399
|
+
const rootRef = (0, import_react26.useRef)(null);
|
|
10400
|
+
(0, import_react26.useEffect)(() => {
|
|
10301
10401
|
if (!open) return;
|
|
10302
10402
|
const handleClick = (e) => {
|
|
10303
10403
|
if (rootRef.current && !rootRef.current.contains(e.target)) {
|
|
@@ -10388,7 +10488,7 @@ var ScSelect = (props) => {
|
|
|
10388
10488
|
};
|
|
10389
10489
|
|
|
10390
10490
|
// src/SC-fileField/ScFileField.tsx
|
|
10391
|
-
var
|
|
10491
|
+
var import_react27 = require("react");
|
|
10392
10492
|
|
|
10393
10493
|
// src/SC-fileField/ScFileField.module.css
|
|
10394
10494
|
var ScFileField_default = {
|
|
@@ -10426,7 +10526,7 @@ var ScFileField = (props) => {
|
|
|
10426
10526
|
label,
|
|
10427
10527
|
className
|
|
10428
10528
|
} = props;
|
|
10429
|
-
const inputRef = (0,
|
|
10529
|
+
const inputRef = (0, import_react27.useRef)(null);
|
|
10430
10530
|
const hasFile = Boolean(fileName);
|
|
10431
10531
|
const isUploading = Boolean(uploading);
|
|
10432
10532
|
const clampedProgress = Math.max(0, Math.min(100, progress));
|
|
@@ -10545,7 +10645,7 @@ var ScFileField = (props) => {
|
|
|
10545
10645
|
};
|
|
10546
10646
|
|
|
10547
10647
|
// src/SC-mediaApproval/ScMediaApproval.tsx
|
|
10548
|
-
var
|
|
10648
|
+
var import_react28 = require("react");
|
|
10549
10649
|
|
|
10550
10650
|
// src/SC-mediaApproval/ScMediaApproval.module.css
|
|
10551
10651
|
var ScMediaApproval_default = {
|
|
@@ -10592,9 +10692,9 @@ var ScMediaApproval = (props) => {
|
|
|
10592
10692
|
className
|
|
10593
10693
|
} = props;
|
|
10594
10694
|
const total = mediaUrls.length;
|
|
10595
|
-
const [index, setIndex] = (0,
|
|
10596
|
-
const [mediaLoading, setMediaLoading] = (0,
|
|
10597
|
-
(0,
|
|
10695
|
+
const [index, setIndex] = (0, import_react28.useState)(activeIndex ?? 0);
|
|
10696
|
+
const [mediaLoading, setMediaLoading] = (0, import_react28.useState)(false);
|
|
10697
|
+
(0, import_react28.useEffect)(() => {
|
|
10598
10698
|
if (typeof activeIndex === "number") {
|
|
10599
10699
|
setIndex(activeIndex);
|
|
10600
10700
|
}
|
|
@@ -10729,7 +10829,7 @@ var ScMediaApproval = (props) => {
|
|
|
10729
10829
|
};
|
|
10730
10830
|
|
|
10731
10831
|
// src/SC-mediaSelect/ScMediaSelect.tsx
|
|
10732
|
-
var
|
|
10832
|
+
var import_react29 = require("react");
|
|
10733
10833
|
|
|
10734
10834
|
// src/SC-mediaSelect/ScMediaSelect.module.css
|
|
10735
10835
|
var ScMediaSelect_default = {
|
|
@@ -10785,7 +10885,7 @@ var ScMediaSelect = (props) => {
|
|
|
10785
10885
|
} = props;
|
|
10786
10886
|
const total = items.length;
|
|
10787
10887
|
const resolvedMax = typeof max === "number" ? max : total;
|
|
10788
|
-
const selectedSet = (0,
|
|
10888
|
+
const selectedSet = (0, import_react29.useMemo)(() => new Set(selected), [selected]);
|
|
10789
10889
|
const selectedCount = selectedSet.size;
|
|
10790
10890
|
let countLabel = selectedCount + " of " + total + " selected";
|
|
10791
10891
|
if (min > 0) countLabel += " (min " + min + ")";
|
|
@@ -10854,7 +10954,7 @@ var ScMediaSelect = (props) => {
|
|
|
10854
10954
|
};
|
|
10855
10955
|
|
|
10856
10956
|
// src/SC-todoList/ScTodoList.tsx
|
|
10857
|
-
var
|
|
10957
|
+
var import_react30 = require("react");
|
|
10858
10958
|
|
|
10859
10959
|
// src/SC-todoList/ScTodoList.module.css
|
|
10860
10960
|
var ScTodoList_default = {
|
|
@@ -10887,9 +10987,9 @@ var ScTodoList = ({
|
|
|
10887
10987
|
addPlaceholder = "Add an item",
|
|
10888
10988
|
className
|
|
10889
10989
|
}) => {
|
|
10890
|
-
const [editingId, setEditingId] = (0,
|
|
10891
|
-
const [editValue, setEditValue] = (0,
|
|
10892
|
-
const [newValue, setNewValue] = (0,
|
|
10990
|
+
const [editingId, setEditingId] = (0, import_react30.useState)(null);
|
|
10991
|
+
const [editValue, setEditValue] = (0, import_react30.useState)("");
|
|
10992
|
+
const [newValue, setNewValue] = (0, import_react30.useState)("");
|
|
10893
10993
|
const total = items.length;
|
|
10894
10994
|
const completed = items.filter((i) => i.status === "completed").length;
|
|
10895
10995
|
const startEditing = (item) => {
|
|
@@ -11743,7 +11843,7 @@ var ScWorkspaceSwitchMobileV2 = ({
|
|
|
11743
11843
|
};
|
|
11744
11844
|
|
|
11745
11845
|
// src/SC-imageField/ScImageField.tsx
|
|
11746
|
-
var
|
|
11846
|
+
var import_react31 = require("react");
|
|
11747
11847
|
|
|
11748
11848
|
// src/SC-imageField/ScImageField.module.css
|
|
11749
11849
|
var ScImageField_default = {
|
|
@@ -11770,7 +11870,7 @@ var ScImageField = ({
|
|
|
11770
11870
|
onRemove,
|
|
11771
11871
|
className
|
|
11772
11872
|
}) => {
|
|
11773
|
-
const inputRef = (0,
|
|
11873
|
+
const inputRef = (0, import_react31.useRef)(null);
|
|
11774
11874
|
const hasImage = !!imagePreview;
|
|
11775
11875
|
function handleClick() {
|
|
11776
11876
|
if (!hasImage) {
|
|
@@ -12006,7 +12106,7 @@ var ScPlanDetailsCardMobile = ({
|
|
|
12006
12106
|
};
|
|
12007
12107
|
|
|
12008
12108
|
// src/SC-ProfilePopup/ScProfilePopup.tsx
|
|
12009
|
-
var
|
|
12109
|
+
var import_react32 = require("react");
|
|
12010
12110
|
|
|
12011
12111
|
// src/SC-ProfilePopup/ScProfilePopup.module.css
|
|
12012
12112
|
var ScProfilePopup_default = {
|
|
@@ -12040,7 +12140,7 @@ var activateOnKey = (handler) => (event) => {
|
|
|
12040
12140
|
handler();
|
|
12041
12141
|
}
|
|
12042
12142
|
};
|
|
12043
|
-
var ScProfilePopup = (0,
|
|
12143
|
+
var ScProfilePopup = (0, import_react32.forwardRef)(
|
|
12044
12144
|
({
|
|
12045
12145
|
name = "Chris Hemsworth",
|
|
12046
12146
|
email = "chris@kepler.com",
|