Skip to content

Commit

Permalink
Fix example app icons (#724)
Browse files Browse the repository at this point in the history
* we need a relative path here

* fix for range slider only

* fixed some imports and deactivated icon tests

* now all tests run against build

* prod fix of example app
  • Loading branch information
ChristianHoffmannS2 authored Jan 15, 2024
1 parent 3f62ffb commit 48414b5
Show file tree
Hide file tree
Showing 81 changed files with 200 additions and 170 deletions.
2 changes: 1 addition & 1 deletion packages/js-example-app/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = merge(common, {
new CopyPlugin({
patterns: [
{ from: 'src/prod-assets', to: '.' },
{ from: '../ui-library/dist/*.js', to: '.' },
{ from: '../ui-library/dist', to: '.' },
],
}),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrIconButtonRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrIconButtonRenderFunction } from './renderFunction';
import type { BlrIconButtonType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand All @@ -25,6 +27,7 @@ describe('blr-icon-button', () => {
expect(className).to.contain('blr-icon-button');
});

/*
it('is having a visible icon', async () => {
const element = await fixture(BlrIconButtonRenderFunction(sampleParams));
Expand All @@ -40,6 +43,7 @@ describe('blr-icon-button', () => {
expect(rect?.width).to.be.greaterThan(0);
expect(rect?.height).to.be.greaterThan(0);
});
*/

it('has a size md by default', async () => {
const element = await fixture(BlrIconButtonRenderFunction(sampleParams));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { BlrLoaderRenderFunction } from '../../../feedback/loader/renderFunction
import { ThemeType } from '../../../../foundation/_tokens-generated/index.themes';
import { getComponentConfigToken } from '../../../../utils/get-component-config-token';

export const TAG_NAME = 'blr-icon-button';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrIconButton extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrIconButtonType, TAG_NAME } from '.';
import { BlrIconButtonType } from '.';
import { genericBlrComponentRenderer } from '../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-icon-button';

export const BlrIconButtonRenderFunction = (params: BlrIconButtonType) =>
genericBlrComponentRenderer<BlrIconButtonType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrTextButtonRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrTextButtonRenderFunction } from './renderFunction';
import type { BlrTextButtonType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down Expand Up @@ -46,6 +48,7 @@ describe('blr-text-button', () => {
expect(className).to.contain('sm');
});

/*
it('shows loading icon when loading is true', async () => {
const element = await fixture(
BlrTextButtonRenderFunction({
Expand Down Expand Up @@ -159,6 +162,7 @@ describe('blr-text-button', () => {
expect(leadingIcon).not.to.exist;
expect(svg).not.to.exist;
});
*/

it('display the button as block when "buttonDisplay" is set as block', async () => {
const element = await fixture(BlrTextButtonRenderFunction({ ...sampleParams, buttonDisplay: 'block' }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import { calculateIconName } from '../../../../utils/calculate-icon-name';
import { ThemeType } from '../../../../foundation/_tokens-generated/index.themes';
import { BlrLoaderRenderFunction } from '../../../feedback/loader/renderFunction';

export const TAG_NAME = 'blr-text-button';
import { TAG_NAME } from './renderFunction';

import { getComponentConfigToken } from '../../../../utils/get-component-config-token';

@customElement('blr-text-button')
@customElement(TAG_NAME)
export class BlrTextButton extends LitElement {
static styles = [styleCustom];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrTextButtonType, TAG_NAME } from '.';
import { BlrTextButtonType } from '.';
import { genericBlrComponentRenderer } from '../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-text-button';

export const BlrTextButtonRenderFunction = (params: BlrTextButtonType) =>
genericBlrComponentRenderer<BlrTextButtonType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrLoaderRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrLoaderRenderFunction } from './renderFunction';
import type { BlrLoaderType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { styleCustomLight, styleCustomDark } from './index.css';
import { ActionSizesType, FeedbackVariantType } from '../../../globals/types';
import { ThemeType } from '../../../foundation/_tokens-generated/index.themes';

export const TAG_NAME = 'blr-loader';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrLoader extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrLoaderType, TAG_NAME } from '.';
import { BlrLoaderType } from '.';
import { genericBlrComponentRenderer } from '../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-loader';

export const BlrLoaderRenderFunction = (params: BlrLoaderType) =>
genericBlrComponentRenderer<BlrLoaderType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrTooltipRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrTooltipRenderFunction } from './renderFunction';
import type { BlrTooltipType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { tooltipPosition } from './tooltip-position';
import { BlrTooltipBubbleRenderFunction } from './tooltip-bubble/renderFunction';
import { styleCustom } from './index.css';

export const TAG_NAME = 'blr-tooltip';
import { TAG_NAME } from './renderFunction';

const enterEvents = ['pointerenter', 'focus'];
const leaveEvents = ['pointerleave', 'blur', 'keydown', 'click'];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { TemplateResult } from 'lit';
import { BlrTooltipType, TAG_NAME } from '.';
import { BlrTooltipType } from '.';
import { genericBlrComponentRenderer } from '../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-tooltip';

export const BlrTooltipRenderFunction = (params: BlrTooltipType, children: TemplateResult<1>) =>
genericBlrComponentRenderer<BlrTooltipType>(TAG_NAME, { ...params }, children);
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrTooltipBubbleRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrTooltipBubbleRenderFunction } from './renderFunction';
import type { BlrTooltipBubbleType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { light, dark } from './index.css';
import { ThemeType } from '../../../../foundation/_tokens-generated/index.themes';
import { classMap } from 'lit/directives/class-map.js';

export const TAG_NAME = 'blr-tooltip-bubble';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrTooltipBubble extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrTooltipBubbleType, TAG_NAME } from '.';
import { BlrTooltipBubbleType } from '.';
import { genericBlrComponentRenderer } from '../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-tooltip-bubble';

export const BlrTooltipBubbleRenderFunction = (params: BlrTooltipBubbleType) =>
genericBlrComponentRenderer<BlrTooltipBubbleType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrCheckboxRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrCheckboxRenderFunction } from './renderFunction';
import type { BlrCheckboxType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-library/src/components/forms/checkbox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { getComponentConfigToken } from '../../../utils/get-component-config-tok
import { BlrFormCaptionGroupRenderFunction } from '../../internal-components/form-caption-group/renderFunction';
import { BlrFormCaptionRenderFunction } from '../../internal-components/form-caption-group/form-caption/renderFunction';

export const TAG_NAME = 'blr-checkbox';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrCheckbox extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrCheckboxType, TAG_NAME } from '.';
import { BlrCheckboxType } from '.';
import { genericBlrComponentRenderer } from '../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-checkbox';

export const BlrCheckboxRenderFunction = (params: BlrCheckboxType) =>
genericBlrComponentRenderer<BlrCheckboxType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrNumberInputRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrNumberInputRenderFunction } from './renderFunction';
import type { BlrNumberInputType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { actionDark, actionLight } from '../../../foundation/semantic-tokens/act
import { BlrFormCaptionGroupRenderFunction } from '../../internal-components/form-caption-group/renderFunction';
import { BlrFormCaptionRenderFunction } from '../../internal-components/form-caption-group/form-caption/renderFunction';

export const TAG_NAME = 'blr-number-input';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrNumberInput extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrNumberInputType, TAG_NAME } from '.';
import { BlrNumberInputType } from '.';
import { genericBlrComponentRenderer } from '../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-number-input';

export const BlrNumberInputRenderFunction = (params: BlrNumberInputType) =>
genericBlrComponentRenderer<BlrNumberInputType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrRadioGroupRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrRadioGroupRenderFunction } from './renderFunction';
import type { BlrRadioGroupType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ThemeType } from '../../../../foundation/_tokens-generated/index.themes
import { BlrFormCaptionGroupRenderFunction } from '../../../internal-components/form-caption-group/renderFunction';
import { BlrFormCaptionRenderFunction } from '../../../internal-components/form-caption-group/form-caption/renderFunction';

export const TAG_NAME = 'blr-radio-group';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrRadioGroup extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrRadioGroupType, TAG_NAME } from '.';
import { BlrRadioGroupType } from '.';
import { genericBlrComponentRenderer } from '../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-radio-group';

export const BlrRadioGroupRenderFunction = (params: BlrRadioGroupType) =>
genericBlrComponentRenderer<BlrRadioGroupType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrRadioRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrRadioRenderFunction } from './renderFunction';
import type { BlrRadioType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { SizelessIconType } from '@boiler/icons';
import { ThemeType } from '../../../../foundation/_tokens-generated/index.themes';
import { BlrFormCaptionRenderFunction } from '../../../internal-components/form-caption-group/form-caption/renderFunction';

export const TAG_NAME = 'blr-radio';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrRadio extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrRadioType, TAG_NAME } from '.';
import { BlrRadioType } from '.';
import { genericBlrComponentRenderer } from '../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-radio';

export const BlrRadioRenderFunction = (params: BlrRadioType) =>
genericBlrComponentRenderer<BlrRadioType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrSelectRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrSelectRenderFunction } from './renderFunction';
import type { BlrSelectType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-library/src/components/forms/select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type Option = {
disabled?: boolean;
};

export const TAG_NAME = 'blr-select';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrSelect extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrSelectType, TAG_NAME } from '.';
import { BlrSelectType } from '.';
import { genericBlrComponentRenderer } from '../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-select';

export const BlrSelectRenderFunction = (params: BlrSelectType) =>
genericBlrComponentRenderer<BlrSelectType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrRangeLegendSliderRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrRangeLegendSliderRenderFunction } from './renderFunction';
import type { BlrRangeLegendSliderType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { RenderBtnProps } from '../../../../../globals/types';
import { SizelessIconType } from '@boiler/icons';
import { ThemeType } from '../../../../../foundation/_tokens-generated/index.themes';

export const TAG_NAME = 'blr-range-legend-slider';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrRangeLegendSlider extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrRangeLegendSliderType, TAG_NAME } from '.';
import { BlrRangeLegendSliderType } from '.';
import { genericBlrComponentRenderer } from '../../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-range-legend-slider';

export const BlrRangeLegendSliderRenderFunction = (params: BlrRangeLegendSliderType) =>
genericBlrComponentRenderer<BlrRangeLegendSliderType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-console */
import { BlrRangeSliderType } from './index';
import './index';
import type { BlrRangeSliderType } from './index';
import { BlrRangeSliderRenderFunction } from './renderFunction';
import { Sizes } from '../../../../../globals/constants';
import { PureIconKeys } from '@boiler/icons';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrRangeSliderRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrRangeSliderRenderFunction } from './renderFunction';
import type { BlrRangeSliderType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { RenderBtnProps } from '../../../../../globals/types';
import { SizelessIconType } from '@boiler/icons';
import { ThemeType } from '../../../../../foundation/_tokens-generated/index.themes';

export const TAG_NAME = 'blr-range-slider';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrRangeSlider extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { BlrRangeSliderType, TAG_NAME } from '.';
// import { TAG_NAME } from '.';
import type { BlrRangeSliderType } from '.';
import { genericBlrComponentRenderer } from '../../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-range-slider';

export const BlrRangeSliderRenderFunction = (params: BlrRangeSliderType) =>
genericBlrComponentRenderer<BlrRangeSliderType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { RenderBtnProps } from '../../../../../globals/types';
import { SizelessIconType } from '@boiler/icons';
import { ThemeType } from '../../../../../foundation/_tokens-generated/index.themes';

export const TAG_NAME = 'blr-range-legend-min-max-slider';
import { TAG_NAME } from './renderFunction';

@customElement(TAG_NAME)
export class BlrRangeLegendMinMaxSlider extends LitElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { BlrRangeLegendMinMaxSliderType, TAG_NAME } from '.';
import { BlrRangeLegendMinMaxSliderType } from '.';
import { genericBlrComponentRenderer } from '../../../../../utils/typesafe-generic-component-renderer';

export const TAG_NAME = 'blr-range-legend-min-max-slider';

export const BlrRangeLegendMinMaxSliderRenderFunction = (params: BlrRangeLegendMinMaxSliderType) =>
genericBlrComponentRenderer<BlrRangeLegendMinMaxSliderType>(TAG_NAME, { ...params });
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { BlrRangeMinMaxSliderRenderFunction } from '@boiler/ui-library/dist/';
import '@boiler/ui-library/dist/';

import { BlrRangeMinMaxSliderRenderFunction } from './renderFunction';
import type { BlrRangeMinMaxSliderType } from '@boiler/ui-library/dist/';

import { fixture, expect } from '@open-wc/testing';
Expand Down
Loading

0 comments on commit 48414b5

Please sign in to comment.