@amboss/design-system 2.2.4 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/components/EntityTree/EntityTree.d.ts +27 -0
- package/build/cjs/components/EntityTree/EntityTree.js +1 -0
- package/build/cjs/components/EntityTree/tree.d.ts +7 -0
- package/build/cjs/components/EntityTree/tree.js +1 -0
- package/build/cjs/components/EntityTree/tree.test.d.ts +1 -0
- package/build/cjs/components/EntityTree/tree.test.js +1 -0
- package/build/cjs/components/EntityTree/types.d.ts +5 -0
- package/build/cjs/components/EntityTree/types.js +1 -0
- package/build/cjs/components/List/List.d.ts +3 -0
- package/build/cjs/components/List/List.js +1 -0
- package/build/cjs/components/List/ListItem.d.ts +3 -0
- package/build/cjs/components/List/ListItem.js +1 -0
- package/build/cjs/components/List/ListItemExpandButton.d.ts +3 -0
- package/build/cjs/components/List/ListItemExpandButton.js +1 -0
- package/build/cjs/components/List/ListItemLabel.d.ts +3 -0
- package/build/cjs/components/List/ListItemLabel.js +1 -0
- package/build/cjs/components/List/ListItemText.d.ts +3 -0
- package/build/cjs/components/List/ListItemText.js +1 -0
- package/build/cjs/components/List/styled-components.d.ts +18 -0
- package/build/cjs/components/List/styled-components.js +1 -0
- package/build/cjs/components/List/types.d.ts +52 -0
- package/build/cjs/components/List/types.js +1 -0
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +1 -1
- package/build/esm/components/EntityTree/EntityTree.d.ts +27 -0
- package/build/esm/components/EntityTree/EntityTree.js +1 -0
- package/build/esm/components/EntityTree/tree.d.ts +7 -0
- package/build/esm/components/EntityTree/tree.js +1 -0
- package/build/esm/components/EntityTree/tree.test.d.ts +1 -0
- package/build/esm/components/EntityTree/tree.test.js +1 -0
- package/build/esm/components/EntityTree/types.d.ts +5 -0
- package/build/esm/components/EntityTree/types.js +1 -0
- package/build/esm/components/List/List.d.ts +3 -0
- package/build/esm/components/List/List.js +1 -0
- package/build/esm/components/List/ListItem.d.ts +3 -0
- package/build/esm/components/List/ListItem.js +1 -0
- package/build/esm/components/List/ListItemExpandButton.d.ts +3 -0
- package/build/esm/components/List/ListItemExpandButton.js +1 -0
- package/build/esm/components/List/ListItemLabel.d.ts +3 -0
- package/build/esm/components/List/ListItemLabel.js +1 -0
- package/build/esm/components/List/ListItemText.d.ts +3 -0
- package/build/esm/components/List/ListItemText.js +1 -0
- package/build/esm/components/List/styled-components.d.ts +18 -0
- package/build/esm/components/List/styled-components.js +1 -0
- package/build/esm/components/List/types.d.ts +52 -0
- package/build/esm/components/List/types.js +1 -0
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps } from "../List/types";
|
|
3
|
+
import type { NodeID, CheckboxState } from "./types";
|
|
4
|
+
export type TreeNode = {
|
|
5
|
+
id: NodeID;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
children: TreeNode[];
|
|
9
|
+
};
|
|
10
|
+
export type TreeNodeWithUIState = TreeNode & {
|
|
11
|
+
isExpanded: boolean;
|
|
12
|
+
checkedState: CheckboxState;
|
|
13
|
+
};
|
|
14
|
+
type PartialListItemProps = Pick<ListItemProps, "hideBorder" | "size" | "renderRight">;
|
|
15
|
+
export type EntityTreeProps = {
|
|
16
|
+
data: TreeNode[];
|
|
17
|
+
selectedIds?: NodeID[];
|
|
18
|
+
onSelectionChange?: (ids: NodeID[]) => void;
|
|
19
|
+
expandedIds?: NodeID[];
|
|
20
|
+
onToggle?: (ids: NodeID[]) => void;
|
|
21
|
+
filterFn?: (node: TreeNode) => boolean;
|
|
22
|
+
onTreeChange?: (data: TreeNodeWithUIState[]) => void;
|
|
23
|
+
showItemsCount?: boolean;
|
|
24
|
+
"data-e2e-test-id"?: string;
|
|
25
|
+
} & PartialListItemProps;
|
|
26
|
+
export declare const EntityTree: ({ data, selectedIds, onSelectionChange, expandedIds, onToggle, filterFn, onTreeChange, hideBorder, size, showItemsCount, renderRight, "data-e2e-test-id": dataE2eTestId, }: EntityTreeProps) => React.ReactElement;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"EntityTree",{enumerable:!0,get:function(){return EntityTree}});const _react=require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_styledcomponents=require("../List/styled-components"),_ListItem=require("../List/ListItem"),_Text=require("../Typography/Text/Text"),_Checkbox=require("../Form/Checkbox/Checkbox"),_tree=require("./tree"),getLastNodeOfList=({node,data,level,isParentsLastOfLvl})=>{let currentLastNodeOfLvl=node.id===data[data.length-1].id;return 0===level?currentLastNodeOfLvl:isParentsLastOfLvl&¤tLastNodeOfLvl},makeRenderTreeBranches=({nodeChildrenMap,nodeCheckboxState,nodeExpandedState,handleSelectionChange,handleToggle,expandAll,hideBorder,size,showItemsCount,renderRight})=>({data,level,renderFn,isParentsLastOfLvl})=>data.map(node=>{let readOnly=null===nodeCheckboxState,hasChildren=node.children.length>0,isExpanded=!!expandAll||!!nodeExpandedState[node.id],leafItems=(0,_tree.getLeafNodeIds)(nodeChildrenMap,node.id),totalItemsCount=leafItems.length,selectedItemsCount=nodeCheckboxState?leafItems.filter(leafId=>"checked"===nodeCheckboxState[leafId]).length:null,countLabel=nodeCheckboxState?`(${selectedItemsCount}/${totalItemsCount})`:`(${totalItemsCount})`,isLastNodeOfList=getLastNodeOfList({node,data,level,isParentsLastOfLvl});return _react.default.createElement(_ListItem.ListItem,{key:node.id,role:"treeitem",hideBorder:hideBorder||isLastNodeOfList&&!isExpanded,size:size,lSpaceStep:level,"aria-label":node.label,description:node.description,renderLabel:({size:textSize})=>hasChildren?_react.default.createElement(_react.default.Fragment,null,node.label," ",showItemsCount&&_react.default.createElement(_Text.Text,{as:"span",size:textSize,color:"tertiary"},countLabel)):_react.default.createElement(_Text.Text,{size:textSize},node.label),isExpanded:hasChildren?isExpanded:void 0,onExpandClick:e=>{e.stopPropagation(),handleToggle(node.id)},onClick:readOnly?()=>handleToggle(node.id):()=>handleSelectionChange(node.id),renderLeft:readOnly?void 0:()=>_react.default.createElement(_Checkbox.CheckboxRaw,{size:"s",name:node.label,checked:"checked"===nodeCheckboxState[node.id],indeterminate:"indeterminate"===nodeCheckboxState[node.id],onChange:()=>handleSelectionChange(node.id)}),renderRight:renderRight},hasChildren&&_react.default.createElement("ul",null,renderFn({data:node.children,level:level+1,renderFn,isParentsLastOfLvl:isLastNodeOfList})))}),EntityTree=({data,selectedIds,onSelectionChange,expandedIds=[],onToggle,filterFn,onTreeChange,hideBorder=!1,size="m",showItemsCount=!0,renderRight,"data-e2e-test-id":dataE2eTestId})=>{let nodeChildrenMap=Object.assign({},...data.map(tree=>(0,_tree.getNodeChildrenMap)(tree))),nodeCheckboxState=selectedIds?Object.assign({},...data.map(tree=>(0,_tree.getTreeCheckboxState)(nodeChildrenMap,tree.id,selectedIds))):null,nodeExpandedState=expandedIds.reduce((acc,id)=>(acc[id]=!0,acc),{}),dataShown=filterFn?data.map(tree=>(0,_tree.filterTree)(tree,filterFn)).filter(Boolean):data;(0,_react.useEffect)(()=>{onTreeChange&&onTreeChange(dataShown.map(tree=>(0,_tree.mapTree)(tree,node=>({...node,checkedState:!!nodeCheckboxState&&nodeCheckboxState[node.id],isExpanded:!!nodeExpandedState[node.id]}))))},[dataShown,nodeCheckboxState,nodeExpandedState,onTreeChange]);let renderTreeBranches=makeRenderTreeBranches({nodeChildrenMap,nodeCheckboxState,nodeExpandedState,handleSelectionChange:targetId=>{if(onSelectionChange){let updatedSelectedIds=[];if(0===nodeChildrenMap[targetId].length)updatedSelectedIds=selectedIds.includes(targetId)?selectedIds.filter(id=>id!==targetId):selectedIds.concat([targetId]);else{let affectedLeafNodeIds=(0,_tree.getLeafNodeIds)(nodeChildrenMap,targetId);updatedSelectedIds="checked"===nodeCheckboxState[targetId]?selectedIds.filter(id=>!affectedLeafNodeIds.includes(id)):selectedIds.concat(affectedLeafNodeIds)}onSelectionChange(updatedSelectedIds)}},handleToggle:targetId=>{onToggle&&onToggle(expandedIds.includes(targetId)?expandedIds.filter(id=>id!==targetId):expandedIds.concat([targetId]))},expandAll:!!filterFn,hideBorder,size,showItemsCount,renderRight});return _react.default.createElement(_styledcomponents.StyledList,{role:"tree","data-e2e-test-id":dataE2eTestId,"data-ds-id":"EntityTree"},renderTreeBranches({data:dataShown,level:0,renderFn:renderTreeBranches}))};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NodeID, NodeChildrenMap, NodeCheckboxState } from "./types";
|
|
2
|
+
import type { TreeNode } from "./EntityTree";
|
|
3
|
+
export declare function getNodeChildrenMap(tree: Partial<TreeNode>): NodeChildrenMap;
|
|
4
|
+
export declare function getTreeCheckboxState(nodeChildrenMap: NodeChildrenMap, rootID: NodeID, selectedLeafNodeIds: NodeID[]): NodeCheckboxState;
|
|
5
|
+
export declare function getLeafNodeIds(nodeChildrenMap: NodeChildrenMap, rootID: NodeID): NodeID[];
|
|
6
|
+
export declare function filterTree(tree: TreeNode, filterFn: (node: TreeNode) => boolean): TreeNode | null;
|
|
7
|
+
export declare function mapTree(tree: TreeNode, mapFn: (node: TreeNode) => TreeNode): TreeNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function foldTree(f,nodeChildrenMap,rootID){let go=nodeID=>f(nodeID,nodeChildrenMap[nodeID].map(go));return go(rootID)}function getNodeChildrenMap(tree){let nodeChildrenMap={};return!function traverse(node){let{children}=node;nodeChildrenMap[node.id]=children.map(child=>(traverse(child),child.id))}(tree),nodeChildrenMap}function getTreeCheckboxState(nodeChildrenMap,rootID,selectedLeafNodeIds){return foldTree((currId,childrenResults)=>{if(0===nodeChildrenMap[currId].length)return{[currId]:selectedLeafNodeIds.includes(currId)?"checked":"unchecked"};let mergedChildrenResult=childrenResults.reduce((acc,result)=>Object.assign(acc,result)),childrenStates=new Set(nodeChildrenMap[currId].map(childId=>mergedChildrenResult[childId]));return{[currId]:1===childrenStates.size?childrenStates.values().next().value:"indeterminate",...mergedChildrenResult}},nodeChildrenMap,rootID)}function getLeafNodeIds(nodeChildrenMap,rootID){return foldTree((currId,childrenResults)=>0===nodeChildrenMap[currId].length?[currId]:childrenResults.flat(),nodeChildrenMap,rootID)}Object.defineProperty(exports,"__esModule",{value:!0}),function(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:all[name]})}(exports,{filterTree:function(){return function filterTree(tree,filterFn){let filteredChildren=tree.children.map(child=>filterTree(child,filterFn)).filter(child=>child);return 0!==filteredChildren.length||filterFn(tree)?{...tree,children:filteredChildren}:null}},getLeafNodeIds:function(){return getLeafNodeIds},getNodeChildrenMap:function(){return getNodeChildrenMap},getTreeCheckboxState:function(){return getTreeCheckboxState},mapTree:function(){return function mapTree(tree,mapFn){return{...mapFn(tree),children:tree.children.map(child=>mapTree(child,mapFn))}}}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const _tree=require("./tree"),treeListData=[{id:"a",label:"a",children:[{id:"a.1",label:"a.1",children:[{id:"a.1.1",label:"a.1.1",children:[]},{id:"a.1.2",label:"a.1.2",children:[]}]}]},{id:"b",label:"b",children:[{id:"b.1",label:"b.1",children:[{id:"b.1.1",label:"b.1.1",children:[]}]}]}],nodeChildrenMap={root:["a","b"],a:["a.1"],"a.1":["a.1.1","a.1.2"],"a.1.1":[],"a.1.2":[],b:["b.1"],"b.1":["b.1.1"],"b.1.1":[]};test("getNodeChildrenMap should return a relationship mapping between parent and children nodes",()=>{let nodeChildrenMap1=(0,_tree.getNodeChildrenMap)(treeListData[0]),nodeChildrenMap2=(0,_tree.getNodeChildrenMap)(treeListData[1]);expect(nodeChildrenMap1).toEqual({a:["a.1"],"a.1":["a.1.1","a.1.2"],"a.1.1":[],"a.1.2":[]}),expect(nodeChildrenMap2).toEqual({b:["b.1"],"b.1":["b.1.1"],"b.1.1":[]})}),test("getLeafNodeIds should return all the leaf nodes of any given node",()=>{expect((0,_tree.getLeafNodeIds)(nodeChildrenMap,"root")).toEqual(["a.1.1","a.1.2","b.1.1"]),expect((0,_tree.getLeafNodeIds)(nodeChildrenMap,"a")).toEqual(["a.1.1","a.1.2"]),expect((0,_tree.getLeafNodeIds)(nodeChildrenMap,"b.1")).toEqual(["b.1.1"]),expect((0,_tree.getLeafNodeIds)(nodeChildrenMap,"b.1.1")).toEqual(["b.1.1"])}),test("getTreeCheckboxState should return the checkbox state of each node in the tree",()=>{let nodeCheckboxState=(0,_tree.getTreeCheckboxState)(nodeChildrenMap,"root",["a.1.1","b.1.1"]);expect(nodeCheckboxState).toEqual({root:"indeterminate",a:"indeterminate","a.1":"indeterminate","a.1.1":"checked","a.1.2":"unchecked",b:"checked","b.1":"checked","b.1.1":"checked"})}),test("filterTree should return a new tree with the nodes that satisfy the filter function",()=>{let filteredTree1=(0,_tree.filterTree)(treeListData[0],node=>"a.1"===node.id);expect(filteredTree1).toEqual({id:"a",label:"a",children:[{id:"a.1",label:"a.1",children:[]}]});let filteredTree2=(0,_tree.filterTree)(treeListData[0],node=>"non-existent"===node.id);expect(filteredTree2).toEqual(null)}),test("mapTree should return a new tree with all its nodes being mapped",()=>{let mappedTree=(0,_tree.mapTree)(treeListData[0],node=>({...node,label:node.label.toUpperCase()}));expect(mappedTree).toEqual({id:"a",label:"A",children:[{id:"a.1",label:"A.1",children:[{id:"a.1.1",label:"A.1.1",children:[]},{id:"a.1.2",label:"A.1.2",children:[]}]}]})});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type NodeID = string;
|
|
2
|
+
export type NodeChildrenMap = Record<NodeID, NodeID[]>;
|
|
3
|
+
export type CheckboxState = "checked" | "unchecked" | "indeterminate";
|
|
4
|
+
export type NodeCheckboxState = Record<NodeID, CheckboxState>;
|
|
5
|
+
export type NodeExpandedState = Record<NodeID, boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"List",{enumerable:!0,get:function(){return List}});const _react=require("@swc/helpers/_/_interop_require_default")._(require("react")),_Container=require("../Container/Container"),_styledcomponents=require("./styled-components");function List({children,role="list","data-e2e-test-id":dataE2eTestId}){return _react.default.createElement(_Container.Container,null,_react.default.createElement(_styledcomponents.StyledList,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":"List",role:role},children))}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps } from "./types";
|
|
3
|
+
export declare function ListItem({ description, size, role, renderLeft, renderRight, isExpanded, children, onClick, onExpandClick, isClickable, lSpaceStep, renderLabel, hideBorder, "aria-label": ariaLabel, }: ListItemProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ListItem",{enumerable:!0,get:function(){return ListItem}});const _react=require("@swc/helpers/_/_interop_require_default")._(require("react")),_ListItemLabel=require("./ListItemLabel"),_styledcomponents=require("./styled-components");function ListItem({description,size="m",role,renderLeft,renderRight,isExpanded,children,onClick,onExpandClick,isClickable=!0,lSpaceStep,renderLabel,hideBorder,"aria-label":ariaLabel}){return _react.default.createElement(_styledcomponents.StyledListItem,{role:role,"aria-expanded":isExpanded,"aria-label":ariaLabel},_react.default.createElement(_ListItemLabel.ListItemLabel,{lSpaceStep:lSpaceStep,hideBorder:hideBorder,isExpanded:isExpanded,size:size,description:description,onExpandClick:onExpandClick,onClick:onClick,isClickable:isClickable,renderLeft:renderLeft,renderRight:renderRight,renderLabel:renderLabel}),isExpanded&&children)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ListItemExpandButton",{enumerable:!0,get:function(){return ListItemExpandButton}});const _react=require("@swc/helpers/_/_interop_require_default")._(require("react")),_PictogramButton=require("../PictogramButton/PictogramButton"),_Box=require("../Box/Box");function ListItemExpandButton({onClick,isExpanded}){return _react.default.createElement(_Box.Box,{vSpace:"zero",lSpace:"m",rSpace:"m"},_react.default.createElement(_PictogramButton.PictogramButton,{onClick:onClick,icon:isExpanded?"chevron-down":"chevron-right"}))}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps } from "./types";
|
|
3
|
+
export declare function ListItemLabel({ description, size, renderLeft, renderRight, renderLabel, isExpanded, onClick, onExpandClick, isClickable, lSpaceStep, hideBorder, }: Partial<ListItemProps>): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ListItemLabel",{enumerable:!0,get:function(){return ListItemLabel}});const _react=require("@swc/helpers/_/_interop_require_wildcard")._(require("react")),_ListItemText=require("./ListItemText"),_ListItemExpandButton=require("./ListItemExpandButton"),_Inline=require("../Inline/Inline"),_styledcomponents=require("./styled-components"),useListItemLabel=({size,isExpanded,lSpaceStep})=>{let hasExpandableIcon=void 0!==isExpanded,isTreeNode=void 0!==lSpaceStep;return{isDeepestTreeNode:!hasExpandableIcon&&isTreeNode,isTreeNode,textSize:"xs"===size?"s":"m",hasExpandableIcon}},StopPropogationWrapper=({children})=>{let handleClick=(0,_react.useCallback)(e=>{e.stopPropagation()},[]);return _react.default.createElement("div",{role:"presentation",onClick:handleClick},children)};function ListItemLabel({description,size="m",renderLeft,renderRight,renderLabel,isExpanded,onClick,onExpandClick,isClickable=!0,lSpaceStep,hideBorder}){let{textSize,hasExpandableIcon,isTreeNode,isDeepestTreeNode}=useListItemLabel({size,isExpanded,lSpaceStep});return _react.default.createElement(_styledcomponents.StyledListItemLabel,{size:size,onClick:onClick,isClickable:isClickable,isDeepestTreeNode:isDeepestTreeNode,lSpaceStep:lSpaceStep},hasExpandableIcon&&_react.default.createElement(_ListItemExpandButton.ListItemExpandButton,{isExpanded:isExpanded,onClick:onExpandClick}),_react.default.createElement(_styledcomponents.StyledListItemWrapper,{size:size,hasLSpace:!isTreeNode,hideBorder:hideBorder},_react.default.createElement(_Inline.Inline,{noWrap:!0,alignItems:"spaceBetween"},_react.default.createElement(_Inline.Inline,{noWrap:!0,alignItems:"spaceBetween",space:"m"},renderLeft&&renderLeft({size:textSize}),_react.default.createElement(_ListItemText.ListItemText,{size:textSize,description:description},renderLabel({size:textSize}))),renderRight&&_react.default.createElement(StopPropogationWrapper,null,renderRight({size:textSize})))))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"ListItemText",{enumerable:!0,get:function(){return ListItemText}});const _react=require("@swc/helpers/_/_interop_require_default")._(require("react")),_Text=require("../Typography/Text/Text"),_Stack=require("../Stack/Stack");function ListItemText({children,size,description}){return _react.default.createElement(_Stack.Stack,{space:"xxs"},_react.default.createElement(_Text.Text,{size:size},children),description&&_react.default.createElement(_Text.Text,{color:"tertiary",size:"s"},description))}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ListItemProps, ListItemWrapperProps, UseListItemLabelReturn } from "./types";
|
|
3
|
+
export declare const StyledList: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: import("react").ElementType<any>;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
7
|
+
export declare const StyledListItemWrapper: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: import("react").ElementType<any>;
|
|
10
|
+
} & ListItemWrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
export declare const StyledListItem: import("@emotion/styled").StyledComponent<{
|
|
12
|
+
theme?: import("@emotion/react").Theme;
|
|
13
|
+
as?: import("react").ElementType<any>;
|
|
14
|
+
} & Partial<ListItemProps>, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
15
|
+
export declare const StyledListItemLabel: import("@emotion/styled").StyledComponent<{
|
|
16
|
+
theme?: import("@emotion/react").Theme;
|
|
17
|
+
as?: import("react").ElementType<any>;
|
|
18
|
+
} & Partial<ListItemProps> & Partial<UseListItemLabelReturn>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:all[name]})}(exports,{StyledList:function(){return StyledList},StyledListItem:function(){return StyledListItem},StyledListItemLabel:function(){return StyledListItemLabel},StyledListItemWrapper:function(){return StyledListItemWrapper}});const _styled=require("@swc/helpers/_/_interop_require_default")._(require("@emotion/styled")),_mediaQueries=require("../../shared/mediaQueries"),StyledList=(0,_styled.default)("ul",{target:"ecuw86y0",label:"StyledList"})("/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB0eXBlIHtcbiAgTGlzdEl0ZW1Qcm9wcyxcbiAgTGlzdEl0ZW1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Y2luZy54c31gLFxuICAgICAgICBzOiBgJHt0aGVtZS52YXJpYWJsZXMuc2l6ZS5zcGFjaW5nLnN9YCxcbiAgICAgICAgbTogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy5tfWAsXG4gICAgICAgIGw6IGAke3RoZW1lLnZhcmlhYmxlcy5zaXplLnNwYWNpbmcubH1gLFxuICAgICAgfSBhcyBhbnksXG4gICAgXSxcbiAgfSksXG5cbiAgdHJhbnNpdGlvbjogXCJiYWNrZ3JvdW5kLWNvbG9yIDAuMXMgZWFzZS1vdXRcIixcbiAgLi4uKGlzQ2xpY2thYmxlICYmIHtcbiAgICBjdXJzb3I6IFwicG9pbnRlclwiLFxuICAgIFwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVEwQiJ9 */"),StyledListItemWrapper=(0,_styled.default)("div",{target:"ecuw86y1",label:"StyledListItemWrapper"})(({theme,size,hasLSpace,hideBorder})=>({borderBottom:`1px solid ${theme.values.color.border.secondary.default}`,...hideBorder&&{borderBottomColor:"transparent"},width:"100%",...hasLSpace&&{paddingLeft:theme.variables.size.spacing.l},paddingRight:theme.variables.size.spacing.l,...(0,_mediaQueries.mq)({paddingBottom:[size,{xs:`calc(${theme.variables.size.spacing.xs} - 1px)`,s:`calc(${theme.variables.size.spacing.s} - 1px)`,m:`calc(${theme.variables.size.spacing.m} - 1px)`,l:`calc(${theme.variables.size.spacing.l} - 1px)`}]})}),"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbm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ZXN0VHJlZU5vZGUgPyBcIjU2cHhcIiA6IFwiMHB4XCJcbiAgICB9KWAsXG4gIH0pLFxuXG4gIC4uLm1xKHtcbiAgICBwYWRkaW5nVG9wOiBbXG4gICAgICBzaXplLFxuICAgICAge1xuICAgICAgICB4czogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy54c31gLFxuICAgICAgICBzOiBgJHt0aGVtZS52YXJpYWJsZXMuc2l6ZS5zcGFjaW5nLnN9YCxcbiAgICAgICAgbTogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy5tfWAsXG4gICAgICAgIGw6IGAke3RoZW1lLnZhcmlhYmxlcy5zaXplLnNwYWNpbmcubH1gLFxuICAgICAgfSBhcyBhbnksXG4gICAgXSxcbiAgfSksXG5cbiAgdHJhbnNpdGlvbjogXCJiYWNrZ3JvdW5kLWNvbG9yIDAuMXMgZWFzZS1vdXRcIixcbiAgLi4uKGlzQ2xpY2thYmxlICYmIHtcbiAgICBjdXJzb3I6IFwicG9pbnRlclwiLFxuICAgIFwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVVxQyJ9 */"),StyledListItem=(0,_styled.default)("li",{target:"ecuw86y2",label:"StyledListItem"})(()=>({listStyleType:"none"}),"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1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aW5nVG9wOiBbXG4gICAgICBzaXplLFxuICAgICAge1xuICAgICAgICB4czogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy54c31gLFxuICAgICAgICBzOiBgJHt0aGVtZS52YXJpYWJsZXMuc2l6ZS5zcGFjaW5nLnN9YCxcbiAgICAgICAgbTogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy5tfWAsXG4gICAgICAgIGw6IGAke3RoZW1lLnZhcmlhYmxlcy5zaXplLnNwYWNpbmcubH1gLFxuICAgICAgfSBhcyBhbnksXG4gICAgXSxcbiAgfSksXG5cbiAgdHJhbnNpdGlvbjogXCJiYWNrZ3JvdW5kLWNvbG9yIDAuMXMgZWFzZS1vdXRcIixcbiAgLi4uKGlzQ2xpY2thYmxlICYmIHtcbiAgICBjdXJzb3I6IFwicG9pbnRlclwiLFxuICAgIFwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1DOEIifQ== */"),StyledListItemLabel=(0,_styled.default)("div",{target:"ecuw86y3",label:"StyledListItemLabel"})(({theme,size,isClickable,lSpaceStep,isDeepestTreeNode})=>({display:"flex",flexGrow:1,width:"100%",pointerEvents:isClickable?"auto":"none",...lSpaceStep&&{paddingLeft:`calc(${theme.variables.size.spacing.xl} * ${lSpaceStep} + ${isDeepestTreeNode?"56px":"0px"})`},...(0,_mediaQueries.mq)({paddingTop:[size,{xs:`${theme.variables.size.spacing.xs}`,s:`${theme.variables.size.spacing.s}`,m:`${theme.variables.size.spacing.m}`,l:`${theme.variables.size.spacing.l}`}]}),transition:"background-color 0.1s ease-out",...isClickable&&{cursor:"pointer","&:hover":{backgroundColor:theme.values.color.background.transparent.hover}}}),"/*# sourceMappingUR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VwICYmIHtcbiAgICBwYWRkaW5nTGVmdDogYGNhbGMoJHt0aGVtZS52YXJpYWJsZXMuc2l6ZS5zcGFjaW5nLnhsfSAqICR7bFNwYWNlU3RlcH0gKyAke1xuICAgICAgaXNEZWVwZXN0VHJlZU5vZGUgPyBcIjU2cHhcIiA6IFwiMHB4XCJcbiAgICB9KWAsXG4gIH0pLFxuXG4gIC4uLm1xKHtcbiAgICBwYWRkaW5nVG9wOiBbXG4gICAgICBzaXplLFxuICAgICAge1xuICAgICAgICB4czogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy54c31gLFxuICAgICAgICBzOiBgJHt0aGVtZS52YXJpYWJsZXMuc2l6ZS5zcGFjaW5nLnN9YCxcbiAgICAgICAgbTogYCR7dGhlbWUudmFyaWFibGVzLnNpemUuc3BhY2luZy5tfWAsXG4gICAgICAgIGw6IGAke3RoZW1lLnZhcmlhYmxlcy5zaXplLnNwYWNpbmcubH1gLFxuICAgICAgfSBhcyBhbnksXG4gICAgXSxcbiAgfSksXG5cbiAgdHJhbnNpdGlvbjogXCJiYWNrZ3JvdW5kLWNvbG9yIDAuMXMgZWFzZS1vdXRcIixcbiAgLi4uKGlzQ2xpY2thYmxlICYmIHtcbiAgICBjdXJzb3I6IFwicG9pbnRlclwiLFxuICAgIFwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVDbUMifQ== */");
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MQ, TextSize } from "../../types";
|
|
3
|
+
export type ListSizes = "xs" | "s" | "m" | "l" | MQ<"xs" | "s" | "m" | "l">;
|
|
4
|
+
export type ListProps = {
|
|
5
|
+
role?: "list" | "tree" | "group";
|
|
6
|
+
"data-e2e-test-id"?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type ListItemWrapperProps = {
|
|
10
|
+
size: ListSizes;
|
|
11
|
+
hasLSpace: boolean;
|
|
12
|
+
hideBorder: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type ListItemProps = {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
role?: "listitem" | "treeitem";
|
|
17
|
+
isClickable?: boolean;
|
|
18
|
+
size?: ListSizes;
|
|
19
|
+
lSpaceStep?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
20
|
+
description?: string;
|
|
21
|
+
renderLabel: (props: {
|
|
22
|
+
size: TextSize;
|
|
23
|
+
}) => React.ReactElement;
|
|
24
|
+
renderLeft?: (props: {
|
|
25
|
+
size: ListSizes;
|
|
26
|
+
}) => React.ReactElement;
|
|
27
|
+
renderRight?: (props: {
|
|
28
|
+
size: ListSizes;
|
|
29
|
+
}) => React.ReactElement;
|
|
30
|
+
isExpanded?: boolean;
|
|
31
|
+
hideBorder?: boolean;
|
|
32
|
+
onExpandClick?: (e: React.MouseEvent) => void;
|
|
33
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
34
|
+
"aria-label": string;
|
|
35
|
+
};
|
|
36
|
+
export type ListItemLabelProps = {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
size: TextSize;
|
|
39
|
+
description?: string;
|
|
40
|
+
};
|
|
41
|
+
export type UseListItemLabelProps = {
|
|
42
|
+
size: ListItemProps["size"];
|
|
43
|
+
isExpanded?: boolean;
|
|
44
|
+
isTreeNode?: boolean;
|
|
45
|
+
lSpaceStep?: number;
|
|
46
|
+
};
|
|
47
|
+
export type UseListItemLabelReturn = {
|
|
48
|
+
textSize: "s" | "m";
|
|
49
|
+
hasExpandableIcon: boolean;
|
|
50
|
+
isTreeNode: boolean;
|
|
51
|
+
isDeepestTreeNode: boolean;
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
package/build/cjs/index.d.ts
CHANGED
|
@@ -64,3 +64,4 @@ export * from "./components/Form/MaskedInput/MaskedInput";
|
|
|
64
64
|
export * from "./components/Utilities/Expandable/Expandable";
|
|
65
65
|
export * from "./components/QBankRichText/QBankRichText";
|
|
66
66
|
export * from "./components/Tutorialtip/Tutorialtip";
|
|
67
|
+
export * from "./components/EntityTree/EntityTree";
|
package/build/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:all[name]})}(exports,{CacheProvider:function(){return _react.CacheProvider},ThemeProvider:function(){return _react.ThemeProvider},createCache:function(){return _cache.default},dark:function(){return dark},light:function(){return light}});const _export_star=require("@swc/helpers/_/_export_star"),_interop_require_default=require("@swc/helpers/_/_interop_require_default"),_visualConfig=require("./web-tokens/visualConfig"),_react=require("@emotion/react"),_cache=_interop_require_default._(require("@emotion/cache"));_export_star._(require("./components/Card/Card"),exports),_export_star._(require("./components/Card/CardBox"),exports),_export_star._(require("./components/Box/Box"),exports),_export_star._(require("./components/Inline/Inline"),exports),_export_star._(require("./components/Stack/Stack"),exports),_export_star._(require("./components/Typography/Header/Header"),exports),_export_star._(require("./components/Typography/Text/Text"),exports),_export_star._(require("./components/Typography/TextClamped/TextClamped"),exports),_export_star._(require("./components/Typography/StyledText/StyledText"),exports),_export_star._(require("./components/Link/Link"),exports),_export_star._(require("./components/Icon/Icon"),exports),_export_star._(require("./components/Button/Button"),exports),_export_star._(require("./components/BulkActionsToolbar/BulkActionsToolbar"),exports),_export_star._(require("./components/Divider/Divider"),exports),_export_star._(require("./components/Column/Columns"),exports),_export_star._(require("./components/Form/SearchInput/SearchInput"),exports),_export_star._(require("./components/Tabs/Tabs"),exports),_export_star._(require("./components/Badge/Badge"),exports),_export_star._(require("./components/SearchResult/SearchResult"),exports),_export_star._(require("./components/Form/ToggleButton/ToggleButton"),exports),_export_star._(require("./components/DropdownMenu/DropdownMenu"),exports),_export_star._(require("./components/Form/FormFieldGroup/FormFieldGroup"),exports),_export_star._(require("./components/Form/Input"),exports),_export_star._(require("./components/Form/Checkbox/Checkbox"),exports),_export_star._(require("./components/Form/Toggle/Toggle"),exports),_export_star._(require("./components/Form/Radio/Radio"),exports),_export_star._(require("./components/Form/RadioButton/RadioButton"),exports),_export_star._(require("./components/Form/RangeInput/RangeInput"),exports),_export_star._(require("./components/Form/Textarea/Textarea"),exports),_export_star._(require("./components/Form/Select/Select"),exports),_export_star._(require("./components/SubThemeProvider/SubThemeProvider"),exports),_export_star._(require("./components/PictogramButton/PictogramButton"),exports),_export_star._(require("./components/MediaViewerBar/MediaViewerBar"),exports),_export_star._(require("./components/SegmentedProgressBar/SegmentedProgressBar"),exports),_export_star._(require("./components/ProgressBar/ProgressBar"),exports),_export_star._(require("./components/Container/Container"),exports),_export_star._(require("./components/Form/PasswordInput"),exports),_export_star._(require("./components/RoundButton/RoundButton"),exports),_export_star._(require("./components/Notification/Notification"),exports),_export_star._(require("./components/Logo/Logo"),exports),_export_star._(require("./components/MediaItem/MediaItem"),exports),_export_star._(require("./components/Callout/Callout"),exports),_export_star._(require("./components/Patterns/Modal/Modal"),exports),_export_star._(require("./components/Patterns/ButtonGroup/ButtonGroup"),exports),_export_star._(require("./components/Collapsible/Collapsible"),exports),_export_star._(require("./components/LoadingSpinner/LoadingSpinner"),exports),_export_star._(require("./components/Pagination/Pagination"),exports),_export_star._(require("./components/DataTable"),exports),_export_star._(require("./components/Form/SegmentedControl/SegmentedControl"),exports),_export_star._(require("./components/Tooltip/Tooltip"),exports),_export_star._(require("./components/Tag/Tag"),exports),_export_star._(require("./components/TagGroup/TagGroup"),exports),_export_star._(require("./components/Toggletip/Toggletip"),exports),_export_star._(require("./components/Popover/Popover"),exports),_export_star._(require("./components/UserHighlightTooltip/UserHighlightTooltip"),exports),_export_star._(require("./components/Sheet/Sheet"),exports),_export_star._(require("./components/Image/Image"),exports),_export_star._(require("./components/Form/MaskedInput/MaskedInput"),exports),_export_star._(require("./components/Utilities/Expandable/Expandable"),exports),_export_star._(require("./components/QBankRichText/QBankRichText"),exports),_export_star._(require("./components/Tutorialtip/Tutorialtip"),exports);const{dark,light}=_visualConfig.ambossVisualConfiguration;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),function(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:!0,get:all[name]})}(exports,{CacheProvider:function(){return _react.CacheProvider},ThemeProvider:function(){return _react.ThemeProvider},createCache:function(){return _cache.default},dark:function(){return dark},light:function(){return light}});const _export_star=require("@swc/helpers/_/_export_star"),_interop_require_default=require("@swc/helpers/_/_interop_require_default"),_visualConfig=require("./web-tokens/visualConfig"),_react=require("@emotion/react"),_cache=_interop_require_default._(require("@emotion/cache"));_export_star._(require("./components/Card/Card"),exports),_export_star._(require("./components/Card/CardBox"),exports),_export_star._(require("./components/Box/Box"),exports),_export_star._(require("./components/Inline/Inline"),exports),_export_star._(require("./components/Stack/Stack"),exports),_export_star._(require("./components/Typography/Header/Header"),exports),_export_star._(require("./components/Typography/Text/Text"),exports),_export_star._(require("./components/Typography/TextClamped/TextClamped"),exports),_export_star._(require("./components/Typography/StyledText/StyledText"),exports),_export_star._(require("./components/Link/Link"),exports),_export_star._(require("./components/Icon/Icon"),exports),_export_star._(require("./components/Button/Button"),exports),_export_star._(require("./components/BulkActionsToolbar/BulkActionsToolbar"),exports),_export_star._(require("./components/Divider/Divider"),exports),_export_star._(require("./components/Column/Columns"),exports),_export_star._(require("./components/Form/SearchInput/SearchInput"),exports),_export_star._(require("./components/Tabs/Tabs"),exports),_export_star._(require("./components/Badge/Badge"),exports),_export_star._(require("./components/SearchResult/SearchResult"),exports),_export_star._(require("./components/Form/ToggleButton/ToggleButton"),exports),_export_star._(require("./components/DropdownMenu/DropdownMenu"),exports),_export_star._(require("./components/Form/FormFieldGroup/FormFieldGroup"),exports),_export_star._(require("./components/Form/Input"),exports),_export_star._(require("./components/Form/Checkbox/Checkbox"),exports),_export_star._(require("./components/Form/Toggle/Toggle"),exports),_export_star._(require("./components/Form/Radio/Radio"),exports),_export_star._(require("./components/Form/RadioButton/RadioButton"),exports),_export_star._(require("./components/Form/RangeInput/RangeInput"),exports),_export_star._(require("./components/Form/Textarea/Textarea"),exports),_export_star._(require("./components/Form/Select/Select"),exports),_export_star._(require("./components/SubThemeProvider/SubThemeProvider"),exports),_export_star._(require("./components/PictogramButton/PictogramButton"),exports),_export_star._(require("./components/MediaViewerBar/MediaViewerBar"),exports),_export_star._(require("./components/SegmentedProgressBar/SegmentedProgressBar"),exports),_export_star._(require("./components/ProgressBar/ProgressBar"),exports),_export_star._(require("./components/Container/Container"),exports),_export_star._(require("./components/Form/PasswordInput"),exports),_export_star._(require("./components/RoundButton/RoundButton"),exports),_export_star._(require("./components/Notification/Notification"),exports),_export_star._(require("./components/Logo/Logo"),exports),_export_star._(require("./components/MediaItem/MediaItem"),exports),_export_star._(require("./components/Callout/Callout"),exports),_export_star._(require("./components/Patterns/Modal/Modal"),exports),_export_star._(require("./components/Patterns/ButtonGroup/ButtonGroup"),exports),_export_star._(require("./components/Collapsible/Collapsible"),exports),_export_star._(require("./components/LoadingSpinner/LoadingSpinner"),exports),_export_star._(require("./components/Pagination/Pagination"),exports),_export_star._(require("./components/DataTable"),exports),_export_star._(require("./components/Form/SegmentedControl/SegmentedControl"),exports),_export_star._(require("./components/Tooltip/Tooltip"),exports),_export_star._(require("./components/Tag/Tag"),exports),_export_star._(require("./components/TagGroup/TagGroup"),exports),_export_star._(require("./components/Toggletip/Toggletip"),exports),_export_star._(require("./components/Popover/Popover"),exports),_export_star._(require("./components/UserHighlightTooltip/UserHighlightTooltip"),exports),_export_star._(require("./components/Sheet/Sheet"),exports),_export_star._(require("./components/Image/Image"),exports),_export_star._(require("./components/Form/MaskedInput/MaskedInput"),exports),_export_star._(require("./components/Utilities/Expandable/Expandable"),exports),_export_star._(require("./components/QBankRichText/QBankRichText"),exports),_export_star._(require("./components/Tutorialtip/Tutorialtip"),exports),_export_star._(require("./components/EntityTree/EntityTree"),exports);const{dark,light}=_visualConfig.ambossVisualConfiguration;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps } from "../List/types";
|
|
3
|
+
import type { NodeID, CheckboxState } from "./types";
|
|
4
|
+
export type TreeNode = {
|
|
5
|
+
id: NodeID;
|
|
6
|
+
label: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
children: TreeNode[];
|
|
9
|
+
};
|
|
10
|
+
export type TreeNodeWithUIState = TreeNode & {
|
|
11
|
+
isExpanded: boolean;
|
|
12
|
+
checkedState: CheckboxState;
|
|
13
|
+
};
|
|
14
|
+
type PartialListItemProps = Pick<ListItemProps, "hideBorder" | "size" | "renderRight">;
|
|
15
|
+
export type EntityTreeProps = {
|
|
16
|
+
data: TreeNode[];
|
|
17
|
+
selectedIds?: NodeID[];
|
|
18
|
+
onSelectionChange?: (ids: NodeID[]) => void;
|
|
19
|
+
expandedIds?: NodeID[];
|
|
20
|
+
onToggle?: (ids: NodeID[]) => void;
|
|
21
|
+
filterFn?: (node: TreeNode) => boolean;
|
|
22
|
+
onTreeChange?: (data: TreeNodeWithUIState[]) => void;
|
|
23
|
+
showItemsCount?: boolean;
|
|
24
|
+
"data-e2e-test-id"?: string;
|
|
25
|
+
} & PartialListItemProps;
|
|
26
|
+
export declare const EntityTree: ({ data, selectedIds, onSelectionChange, expandedIds, onToggle, filterFn, onTreeChange, hideBorder, size, showItemsCount, renderRight, "data-e2e-test-id": dataE2eTestId, }: EntityTreeProps) => React.ReactElement;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React,{useEffect}from"react";import{StyledList}from"../List/styled-components";import{ListItem}from"../List/ListItem";import{Text}from"../Typography/Text/Text";import{CheckboxRaw}from"../Form/Checkbox/Checkbox";import{getNodeChildrenMap,getTreeCheckboxState,getLeafNodeIds,filterTree,mapTree}from"./tree";let getLastNodeOfList=({node,data,level,isParentsLastOfLvl})=>{let currentLastNodeOfLvl=node.id===data[data.length-1].id;return 0===level?currentLastNodeOfLvl:isParentsLastOfLvl&¤tLastNodeOfLvl},makeRenderTreeBranches=({nodeChildrenMap,nodeCheckboxState,nodeExpandedState,handleSelectionChange,handleToggle,expandAll,hideBorder,size,showItemsCount,renderRight})=>({data,level,renderFn,isParentsLastOfLvl})=>data.map(node=>{let readOnly=null===nodeCheckboxState,hasChildren=node.children.length>0,isExpanded=!!expandAll||!!nodeExpandedState[node.id],leafItems=getLeafNodeIds(nodeChildrenMap,node.id),totalItemsCount=leafItems.length,selectedItemsCount=nodeCheckboxState?leafItems.filter(leafId=>"checked"===nodeCheckboxState[leafId]).length:null,countLabel=nodeCheckboxState?`(${selectedItemsCount}/${totalItemsCount})`:`(${totalItemsCount})`,isLastNodeOfList=getLastNodeOfList({node,data,level,isParentsLastOfLvl});return React.createElement(ListItem,{key:node.id,role:"treeitem",hideBorder:hideBorder||isLastNodeOfList&&!isExpanded,size:size,lSpaceStep:level,"aria-label":node.label,description:node.description,renderLabel:({size:textSize})=>hasChildren?React.createElement(React.Fragment,null,node.label," ",showItemsCount&&React.createElement(Text,{as:"span",size:textSize,color:"tertiary"},countLabel)):React.createElement(Text,{size:textSize},node.label),isExpanded:hasChildren?isExpanded:void 0,onExpandClick:e=>{e.stopPropagation(),handleToggle(node.id)},onClick:readOnly?()=>handleToggle(node.id):()=>handleSelectionChange(node.id),renderLeft:readOnly?void 0:()=>React.createElement(CheckboxRaw,{size:"s",name:node.label,checked:"checked"===nodeCheckboxState[node.id],indeterminate:"indeterminate"===nodeCheckboxState[node.id],onChange:()=>handleSelectionChange(node.id)}),renderRight:renderRight},hasChildren&&React.createElement("ul",null,renderFn({data:node.children,level:level+1,renderFn,isParentsLastOfLvl:isLastNodeOfList})))});export const EntityTree=({data,selectedIds,onSelectionChange,expandedIds=[],onToggle,filterFn,onTreeChange,hideBorder=!1,size="m",showItemsCount=!0,renderRight,"data-e2e-test-id":dataE2eTestId})=>{let nodeChildrenMap=Object.assign({},...data.map(tree=>getNodeChildrenMap(tree))),nodeCheckboxState=selectedIds?Object.assign({},...data.map(tree=>getTreeCheckboxState(nodeChildrenMap,tree.id,selectedIds))):null,nodeExpandedState=expandedIds.reduce((acc,id)=>(acc[id]=!0,acc),{}),dataShown=filterFn?data.map(tree=>filterTree(tree,filterFn)).filter(Boolean):data;useEffect(()=>{onTreeChange&&onTreeChange(dataShown.map(tree=>mapTree(tree,node=>({...node,checkedState:!!nodeCheckboxState&&nodeCheckboxState[node.id],isExpanded:!!nodeExpandedState[node.id]}))))},[dataShown,nodeCheckboxState,nodeExpandedState,onTreeChange]);let renderTreeBranches=makeRenderTreeBranches({nodeChildrenMap,nodeCheckboxState,nodeExpandedState,handleSelectionChange:targetId=>{if(onSelectionChange){let updatedSelectedIds=[];if(0===nodeChildrenMap[targetId].length)updatedSelectedIds=selectedIds.includes(targetId)?selectedIds.filter(id=>id!==targetId):selectedIds.concat([targetId]);else{let affectedLeafNodeIds=getLeafNodeIds(nodeChildrenMap,targetId);updatedSelectedIds="checked"===nodeCheckboxState[targetId]?selectedIds.filter(id=>!affectedLeafNodeIds.includes(id)):selectedIds.concat(affectedLeafNodeIds)}onSelectionChange(updatedSelectedIds)}},handleToggle:targetId=>{onToggle&&onToggle(expandedIds.includes(targetId)?expandedIds.filter(id=>id!==targetId):expandedIds.concat([targetId]))},expandAll:!!filterFn,hideBorder,size,showItemsCount,renderRight});return React.createElement(StyledList,{role:"tree","data-e2e-test-id":dataE2eTestId,"data-ds-id":"EntityTree"},renderTreeBranches({data:dataShown,level:0,renderFn:renderTreeBranches}))};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NodeID, NodeChildrenMap, NodeCheckboxState } from "./types";
|
|
2
|
+
import type { TreeNode } from "./EntityTree";
|
|
3
|
+
export declare function getNodeChildrenMap(tree: Partial<TreeNode>): NodeChildrenMap;
|
|
4
|
+
export declare function getTreeCheckboxState(nodeChildrenMap: NodeChildrenMap, rootID: NodeID, selectedLeafNodeIds: NodeID[]): NodeCheckboxState;
|
|
5
|
+
export declare function getLeafNodeIds(nodeChildrenMap: NodeChildrenMap, rootID: NodeID): NodeID[];
|
|
6
|
+
export declare function filterTree(tree: TreeNode, filterFn: (node: TreeNode) => boolean): TreeNode | null;
|
|
7
|
+
export declare function mapTree(tree: TreeNode, mapFn: (node: TreeNode) => TreeNode): TreeNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function foldTree(f,nodeChildrenMap,rootID){let go=nodeID=>f(nodeID,nodeChildrenMap[nodeID].map(go));return go(rootID)}export function getNodeChildrenMap(tree){let nodeChildrenMap={};return!function traverse(node){let{children}=node;nodeChildrenMap[node.id]=children.map(child=>(traverse(child),child.id))}(tree),nodeChildrenMap}export function getTreeCheckboxState(nodeChildrenMap,rootID,selectedLeafNodeIds){return foldTree((currId,childrenResults)=>{if(0===nodeChildrenMap[currId].length)return{[currId]:selectedLeafNodeIds.includes(currId)?"checked":"unchecked"};let mergedChildrenResult=childrenResults.reduce((acc,result)=>Object.assign(acc,result)),childrenStates=new Set(nodeChildrenMap[currId].map(childId=>mergedChildrenResult[childId]));return{[currId]:1===childrenStates.size?childrenStates.values().next().value:"indeterminate",...mergedChildrenResult}},nodeChildrenMap,rootID)}export function getLeafNodeIds(nodeChildrenMap,rootID){return foldTree((currId,childrenResults)=>0===nodeChildrenMap[currId].length?[currId]:childrenResults.flat(),nodeChildrenMap,rootID)}export function filterTree(tree,filterFn){let filteredChildren=tree.children.map(child=>filterTree(child,filterFn)).filter(child=>child);return 0!==filteredChildren.length||filterFn(tree)?{...tree,children:filteredChildren}:null}export function mapTree(tree,mapFn){return{...mapFn(tree),children:tree.children.map(child=>mapTree(child,mapFn))}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getNodeChildrenMap,getLeafNodeIds,getTreeCheckboxState,filterTree,mapTree}from"./tree";let treeListData=[{id:"a",label:"a",children:[{id:"a.1",label:"a.1",children:[{id:"a.1.1",label:"a.1.1",children:[]},{id:"a.1.2",label:"a.1.2",children:[]}]}]},{id:"b",label:"b",children:[{id:"b.1",label:"b.1",children:[{id:"b.1.1",label:"b.1.1",children:[]}]}]}],nodeChildrenMap={root:["a","b"],a:["a.1"],"a.1":["a.1.1","a.1.2"],"a.1.1":[],"a.1.2":[],b:["b.1"],"b.1":["b.1.1"],"b.1.1":[]};test("getNodeChildrenMap should return a relationship mapping between parent and children nodes",()=>{let nodeChildrenMap1=getNodeChildrenMap(treeListData[0]),nodeChildrenMap2=getNodeChildrenMap(treeListData[1]);expect(nodeChildrenMap1).toEqual({a:["a.1"],"a.1":["a.1.1","a.1.2"],"a.1.1":[],"a.1.2":[]}),expect(nodeChildrenMap2).toEqual({b:["b.1"],"b.1":["b.1.1"],"b.1.1":[]})}),test("getLeafNodeIds should return all the leaf nodes of any given node",()=>{expect(getLeafNodeIds(nodeChildrenMap,"root")).toEqual(["a.1.1","a.1.2","b.1.1"]),expect(getLeafNodeIds(nodeChildrenMap,"a")).toEqual(["a.1.1","a.1.2"]),expect(getLeafNodeIds(nodeChildrenMap,"b.1")).toEqual(["b.1.1"]),expect(getLeafNodeIds(nodeChildrenMap,"b.1.1")).toEqual(["b.1.1"])}),test("getTreeCheckboxState should return the checkbox state of each node in the tree",()=>{let nodeCheckboxState=getTreeCheckboxState(nodeChildrenMap,"root",["a.1.1","b.1.1"]);expect(nodeCheckboxState).toEqual({root:"indeterminate",a:"indeterminate","a.1":"indeterminate","a.1.1":"checked","a.1.2":"unchecked",b:"checked","b.1":"checked","b.1.1":"checked"})}),test("filterTree should return a new tree with the nodes that satisfy the filter function",()=>{let filteredTree1=filterTree(treeListData[0],node=>"a.1"===node.id);expect(filteredTree1).toEqual({id:"a",label:"a",children:[{id:"a.1",label:"a.1",children:[]}]});let filteredTree2=filterTree(treeListData[0],node=>"non-existent"===node.id);expect(filteredTree2).toEqual(null)}),test("mapTree should return a new tree with all its nodes being mapped",()=>{let mappedTree=mapTree(treeListData[0],node=>({...node,label:node.label.toUpperCase()}));expect(mappedTree).toEqual({id:"a",label:"A",children:[{id:"a.1",label:"A.1",children:[{id:"a.1.1",label:"A.1.1",children:[]},{id:"a.1.2",label:"A.1.2",children:[]}]}]})});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type NodeID = string;
|
|
2
|
+
export type NodeChildrenMap = Record<NodeID, NodeID[]>;
|
|
3
|
+
export type CheckboxState = "checked" | "unchecked" | "indeterminate";
|
|
4
|
+
export type NodeCheckboxState = Record<NodeID, CheckboxState>;
|
|
5
|
+
export type NodeExpandedState = Record<NodeID, boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from"react";import{Container}from"../Container/Container";import{StyledList}from"./styled-components";export function List({children,role="list","data-e2e-test-id":dataE2eTestId}){return React.createElement(Container,null,React.createElement(StyledList,{"data-e2e-test-id":dataE2eTestId,"data-ds-id":"List",role:role},children))}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps } from "./types";
|
|
3
|
+
export declare function ListItem({ description, size, role, renderLeft, renderRight, isExpanded, children, onClick, onExpandClick, isClickable, lSpaceStep, renderLabel, hideBorder, "aria-label": ariaLabel, }: ListItemProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from"react";import{ListItemLabel}from"./ListItemLabel";import{StyledListItem}from"./styled-components";export function ListItem({description,size="m",role,renderLeft,renderRight,isExpanded,children,onClick,onExpandClick,isClickable=!0,lSpaceStep,renderLabel,hideBorder,"aria-label":ariaLabel}){return React.createElement(StyledListItem,{role:role,"aria-expanded":isExpanded,"aria-label":ariaLabel},React.createElement(ListItemLabel,{lSpaceStep:lSpaceStep,hideBorder:hideBorder,isExpanded:isExpanded,size:size,description:description,onExpandClick:onExpandClick,onClick:onClick,isClickable:isClickable,renderLeft:renderLeft,renderRight:renderRight,renderLabel:renderLabel}),isExpanded&&children)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from"react";import{PictogramButton}from"../PictogramButton/PictogramButton";import{Box}from"../Box/Box";export function ListItemExpandButton({onClick,isExpanded}){return React.createElement(Box,{vSpace:"zero",lSpace:"m",rSpace:"m"},React.createElement(PictogramButton,{onClick:onClick,icon:isExpanded?"chevron-down":"chevron-right"}))}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ListItemProps } from "./types";
|
|
3
|
+
export declare function ListItemLabel({ description, size, renderLeft, renderRight, renderLabel, isExpanded, onClick, onExpandClick, isClickable, lSpaceStep, hideBorder, }: Partial<ListItemProps>): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React,{useCallback}from"react";import{ListItemText}from"./ListItemText";import{ListItemExpandButton}from"./ListItemExpandButton";import{Inline}from"../Inline/Inline";import{StyledListItemWrapper,StyledListItemLabel}from"./styled-components";let useListItemLabel=({size,isExpanded,lSpaceStep})=>{let hasExpandableIcon=void 0!==isExpanded,isTreeNode=void 0!==lSpaceStep;return{isDeepestTreeNode:!hasExpandableIcon&&isTreeNode,isTreeNode,textSize:"xs"===size?"s":"m",hasExpandableIcon}},StopPropogationWrapper=({children})=>{let handleClick=useCallback(e=>{e.stopPropagation()},[]);return React.createElement("div",{role:"presentation",onClick:handleClick},children)};export function ListItemLabel({description,size="m",renderLeft,renderRight,renderLabel,isExpanded,onClick,onExpandClick,isClickable=!0,lSpaceStep,hideBorder}){let{textSize,hasExpandableIcon,isTreeNode,isDeepestTreeNode}=useListItemLabel({size,isExpanded,lSpaceStep});return React.createElement(StyledListItemLabel,{size:size,onClick:onClick,isClickable:isClickable,isDeepestTreeNode:isDeepestTreeNode,lSpaceStep:lSpaceStep},hasExpandableIcon&&React.createElement(ListItemExpandButton,{isExpanded:isExpanded,onClick:onExpandClick}),React.createElement(StyledListItemWrapper,{size:size,hasLSpace:!isTreeNode,hideBorder:hideBorder},React.createElement(Inline,{noWrap:!0,alignItems:"spaceBetween"},React.createElement(Inline,{noWrap:!0,alignItems:"spaceBetween",space:"m"},renderLeft&&renderLeft({size:textSize}),React.createElement(ListItemText,{size:textSize,description:description},renderLabel({size:textSize}))),renderRight&&React.createElement(StopPropogationWrapper,null,renderRight({size:textSize})))))}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from"react";import{Text}from"../Typography/Text/Text";import{Stack}from"../Stack/Stack";export function ListItemText({children,size,description}){return React.createElement(Stack,{space:"xxs"},React.createElement(Text,{size:size},children),description&&React.createElement(Text,{color:"tertiary",size:"s"},description))}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ListItemProps, ListItemWrapperProps, UseListItemLabelReturn } from "./types";
|
|
3
|
+
export declare const StyledList: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme;
|
|
5
|
+
as?: import("react").ElementType<any>;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
7
|
+
export declare const StyledListItemWrapper: import("@emotion/styled").StyledComponent<{
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: import("react").ElementType<any>;
|
|
10
|
+
} & ListItemWrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
export declare const StyledListItem: import("@emotion/styled").StyledComponent<{
|
|
12
|
+
theme?: import("@emotion/react").Theme;
|
|
13
|
+
as?: import("react").ElementType<any>;
|
|
14
|
+
} & Partial<ListItemProps>, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
15
|
+
export declare const StyledListItemLabel: import("@emotion/styled").StyledComponent<{
|
|
16
|
+
theme?: import("@emotion/react").Theme;
|
|
17
|
+
as?: import("react").ElementType<any>;
|
|
18
|
+
} & Partial<ListItemProps> & Partial<UseListItemLabelReturn>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import styled from"@emotion/styled";import{mq}from"../../shared/mediaQueries";export const StyledList=styled("ul",{target:"ecuw86y0",label:"StyledList"})("/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB0eXBlIHtcbiAgTGlzdEl0ZW1Qcm9wcyxcbiAgTGlzdEl0ZW1XcmFwcGVyUHJvcHMsXG4gIFVzZUxpc3RJdGVtTGFiZWxSZXR1cm4sXG59IGZyb20gXCIuL3R5cGVzXCI7XG5pbXBvcnQgeyBtcSB9IGZyb20gXCIuLi8uLi9zaGFyZWQvbWVkaWFRdWVyaWVzXCI7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRMaXN0ID0gc3R5bGVkLnVsYGA7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRMaXN0SXRlbVdyYXBwZXIgPSBzdHlsZWQuZGl2PExpc3RJdGVtV3JhcHBlclByb3BzPihcbiAgKHsgdGhlbWUsIHNpemUsIGhhc0xTcGFjZSwgaGlkZUJvcmRlciB9KSA9PiAoe1xuICAgIGJvcmRlckJvdHRvbTogYDFweCBzb2xpZCAke3RoZW1lLnZhbHVlcy5jb2xvci5ib3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nZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVEwQiJ9 */");export const StyledListItemWrapper=styled("div",{target:"ecuw86y1",label:"StyledListItemWrapper"})(({theme,size,hasLSpace,hideBorder})=>({borderBottom:`1px solid ${theme.values.color.border.secondary.default}`,...hideBorder&&{borderBottomColor:"transparent"},width:"100%",...hasLSpace&&{paddingLeft:theme.variables.size.spacing.l},paddingRight:theme.variables.size.spacing.l,...mq({paddingBottom:[size,{xs:`calc(${theme.variables.size.spacing.xs} - 1px)`,s:`calc(${theme.variables.size.spacing.s} - 1px)`,m:`calc(${theme.variables.size.spacing.m} - 1px)`,l:`calc(${theme.variables.size.spacing.l} - 1px)`}]})}),"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB0eXBlIHtcbiAgTGlzdEl0ZW1Qcm9wcyxcbiAgTGlzdEl0ZW1XcmFwcGVyUHJvcHMsXG4gIFVzZUxpc3RJdGVtTGFiZWxSZXR1cm4sXG59IGZyb20gXCIuL3R5cGVzXCI7XG5pbXBvcnQgeyBtcSB9IGZyb20gXCIuLi8uLi9zaGFyZWQvbWVkaWFRdWVyaWVzXCI7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRMaXN0ID0gc3R5bGVkLnVsYGA7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRMaXN0SXRlbVdyYXBwZXIgPSBzdHlsZWQuZGl2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kLWNvbG9yIDAuMXMgZWFzZS1vdXRcIixcbiAgLi4uKGlzQ2xpY2thYmxlICYmIHtcbiAgICBjdXJzb3I6IFwicG9pbnRlclwiLFxuICAgIFwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVVxQyJ9 */");export const StyledListItem=styled("li",{target:"ecuw86y2",label:"StyledListItem"})(()=>({listStyleType:"none"}),"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB0eXBlIHtcbiAgTGlzdEl0ZW1Qcm9wcyxcbiAgTGlzdEl0ZW1XcmFwcGVyUHJvcHMsXG4gIFVzZUxpc3RJdGVtTGFiZWxSZXR1cm4sXG59IGZyb20gXCIuL3R5cGVzXCI7XG5pbXBvcnQgeyBtcSB9IGZyb20gXCIuLi8uLi9zaGFyZWQvbWVkaWFRdWVyaWVzXCI7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRMaXN0ID0gc3R5bGVkLnVsYGA7XG5cbmV4cG9ydCBjb25zdCBTdHlsZWRMaXN0SXRlbVdyYXBwZXIgPSBzdHlsZWQuZGl2PExpc3RJdGVtV3JhcHBlclByb3BzPihcbiAgKHsgdGhlbWUsIHNpemUsIGhhc0xTcGFjZSwgaGlkZUJvcmRlciB9KSA9PiAoe1xuICAgIGJ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FwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1DOEIifQ== */");export const StyledListItemLabel=styled("div",{target:"ecuw86y3",label:"StyledListItemLabel"})(({theme,size,isClickable,lSpaceStep,isDeepestTreeNode})=>({display:"flex",flexGrow:1,width:"100%",pointerEvents:isClickable?"auto":"none",...lSpaceStep&&{paddingLeft:`calc(${theme.variables.size.spacing.xl} * ${lSpaceStep} + ${isDeepestTreeNode?"56px":"0px"})`},...mq({paddingTop:[size,{xs:`${theme.variables.size.spacing.xs}`,s:`${theme.variables.size.spacing.s}`,m:`${theme.variables.size.spacing.m}`,l:`${theme.variables.size.spacing.l}`}]}),transition:"background-color 0.1s ease-out",...isClickable&&{cursor:"pointer","&:hover":{backgroundColor:theme.values.color.background.transparent.hover}}}),"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyIsInNvdXJjZXMiOlsic3JjL2NvbXBvbmVudHMvTGlzdC9zdHlsZWQtY29tcG9uZW50cy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gXCJAZW1vdGlvbi9zdHlsZWRcIjtcbmltcG9ydCB0eXBlIHtcbiAgTGlzdEl0ZW1Qcm9wcyxcbiAgTGlzdEl0ZW1XcmFwcGVyUHJvcHMsXG4gIFVzZUxpc3RJdGVtTGFiZWxSZXR1cm4sXG59IGZyb20gXCIuL3R5cGVzXCI7XG5pbXBvcnQgeyBtcSB9IGZyb20gXCIuLi8uLi9zaGFyZWQvbWVkaWFRdWVyaWVzXCI7XG5cbmV4cG9ydCBjb25z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mxlcy5zaXplLnNwYWNpbmcubH1gLFxuICAgICAgfSBhcyBhbnksXG4gICAgXSxcbiAgfSksXG5cbiAgdHJhbnNpdGlvbjogXCJiYWNrZ3JvdW5kLWNvbG9yIDAuMXMgZWFzZS1vdXRcIixcbiAgLi4uKGlzQ2xpY2thYmxlICYmIHtcbiAgICBjdXJzb3I6IFwicG9pbnRlclwiLFxuICAgIFwiJjpob3ZlclwiOiB7XG4gICAgICBiYWNrZ3JvdW5kQ29sb3I6IHRoZW1lLnZhbHVlcy5jb2xvci5iYWNrZ3JvdW5kLnRyYW5zcGFyZW50LmhvdmVyLFxuICAgIH0sXG4gIH0pLFxufSkpO1xuIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVDbUMifQ== */");
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { MQ, TextSize } from "../../types";
|
|
3
|
+
export type ListSizes = "xs" | "s" | "m" | "l" | MQ<"xs" | "s" | "m" | "l">;
|
|
4
|
+
export type ListProps = {
|
|
5
|
+
role?: "list" | "tree" | "group";
|
|
6
|
+
"data-e2e-test-id"?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export type ListItemWrapperProps = {
|
|
10
|
+
size: ListSizes;
|
|
11
|
+
hasLSpace: boolean;
|
|
12
|
+
hideBorder: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type ListItemProps = {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
role?: "listitem" | "treeitem";
|
|
17
|
+
isClickable?: boolean;
|
|
18
|
+
size?: ListSizes;
|
|
19
|
+
lSpaceStep?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
20
|
+
description?: string;
|
|
21
|
+
renderLabel: (props: {
|
|
22
|
+
size: TextSize;
|
|
23
|
+
}) => React.ReactElement;
|
|
24
|
+
renderLeft?: (props: {
|
|
25
|
+
size: ListSizes;
|
|
26
|
+
}) => React.ReactElement;
|
|
27
|
+
renderRight?: (props: {
|
|
28
|
+
size: ListSizes;
|
|
29
|
+
}) => React.ReactElement;
|
|
30
|
+
isExpanded?: boolean;
|
|
31
|
+
hideBorder?: boolean;
|
|
32
|
+
onExpandClick?: (e: React.MouseEvent) => void;
|
|
33
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
34
|
+
"aria-label": string;
|
|
35
|
+
};
|
|
36
|
+
export type ListItemLabelProps = {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
size: TextSize;
|
|
39
|
+
description?: string;
|
|
40
|
+
};
|
|
41
|
+
export type UseListItemLabelProps = {
|
|
42
|
+
size: ListItemProps["size"];
|
|
43
|
+
isExpanded?: boolean;
|
|
44
|
+
isTreeNode?: boolean;
|
|
45
|
+
lSpaceStep?: number;
|
|
46
|
+
};
|
|
47
|
+
export type UseListItemLabelReturn = {
|
|
48
|
+
textSize: "s" | "m";
|
|
49
|
+
hasExpandableIcon: boolean;
|
|
50
|
+
isTreeNode: boolean;
|
|
51
|
+
isDeepestTreeNode: boolean;
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
package/build/esm/index.d.ts
CHANGED
|
@@ -64,3 +64,4 @@ export * from "./components/Form/MaskedInput/MaskedInput";
|
|
|
64
64
|
export * from "./components/Utilities/Expandable/Expandable";
|
|
65
65
|
export * from "./components/QBankRichText/QBankRichText";
|
|
66
66
|
export * from "./components/Tutorialtip/Tutorialtip";
|
|
67
|
+
export * from "./components/EntityTree/EntityTree";
|
package/build/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ambossVisualConfiguration}from"./web-tokens/visualConfig";export const{dark,light}=ambossVisualConfiguration;export{ThemeProvider,CacheProvider}from"@emotion/react";export{default as createCache}from"@emotion/cache";export*from"./components/Card/Card";export*from"./components/Card/CardBox";export*from"./components/Box/Box";export*from"./components/Inline/Inline";export*from"./components/Stack/Stack";export*from"./components/Typography/Header/Header";export*from"./components/Typography/Text/Text";export*from"./components/Typography/TextClamped/TextClamped";export*from"./components/Typography/StyledText/StyledText";export*from"./components/Link/Link";export*from"./components/Icon/Icon";export*from"./components/Button/Button";export*from"./components/BulkActionsToolbar/BulkActionsToolbar";export*from"./components/Divider/Divider";export*from"./components/Column/Columns";export*from"./components/Form/SearchInput/SearchInput";export*from"./components/Tabs/Tabs";export*from"./components/Badge/Badge";export*from"./components/SearchResult/SearchResult";export*from"./components/Form/ToggleButton/ToggleButton";export*from"./components/DropdownMenu/DropdownMenu";export*from"./components/Form/FormFieldGroup/FormFieldGroup";export*from"./components/Form/Input";export*from"./components/Form/Checkbox/Checkbox";export*from"./components/Form/Toggle/Toggle";export*from"./components/Form/Radio/Radio";export*from"./components/Form/RadioButton/RadioButton";export*from"./components/Form/RangeInput/RangeInput";export*from"./components/Form/Textarea/Textarea";export*from"./components/Form/Select/Select";export*from"./components/SubThemeProvider/SubThemeProvider";export*from"./components/PictogramButton/PictogramButton";export*from"./components/MediaViewerBar/MediaViewerBar";export*from"./components/SegmentedProgressBar/SegmentedProgressBar";export*from"./components/ProgressBar/ProgressBar";export*from"./components/Container/Container";export*from"./components/Form/PasswordInput";export*from"./components/RoundButton/RoundButton";export*from"./components/Notification/Notification";export*from"./components/Logo/Logo";export*from"./components/MediaItem/MediaItem";export*from"./components/Callout/Callout";export*from"./components/Patterns/Modal/Modal";export*from"./components/Patterns/ButtonGroup/ButtonGroup";export*from"./components/Collapsible/Collapsible";export*from"./components/LoadingSpinner/LoadingSpinner";export*from"./components/Pagination/Pagination";export*from"./components/DataTable";export*from"./components/Form/SegmentedControl/SegmentedControl";export*from"./components/Tooltip/Tooltip";export*from"./components/Tag/Tag";export*from"./components/TagGroup/TagGroup";export*from"./components/Toggletip/Toggletip";export*from"./components/Popover/Popover";export*from"./components/UserHighlightTooltip/UserHighlightTooltip";export*from"./components/Sheet/Sheet";export*from"./components/Image/Image";export*from"./components/Form/MaskedInput/MaskedInput";export*from"./components/Utilities/Expandable/Expandable";export*from"./components/QBankRichText/QBankRichText";export*from"./components/Tutorialtip/Tutorialtip";
|
|
1
|
+
import{ambossVisualConfiguration}from"./web-tokens/visualConfig";export const{dark,light}=ambossVisualConfiguration;export{ThemeProvider,CacheProvider}from"@emotion/react";export{default as createCache}from"@emotion/cache";export*from"./components/Card/Card";export*from"./components/Card/CardBox";export*from"./components/Box/Box";export*from"./components/Inline/Inline";export*from"./components/Stack/Stack";export*from"./components/Typography/Header/Header";export*from"./components/Typography/Text/Text";export*from"./components/Typography/TextClamped/TextClamped";export*from"./components/Typography/StyledText/StyledText";export*from"./components/Link/Link";export*from"./components/Icon/Icon";export*from"./components/Button/Button";export*from"./components/BulkActionsToolbar/BulkActionsToolbar";export*from"./components/Divider/Divider";export*from"./components/Column/Columns";export*from"./components/Form/SearchInput/SearchInput";export*from"./components/Tabs/Tabs";export*from"./components/Badge/Badge";export*from"./components/SearchResult/SearchResult";export*from"./components/Form/ToggleButton/ToggleButton";export*from"./components/DropdownMenu/DropdownMenu";export*from"./components/Form/FormFieldGroup/FormFieldGroup";export*from"./components/Form/Input";export*from"./components/Form/Checkbox/Checkbox";export*from"./components/Form/Toggle/Toggle";export*from"./components/Form/Radio/Radio";export*from"./components/Form/RadioButton/RadioButton";export*from"./components/Form/RangeInput/RangeInput";export*from"./components/Form/Textarea/Textarea";export*from"./components/Form/Select/Select";export*from"./components/SubThemeProvider/SubThemeProvider";export*from"./components/PictogramButton/PictogramButton";export*from"./components/MediaViewerBar/MediaViewerBar";export*from"./components/SegmentedProgressBar/SegmentedProgressBar";export*from"./components/ProgressBar/ProgressBar";export*from"./components/Container/Container";export*from"./components/Form/PasswordInput";export*from"./components/RoundButton/RoundButton";export*from"./components/Notification/Notification";export*from"./components/Logo/Logo";export*from"./components/MediaItem/MediaItem";export*from"./components/Callout/Callout";export*from"./components/Patterns/Modal/Modal";export*from"./components/Patterns/ButtonGroup/ButtonGroup";export*from"./components/Collapsible/Collapsible";export*from"./components/LoadingSpinner/LoadingSpinner";export*from"./components/Pagination/Pagination";export*from"./components/DataTable";export*from"./components/Form/SegmentedControl/SegmentedControl";export*from"./components/Tooltip/Tooltip";export*from"./components/Tag/Tag";export*from"./components/TagGroup/TagGroup";export*from"./components/Toggletip/Toggletip";export*from"./components/Popover/Popover";export*from"./components/UserHighlightTooltip/UserHighlightTooltip";export*from"./components/Sheet/Sheet";export*from"./components/Image/Image";export*from"./components/Form/MaskedInput/MaskedInput";export*from"./components/Utilities/Expandable/Expandable";export*from"./components/QBankRichText/QBankRichText";export*from"./components/Tutorialtip/Tutorialtip";export*from"./components/EntityTree/EntityTree";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amboss/design-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "the design system for AMBOSS products",
|
|
5
5
|
"author": "AMBOSS",
|
|
6
6
|
"license": "ISC",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@auto-it/npm": "^
|
|
136
|
+
"@auto-it/npm": "^11.1.6",
|
|
137
137
|
"@auto-it/released": "^10.13.2",
|
|
138
138
|
"@babel/cli": "^7.23.4",
|
|
139
139
|
"@babel/core": "^7.12.3",
|