Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wrap all styles in ui5-webcomponents-react css layer #6306

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions config/layers-plugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function cssLayersPlugin(opts) {
opts = opts || {};

return {
postcssPlugin: 'css-layers-plugin',
Once(root, { AtRule }) {
const layer = new AtRule({
name: 'layer',
params: 'ui5-webcomponents-react',
nodes: root.nodes
});
root.removeAll();
root.append(layer);
}
};
}

cssLayersPlugin.postcss = true;

export default cssLayersPlugin;
2 changes: 2 additions & 0 deletions config/postcss-config-factory.js
Original file line number Diff line number Diff line change
@@ -5,12 +5,14 @@ import postcssModules from 'postcss-modules';
import postcssNesting from 'postcss-nesting';
import stringHash from 'string-hash';
import postcssCSStoESM from '../scripts/postcss-css-to-esm.mjs';
import cssLayersPlugin from './layers-plugin.js';

export function postcssConfigFactory(packageName) {
return {
plugins: [
postcssImport(),
postcssNesting(),
cssLayersPlugin(),
postcssModules({
// generateScopedName: '[name]__[local]___[hash:base64:5]',
generateScopedName: function (name, filename, css) {

Unchanged files with check annotations Beta

function ResizeTestComponent({ onChange }: { onChange: (event: { width: number; height: number }) => void }) {
useEffect(() => {
attachResizeHandler(onChange);
}, []);

Check warning on line 12 in packages/base/src/Device/index.cy.tsx

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'onChange'. Either include it or remove the dependency array
const unregister = () => {
detachResizeHandler(onChange);
}) {
useEffect(() => {
attachOrientationChangeHandler(onChange);
}, []);

Check warning on line 32 in packages/base/src/Device/index.cy.tsx

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'onChange'. Either include it or remove the dependency array
const unregister = () => {
detachOrientationChangeHandler(onChange);
* @param measure {IChartMeasure} Current measure object
* @param dataElement {object} Current data element
*/
highlightColor?: (value: number, measure: MeasureConfig, dataElement: Record<string, any>) => CSSProperties['color'];

Check warning on line 79 in packages/charts/src/components/BarChart/BarChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
}
interface DimensionConfig extends IChartDimension {
? dataKeys.findIndex((key) => key === chartConfig.secondYAxis?.dataKey)
: 0;
const [componentRef, chartRef] = useSyncRef<any>(ref);

Check warning on line 189 in packages/charts/src/components/BarChart/BarChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
const onItemLegendClick = useLegendItemClick(onLegendClick);
const labelFormatter = useLabelFormatter(primaryDimension);
speed={2}
backgroundColor={ThemingParameters.sapContent_ImagePlaceholderBackground}
foregroundColor={ThemingParameters.sapContent_ImagePlaceholderForegroundColor}
backgroundOpacity={ThemingParameters.sapContent_DisabledOpacity as any}

Check warning on line 15 in packages/charts/src/components/BarChart/Placeholder.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
>
<rect x="20" y="10" width="1" height="135" />
<rect x="20" y="20" width="85" height="15" />
* @param measure {IChartMeasure} Current measure object
* @param dataElement {object} Current data element
*/
highlightColor?: (value: number, measure: MeasureConfig, dataElement: Record<string, any>) => CSSProperties['color'];

Check warning on line 69 in packages/charts/src/components/BulletChart/BulletChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
}
interface DimensionConfig extends IChartDimension {
...rest
} = props;
const [componentRef, chartRef] = useSyncRef<any>(ref);

Check warning on line 149 in packages/charts/src/components/BulletChart/BulletChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
const chartConfig: BulletChartProps['chartConfig'] = {
yAxisVisible: false,
);
} else {
onDataPointClick(
enrichEventWithDetails({} as any, {

Check warning on line 228 in packages/charts/src/components/BulletChart/BulletChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
value: eventOrIndex.value,
dataKey: eventOrIndex.dataKey,
dataIndex: eventOrIndex.index,
{chartConfig.xAxisVisible &&
dimensions.map((dimension, index) => {
let AxisComponent;
const axisProps: any = {

Check warning on line 305 in packages/charts/src/components/BulletChart/BulletChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
dataKey: dimension.accessor,
interval: dimension?.interval ?? (isBigDataSet ? 'preserveStart' : 0),
tickLine: index < 1,
/>
)}
{sortedMeasures?.map((element, index) => {
const chartElementProps: any = {

Check warning on line 443 in packages/charts/src/components/BulletChart/BulletChart.tsx

GitHub Actions / lint

Unexpected any. Specify a different type
isAnimationActive: !noAnimation
};
let labelPosition = 'top';