@nl-design-system-community/clippy-components 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/clippy-button/index.d.ts +25 -0
  2. package/dist/clippy-button/index.d.ts.map +1 -0
  3. package/dist/clippy-button/index.js +9 -0
  4. package/dist/clippy-code/index.d.ts +13 -0
  5. package/dist/clippy-code/index.d.ts.map +1 -0
  6. package/dist/clippy-code/index.js +21 -0
  7. package/dist/clippy-color-combobox/index.d.ts +46 -0
  8. package/dist/clippy-color-combobox/index.d.ts.map +1 -0
  9. package/dist/clippy-color-combobox/index.js +10 -0
  10. package/dist/clippy-color-combobox/lib.d.ts +19 -0
  11. package/dist/clippy-color-combobox/lib.d.ts.map +1 -0
  12. package/dist/clippy-color-combobox/messages/en.d.ts +10 -0
  13. package/dist/clippy-color-combobox/messages/en.d.ts.map +1 -0
  14. package/dist/clippy-color-combobox/messages/nl.d.ts +10 -0
  15. package/dist/clippy-color-combobox/messages/nl.d.ts.map +1 -0
  16. package/dist/clippy-combobox/index.d.ts +17 -23
  17. package/dist/clippy-combobox/index.d.ts.map +1 -0
  18. package/dist/clippy-combobox/index.js +8 -315
  19. package/dist/clippy-font-combobox/external.d.ts +3 -6
  20. package/dist/clippy-font-combobox/external.d.ts.map +1 -0
  21. package/dist/clippy-font-combobox/index.d.ts +9 -3
  22. package/dist/clippy-font-combobox/index.d.ts.map +1 -0
  23. package/dist/clippy-font-combobox/index.js +56 -34
  24. package/dist/clippy-heading/index.d.ts +14 -0
  25. package/dist/clippy-heading/index.d.ts.map +1 -0
  26. package/dist/clippy-heading/index.js +262 -0
  27. package/dist/clippy-html-image/index.d.ts +1 -0
  28. package/dist/clippy-html-image/index.d.ts.map +1 -0
  29. package/dist/clippy-html-image/index.js +11 -8
  30. package/dist/clippy-icon/index.d.ts +26 -0
  31. package/dist/clippy-icon/index.d.ts.map +1 -0
  32. package/dist/clippy-icon/index.js +40 -0
  33. package/dist/clippy-lang-combobox/index.d.ts +43 -0
  34. package/dist/clippy-lang-combobox/index.d.ts.map +1 -0
  35. package/dist/clippy-lang-combobox/index.js +290 -0
  36. package/dist/clippy-lang-combobox/languages.d.ts +202 -0
  37. package/dist/clippy-lang-combobox/languages.d.ts.map +1 -0
  38. package/dist/clippy-modal/index.d.ts +1 -0
  39. package/dist/clippy-modal/index.d.ts.map +1 -0
  40. package/dist/clippy-modal/index.js +85 -69
  41. package/dist/decorators-BGpMqJ7V.js +7 -0
  42. package/dist/en-B-D8DBsf.js +4 -0
  43. package/dist/external-Dtf6f6DP.js +4 -0
  44. package/dist/index-CT1z3SFL.js +106 -0
  45. package/dist/index-CaVpiaBC.js +52 -0
  46. package/dist/index-CmKtM5nD.js +379 -0
  47. package/dist/index-CtreqNZ6.js +3602 -0
  48. package/dist/index-D3FiqptQ.js +65 -0
  49. package/dist/lib/FormElement/index.d.ts +17 -0
  50. package/dist/lib/FormElement/index.d.ts.map +1 -0
  51. package/dist/lib/LocalizationMixin/index.d.ts +29 -0
  52. package/dist/lib/LocalizationMixin/index.d.ts.map +1 -0
  53. package/dist/lib/converters/index.d.ts +6 -0
  54. package/dist/lib/converters/index.d.ts.map +1 -0
  55. package/dist/lib/decorators.d.ts +12 -0
  56. package/dist/lib/decorators.d.ts.map +1 -0
  57. package/dist/nl-CJG2-yS5.js +11 -0
  58. package/package.json +13 -7
  59. package/dist/clippy-font-combobox/google-fonts.json.d.ts +0 -33283
  60. package/dist/external-lwd0iv80.js +0 -8
  61. package/dist/index.d.ts +0 -0
@@ -0,0 +1,65 @@
1
+ var y = (e) => {
2
+ throw TypeError(e);
3
+ };
4
+ var d = (e, r, t) => r.has(e) || y("Cannot " + t);
5
+ var u = (e, r, t) => (d(e, r, "read from private field"), t ? t.call(e) : r.get(e)), b = (e, r, t) => r.has(e) ? y("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), c = (e, r, t, s) => (d(e, r, "write to private field"), s ? s.call(e, t) : r.set(e, t), t);
6
+ import { LitElement as m } from "lit";
7
+ import { property as a } from "lit/decorators.js";
8
+ var _ = Object.defineProperty, g = Object.getOwnPropertyDescriptor, l = (e, r, t, s) => {
9
+ for (var o = s > 1 ? void 0 : s ? g(r, t) : r, p = e.length - 1, h; p >= 0; p--)
10
+ (h = e[p]) && (o = (s ? h(r, t, o) : h(o)) || o);
11
+ return s && o && _(r, t, o), o;
12
+ }, i;
13
+ const f = class f extends m {
14
+ constructor() {
15
+ super(...arguments);
16
+ b(this, i);
17
+ this.name = "", this.hiddenLabel = "", this.disabled = !1, this.readonly = !1, this.internals_ = this.attachInternals(), c(this, i, null);
18
+ }
19
+ set value(t) {
20
+ u(this, i) !== t && (c(this, i, t), this.internals_.setFormValue(this.valueToFormValue(t)));
21
+ }
22
+ get value() {
23
+ return u(this, i);
24
+ }
25
+ /**
26
+ * Override this function to customize how the value is converted to a form value;
27
+ */
28
+ valueToFormValue(t) {
29
+ switch (!0) {
30
+ /* eslint-disable eqeqeq -- loose equality will also return null for undefined */
31
+ case t == null:
32
+ return null;
33
+ case (typeof t == "string" || t instanceof File):
34
+ return t;
35
+ case typeof t == "object":
36
+ try {
37
+ return JSON.stringify(t);
38
+ } catch {
39
+ return null;
40
+ }
41
+ default:
42
+ return String(t);
43
+ }
44
+ }
45
+ };
46
+ i = new WeakMap(), f.formAssociated = !0;
47
+ let n = f;
48
+ l([
49
+ a()
50
+ ], n.prototype, "name", 2);
51
+ l([
52
+ a({ attribute: "hidden-label" })
53
+ ], n.prototype, "hiddenLabel", 2);
54
+ l([
55
+ a({ type: Boolean })
56
+ ], n.prototype, "disabled", 2);
57
+ l([
58
+ a({ type: Boolean })
59
+ ], n.prototype, "readonly", 2);
60
+ l([
61
+ a()
62
+ ], n.prototype, "value", 1);
63
+ export {
64
+ n as F
65
+ };
@@ -0,0 +1,17 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class FormElement<V = unknown> extends LitElement {
3
+ #private;
4
+ name: string;
5
+ hiddenLabel: string;
6
+ disabled: boolean;
7
+ readonly: boolean;
8
+ internals_: ElementInternals;
9
+ static readonly formAssociated = true;
10
+ set value(value: V | null);
11
+ get value(): V | null;
12
+ /**
13
+ * Override this function to customize how the value is converted to a form value;
14
+ */
15
+ valueToFormValue(value: V | null): string | File | null;
16
+ }
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/FormElement/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAGjC,qBAAa,WAAW,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,UAAU;;IAC1C,IAAI,SAAM;IACmB,WAAW,SAAM;IAC7B,QAAQ,UAAS;IACjB,QAAQ,UAAS;IAC9C,UAAU,mBAA0B;IAGpC,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC,IACI,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAKxB;IAED,IAAI,KAAK,IAAI,CAAC,GAAG,IAAI,CAEpB;IAED;;OAEG;IACH,gBAAgB,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI;CAiBxD"}
@@ -0,0 +1,29 @@
1
+ import { LitElement } from 'lit';
2
+ type Constructor<T> = new (...args: any[]) => T;
3
+ /**
4
+ * Proper typing dictates some specific patterns as defined in Lit documentation.
5
+ * @see https://lit.dev/docs/composition/mixins/#mixins-in-typescript
6
+ */
7
+ declare class LocalizationMixinInterface {
8
+ static readonly DEFAULT_LANG: string;
9
+ get DEFAULT_LANG(): typeof LocalizationMixinInterface.DEFAULT_LANG;
10
+ get lang(): string;
11
+ set lang(value: string);
12
+ }
13
+ /**
14
+ * Ensures that the component has a `lang` property that can be used for other functionality.
15
+ * On connection, it attempts to determine the language by checking:
16
+ * 1. The component's `lang` attribute.
17
+ * 2. The closest ancestor element with a `lang` attribute.
18
+ * 3. `DEFAULT_LANG`.
19
+ *
20
+ * The `lang` property is decorated with `@property()` for Lit reactivity.
21
+ *
22
+ * @template T - The base class type, which must extend LitElement.
23
+ * @param superClass - The base class to extend.
24
+ * @param defaultLang - The default language (`en` when no value supplied).
25
+ * @returns A new class extending the base class with localization capabilities.
26
+ */
27
+ declare const LocalizationMixin: <T extends Constructor<LitElement>>(superClass: T, defaultLang?: "en") => Constructor<LocalizationMixinInterface> & T;
28
+ export default LocalizationMixin;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/LocalizationMixin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjC,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAIhD;;;GAGG;AACH,OAAO,OAAO,0BAA0B;IACtC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IACrC,IAAI,YAAY,IAAI,OAAO,0BAA0B,CAAC,YAAY,CAAC;IACnE,IAAI,IAAI,IAAI,MAAM,CAAC;IACnB,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,iBAAiB,GAAI,CAAC,SAAS,WAAW,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC,EAAE,kBAA0B,KAwCpE,WAAW,CAAC,0BAA0B,CAAC,GAAG,CAC5E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { ComplexAttributeConverter } from 'lit';
2
+ type AttributeConverterFrom<T> = NonNullable<ComplexAttributeConverter<T>['fromAttribute']>;
3
+ export declare const arrayFromTokenList: AttributeConverterFrom<Array<unknown> | null>;
4
+ export declare const arrayFromCommaList: AttributeConverterFrom<Array<unknown> | null>;
5
+ export {};
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/converters/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,KAAK,CAAC;AAErD,KAAK,sBAAsB,CAAC,CAAC,IAAI,WAAW,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;AAqB5F,eAAO,MAAM,kBAAkB,EAAE,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAA+B,CAAC;AAC7G,eAAO,MAAM,kBAAkB,EAAE,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAA6B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Custom element decorator with safety check that prevents duplicate registrations.
3
+ *
4
+ * This decorator provides the same functionality as Lit's @customElement but adds
5
+ * a safety check to prevent "already defined" errors when the same element is
6
+ * registered multiple times (e.g., in hot module reloading scenarios).
7
+ *
8
+ * @param tagName - The custom element tag name
9
+ * @returns A class decorator function
10
+ */
11
+ export declare const safeCustomElement: (tagName: string) => (target: CustomElementConstructor) => void;
12
+ //# sourceMappingURL=decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/lib/decorators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,MACvC,QAAQ,wBAAwB,KAAG,IAM5C,CAAC"}
@@ -0,0 +1,11 @@
1
+ const E = {
2
+ RED: "rood",
3
+ ORANGE: "oranje",
4
+ YELLOW: "geel",
5
+ GREEN: "groen",
6
+ BLUE: "blauw",
7
+ PURPLE: "paars"
8
+ };
9
+ export {
10
+ E as default
11
+ };
package/package.json CHANGED
@@ -1,17 +1,15 @@
1
1
  {
2
2
  "name": "@nl-design-system-community/clippy-components",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "exports": {
7
- ".": {
8
- "types": "./dist/index.d.ts",
9
- "import": "./dist/index.js"
10
- },
11
7
  "./*": {
12
8
  "import": "./dist/*/index.js",
13
9
  "types": "./dist/*/index.d.ts"
14
- }
10
+ },
11
+ "./src/*": "./src/*",
12
+ "./assets/*": "./assets/*"
15
13
  },
16
14
  "files": [
17
15
  "dist/"
@@ -27,15 +25,22 @@
27
25
  },
28
26
  "dependencies": {
29
27
  "@amsterdam/design-system-css": "2.2.0",
28
+ "@nl-design-system-candidate/button-css": "1.0.0",
29
+ "@nl-design-system-candidate/code-css": "2.0.3",
30
+ "@nl-design-system-candidate/color-sample-css": "1.0.4",
31
+ "@nl-design-system-candidate/heading-css": "1.1.3",
32
+ "@tabler/icons": "3.36.0",
30
33
  "@utrecht/button-css": "3.0.1",
31
34
  "@utrecht/combobox-css": "2.0.1",
32
35
  "@utrecht/listbox-css": "2.0.1",
33
36
  "@utrecht/textbox-css": "3.0.1",
37
+ "colorjs.io": "0.6.0-beta.3",
34
38
  "lit": "3.3.2",
35
39
  "memoize": "10.2.0"
36
40
  },
37
41
  "devDependencies": {
38
42
  "@types/dlv": "1.1.5",
43
+ "@types/react": "18.3.23",
39
44
  "@vitest/browser-playwright": "4.0.16",
40
45
  "@vitest/coverage-v8": "4.0.16",
41
46
  "glob": "13.0.0",
@@ -48,9 +53,10 @@
48
53
  "vitest": "4.0.16"
49
54
  },
50
55
  "scripts": {
51
- "dev": "vite build --watch",
56
+ "dev": "vite build --watch --mode development",
52
57
  "types": "tsc -p tsconfig.json --emitDeclarationOnly",
53
58
  "type-check": "tsc --noEmit --project tsconfig.json",
59
+ "prebuild": "node --env-file-if-exists=.env ./scripts/download-font-list.ts",
54
60
  "build": "pnpm run type-check && vite build",
55
61
  "clean": "rimraf dist/",
56
62
  "lint": "pnpm run --sequential '/^lint:.+$/'",