@amboss/design-system 4.9.0 → 4.9.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/build/cjs/components/Content/ContentBox/constants.js +1 -1
- package/build/cjs/components/Content/ContentBox/types.d.ts +1 -1
- package/build/cjs/components/Internal/LayoutFloat/LayoutFloatDragHandleGuard.d.ts +3 -1
- package/build/cjs/components/Internal/LayoutFloat/LayoutFloatDragHandleGuard.js +1 -1
- package/build/cjs/components/Internal/PanelHeader/PanelHeader.js +1 -1
- package/build/cjs/components/Layout/-constants.d.ts +12 -0
- package/build/cjs/components/Layout/-constants.js +1 -1
- package/build/cjs/components/Layout/Layout.js +1 -1
- package/build/cjs/components/Layout/LeftPanel/LeftBarToggle.js +1 -1
- package/build/cjs/components/Layout/usePanelDockedSlide.d.ts +10 -0
- package/build/cjs/components/Layout/usePanelDockedSlide.js +1 -1
- package/build/cjs/components/Patterns/Modal/Modal.js +2 -2
- package/build/cjs/components/Tooltip/BaseTooltip.js +1 -1
- package/build/cjs/components/Tooltip/TooltipContent.d.ts +13 -1
- package/build/cjs/components/Tooltip/TooltipContent.js +1 -1
- package/build/cjs/components/Tooltip/utils.d.ts +0 -1
- package/build/cjs/components/Tooltip/utils.js +1 -1
- package/build/cjs/components/VirtualScrollList/VirtualScrollList.js +1 -1
- package/build/cjs/shared/parseDurationMs.d.ts +2 -0
- package/build/cjs/shared/parseDurationMs.js +1 -0
- package/build/cjs/web-tokens/assets/icons.json +4 -5
- package/build/cjs/web-tokens/assets/icons16.json +4 -5
- package/build/cjs/web-tokens/visualConfig.d.ts +14 -0
- package/build/cjs/web-tokens/visualConfig.js +1 -1
- package/build/esm/components/Content/ContentBox/constants.js +1 -1
- package/build/esm/components/Content/ContentBox/types.d.ts +1 -1
- package/build/esm/components/Internal/LayoutFloat/LayoutFloatDragHandleGuard.d.ts +3 -1
- package/build/esm/components/Internal/LayoutFloat/LayoutFloatDragHandleGuard.js +1 -1
- package/build/esm/components/Internal/PanelHeader/PanelHeader.js +1 -1
- package/build/esm/components/Layout/-constants.d.ts +12 -0
- package/build/esm/components/Layout/-constants.js +1 -1
- package/build/esm/components/Layout/Layout.js +1 -1
- package/build/esm/components/Layout/LeftPanel/LeftBarToggle.js +1 -1
- package/build/esm/components/Layout/usePanelDockedSlide.d.ts +10 -0
- package/build/esm/components/Layout/usePanelDockedSlide.js +1 -1
- package/build/esm/components/Patterns/Modal/Modal.js +2 -2
- package/build/esm/components/Tooltip/BaseTooltip.js +1 -1
- package/build/esm/components/Tooltip/TooltipContent.d.ts +13 -1
- package/build/esm/components/Tooltip/TooltipContent.js +1 -1
- package/build/esm/components/Tooltip/utils.d.ts +0 -1
- package/build/esm/components/Tooltip/utils.js +1 -1
- package/build/esm/components/VirtualScrollList/VirtualScrollList.js +1 -1
- package/build/esm/shared/parseDurationMs.d.ts +2 -0
- package/build/esm/shared/parseDurationMs.js +1 -0
- package/build/esm/web-tokens/assets/icons.json +4 -5
- package/build/esm/web-tokens/assets/icons16.json +4 -5
- package/build/esm/web-tokens/visualConfig.d.ts +14 -0
- package/build/esm/web-tokens/visualConfig.js +1 -1
- package/build/scss/_variables.scss +6 -0
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get CONTENT_BOX_TYPE_TO_COLOR_VARIANT(){return CONTENT_BOX_TYPE_TO_COLOR_VARIANT},get CONTENT_BOX_TYPE_TO_ICON(){return CONTENT_BOX_TYPE_TO_ICON},get TEXT_COLOR_BY_COLOR_VARIANT(){return TEXT_COLOR_BY_COLOR_VARIANT}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const CONTENT_BOX_TYPE_TO_COLOR_VARIANT={merke:"success",merkspruch:"info",cave:"error","clinic-box":"neutral","case-link":"success","
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get CONTENT_BOX_TYPE_TO_COLOR_VARIANT(){return CONTENT_BOX_TYPE_TO_COLOR_VARIANT},get CONTENT_BOX_TYPE_TO_ICON(){return CONTENT_BOX_TYPE_TO_ICON},get TEXT_COLOR_BY_COLOR_VARIANT(){return TEXT_COLOR_BY_COLOR_VARIANT}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const CONTENT_BOX_TYPE_TO_COLOR_VARIANT={merke:"success",merkspruch:"info",cave:"error","clinic-box":"neutral","case-link":"success","guideline-recommendations":"neutral"},TEXT_COLOR_BY_COLOR_VARIANT={info:"info",warning:"primary",error:"error",success:"success",neutral:"primary"},CONTENT_BOX_TYPE_TO_ICON={merke:"stethoscope",merkspruch:"bulb",cave:"alert-triangle","clinic-box":"stethoscope","case-link":"link","guideline-recommendations":"compass"};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type ContentBoxColorVariant = "info" | "error" | "success" | "warning" | "neutral";
|
|
2
|
-
export type ContentBoxType = "merke" | "merkspruch" | "cave" | "clinic-box" | "case-link" | "
|
|
2
|
+
export type ContentBoxType = "merke" | "merkspruch" | "cave" | "clinic-box" | "case-link" | "guideline-recommendations";
|
|
@@ -6,5 +6,7 @@ export type LayoutFloatDragHandleGuardProps = {
|
|
|
6
6
|
* Shields a header slot's content from the enclosing `LayoutFloatDragHandle`'s
|
|
7
7
|
* `moveProps`: a drag can still start on it, but its own click/arrow-key
|
|
8
8
|
* behavior wins. Inert (guards detached) while the handle isn't draggable.
|
|
9
|
+
* Renders nothing when there's no content to shield, so an absent slot
|
|
10
|
+
* doesn't leave an empty flex item behind for `Inline`'s gap to act on.
|
|
9
11
|
*/
|
|
10
|
-
export declare function LayoutFloatDragHandleGuard({ children, }: LayoutFloatDragHandleGuardProps): React.ReactElement;
|
|
12
|
+
export declare function LayoutFloatDragHandleGuard({ children, }: LayoutFloatDragHandleGuardProps): React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"LayoutFloatDragHandleGuard",{enumerable:!0,get:function(){return LayoutFloatDragHandleGuard}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_useLayoutFloatDragHandleContext=require("./useLayoutFloatDragHandleContext"),StyledSlotDragGuard=(0,_styled.default)("div",{target:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"LayoutFloatDragHandleGuard",{enumerable:!0,get:function(){return LayoutFloatDragHandleGuard}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_useLayoutFloatDragHandleContext=require("./useLayoutFloatDragHandleContext"),StyledSlotDragGuard=(0,_styled.default)("div",{target:"e15tse230",label:"StyledSlotDragGuard"})({display:"contents"});function LayoutFloatDragHandleGuard({children}){let{canDrag,onSlotPointerDown,onSlotPointerCancel,onSlotClickCapture,onSlotKeyDown}=(0,_useLayoutFloatDragHandleContext.useLayoutFloatDragHandleContext)();if(!children)return null;let guardProps={};return canDrag&&(guardProps={onPointerDown:onSlotPointerDown,onPointerCancel:onSlotPointerCancel,onClickCapture:onSlotClickCapture,onKeyDown:onSlotKeyDown}),_react.default.createElement(StyledSlotDragGuard,guardProps,children)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"PanelHeader",{enumerable:!0,get:function(){return PanelHeader}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_TextClamped=require("../../../components/Typography/TextClamped/TextClamped"),_mixins=require("../../../shared/mixins"),_Box=require("../../Box/Box"),_Inline=require("../../Inline/Inline"),_Icon=require("../../Icon/Icon"),_Header=require("../../Typography/Header/Header"),StyledHeaderSurface=(0,_styled.default)("div",{target:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"PanelHeader",{enumerable:!0,get:function(){return PanelHeader}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/_interop_require_default._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_TextClamped=require("../../../components/Typography/TextClamped/TextClamped"),_constants=require("../../Layout/-constants"),_mixins=require("../../../shared/mixins"),_Box=require("../../Box/Box"),_Inline=require("../../Inline/Inline"),_Icon=require("../../Icon/Icon"),_Header=require("../../Typography/Header/Header"),StyledHeaderSurface=(0,_styled.default)("div",{target:"e13e79rk0",label:"StyledHeaderSurface"})(({theme})=>({backgroundColor:theme.values.color.background.primary.default})),StyledHeaderRow=(0,_styled.default)("div",{target:"e13e79rk1",label:"StyledHeaderRow"})({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"}),StyledLeadingGroup=(0,_styled.default)("div",{target:"e13e79rk2",label:"StyledLeadingGroup"})(({theme,isContentFaded})=>({minWidth:0,overflow:"hidden",...(0,_mixins.getLeftPanelFadeStyles)({theme,isFaded:isContentFaded})})),StyledSlotContent=(0,_styled.default)("div",{target:"e13e79rk3",label:"StyledSlotContent"})({width:"max-content"}),StyledLeadingContent=(0,_styled.default)("div",{target:"e13e79rk4",label:"StyledLeadingContent"})(({theme,hasTitleInset})=>({paddingLeft:hasTitleInset?theme.variables.size.spacing.xxs:0})),StyledTrailingGroup=(0,_styled.default)("div",{target:"e13e79rk5",label:"StyledTrailingGroup"})({alignSelf:"flex-start",flexShrink:0});function PanelHeader({leftSlot,title,rightSlot,isContentFaded=!1,"data-e2e-test-id":dataE2eTestId}){let colorTitleItems="primary",hasTitle=title&&!1!==title.isVisible,hasIcon=hasTitle&&void 0!==title.icon;return _react.default.createElement(StyledHeaderSurface,{"data-e2e-test-id":dataE2eTestId},_react.default.createElement(_Box.Box,{vSpace:_constants.LEFT_BAR_BUTTON_INSET.vSpace,lSpace:hasIcon?"xs":"s",rSpace:_constants.LEFT_BAR_BUTTON_INSET.hSpace},_react.default.createElement(StyledHeaderRow,null,_react.default.createElement(StyledLeadingGroup,{isContentFaded:isContentFaded},_react.default.createElement(StyledLeadingContent,{hasTitleInset:!!(hasTitle&&!hasIcon)},_react.default.createElement(_Inline.Inline,{space:"xs",vAlignItems:"center",noWrap:!0},leftSlot&&_react.default.createElement(StyledSlotContent,null,leftSlot),hasTitle&&_react.default.createElement(_Inline.Inline,{space:"xs",vAlignItems:"center",noWrap:!0},title.icon&&_react.default.createElement(_Icon.Icon,{...title.icon,color:colorTitleItems,size:"s"}),_react.default.createElement(_TextClamped.TextClamped,{as:"span"},_react.default.createElement(_Header.H5,{as:title.as,color:colorTitleItems},title.label)))))),_react.default.createElement(StyledTrailingGroup,null,_react.default.createElement(_Inline.Inline,{space:"xxs",vAlignItems:"center",noWrap:!0},_react.default.createElement(_react.default.Fragment,null,rightSlot))))))}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SpaceSizes } from "../../types";
|
|
1
2
|
/**
|
|
2
3
|
* Slot keys - the single source of truth. The key *types* (`SlotKey`,
|
|
3
4
|
* `SidePanelKey`, `PanelKey`) are derived from these const values below and
|
|
@@ -23,6 +24,16 @@ export type PanelKey = (typeof PANELS)[number];
|
|
|
23
24
|
* says otherwise. The store leaves `variant` unset until then, so every
|
|
24
25
|
* reader resolves it against this. */
|
|
25
26
|
export declare const DEFAULT_LEFT_PANEL_VARIANT = "sidebar";
|
|
27
|
+
/** Both axes of the inset between a bar button and the edge of the left bar's
|
|
28
|
+
* column. Shared by `LeftBarToggle`'s own button and `PanelHeader`'s trailing
|
|
29
|
+
* slot: the header's control walks down onto the bar's as the panel
|
|
30
|
+
* collapses, and the two only land on the same spot because both read this
|
|
31
|
+
* one value - on both axes - rather than each writing its own. */
|
|
32
|
+
type BarButtonInset = {
|
|
33
|
+
hSpace: SpaceSizes;
|
|
34
|
+
vSpace: SpaceSizes;
|
|
35
|
+
};
|
|
36
|
+
export declare const LEFT_BAR_BUTTON_INSET: BarButtonInset;
|
|
26
37
|
/** Everything but pinned `content`, which never competes for row space. */
|
|
27
38
|
export type TogglableSlotKey = Exclude<SlotKey, typeof Slot.content>;
|
|
28
39
|
/** Slots the app opens/closes, in `PANEL_ORDER`. */
|
|
@@ -73,3 +84,4 @@ export declare const PANEL_WIDTH_VAR: {
|
|
|
73
84
|
readonly content: "--ds-layout-content-width";
|
|
74
85
|
readonly rightPanel: "--ds-layout-rightPanel-width";
|
|
75
86
|
};
|
|
87
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get BOTTOM_BAR_HEIGHT_VAR(){return BOTTOM_BAR_HEIGHT_VAR},get DEFAULT_LEFT_PANEL_VARIANT(){return DEFAULT_LEFT_PANEL_VARIANT},get PAGE_BOTTOM_BAR_INSET(){return PAGE_BOTTOM_BAR_INSET},get PANELS(){return PANELS},get PANEL_ORDER(){return PANEL_ORDER},get PANEL_WIDTH_VAR(){return PANEL_WIDTH_VAR},get RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR(){return RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR},get RIGHT_PANEL_BOTTOM_BAR_INSET(){return RIGHT_PANEL_BOTTOM_BAR_INSET},get SIDE_PANELS(){return SIDE_PANELS},get SPLIT_MAX_WIDTH_VAR(){return SPLIT_MAX_WIDTH_VAR},get SUBNAV_OFFSET_VAR(){return SUBNAV_OFFSET_VAR},get Slot(){return Slot},get TOGGLABLE_SLOTS(){return TOGGLABLE_SLOTS}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _layoutvars=require("../../web-tokens/layout-vars"),Slot={leftPanel:"leftPanel",content:"content",splitview:"splitview",rightPanel:"rightPanel"},SIDE_PANELS=[Slot.leftPanel,Slot.rightPanel],PANELS=[Slot.content,Slot.splitview],PANEL_ORDER=[Slot.leftPanel,Slot.content,Slot.splitview,Slot.rightPanel],DEFAULT_LEFT_PANEL_VARIANT="sidebar",TOGGLABLE_SLOTS=PANEL_ORDER.filter(slot=>slot!==Slot.content),SUBNAV_OFFSET_VAR=_layoutvars.LAYOUT_VARS.subnavOffset,SPLIT_MAX_WIDTH_VAR=_layoutvars.LAYOUT_VARS.splitMaxWidth,BOTTOM_BAR_HEIGHT_VAR=_layoutvars.LAYOUT_VARS.bottomBarHeight,RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR=_layoutvars.LAYOUT_VARS.rightPanelBottomBarHeight,PAGE_BOTTOM_BAR_INSET=`var(${BOTTOM_BAR_HEIGHT_VAR}, 0px)`,RIGHT_PANEL_BOTTOM_BAR_INSET=`var(${RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR}, ${PAGE_BOTTOM_BAR_INSET})`,PANEL_WIDTH_VAR={leftPanel:_layoutvars.LAYOUT_VARS.leftPanelWidth,content:_layoutvars.LAYOUT_VARS.contentWidth,rightPanel:_layoutvars.LAYOUT_VARS.rightPanelWidth};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get BOTTOM_BAR_HEIGHT_VAR(){return BOTTOM_BAR_HEIGHT_VAR},get DEFAULT_LEFT_PANEL_VARIANT(){return DEFAULT_LEFT_PANEL_VARIANT},get LEFT_BAR_BUTTON_INSET(){return LEFT_BAR_BUTTON_INSET},get PAGE_BOTTOM_BAR_INSET(){return PAGE_BOTTOM_BAR_INSET},get PANELS(){return PANELS},get PANEL_ORDER(){return PANEL_ORDER},get PANEL_WIDTH_VAR(){return PANEL_WIDTH_VAR},get RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR(){return RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR},get RIGHT_PANEL_BOTTOM_BAR_INSET(){return RIGHT_PANEL_BOTTOM_BAR_INSET},get SIDE_PANELS(){return SIDE_PANELS},get SPLIT_MAX_WIDTH_VAR(){return SPLIT_MAX_WIDTH_VAR},get SUBNAV_OFFSET_VAR(){return SUBNAV_OFFSET_VAR},get Slot(){return Slot},get TOGGLABLE_SLOTS(){return TOGGLABLE_SLOTS}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _layoutvars=require("../../web-tokens/layout-vars"),Slot={leftPanel:"leftPanel",content:"content",splitview:"splitview",rightPanel:"rightPanel"},SIDE_PANELS=[Slot.leftPanel,Slot.rightPanel],PANELS=[Slot.content,Slot.splitview],PANEL_ORDER=[Slot.leftPanel,Slot.content,Slot.splitview,Slot.rightPanel],DEFAULT_LEFT_PANEL_VARIANT="sidebar",LEFT_BAR_BUTTON_INSET={hSpace:"s",vSpace:"xs"},TOGGLABLE_SLOTS=PANEL_ORDER.filter(slot=>slot!==Slot.content),SUBNAV_OFFSET_VAR=_layoutvars.LAYOUT_VARS.subnavOffset,SPLIT_MAX_WIDTH_VAR=_layoutvars.LAYOUT_VARS.splitMaxWidth,BOTTOM_BAR_HEIGHT_VAR=_layoutvars.LAYOUT_VARS.bottomBarHeight,RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR=_layoutvars.LAYOUT_VARS.rightPanelBottomBarHeight,PAGE_BOTTOM_BAR_INSET=`var(${BOTTOM_BAR_HEIGHT_VAR}, 0px)`,RIGHT_PANEL_BOTTOM_BAR_INSET=`var(${RIGHT_PANEL_BOTTOM_BAR_HEIGHT_VAR}, ${PAGE_BOTTOM_BAR_INSET})`,PANEL_WIDTH_VAR={leftPanel:_layoutvars.LAYOUT_VARS.leftPanelWidth,content:_layoutvars.LAYOUT_VARS.contentWidth,rightPanel:_layoutvars.LAYOUT_VARS.rightPanelWidth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get Layout(){return Layout},get PANEL_HOST_DS_ID(){return PANEL_HOST_DS_ID}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_Panel=require("../Internal/Panel/Panel"),_LayoutFloat=require("../Internal/LayoutFloat/LayoutFloat"),_useBreakpoints=require("../../shared/useBreakpoints"),_constants=require("./-constants"),_context=require("./context"),_useMobileSplitStack=require("./Split/MobileSplitView/useMobileSplitStack"),_useMobileSplitView=require("./Split/MobileSplitView/useMobileSplitView"),_LayoutProvider=require("./LayoutProvider"),_Content=require("./Content/Content"),_RightPanel=require("./RightPanel/RightPanel"),_RightPanelHeader=require("./RightPanel/RightPanelHeader"),_RightPanelFooter=require("./RightPanel/RightPanelFooter"),_LeftPanel=require("./LeftPanel/LeftPanel"),_LeftPanelHeader=require("./LeftPanel/LeftPanelHeader"),_LeftPanelFooter=require("./LeftPanel/LeftPanelFooter"),_LeftNavBar=require("./LeftNavBar/LeftNavBar"),_LeftNavBarFooter=require("./LeftNavBar/LeftNavBarFooter"),_Split=require("./Split/Split"),_SplitHeader=require("./Split/SplitHeader"),_SplitFooter=require("./Split/SplitFooter"),_registry=require("./registry"),_usePortalTargets=require("./usePortalTargets"),_LayoutFloatDragProvider=require("../Internal/LayoutFloat/LayoutFloatDragProvider"),_LayoutCssVars=require("./LayoutCssVars"),_useLayout=require("./useLayout"),_useLayoutRules=require("./useLayoutRules"),_rules=require("./rules"),resizableFromState=slotState=>"sidePanel"===slotState.kind?slotState.resizable:void 0,useGlobalCssVariables=slotHosts=>{let leftPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.leftPanel),contentWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.content),rightPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.rightPanel);(0,_react.useEffect)(()=>{let targets=[[_constants.Slot.leftPanel,leftPanelWidthCssVar],[_constants.Slot.content,contentWidthCssVar],[_constants.Slot.rightPanel,rightPanelWidthCssVar]],observers=[];return targets.forEach(([slot,handle])=>{let node=slotHosts[slot]??null;if(!node)return void handle.set("0px");let publishNodeWidth=()=>handle.set(`${node.getBoundingClientRect().width}px`);if(publishNodeWidth(),"undefined"==typeof ResizeObserver)return;let observer=new ResizeObserver(publishNodeWidth);observer.observe(node),observers.push(observer)}),()=>observers.forEach(observer=>observer.disconnect())},[leftPanelWidthCssVar,contentWidthCssVar,rightPanelWidthCssVar,slotHosts])},StyledLayout=(0,_styled.default)("div",{target:"exoyye20",label:"StyledLayout"})({position:"relative",height:"100%",width:"100%"}),StyledPanelRow=(0,_styled.default)("div",{target:"exoyye21",label:"StyledPanelRow"})(({theme,hasOffcanvasLeftBar})=>({height:"100%",boxSizing:"border-box",...hasOffcanvasLeftBar&&{paddingLeft:theme.variables.size.dimension.leftNavBar.width}})),StyledPanelHost=(0,_styled.default)("div",{target:"exoyye22",label:"StyledPanelHost"})({position:"relative",height:"100%",width:"100%"}),PANEL_HOST_DS_ID="PanelHost",StyledContentColumn=(0,_styled.default)("div",{shouldForwardProp:prop=>"isSplitOpen"!==prop,target:"exoyye23",label:"StyledContentColumn"})(({isSplitOpen,theme})=>({display:"flex",height:`calc(100% - ${_constants.PAGE_BOTTOM_BAR_INSET})`,width:"100%",...isSplitOpen&&{maxWidth:theme.variables.layout.split.maxWidth.default,marginInline:"auto",gap:theme.variables.size.spacing.xxs}})),StyledContentColumnHalf=(0,_styled.default)("div",{target:"exoyye24",label:"StyledContentColumnHalf"})({position:"relative",height:"100%",flex:"1 1 0",minWidth:0}),StyledMobileSplitStackHost=(0,_styled.default)("div",{target:"exoyye25",label:"StyledMobileSplitStackHost"})({position:"absolute",top:0,left:0,right:0,bottom:_constants.PAGE_BOTTOM_BAR_INSET,overflow:"hidden",pointerEvents:"none"}),isPanelPresent=({slot,declared,present,isShown})=>!!(declared[slot]&&(isShown(slot)||present[slot])),defaultSizeFor=({slot,panel,panelState})=>slot===_constants.Slot.content?void 0:panel?.defaultSize!==void 0?panel.defaultSize:panel?.resizable!==!1?panelState.size:void 0,childFor=(slot,contentColumn,slotHostRefs)=>slot===_constants.Slot.content?contentColumn:_react.default.createElement(StyledPanelHost,{"data-ds-id":PANEL_HOST_DS_ID,ref:slotHostRefs[slot]}),Layout=function({children,persistenceKey,storage,rules=_rules.DEFAULT_LAYOUT_RULES,additionalRulesData}){let[declared,setDeclared]=(0,_react.useState)({}),layout=(0,_useLayout.useLayout)(),{state:layoutState,...panelCallbacks}=layout;(0,_useLayoutRules.useLayoutRules)({layout,declared,rules,additionalData:additionalRulesData});let{dispatch}=(0,_context.useLayoutStore)(),persistence=(0,_context.useLayoutPersistence)(),resolvedKey=persistenceKey??persistence.persistenceKey,resolvedStorage=storage??persistence.storage,{isMobile}=(0,_useBreakpoints.useBreakpoints)(),showMobileSplitStack=(0,_useMobileSplitView.useMobileSplitViewEnabled)(),[mobileSplitStackHost,setMobileSplitStackHost]=(0,_react.useState)(null),[splitCount,setSplitCount]=(0,_react.useState)(0),registerSplit=(0,_react.useCallback)(()=>(setSplitCount(count=>count+1),()=>setSplitCount(count=>count-1)),[]),mobileSplitStack=(0,_react.useMemo)(()=>({host:mobileSplitStackHost,isSplitPresent:splitCount>0,registerSplit}),[mobileSplitStackHost,splitCount,registerSplit]),panelsEnabled=(0,_context.useLayoutPanelsEnabled)(),rightPanelVariant=layoutState[_constants.Slot.rightPanel].variant??declared[_constants.Slot.rightPanel]?.variant??"sidebar",isRightPanelFloating=!0===panelsEnabled&&!isMobile&&"float"===rightPanelVariant,hasOffcanvasLeftBar=!!declared[_constants.Slot.leftPanel]&&"offcanvas"===layoutState[_constants.Slot.leftPanel].variant,isShown=slot=>layoutState[slot].visible&&!(slot===_constants.Slot.rightPanel&&(isRightPanelFloating||isMobile))&&!(slot===_constants.Slot.leftPanel&&hasOffcanvasLeftBar),[present,setPresent]=(0,_react.useState)({}),presence=(0,_react.useMemo)(()=>({setPresent:(slot,isPresent)=>setPresent(prev=>prev[slot]===isPresent?prev:{...prev,[slot]:isPresent})}),[]),panelHandles=(0,_react.useRef)({}),panelElements=(0,_react.useRef)({}),resizeSuppressed=(0,_react.useRef)({}),animationControl=(0,_react.useMemo)(()=>({setHandle:(slot,handle)=>{panelHandles.current[slot]=handle},getHandle:slot=>panelHandles.current[slot]??null,setElement:(slot,element)=>{panelElements.current[slot]=element},getElement:slot=>panelElements.current[slot]??null,setResizeSuppressed:(slot,suppressed)=>{resizeSuppressed.current[slot]=suppressed}}),[]),panelRefCallbacks=(0,_react.useMemo)(()=>{let handleCallbacks=new Map,elementCallbacks=new Map;return{handleFor:id=>{let callback=handleCallbacks.get(id);return callback||(callback=handle=>animationControl.setHandle(id,handle),handleCallbacks.set(id,callback)),callback},elementFor:id=>{let callback=elementCallbacks.get(id);return callback||(callback=element=>animationControl.setElement(id,element),elementCallbacks.set(id,callback)),callback}}},[animationControl]),shouldSuppressLayoutCallback=(0,_react.useCallback)(()=>Object.values(resizeSuppressed.current).some(Boolean),[]),registry=(0,_react.useMemo)(()=>({register:(slot,reg)=>setDeclared(prev=>({...prev,[slot]:reg})),unregister:slot=>setDeclared(prev=>{if(!(slot in prev))return prev;let next={...prev};return delete next[slot],next})}),[]),{portalTargets,slotHosts,slotHostRefs,floatHostRef}=(0,_usePortalTargets.usePortalTargets)({slots:_constants.PANEL_ORDER,floatableSlot:_constants.Slot.rightPanel,isFloating:isRightPanelFloating});useGlobalCssVariables(slotHosts);let rowSlots=_constants.PANEL_ORDER.filter(slot=>slot!==_constants.Slot.splitview),declaredSlots=rowSlots.filter(slot=>declared[slot]),isSolo=declaredSlots.length<=1,soloSlot=declaredSlots[0],isSplitOpen=isPanelPresent({slot:_constants.Slot.splitview,declared,present,isShown})&&isPanelPresent({slot:_constants.Slot.content,declared,present,isShown}),contentColumn=_react.default.createElement(StyledContentColumn,{isSplitOpen:isSplitOpen},_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.content]}),isSplitOpen&&_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.splitview]})),panelItems=rowSlots.filter(slot=>isPanelPresent({slot,declared,present,isShown})).map(slot=>{let panel=declared[slot],panelState=layoutState[slot];return{id:slot,child:childFor(slot,contentColumn,slotHostRefs),defaultSize:defaultSizeFor({slot,panel,panelState}),minSize:panel?.minSize??panelState.minSize,maxSize:panel?.maxSize??panelState.maxSize,collapsible:slot!==_constants.Slot.content&&(panel?.collapsible??!0),lockWidthOnWindowResize:panel?.lockWidthOnWindowResize,resizable:panel?.resizable??resizableFromState(panelState)}}),rowKey=panelItems.map(item=>item.id).join(","),soloHost=soloSlot&&isShown(soloSlot)?childFor(soloSlot,contentColumn,slotHostRefs):null,panelGroup=panelItems.length>0?_react.default.createElement(_Panel.Panel,{key:resolvedKey,panels:panelItems,persistenceKey:resolvedKey,storage:resolvedStorage,onResize:(id,size)=>{isShown(id)&&dispatch({type:"resize",slot:id,size:declared[id]?.lockWidthOnWindowResize?Math.round(size.inPixels):`${size.asPercentage}%`})},onCollapse:id=>panelCallbacks[id].hide(),panelHandleFor:panelRefCallbacks.handleFor,panelElementFor:panelRefCallbacks.elementFor,shouldSuppressLayoutCallback:shouldSuppressLayoutCallback}):null;return _react.default.createElement(_registry.PanelRegistryContext.Provider,{value:registry},_react.default.createElement(_registry.PanelDeclarationsContext.Provider,{value:declared},_react.default.createElement(_registry.PanelPresenceContext.Provider,{value:presence},_react.default.createElement(_registry.PanelAnimationContext.Provider,{value:animationControl},_react.default.createElement(_registry.PanelRowContext.Provider,{value:rowKey},_react.default.createElement(_registry.LayoutPortalContext.Provider,{value:portalTargets},_react.default.createElement(_LayoutFloatDragProvider.LayoutFloatDragProvider,null,_react.default.createElement(_useMobileSplitStack.MobileSplitStackContext.Provider,{value:mobileSplitStack},_react.default.createElement(StyledLayout,{"data-ds-id":"Layout"},_react.default.createElement(StyledPanelRow,{hasOffcanvasLeftBar:hasOffcanvasLeftBar},isSolo?soloHost:panelGroup),isRightPanelFloating&&layoutState[_constants.Slot.rightPanel].visible&&_react.default.createElement(_LayoutFloat.LayoutFloat,{hostRef:floatHostRef}),children,showMobileSplitStack&&_react.default.createElement(StyledMobileSplitStackHost,{ref:setMobileSplitStackHost}))))))))))};Layout.Provider=_LayoutProvider.LayoutProvider,Layout.LeftPanel=_LeftPanel.LeftPanel,Layout.LeftNavBar=_LeftNavBar.LeftNavBar,Layout.LeftNavBarFooter=_LeftNavBarFooter.LeftNavBarFooter,Layout.LeftPanelHeader=_LeftPanelHeader.LeftPanelHeader,Layout.LeftPanelFooter=_LeftPanelFooter.LeftPanelFooter,Layout.RightPanel=_RightPanel.RightPanel,Layout.RightPanelHeader=_RightPanelHeader.RightPanelHeader,Layout.RightPanelFooter=_RightPanelFooter.RightPanelFooter,Layout.Content=_Content.Content,Layout.Split=_Split.Split,Layout.SplitHeader=_SplitHeader.SplitHeader,Layout.SplitFooter=_SplitFooter.SplitFooter;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get Layout(){return Layout},get PANEL_HOST_DS_ID(){return PANEL_HOST_DS_ID}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_Panel=require("../Internal/Panel/Panel"),_LayoutFloat=require("../Internal/LayoutFloat/LayoutFloat"),_useBreakpoints=require("../../shared/useBreakpoints"),_constants=require("./-constants"),_context=require("./context"),_useMobileSplitStack=require("./Split/MobileSplitView/useMobileSplitStack"),_useMobileSplitView=require("./Split/MobileSplitView/useMobileSplitView"),_LayoutProvider=require("./LayoutProvider"),_Content=require("./Content/Content"),_RightPanel=require("./RightPanel/RightPanel"),_RightPanelHeader=require("./RightPanel/RightPanelHeader"),_RightPanelFooter=require("./RightPanel/RightPanelFooter"),_LeftPanel=require("./LeftPanel/LeftPanel"),_LeftPanelHeader=require("./LeftPanel/LeftPanelHeader"),_LeftPanelFooter=require("./LeftPanel/LeftPanelFooter"),_LeftNavBar=require("./LeftNavBar/LeftNavBar"),_LeftNavBarFooter=require("./LeftNavBar/LeftNavBarFooter"),_Split=require("./Split/Split"),_SplitHeader=require("./Split/SplitHeader"),_SplitFooter=require("./Split/SplitFooter"),_registry=require("./registry"),_usePortalTargets=require("./usePortalTargets"),_LayoutFloatDragProvider=require("../Internal/LayoutFloat/LayoutFloatDragProvider"),_LayoutCssVars=require("./LayoutCssVars"),_useLayout=require("./useLayout"),_useLayoutRules=require("./useLayoutRules"),_rules=require("./rules"),resizableFromState=slotState=>"sidePanel"===slotState.kind?slotState.resizable:void 0,useGlobalCssVariables=slotHosts=>{let leftPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.leftPanel),contentWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.content),rightPanelWidthCssVar=(0,_LayoutCssVars.useLayoutVar)(_constants.PANEL_WIDTH_VAR.rightPanel);(0,_react.useEffect)(()=>{let targets=[[_constants.Slot.leftPanel,leftPanelWidthCssVar],[_constants.Slot.content,contentWidthCssVar],[_constants.Slot.rightPanel,rightPanelWidthCssVar]],observers=[];return targets.forEach(([slot,handle])=>{let node=slotHosts[slot]??null;if(!node)return void handle.set("0px");let publishNodeWidth=()=>handle.set(`${node.getBoundingClientRect().width}px`);if(publishNodeWidth(),"undefined"==typeof ResizeObserver)return;let observer=new ResizeObserver(publishNodeWidth);observer.observe(node),observers.push(observer)}),()=>observers.forEach(observer=>observer.disconnect())},[leftPanelWidthCssVar,contentWidthCssVar,rightPanelWidthCssVar,slotHosts])},StyledLayout=(0,_styled.default)("div",{target:"e1rj6vf40",label:"StyledLayout"})({position:"relative",height:"100%",width:"100%"}),StyledPanelRow=(0,_styled.default)("div",{target:"e1rj6vf41",label:"StyledPanelRow"})(({theme,hasOffcanvasLeftBar})=>({height:"100%",boxSizing:"border-box",...hasOffcanvasLeftBar&&{paddingLeft:theme.variables.size.dimension.leftNavBar.width}})),StyledPanelHost=(0,_styled.default)("div",{target:"e1rj6vf42",label:"StyledPanelHost"})({position:"relative",height:"100%",width:"100%"}),PANEL_HOST_DS_ID="PanelHost",StyledContentColumn=(0,_styled.default)("div",{shouldForwardProp:prop=>"isSplitOpen"!==prop,target:"e1rj6vf43",label:"StyledContentColumn"})(({isSplitOpen,theme})=>({display:"flex",height:`calc(100% - ${_constants.PAGE_BOTTOM_BAR_INSET})`,width:"100%",...isSplitOpen&&{maxWidth:theme.variables.layout.split.maxWidth.default,marginInline:"auto",gap:theme.variables.size.spacing.xxs}})),StyledContentColumnHalf=(0,_styled.default)("div",{target:"e1rj6vf44",label:"StyledContentColumnHalf"})({position:"relative",height:"100%",flex:"1 1 0",minWidth:0}),StyledMobileSplitStackHost=(0,_styled.default)("div",{target:"e1rj6vf45",label:"StyledMobileSplitStackHost"})({position:"absolute",top:0,left:0,right:0,bottom:_constants.PAGE_BOTTOM_BAR_INSET,overflow:"hidden",pointerEvents:"none"}),isPanelPresent=({slot,declared,present,isShown})=>!!(declared[slot]&&(isShown(slot)||present[slot])),defaultSizeFor=({slot,panel,panelState})=>slot===_constants.Slot.content?void 0:panel?.defaultSize!==void 0?panel.defaultSize:panel?.resizable!==!1?panelState.size:void 0,childFor=(slot,contentColumn,slotHostRefs)=>slot===_constants.Slot.content?contentColumn:_react.default.createElement(StyledPanelHost,{"data-ds-id":PANEL_HOST_DS_ID,ref:slotHostRefs[slot]}),Layout=function({children,persistenceKey,storage,rules=_rules.DEFAULT_LAYOUT_RULES,additionalRulesData}){let[declared,setDeclared]=(0,_react.useState)({}),layout=(0,_useLayout.useLayout)(),{state:layoutState,...panelCallbacks}=layout;(0,_useLayoutRules.useLayoutRules)({layout,declared,rules,additionalData:additionalRulesData});let{dispatch}=(0,_context.useLayoutStore)(),persistence=(0,_context.useLayoutPersistence)(),resolvedKey=persistenceKey??persistence.persistenceKey,resolvedStorage=storage??persistence.storage,{isMobile}=(0,_useBreakpoints.useBreakpoints)(),showMobileSplitStack=(0,_useMobileSplitView.useMobileSplitViewEnabled)(),[mobileSplitStackHost,setMobileSplitStackHost]=(0,_react.useState)(null),[splitCount,setSplitCount]=(0,_react.useState)(0),registerSplit=(0,_react.useCallback)(()=>(setSplitCount(count=>count+1),()=>setSplitCount(count=>count-1)),[]),mobileSplitStack=(0,_react.useMemo)(()=>({host:mobileSplitStackHost,isSplitPresent:splitCount>0,registerSplit}),[mobileSplitStackHost,splitCount,registerSplit]),panelsEnabled=(0,_context.useLayoutPanelsEnabled)(),rightPanelVariant=layoutState[_constants.Slot.rightPanel].variant??declared[_constants.Slot.rightPanel]?.variant??"sidebar",isRightPanelFloating=!0===panelsEnabled&&!isMobile&&"float"===rightPanelVariant,hasOffcanvasLeftBar=!!declared[_constants.Slot.leftPanel]&&"offcanvas"===layoutState[_constants.Slot.leftPanel].variant,isShown=slot=>layoutState[slot].visible&&!(slot===_constants.Slot.rightPanel&&(isRightPanelFloating||isMobile))&&!(slot===_constants.Slot.leftPanel&&hasOffcanvasLeftBar),[present,setPresent]=(0,_react.useState)({}),presence=(0,_react.useMemo)(()=>({setPresent:(slot,isPresent)=>setPresent(prev=>prev[slot]===isPresent?prev:{...prev,[slot]:isPresent})}),[]),panelHandles=(0,_react.useRef)({}),panelElements=(0,_react.useRef)({}),resizeSuppressed=(0,_react.useRef)({}),animationControl=(0,_react.useMemo)(()=>({setHandle:(slot,handle)=>{panelHandles.current[slot]=handle},getHandle:slot=>panelHandles.current[slot]??null,setElement:(slot,element)=>{panelElements.current[slot]=element},getElement:slot=>panelElements.current[slot]??null,setResizeSuppressed:(slot,suppressed)=>{resizeSuppressed.current[slot]=suppressed}}),[]),panelRefCallbacks=(0,_react.useMemo)(()=>{let handleCallbacks=new Map,elementCallbacks=new Map;return{handleFor:id=>{let callback=handleCallbacks.get(id);return callback||(callback=handle=>animationControl.setHandle(id,handle),handleCallbacks.set(id,callback)),callback},elementFor:id=>{let callback=elementCallbacks.get(id);return callback||(callback=element=>animationControl.setElement(id,element),elementCallbacks.set(id,callback)),callback}}},[animationControl]),shouldSuppressLayoutCallback=(0,_react.useCallback)(()=>Object.values(resizeSuppressed.current).some(Boolean),[]),registry=(0,_react.useMemo)(()=>({register:(slot,reg)=>setDeclared(prev=>({...prev,[slot]:reg})),unregister:slot=>setDeclared(prev=>{if(!(slot in prev))return prev;let next={...prev};return delete next[slot],next})}),[]),{portalTargets,slotHosts,slotHostRefs,floatHostRef}=(0,_usePortalTargets.usePortalTargets)({slots:_constants.PANEL_ORDER,floatableSlot:_constants.Slot.rightPanel,isFloating:isRightPanelFloating});useGlobalCssVariables(slotHosts);let rowSlots=_constants.PANEL_ORDER.filter(slot=>slot!==_constants.Slot.splitview),declaredSlots=rowSlots.filter(slot=>declared[slot]),isSolo=declaredSlots.length<=1,soloSlot=declaredSlots[0],isSplitOpen=isPanelPresent({slot:_constants.Slot.splitview,declared,present,isShown})&&isPanelPresent({slot:_constants.Slot.content,declared,present,isShown}),contentColumn=_react.default.createElement(StyledContentColumn,{isSplitOpen:isSplitOpen},_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.content]}),isSplitOpen&&_react.default.createElement(StyledContentColumnHalf,{ref:slotHostRefs[_constants.Slot.splitview]})),panelItems=rowSlots.filter(slot=>isPanelPresent({slot,declared,present,isShown})).map(slot=>{let panel=declared[slot],panelState=layoutState[slot];return{id:slot,child:childFor(slot,contentColumn,slotHostRefs),defaultSize:defaultSizeFor({slot,panel,panelState}),minSize:panel?.minSize??panelState.minSize,maxSize:panel?.maxSize??panelState.maxSize,collapsible:slot!==_constants.Slot.content&&(panel?.collapsible??!0),lockWidthOnWindowResize:panel?.lockWidthOnWindowResize,resizable:panel?.resizable??resizableFromState(panelState)}}),rowKey=panelItems.map(item=>item.id).join(","),soloHost=soloSlot&&isShown(soloSlot)?childFor(soloSlot,contentColumn,slotHostRefs):null,panelGroup=panelItems.length>0?_react.default.createElement(_Panel.Panel,{key:resolvedKey,panels:panelItems,persistenceKey:resolvedKey,storage:resolvedStorage,onResize:(id,size)=>{isShown(id)&&declared[id]?.resizable!==!1&&dispatch({type:"resize",slot:id,size:declared[id]?.lockWidthOnWindowResize?Math.round(size.inPixels):`${size.asPercentage}%`})},onCollapse:id=>panelCallbacks[id].hide(),panelHandleFor:panelRefCallbacks.handleFor,panelElementFor:panelRefCallbacks.elementFor,shouldSuppressLayoutCallback:shouldSuppressLayoutCallback}):null;return _react.default.createElement(_registry.PanelRegistryContext.Provider,{value:registry},_react.default.createElement(_registry.PanelDeclarationsContext.Provider,{value:declared},_react.default.createElement(_registry.PanelPresenceContext.Provider,{value:presence},_react.default.createElement(_registry.PanelAnimationContext.Provider,{value:animationControl},_react.default.createElement(_registry.PanelRowContext.Provider,{value:rowKey},_react.default.createElement(_registry.LayoutPortalContext.Provider,{value:portalTargets},_react.default.createElement(_LayoutFloatDragProvider.LayoutFloatDragProvider,null,_react.default.createElement(_useMobileSplitStack.MobileSplitStackContext.Provider,{value:mobileSplitStack},_react.default.createElement(StyledLayout,{"data-ds-id":"Layout"},_react.default.createElement(StyledPanelRow,{hasOffcanvasLeftBar:hasOffcanvasLeftBar},isSolo?soloHost:panelGroup),isRightPanelFloating&&layoutState[_constants.Slot.rightPanel].visible&&_react.default.createElement(_LayoutFloat.LayoutFloat,{hostRef:floatHostRef}),children,showMobileSplitStack&&_react.default.createElement(StyledMobileSplitStackHost,{ref:setMobileSplitStackHost}))))))))))};Layout.Provider=_LayoutProvider.LayoutProvider,Layout.LeftPanel=_LeftPanel.LeftPanel,Layout.LeftNavBar=_LeftNavBar.LeftNavBar,Layout.LeftNavBarFooter=_LeftNavBarFooter.LeftNavBarFooter,Layout.LeftPanelHeader=_LeftPanelHeader.LeftPanelHeader,Layout.LeftPanelFooter=_LeftPanelFooter.LeftPanelFooter,Layout.RightPanel=_RightPanel.RightPanel,Layout.RightPanelHeader=_RightPanelHeader.RightPanelHeader,Layout.RightPanelFooter=_RightPanelFooter.RightPanelFooter,Layout.Content=_Content.Content,Layout.Split=_Split.Split,Layout.SplitHeader=_SplitHeader.SplitHeader,Layout.SplitFooter=_SplitFooter.SplitFooter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"LeftBarToggle",{enumerable:!0,get:function(){return LeftBarToggle}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_Box=require("../../Box/Box"),_PictogramButton=require("../../PictogramButton/PictogramButton"),_constants=require("../-constants"),_useLayout=require("../useLayout"),_useLeftPanelId=require("../useLeftPanelId");function LeftBarToggle({"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId,buttonRef}){let{show,isVisible}=(0,_useLayout.useLayout)()[_constants.Slot.leftPanel],leftPanelId=(0,_useLeftPanelId.useLeftPanelId)();return _react.default.createElement(_Box.Box,{space:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"LeftBarToggle",{enumerable:!0,get:function(){return LeftBarToggle}});const _react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_default")._(require("react")),_Box=require("../../Box/Box"),_PictogramButton=require("../../PictogramButton/PictogramButton"),_constants=require("../-constants"),_useLayout=require("../useLayout"),_useLeftPanelId=require("../useLeftPanelId");function LeftBarToggle({"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId,buttonRef}){let{show,isVisible}=(0,_useLayout.useLayout)()[_constants.Slot.leftPanel],leftPanelId=(0,_useLeftPanelId.useLeftPanelId)();return _react.default.createElement(_Box.Box,{space:_constants.LEFT_BAR_BUTTON_INSET.hSpace,vSpace:_constants.LEFT_BAR_BUTTON_INSET.vSpace},_react.default.createElement(_PictogramButton.PictogramButton,{ref:buttonRef,icon:"open-sidebar-left",size:"s",onClick:show,"aria-label":ariaLabel,"data-e2e-test-id":dataE2eTestId,"aria-controls":leftPanelId,"aria-expanded":isVisible}))}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { SidePanelKey } from "./-constants";
|
|
2
2
|
import type { Size } from "./-types";
|
|
3
|
+
type SlidePhase = "idle" | "entering" | "exiting";
|
|
4
|
+
type GetMaxSizeOptions = {
|
|
5
|
+
collapsedSize?: Size;
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
maxSize?: Size;
|
|
8
|
+
openSize?: Size;
|
|
9
|
+
phase: SlidePhase;
|
|
10
|
+
};
|
|
11
|
+
export declare const getMaxSize: ({ collapsedSize, isVisible, maxSize, openSize, phase, }: GetMaxSizeOptions) => Size | undefined;
|
|
3
12
|
export type PanelDockedSlideOptions = {
|
|
4
13
|
/** Which side-panel slot this animates. */
|
|
5
14
|
slot: SidePanelKey;
|
|
@@ -38,3 +47,4 @@ export type PanelDockedSlide = {
|
|
|
38
47
|
* {@link useExitAnimation} and the Drawer's styled components.
|
|
39
48
|
*/
|
|
40
49
|
export declare function usePanelDockedSlide({ slot, defaultSize, minSize, maxSize, collapsible, resizable, lockWidthOnWindowResize, collapsedSize, }: PanelDockedSlideOptions): PanelDockedSlide;
|
|
50
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get getMaxSize(){return getMaxSize},get usePanelDockedSlide(){return usePanelDockedSlide}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const _react=require("react"),_react1=require("@emotion/react"),_useWindow=require("../../shared/useWindow"),_parseDurationMs=require("../../shared/parseDurationMs"),_prefersReducedMotion=require("../../shared/prefersReducedMotion"),_registry=require("./registry"),_useLayout=require("./useLayout"),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,minSizeFor=({collapsedSize,isVisible,minSize})=>void 0===collapsedSize?minSize:isVisible?minSize??collapsedSize:collapsedSize,getMaxSize=({collapsedSize,isVisible,maxSize,openSize,phase})=>void 0===collapsedSize?maxSize:isVisible||"idle"!==phase?maxSize??openSize:collapsedSize;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)(),rowKey=(0,_registry.usePanelRow)(),reducedMotion=(0,_prefersReducedMotion.prefersReducedMotion)(window),hasCollapsedRest=void 0!==collapsedSize,isCollapsible=collapsible&&!hasCollapsedRest,[isMounted,setIsMounted]=(0,_react.useState)(isVisible),[phase,setPhase]=(0,_react.useState)("idle"),[fixedWidth,setFixedWidth]=(0,_react.useState)(null),[prevVisible,setPrevVisible]=(0,_react.useState)(isVisible);isVisible!==prevVisible&&(setPrevVisible(isVisible),setPhase(isVisible?"entering":"exiting"),isVisible&&setIsMounted(!0),animation?.setResizeSuppressed(slot,!0));let openSize=hasCollapsedRest?state.size??defaultSize:defaultSize;(0,_registry.useDeclarePanel)(slot,{defaultSize:mountDefaultSizeFor({collapsedSize,defaultSize:openSize,isVisible,isSlidingIn:"entering"===phase&&collapsible&&!reducedMotion}),minSize:minSizeFor({collapsedSize,isVisible,minSize}),maxSize:getMaxSize({collapsedSize,isVisible,maxSize,openSize,phase}),collapsible:isCollapsible,resizable,lockWidthOnWindowResize}),(0,_registry.usePanelPresence)(slot,hasCollapsedRest||isMounted);let latestRest=(0,_react.useRef)({isVisible,openSize,phase});return latestRest.current={isVisible,openSize,phase},(0,_react.useLayoutEffect)(()=>{if(!hasCollapsedRest)return;let frame=0,cancelled=!1,resizeToRest=attempt=>{if(cancelled)return;let handle=animation?.getHandle(slot)??null;if(handle&&isHandleReady(handle)){let rest=latestRest.current;if("idle"!==rest.phase)return;let restSize=rest.isVisible?rest.openSize??minSize:collapsedSize;try{void 0!==restSize&&handle.resize(restSize)}catch{}return}animation&&!(attempt>=30)&&(frame=window.requestAnimationFrame(()=>resizeToRest(attempt+1)))};return Promise.resolve().then(()=>resizeToRest(0)),()=>{cancelled=!0,window.cancelAnimationFrame(frame)}},[rowKey]),(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=(0,_parseDurationMs.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{}setFixedWidth(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);setFixedWidth("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)},waitForColumn=attempt=>{if(cancelled)return;if(0===attempt&&hasCollapsedRest){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,fixedWidth}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return Modal}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react1=require("@emotion/react"),_Header=require("../../Typography/Header/Header"),_Stack=require("../../Stack/Stack"),_Container=require("../../Container/Container"),_Box=require("../../Box/Box"),_ButtonGroup=require("../ButtonGroup/ButtonGroup"),_PictogramButton=require("../../PictogramButton/PictogramButton"),_Text=require("../../Typography/Text/Text"),_mediaQueries=require("../../../shared/mediaQueries"),_useScrollDetection=require("../../../shared/useScrollDetection"),_appendId=require("../../../shared/appendId"),_useWindow=require("../../../shared/useWindow"),_Lightbox=require("../../Lightbox/Lightbox"),getDesktopSpace=theme=>theme.variables.size.spacing.l,getDesktopInnerSpace=theme=>theme.variables.size.spacing.xl,getMobileSpace=theme=>theme.variables.size.spacing.m,getMobileInnerSpace=theme=>theme.variables.size.spacing.m,StyledModalWrapper=(0,_styled.default)("div",{target:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Modal",{enumerable:!0,get:function(){return Modal}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_react=/*#__PURE__*/require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react1=require("@emotion/react"),_Header=require("../../Typography/Header/Header"),_Stack=require("../../Stack/Stack"),_Container=require("../../Container/Container"),_Box=require("../../Box/Box"),_ButtonGroup=require("../ButtonGroup/ButtonGroup"),_PictogramButton=require("../../PictogramButton/PictogramButton"),_Text=require("../../Typography/Text/Text"),_mediaQueries=require("../../../shared/mediaQueries"),_useScrollDetection=require("../../../shared/useScrollDetection"),_appendId=require("../../../shared/appendId"),_useWindow=require("../../../shared/useWindow"),_Lightbox=require("../../Lightbox/Lightbox"),getDesktopSpace=theme=>theme.variables.size.spacing.l,getDesktopInnerSpace=theme=>theme.variables.size.spacing.xl,getMobileSpace=theme=>theme.variables.size.spacing.m,getMobileInnerSpace=theme=>theme.variables.size.spacing.m,StyledModalWrapper=(0,_styled.default)("div",{target:"e1v2szni0",label:"StyledModalWrapper"})(({theme,isFullScreen,size})=>{let fadeInModal=(0,_react.useMemo)(()=>(0,_react1.keyframes)`
|
|
2
2
|
from {
|
|
3
3
|
opacity: ${theme.variables.opacity.hidden};
|
|
4
4
|
transform: translateY(20px);
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
opacity: ${theme.variables.opacity.visible};
|
|
8
8
|
transform: translateY(0);
|
|
9
9
|
}
|
|
10
|
-
`,[theme.variables.opacity.hidden,theme.variables.opacity.visible]);return{animation:`${fadeInModal} ${theme.variables.animation.modal.open.duration} ${theme.variables.animation.modal.open.delay} ${theme.variables.animation.modal.open.timingFunction} both`,"&:focus":{outline:"none"},...(0,_mediaQueries.useResponsiveValue)({width:[`calc(100% - ${getMobileSpace(theme)} * 2)`,isFullScreen?`calc(100% - ${getDesktopSpace(theme)} * 2)`:theme.variables.size.dimension.modal.width[size]]})}}),StyledInner=(0,_styled.default)("div",{target:"
|
|
10
|
+
`,[theme.variables.opacity.hidden,theme.variables.opacity.visible]);return{animation:`${fadeInModal} ${theme.variables.animation.modal.open.duration} ${theme.variables.animation.modal.open.delay} ${theme.variables.animation.modal.open.timingFunction} both`,"&:focus":{outline:"none"},...(0,_mediaQueries.useResponsiveValue)({width:[`calc(100% - ${getMobileSpace(theme)} * 2)`,isFullScreen?`calc(100% - ${getDesktopSpace(theme)} * 2)`:theme.variables.size.dimension.modal.width[size]]})}}),StyledInner=(0,_styled.default)("div",{target:"e1v2szni1",label:"StyledInner"})(({theme,isFullScreen,size})=>{let mobileVerticalSpace=getMobileSpace(theme),mobileInnerVerticalSpace=getMobileInnerSpace(theme),desktopVerticalSpace=getDesktopSpace(theme),desktopInnerVerticalSpace=getDesktopInnerSpace(theme),fullScreenMobile=`calc(100dvh - ${mobileVerticalSpace} * 2 - ${mobileInnerVerticalSpace} * 2)`;return{display:"flex",...(0,_mediaQueries.useResponsiveValue)({height:["l"===size||isFullScreen?fullScreenMobile:"auto",isFullScreen?`calc(100dvh - ${desktopVerticalSpace} * 2 - ${desktopInnerVerticalSpace} * 2)`:"l"===size?`calc(100dvh - ${desktopVerticalSpace} * 2 - ${desktopInnerVerticalSpace} * 2 - ${theme.variables.size.dimension.modal.margin.l} * 2)`:"auto"],maxHeight:[fullScreenMobile,isFullScreen?"auto":"l"===size?`calc(${theme.variables.size.dimension.modal.maxHeight.l} - ${desktopInnerVerticalSpace} * 2)`:`calc(100dvh - ${desktopVerticalSpace} * 2 - ${desktopInnerVerticalSpace} * 2)`]}),flexDirection:"column",overflow:"hidden"}}),StyledBody=(0,_styled.default)("div",{target:"e1v2szni2",label:"StyledBody"})(({theme,borderBottom,borderTop,size,isFullScreen,privateProps})=>({overflowY:"auto",maxHeight:"100%",...(isFullScreen||"l"===size)&&{flex:1},...privateProps?.height&&{height:privateProps?.height},...borderBottom&&{borderBottom:`1px solid ${theme.values.color.divider.primary}`},...borderTop&&{borderTop:`1px solid ${theme.values.color.divider.primary}`}})),StyledImg=(0,_styled.default)("img",{target:"e1v2szni3",label:"StyledImg"})(()=>({width:"100%",aspectRatio:"16/9"})),StyledMaxWidth=(0,_styled.default)("div",{target:"e1v2szni4",label:"StyledMaxWidth"})(({theme})=>({maxWidth:theme.variables.size.dimension.modal.fullScreenContentWidth,margin:"0 auto",height:"100%"})),StyledXContainer=(0,_styled.default)("div",{target:"e1v2szni5",label:"StyledXContainer"})(({theme})=>({position:"absolute",...(0,_mediaQueries.useResponsiveValue)({top:[theme.variables.size.spacing.s,theme.variables.size.spacing.l],right:[theme.variables.size.spacing.s,theme.variables.size.spacing.l]})})),Footer=({children,alignItems=["stretch","right"],isShortViewport})=>_react.default.createElement(_Box.Box,{space:"zero",tSpace:isShortViewport?"m":"l"},_react.default.createElement(_Stack.Stack,{alignItems:alignItems},children)),HorizontalOffset=({children,isFullScreen,isMaxWidthLimit,height})=>_react.default.createElement(_Box.Box,{space:["m","xl"],vSpace:"zero",height:height},isFullScreen&&isMaxWidthLimit?_react.default.createElement(StyledMaxWidth,null,children):children);function getIsShortViewport(window){return void 0!==window&&window.innerHeight<420}function Modal({header,subHeader,labelHeader,children,imageUrl,ImageComponent,secondaryButton,cancelButtonLabel,isDismissible=!0,isFullScreen,isMaxWidthLimit=!0,actionButton,role="dialog",onAction,size="m",privateProps:{skipPortal,height,zeroPadding,tabbableOptions}={skipPortal:!1,height:void 0,zeroPadding:!1},portalContainer,closeButtonAriaLabel="Dismiss Dialog","data-e2e-test-id":dataE2eTestId,imageAlt,initialFocus,...ariaAttributes}){let{"aria-label":ariaLabel,"aria-describedby":ariaDescribedBy,...restAriaAttributes}=ariaAttributes,backdropRef=(0,_react.useRef)(null),subHeaderId=(0,_react.useId)(),window=(0,_useWindow.useWindow)(),{scrollableRef,isScrollBottom,isScrollTop,hasScroll}=(0,_useScrollDetection.useScrollDetection)(),[isShortViewport,setIsShortViewport]=(0,_react.useState)(getIsShortViewport(window));(0,_react.useEffect)(()=>{let resizeObserver;return"undefined"!=typeof ResizeObserver&&backdropRef.current&&(resizeObserver=new ResizeObserver(()=>{setIsShortViewport(getIsShortViewport(window))})).observe(backdropRef.current),()=>{resizeObserver&&resizeObserver.disconnect()}},[window]);let handleClose=()=>{onAction?.("cancel")},hasImage=imageUrl||ImageComponent,HeadingComponent=isShortViewport?_Header.H3:_Header.H2,isImageVisible=!isShortViewport&&!!hasImage,horizontalOffsetProps={isFullScreen,isMaxWidthLimit},hasHeaderRow=isDismissible||!!(labelHeader||header||subHeader||isImageVisible),closeButton=isDismissible&&_react.default.createElement(StyledXContainer,null,_react.default.createElement(_PictogramButton.PictogramButton,{variant:"tertiary",icon:"x",size:"s",onClick:handleClose,"aria-label":closeButtonAriaLabel,"data-modal-close-btn":!0}));return _react.default.createElement(_Lightbox.Lightbox,{backdropRef:backdropRef,portalContainer:portalContainer,handleClose:handleClose,isDismissible:isDismissible,privateProps:{skipPortal,tabbableOptions},initialFocus:initialFocus},_react.default.createElement(StyledModalWrapper,{role:role,"data-e2e-test-id":dataE2eTestId,"data-ds-id":"Modal",isFullScreen:isFullScreen,size:size,"aria-label":ariaLabel||header,"aria-describedby":subHeader?(0,_appendId.appendId)(ariaDescribedBy,subHeaderId):ariaDescribedBy,...restAriaAttributes,"aria-modal":"true",tabIndex:-1},_react.default.createElement(_Container.Container,{elevation:4},_react.default.createElement(_Box.Box,{space:"zero",vSpace:["m","xl"]},_react.default.createElement(StyledInner,{isFullScreen:isFullScreen,size:size},hasHeaderRow&&_react.default.createElement(HorizontalOffset,horizontalOffsetProps,_react.default.createElement(_Box.Box,{space:"zero",bSpace:"s"},_react.default.createElement(_Stack.Stack,{space:isImageVisible?["s","l"]:"zero"},isImageVisible&&(imageUrl?_react.default.createElement(_Box.Box,{space:"zero",tSpace:["xl","l"]},_react.default.createElement(StyledImg,{src:imageUrl,alt:imageAlt})):ImageComponent&&_react.default.createElement(ImageComponent,null)),_react.default.createElement(_Stack.Stack,{space:"xxs"},labelHeader&&_react.default.createElement(_Header.H6,{as:"div"},labelHeader),_react.default.createElement(_Stack.Stack,{space:"zero"},header&&_react.default.createElement(HeadingComponent,{as:"h1"},header),subHeader&&_react.default.createElement(_Header.H4,{as:"h2",color:"tertiary",id:subHeaderId},subHeader)))))),_react.default.createElement(StyledBody,{ref:scrollableRef,size:size,isFullScreen:isFullScreen,borderBottom:hasScroll&&!isScrollBottom,borderTop:hasScroll&&!isScrollTop,privateProps:{height}},zeroPadding?children:_react.default.createElement(_Box.Box,{space:"zero",vSpace:"xxxs",height:"100%"},_react.default.createElement(HorizontalOffset,{...horizontalOffsetProps,height:"100%"},children))),(actionButton||cancelButtonLabel||secondaryButton)&&_react.default.createElement(HorizontalOffset,horizontalOffsetProps,_react.default.createElement(Footer,{isShortViewport:isShortViewport},_react.default.createElement(_ButtonGroup.ButtonGroup,{actionButton:actionButton,secondaryButton:secondaryButton,cancelButtonText:cancelButtonLabel,onButtonClick:onAction}))),closeButton)))))}Modal.Stack=({children,...rest})=>_react.default.createElement(_Stack.Stack,{...rest,space:"m"},children),Modal.Text=({children,...rest})=>_react.default.createElement(_Text.Text,{...rest,size:"m",color:"tertiary"},children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BaseTooltip",{enumerable:!0,get:function(){return BaseTooltip}});const _interop_require_wildcard=require("@swc/helpers/_/_interop_require_wildcard"),_interactions=require("@react-aria/interactions"),_react=/*#__PURE__*/_interop_require_wildcard._(require("react")),_TooltipContent=require("./TooltipContent");function BaseTooltip({placement="auto",content,children,externalTriggerRef,portalContainer,contentPadding,maxWidth,subTheme,"data-e2e-test-id":dataE2eTestId,onVisibilityChange,privateProps,...ariaAttributes}){let tooltipId=(0,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"BaseTooltip",{enumerable:!0,get:function(){return BaseTooltip}});const _interop_require_wildcard=require("@swc/helpers/_/_interop_require_wildcard"),_interactions=require("@react-aria/interactions"),_react=require("@emotion/react"),_react1=/*#__PURE__*/_interop_require_wildcard._(require("react")),_parseDurationMs=require("../../shared/parseDurationMs"),_TooltipContent=require("./TooltipContent");let openTooltip=null,lastHiddenInstance=null,lastTooltipHideTimestamp=0;const isOpenTooltip=instance=>openTooltip?.instance===instance,canReplacePreviousTooltip=(instance,replaceWindow)=>openTooltip?openTooltip.isReplaceable():lastHiddenInstance!==instance&&Date.now()-lastTooltipHideTimestamp<replaceWindow;function BaseTooltip({placement="auto",content,children,externalTriggerRef,portalContainer,contentPadding,maxWidth,subTheme,"data-e2e-test-id":dataE2eTestId,onVisibilityChange,privateProps,...ariaAttributes}){let tooltipId=(0,_react1.useMemo)(()=>`DSTooltip_${Math.floor(Date.now()*Math.random())}`,[]),{isFocusVisible}=(0,_interactions.useFocusVisible)(),{open:openMotion,close:closeMotion,replace:replaceMotion}=(0,_react.useTheme)().variables.animation.tooltip,showDelay=(0,_parseDurationMs.parseDurationMs)(openMotion.delay),hideDelay=(0,_parseDurationMs.parseDurationMs)(closeMotion.delay),replaceWindow=(0,_parseDurationMs.parseDurationMs)(replaceMotion.window),instanceRef=(0,_react1.useRef)({}),[isVisible,setVisible]=(0,_react1.useState)(!1),[openedAsReplacement,setOpenedAsReplacement]=(0,_react1.useState)(!1),triggeredByEvent=(0,_react1.useRef)(null),isTooltipHovered=(0,_react1.useRef)(!1),isTriggerHovered=(0,_react1.useRef)(!1),hideTooltipTimeoutId=(0,_react1.useRef)(null),showTooltipTimeoutId=(0,_react1.useRef)(null),internalTriggerRef=(0,_react1.useRef)(null),triggerRef=externalTriggerRef||internalTriggerRef,toggleVisibility=(0,_react1.useCallback)(status=>{setVisible(status),status||setOpenedAsReplacement(!1),onVisibilityChange&&onVisibilityChange(status)},[onVisibilityChange]),handleTriggerPointerEnter=(0,_react1.useCallback)(()=>{if(isTriggerHovered.current=!0,!isTooltipHovered.current&&!isOpenTooltip(instanceRef.current)){clearTimeout(showTooltipTimeoutId.current);let showOnHover=()=>{triggeredByEvent.current="hover",toggleVisibility(!0)};if(canReplacePreviousTooltip(instanceRef.current,replaceWindow)){openTooltip?.hide(),setOpenedAsReplacement(!0),showOnHover();return}showTooltipTimeoutId.current=setTimeout(()=>{isTriggerHovered.current&&showOnHover()},showDelay)}},[toggleVisibility,showDelay,replaceWindow]),scheduleHoverHide=(0,_react1.useCallback)(()=>{clearTimeout(hideTooltipTimeoutId.current),hideTooltipTimeoutId.current=setTimeout(()=>{isTooltipHovered.current||"hover"!==triggeredByEvent.current||isTriggerHovered.current||toggleVisibility(!1)},hideDelay)},[toggleVisibility,hideDelay]),handleTriggerPointerLeave=(0,_react1.useCallback)(()=>{isTriggerHovered.current=!1,scheduleHoverHide()},[scheduleHoverHide]),handleTriggerFocus=(0,_react1.useCallback)(()=>{isFocusVisible&&(triggeredByEvent.current="focus",toggleVisibility(!0))},[isFocusVisible,toggleVisibility]),handleTriggerBlur=(0,_react1.useCallback)(()=>{"focus"===triggeredByEvent.current&&toggleVisibility(!1)},[toggleVisibility]),handleTriggerClick=(0,_react1.useCallback)(()=>{toggleVisibility(!1)},[toggleVisibility]),handleTriggerKeyDown=(0,_react1.useCallback)(evt=>{"Escape"===evt.key&&toggleVisibility(!1)},[toggleVisibility]),toggleVisibilityRef=(0,_react1.useRef)(toggleVisibility);(0,_react1.useEffect)(()=>{toggleVisibilityRef.current=toggleVisibility},[toggleVisibility]),(0,_react1.useEffect)(()=>{if(!isVisible)return;let openedTooltip={instance:instanceRef.current,hide:()=>{clearTimeout(hideTooltipTimeoutId.current),toggleVisibilityRef.current(!1)},isReplaceable:()=>"hover"===triggeredByEvent.current};return openTooltip=openedTooltip,()=>{openTooltip===openedTooltip&&(openTooltip=null),lastHiddenInstance=openedTooltip.instance,lastTooltipHideTimestamp=Date.now()}},[isVisible]),(0,_react1.useEffect)(()=>()=>{clearTimeout(showTooltipTimeoutId.current),clearTimeout(hideTooltipTimeoutId.current)},[]),(0,_react1.useEffect)(()=>{let trigger;if(externalTriggerRef?.current&&!children){let triggerTabIndex=(trigger=externalTriggerRef.current).getAttribute("tabindex");trigger.setAttribute("tabindex",triggerTabIndex??"0"),trigger.addEventListener("pointerenter",handleTriggerPointerEnter),trigger.addEventListener("pointerleave",handleTriggerPointerLeave),trigger.addEventListener("focus",handleTriggerFocus),trigger.addEventListener("blur",handleTriggerBlur),trigger.addEventListener("click",handleTriggerClick),trigger.addEventListener("keydown",handleTriggerKeyDown)}return()=>{trigger&&(trigger.removeEventListener("pointerenter",handleTriggerPointerEnter),trigger.removeEventListener("pointerleave",handleTriggerPointerLeave),trigger.removeEventListener("focus",handleTriggerFocus),trigger.removeEventListener("blur",handleTriggerBlur),trigger.removeEventListener("click",handleTriggerClick),trigger.removeEventListener("keydown",handleTriggerKeyDown))}},[externalTriggerRef,children,handleTriggerPointerEnter,handleTriggerPointerLeave,handleTriggerFocus,handleTriggerBlur,handleTriggerClick,handleTriggerKeyDown]),(0,_react1.useEffect)(()=>{if(externalTriggerRef?.current&&!children){let trigger=externalTriggerRef.current;isVisible?trigger.setAttribute("aria-describedby",tooltipId):trigger.removeAttribute("aria-describedby")}},[externalTriggerRef,children,tooltipId,isVisible]);let triggerElm=children?_react1.default.cloneElement(children,{ref:triggerRef,...ariaAttributes,...isVisible&&{"aria-describedby":tooltipId},tabIndex:children.props.tabIndex??0,onPointerEnter:handleTriggerPointerEnter,onPointerLeave:handleTriggerPointerLeave,onFocus:evt=>{handleTriggerFocus(),children.props.onFocus&&children.props.onFocus(evt)},onBlur:evt=>{handleTriggerBlur(),children.props.onBlur&&children.props.onBlur(evt)},onClick:evt=>{handleTriggerClick(),children.props.onClick&&children.props.onClick(evt)},onKeyDown:handleTriggerKeyDown}):null,tooltipElm=_react1.default.createElement(_TooltipContent.TooltipContent,{dataDSId:"Tooltip",content:content,placement:placement,portalContainer:portalContainer,dataE2eTestId:dataE2eTestId,isVisible:isVisible,skipOpenAnimation:openedAsReplacement,hasHoverBridge:!0,tooltipId:tooltipId,triggerRef:triggerRef,role:"tooltip",contentPadding:contentPadding,maxWidth:maxWidth,subTheme:subTheme,onTooltipPointerEnter:()=>{isTooltipHovered.current=!0},onTooltipPointerLeave:()=>{isTooltipHovered.current=!1,scheduleHoverHide()},privateProps:privateProps});return _react1.default.createElement(_react1.default.Fragment,null,triggerElm,tooltipElm)}
|
|
@@ -45,6 +45,18 @@ export type TooltipContentProps = {
|
|
|
45
45
|
hideArrow?: boolean;
|
|
46
46
|
/** Sets css visibility hidden when trigger is scrolled out of view */
|
|
47
47
|
isHiddenOnInvisibleTrigger?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
* Appears without its open animation, when this tooltip replaces one already
|
|
51
|
+
* on screen. Defaults to `false`.
|
|
52
|
+
*/
|
|
53
|
+
skipOpenAnimation?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* Covers the gap to the trigger with an invisible hover area, so a hover
|
|
57
|
+
* tooltip survives the pointer moving onto it. Defaults to `false`.
|
|
58
|
+
*/
|
|
59
|
+
hasHoverBridge?: boolean;
|
|
48
60
|
onTooltipPointerEnter?: React.PointerEventHandler<HTMLDivElement>;
|
|
49
61
|
onTooltipPointerLeave?: React.PointerEventHandler<HTMLDivElement>;
|
|
50
62
|
/** This callback is triggered when content overflows the viewport both above and below trigger. Use this for tracking purposes or re-rendering Popover with a larger maxWidth */
|
|
@@ -52,4 +64,4 @@ export type TooltipContentProps = {
|
|
|
52
64
|
privateProps?: TooltipPrivateProps;
|
|
53
65
|
} & Pick<PortalProps, "portalContainer"> & AriaAttributes;
|
|
54
66
|
/** This component is used to display the overlay for both Toggletip and Tooltip components */
|
|
55
|
-
export declare function TooltipContent({ placement, content, tooltipId, triggerRef, portalContainer, dataE2eTestId, dataDSId, isVisible, "aria-hidden": ariaHidden, role, tabIndex, contentPadding, maxWidth, subTheme, defaultVerticalPlacement, hideArrow, isHiddenOnInvisibleTrigger, onTooltipPointerEnter, onTooltipPointerLeave, onOverflowViewport, privateProps, ...ariaAttributes }: TooltipContentProps): React.ReactElement | null;
|
|
67
|
+
export declare function TooltipContent({ placement, content, tooltipId, triggerRef, portalContainer, dataE2eTestId, dataDSId, isVisible, "aria-hidden": ariaHidden, role, tabIndex, contentPadding, maxWidth, subTheme, defaultVerticalPlacement, hideArrow, isHiddenOnInvisibleTrigger, skipOpenAnimation, hasHoverBridge, onTooltipPointerEnter, onTooltipPointerLeave, onOverflowViewport, privateProps, ...ariaAttributes }: TooltipContentProps): React.ReactElement | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"TooltipContent",{enumerable:!0,get:function(){return TooltipContent}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_interop_require_wildcard=require("@swc/helpers/_/_interop_require_wildcard"),_react=require("@emotion/react"),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react1=/*#__PURE__*/_interop_require_wildcard._(require("react")),_Portal=require("../Portal/Portal"),_SubThemeProvider=require("../SubThemeProvider/SubThemeProvider"),_useFloatingPosition=require("../Utilities/FloatingPosition/useFloatingPosition"),_FloatingPositionedContext=require("./FloatingPositionedContext"),_utils=require("./utils"),StyledContainer=(0,_styled.default)("div",{target:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"TooltipContent",{enumerable:!0,get:function(){return TooltipContent}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_interop_require_wildcard=require("@swc/helpers/_/_interop_require_wildcard"),_react=require("@emotion/react"),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react1=/*#__PURE__*/_interop_require_wildcard._(require("react")),_Portal=require("../Portal/Portal"),_SubThemeProvider=require("../SubThemeProvider/SubThemeProvider"),_useFloatingPosition=require("../Utilities/FloatingPosition/useFloatingPosition"),_FloatingPositionedContext=require("./FloatingPositionedContext"),_utils=require("./utils"),StyledContainer=(0,_styled.default)("div",{target:"e1igm2h80",label:"StyledContainer"})(({theme,side,maxWidth,contentPadding,subTheme,isHidden,isSidePlacement,hoverBridgeSize})=>{let zIndex=(0,_Portal.usePortalChildZIndex)(theme.variables.zIndex.tooltip),{open:openMotion}=theme.variables.animation.tooltip,animationDistance="top"===side?`-${openMotion.distanceY}`:openMotion.distanceY,animation=(0,_react.keyframes)({from:{opacity:theme.variables.opacity.hidden,...!isSidePlacement&&{transform:`translateY(${animationDistance})`}},to:{opacity:theme.variables.opacity.visible,...!isSidePlacement&&{transform:"translateY(0)"}}}),contentPaddingMap={s:theme.variables.size.spacing.xxs,m:theme.variables.size.spacing.s},invertedSubThemeStyles={padding:`${theme.variables.size.spacing.xs} ${theme.variables.size.spacing.s}`,...contentPadding&&{padding:contentPaddingMap[contentPadding]}};return{zIndex,opacity:theme.variables.opacity.hidden,animation:`${openMotion.duration} ${openMotion.timingFunction} forwards ${animation}`,maxWidth,width:"max-content",boxSizing:"border-box",backgroundColor:subTheme?theme.values.color.background.primary.default:theme.values.color.background.elevated.default,borderRadius:subTheme?theme.variables.size.borderRadius.xs:theme.variables.size.borderRadius.s,...isHidden&&{visibility:"hidden"},...void 0!==hoverBridgeSize&&{"::before":{content:'""',position:"absolute",..."top"===side&&{top:"100%",left:0,right:0,height:hoverBridgeSize},..."bottom"===side&&{bottom:"100%",left:0,right:0,height:hoverBridgeSize},...side===_utils.SIDE_PLACEMENT_SIDE&&{right:"100%",top:0,bottom:0,width:hoverBridgeSize}}},"@media (prefers-reduced-motion: reduce)":{animation:"none",opacity:theme.variables.opacity.visible},...!!subTheme&&invertedSubThemeStyles,...!subTheme&&{":after":{content:'" "',position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",borderRadius:"inherit",boxShadow:theme.values.elevation[3]}}}}),StyledArrow=(0,_styled.default)("div",{target:"e1igm2h81",label:"StyledArrow"})(({theme,subTheme,side,size=_utils.ARROW_SIZE,arrowOffsetLeft})=>{let adjustmentForShadow=+!subTheme,arrowContainerHeight=size+_utils.DISTANCE_FROM_TRIGGER,arrowSideLength=Math.sqrt(size**2+(size+adjustmentForShadow)**2);return{position:"absolute",left:arrowOffsetLeft,width:40,height:arrowContainerHeight,zIndex:1,overflow:"hidden",..."top"===side&&{top:`calc(100% - ${adjustmentForShadow}px)`},..."bottom"===side&&{top:`-${arrowContainerHeight-adjustmentForShadow}px`},"&::after":{content:'" "',position:"absolute",top:"top"===side?0:"100%",left:"50%",width:arrowSideLength,height:arrowSideLength,backgroundColor:subTheme?theme.values.color.background.primary.default:theme.values.color.background.elevated.default,transform:"translate(-50%, -50%) rotate(45deg)",...!subTheme&&{boxShadow:theme.values.elevation[3]}}}});function TooltipContent({placement="auto",content,tooltipId,triggerRef,portalContainer,dataE2eTestId,dataDSId,isVisible,"aria-hidden":ariaHidden,role,tabIndex,contentPadding,maxWidth=224,subTheme,defaultVerticalPlacement,hideArrow=!1,isHiddenOnInvisibleTrigger=!1,skipOpenAnimation=!1,hasHoverBridge=!1,onTooltipPointerEnter,onTooltipPointerLeave,onOverflowViewport,privateProps,...ariaAttributes}){let[isHidden,setIsHidden]=(0,_react1.useState)(!1),arrowRef=(0,_react1.useRef)(null),isOverflowCallbackCalledRef=(0,_react1.useRef)(!1),{placement:sidePlacement,offset:sideOffset=_utils.sidePlacementOffset,maxWidth:privateMaxWidth}=privateProps??{},arrowSize=(0,_react1.useMemo)(()=>hideArrow?0:subTheme?_utils.ARROW_SIZE:_utils.ARROW_SIZE_BIG,[subTheme,hideArrow]),handleViewportOverflow=(0,_react1.useCallback)((triggerRect,tooltipRect,viewportHeight)=>{isOverflowCallbackCalledRef.current||(onOverflowViewport?.(triggerRect,tooltipRect,viewportHeight),isOverflowCallbackCalledRef.current=!0)},[onOverflowViewport,isOverflowCallbackCalledRef]),overflowMiddleware=(0,_react1.useMemo)(()=>"auto"===placement?[(0,_utils.createOverflowViewportReporter)(handleViewportOverflow)]:void 0,[placement,handleViewportOverflow]),{placement:preferredPlacement,fallbackPlacements}=(0,_react1.useMemo)(()=>(0,_utils.toFloatingPlacement)({placement,defaultVerticalPlacement,sidePlacement}),[placement,defaultVerticalPlacement,sidePlacement]),offset=(0,_react1.useMemo)(()=>(0,_utils.getTooltipOffsetOptions)({arrowSize,sideOffset}),[arrowSize,sideOffset]),anchorRef=(0,_react1.useRef)(null),anchorSourceRef=(0,_react1.useRef)(null);anchorSourceRef.current!==triggerRef.current&&(anchorSourceRef.current=triggerRef.current,anchorRef.current=(0,_utils.toFloatingAnchor)(triggerRef.current));let{setFloating,floatingStyles,placement:resolvedPlacement,isPositioned,middlewareData}=(0,_useFloatingPosition.useFloatingPosition)({anchorRef,placement:preferredPlacement,offset,flip:{fallbackPlacements},arrowRef:hideArrow?void 0:arrowRef,disableTransform:!0,trackAnimationFrame:!0,isOpen:!!isVisible,extraMiddleware:overflowMiddleware});if((0,_react1.useEffect)(()=>{isOverflowCallbackCalledRef.current=!1},[isVisible,isOverflowCallbackCalledRef]),(0,_react1.useEffect)(()=>{let observer;return isHiddenOnInvisibleTrigger&&triggerRef.current&&isVisible&&"undefined"!=typeof IntersectionObserver&&(observer=new IntersectionObserver(entries=>entries.forEach(entry=>{let rect=entry.boundingClientRect;(rect?.width!==0||rect?.height!==0)&&setIsHidden(!entry.isIntersecting)}),{root:null,threshold:.99})).observe(triggerRef.current),()=>{observer&&observer.disconnect()}},[triggerRef,isVisible,isHiddenOnInvisibleTrigger]),!isVisible)return null;let side=(0,_utils.getPlacementSide)(resolvedPlacement),isSidePlacement=side===_utils.SIDE_PLACEMENT_SIDE,triggerGap=isSidePlacement?sideOffset:arrowSize+_utils.DISTANCE_FROM_TRIGGER,tooltipElm=_react1.default.createElement(StyledContainer,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":dataDSId,"data-placement":resolvedPlacement,style:{...floatingStyles,...skipOpenAnimation&&{animationDuration:"0ms"}},ref:setFloating,id:tooltipId,role:role,...ariaAttributes,"aria-hidden":ariaHidden,subTheme:subTheme,tabIndex:tabIndex,side:side,maxWidth:privateMaxWidth??maxWidth,contentPadding:contentPadding,isHidden:isHidden||!isPositioned,isSidePlacement:isSidePlacement,hoverBridgeSize:hasHoverBridge?triggerGap:void 0,onPointerEnter:onTooltipPointerEnter,onPointerLeave:onTooltipPointerLeave},_react1.default.createElement(_FloatingPositionedContext.FloatingPositionedContext.Provider,{value:isPositioned},content),!hideArrow&&side!==_utils.SIDE_PLACEMENT_SIDE&&_react1.default.createElement(StyledArrow,{ref:arrowRef,"data-e2e-test-id":`${dataE2eTestId}_arrow`,subTheme:subTheme,side:side,size:arrowSize,arrowOffsetLeft:middlewareData.arrow?.x})),wrapperElm=subTheme?_react1.default.createElement(_SubThemeProvider.SubThemeProvider,{name:subTheme},tooltipElm):tooltipElm;return _react1.default.createElement(_Portal.Portal,{portalContainer:portalContainer},wrapperElm)}
|
|
@@ -2,7 +2,6 @@ import type { OffsetOptions } from "@floating-ui/react-dom";
|
|
|
2
2
|
import type { Middleware, Placement, VirtualElement } from "../Utilities/FloatingPosition/useFloatingPosition";
|
|
3
3
|
import type { TooltipContentProps, TooltipPlacement, TooltipPrivateProps, TooltipVerticalPlacement } from "./TooltipContent";
|
|
4
4
|
export declare const DISTANCE_FROM_TRIGGER = 4;
|
|
5
|
-
export declare const ANIMATION_DISTANCE = 8;
|
|
6
5
|
export declare const ARROW_SIZE = 6;
|
|
7
6
|
export declare const ARROW_SIZE_BIG = 8;
|
|
8
7
|
/** TODO: remove temporary side placement. Matches the gap top/bottom tooltips settle at. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var target=exports,all={get ARROW_SIZE(){return ARROW_SIZE},get ARROW_SIZE_BIG(){return ARROW_SIZE_BIG},get DISTANCE_FROM_TRIGGER(){return DISTANCE_FROM_TRIGGER},get SIDE_PLACEMENT_SIDE(){return SIDE_PLACEMENT_SIDE},get createOverflowViewportReporter(){return createOverflowViewportReporter},get getArrowOffset(){return getArrowOffset},get getPlacementSide(){return getPlacementSide},get getTooltipOffsetOptions(){return getTooltipOffsetOptions},get sidePlacementOffset(){return sidePlacementOffset},get toFloatingAnchor(){return toFloatingAnchor},get toFloatingPlacement(){return toFloatingPlacement}};for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:Object.getOwnPropertyDescriptor(all,name).get});const DISTANCE_FROM_TRIGGER=4,ARROW_SIZE=6,ARROW_SIZE_BIG=8,sidePlacementOffset=10,getArrowOffset=size=>2*size,START_SUFFIX="-start",END_SUFFIX="-end",SIDE_PLACEMENT="right-start",DS_TO_FLOATING_PLACEMENT={top:"top",bottom:"bottom","top-left":`top${END_SUFFIX}`,"top-right":`top${START_SUFFIX}`,"bottom-left":`bottom${END_SUFFIX}`,"bottom-right":`bottom${START_SUFFIX}`},OPPOSITE_SIDE={top:"bottom",bottom:"top"},sideWithAlignments=side=>[side,`${side}${START_SUFFIX}`,`${side}${END_SUFFIX}`],toFloatingPlacement=({placement,defaultVerticalPlacement,sidePlacement})=>{let isAutomatic=!placement||"auto"===placement,preferred=isAutomatic?defaultVerticalPlacement??"top":DS_TO_FLOATING_PLACEMENT[placement],[side,alignment]=preferred.split("-"),oppositeSide=OPPOSITE_SIDE[side],resolved=isAutomatic?{placement:preferred,fallbackPlacements:[...sideWithAlignments(side).slice(1),...sideWithAlignments(oppositeSide)]}:{placement:preferred,fallbackPlacements:[alignment?`${oppositeSide}-${alignment}`:oppositeSide]};return"right-top"===sidePlacement?{placement:SIDE_PLACEMENT,fallbackPlacements:[resolved.placement,...resolved.fallbackPlacements]}:resolved},SIDE_PLACEMENT_SIDE="right",getPlacementSide=placement=>placement.split("-")[0],getTooltipOffsetOptions=({arrowSize,sideOffset})=>({rects,placement})=>{if(placement===SIDE_PLACEMENT)return{mainAxis:sideOffset};let mainAxis=arrowSize+DISTANCE_FROM_TRIGGER;return(placement.endsWith(START_SUFFIX)||placement.endsWith(END_SUFFIX))&&0!==arrowSize?{mainAxis,alignmentAxis:rects.reference.width/2-getArrowOffset(arrowSize)-arrowSize}:{mainAxis}},createOverflowViewportReporter=onOverflowViewport=>({name:"reportOverflowViewport",fn({elements}){let triggerRect=elements.reference.getBoundingClientRect(),tooltipRect=elements.floating.getBoundingClientRect(),viewportHeight=elements.floating.ownerDocument.documentElement.clientHeight,canPlaceAboveTrigger=triggerRect.top>=tooltipRect.height,canPlaceBelowTrigger=triggerRect.bottom+tooltipRect.height<viewportHeight;return canPlaceAboveTrigger||canPlaceBelowTrigger||onOverflowViewport(triggerRect,tooltipRect,viewportHeight),{}}}),toFloatingAnchor=trigger=>{if(!trigger)return null;if("undefined"!=typeof Range&&trigger instanceof Range){let container=trigger.commonAncestorContainer;return{getBoundingClientRect:()=>trigger.getBoundingClientRect(),getClientRects:()=>trigger.getClientRects(),contextElement:container instanceof Element?container:container.parentElement??void 0}}return trigger};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"VirtualScrollList",{enumerable:!0,get:function(){return VirtualScrollList}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_interop_require_wildcard=require("@swc/helpers/_/_interop_require_wildcard"),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react=/*#__PURE__*/_interop_require_wildcard._(require("react")),_VirtualScrollListReducer=require("./VirtualScrollListReducer"),StyledContainer=(0,_styled.default)("div",{target:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"VirtualScrollList",{enumerable:!0,get:function(){return VirtualScrollList}});const _interop_require_default=require("@swc/helpers/_/_interop_require_default"),_interop_require_wildcard=require("@swc/helpers/_/_interop_require_wildcard"),_styled=/*#__PURE__*/_interop_require_default._(require("@emotion/styled")),_react=/*#__PURE__*/_interop_require_wildcard._(require("react")),_VirtualScrollListReducer=require("./VirtualScrollListReducer"),StyledContainer=(0,_styled.default)("div",{target:"eyhrtu0",label:"StyledContainer"})(({maxHeight})=>({overflow:"auto",width:"100%",height:"100%",maxHeight})),StyledScrollableContent=(0,_styled.default)("div",{target:"eyhrtu1",label:"StyledScrollableContent"})(({maxContentHeight})=>({overflow:"hidden",boxSizing:"border-box",height:maxContentHeight}));function VirtualScrollList({id,maxHeight,itemHeight,itemAmount,emptyState=()=>null,itemInView,itemTemplate,containerStyle,"data-e2e-test-id":dataE2eTestId,onContentHeightChange,role,...ariaAttributes}){let scrollableContainerRef=(0,_react.useRef)(null),viewportRef=(0,_react.useRef)(null),adjustedForReflow=(0,_react.useRef)(!1),[{scrolledItemCount=0,amountOfItemsInView=0,scrolledInPx,maxContentHeight=maxHeight,recommendedScrollPosition},dispatch]=(0,_react.useReducer)(_VirtualScrollListReducer.VirtualScrollReducer,{});(0,_react.useLayoutEffect)(()=>{dispatch({type:"reset",itemHeight,maxHeight,overscan:10});let scrollableContainer=scrollableContainerRef.current;scrollableContainer&&(scrollableContainer.scrollTop=0)},[itemHeight,itemAmount,maxHeight]),(0,_react.useEffect)(()=>{let scrollableContainer=scrollableContainerRef.current;scrollableContainer&&dispatch({type:"recommendScrollPosition",scrollTop:scrollableContainer.scrollTop,itemToBeInView:itemInView})},[itemInView]),(0,_react.useEffect)(()=>{if(null==recommendedScrollPosition)return;let scrollableContainer=scrollableContainerRef.current;scrollableContainer&&(scrollableContainer.scrollTop=recommendedScrollPosition)},[recommendedScrollPosition]),(0,_react.useLayoutEffect)(()=>{viewportRef.current&&dispatch({type:"updateViewport",viewportNode:viewportRef.current,itemAmount})},[itemAmount,scrolledItemCount,amountOfItemsInView]),(0,_react.useEffect)(()=>{onContentHeightChange?.()},[maxContentHeight,onContentHeightChange]);let itemCountToBeRendered=Math.min(Math.max(0,itemAmount-scrolledItemCount),amountOfItemsInView);return maxContentHeight>maxHeight&&!adjustedForReflow.current&&viewportRef.current&&(setTimeout(()=>{let viewportNode=viewportRef.current;viewportNode&&dispatch({type:"updateViewport",viewportNode,itemAmount})}),adjustedForReflow.current=!0),_react.default.createElement(StyledContainer,{ref:scrollableContainerRef,maxHeight:maxHeight,style:{maxHeight,...containerStyle},"data-e2e-test-id":dataE2eTestId,"data-ds-id":"VirtualScrollList",onScroll:e=>{dispatch({type:"scroll",scrollTop:e.currentTarget.scrollTop})}},0===itemAmount?emptyState():_react.default.createElement(StyledScrollableContent,{maxContentHeight:maxContentHeight},_react.default.createElement("div",{ref:viewportRef,style:{transform:`translateY(${scrolledInPx}px`},role:role,id:id,...ariaAttributes},!!itemCountToBeRendered&&Array(itemCountToBeRendered).fill(0).map((_,index)=>itemTemplate(scrolledItemCount+index)))))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"parseDurationMs",{enumerable:!0,get:function(){return parseDurationMs}});const parseDurationMs=duration=>{let trimmed=duration.trim();return trimmed.endsWith("ms")?parseFloat(trimmed):trimmed.endsWith("s")?1e3*parseFloat(trimmed):parseFloat(trimmed)||0};
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"credit-card": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M3 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h18a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3zm19 6V6a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v3zM2 11h20v7a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z\" clip-rule=\"evenodd\"/></svg>",
|
|
71
71
|
"cursor-default": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill-rule=\"evenodd\" d=\"M1.293 2.293a1 1 0 0 0-.197 1.135l9 19a1 1 0 0 0 1.874-.186l1.855-7.417 7.418-1.855a1 1 0 0 0 .185-1.874l-19-9a1 1 0 0 0-1.135.197m16.754 9.415-5.29 1.322a1 1 0 0 0-.727.728l-1.322 5.289L4.102 5.102z\" clip-rule=\"evenodd\"/></svg>",
|
|
72
72
|
"cursor-text": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M16 1a1 1 0 1 1 0 2 3 3 0 0 0-3 3v5h2a1 1 0 1 1 0 2h-2v5.494A2.506 2.506 0 0 0 15.506 21a1 1 0 0 1 0 2A4.5 4.5 0 0 1 12 21.322 4.5 4.5 0 0 1 8.494 23a1 1 0 1 1 0-2A2.506 2.506 0 0 0 11 18.494V13H9a1 1 0 1 1 0-2h2V6a3 3 0 0 0-3-3 1 1 0 0 1 0-2c1.636 0 3.088.786 4 2a5 5 0 0 1 4-2\"/></svg>",
|
|
73
|
-
"dgim": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"currentColor\" d=\"M14.255 14.863c.683.371 1.338.934 1.795 1.416.833.881 1.08 1.884 1.057 2.877l-.002.088a3.93 3.93 0 0 1-1.217 2.732c-.87.83-1.991 1.041-3.09 1.023h-2.13c-.957 0-1.414-.216-1.928-.455-.54-.25-.94-.615-.94-.937v-.38c0-.253.4-.67.951-.915.751-.334 1.044-.449 1.917-.449h3.156c.227 0 .43-.052.431-.083z\"/><path fill=\"currentColor\" d=\"M14.255 5.987c.784.104 3.498.615 3.725 2.744.201 1.89-1.156 2.586-1.95 3.002l-5.36 2.627v4.368c-.927-.437-1.982-.762-2.686-1.636-.646-.801-1.004-1.815-.983-2.78l.01-.15c0-.011-.007-1.908 1.846-2.769l5.398-2.646z\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M14.005 1c.893 0 1.44.212 2.145.633.15.092 1.002.593 1.002.94l-.003.355c0 .331-.594.755-.812.865-.655.338-1.294.717-2.08.717h-3.159c-.227 0-.43.054-.43.114v5.069c-.747-.442-1.55-.967-2.043-1.462a3.74 3.74 0 0 1-1.107-2.748l.012-.449C7.579 2.85 9.437 1 11.578 1zm-.445 1.063a.426.426 0 0 0-.433.417c0 .23.194.417.433.417a.426.426 0 0 0 .433-.417.426.426 0 0 0-.433-.417\" clip-rule=\"evenodd\"/></svg>",
|
|
74
73
|
"dosage": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"currentColor\" d=\"M12 6a1 1 0 1 0-2 0v5a1 1 0 0 0 .46.841l1.5.964a1 1 0 0 0 1.08-1.683L12 10.454z\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M11 1c5.362 0 9.738 4.22 9.989 9.52A3.97 3.97 0 0 1 23 13.972a3.98 3.98 0 0 1-1.159 2.81h-.001l-2.483 2.483-.034.036-2.538 2.539-.002.002a3.978 3.978 0 0 1-6.264-.853C5.22 20.738 1 16.362 1 11 1 5.477 5.477 1 11 1M3 11a8 8 0 0 1 15.938-1 3.98 3.98 0 0 0-2.721 1.158l-5.058 5.06A3.98 3.98 0 0 0 10 18.939 8 8 0 0 1 3 11m14.612 7.183-2.24 2.241v.001A1.978 1.978 0 0 1 12 19.026c0-.523.206-1.024.575-1.395l2.242-2.244z\" clip-rule=\"evenodd\"/></svg>",
|
|
75
74
|
"dot": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><circle cx=\"12\" cy=\"12\" r=\"4\"/></svg>",
|
|
76
75
|
"download": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4m4-5 5 5 5-5m-5 5V3\"/></svg>",
|
|
@@ -87,10 +86,10 @@
|
|
|
87
86
|
"face-neutral": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"currentColor\" d=\"M8.19 10.11c.05.04.1.09.15.12q.09.06.18.09.09.045.18.06c.07.01.14.02.2.02.26 0 .52-.11.71-.29.18-.19.29-.45.29-.71s-.11-.52-.29-.71c-.24-.23-.58-.33-.91-.27q-.09.015-.18.06-.09.03-.18.09l-.15.12q-.135.15-.21.33c-.05.12-.08.25-.08.38s.03.26.08.38c.05.13.12.23.21.33m6.91.29c.26 0 .52-.11.71-.29.18-.19.29-.44.29-.71 0-.13-.03-.26-.08-.38-.05-.13-.12-.23-.21-.33-.37-.37-1.05-.37-1.42 0-.09.1-.16.2-.21.33-.05.12-.08.25-.08.38 0 .27.11.52.29.71.19.18.45.29.71.29M12 21c-4.962 0-9-4.038-9-9 0-4.963 4.038-9 9-9 4.963 0 9 4.037 9 9 0 4.962-4.037 9-9 9m0-20C5.935 1 1 5.934 1 12s4.935 11 11 11 11-4.935 11-11S18.065 1 12 1m4 13.5H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2\"/></svg>",
|
|
88
87
|
"face-sad": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"currentColor\" d=\"M8.9 10.4c-.06 0-.13-.01-.2-.02a.6.6 0 0 1-.18-.06.8.8 0 0 1-.18-.09c-.05-.03-.1-.08-.15-.12-.09-.1-.16-.2-.21-.33a1 1 0 0 1-.08-.38c0-.13.03-.26.08-.38q.075-.18.21-.33l.15-.12q.09-.06.18-.09.09-.045.18-.06c.33-.06.67.04.91.27.18.19.29.45.29.71s-.11.52-.29.71c-.19.18-.45.29-.71.29m6.2 0c-.26 0-.52-.11-.71-.29-.18-.19-.29-.44-.29-.71 0-.13.03-.26.08-.38.05-.13.12-.23.21-.33.37-.37 1.05-.37 1.42 0 .09.1.16.2.21.33.05.12.08.25.08.38 0 .27-.11.52-.29.71-.19.18-.45.29-.71.29M12 3c-4.962 0-9 4.038-9 9s4.038 9 9 9c4.963 0 9-4.038 9-9s-4.037-9-9-9m0 20C5.935 23 1 18.066 1 12S5.935 1 12 1s11 4.935 11 11-4.935 11-11 11m4-5.7a1 1 0 0 1-.707-.293 4.66 4.66 0 0 0-6.586 0 .999.999 0 1 1-1.414-1.414 6.663 6.663 0 0 1 9.414 0A.999.999 0 0 1 16 17.3\"/></svg>",
|
|
89
88
|
"facebook": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"#1877F2\" d=\"M24 12c0-6.627-5.373-12-12-12S0 5.373 0 12c0 5.99 4.388 10.954 10.125 11.854V15.47H7.078V12h3.047V9.356c0-3.007 1.792-4.668 4.533-4.668 1.312 0 2.686.234 2.686.234v2.953H15.83c-1.491 0-1.956.925-1.956 1.875V12h3.328l-.532 3.469h-2.796v8.385C19.612 22.954 24 17.99 24 12\"/><path fill=\"#fff\" d=\"M16.671 15.469 17.203 12h-3.328V9.75c0-.949.465-1.875 1.956-1.875h1.513V4.922s-1.374-.234-2.686-.234c-2.741 0-4.533 1.66-4.533 4.668V12H7.078v3.469h3.047v8.385a12.1 12.1 0 0 0 3.75 0V15.47h2.796z\"/></svg>",
|
|
90
|
-
"fc-circle": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
|
|
91
|
-
"fc-diamond": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
|
|
92
|
-
"fc-hexagon": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
|
|
93
|
-
"fc-triangle": "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
|
|
89
|
+
"fc-circle": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M23 12c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1s11 4.925 11 11\"/></svg>",
|
|
90
|
+
"fc-diamond": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M1.354 12.354a.5.5 0 0 1 0-.708L11.646 1.354a.5.5 0 0 1 .708 0l10.292 10.292a.5.5 0 0 1 0 .708L12.354 22.646a.5.5 0 0 1-.708 0z\"/></svg>",
|
|
91
|
+
"fc-hexagon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M22.841 11.739a.5.5 0 0 1 0 .522l-5.195 8.5a.5.5 0 0 1-.426.239H6.78a.5.5 0 0 1-.426-.239l-5.195-8.5a.5.5 0 0 1 0-.522l5.195-8.5A.5.5 0 0 1 6.78 3h10.44a.5.5 0 0 1 .426.239z\"/></svg>",
|
|
92
|
+
"fc-triangle": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M11.567 2.747a.5.5 0 0 1 .866 0L22.566 20.25a.5.5 0 0 1-.433.75H1.867a.5.5 0 0 1-.432-.75z\"/></svg>",
|
|
94
93
|
"figma": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" viewBox=\"0 0 24 24\" focusable=\"false\"><path fill=\"#1ABCFE\" d=\"M12 12a4 4 0 1 1 8 0 4 4 0 0 1-8 0\"/><path fill=\"#0ACF83\" d=\"M4 20a4 4 0 0 1 4-4h4v4a4 4 0 1 1-8 0\"/><path fill=\"#FF7262\" d=\"M12 0v8h4a4 4 0 1 0 0-8z\"/><path fill=\"#F24E1E\" d=\"M4 4a4 4 0 0 0 4 4h4V0H8a4 4 0 0 0-4 4\"/><path fill=\"#A259FF\" d=\"M4 12a4 4 0 0 0 4 4h4V8H8a4 4 0 0 0-4 4\"/></svg>",
|
|
95
94
|
"file-pdf": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"currentColor\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M5.457 14.129q.208 0 .36.047a.7.7 0 0 1 .25.134.5.5 0 0 1 .148.21q.05.12.05.27 0 .326-.196.513-.193.187-.612.187h-.565v-1.36zm3.931.019q.303 0 .54.093.242.094.408.268t.256.425.089.565q0 .316-.09.567-.088.252-.255.428-.167.173-.407.267-.239.09-.541.091h-.762v-2.704z\"/><path fill-rule=\"evenodd\" d=\"m14.172 1.016.026.004.048.011q.024.005.047.012.144.045.267.128l.074.056q.038.03.073.066l7 7A1 1 0 0 1 22 9v11a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3v-1H3a1 1 0 0 1-1-1v-5a1 1 0 0 1 1-1h1V4a3 3 0 0 1 3-3h7q.088 0 .172.016M4.2 13.5a.2.2 0 0 0-.2.2v3.6c0 .11.09.2.2.2h.492a.2.2 0 0 0 .2-.2v-1.176h.565q.43 0 .752-.096.32-.099.532-.276a1.1 1.1 0 0 0 .316-.422 1.4 1.4 0 0 0 .104-.54q0-.278-.101-.516a1.04 1.04 0 0 0-.306-.408 1.5 1.5 0 0 0-.533-.27 2.7 2.7 0 0 0-.764-.096zm3.729 0a.2.2 0 0 0-.2.2v3.6c0 .11.09.2.2.2h1.459q.495 0 .904-.148.407-.15.695-.415.292-.264.45-.63.16-.37.16-.808 0-.435-.16-.803a1.8 1.8 0 0 0-.45-.63 2 2 0 0 0-.695-.418 2.6 2.6 0 0 0-.904-.148zm4.523 0a.2.2 0 0 0-.2.2v3.6c0 .11.09.2.2.2h.498a.2.2 0 0 0 .2-.2v-1.396h1.353a.2.2 0 0 0 .2-.2v-.25a.2.2 0 0 0-.2-.201H13.15v-1.105h1.65a.2.2 0 0 0 .2-.2V13.7a.2.2 0 0 0-.2-.2zM15 8h3.586L15 4.414zm1 4a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H6v1a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V10h-6a1 1 0 0 1-1-1V3H7a1 1 0 0 0-1 1v8z\" clip-rule=\"evenodd\"/></svg>",
|
|
96
95
|
"file-text": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" viewBox=\"0 0 24 24\" focusable=\"false\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"/><path d=\"M14 2v6h6m-4 5H8m8 4H8m2-8H8\"/></svg>",
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"credit-card": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M3 2a3 3 0 0 0-3 3v6a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3zm11 4V5a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v1zM2 8h12v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z\" clip-rule=\"evenodd\"/></svg>",
|
|
71
71
|
"cursor-default": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M14.417 6.59a1 1 0 0 1-.184 1.883L9.863 9.52l-.88 4.665a1 1 0 0 1-1.877.262l-6-12a1 1 0 0 1 1.31-1.356zM4.163 4.092l3.403 6.806.45-2.383a1 1 0 0 1 .75-.786l2.185-.525z\"/></svg>",
|
|
72
72
|
"cursor-text": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M11 1a1 1 0 1 1 0 2 2 2 0 0 0-2 2v2h1a1 1 0 0 1 0 2H9v2.37c0 .9.73 1.63 1.63 1.63a1 1 0 0 1 0 2A3.62 3.62 0 0 1 8 13.87 3.62 3.62 0 0 1 5.37 15a1 1 0 0 1 0-2c.9 0 1.63-.73 1.63-1.63V9H6a1 1 0 0 1 0-2h1V5a2 2 0 0 0-2-2 1 1 0 0 1 0-2 4 4 0 0 1 3 1.355A4 4 0 0 1 11 1\"/></svg>",
|
|
73
|
-
"dgim": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><path fill=\"currentColor\" d=\"M9 10.102c.497.27 1.25.66 1.581 1.01.606.64.787 1.37.77 2.092l-.002.065a2.86 2.86 0 0 1-.885 1.987c-.633.603-1.448.756-2.248.743H6.667c-.696 0-1.028-.156-1.402-.33-.393-.182-.684-.447-.684-.682v-.277c0-.183.29-.486.692-.665.547-.242.76-.444 1.394-.444h.766l1.067.02c.497 0 .5-.415.5-.42zM9 3.56c.57.075 2.82.514 2.985 2.062.147 1.375-.84 1.882-1.418 2.185L7 9.765v3.175c-.674-.317-1.773-.6-2.285-1.236-.47-.583-.73-1.321-.715-2.022l.007-.11c0-.013-.002-1.389 1.343-2.013L9 5.567zM9.093 0c.65 0 1.05.154 1.561.46.11.067.728.431.728.684l-.001.258c0 .241-.433.549-.591.63a3.16 3.16 0 0 1-1.513.369h-.315l-1.612.01c-.165 0-.35.061-.35.23v3.686c-.543-.32-1.46-.708-1.82-1.068a2.72 2.72 0 0 1-.804-2l.008-.324C4.42 1.345 5.77 0 7.328 0zm-.299.8c-.23 0-.415.18-.415.4s.186.4.415.4c.23 0 .416-.179.416-.4a.41.41 0 0 0-.416-.4\"/></svg>",
|
|
74
73
|
"dosage": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><path fill=\"currentColor\" d=\"M6 4v3a1 1 0 0 0 .284.698l1.198 1.229L8.914 7.53 8 6.593V4z\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M6.235 13.959a7.001 7.001 0 1 1 7.724-7.724 3.253 3.253 0 0 1 1.093 5.316l-.002.002-1.154 1.154q-.048.047-.1.088a1 1 0 0 1-.089.1l-2.156 2.157a3.254 3.254 0 0 1-5.316-1.093M2 7a5 5 0 0 1 9.92-.894 3.25 3.25 0 0 0-1.47.842l-.002.002-1.155 1.154a1 1 0 0 0-.088.101 1 1 0 0 0-.1.088L6.95 10.448l-.002.001c-.409.411-.697.92-.842 1.471A5 5 0 0 1 2 7m6 5.747c0-.332.13-.65.365-.886l1.446-1.447 1.775 1.775-1.447 1.446A1.255 1.255 0 0 1 8 12.747\" clip-rule=\"evenodd\"/></svg>",
|
|
75
74
|
"dot": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><circle cx=\"8\" cy=\"8\" r=\"4\"/></svg>",
|
|
76
75
|
"download": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><g stroke=\"currentColor\" stroke-width=\"2\"><path stroke-linejoin=\"round\" d=\"M2 8v3.6c0 .773.56 1.4 1.25 1.4h9.5c.69 0 1.25-.627 1.25-1.4V8\"/><path stroke-linejoin=\"bevel\" d=\"M8 8V1\"/><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M11 6 8 9 5 6\"/></g></svg>",
|
|
@@ -87,10 +86,10 @@
|
|
|
87
86
|
"face-neutral": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><circle cx=\"8\" cy=\"8\" r=\"7\" stroke=\"currentColor\" stroke-width=\"2\"/><g fill=\"currentColor\"><circle cx=\"6\" cy=\"6\" r=\"1\"/><circle cx=\"10\" cy=\"6\" r=\"1\"/><path d=\"M5 9a1 1 0 0 0 0 2zm6 2a1 1 0 1 0 0-2zm-6 0h6V9H5z\"/></g></svg>",
|
|
88
87
|
"face-sad": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><circle cx=\"8\" cy=\"8\" r=\"7\" stroke=\"currentColor\" stroke-width=\"2\"/><path stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"2\" d=\"M5 10.5c.85-.788 1.885-1.25 3-1.25s2.15.462 3 1.25\"/><g fill=\"currentColor\"><circle cx=\"6\" cy=\"6\" r=\"1\"/><circle cx=\"10\" cy=\"6\" r=\"1\"/></g></svg>",
|
|
89
88
|
"facebook": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><path fill=\"#1877f2\" d=\"M16 8a8 8 0 1 0-9.25 7.903v-5.59H4.719V8H6.75V6.238c0-2.006 1.194-3.113 3.022-3.113.875 0 1.79.156 1.79.156V5.25h-1.008c-.994 0-1.304.617-1.304 1.25V8h2.219l-.355 2.313H9.25v5.59A8 8 0 0 0 16 8\"/><path fill=\"#fff\" d=\"M11.114 10.313 11.47 8H9.25V6.5c0-.633.31-1.25 1.304-1.25h1.009V3.281s-.916-.156-1.791-.156c-1.828 0-3.022 1.107-3.022 3.112V8H4.719v2.313H6.75v5.59c.828.13 1.672.13 2.5 0v-5.59z\"/></svg>",
|
|
90
|
-
"fc-circle": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"
|
|
91
|
-
"fc-diamond": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"
|
|
92
|
-
"fc-hexagon": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"
|
|
93
|
-
"fc-triangle": "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"
|
|
89
|
+
"fc-circle": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0\"/></svg>",
|
|
90
|
+
"fc-diamond": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M1.354 8.354a.5.5 0 0 1 0-.708l6.292-6.292a.5.5 0 0 1 .708 0l6.292 6.292a.5.5 0 0 1 0 .708l-6.292 6.292a.5.5 0 0 1-.708 0z\"/></svg>",
|
|
91
|
+
"fc-hexagon": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M14.854 7.749a.5.5 0 0 1 .001.502l-3.211 5.561a.5.5 0 0 1-.433.25H4.789a.5.5 0 0 1-.433-.25L1.145 8.251a.5.5 0 0 1 .001-.502l3.209-5.501A.5.5 0 0 1 4.787 2h6.426a.5.5 0 0 1 .432.248z\"/></svg>",
|
|
92
|
+
"fc-triangle": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M7.568 2.74a.5.5 0 0 1 .864 0l6.129 10.508a.5.5 0 0 1-.431.752H1.871a.5.5 0 0 1-.432-.752z\"/></svg>",
|
|
94
93
|
"figma": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><path fill=\"#1ABCFE\" d=\"M8.003 8a2.667 2.667 0 1 1 5.334 0 2.667 2.667 0 0 1-5.334 0\"/><path fill=\"#0ACF83\" d=\"M2.67 13.333a2.667 2.667 0 0 1 2.667-2.666h2.666v2.666a2.667 2.667 0 1 1-5.333 0\"/><path fill=\"#FF7262\" d=\"M8.003 0v5.333h2.667a2.667 2.667 0 0 0 0-5.333z\"/><path fill=\"#F24E1E\" d=\"M2.67 2.667a2.667 2.667 0 0 0 2.667 2.666h2.666V0H5.337A2.667 2.667 0 0 0 2.67 2.667\"/><path fill=\"#A259FF\" d=\"M2.67 8a2.667 2.667 0 0 0 2.667 2.667h2.666V5.333H5.337A2.667 2.667 0 0 0 2.67 8\"/></svg>",
|
|
95
94
|
"file-pdf": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\" focusable=\"false\"><path d=\"M2.528 9.472q.152 0 .262.035a.5.5 0 0 1 .182.1.4.4 0 0 1 .108.158.5.5 0 0 1 .036.203.52.52 0 0 1-.142.384q-.141.141-.446.141h-.41V9.472zm2.859.014q.22 0 .393.07a.81.81 0 0 1 .483.52q.065.187.065.423 0 .238-.065.426a.82.82 0 0 1-.482.522 1.1 1.1 0 0 1-.394.067h-.554V9.486z\"/><path fill-rule=\"evenodd\" d=\"M9.438.006a1 1 0 0 1 .632.318l3.667 4A1 1 0 0 1 14 5v8.667a2.334 2.334 0 0 1-2.095 2.321l-.238.012H4.333A2.334 2.334 0 0 1 2 13.667V13H1a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h1V2.333A2.333 2.333 0 0 1 4.333 0h5zM4.333 2A.333.333 0 0 0 4 2.333V8h6.015a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H4v.667c0 .184.15.333.333.333h7.334c.184 0 .333-.15.333-.333V6H9a1 1 0 0 1-1-1V2zM1.669 9a.2.2 0 0 0-.2.2v2.6c0 .11.09.2.2.2h.249a.2.2 0 0 0 .2-.2v-.831h.41q.315 0 .547-.073.234-.074.388-.207a.8.8 0 0 0 .228-.316q.076-.184.077-.405 0-.21-.074-.387a.8.8 0 0 0-.222-.306q-.151-.13-.388-.203A1.9 1.9 0 0 0 2.528 9zm2.71 0a.2.2 0 0 0-.198.2v2.6c0 .11.089.2.199.2h1.007q.36 0 .658-.111.296-.113.506-.31.212-.2.326-.475.117-.276.117-.605 0-.326-.117-.602a1.4 1.4 0 0 0-.326-.473 1.5 1.5 0 0 0-.506-.313A1.9 1.9 0 0 0 5.387 9zm3.292 0a.2.2 0 0 0-.2.2v2.6c0 .11.09.2.2.2h.253a.2.2 0 0 0 .2-.2v-.997h.929a.2.2 0 0 0 .2-.2v-.088a.2.2 0 0 0-.2-.2h-.929v-.829h1.145a.2.2 0 0 0 .2-.2V9.2a.2.2 0 0 0-.2-.2zM10 4h.727L10 3.206z\" clip-rule=\"evenodd\"/></svg>",
|
|
96
95
|
"file-text": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" viewBox=\"0 0 16 16\" focusable=\"false\"><path fill=\"currentColor\" d=\"M11 10v2H5v-2zM5 7v2h6V7zm2-3H5v2h2z\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M12 16H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.172a2 2 0 0 1 1.414.586l2.828 2.828A2 2 0 0 1 14 4.828V14a2 2 0 0 1-2 2M9 6h3v8H4V2h4v3a1 1 0 0 0 1 1m1-3.172L11.172 4H10z\" clip-rule=\"evenodd\"/></svg>",
|
|
@@ -159,6 +159,20 @@ type Variables = {
|
|
|
159
159
|
"distanceY": string;
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
|
+
"tooltip": {
|
|
163
|
+
"open": {
|
|
164
|
+
"duration": string;
|
|
165
|
+
"delay": string;
|
|
166
|
+
"timingFunction": string;
|
|
167
|
+
"distanceY": string;
|
|
168
|
+
};
|
|
169
|
+
"close": {
|
|
170
|
+
"delay": string;
|
|
171
|
+
};
|
|
172
|
+
"replace": {
|
|
173
|
+
"window": string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
162
176
|
"navBarTabButton": {
|
|
163
177
|
"open": {
|
|
164
178
|
"duration": string;
|