Skip to content

Commit 9c2673d

Browse files
committed
chore(138): use nlds candidate css
1 parent 279f741 commit 9c2673d

File tree

7 files changed

+71
-71
lines changed

7 files changed

+71
-71
lines changed

packages/editor/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
},
3535
"dependencies": {
3636
"@lit/context": "1.1.6",
37+
"@nl-design-system-candidate/button-css": "1.0.0",
38+
"@nl-design-system-candidate/link-css": "2.0.3",
3739
"@nl-design-system-candidate/number-badge-css": "1.1.4",
3840
"@tabler/icons": "3.35.0",
3941
"@tiptap/core": "3.11.1",
@@ -55,7 +57,6 @@
5557
"@tiptap/extension-underline": "3.11.1",
5658
"@tiptap/extensions": "3.11.1",
5759
"@tiptap/pm": "3.11.1",
58-
"@utrecht/web-component-library-stencil": "4.0.0",
5960
"lit": "3.3.1",
6061
"prosemirror-model": "1.25.4"
6162
},

packages/editor/src/components/toolbar/toolbar-image-upload/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { Editor } from '@tiptap/core';
22
import { consume } from '@lit/context';
3+
import buttonCss from '@nl-design-system-candidate/button-css/button.css?inline';
34
import PhotoIcon from '@tabler/icons/outline/photo.svg?raw';
4-
import { html, LitElement } from 'lit';
5+
import { html, LitElement, unsafeCSS } from 'lit';
56
import { customElement, property, state } from 'lit/decorators.js';
67
import { map } from 'lit/directives/map.js';
78
import { createRef, ref, type Ref } from 'lit/directives/ref.js';
@@ -13,7 +14,7 @@ import imageUploadDialogStyles from './styles.ts';
1314

1415
@customElement('clippy-toolbar-image-upload')
1516
export class ToolbarImageUpload extends LitElement {
16-
static override readonly styles = [imageUploadDialogStyles];
17+
static override readonly styles = [imageUploadDialogStyles, unsafeCSS(buttonCss)];
1718

1819
readonly #dialogRef: Ref<HTMLDialogElement> = createRef();
1920
readonly #inputRef: Ref<HTMLInputElement> = createRef();
@@ -130,7 +131,7 @@ export class ToolbarImageUpload extends LitElement {
130131
</div>
131132
</li>`,
132133
)}
133-
<button @click=${this.#insertImages}>Invoegen</button>
134+
<button class="nl-button nl-button--primary" @click=${this.#insertImages}>Invoegen</button>
134135
</dialog>
135136
`;
136137
}

packages/editor/src/components/toolbar/toolbar-link/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import type { Editor } from '@tiptap/core';
2+
import buttonCss from '@nl-design-system-candidate/button-css/button.css?inline';
23
import LinkIcon from '@tabler/icons/outline/link.svg?raw';
3-
import { html, LitElement } from 'lit';
4+
import { html, LitElement, unsafeCSS } from 'lit';
45
import { customElement, state } from 'lit/decorators.js';
56
import { createRef, ref, type Ref } from 'lit/directives/ref.js';
67
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
7-
import { editor } from '@/decorators/TipTapDecorator.ts';
88
import './../toolbar-button';
9+
import { editor } from '@/decorators/TipTapDecorator.ts';
910

1011
const tag = 'clippy-toolbar-link';
1112

@@ -17,7 +18,7 @@ declare global {
1718

1819
@customElement(tag)
1920
export class ToolbarLink extends LitElement {
20-
static override readonly styles = [];
21+
static override readonly styles = [unsafeCSS(buttonCss)];
2122

2223
readonly #dialogRef: Ref<HTMLDialogElement> = createRef();
2324
readonly #inputRef: Ref<HTMLInputElement> = createRef();
@@ -72,9 +73,13 @@ export class ToolbarLink extends LitElement {
7273
<label>Link to:<input value=${this.previousUrl} ${ref(this.#inputRef)} type="text" /></label>
7374
</div>
7475
<div>
75-
<button @click=${() => this.#dialogRef.value?.close()}>Sluiten</button>
76-
<button @click=${this.#unsetLink}>Verwijder link</button>
77-
<button @click=${this.#updateLink}>Link toevoegen</button>
76+
<button class="nl-button nl-button--secondary " @click=${() => this.#dialogRef.value?.close()}>
77+
Sluiten
78+
</button>
79+
<button class="nl-button nl-button--secondary nl-button--negative" @click=${this.#unsetLink}>
80+
Verwijder link
81+
</button>
82+
<button class="nl-button nl-button--primary" @click=${this.#updateLink}>Link toevoegen</button>
7883
</div>
7984
</dialog>
8085
`;

packages/editor/src/components/validations/drawer/validation-list-item/index.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import buttonCss from '@nl-design-system-candidate/button-css/button.css?inline';
2+
import linkCss from '@nl-design-system-candidate/link-css/link.css?inline';
13
import AlertCircleIcon from '@tabler/icons/outline/alert-circle.svg?raw';
24
import AlertTriangleIcon from '@tabler/icons/outline/alert-triangle.svg?raw';
35
import InfoCircleIcon from '@tabler/icons/outline/info-circle.svg?raw';
4-
import { LitElement, html } from 'lit';
6+
import { LitElement, html, unsafeCSS } from 'lit';
57
import { customElement, property } from 'lit/decorators.js';
68
import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
79
import type { ValidationSeverity } from '@/types/validation.ts';
@@ -10,7 +12,7 @@ import validationListItemStyles from './styles.ts';
1012

1113
@customElement('clippy-validation-list-item')
1214
export class ClippyValidationItem extends LitElement {
13-
static override readonly styles = [validationListItemStyles];
15+
static override readonly styles = [validationListItemStyles, unsafeCSS(linkCss), unsafeCSS(buttonCss)];
1416

1517
@property({ type: String }) key: string = '';
1618
@property({ type: Number }) pos: number = 0;
@@ -51,14 +53,14 @@ export class ClippyValidationItem extends LitElement {
5153
<slot name="tip-html" class="clippy-dialog__list-item-tip"></slot>
5254
${this.href
5355
? html`
54-
<div class="clippy-dialog__list-item-link">
55-
<utrecht-link href="${this.href}" target="_blank"> Uitgebreide toelichting </utrecht-link>
56-
</div>
57-
`
56+
<div class="clippy-dialog__list-item-link">
57+
<a class="nl-link" href="${this.href}" target="_blank"> Uitgebreide toelichting </anl-link>
58+
</div>
59+
`
5860
: null}
5961
<div class="clippy-dialog__list-item-actions">
60-
<utrecht-button disabled="true">Negeren</utrecht-button>
61-
<utrecht-button appearance="secondary-action-button" @click=${this.#focusNode}>Aanpassen</utrecht-button>
62+
<button class="nl-button nl-button--disabled" disabled="disabled">Negeren</button>
63+
<button class="nl-button nl-button--secondary" @click=${this.#focusNode}>Aanpassen</button>
6264
</div>
6365
</li>
6466
`;

packages/editor/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import './components/toolbar';
44
import './components/validations/gutter';
55
import './components/validations/drawer';
66
import './components/bubble-menu';
7-
import { defineCustomElements } from '@utrecht/web-component-library-stencil/loader';
87
import { LitElement, html } from 'lit';
98
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
109
import type { ValidationResult } from '@/types/validation.ts';
@@ -15,8 +14,6 @@ import editorStyles from './styles';
1514

1615
const EDITOR_ID = 'editor';
1716

18-
defineCustomElements();
19-
2017
const sanitizeTopHeadingLevel = (number: number): number => {
2118
if (!Number.isNaN(number) && number >= 1 && number <= 6) {
2219
return number;

packages/editor/test/editor-wrapper.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import type { Editor } from '@tiptap/core';
22
import { ContextProvider, Context } from '@lit/context';
3-
import { defineCustomElements } from '@utrecht/web-component-library-stencil/loader';
43
import { html, LitElement, type TemplateResult } from 'lit';
54
import { tiptapContext } from '../src/context/tiptapContext';
65
import { createTestEditor } from './createTestEditor';
76

8-
defineCustomElements();
9-
107
export class EditorTestWrapper extends LitElement {
118
static override readonly properties = {
129
editor: { attribute: false },

0 commit comments

Comments
 (0)