@uni-design-system/uni-core 0.0.23 → 0.0.24

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 (39) hide show
  1. package/dist/cjs/core/layout/index.d.ts +1 -3
  2. package/dist/cjs/core/layout/index.js +1 -3
  3. package/dist/cjs/core/layout/index.js.map +1 -1
  4. package/dist/cjs/core/layout/layout.helper.d.ts +4 -0
  5. package/dist/cjs/core/layout/layout.helper.js +25 -0
  6. package/dist/cjs/core/layout/layout.helper.js.map +1 -0
  7. package/dist/cjs/core/layout/layout.model.d.ts +1 -1
  8. package/dist/cjs/core/layout/layout.types.d.ts +1 -3
  9. package/dist/cjs/core/layout/layout.types.js +0 -2
  10. package/dist/cjs/core/layout/layout.types.js.map +1 -1
  11. package/dist/esm/core/layout/index.d.ts +1 -3
  12. package/dist/esm/core/layout/index.js +1 -3
  13. package/dist/esm/core/layout/index.js.map +1 -1
  14. package/dist/esm/core/layout/layout.helper.d.ts +4 -0
  15. package/dist/esm/core/layout/layout.helper.js +20 -0
  16. package/dist/esm/core/layout/layout.helper.js.map +1 -0
  17. package/dist/esm/core/layout/layout.model.d.ts +1 -1
  18. package/dist/esm/core/layout/layout.types.d.ts +1 -3
  19. package/dist/esm/core/layout/layout.types.js +1 -1
  20. package/dist/esm/core/layout/layout.types.js.map +1 -1
  21. package/package.json +1 -1
  22. package/dist/cjs/core/layout/breakpoint.helper.d.ts +0 -2
  23. package/dist/cjs/core/layout/breakpoint.helper.js +0 -19
  24. package/dist/cjs/core/layout/breakpoint.helper.js.map +0 -1
  25. package/dist/cjs/core/layout/breakpoint.model.d.ts +0 -4
  26. package/dist/cjs/core/layout/breakpoint.model.js +0 -3
  27. package/dist/cjs/core/layout/breakpoint.model.js.map +0 -1
  28. package/dist/cjs/core/layout/layout.records.d.ts +0 -2
  29. package/dist/cjs/core/layout/layout.records.js +0 -11
  30. package/dist/cjs/core/layout/layout.records.js.map +0 -1
  31. package/dist/esm/core/layout/breakpoint.helper.d.ts +0 -2
  32. package/dist/esm/core/layout/breakpoint.helper.js +0 -15
  33. package/dist/esm/core/layout/breakpoint.helper.js.map +0 -1
  34. package/dist/esm/core/layout/breakpoint.model.d.ts +0 -4
  35. package/dist/esm/core/layout/breakpoint.model.js +0 -2
  36. package/dist/esm/core/layout/breakpoint.model.js.map +0 -1
  37. package/dist/esm/core/layout/layout.records.d.ts +0 -2
  38. package/dist/esm/core/layout/layout.records.js +0 -8
  39. package/dist/esm/core/layout/layout.records.js.map +0 -1
@@ -1,5 +1,3 @@
1
1
  export * from './layout.types';
2
- export * from './breakpoint.helper';
3
- export * from './breakpoint.model';
4
- export * from './layout.records';
2
+ export * from './layout.helper';
5
3
  export * from './layout.model';
@@ -15,8 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./layout.types"), exports);
18
- __exportStar(require("./breakpoint.helper"), exports);
19
- __exportStar(require("./breakpoint.model"), exports);
20
- __exportStar(require("./layout.records"), exports);
18
+ __exportStar(require("./layout.helper"), exports);
21
19
  __exportStar(require("./layout.model"), exports);
22
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,sDAAoC;AACpC,qDAAmC;AACnC,mDAAiC;AACjC,iDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kDAAgC;AAChC,iDAA+B"}
@@ -0,0 +1,4 @@
1
+ import { Size } from '../core.types';
2
+ import { DeviceOrientation } from './layout.types';
3
+ export declare function getDeviceSize(height: number, width: number): Size;
4
+ export declare function getDeviceOrientation(height: number, width: number): DeviceOrientation;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeviceOrientation = exports.getDeviceSize = void 0;
4
+ function getDeviceSize(height, width) {
5
+ if (!height || !width)
6
+ return 'md';
7
+ const max = Math.max(height, width);
8
+ if (max <= 600) // Small Mobile
9
+ return 'xs';
10
+ if (max <= 960) // Large Mobile
11
+ return 'sm';
12
+ if (max <= 1264) // Tablets
13
+ return 'md';
14
+ if (max <= 1904) // Laptops & Monitors
15
+ return 'lg';
16
+ return 'xl'; // Large Monitors
17
+ }
18
+ exports.getDeviceSize = getDeviceSize;
19
+ function getDeviceOrientation(height, width) {
20
+ if (!height || !width)
21
+ return 'landscape';
22
+ return height > width ? 'portrait' : 'landscape';
23
+ }
24
+ exports.getDeviceOrientation = getDeviceOrientation;
25
+ //# sourceMappingURL=layout.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.helper.ts"],"names":[],"mappings":";;;AAGA,SAAgB,aAAa,CAAC,MAAc,EAAE,KAAa;IAEzD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,UAAU;QACzB,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,qBAAqB;QACpC,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA,CAAC,iBAAiB;AAC/B,CAAC;AAnBD,sCAmBC;AAED,SAAgB,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAEhE,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC;IAE1C,OAAO,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAA;AAElD,CAAC;AAND,oDAMC"}
@@ -1,5 +1,5 @@
1
1
  import { Size } from '../core.types';
2
2
  export interface Layout {
3
- deviseSize: Size;
3
+ deviceSize: Size;
4
4
  orientation: 'portrait' | 'landscape';
5
5
  }
@@ -1,3 +1 @@
1
- import { SizeMap } from '../core.types';
2
- export declare type elements = 'margin' | 'border' | 'padding';
3
- export declare const spacings: SizeMap;
1
+ export declare type DeviceOrientation = 'portrait' | 'landscape';
@@ -1,5 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spacings = void 0;
4
- exports.spacings = { xs: 5, sm: 8, md: 13, lg: 21, xl: 34 };
5
3
  //# sourceMappingURL=layout.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":";;;AAIa,QAAA,QAAQ,GAAY,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":""}
@@ -1,5 +1,3 @@
1
1
  export * from './layout.types';
2
- export * from './breakpoint.helper';
3
- export * from './breakpoint.model';
4
- export * from './layout.records';
2
+ export * from './layout.helper';
5
3
  export * from './layout.model';
@@ -1,6 +1,4 @@
1
1
  export * from './layout.types';
2
- export * from './breakpoint.helper';
3
- export * from './breakpoint.model';
4
- export * from './layout.records';
2
+ export * from './layout.helper';
5
3
  export * from './layout.model';
6
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Size } from '../core.types';
2
+ import { DeviceOrientation } from './layout.types';
3
+ export declare function getDeviceSize(height: number, width: number): Size;
4
+ export declare function getDeviceOrientation(height: number, width: number): DeviceOrientation;
@@ -0,0 +1,20 @@
1
+ export function getDeviceSize(height, width) {
2
+ if (!height || !width)
3
+ return 'md';
4
+ const max = Math.max(height, width);
5
+ if (max <= 600) // Small Mobile
6
+ return 'xs';
7
+ if (max <= 960) // Large Mobile
8
+ return 'sm';
9
+ if (max <= 1264) // Tablets
10
+ return 'md';
11
+ if (max <= 1904) // Laptops & Monitors
12
+ return 'lg';
13
+ return 'xl'; // Large Monitors
14
+ }
15
+ export function getDeviceOrientation(height, width) {
16
+ if (!height || !width)
17
+ return 'landscape';
18
+ return height > width ? 'portrait' : 'landscape';
19
+ }
20
+ //# sourceMappingURL=layout.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.helper.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,KAAa;IAEzD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,UAAU;QACzB,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,qBAAqB;QACpC,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA,CAAC,iBAAiB;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAEhE,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC;IAE1C,OAAO,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAA;AAElD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { Size } from '../core.types';
2
2
  export interface Layout {
3
- deviseSize: Size;
3
+ deviceSize: Size;
4
4
  orientation: 'portrait' | 'landscape';
5
5
  }
@@ -1,3 +1 @@
1
- import { SizeMap } from '../core.types';
2
- export declare type elements = 'margin' | 'border' | 'padding';
3
- export declare const spacings: SizeMap;
1
+ export declare type DeviceOrientation = 'portrait' | 'landscape';
@@ -1,2 +1,2 @@
1
- export const spacings = { xs: 5, sm: 8, md: 13, lg: 21, xl: 34 };
1
+ export {};
2
2
  //# sourceMappingURL=layout.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,QAAQ,GAAY,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC"}
1
+ {"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uni-design-system/uni-core",
3
3
  "description": "UNI Design System core dependencies.",
4
- "version": "0.0.23",
4
+ "version": "0.0.24",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/uni-design-system/uni-core.git"
@@ -1,2 +0,0 @@
1
- import { Size } from '../core.types';
2
- export declare function getScreenSize(width: number): Size;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getScreenSize = void 0;
4
- const layout_records_1 = require("./layout.records");
5
- function getScreenSize(width) {
6
- if (!width)
7
- return 'md';
8
- if (width < layout_records_1.Breakpoints['xs'])
9
- return 'xs';
10
- if (width < layout_records_1.Breakpoints['sm'])
11
- return 'sm';
12
- if (width < layout_records_1.Breakpoints['md'])
13
- return 'md';
14
- if (width < layout_records_1.Breakpoints['lg'])
15
- return 'lg';
16
- return 'xl';
17
- }
18
- exports.getScreenSize = getScreenSize;
19
- //# sourceMappingURL=breakpoint.helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoint.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.helper.ts"],"names":[],"mappings":";;;AACA,qDAA+C;AAE/C,SAAgB,aAAa,CAAC,KAAa;IAEzC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA;AACb,CAAC;AAjBD,sCAiBC"}
@@ -1,4 +0,0 @@
1
- export interface Breakpoint {
2
- maxWidthLandscape: number;
3
- minWidthLandscape: number;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=breakpoint.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoint.model.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.model.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import { SizeMap } from '../core.types';
2
- export declare const Breakpoints: SizeMap;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Breakpoints = void 0;
4
- exports.Breakpoints = {
5
- xs: 600,
6
- sm: 960,
7
- md: 1264,
8
- lg: 1904,
9
- xl: 999999
10
- };
11
- //# sourceMappingURL=layout.records.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout.records.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.records.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAY;IAClC,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,MAAM;CACX,CAAA"}
@@ -1,2 +0,0 @@
1
- import { Size } from '../core.types';
2
- export declare function getScreenSize(width: number): Size;
@@ -1,15 +0,0 @@
1
- import { Breakpoints } from './layout.records';
2
- export function getScreenSize(width) {
3
- if (!width)
4
- return 'md';
5
- if (width < Breakpoints['xs'])
6
- return 'xs';
7
- if (width < Breakpoints['sm'])
8
- return 'sm';
9
- if (width < Breakpoints['md'])
10
- return 'md';
11
- if (width < Breakpoints['lg'])
12
- return 'lg';
13
- return 'xl';
14
- }
15
- //# sourceMappingURL=breakpoint.helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoint.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,KAAa;IAEzC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -1,4 +0,0 @@
1
- export interface Breakpoint {
2
- maxWidthLandscape: number;
3
- minWidthLandscape: number;
4
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=breakpoint.model.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoint.model.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.model.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import { SizeMap } from '../core.types';
2
- export declare const Breakpoints: SizeMap;
@@ -1,8 +0,0 @@
1
- export const Breakpoints = {
2
- xs: 600,
3
- sm: 960,
4
- md: 1264,
5
- lg: 1904,
6
- xl: 999999
7
- };
8
- //# sourceMappingURL=layout.records.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"layout.records.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.records.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,MAAM;CACX,CAAA"}