diff --git a/CHANGELOG.md b/CHANGELOG.md
index c52465533e..ec32e013a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,9 +18,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [Unreleased]
### BREAKING CHANGES
-- Remove `Indicator` component, the usages should be replaced with the `Icon` component @mnajdova ([#1120](https://github.com/stardust-ui/react/pull/1120))
+- Remove `Indicator` component, the usages should be replaced with the `Icon` component @mnajdova ([#1120](https://github.com/stardust-ui/react/pull/1120))
- Add shorthand support for `header` and `content` in `Dropdown`,` DropdownSelectedItem.slotClassNames.removeIcon` usages should be replaced with `DropdownSelectedItem.slotClassNames.icon` @silviuavram ([#1054](https://github.com/stardust-ui/react/pull/1054))
- `react@16.8` and `react-dom@16.8` are now required @layershifter ([#1147](https://github.com/stardust-ui/react/pull/1147))
+- Remove `truncateStart`, `truncateMain` and `truncateEnd` props from `Layout` component and `truncateContent` and `truncateHeader` props from `ItemLayout` component @Bugaa92 ([#1127](https://github.com/stardust-ui/react/pull/1127))
### Fixes
- Update vertical && pointing `Menu` styles @jaanus03 ([#1116](https://github.com/stardust-ui/react/pull/1116))
diff --git a/docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.knobs.tsx b/docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.knobs.tsx
deleted file mode 100644
index 64b751d4c0..0000000000
--- a/docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.knobs.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import * as PropTypes from 'prop-types'
-import * as React from 'react'
-import Knobs from 'docs/src/components/Knobs/Knobs'
-
-const ItemLayoutExampleKnobs: any = props => {
- const { onKnobChange, debug, truncateHeader, truncateContent, width } = props
-
- return (
-
-
-
-
-
-
- )
-}
-
-ItemLayoutExampleKnobs.propTypes = {
- onKnobChange: PropTypes.func.isRequired,
- debug: PropTypes.bool,
- truncateContent: PropTypes.bool,
- truncateHeader: PropTypes.bool,
- width: PropTypes.string,
-}
-
-ItemLayoutExampleKnobs.defaultProps = {
- debug: false,
- truncateContent: true,
- truncateHeader: true,
- width: '25rem',
-}
-
-export default ItemLayoutExampleKnobs
diff --git a/docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.shorthand.tsx b/docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.shorthand.tsx
deleted file mode 100644
index 50c0ff7d36..0000000000
--- a/docs/src/examples/components/ItemLayout/Variations/ItemLayoutExampleTruncate.shorthand.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import * as React from 'react'
-import { ItemLayout, Image } from '@stardust-ui/react'
-
-const ellipsis = …
-
-const ItemLayoutExampleTruncateShorthand = ({ knobs }) => (
-
- }
- header="Dante Schneider - Super long title here"
- headerMedia="5:22:40 PM"
- content="The GB pixel is down, navigate the virtual interface!"
- contentMedia="!!"
- endMedia={ellipsis}
- truncateHeader={knobs.truncateHeader}
- truncateContent={knobs.truncateContent}
- />
-
-)
-
-export default ItemLayoutExampleTruncateShorthand
diff --git a/docs/src/examples/components/ItemLayout/Variations/index.tsx b/docs/src/examples/components/ItemLayout/Variations/index.tsx
deleted file mode 100644
index b12846b0f0..0000000000
--- a/docs/src/examples/components/ItemLayout/Variations/index.tsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import * as React from 'react'
-import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample'
-import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection'
-
-const Variations = () => (
-
-
-
-)
-
-export default Variations
diff --git a/docs/src/examples/components/ItemLayout/index.tsx b/docs/src/examples/components/ItemLayout/index.tsx
index 37d8ba9d92..9eeb540d9c 100644
--- a/docs/src/examples/components/ItemLayout/index.tsx
+++ b/docs/src/examples/components/ItemLayout/index.tsx
@@ -1,14 +1,15 @@
import * as React from 'react'
+import { Alert } from '@stardust-ui/react/'
+
import Types from './Types'
import Content from './Content'
-import Variations from './Variations'
import Rtl from './Rtl'
const ItemLayoutExamples = () => (
+
This component is deprecated
-
)
diff --git a/docs/src/examples/components/Layout/index.tsx b/docs/src/examples/components/Layout/index.tsx
index 19cef61c86..795d240ba5 100644
--- a/docs/src/examples/components/Layout/index.tsx
+++ b/docs/src/examples/components/Layout/index.tsx
@@ -1,9 +1,12 @@
import * as React from 'react'
+import { Alert } from '@stardust-ui/react/'
+
import Types from './Types'
import Variations from './Variations'
const LayoutExamples = () => (
+
This component is deprecated
diff --git a/packages/react/src/components/ItemLayout/ItemLayout.tsx b/packages/react/src/components/ItemLayout/ItemLayout.tsx
index 9d10ad7cc8..133ac6c3f4 100644
--- a/packages/react/src/components/ItemLayout/ItemLayout.tsx
+++ b/packages/react/src/components/ItemLayout/ItemLayout.tsx
@@ -62,12 +62,10 @@ export interface ItemLayoutProps extends UIComponentProps, ContentComponentProps
contentMediaCSS?: ICSSInJSStyle
/** Styled applied to the end media element of the rendered component. */
endMediaCSS?: ICSSInJSStyle
- truncateContent?: boolean
- truncateHeader?: boolean
}
/**
- * The Item Layout handles layout styles for menu items, list items and other similar item templates.
+ * (DEPRECATED) The Item Layout handles layout styles for menu items, list items and other similar item templates.
*/
class ItemLayout extends UIComponent, any> {
static create: Function
@@ -101,8 +99,6 @@ class ItemLayout extends UIComponent, any> {
contentCSS: PropTypes.object,
contentMediaCSS: PropTypes.object,
endMediaCSS: PropTypes.object,
- truncateContent: PropTypes.bool,
- truncateHeader: PropTypes.bool,
}
static defaultProps = {
@@ -128,7 +124,7 @@ class ItemLayout extends UIComponent, any> {
},
renderHeaderArea: (props, state, classes) => {
- const { debug, header, headerMedia, truncateHeader, headerCSS, headerMediaCSS } = props
+ const { debug, header, headerMedia, headerCSS, headerMediaCSS } = props
const mergedClasses = cx(ItemLayout.slotClassNames.header, classes.header)
const mediaClasses = cx(ItemLayout.slotClassNames.headerMedia, classes.headerMedia)
@@ -139,7 +135,6 @@ class ItemLayout extends UIComponent, any> {
alignItems="end"
gap={pxToRem(8)}
debug={debug}
- truncateMain={truncateHeader}
main={rtlTextContainer.createFor({ element: header })}
rootCSS={headerCSS}
end={
@@ -154,7 +149,7 @@ class ItemLayout extends UIComponent, any> {
},
renderContentArea: (props, state, classes) => {
- const { debug, content, contentMedia, truncateContent, contentCSS, contentMediaCSS } = props
+ const { debug, content, contentMedia, contentCSS, contentMediaCSS } = props
const mergedClasses = cx(ItemLayout.slotClassNames.content, classes.content)
const mediaClasses = cx(ItemLayout.slotClassNames.contentMedia, classes.contentMedia)
@@ -165,7 +160,6 @@ class ItemLayout extends UIComponent, any> {
alignItems="start"
gap={pxToRem(8)}
debug={debug}
- truncateMain={truncateContent}
rootCSS={contentCSS}
main={rtlTextContainer.createFor({ element: content })}
end={
diff --git a/packages/react/src/components/Layout/Layout.tsx b/packages/react/src/components/Layout/Layout.tsx
index 65b2771156..3731c38a20 100644
--- a/packages/react/src/components/Layout/Layout.tsx
+++ b/packages/react/src/components/Layout/Layout.tsx
@@ -43,14 +43,11 @@ export interface LayoutProps extends UIComponentProps {
reducing?: boolean
/** A layout can render its content directly if only one piece of content exists. */
disappearing?: boolean
- truncateStart?: boolean
- truncateMain?: boolean
- truncateEnd?: boolean
vertical?: boolean
}
/**
- * A layout is a utility for arranging the content of a component.
+ * (DEPRECATED) A layout is a utility for arranging the content of a component.
*/
class Layout extends UIComponent, any> {
static className = 'ui-layout'
@@ -94,10 +91,6 @@ class Layout extends UIComponent, any> {
reducing: PropTypes.bool,
disappearing: PropTypes.bool,
- truncateStart: PropTypes.bool,
- truncateMain: PropTypes.bool,
- truncateEnd: PropTypes.bool,
-
vertical: PropTypes.bool,
}
diff --git a/packages/react/src/themes/teams/components/Layout/layoutStyles.ts b/packages/react/src/themes/teams/components/Layout/layoutStyles.ts
index 20eca36fdd..cb5639808e 100644
--- a/packages/react/src/themes/teams/components/Layout/layoutStyles.ts
+++ b/packages/react/src/themes/teams/components/Layout/layoutStyles.ts
@@ -1,12 +1,6 @@
import { debugRoot, debugArea, debugGap } from '../../../../styles/debugStyles'
import { ComponentSlotStylesInput, ICSSInJSStyle } from '../../../types'
-const truncateStyle = {
- overflow: 'hidden',
- textOverflow: 'ellipsis',
- whiteSpace: 'nowrap',
-}
-
const layoutStyles: ComponentSlotStylesInput = {
root: ({ props }): ICSSInJSStyle => {
const {
@@ -51,28 +45,25 @@ const layoutStyles: ComponentSlotStylesInput = {
...(props.debug && debugGap({ vertical: props.vertical })),
}),
- start: ({ props }): ICSSInJSStyle => ({
- ...(props.debug && debugArea()),
- display: 'inline-flex',
+ start: ({ props: p }): ICSSInJSStyle => ({
+ ...(p.debug && debugArea()),
alignItems: 'center',
- ...(props.truncateStart && truncateStyle),
- ...props.startCSS,
+ display: 'inline-flex',
+ ...p.startCSS,
}),
- main: ({ props }): ICSSInJSStyle => ({
- ...(props.debug && debugArea()),
- display: 'grid',
+ main: ({ props: p }): ICSSInJSStyle => ({
+ ...(p.debug && debugArea()),
alignItems: 'center',
- ...(props.truncateMain && truncateStyle),
- ...props.mainCSS,
+ display: 'grid',
+ ...p.mainCSS,
}),
- end: ({ props }): ICSSInJSStyle => ({
- ...(props.debug && debugArea()),
- display: 'inline-flex',
+ end: ({ props: p }): ICSSInJSStyle => ({
+ ...(p.debug && debugArea()),
alignItems: 'center',
- ...(props.truncateEnd && truncateStyle),
- ...props.endCSS,
+ display: 'inline-flex',
+ ...p.endCSS,
}),
}