@justeattakeaway/pie-webc-core 0.17.1 → 0.18.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.
@@ -1,7 +1,7 @@
1
- vite v4.3.9 building for production...
1
+ vite v4.5.2 building for production...
2
2
  transforming...
3
- ✓ 11 modules transformed.
3
+ ✓ 13 modules transformed.
4
4
  rendering chunks...
5
5
  computing gzip size...
6
- dist/index.js 2.40 kB │ gzip: 1.09 kB
7
- ✓ built in 198ms
6
+ dist/index.js 2.41 kB │ gzip: 1.10 kB
7
+ ✓ built in 229ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [Added] - PIEInputElement interface ([#1257](https://github.com/justeattakeaway/pie/pull/1257)) by [@fernandofranca](https://github.com/fernandofranca)
8
+
3
9
  ## 0.17.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,32 +1,5 @@
1
1
  import { isServer as l } from "lit";
2
- const a = (e) => {
3
- class t extends e {
4
- /**
5
- * A getter to determine whether the text direction is right-to-left (RTL).
6
- * If the `dir` property is present on the component, it will be used to determine the text direction.
7
- * If running on the client-side (not SSR) and the `dir` property is not present, the text direction will be inferred
8
- * from the document's root element. This inference is not available during SSR.
9
- * In all other cases, it will return `false`, indicating a left-to-right (LTR) text direction.
10
- *
11
- * @returns {boolean} - Returns `true` if the text direction is RTL, otherwise `false`.
12
- */
13
- get isRTL() {
14
- return this.dir ? this.dir === "rtl" : !l && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
15
- }
16
- }
17
- return t;
18
- }, d = (e) => {
19
- class t extends e {
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- constructor(...i) {
22
- super(...i), this._internals = this.attachInternals();
23
- }
24
- get form() {
25
- return this._internals.form;
26
- }
27
- }
28
- return t.formAssociated = !0, t;
29
- }, f = (e, t, n) => function(o, r) {
2
+ const a = (e, t, n) => function(o, r) {
30
3
  const s = `#${r}`;
31
4
  Object.defineProperty(o, r, {
32
5
  get() {
@@ -41,7 +14,7 @@ const a = (e) => {
41
14
  },
42
15
  configurable: !0
43
16
  });
44
- }, m = (e) => function(n, i) {
17
+ }, d = (e) => function(n, i) {
45
18
  const o = `#${i}`;
46
19
  Object.defineProperty(n, i, {
47
20
  get() {
@@ -53,10 +26,10 @@ const a = (e) => {
53
26
  configurable: !0
54
27
  });
55
28
  };
56
- function b(e, t) {
29
+ function f(e, t) {
57
30
  customElements.get(e) ? console.warn(`PIE Web Component: "${e}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(e, t);
58
31
  }
59
- function p(e) {
32
+ function m(e) {
60
33
  return new CustomEvent(e.type, {
61
34
  detail: {
62
35
  sourceEvent: e
@@ -65,11 +38,39 @@ function p(e) {
65
38
  cancelable: e.cancelable
66
39
  });
67
40
  }
41
+ const b = (e) => {
42
+ class t extends e {
43
+ /**
44
+ * A getter to determine whether the text direction is right-to-left (RTL).
45
+ * If the `dir` property is present on the component, it will be used to determine the text direction.
46
+ * If running on the client-side (not SSR) and the `dir` property is not present, the text direction will be inferred
47
+ * from the document's root element. This inference is not available during SSR.
48
+ * In all other cases, it will return `false`, indicating a left-to-right (LTR) text direction.
49
+ *
50
+ * @returns {boolean} - Returns `true` if the text direction is RTL, otherwise `false`.
51
+ */
52
+ get isRTL() {
53
+ return this.dir ? this.dir === "rtl" : !l && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
54
+ }
55
+ }
56
+ return t;
57
+ }, p = (e) => {
58
+ class t extends e {
59
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
+ constructor(...i) {
61
+ super(...i), this._internals = this.attachInternals();
62
+ }
63
+ get form() {
64
+ return this._internals.form;
65
+ }
66
+ }
67
+ return t.formAssociated = !0, t;
68
+ };
68
69
  export {
69
- d as FormControlMixin,
70
- a as RtlMixin,
71
- b as defineCustomElement,
72
- m as requiredProperty,
73
- f as validPropertyValues,
74
- p as wrapNativeEvent
70
+ p as FormControlMixin,
71
+ b as RtlMixin,
72
+ f as defineCustomElement,
73
+ d as requiredProperty,
74
+ a as validPropertyValues,
75
+ m as wrapNativeEvent
75
76
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-webc-core",
3
- "version": "0.17.1",
3
+ "version": "0.18.0",
4
4
  "description": "PIE design system base classes, mixins and utilities for web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "build": "run -T vite build",
11
11
  "lint:scripts": "run -T eslint .",
12
12
  "lint:scripts:fix": "run -T eslint . --fix",
13
- "test": "run -T vitest run",
13
+ "test": "run -T vitest run --config ../../../vite.config.js",
14
14
  "test:ci": "yarn test",
15
15
  "test:browsers": "npx playwright test -c ./playwright-lit.config.ts",
16
16
  "test:browsers:ci": "yarn test:browsers",
@@ -20,7 +20,7 @@
20
20
  "lit": "3.1.1"
21
21
  },
22
22
  "devDependencies": {
23
- "@justeattakeaway/pie-components-config": "0.9.0"
23
+ "@justeattakeaway/pie-components-config": "0.11.0"
24
24
  },
25
25
  "volta": {
26
26
  "extends": "../../../package.json"
package/src/index.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from './mixins';
2
1
  export * from './decorators';
3
2
  export * from './functions';
3
+ export * from './interfaces';
4
+ export * from './mixins';
@@ -0,0 +1 @@
1
+ export * from './pie-input-element';
@@ -0,0 +1,3 @@
1
+ export interface PIEInputElement {
2
+ focusTarget: HTMLElement;
3
+ }
package/vite.config.js CHANGED
@@ -13,7 +13,13 @@ export default defineConfig({
13
13
  },
14
14
  },
15
15
  test: {
16
+ dir: '.',
16
17
  environment: 'jsdom',
17
- exclude: ['**/*.browser.spec.ts'],
18
+ globals: true,
19
+ exclude: [
20
+ '**/test/{accessibility,component,system,visual}/*.spec.{js,ts}',
21
+ '**/test/mixins/**/*.browser.spec.{js,ts}',
22
+ '**/node_modules/**/*'
23
+ ],
18
24
  },
19
25
  });