Skip to content

Commit f037bac

Browse files
committed
style OS in AT
1 parent ffb1bcb commit f037bac

File tree

4 files changed

+19
-15
lines changed

4 files changed

+19
-15
lines changed

.storybook/preview-head.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,19 @@
176176
padding-block: 0;
177177
}
178178

179-
/* TODO remove this workaround as soon as https://github.com/storybookjs/storybook/issues/20497 is fixed */
180-
.docs-story > div > div[scale] {
181-
min-height: 20px;
182-
height: auto;
183-
}
184-
179+
/*ObjectStatus "InListOrTable" story */
185180
.interactive-table-row:active .object-status,
186-
.interactive-analytical-table [role='row']:active .object-status,
187181
.interactive-li[active] .object-status {
188182
--ui5wcr-object-status-icon-color: var(--sapList_Active_TextColor);
189183
color: var(--sapList_Active_TextColor);
190184
text-shadow: none;
191185
}
186+
187+
/* TODO remove this workaround as soon as https://github.com/storybookjs/storybook/issues/20497 is fixed */
188+
.docs-story > div > div[scale] {
189+
min-height: 20px;
190+
height: auto;
191+
}
192192
</style>
193193
<script data-ui5-config type="application/json">
194194
{

packages/main/src/components/AnalyticalTable/AnalyticalTable.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,15 @@
184184
& [data-component-name='ObjectStatus'][data-inverted='false']:not([data-state^='Indication']) {
185185
--ui5wcr-object-status-icon-color: var(--sapContent_ContrastTextColor);
186186
color: var(--sapContent_ContrastTextColor);
187+
text-shadow: none;
187188
}
188189
}
189190
}
191+
.trActive:active [data-component-name='ObjectStatus'][data-inverted='false'] {
192+
--ui5wcr-object-status-icon-color: var(--sapList_Active_TextColor);
193+
color: var(--sapList_Active_TextColor);
194+
text-shadow: none;
195+
}
190196

191197
.trActive {
192198
cursor: pointer;

packages/main/src/components/ObjectStatus/ObjectStatus.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ import * as ComponentStories from './ObjectStatus.stories';
4444

4545
**Applicable since v2.17.0**
4646

47-
When a normal (non-inverted) `ObjectStatus` is used in interactive lists or tables, you can override the text and icon `color` and `text-shadow` to comply with design specs.
47+
The `AnalyticalTable` component includes active state styling for `ObjectStatus` out of the box, as it is developed within project and can be styled accordingly.
48+
For lists or tables from `@ui5/webcomponents(-fiori/-ai/-compat)` (e.g., `List`, `Table`), custom CSS is required to override the text and icon `color` and `text-shadow` to ensure proper styling when rows are in active state:
4849

4950
```css
5051
.object-status {
@@ -62,7 +63,6 @@ When a normal (non-inverted) `ObjectStatus` is used in interactive lists or tabl
6263

6364
```css
6465
.interactive-table-row:active .object-status,
65-
.interactive-analytical-table [role='row']:active .object-status,
6666
.interactive-li[active] .object-status {
6767
--ui5wcr-object-status-icon-color: var(--sapList_Active_TextColor);
6868
color: var(--sapList_Active_TextColor);
@@ -77,12 +77,12 @@ When a normal (non-inverted) `ObjectStatus` is used in interactive lists or tabl
7777
{
7878
accessor: 'os1',
7979
Header: 'ObjectStatus (controllable)',
80-
Cell: () => <ObjectStatus {...objectStatusProps} className={'object-status'} />,
80+
Cell: () => <ObjectStatus {...objectStatusProps} />,
8181
},
8282
{
8383
accessor: 'os2',
8484
Header: 'ObjectStatus ("Negative")',
85-
Cell: () => <ObjectStatus {...objectStatusProps} className={'object-status'} state={'Negative'} />,
85+
Cell: () => <ObjectStatus {...objectStatusProps} state={'Negative'} />,
8686
},
8787
],
8888
[objectStatusProps],
@@ -123,7 +123,6 @@ When a normal (non-inverted) `ObjectStatus` is used in interactive lists or tabl
123123
minRows={1}
124124
selectionMode={'Single'}
125125
selectionBehavior={'RowOnly'}
126-
className="interactive-analytical-table"
127126
/>
128127
</>
129128
);

packages/main/src/components/ObjectStatus/ObjectStatus.stories.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ export const InListOrTable: Story = {
160160
{
161161
accessor: 'os1',
162162
Header: 'ObjectStatus (controllable)',
163-
Cell: () => <ObjectStatus {...args} className={'object-status'} />,
163+
Cell: () => <ObjectStatus {...args} />,
164164
},
165165
{
166166
accessor: 'os2',
167167
Header: 'ObjectStatus ("Negative")',
168-
Cell: () => <ObjectStatus {...args} className={'object-status'} state={'Negative'} />,
168+
Cell: () => <ObjectStatus {...args} state={'Negative'} />,
169169
},
170170
],
171171
[args],
@@ -206,7 +206,6 @@ export const InListOrTable: Story = {
206206
minRows={1}
207207
selectionMode={'Single'}
208208
selectionBehavior={'RowOnly'}
209-
className="interactive-analytical-table"
210209
/>
211210
</>
212211
);

0 commit comments

Comments
 (0)