@amboss/design-system 4.6.3 → 4.6.6-canary.0
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/build/cjs/components/Content/ContentTable/ContentTable.js +4 -1
- package/build/cjs/components/Internal/PanelHeader/PanelHeader.d.ts +4 -1
- package/build/cjs/components/Internal/PanelHeader/PanelHeader.js +1 -1
- package/build/cjs/components/Internal/Sandwich/-types.d.ts +5 -0
- package/build/cjs/components/Internal/Sandwich/Sandwich.d.ts +1 -1
- package/build/cjs/components/Internal/Sandwich/Sandwich.js +1 -1
- package/build/cjs/components/Layout/-types.d.ts +52 -13
- package/build/cjs/components/Layout/Layout.d.ts +4 -0
- package/build/cjs/components/Layout/Layout.js +1 -1
- package/build/cjs/components/Layout/LayoutProvider.js +1 -1
- package/build/cjs/components/Layout/LeftNavBar/LeftNavBar.d.ts +17 -0
- package/build/cjs/components/Layout/LeftNavBar/LeftNavBar.js +1 -0
- package/build/cjs/components/Layout/LeftNavBar/LeftNavBarFooter.d.ts +7 -0
- package/build/cjs/components/Layout/LeftNavBar/LeftNavBarFooter.js +1 -0
- package/build/cjs/components/Layout/LeftPanel/LeftBarLayers.d.ts +36 -0
- package/build/cjs/components/Layout/LeftPanel/LeftBarLayers.js +1 -0
- package/build/cjs/components/Layout/LeftPanel/LeftBarToggle.d.ts +15 -0
- package/build/cjs/components/Layout/LeftPanel/LeftBarToggle.js +1 -0
- package/build/cjs/components/Layout/LeftPanel/LeftPanel.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftPanelDocked.d.ts +15 -5
- package/build/cjs/components/Layout/LeftPanel/LeftPanelDocked.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftPanelFooter.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftPanelHeader.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftPanelOffcanvas.d.ts +29 -0
- package/build/cjs/components/Layout/LeftPanel/LeftPanelOffcanvas.js +1 -0
- package/build/cjs/components/Layout/LeftPanel/useLeftBarContext.d.ts +11 -0
- package/build/cjs/components/Layout/LeftPanel/useLeftBarContext.js +1 -0
- package/build/cjs/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +11 -0
- package/build/cjs/components/Layout/LeftPanel/useLeftPanelCollapseContext.js +1 -0
- package/build/cjs/components/Layout/context.d.ts +1 -5
- package/build/cjs/components/Layout/context.js +1 -1
- package/build/cjs/components/Layout/rules.js +1 -1
- package/build/cjs/components/Layout/useLayoutRules.js +1 -1
- package/build/cjs/components/Layout/useLeftPanelId.d.ts +6 -0
- package/build/cjs/components/Layout/useLeftPanelId.js +1 -0
- package/build/cjs/components/Layout/usePanelDockedSlide.d.ts +10 -5
- package/build/cjs/components/Layout/usePanelDockedSlide.js +1 -1
- package/build/{esm/components/Layout/useFloatablePortalTargets.d.ts → cjs/components/Layout/usePortalTargets.d.ts} +8 -10
- package/build/cjs/components/Layout/usePortalTargets.js +1 -0
- package/build/cjs/shared/mixins/getLeftPanelFadeStyles.d.ts +19 -0
- package/build/cjs/shared/mixins/getLeftPanelFadeStyles.js +1 -0
- package/build/cjs/shared/mixins/index.d.ts +1 -0
- package/build/cjs/shared/mixins/index.js +1 -1
- package/build/cjs/web-tokens/_colors.json +20 -4
- package/build/cjs/web-tokens/_sizes.json +64 -54
- package/build/cjs/web-tokens/visualConfig.d.ts +27 -1
- package/build/cjs/web-tokens/visualConfig.js +1 -1
- package/build/esm/components/Content/ContentTable/ContentTable.js +4 -1
- package/build/esm/components/Internal/PanelHeader/PanelHeader.d.ts +4 -1
- package/build/esm/components/Internal/PanelHeader/PanelHeader.js +1 -1
- package/build/esm/components/Internal/Sandwich/-types.d.ts +5 -0
- package/build/esm/components/Internal/Sandwich/Sandwich.d.ts +1 -1
- package/build/esm/components/Internal/Sandwich/Sandwich.js +1 -1
- package/build/esm/components/Layout/-types.d.ts +52 -13
- package/build/esm/components/Layout/Layout.d.ts +4 -0
- package/build/esm/components/Layout/Layout.js +1 -1
- package/build/esm/components/Layout/LayoutProvider.js +1 -1
- package/build/esm/components/Layout/LeftNavBar/LeftNavBar.d.ts +17 -0
- package/build/esm/components/Layout/LeftNavBar/LeftNavBar.js +1 -0
- package/build/esm/components/Layout/LeftNavBar/LeftNavBarFooter.d.ts +7 -0
- package/build/esm/components/Layout/LeftNavBar/LeftNavBarFooter.js +1 -0
- package/build/esm/components/Layout/LeftPanel/LeftBarLayers.d.ts +36 -0
- package/build/esm/components/Layout/LeftPanel/LeftBarLayers.js +1 -0
- package/build/esm/components/Layout/LeftPanel/LeftBarToggle.d.ts +15 -0
- package/build/esm/components/Layout/LeftPanel/LeftBarToggle.js +1 -0
- package/build/esm/components/Layout/LeftPanel/LeftPanel.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftPanelDocked.d.ts +15 -5
- package/build/esm/components/Layout/LeftPanel/LeftPanelDocked.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftPanelDrawer.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftPanelFooter.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftPanelHeader.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftPanelOffcanvas.d.ts +29 -0
- package/build/esm/components/Layout/LeftPanel/LeftPanelOffcanvas.js +1 -0
- package/build/esm/components/Layout/LeftPanel/useLeftBarContext.d.ts +11 -0
- package/build/esm/components/Layout/LeftPanel/useLeftBarContext.js +1 -0
- package/build/esm/components/Layout/LeftPanel/useLeftPanelCollapseContext.d.ts +11 -0
- package/build/esm/components/Layout/LeftPanel/useLeftPanelCollapseContext.js +1 -0
- package/build/esm/components/Layout/context.d.ts +1 -5
- package/build/esm/components/Layout/context.js +1 -1
- package/build/esm/components/Layout/rules.js +1 -1
- package/build/esm/components/Layout/useLayoutRules.js +1 -1
- package/build/esm/components/Layout/useLeftPanelId.d.ts +6 -0
- package/build/esm/components/Layout/useLeftPanelId.js +1 -0
- package/build/esm/components/Layout/usePanelDockedSlide.d.ts +10 -5
- package/build/esm/components/Layout/usePanelDockedSlide.js +1 -1
- package/build/{cjs/components/Layout/useFloatablePortalTargets.d.ts → esm/components/Layout/usePortalTargets.d.ts} +8 -10
- package/build/esm/components/Layout/usePortalTargets.js +1 -0
- package/build/esm/shared/mixins/getLeftPanelFadeStyles.d.ts +19 -0
- package/build/esm/shared/mixins/getLeftPanelFadeStyles.js +1 -0
- package/build/esm/shared/mixins/index.d.ts +1 -0
- package/build/esm/shared/mixins/index.js +1 -1
- package/build/esm/web-tokens/_colors.json +20 -4
- package/build/esm/web-tokens/_sizes.json +64 -54
- package/build/esm/web-tokens/visualConfig.d.ts +27 -1
- package/build/esm/web-tokens/visualConfig.js +1 -1
- package/build/scss/_dark.scss +4 -1
- package/build/scss/_light.scss +4 -1
- package/build/scss/_variables.scss +7 -1
- package/package.json +1 -1
- package/build/cjs/components/Layout/PanelSlideBody.d.ts +0 -18
- package/build/cjs/components/Layout/PanelSlideBody.js +0 -1
- package/build/cjs/components/Layout/useFloatablePortalTargets.js +0 -1
- package/build/esm/components/Layout/PanelSlideBody.d.ts +0 -18
- package/build/esm/components/Layout/PanelSlideBody.js +0 -1
- package/build/esm/components/Layout/useFloatablePortalTargets.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"DEFAULT_LAYOUT_RULES",{enumerable:!0,get:function(){return DEFAULT_LAYOUT_RULES}});const DEFAULT_LAYOUT_RULES={maxDockedPanels:{xs:1,m:2,l:3},rightPanel:{priority:1,condition:({isLowPrio,isMobile,layout})=>{isLowPrio&&!isMobile&&layout.rightPanel.setVariant("float")}},splitview:{priority:2,condition:({isLowPrio,isMobile,layout})=>{isLowPrio&&!isMobile&&layout.splitview.hide()}},leftPanel:{priority:3,condition:({isLowPrio,isMobile,layout})=>{let variant=isMobile
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"DEFAULT_LAYOUT_RULES",{enumerable:!0,get:function(){return DEFAULT_LAYOUT_RULES}});const leftPanelVariantFor=({isMobile,isLowPrio})=>isMobile?"drawer":isLowPrio?"offcanvas":"sidebar",DEFAULT_LAYOUT_RULES={maxDockedPanels:{xs:1,m:2,l:3},rightPanel:{priority:1,condition:({isLowPrio,isMobile,layout})=>{isLowPrio&&!isMobile&&layout.rightPanel.setVariant("float")}},splitview:{priority:2,condition:({isLowPrio,isMobile,layout})=>{isLowPrio&&!isMobile&&layout.splitview.hide()}},leftPanel:{priority:3,condition:({isLowPrio,isMobile,layout})=>{let variant=leftPanelVariantFor({isMobile,isLowPrio});variant!==layout.leftPanel.state.variant&&(layout.leftPanel.setVariant(variant),"offcanvas"===variant&&layout.leftPanel.hide())}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useLayoutRules",{enumerable:!0,get:function(){return useLayoutRules}});const _react=require("react"),_useBreakpoints=require("../../shared/useBreakpoints"),_constants=require("./-constants"),DEFAULT_PRIORITY={[_constants.Slot.rightPanel]:1,[_constants.Slot.splitview]:2,[_constants.Slot.leftPanel]:3},maxDockedFor=(maxDockedPanels,breakpoints)=>{let{xs,m=xs,l=m}=maxDockedPanels;return breakpoints.isMobile?xs:breakpoints.isTablet?m:l},isDockedPanel=({state,declared,slot})=>!!declared[slot]&&!!state[slot].visible&&(slot===_constants.Slot.rightPanel?"float"!==state.rightPanel.variant:slot!==_constants.Slot.leftPanel||"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"useLayoutRules",{enumerable:!0,get:function(){return useLayoutRules}});const _react=require("react"),_useBreakpoints=require("../../shared/useBreakpoints"),_constants=require("./-constants"),DEFAULT_PRIORITY={[_constants.Slot.rightPanel]:1,[_constants.Slot.splitview]:2,[_constants.Slot.leftPanel]:3},maxDockedFor=(maxDockedPanels,breakpoints)=>{let{xs,m=xs,l=m}=maxDockedPanels;return breakpoints.isMobile?xs:breakpoints.isTablet?m:l},isDockedPanel=({state,declared,slot})=>!!declared[slot]&&!!state[slot].visible&&(slot===_constants.Slot.rightPanel?"float"!==state.rightPanel.variant:slot!==_constants.Slot.leftPanel||"sidebar"===state.leftPanel.variant),resolveLowPrioSlots=({rules,state,declared,breakpoints})=>{let freeSlots=Math.max(0,maxDockedFor(rules.maxDockedPanels,breakpoints)-1),priorityFor=slot=>rules[slot]?.priority??DEFAULT_PRIORITY[slot],outranks=(slot,other)=>{let byPriority=priorityFor(slot)-priorityFor(other);return 0!==byPriority?byPriority<0:_constants.PANEL_ORDER.indexOf(slot)<_constants.PANEL_ORDER.indexOf(other)},countStrongerDocked=slot=>_constants.TOGGLABLE_SLOTS.filter(other=>other!==slot&&isDockedPanel({state,declared,slot:other})&&outranks(other,slot)).length;return _constants.TOGGLABLE_SLOTS.filter(slot=>countStrongerDocked(slot)>=freeSlots)};function useLayoutRules({layout,declared,rules,additionalData}){let layoutRef=(0,_react.useRef)(layout);layoutRef.current=layout;let{isMobile,isTablet,isDesktop}=(0,_useBreakpoints.useBreakpoints)(),{state}=layout;(0,_react.useEffect)(()=>{if(!rules)return;let lowPrioSlots=resolveLowPrioSlots({rules,state,declared,breakpoints:{isMobile,isTablet,isDesktop}});_constants.TOGGLABLE_SLOTS.forEach(slot=>{let condition=rules[slot]?.condition;condition&&condition({...additionalData,isLowPrio:lowPrioSlots.includes(slot),isMobile,isTablet,isDesktop,layout:layoutRef.current})})},[rules,additionalData,state,declared,isMobile,isTablet,isDesktop])}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** DOM id of the rendered left panel, generated once per `Layout`. Lets a
|
|
2
|
+
* control living OUTSIDE the panel - the nav left bar's open button - point
|
|
3
|
+
* `aria-controls` at it without the two components knowing each other. Empty
|
|
4
|
+
* outside a `Layout`, where there is no panel to reference. */
|
|
5
|
+
export declare const LeftPanelIdContext: React.Context<string>;
|
|
6
|
+
export declare const useLeftPanelId: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get LeftPanelIdContext(){return LeftPanelIdContext},get useLeftPanelId(){return useLeftPanelId}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _react=require("react"),LeftPanelIdContext=(0,_react.createContext)(""),useLeftPanelId=()=>(0,_react.useContext)(LeftPanelIdContext);
|
|
@@ -14,6 +14,12 @@ export type PanelDockedSlideOptions = {
|
|
|
14
14
|
/** Forwarded to the declaration: lock the column's width when the window
|
|
15
15
|
* resizes. Doesn't affect the slide, which resizes the column outright. */
|
|
16
16
|
lockWidthOnWindowResize?: boolean;
|
|
17
|
+
/** Width the column rests at while hidden, instead of collapsing to nothing.
|
|
18
|
+
* Set it and the column never unmounts: closing narrows it to this, opening
|
|
19
|
+
* widens it back, so one box carries both states (a nav left bar that widens
|
|
20
|
+
* into the panel). The column stops being collapsible - there is no zero to
|
|
21
|
+
* collapse to - and this becomes its `minSize` while it is hidden. */
|
|
22
|
+
collapsedSize?: Size;
|
|
17
23
|
};
|
|
18
24
|
export type PanelDockedSlide = {
|
|
19
25
|
/** Whether the panel's content should render at all (entering, open, or
|
|
@@ -26,10 +32,9 @@ export type PanelDockedSlide = {
|
|
|
26
32
|
/**
|
|
27
33
|
* Animates a docked side panel's open/close as a width slide on its
|
|
28
34
|
* `react-resizable-panels` column, pushing neighbouring content smoothly
|
|
29
|
-
* instead of snapping. Slot-generic - works for either side panel
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* reduced motion is requested. The mobile modal-drawer lifecycle lives in
|
|
35
|
+
* instead of snapping. Slot-generic - works for either side panel. Falls back to
|
|
36
|
+
* an instant open/close when the panel isn't collapsible, no handle is
|
|
37
|
+
* available, or reduced motion is requested. The mobile modal-drawer lifecycle lives in
|
|
33
38
|
* {@link useExitAnimation} and the Drawer's styled components.
|
|
34
39
|
*/
|
|
35
|
-
export declare function usePanelDockedSlide({ slot, defaultSize, minSize, maxSize, collapsible, resizable, lockWidthOnWindowResize, }: PanelDockedSlideOptions): PanelDockedSlide;
|
|
40
|
+
export declare function usePanelDockedSlide({ slot, defaultSize, minSize, maxSize, collapsible, resizable, lockWidthOnWindowResize, collapsedSize, }: PanelDockedSlideOptions): PanelDockedSlide;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"usePanelDockedSlide",{enumerable:!0,get:function(){return usePanelDockedSlide}});const _react=require("react"),_react1=require("@emotion/react"),_useWindow=require("../../shared/useWindow"),_prefersReducedMotion=require("../../shared/prefersReducedMotion"),_registry=require("./registry"),_useLayout=require("./useLayout"),parseDurationMs=duration=>{let trimmed=duration.trim();return trimmed.endsWith("ms")?parseFloat(trimmed):trimmed.endsWith("s")?1e3*parseFloat(trimmed):parseFloat(trimmed)||0},resolveSizePx=(size,groupWidthPx)=>{if("number"==typeof size)return size;if("string"!=typeof size)return null;let parsed=parseFloat(size);return Number.isFinite(parsed)?size.trim().endsWith("px")?parsed:null!=groupWidthPx?parsed/100*groupWidthPx:null:null},groupColumnsOf=element=>{let columns=element.closest("[data-group]")?.querySelectorAll("[data-panel]");return columns?Array.from(columns):[element]},isHandleReady=handle=>{try{return handle.isCollapsed(),!0}catch{return!1}};function usePanelDockedSlide({slot,defaultSize,minSize,maxSize,collapsible,resizable,lockWidthOnWindowResize}){let{isVisible,state}=(0,_useLayout.useLayout)()[slot],theme=(0,_react1.useTheme)(),window=(0,_useWindow.useWindow)(),animation=(0,_registry.usePanelAnimationControl)(),reducedMotion=(0,_prefersReducedMotion.prefersReducedMotion)(window),[isMounted,setIsMounted]=(0,_react.useState)(isVisible),[phase,setPhase]=(0,_react.useState)("idle"),[pinnedWidth,setPinnedWidth]=(0,_react.useState)(null),[prevVisible,setPrevVisible]=(0,_react.useState)(isVisible);
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"usePanelDockedSlide",{enumerable:!0,get:function(){return usePanelDockedSlide}});const _react=require("react"),_react1=require("@emotion/react"),_useWindow=require("../../shared/useWindow"),_prefersReducedMotion=require("../../shared/prefersReducedMotion"),_registry=require("./registry"),_useLayout=require("./useLayout"),parseDurationMs=duration=>{let trimmed=duration.trim();return trimmed.endsWith("ms")?parseFloat(trimmed):trimmed.endsWith("s")?1e3*parseFloat(trimmed):parseFloat(trimmed)||0},resolveSizePx=(size,groupWidthPx)=>{if("number"==typeof size)return size;if("string"!=typeof size)return null;let parsed=parseFloat(size);return Number.isFinite(parsed)?size.trim().endsWith("px")?parsed:null!=groupWidthPx?parsed/100*groupWidthPx:null:null},groupColumnsOf=element=>{let columns=element.closest("[data-group]")?.querySelectorAll("[data-panel]");return columns?Array.from(columns):[element]},isHandleReady=handle=>{try{return handle.isCollapsed(),!0}catch{return!1}},mountDefaultSizeFor=({collapsedSize,defaultSize,isVisible,isSlidingIn})=>void 0!==collapsedSize?isVisible?defaultSize:collapsedSize:isSlidingIn?0:defaultSize;function usePanelDockedSlide({slot,defaultSize,minSize,maxSize,collapsible,resizable,lockWidthOnWindowResize,collapsedSize}){let{isVisible,state}=(0,_useLayout.useLayout)()[slot],theme=(0,_react1.useTheme)(),window=(0,_useWindow.useWindow)(),animation=(0,_registry.usePanelAnimationControl)(),reducedMotion=(0,_prefersReducedMotion.prefersReducedMotion)(window),hasCollapsedRest=void 0!==collapsedSize,isCollapsible=collapsible&&!hasCollapsedRest,[isMounted,setIsMounted]=(0,_react.useState)(isVisible),[phase,setPhase]=(0,_react.useState)("idle"),[pinnedWidth,setPinnedWidth]=(0,_react.useState)(null),[prevVisible,setPrevVisible]=(0,_react.useState)(isVisible);isVisible!==prevVisible&&(setPrevVisible(isVisible),setPhase(isVisible?"entering":"exiting"),isVisible&&setIsMounted(!0));let openSize=hasCollapsedRest?state.size??defaultSize:defaultSize;return(0,_registry.useDeclarePanel)(slot,{defaultSize:mountDefaultSizeFor({collapsedSize,defaultSize:openSize,isVisible,isSlidingIn:"entering"===phase&&collapsible&&!reducedMotion}),minSize:hasCollapsedRest&&!isVisible?collapsedSize:minSize??collapsedSize,maxSize,collapsible:isCollapsible,resizable,lockWidthOnWindowResize}),(0,_registry.usePanelPresence)(slot,hasCollapsedRest||isMounted),(0,_react.useLayoutEffect)(()=>{if(!hasCollapsedRest)return;let frame=0,restSize=isVisible?openSize??minSize:collapsedSize,resizeToRest=attempt=>{let handle=animation?.getHandle(slot)??null;if(handle&&isHandleReady(handle)){try{void 0!==restSize&&handle.resize(restSize)}catch{}return}animation&&!(attempt>=30)&&(frame=window.requestAnimationFrame(()=>resizeToRest(attempt+1)))};return resizeToRest(0),()=>window.cancelAnimationFrame(frame)},[]),(0,_react.useLayoutEffect)(()=>{if("idle"===phase)return;let cancelled=!1,frame=0,settleTimer=0,animatedColumns=[];animation?.setResizeSuppressed(slot,!0);let{duration,timingFunction}=hasCollapsedRest?theme.variables.animation.navSlide.collapse:theme.variables.animation.navSlide.open,durationMs=parseDurationMs(duration),setColumnTransitions=enabled=>{animatedColumns.forEach(column=>{enabled?column.style.setProperty("transition",`flex-grow ${duration} ${timingFunction}`):column.style.removeProperty("transition")})},targetSize=state.size??defaultSize??minSize,openColumn=(handle,targetPx)=>{handle.isCollapsed()&&handle.expand(),handle.resize(targetPx??targetSize??minSize??"20%")},settle=handle=>{if(setColumnTransitions(!1),animation?.setResizeSuppressed(slot,!1),"entering"===phase&&handle&&!hasCollapsedRest)try{handle.getSize().inPixels<1&&openColumn(handle,null)}catch{}setPinnedWidth(null),"exiting"!==phase||hasCollapsedRest||setIsMounted(!1),setPhase("idle")},runSlide=(handle,element)=>{animatedColumns=groupColumnsOf(element);let groupWidthPx=element.closest("[data-group]")?.getBoundingClientRect().width??null,targetPx=resolveSizePx(targetSize,groupWidthPx),collapsedPx=resolveSizePx(collapsedSize,groupWidthPx);setPinnedWidth("entering"===phase?targetPx:handle.getSize().inPixels),reducedMotion||setColumnTransitions(!0),element.getBoundingClientRect();try{"entering"===phase?openColumn(handle,targetPx):hasCollapsedRest?handle.resize(collapsedPx??collapsedSize):handle.collapse()}catch{settle(handle);return}settleTimer=window.setTimeout(()=>settle(handle),reducedMotion?0:durationMs+80)},waitsForRelaxedMinimum="exiting"===phase&&hasCollapsedRest,waitForColumn=attempt=>{if(cancelled)return;if(0===attempt&&waitsForRelaxedMinimum){frame=window.requestAnimationFrame(()=>waitForColumn(attempt+1));return}let handle=animation?.getHandle(slot)??null,element=animation?.getElement(slot)??null;return handle&&element&&isHandleReady(handle)?void runSlide(handle,element):"exiting"===phase||!animation||attempt>=30?void settle(handle):void(frame=window.requestAnimationFrame(()=>waitForColumn(attempt+1)))};return collapsible||hasCollapsedRest?waitForColumn(0):settle(animation?.getHandle(slot)??null),()=>{cancelled=!0,window.cancelAnimationFrame(frame),window.clearTimeout(settleTimer),setColumnTransitions(!1),animation?.setResizeSuppressed(slot,!1)}},[phase,slot,collapsible,hasCollapsedRest,reducedMotion,animation,window,theme]),{isMounted:hasCollapsedRest||isMounted,pinnedWidth}}
|
|
@@ -7,15 +7,13 @@ import type { SlotKey } from "./-types";
|
|
|
7
7
|
* - **slot host** - the `<div>` a panel occupies in the docked row (one per
|
|
8
8
|
* shown slot, captured via ref).
|
|
9
9
|
* - **float host** - the `<div>` inside the floating window's shell.
|
|
10
|
-
* - **carrier** - a persistent `<div>` that carries
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* carrier, whose identity never changes - so the panel's children keep
|
|
16
|
-
* their state across dock ↔ float instead of remounting.
|
|
10
|
+
* - **carrier** - a persistent `<div>` that carries one slot's children,
|
|
11
|
+
* physically reparented whenever that slot's host changes.
|
|
12
|
+
* - **portal target** - what a marker portals its content into: always the
|
|
13
|
+
* slot's carrier, whose identity never changes - so a panel's children keep
|
|
14
|
+
* their state across a host change instead of remounting.
|
|
17
15
|
*/
|
|
18
|
-
type
|
|
16
|
+
type PortalTargetsArgs = {
|
|
19
17
|
/** All slots, in row order. */
|
|
20
18
|
slots: readonly SlotKey[];
|
|
21
19
|
/** The single slot whose content may move into the floating window. */
|
|
@@ -23,7 +21,7 @@ type FloatablePortalTargetsArgs = {
|
|
|
23
21
|
/** Whether the floatable slot is currently floating. */
|
|
24
22
|
isFloating: boolean;
|
|
25
23
|
};
|
|
26
|
-
type
|
|
24
|
+
type PortalTargetsResult = {
|
|
27
25
|
/** Per-slot portal targets - what markers portal content into. */
|
|
28
26
|
portalTargets: PortalTargets;
|
|
29
27
|
/** The docked-row host elements, keyed by slot (for width observers etc.). */
|
|
@@ -33,5 +31,5 @@ type FloatablePortalTargetsResult = {
|
|
|
33
31
|
/** Ref callback for the floating window's content host `<div>`. */
|
|
34
32
|
floatHostRef: (el: HTMLElement | null) => void;
|
|
35
33
|
};
|
|
36
|
-
export declare const
|
|
34
|
+
export declare const usePortalTargets: ({ slots, floatableSlot, isFloating, }: PortalTargetsArgs) => PortalTargetsResult;
|
|
37
35
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"usePortalTargets",{enumerable:!0,get:function(){return usePortalTargets}});const _react=require("react"),_useDocument=require("../../shared/useDocument"),usePortalContainerRefs=keys=>{let[elements,setElements]=(0,_react.useState)({});return[elements,(0,_react.useMemo)(()=>{let map={};return keys.forEach(key=>{map[key]=el=>setElements(prev=>prev[key]===el?prev:{...prev,[key]:el})}),map},[keys])]},createCarrierNode=document=>{let node=document.createElement("div");return node.style.height="100%",node.style.width="100%",node.style.position="relative",node},useReparentingPortalNodes=({slots,hosts})=>{let document=(0,_useDocument.useDocument)(),[carriers]=(0,_react.useState)(()=>document?slots.reduce((created,slot)=>({...created,[slot]:createCarrierNode(document)}),{}):{});return(0,_react.useLayoutEffect)(()=>{slots.forEach(slot=>{let carrier=carriers[slot],host=hosts[slot];carrier&&host&&carrier.parentElement!==host&&host.appendChild(carrier)})},[slots,carriers,hosts]),carriers},takePlacedCarriers=({slots,hosts,carriers})=>slots.reduce((targets,slot)=>{let carrier=carriers[slot];return hosts[slot]||carrier?.parentElement?{...targets,[slot]:carrier}:targets},{}),usePortalTargets=({slots,floatableSlot,isFloating})=>{let[slotHosts,slotHostRefs]=usePortalContainerRefs(slots),[floatHost,setFloatHost]=(0,_react.useState)(null),carrierHosts=(0,_react.useMemo)(()=>isFloating?{...slotHosts,[floatableSlot]:floatHost}:slotHosts,[slotHosts,floatableSlot,isFloating,floatHost]),carriers=useReparentingPortalNodes({slots,hosts:carrierHosts});return{portalTargets:(0,_react.useMemo)(()=>takePlacedCarriers({slots,hosts:carrierHosts,carriers}),[slots,carrierHosts,carriers]),slotHosts,slotHostRefs,floatHostRef:setFloatHost}};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CSSObject, Theme } from "@emotion/react";
|
|
2
|
+
type PanelContentFadeOptions = {
|
|
3
|
+
theme: Theme;
|
|
4
|
+
/** Whether the content is currently faded out. */
|
|
5
|
+
isFaded: boolean;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Fades a docked panel's content out across its collapse, and back in at once
|
|
9
|
+
* when it reopens - the panel covers the left bar the instant it is shown, so
|
|
10
|
+
* there is nothing to reveal on the way in.
|
|
11
|
+
*
|
|
12
|
+
* Runs on the column's own slide timing, so the two move together.
|
|
13
|
+
*
|
|
14
|
+
* Applied per part rather than to the whole panel: a control at the header's
|
|
15
|
+
* trailing edge travels down onto the left bar's own and has to stay solid the
|
|
16
|
+
* whole way, so it is left out.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getLeftPanelFadeStyles({ theme, isFaded, }: PanelContentFadeOptions): CSSObject;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function getLeftPanelFadeStyles({theme,isFaded}){let{duration,timingFunction}=theme.variables.animation.navSlide.collapse;return{opacity:isFaded?theme.variables.opacity.hidden:theme.variables.opacity.visible,transition:isFaded?`opacity ${duration} ${timingFunction}`:"none","@media (prefers-reduced-motion: reduce)":{transition:"none"}}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"getLeftPanelFadeStyles",{enumerable:!0,get:function(){return getLeftPanelFadeStyles}});
|
|
@@ -6,4 +6,5 @@ export { getBaseButtonStyles } from "./Button/getBaseButtonStyles";
|
|
|
6
6
|
export { getPressedStyles } from "./Button/getPressedStyles";
|
|
7
7
|
export { getPillStyles } from "./Button/getPillStyles";
|
|
8
8
|
export { getFocusStyles } from "./getFocusStyles";
|
|
9
|
+
export { getLeftPanelFadeStyles } from "./getLeftPanelFadeStyles";
|
|
9
10
|
export { getPrimaryVariantStyles, getSecondaryVariantStyles, getTertiaryVariantStyles, } from "./Button/getVariantStyles";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get getBaseButtonStyles(){return _getBaseButtonStyles.getBaseButtonStyles},get getButtonAppearanceReset(){return _getButtonAppearanceReset.getButtonAppearanceReset},get getDisabledStyles(){return _getDisabledStyles.getDisabledStyles},get getFocusStyles(){return _getFocusStyles.getFocusStyles},get getInputTextPlaceholder(){return _getInputTextPlaceholder.getInputTextPlaceholder},get getInputTextStyles(){return _getInputTextStyles.getInputTextStyles},get getPillStyles(){return _getPillStyles.getPillStyles},get getPressedStyles(){return _getPressedStyles.getPressedStyles},get getPrimaryVariantStyles(){return _getVariantStyles.getPrimaryVariantStyles},get getSecondaryVariantStyles(){return _getVariantStyles.getSecondaryVariantStyles},get getTertiaryVariantStyles(){return _getVariantStyles.getTertiaryVariantStyles}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _getInputTextPlaceholder=require("./TextInput/getInputTextPlaceholder"),_getInputTextStyles=require("./TextInput/getInputTextStyles"),_getDisabledStyles=require("./Button/getDisabledStyles"),_getButtonAppearanceReset=require("./Button/getButtonAppearanceReset"),_getBaseButtonStyles=require("./Button/getBaseButtonStyles"),_getPressedStyles=require("./Button/getPressedStyles"),_getPillStyles=require("./Button/getPillStyles"),_getFocusStyles=require("./getFocusStyles"),_getVariantStyles=require("./Button/getVariantStyles");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get getBaseButtonStyles(){return _getBaseButtonStyles.getBaseButtonStyles},get getButtonAppearanceReset(){return _getButtonAppearanceReset.getButtonAppearanceReset},get getDisabledStyles(){return _getDisabledStyles.getDisabledStyles},get getFocusStyles(){return _getFocusStyles.getFocusStyles},get getInputTextPlaceholder(){return _getInputTextPlaceholder.getInputTextPlaceholder},get getInputTextStyles(){return _getInputTextStyles.getInputTextStyles},get getLeftPanelFadeStyles(){return _getLeftPanelFadeStyles.getLeftPanelFadeStyles},get getPillStyles(){return _getPillStyles.getPillStyles},get getPressedStyles(){return _getPressedStyles.getPressedStyles},get getPrimaryVariantStyles(){return _getVariantStyles.getPrimaryVariantStyles},get getSecondaryVariantStyles(){return _getVariantStyles.getSecondaryVariantStyles},get getTertiaryVariantStyles(){return _getVariantStyles.getTertiaryVariantStyles}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _getInputTextPlaceholder=require("./TextInput/getInputTextPlaceholder"),_getInputTextStyles=require("./TextInput/getInputTextStyles"),_getDisabledStyles=require("./Button/getDisabledStyles"),_getButtonAppearanceReset=require("./Button/getButtonAppearanceReset"),_getBaseButtonStyles=require("./Button/getBaseButtonStyles"),_getPressedStyles=require("./Button/getPressedStyles"),_getPillStyles=require("./Button/getPillStyles"),_getFocusStyles=require("./getFocusStyles"),_getLeftPanelFadeStyles=require("./getLeftPanelFadeStyles"),_getVariantStyles=require("./Button/getVariantStyles");
|
|
@@ -2198,10 +2198,26 @@
|
|
|
2198
2198
|
"color-content-table-row": {
|
|
2199
2199
|
"name": "content.table",
|
|
2200
2200
|
"subState": "row",
|
|
2201
|
-
"darkValue": "
|
|
2202
|
-
"darkOriginalValue": "night-
|
|
2203
|
-
"lightValue": "
|
|
2204
|
-
"lightOriginalValue": "
|
|
2201
|
+
"darkValue": "#32363e",
|
|
2202
|
+
"darkOriginalValue": "night-black.light01",
|
|
2203
|
+
"lightValue": "#e0e6eb",
|
|
2204
|
+
"lightOriginalValue": "gray.light02"
|
|
2205
|
+
},
|
|
2206
|
+
"color-content-table-cell": {
|
|
2207
|
+
"name": "content.table",
|
|
2208
|
+
"subState": "cell",
|
|
2209
|
+
"darkValue": "#5a7183",
|
|
2210
|
+
"darkOriginalValue": "gray.regular",
|
|
2211
|
+
"lightValue": "#bdc9d1",
|
|
2212
|
+
"lightOriginalValue": "gray.light01-alt01"
|
|
2213
|
+
},
|
|
2214
|
+
"color-content-table-col": {
|
|
2215
|
+
"name": "content.table",
|
|
2216
|
+
"subState": "col",
|
|
2217
|
+
"darkValue": "#24282d",
|
|
2218
|
+
"darkOriginalValue": "night-black.dark01",
|
|
2219
|
+
"lightValue": "#f5f7f9",
|
|
2220
|
+
"lightOriginalValue": "gray.light04"
|
|
2205
2221
|
},
|
|
2206
2222
|
"color-content-checkbox-background": {
|
|
2207
2223
|
"name": "content.checkbox",
|