@eccenca/gui-elements 23.0.0 → 23.1.0-easynav.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/CHANGELOG.md +35 -1
- package/README.md +7 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js +7 -2
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -7
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/extensions/scrollOnDragHook.js +200 -0
- package/dist/cjs/cmem/react-flow/extensions/scrollOnDragHook.js.map +1 -0
- package/dist/cjs/common/Intent/index.js +7 -3
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/utils/characters.js +82 -0
- package/dist/cjs/common/utils/characters.js.map +1 -0
- package/dist/cjs/components/Application/ApplicationTitle.js +2 -2
- package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/cjs/components/Badge/Badge.js +44 -0
- package/dist/cjs/components/Badge/Badge.js.map +1 -0
- package/dist/cjs/components/Depiction/Depiction.js +111 -0
- package/dist/cjs/components/Depiction/Depiction.js.map +1 -0
- package/dist/cjs/components/Grid/Grid.js +7 -2
- package/dist/cjs/components/Grid/Grid.js.map +1 -1
- package/dist/cjs/components/Grid/GridColumn.js +6 -2
- package/dist/cjs/components/Grid/GridColumn.js.map +1 -1
- package/dist/cjs/components/Grid/GridRow.js +3 -0
- package/dist/cjs/components/Grid/GridRow.js.map +1 -1
- package/dist/cjs/components/Icon/BaseIcon.js +38 -0
- package/dist/cjs/components/Icon/BaseIcon.js.map +1 -0
- package/dist/cjs/components/Icon/Icon.js +9 -24
- package/dist/cjs/components/Icon/Icon.js.map +1 -1
- package/dist/cjs/components/Icon/IconButton.js +8 -1
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/TestIcon.js +35 -0
- package/dist/cjs/components/Icon/TestIcon.js.map +1 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js +123 -621
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Icon/index.js +11 -0
- package/dist/cjs/components/Icon/index.js.map +1 -0
- package/dist/cjs/components/Menu/MenuItem.js +1 -1
- package/dist/cjs/components/Menu/MenuItem.js.map +1 -1
- package/dist/cjs/components/MultiSelect/MultiSelect.js +56 -23
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/Notification/Notification.js +10 -2
- package/dist/cjs/components/Notification/Notification.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js +24 -0
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/Tag/Tag.js +6 -2
- package/dist/cjs/components/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/TextField/TextArea.js +4 -2
- package/dist/cjs/components/TextField/TextArea.js.map +1 -1
- package/dist/cjs/components/TextField/TextField.js +4 -2
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/TextField/useTextValidation.js +84 -0
- package/dist/cjs/components/TextField/useTextValidation.js.map +1 -0
- package/dist/cjs/components/Tree/Tree.js.map +1 -1
- package/dist/cjs/components/Typography/Highlighter.js.map +1 -1
- package/dist/cjs/components/Typography/OverflowText.js.map +1 -1
- package/dist/cjs/components/Typography/WhiteSpaceContainer.js +35 -12
- package/dist/cjs/components/Typography/WhiteSpaceContainer.js.map +1 -1
- package/dist/cjs/components/Typography/index.js +21 -0
- package/dist/cjs/components/Typography/index.js.map +1 -0
- package/dist/cjs/components/Workspace/WorkspaceContent.js +1 -1
- package/dist/cjs/components/Workspace/WorkspaceContent.js.map +1 -1
- package/dist/cjs/components/index.js +18 -0
- package/dist/cjs/components/index.js.map +1 -0
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +58 -0
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +12 -3
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/index.js +11 -0
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +57 -30
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +3 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/versionsupport.js +20 -0
- package/dist/cjs/extensions/react-flow/versionsupport.js.map +1 -0
- package/dist/cjs/index.js +7 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js +7 -2
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlow.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +3 -6
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/extensions/scrollOnDragHook.js +194 -0
- package/dist/esm/cmem/react-flow/extensions/scrollOnDragHook.js.map +1 -0
- package/dist/esm/common/Intent/index.js +5 -13
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/utils/characters.js +96 -0
- package/dist/esm/common/utils/characters.js.map +1 -0
- package/dist/esm/components/Application/ApplicationTitle.js +2 -2
- package/dist/esm/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/esm/components/Badge/Badge.js +48 -0
- package/dist/esm/components/Badge/Badge.js.map +1 -0
- package/dist/esm/components/Depiction/Depiction.js +96 -0
- package/dist/esm/components/Depiction/Depiction.js.map +1 -0
- package/dist/esm/components/Grid/Grid.js +7 -2
- package/dist/esm/components/Grid/Grid.js.map +1 -1
- package/dist/esm/components/Grid/GridColumn.js +6 -2
- package/dist/esm/components/Grid/GridColumn.js.map +1 -1
- package/dist/esm/components/Grid/GridRow.js +3 -0
- package/dist/esm/components/Grid/GridRow.js.map +1 -1
- package/dist/esm/components/Icon/BaseIcon.js +44 -0
- package/dist/esm/components/Icon/BaseIcon.js.map +1 -0
- package/dist/esm/components/Icon/Icon.js +9 -24
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Icon/IconButton.js +8 -1
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/TestIcon.js +41 -0
- package/dist/esm/components/Icon/TestIcon.js.map +1 -0
- package/dist/esm/components/Icon/canonicalIconNames.js +123 -621
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Icon/index.js +4 -0
- package/dist/esm/components/Icon/index.js.map +1 -0
- package/dist/esm/components/Menu/MenuItem.js +1 -1
- package/dist/esm/components/Menu/MenuItem.js.map +1 -1
- package/dist/esm/components/MultiSelect/MultiSelect.js +61 -44
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/Notification/Notification.js +12 -4
- package/dist/esm/components/Notification/Notification.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js +24 -0
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/Tag/Tag.js +6 -2
- package/dist/esm/components/Tag/Tag.js.map +1 -1
- package/dist/esm/components/TextField/TextArea.js +4 -2
- package/dist/esm/components/TextField/TextArea.js.map +1 -1
- package/dist/esm/components/TextField/TextField.js +4 -2
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/components/TextField/useTextValidation.js +78 -0
- package/dist/esm/components/TextField/useTextValidation.js.map +1 -0
- package/dist/esm/components/Tree/Tree.js.map +1 -1
- package/dist/esm/components/Typography/Highlighter.js.map +1 -1
- package/dist/esm/components/Typography/OverflowText.js.map +1 -1
- package/dist/esm/components/Typography/WhiteSpaceContainer.js +16 -14
- package/dist/esm/components/Typography/WhiteSpaceContainer.js.map +1 -1
- package/dist/esm/components/Typography/index.js +12 -0
- package/dist/esm/components/Typography/index.js.map +1 -0
- package/dist/esm/components/Workspace/WorkspaceContent.js +1 -1
- package/dist/esm/components/Workspace/WorkspaceContent.js.map +1 -1
- package/dist/esm/components/index.js +6 -0
- package/dist/esm/components/index.js.map +1 -0
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +47 -0
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +13 -4
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/index.js +1 -0
- package/dist/esm/extensions/react-flow/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +67 -38
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +3 -2
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/versionsupport.js +32 -0
- package/dist/esm/extensions/react-flow/versionsupport.js.map +1 -0
- package/dist/esm/index.js +5 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +2 -1
- package/dist/types/cmem/react-flow/ReactFlow/ReactFlow.d.ts +14 -0
- package/dist/types/cmem/react-flow/extensions/scrollOnDragHook.d.ts +22 -0
- package/dist/types/common/Intent/index.d.ts +4 -3
- package/dist/types/common/utils/characters.d.ts +19 -0
- package/dist/types/components/Badge/Badge.d.ts +42 -0
- package/dist/types/components/Depiction/Depiction.d.ts +71 -0
- package/dist/types/components/Grid/Grid.d.ts +21 -2
- package/dist/types/components/Grid/GridColumn.d.ts +21 -3
- package/dist/types/components/Grid/GridRow.d.ts +18 -2
- package/dist/types/components/Icon/BaseIcon.d.ts +45 -0
- package/dist/types/components/Icon/Icon.d.ts +7 -34
- package/dist/types/components/Icon/IconButton.d.ts +3 -2
- package/dist/types/components/Icon/TestIcon.d.ts +20 -0
- package/dist/types/components/Icon/canonicalIconNames.d.ts +9 -7
- package/dist/types/components/Icon/index.d.ts +4 -0
- package/dist/types/components/Menu/MenuItem.d.ts +2 -1
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +3 -1
- package/dist/types/components/Notification/Notification.d.ts +13 -4
- package/dist/types/components/Tabs/Tab.d.ts +2 -0
- package/dist/types/components/Tag/Tag.d.ts +16 -3
- package/dist/types/components/TextField/TextArea.d.ts +7 -2
- package/dist/types/components/TextField/TextField.d.ts +6 -1
- package/dist/types/components/TextField/useTextValidation.d.ts +28 -0
- package/dist/types/components/Tree/Tree.d.ts +2 -1
- package/dist/types/components/Typography/Highlighter.d.ts +2 -2
- package/dist/types/components/Typography/OverflowText.d.ts +2 -2
- package/dist/types/components/Typography/WhiteSpaceContainer.d.ts +45 -4
- package/dist/types/components/Typography/index.d.ts +12 -0
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +32 -0
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +11 -3
- package/dist/types/extensions/react-flow/index.d.ts +1 -0
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +31 -7
- package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -1
- package/dist/types/extensions/react-flow/versionsupport.d.ts +7 -0
- package/dist/types/index.d.ts +6 -11
- package/package.json +14 -16
- package/scripts/compile-sass.ts +9 -1
- package/src/_shame.scss +1 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +6 -4
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +3 -2
- package/src/cmem/react-flow/ReactFlow/ReactFlow.tsx +26 -1
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +10 -6
- package/src/cmem/react-flow/extensions/scrollOnDragHook.ts +247 -0
- package/src/common/Intent/index.ts +16 -12
- package/src/common/utils/characters.ts +111 -0
- package/src/components/Accordion/accordion.scss +4 -3
- package/src/components/Application/ApplicationTitle.tsx +2 -2
- package/src/components/Application/_config.scss +1 -1
- package/src/components/Application/_content.scss +1 -1
- package/src/components/Application/_header.scss +2 -2
- package/src/components/Application/_sidebar.scss +2 -9
- package/src/components/Application/_toolbar.scss +1 -1
- package/src/components/Application/application.scss +4 -4
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +13 -8
- package/src/components/Badge/Badge.stories.tsx +47 -0
- package/src/components/Badge/Badge.tsx +93 -0
- package/src/components/Badge/badge.scss +44 -0
- package/src/components/Depiction/Depiction.tsx +198 -0
- package/src/components/Depiction/depiction.scss +176 -0
- package/src/components/Depiction/stories/Depiction.stories.tsx +69 -0
- package/src/components/Depiction/stories/test-16to9.png +0 -0
- package/src/components/Depiction/stories/test-16to9.svg +41 -0
- package/src/components/Depiction/stories/test-16to9.tobase64.svg +41 -0
- package/src/components/Depiction/stories/test-16to9.tsx +44 -0
- package/src/components/Depiction/stories/test-9to16.png +0 -0
- package/src/components/Depiction/stories/test-9to16.svg +44 -0
- package/src/components/Depiction/stories/test-9to16.tobase64.svg +44 -0
- package/src/components/Depiction/stories/test-9to16.tsx +48 -0
- package/src/components/Grid/Grid.tsx +22 -4
- package/src/components/Grid/GridColumn.tsx +24 -7
- package/src/components/Grid/GridRow.tsx +18 -3
- package/src/components/Grid/grid.scss +14 -13
- package/src/components/Grid/stories/Grid.stories.tsx +27 -0
- package/src/components/Grid/stories/GridColumn.stories.tsx +66 -0
- package/src/components/Grid/stories/GridRow.stories.tsx +47 -0
- package/src/components/Icon/BaseIcon.tsx +84 -0
- package/src/components/Icon/Icon.tsx +23 -82
- package/src/components/Icon/IconButton.tsx +18 -14
- package/src/components/Icon/TestIcon.tsx +39 -0
- package/src/components/Icon/canonicalIconNames.tsx +132 -633
- package/src/components/Icon/index.ts +5 -0
- package/src/components/Icon/stories/Icon.stories.tsx +13 -0
- package/src/components/Icon/stories/IconButton.stories.tsx +14 -7
- package/src/components/Icon/stories/TestIcon.stories.tsx +28 -0
- package/src/components/Link/link.scss +2 -1
- package/src/components/Menu/MenuItem.tsx +14 -4
- package/src/components/Menu/Stories/MenuItem.stories.tsx +16 -2
- package/src/components/MultiSelect/MultiSelect.tsx +58 -27
- package/src/components/Notification/Notification.stories.tsx +4 -0
- package/src/components/Notification/Notification.tsx +26 -6
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +31 -0
- package/src/components/OverviewItem/overviewitem.scss +2 -1
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +22 -1
- package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +8 -3
- package/src/components/Pagination/pagination.scss +3 -2
- package/src/components/SimpleTable/simpletable.scss +11 -12
- package/src/components/Tag/Tag.stories.tsx +7 -2
- package/src/components/Tag/Tag.tsx +24 -4
- package/src/components/Tag/tag.scss +84 -3
- package/src/components/TagInput/taginput.scss +6 -0
- package/src/components/TextField/TextArea.tsx +10 -1
- package/src/components/TextField/TextField.tsx +9 -0
- package/src/components/TextField/stories/SearchField.stories.tsx +1 -1
- package/src/components/TextField/textfield.scss +12 -0
- package/src/components/TextField/useTextValidation.ts +103 -0
- package/src/components/Tooltip/tooltip.scss +1 -1
- package/src/components/Tree/Tree.stories.tsx +7 -1
- package/src/components/Tree/Tree.tsx +2 -1
- package/src/components/Typography/Highlighter.tsx +2 -2
- package/src/components/Typography/OverflowText.tsx +2 -2
- package/src/components/Typography/WhiteSpaceContainer.tsx +69 -21
- package/src/components/Typography/index.ts +25 -0
- package/src/components/Typography/stories/WhiteSpaceContainer.stories.tsx +55 -0
- package/src/components/Typography/typography.scss +3 -2
- package/src/components/Workspace/WorkspaceContent.tsx +1 -1
- package/src/components/index.scss +5 -0
- package/src/components/index.ts +5 -0
- package/src/extensions/react-flow/_config.scss +1 -0
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +83 -0
- package/src/extensions/react-flow/edges/_edges.scss +77 -0
- package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +39 -0
- package/src/extensions/react-flow/handles/HandleDefault.tsx +38 -10
- package/src/extensions/react-flow/index.ts +1 -0
- package/src/extensions/react-flow/nodes/NodeContent.tsx +134 -55
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +4 -2
- package/src/extensions/react-flow/nodes/_nodes.scss +56 -17
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +37 -1
- package/src/extensions/react-flow/versionsupport.ts +22 -0
- package/src/includes/carbon-components/_components.scss +11 -0
- package/src/includes/carbon-components/_requisits.scss +18 -0
- package/src/includes/carbon-components/_variables.scss +50 -53
- package/src/index.scss +4 -105
- package/src/index.ts +6 -16
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
width="1920"
|
|
6
|
+
height="1080"
|
|
7
|
+
viewBox="0 0 1920 1080"
|
|
8
|
+
version="1.1"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
11
|
+
<g>
|
|
12
|
+
<rect
|
|
13
|
+
style="fill:#ffeeaa;stroke:none;stroke-width:10.8677;stroke-linecap:square;stroke-linejoin:miter;stroke-dasharray:none"
|
|
14
|
+
width="1920"
|
|
15
|
+
height="1080"
|
|
16
|
+
x="0"
|
|
17
|
+
y="0" />
|
|
18
|
+
<rect
|
|
19
|
+
style="fill:#fff6d5;stroke:#ffcc00;stroke-width:10;stroke-linecap:square;stroke-linejoin:miter;stroke-dasharray:none"
|
|
20
|
+
width="1810"
|
|
21
|
+
height="970"
|
|
22
|
+
x="55"
|
|
23
|
+
y="55" />
|
|
24
|
+
<path
|
|
25
|
+
style="fill:none;stroke:#ffcc00;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:none"
|
|
26
|
+
d="m 55,55 1810,970"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
style="fill:none;stroke:#ffcc00;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-dasharray:none"
|
|
30
|
+
d="M 55,1025 1865,55"
|
|
31
|
+
/>
|
|
32
|
+
<text
|
|
33
|
+
xml:space="preserve"
|
|
34
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:133.333px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto"
|
|
35
|
+
x="592.71484"
|
|
36
|
+
y="587.39581"
|
|
37
|
+
><tspan
|
|
38
|
+
x="592.71484"
|
|
39
|
+
y="587.39581">1920 x 1080</tspan></text>
|
|
40
|
+
</g>
|
|
41
|
+
</svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const Svg16to9 = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="1920"
|
|
7
|
+
height="1080"
|
|
8
|
+
viewBox="0 0 1920 1080"
|
|
9
|
+
// preserveAspectRatio="xMidYMid slice"
|
|
10
|
+
version="1.1"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<g>
|
|
14
|
+
<rect
|
|
15
|
+
style={{fill:"#ffeeaa", stroke:"none", strokeWidth:"10", strokeLinecap:"square", strokeLinejoin:"miter", strokeDasharray:"none"}}
|
|
16
|
+
width="1920"
|
|
17
|
+
height="1080"
|
|
18
|
+
x="0"
|
|
19
|
+
y="0" />
|
|
20
|
+
<rect
|
|
21
|
+
style={{"fill":"#fff6d5", "stroke":"#ffcc00", strokeWidth:"10", strokeLinecap:"square", strokeLinejoin:"miter", strokeDasharray:"none"}}
|
|
22
|
+
width="1810"
|
|
23
|
+
height="970"
|
|
24
|
+
x="55"
|
|
25
|
+
y="55" />
|
|
26
|
+
<path
|
|
27
|
+
style={{"fill":"none", "stroke":"#ffcc00", strokeWidth:"10", strokeLinecap:"butt", strokeLinejoin:"miter", strokeOpacity:"1", strokeDasharray:"none"}}
|
|
28
|
+
d="m 55,55 1810,970"
|
|
29
|
+
/>
|
|
30
|
+
<path
|
|
31
|
+
style={{"fill":"none", "stroke":"#ffcc00", strokeWidth:"10", strokeLinecap:"butt", strokeLinejoin:"miter", strokeOpacity:"1", strokeDasharray:"none"}}
|
|
32
|
+
d="M 55,1025 1865,55"
|
|
33
|
+
/>
|
|
34
|
+
<text
|
|
35
|
+
style={{fontStyle:"normal", fontVariant:"normal", fontWeight:"normal", fontStretch:"normal", fontSize:"133.333px", lineHeight:"1.25", fontFamily:"Roboto"}}
|
|
36
|
+
x="592.71484"
|
|
37
|
+
y="587.39581"
|
|
38
|
+
><tspan
|
|
39
|
+
x="592.71484"
|
|
40
|
+
y="587.39581">1920 x 1080</tspan></text>
|
|
41
|
+
</g>
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
width="1080"
|
|
6
|
+
height="1920"
|
|
7
|
+
viewBox="0 0 1080 1920"
|
|
8
|
+
version="1.1"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
11
|
+
<g
|
|
12
|
+
transform="translate(-420,420)">
|
|
13
|
+
<rect
|
|
14
|
+
style="fill:#ffeeaa;stroke:none;stroke-width:10.8677;stroke-linecap:square;stroke-linejoin:miter;stroke-dasharray:none"
|
|
15
|
+
width="1920"
|
|
16
|
+
height="1080"
|
|
17
|
+
x="-420"
|
|
18
|
+
y="-1500"
|
|
19
|
+
transform="rotate(90)" />
|
|
20
|
+
<rect
|
|
21
|
+
style="fill:#fff6d5;stroke:#ffcc00;stroke-width:10;stroke-linecap:square;stroke-linejoin:miter;stroke-dasharray:none"
|
|
22
|
+
width="1810"
|
|
23
|
+
height="970"
|
|
24
|
+
x="-365"
|
|
25
|
+
y="-1445"
|
|
26
|
+
transform="rotate(90)" />
|
|
27
|
+
<path
|
|
28
|
+
style="fill:none;stroke:#ffcc00;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
29
|
+
d="M 1445,-365 475,1445"
|
|
30
|
+
/>
|
|
31
|
+
<path
|
|
32
|
+
style="fill:none;stroke:#ffcc00;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
33
|
+
d="m 475,-365 970,1810"
|
|
34
|
+
/>
|
|
35
|
+
<text
|
|
36
|
+
xml:space="preserve"
|
|
37
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:133.333px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto"
|
|
38
|
+
x="592.71576"
|
|
39
|
+
y="587.39569"
|
|
40
|
+
><tspan
|
|
41
|
+
x="592.71576"
|
|
42
|
+
y="587.39569">1080 x 1920</tspan></text>
|
|
43
|
+
</g>
|
|
44
|
+
</svg>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
width="1080"
|
|
6
|
+
height="1920"
|
|
7
|
+
viewBox="0 0 1080 1920"
|
|
8
|
+
version="1.1"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
11
|
+
<g
|
|
12
|
+
transform="translate(-420,420)">
|
|
13
|
+
<rect
|
|
14
|
+
style="fill:#ffeeaa;stroke:none;stroke-width:10.8677;stroke-linecap:square;stroke-linejoin:miter;stroke-dasharray:none"
|
|
15
|
+
width="1920"
|
|
16
|
+
height="1080"
|
|
17
|
+
x="-420"
|
|
18
|
+
y="-1500"
|
|
19
|
+
transform="rotate(90)" />
|
|
20
|
+
<rect
|
|
21
|
+
style="fill:#fff6d5;stroke:#ffcc00;stroke-width:10;stroke-linecap:square;stroke-linejoin:miter;stroke-dasharray:none"
|
|
22
|
+
width="1810"
|
|
23
|
+
height="970"
|
|
24
|
+
x="-365"
|
|
25
|
+
y="-1445"
|
|
26
|
+
transform="rotate(90)" />
|
|
27
|
+
<path
|
|
28
|
+
style="fill:none;stroke:#ffcc00;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
29
|
+
d="M 1445,-365 475,1445"
|
|
30
|
+
/>
|
|
31
|
+
<path
|
|
32
|
+
style="fill:none;stroke:#ffcc00;stroke-width:10;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
33
|
+
d="m 475,-365 970,1810"
|
|
34
|
+
/>
|
|
35
|
+
<text
|
|
36
|
+
xml:space="preserve"
|
|
37
|
+
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:133.333px;line-height:1.25;font-family:Roboto;-inkscape-font-specification:Roboto"
|
|
38
|
+
x="592.71576"
|
|
39
|
+
y="587.39569"
|
|
40
|
+
><tspan
|
|
41
|
+
x="592.71576"
|
|
42
|
+
y="587.39569">1080 x 1920</tspan></text>
|
|
43
|
+
</g>
|
|
44
|
+
</svg>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export const Svg9to16 = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
width="1080"
|
|
7
|
+
height="1920"
|
|
8
|
+
viewBox="0 0 1080 1920"
|
|
9
|
+
version="1.1"
|
|
10
|
+
id="svg5"
|
|
11
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
|
+
>
|
|
13
|
+
<g transform="translate(-420,420)">
|
|
14
|
+
<rect
|
|
15
|
+
style={{fill:"#ffeeaa", stroke:"none", strokeWidth:"10", strokeLinecap:"square", strokeLinejoin:"miter", strokeDasharray:"none"}}
|
|
16
|
+
width="1920"
|
|
17
|
+
height="1080"
|
|
18
|
+
x="-420"
|
|
19
|
+
y="-1500"
|
|
20
|
+
transform="rotate(90)" />
|
|
21
|
+
<rect
|
|
22
|
+
style={{"fill":"#fff6d5", "stroke":"#ffcc00", strokeWidth:"10", strokeLinecap:"square", strokeLinejoin:"miter", strokeDasharray:"none"}}
|
|
23
|
+
id="rect234"
|
|
24
|
+
width="1810"
|
|
25
|
+
height="970"
|
|
26
|
+
x="-365"
|
|
27
|
+
y="-1445"
|
|
28
|
+
transform="rotate(90)" />
|
|
29
|
+
<path
|
|
30
|
+
style={{"fill":"none", "stroke":"#ffcc00", strokeWidth:"10", strokeLinecap:"butt", strokeLinejoin:"miter", strokeOpacity:"1", strokeDasharray:"none"}}
|
|
31
|
+
d="M 1445,-365 475,1445"
|
|
32
|
+
id="path1013" />
|
|
33
|
+
<path
|
|
34
|
+
style={{"fill":"none", "stroke":"#ffcc00", strokeWidth:"10", strokeLinecap:"butt", strokeLinejoin:"miter", strokeOpacity:"1", strokeDasharray:"none"}}
|
|
35
|
+
d="m 475,-365 970,1810"
|
|
36
|
+
id="path1015" />
|
|
37
|
+
<text
|
|
38
|
+
style={{fontStyle:"normal", fontVariant:"normal", fontWeight:"normal", fontStretch:"normal", fontSize:"133.333px", lineHeight:"1.25", fontFamily:"Roboto"}}
|
|
39
|
+
x="592.71576"
|
|
40
|
+
y="587.39569"
|
|
41
|
+
id="text1797"><tspan
|
|
42
|
+
id="tspan1795"
|
|
43
|
+
x="592.71576"
|
|
44
|
+
y="587.39569">1080 x 1920</tspan></text>
|
|
45
|
+
</g>
|
|
46
|
+
</svg>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
//
|
|
3
|
-
import {
|
|
2
|
+
// @ts-ignore // FlexGrid is not part of @types/carbon-components-react
|
|
3
|
+
import { FlexGrid as CarbonGrid, GridDefaultProps } from "carbon-components-react";
|
|
4
4
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
5
|
-
import {GridDefaultProps} from "carbon-components-react/lib/components/Grid/Grid";
|
|
6
5
|
|
|
7
|
-
interface GridProps extends GridDefaultProps {
|
|
6
|
+
interface GridProps extends Omit<GridDefaultProps, "fullWidth" | "columns" | "narrow"> {
|
|
7
|
+
/**
|
|
8
|
+
* The available grid height can be distributed between multiple rows.
|
|
9
|
+
* To do so the `verticalStretched` property must be set for the `<GridRow />` element that need to be stretched.
|
|
10
|
+
* This property can be set for multiple rows, then they share the available vertical space regarding their content.
|
|
11
|
+
*/
|
|
8
12
|
verticalStretchable?: boolean
|
|
13
|
+
/**
|
|
14
|
+
* Use the exact space defined by the parent element.
|
|
15
|
+
* This parent element must be displayed using a fixed, relative or absolute position.
|
|
16
|
+
*/
|
|
9
17
|
useAbsoluteSpace?: boolean
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated
|
|
20
|
+
* This is set always by default.
|
|
21
|
+
*/
|
|
22
|
+
fullWidth?: boolean
|
|
10
23
|
}
|
|
11
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Layouts a grid that can contain rows and columns.
|
|
27
|
+
* Grids can also be stacked into other grids for more complex layouts.
|
|
28
|
+
* A very complex level of stacked grids is a sign that something should be designed differently.
|
|
29
|
+
*/
|
|
12
30
|
function Grid({
|
|
13
31
|
children,
|
|
14
32
|
verticalStretchable = false,
|
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
// import PropTypes from 'prop-types';
|
|
3
|
-
import { Column as CarbonColumn } from "carbon-components-react";
|
|
3
|
+
import { Column as CarbonColumn, ColumnDefaultProps } from "carbon-components-react";
|
|
4
4
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
5
|
-
import {ColumnDefaultProps} from "carbon-components-react/lib/components/Grid/Column";
|
|
6
5
|
|
|
7
|
-
interface GridColumnProps extends ColumnDefaultProps {
|
|
6
|
+
interface GridColumnProps extends Omit<ColumnDefaultProps, "max" | "xlg" | "lg" | "md" | "sm"> {
|
|
7
|
+
/**
|
|
8
|
+
* Column width is small, using 3 (or 2, on medium viewports) parts out of 16.
|
|
9
|
+
* This boolean property is basically a quick switch for setting `{ md:2, lg:3 }`.
|
|
10
|
+
*/
|
|
8
11
|
small?: boolean
|
|
12
|
+
/**
|
|
13
|
+
* Column width is medium, using 5 (or 3, on medium viewports) parts out of 16.
|
|
14
|
+
* This boolean property is basically a quick switch for setting `{ md:3, lg:5 }`.
|
|
15
|
+
*/
|
|
9
16
|
medium?: boolean
|
|
17
|
+
/**
|
|
18
|
+
* Alignment of column content.
|
|
19
|
+
*/
|
|
20
|
+
verticalAlign?: "top" | "center"
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated
|
|
23
|
+
*/
|
|
10
24
|
full?: boolean
|
|
11
|
-
verticalAlign?: "center"
|
|
12
25
|
}
|
|
13
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Grid columns can be used in grid rows.
|
|
29
|
+
* They can contain other grids if this is necessary for more complex layouts.
|
|
30
|
+
*/
|
|
14
31
|
function GridColumn({
|
|
15
32
|
children,
|
|
16
33
|
className = '',
|
|
17
34
|
small = false,
|
|
18
35
|
medium = false,
|
|
19
|
-
full
|
|
20
|
-
verticalAlign,
|
|
36
|
+
full,
|
|
37
|
+
verticalAlign = "top",
|
|
21
38
|
...otherProps
|
|
22
39
|
}: GridColumnProps) {
|
|
23
40
|
let sizeConfig = {};
|
|
@@ -25,8 +42,8 @@ function GridColumn({
|
|
|
25
42
|
if (medium) sizeConfig = { md:3, lg:5 };
|
|
26
43
|
return (
|
|
27
44
|
<CarbonColumn
|
|
28
|
-
{...otherProps}
|
|
29
45
|
{...sizeConfig}
|
|
46
|
+
{...otherProps}
|
|
30
47
|
className={
|
|
31
48
|
`${eccgui}-grid__column` +
|
|
32
49
|
(verticalAlign ? ` ${eccgui}-grid__column--vertical-` + verticalAlign : '') +
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
// import PropTypes from 'prop-types';
|
|
3
|
-
import { Row as CarbonRow } from "carbon-components-react";
|
|
3
|
+
import { Row as CarbonRow, RowDefaultProps } from "carbon-components-react";
|
|
4
4
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
5
|
-
import {RowDefaultProps} from "carbon-components-react/lib/components/Grid/Row";
|
|
6
5
|
|
|
7
|
-
interface GridRowProps extends RowDefaultProps {
|
|
6
|
+
interface GridRowProps extends Omit<RowDefaultProps, "narrow"> {
|
|
7
|
+
/**
|
|
8
|
+
* Do not wrap column children when there is not enough space available.
|
|
9
|
+
* This only works for grids on medium sized and larger viewports.
|
|
10
|
+
*/
|
|
8
11
|
dontWrapColumns?: boolean
|
|
12
|
+
/**
|
|
13
|
+
* Row uses maximum height of the workview.
|
|
14
|
+
*/
|
|
9
15
|
fullHeight?: boolean
|
|
16
|
+
/**
|
|
17
|
+
* When a row is vertically stretched then it uses the remaining spcae on the y-axis.
|
|
18
|
+
* Option can be used on multiple rows, then they share the available space.
|
|
19
|
+
* This makes only sense if the grid height is set by additional styles or properties.
|
|
20
|
+
* The grid must be set to `verticalStretchable=true`.
|
|
21
|
+
*/
|
|
10
22
|
verticalStretched?: boolean
|
|
11
23
|
}
|
|
12
24
|
|
|
25
|
+
/**
|
|
26
|
+
* Grid rows exists as children in a grid and can contain columns.
|
|
27
|
+
*/
|
|
13
28
|
function GridRow({
|
|
14
29
|
children,
|
|
15
30
|
className = "",
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
|
|
1
3
|
// own vars
|
|
2
4
|
$eccgui-size-grid-gutter: $eccgui-size-block-whitespace !default;
|
|
3
5
|
|
|
4
|
-
// import lib requisits
|
|
5
|
-
@import "~carbon-components/scss/globals/scss/feature-flags";
|
|
6
|
-
@import "~carbon-components/scss/globals/scss/functions";
|
|
7
|
-
@import "~carbon-components/scss/globals/scss/mixins";
|
|
8
|
-
@import "~carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/grid/mixins";
|
|
9
6
|
// overwrite lib vars
|
|
10
|
-
$
|
|
7
|
+
$grid-gutter: rem($eccgui-size-grid-gutter);
|
|
11
8
|
// load grid
|
|
12
|
-
@
|
|
13
|
-
@include carbon--grid();
|
|
14
|
-
}
|
|
9
|
+
@import "~@carbon/styles/scss/grid/flexbox";
|
|
15
10
|
|
|
16
11
|
// adjustments
|
|
17
12
|
|
|
@@ -39,13 +34,15 @@ $carbon--grid-gutter: carbon--rem($eccgui-size-grid-gutter);
|
|
|
39
34
|
.#{$eccgui}-grid--absolutespace {
|
|
40
35
|
position: absolute;
|
|
41
36
|
top: 0;
|
|
42
|
-
left: 0.
|
|
43
|
-
right: 0.
|
|
37
|
+
left: 0.5 * $eccgui-size-grid-gutter;;
|
|
38
|
+
right: 0.5 * $eccgui-size-grid-gutter;;
|
|
44
39
|
bottom: 0;
|
|
45
40
|
}
|
|
46
41
|
|
|
47
42
|
.#{$prefix}--row {
|
|
48
43
|
flex-wrap: wrap;
|
|
44
|
+
margin-left: -0.5 * $eccgui-size-grid-gutter;;
|
|
45
|
+
margin-right: -0.5 * $eccgui-size-grid-gutter;;
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
.#{$eccgui}-grid__row--fullheight {
|
|
@@ -74,6 +71,8 @@ $carbon--grid-gutter: carbon--rem($eccgui-size-grid-gutter);
|
|
|
74
71
|
@see https://css-tricks.com/flexbox-truncated-text/
|
|
75
72
|
*/
|
|
76
73
|
min-width: 0;
|
|
74
|
+
padding-left: 0.5 * $eccgui-size-grid-gutter;;
|
|
75
|
+
padding-right: 0.5 * $eccgui-size-grid-gutter;;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
.#{$eccgui}-grid__column {
|
|
@@ -84,6 +83,8 @@ $carbon--grid-gutter: carbon--rem($eccgui-size-grid-gutter);
|
|
|
84
83
|
align-self: center;
|
|
85
84
|
}
|
|
86
85
|
|
|
87
|
-
.#{$eccgui}-grid__row--
|
|
88
|
-
|
|
86
|
+
.#{$eccgui}-grid__row--dontwrapcolumns {
|
|
87
|
+
@media (min-width: 42rem) { // Carbon breakpoint for medium viewports
|
|
88
|
+
flex-wrap: nowrap;
|
|
89
|
+
}
|
|
89
90
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Grid, GridRow, GridColumn } from "../../../../index";
|
|
4
|
+
import { Default as RowExample } from "./GridRow.stories";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Grid",
|
|
8
|
+
component: Grid,
|
|
9
|
+
subcomponents: { GridRow, GridColumn },
|
|
10
|
+
argTypes: {
|
|
11
|
+
children: {
|
|
12
|
+
control: "none",
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
} as ComponentMeta<typeof Grid>;
|
|
16
|
+
|
|
17
|
+
const Template: ComponentStory<typeof Grid> = (args) => (
|
|
18
|
+
<div style={{ minHeight: "30vh", position: "relative"}}>
|
|
19
|
+
<Grid {...args} />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const Default = Template.bind({});
|
|
24
|
+
Default.args = {
|
|
25
|
+
children: <GridRow {...RowExample.args} verticalStretched />,
|
|
26
|
+
verticalStretchable: true,
|
|
27
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { LoremIpsum } from 'react-lorem-ipsum';
|
|
4
|
+
import { Grid, GridRow, GridColumn, HtmlContentBlock } from "../../../../index";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Grid/Column",
|
|
8
|
+
component: GridColumn,
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: "none",
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
} as ComponentMeta<typeof GridColumn>;
|
|
15
|
+
|
|
16
|
+
const Template: ComponentStory<typeof GridColumn> = (args) => (
|
|
17
|
+
<Grid>
|
|
18
|
+
<GridRow>
|
|
19
|
+
<GridColumn {...args} />
|
|
20
|
+
</GridRow>
|
|
21
|
+
</Grid>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
Default.args = {
|
|
26
|
+
children: (
|
|
27
|
+
<HtmlContentBlock>
|
|
28
|
+
<h2>This is a column.</h2>
|
|
29
|
+
<LoremIpsum p={2} avgSentencesPerParagraph={3} random={false} />
|
|
30
|
+
</HtmlContentBlock>
|
|
31
|
+
),
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const otherColumn = (
|
|
35
|
+
<GridColumn>
|
|
36
|
+
<HtmlContentBlock>
|
|
37
|
+
<h2>This is another column.</h2>
|
|
38
|
+
<LoremIpsum p={3} avgSentencesPerParagraph={2} random={false} />
|
|
39
|
+
</HtmlContentBlock>
|
|
40
|
+
</GridColumn>
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
const TemplateWidths: ComponentStory<typeof GridColumn> = (args) => (
|
|
44
|
+
<Grid>
|
|
45
|
+
<GridRow>
|
|
46
|
+
<GridColumn {...args} />
|
|
47
|
+
</GridRow>
|
|
48
|
+
<GridRow>
|
|
49
|
+
<GridColumn {...args} />
|
|
50
|
+
{ otherColumn }
|
|
51
|
+
</GridRow>
|
|
52
|
+
<GridRow>
|
|
53
|
+
<GridColumn {...args} medium />
|
|
54
|
+
{ otherColumn }
|
|
55
|
+
</GridRow>
|
|
56
|
+
<GridRow>
|
|
57
|
+
<GridColumn {...args} small />
|
|
58
|
+
{ otherColumn }
|
|
59
|
+
</GridRow>
|
|
60
|
+
</Grid>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const Widths = TemplateWidths.bind({});
|
|
64
|
+
Widths.args = {
|
|
65
|
+
...Default.args
|
|
66
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Grid, GridRow, GridColumn } from "../../../../index";
|
|
4
|
+
import { Default as ColumnExample } from "./GridColumn.stories";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: "Components/Grid/Row",
|
|
8
|
+
component: GridRow,
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: "none",
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
} as ComponentMeta<typeof GridRow>;
|
|
15
|
+
|
|
16
|
+
const Template: ComponentStory<typeof GridRow> = (args) => (
|
|
17
|
+
<Grid style={{minHeight: "30vh"}} verticalStretchable>
|
|
18
|
+
<GridRow {...args} />
|
|
19
|
+
</Grid>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const Default = Template.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
children: <GridColumn {...ColumnExample.args} verticalAlign="center" />,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const TemplateStretched: ComponentStory<typeof GridRow> = (args) => (
|
|
28
|
+
<Grid style={{minHeight: "50vh"}} verticalStretchable>
|
|
29
|
+
<GridRow {...args}>
|
|
30
|
+
<GridColumn>Top row.</GridColumn>
|
|
31
|
+
</GridRow>
|
|
32
|
+
<GridRow {...args} verticalStretched>
|
|
33
|
+
<GridColumn verticalAlign="center">Stretched row.</GridColumn>
|
|
34
|
+
</GridRow>
|
|
35
|
+
<GridRow {...args} verticalStretched>
|
|
36
|
+
<GridColumn verticalAlign="center">Stretched row.</GridColumn>
|
|
37
|
+
</GridRow>
|
|
38
|
+
<GridRow {...args}>
|
|
39
|
+
<GridColumn>Bottom row.</GridColumn>
|
|
40
|
+
</GridRow>
|
|
41
|
+
</Grid>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export const VerticalStretched = TemplateStretched.bind({});
|
|
45
|
+
VerticalStretched.args = {
|
|
46
|
+
...Default.args
|
|
47
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconProps as CarbonIconProps } from "carbon-components-react";
|
|
3
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
4
|
+
import { IntentTypes } from "../../common/Intent";
|
|
5
|
+
import Tooltip, { TooltipProps } from "./../Tooltip/Tooltip";
|
|
6
|
+
import { CarbonIconType } from "./canonicalIconNames"
|
|
7
|
+
|
|
8
|
+
export interface BaseIconProps extends Omit<CarbonIconProps, "icon" | "description" | "name"> {
|
|
9
|
+
/**
|
|
10
|
+
* Carbon icon component that is used.
|
|
11
|
+
*/
|
|
12
|
+
iconComponent: CarbonIconType;
|
|
13
|
+
/**
|
|
14
|
+
* Add tooltip text to icon
|
|
15
|
+
*/
|
|
16
|
+
tooltipText?: string,
|
|
17
|
+
/**
|
|
18
|
+
* Intent state of icon.
|
|
19
|
+
* Currently only `success`, `info`, `warning` and `danger` are implemented for icons, even there are more states available.
|
|
20
|
+
*/
|
|
21
|
+
intent?: IntentTypes
|
|
22
|
+
/**
|
|
23
|
+
* Display large icon version.
|
|
24
|
+
*/
|
|
25
|
+
large?: boolean,
|
|
26
|
+
/**
|
|
27
|
+
* Display small icon version.
|
|
28
|
+
*/
|
|
29
|
+
small?: boolean,
|
|
30
|
+
/**
|
|
31
|
+
* Additional CSS classes.
|
|
32
|
+
*/
|
|
33
|
+
className?: string,
|
|
34
|
+
/**
|
|
35
|
+
* Description for icon as accessibility fallback.
|
|
36
|
+
*/
|
|
37
|
+
description?: string,
|
|
38
|
+
/**
|
|
39
|
+
* Additonal tooltip properties, e.g. `hoverOpenDelay`.
|
|
40
|
+
*/
|
|
41
|
+
tooltipProps?: Partial<Omit<TooltipProps, "content" | "children">>,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The base icon provides the basic functionality that is necessary to wrap the Carbon icon component.
|
|
46
|
+
*/
|
|
47
|
+
function BaseIcon({
|
|
48
|
+
iconComponent,
|
|
49
|
+
className = "",
|
|
50
|
+
large = false,
|
|
51
|
+
small = false,
|
|
52
|
+
tooltipText,
|
|
53
|
+
tooltipProps,
|
|
54
|
+
intent,
|
|
55
|
+
description,
|
|
56
|
+
...restProps
|
|
57
|
+
}: BaseIconProps) {
|
|
58
|
+
let sizeConfig = { height: 20, width: 20, size: 20 };
|
|
59
|
+
if (small) sizeConfig = { height: 16, width: 16, size: 16 };
|
|
60
|
+
if (large) sizeConfig = { height: 32, width: 32, size: 32 };
|
|
61
|
+
const CarbonIconNamed = iconComponent;
|
|
62
|
+
|
|
63
|
+
const icon = (
|
|
64
|
+
<CarbonIconNamed
|
|
65
|
+
{...restProps}
|
|
66
|
+
{...sizeConfig}
|
|
67
|
+
description={ description ?? (tooltipText ?? "")}
|
|
68
|
+
className={
|
|
69
|
+
`${eccgui}-icon` +
|
|
70
|
+
(intent ? ` ${eccgui}-intent--${intent}` : "") +
|
|
71
|
+
(!!className ? ` ${className}` : "")
|
|
72
|
+
}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
return tooltipText ? (
|
|
76
|
+
<Tooltip content={tooltipText} {...tooltipProps}>
|
|
77
|
+
<span>{icon}</span>
|
|
78
|
+
</Tooltip>
|
|
79
|
+
) : (
|
|
80
|
+
icon
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default BaseIcon;
|