diff --git a/package-lock.json b/package-lock.json index d5a2b457b..e4ee70aff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22834,7 +22834,7 @@ "@storybook/web-components": "^8.6.12", "@storybook/web-components-vite": "^8.6.12", "@timkendrick/monaco-editor": "^0.0.9", - "@types/jest": "^29.5.10", + "@types/jest": "^29.5.14", "@typescript-eslint/eslint-plugin": "^8.30.1", "@typescript-eslint/parser": "^8.30.1", "@typescript-eslint/rule-tester": "^8.30.1", diff --git a/packages/stencil-library/.storybook/main.ts b/packages/stencil-library/.storybook/main.ts index fff4ce5cc..f4e8b5422 100644 --- a/packages/stencil-library/.storybook/main.ts +++ b/packages/stencil-library/.storybook/main.ts @@ -1,5 +1,4 @@ import type { StorybookConfig } from '@storybook/web-components-vite'; - import { join, dirname } from "path" /** @@ -12,7 +11,7 @@ function getAbsolutePath(value: string): any { const config: StorybookConfig = { "stories": [ "../src/**/*.mdx", - "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)", + "../src/components/**/*.stories.@(js|jsx|mjs|ts|tsx)", ], "addons": [ getAbsolutePath('@storybook/addon-essentials'), diff --git a/packages/stencil-library/eslint.config.ts b/packages/stencil-library/eslint.config.ts index e2be5eeb6..fb79f9382 100644 --- a/packages/stencil-library/eslint.config.ts +++ b/packages/stencil-library/eslint.config.ts @@ -36,6 +36,9 @@ export default (tseslint.config( ".storybook/**/*", "eslint.config.ts", "stencil.config.ts", + "storybook-static", + "types", + "vite.config.ts", ], }, { diff --git a/packages/stencil-library/package.json b/packages/stencil-library/package.json index 9f3406331..50bfa1953 100644 --- a/packages/stencil-library/package.json +++ b/packages/stencil-library/package.json @@ -55,8 +55,8 @@ "devDependencies": { "@chromatic-com/storybook": "^3.1.0", "@eslint/js": "^9.24.0", - "@stencil/eslint-plugin": "1.0.0", "@stencil/core": "4.29.3", + "@stencil/eslint-plugin": "1.0.0", "@stencil/react-output-target": "^0.5.1", "@stencil/sass": "^3.0.4", "@storybook/addon-a11y": "^8.6.12", @@ -68,7 +68,7 @@ "@storybook/web-components": "^8.6.12", "@storybook/web-components-vite": "^8.6.12", "@timkendrick/monaco-editor": "^0.0.9", - "@types/jest": "^29.5.10", + "@types/jest": "^29.5.14", "@typescript-eslint/eslint-plugin": "^8.30.1", "@typescript-eslint/parser": "^8.30.1", "@typescript-eslint/rule-tester": "^8.30.1", diff --git a/packages/stencil-library/src/components/dnn-autocomplete/dnn-button.stories.ts b/packages/stencil-library/src/components/dnn-autocomplete/dnn-autocomplete.stories.ts similarity index 84% rename from packages/stencil-library/src/components/dnn-autocomplete/dnn-button.stories.ts rename to packages/stencil-library/src/components/dnn-autocomplete/dnn-autocomplete.stories.ts index d0cf4eb42..77f17e5ee 100644 --- a/packages/stencil-library/src/components/dnn-autocomplete/dnn-button.stories.ts +++ b/packages/stencil-library/src/components/dnn-autocomplete/dnn-autocomplete.stories.ts @@ -1,10 +1,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; -import { html, LitElement } from 'lit'; -import { customElement, state } from 'lit/decorators.js'; -import { ifDefined } from 'lit-html/directives/if-defined.js'; -import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; +import { html } from 'lit'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/AutoComplete', @@ -13,7 +10,7 @@ const meta: Meta = { parameters: { docs: { description: { - component: readme.default, + component: readme, } } }, diff --git a/packages/stencil-library/src/components/dnn-button/dnn-button.stories.ts b/packages/stencil-library/src/components/dnn-button/dnn-button.stories.ts index 6e8ff2cf6..e3777721d 100644 --- a/packages/stencil-library/src/components/dnn-button/dnn-button.stories.ts +++ b/packages/stencil-library/src/components/dnn-button/dnn-button.stories.ts @@ -3,7 +3,7 @@ import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Button', diff --git a/packages/stencil-library/src/components/dnn-checkbox/dnn-checkbox.stories.ts b/packages/stencil-library/src/components/dnn-checkbox/dnn-checkbox.stories.ts index b6ea02e77..128154f9d 100644 --- a/packages/stencil-library/src/components/dnn-checkbox/dnn-checkbox.stories.ts +++ b/packages/stencil-library/src/components/dnn-checkbox/dnn-checkbox.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta : Meta = { title: 'Elements/Checkbox', diff --git a/packages/stencil-library/src/components/dnn-chevron/dnn-chevron.stories.ts b/packages/stencil-library/src/components/dnn-chevron/dnn-chevron.stories.ts index 85af98b28..c26aeb06f 100644 --- a/packages/stencil-library/src/components/dnn-chevron/dnn-chevron.stories.ts +++ b/packages/stencil-library/src/components/dnn-chevron/dnn-chevron.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta : Meta = { diff --git a/packages/stencil-library/src/components/dnn-collapsible/dnn-collapsible.stories.ts b/packages/stencil-library/src/components/dnn-collapsible/dnn-collapsible.stories.ts index 6ee587d9f..a459f87a5 100644 --- a/packages/stencil-library/src/components/dnn-collapsible/dnn-collapsible.stories.ts +++ b/packages/stencil-library/src/components/dnn-collapsible/dnn-collapsible.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: "Elements/Collapsible", diff --git a/packages/stencil-library/src/components/dnn-color-input/dnn-color-input.stories.ts b/packages/stencil-library/src/components/dnn-color-input/dnn-color-input.stories.ts index cd7708c05..1ea3a5f24 100644 --- a/packages/stencil-library/src/components/dnn-color-input/dnn-color-input.stories.ts +++ b/packages/stencil-library/src/components/dnn-color-input/dnn-color-input.stories.ts @@ -3,7 +3,7 @@ import { html, nothing, TemplateResult } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Color Input', diff --git a/packages/stencil-library/src/components/dnn-color-picker/dnn-color-picker.stories.ts b/packages/stencil-library/src/components/dnn-color-picker/dnn-color-picker.stories.ts index a88bf0518..5a161d422 100644 --- a/packages/stencil-library/src/components/dnn-color-picker/dnn-color-picker.stories.ts +++ b/packages/stencil-library/src/components/dnn-color-picker/dnn-color-picker.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/components/dnn-dropzone/dnn-dropzone.stories.ts b/packages/stencil-library/src/components/dnn-dropzone/dnn-dropzone.stories.ts index 0707e5e35..508b3b5ca 100644 --- a/packages/stencil-library/src/components/dnn-dropzone/dnn-dropzone.stories.ts +++ b/packages/stencil-library/src/components/dnn-dropzone/dnn-dropzone.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/components/dnn-image-cropper/dnn-image-cropper.stories.ts b/packages/stencil-library/src/components/dnn-image-cropper/dnn-image-cropper.stories.ts index 452f3b1d2..44f65a66c 100644 --- a/packages/stencil-library/src/components/dnn-image-cropper/dnn-image-cropper.stories.ts +++ b/packages/stencil-library/src/components/dnn-image-cropper/dnn-image-cropper.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Image Cropper', diff --git a/packages/stencil-library/src/components/dnn-input/dnn-input.stories.ts b/packages/stencil-library/src/components/dnn-input/dnn-input.stories.ts index f3153fd6b..c2787b039 100644 --- a/packages/stencil-library/src/components/dnn-input/dnn-input.stories.ts +++ b/packages/stencil-library/src/components/dnn-input/dnn-input.stories.ts @@ -3,7 +3,7 @@ import { html, nothing, TemplateResult } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Input', diff --git a/packages/stencil-library/src/components/dnn-modal/dnn-modal.stories.ts b/packages/stencil-library/src/components/dnn-modal/dnn-modal.stories.ts index e5973d489..52f7331df 100644 --- a/packages/stencil-library/src/components/dnn-modal/dnn-modal.stories.ts +++ b/packages/stencil-library/src/components/dnn-modal/dnn-modal.stories.ts @@ -3,7 +3,7 @@ import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Modal', diff --git a/packages/stencil-library/src/components/dnn-permissions-grid/dnn-permissions-grid.stories.ts b/packages/stencil-library/src/components/dnn-permissions-grid/dnn-permissions-grid.stories.ts index 7610cf1ac..1e7bcc68c 100644 --- a/packages/stencil-library/src/components/dnn-permissions-grid/dnn-permissions-grid.stories.ts +++ b/packages/stencil-library/src/components/dnn-permissions-grid/dnn-permissions-grid.stories.ts @@ -4,7 +4,7 @@ import { IPermissions } from "./permissions-interface"; import { IRoleGroup } from "./role-group-interface"; import { IRole } from "./role-interface"; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: "Elements/Permissions Grid", diff --git a/packages/stencil-library/src/components/dnn-progress-bar/dnn-progress-bar.stories.ts b/packages/stencil-library/src/components/dnn-progress-bar/dnn-progress-bar.stories.ts index e7a920b96..2ecb42801 100644 --- a/packages/stencil-library/src/components/dnn-progress-bar/dnn-progress-bar.stories.ts +++ b/packages/stencil-library/src/components/dnn-progress-bar/dnn-progress-bar.stories.ts @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Progress Bar', diff --git a/packages/stencil-library/src/components/dnn-richtext/dnn-richtext.tsx b/packages/stencil-library/src/components/dnn-richtext/dnn-richtext.tsx index 8350d0ef7..c3f134272 100644 --- a/packages/stencil-library/src/components/dnn-richtext/dnn-richtext.tsx +++ b/packages/stencil-library/src/components/dnn-richtext/dnn-richtext.tsx @@ -7,7 +7,7 @@ import { DeepPartial } from 'jodit/types/types'; @Component({ tag: 'dnn-richtext', styleUrl: 'dnn-richtext.scss', - shadow: true, + shadow: false, formAssociated: true, }) export class DnnRichtext { diff --git a/packages/stencil-library/src/components/dnn-searchbox/dnn-searchbox.stories.ts b/packages/stencil-library/src/components/dnn-searchbox/dnn-searchbox.stories.ts index ac0c0c5da..acd9dde69 100644 --- a/packages/stencil-library/src/components/dnn-searchbox/dnn-searchbox.stories.ts +++ b/packages/stencil-library/src/components/dnn-searchbox/dnn-searchbox.stories.ts @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: "Elements/Searchbox", diff --git a/packages/stencil-library/src/components/dnn-select/dnn-select.stories.ts b/packages/stencil-library/src/components/dnn-select/dnn-select.stories.ts index 0b8766fae..1091e5e4b 100644 --- a/packages/stencil-library/src/components/dnn-select/dnn-select.stories.ts +++ b/packages/stencil-library/src/components/dnn-select/dnn-select.stories.ts @@ -3,7 +3,7 @@ import { html, nothing, TemplateResult } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Select', diff --git a/packages/stencil-library/src/components/dnn-sort-icon/dnn-sort-icon.stories.ts b/packages/stencil-library/src/components/dnn-sort-icon/dnn-sort-icon.stories.ts index 7cae140ca..87a386f71 100644 --- a/packages/stencil-library/src/components/dnn-sort-icon/dnn-sort-icon.stories.ts +++ b/packages/stencil-library/src/components/dnn-sort-icon/dnn-sort-icon.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from "lit"; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: "Elements/Sort Icon", diff --git a/packages/stencil-library/src/components/dnn-tab/dnn-tab.stories.ts b/packages/stencil-library/src/components/dnn-tab/dnn-tab.stories.ts index 3f5bddd83..0adde199a 100644 --- a/packages/stencil-library/src/components/dnn-tab/dnn-tab.stories.ts +++ b/packages/stencil-library/src/components/dnn-tab/dnn-tab.stories.ts @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/components/dnn-tabs/dnn-tabs.stories.ts b/packages/stencil-library/src/components/dnn-tabs/dnn-tabs.stories.ts index a02d80964..7eb1b88f7 100644 --- a/packages/stencil-library/src/components/dnn-tabs/dnn-tabs.stories.ts +++ b/packages/stencil-library/src/components/dnn-tabs/dnn-tabs.stories.ts @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/components/dnn-textarea/dnn-textarea.stories.ts b/packages/stencil-library/src/components/dnn-textarea/dnn-textarea.stories.ts index 913413309..f8f2e8041 100644 --- a/packages/stencil-library/src/components/dnn-textarea/dnn-textarea.stories.ts +++ b/packages/stencil-library/src/components/dnn-textarea/dnn-textarea.stories.ts @@ -3,7 +3,7 @@ import { html, nothing, TemplateResult } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { unsafeHTML } from 'lit-html/directives/unsafe-html.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Textarea', diff --git a/packages/stencil-library/src/components/dnn-toggle/dnn-toggle.stories.ts b/packages/stencil-library/src/components/dnn-toggle/dnn-toggle.stories.ts index fa2ac3e25..f4e697db4 100644 --- a/packages/stencil-library/src/components/dnn-toggle/dnn-toggle.stories.ts +++ b/packages/stencil-library/src/components/dnn-toggle/dnn-toggle.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/components/dnn-treeview-item/dnn-treeview-item.stories.ts b/packages/stencil-library/src/components/dnn-treeview-item/dnn-treeview-item.stories.ts index d05437a6f..1cbe912b6 100644 --- a/packages/stencil-library/src/components/dnn-treeview-item/dnn-treeview-item.stories.ts +++ b/packages/stencil-library/src/components/dnn-treeview-item/dnn-treeview-item.stories.ts @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; import exp from 'constants'; diff --git a/packages/stencil-library/src/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.stories.ts b/packages/stencil-library/src/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.stories.ts index 842ff14dc..b256cf834 100644 --- a/packages/stencil-library/src/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.stories.ts +++ b/packages/stencil-library/src/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.stories.ts @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { title: 'Elements/Vertical Overflow Menu', diff --git a/packages/stencil-library/src/components/dnn-vertical-splitview/dnn-vertical-splitview.stories.ts b/packages/stencil-library/src/components/dnn-vertical-splitview/dnn-vertical-splitview.stories.ts index ce60fed4e..ba35ff49a 100644 --- a/packages/stencil-library/src/components/dnn-vertical-splitview/dnn-vertical-splitview.stories.ts +++ b/packages/stencil-library/src/components/dnn-vertical-splitview/dnn-vertical-splitview.stories.ts @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; import { ifDefined } from 'lit-html/directives/if-defined.js'; import { actions } from '@storybook/addon-actions'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.stories.ts b/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.stories.ts index 159be873f..06fd3d60c 100644 --- a/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.stories.ts +++ b/packages/stencil-library/src/components/examples/dnn-example-form/dnn-example-form.stories.ts @@ -1,6 +1,6 @@ import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; -import readme from "./readme.md"; +import readme from "./readme.md?raw"; const meta: Meta = { diff --git a/packages/stencil-library/src/utilities/stringUtilities.ts b/packages/stencil-library/src/utilities/stringUtilities.ts index dee33f28a..9cbe30731 100644 --- a/packages/stencil-library/src/utilities/stringUtilities.ts +++ b/packages/stencil-library/src/utilities/stringUtilities.ts @@ -15,7 +15,7 @@ export function getReadableFileSizeString (fileSizeInBytes: number) : string { /** Takes an html encoded string and converts it to actual decoded html. */ export function decodeHtml(html: string) : string { - if (html != undefined){ + if (html == undefined){ return ''; } diff --git a/packages/stencil-library/types/raw-md.d.ts b/packages/stencil-library/types/raw-md.d.ts new file mode 100644 index 000000000..326840b48 --- /dev/null +++ b/packages/stencil-library/types/raw-md.d.ts @@ -0,0 +1,4 @@ +declare module '*.md?raw' { + const content: string; + export default content; +} \ No newline at end of file diff --git a/packages/stencil-library/vite.config.ts b/packages/stencil-library/vite.config.ts new file mode 100644 index 000000000..c254e8a2c --- /dev/null +++ b/packages/stencil-library/vite.config.ts @@ -0,0 +1,5 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + assetsInclude: ['**/*.md'], +}); \ No newline at end of file