@uni-design-system/uni-core 0.0.31 → 0.0.33

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 (36) hide show
  1. package/README.md +19 -2
  2. package/dist/cjs/core/background/background.model.d.ts +3 -3
  3. package/dist/cjs/core/border/border.model.d.ts +11 -8
  4. package/dist/cjs/core/button/button.model.d.ts +2 -2
  5. package/dist/cjs/core/core.types.d.ts +1 -0
  6. package/dist/cjs/core/masking/masking.model.d.ts +1 -1
  7. package/dist/cjs/core/shadow/shadow.records.d.ts +1 -1
  8. package/dist/cjs/core/shadow/shadow.records.js +44 -24
  9. package/dist/cjs/core/shadow/shadow.records.js.map +1 -1
  10. package/dist/cjs/core/shadow/shadow.utils.d.ts +3 -0
  11. package/dist/cjs/core/shadow/shadow.utils.js +13 -0
  12. package/dist/cjs/core/shadow/shadow.utils.js.map +1 -0
  13. package/dist/cjs/utils/debounce.d.ts +1 -0
  14. package/dist/cjs/utils/debounce.js +14 -0
  15. package/dist/cjs/utils/debounce.js.map +1 -0
  16. package/dist/cjs/utils/index.d.ts +1 -0
  17. package/dist/cjs/utils/index.js +1 -0
  18. package/dist/cjs/utils/index.js.map +1 -1
  19. package/dist/esm/core/background/background.model.d.ts +3 -3
  20. package/dist/esm/core/border/border.model.d.ts +11 -8
  21. package/dist/esm/core/button/button.model.d.ts +2 -2
  22. package/dist/esm/core/core.types.d.ts +1 -0
  23. package/dist/esm/core/masking/masking.model.d.ts +1 -1
  24. package/dist/esm/core/shadow/shadow.records.d.ts +1 -1
  25. package/dist/esm/core/shadow/shadow.records.js +43 -23
  26. package/dist/esm/core/shadow/shadow.records.js.map +1 -1
  27. package/dist/esm/core/shadow/shadow.utils.d.ts +3 -0
  28. package/dist/esm/core/shadow/shadow.utils.js +8 -0
  29. package/dist/esm/core/shadow/shadow.utils.js.map +1 -0
  30. package/dist/esm/utils/debounce.d.ts +1 -0
  31. package/dist/esm/utils/debounce.js +10 -0
  32. package/dist/esm/utils/debounce.js.map +1 -0
  33. package/dist/esm/utils/index.d.ts +1 -0
  34. package/dist/esm/utils/index.js +1 -0
  35. package/dist/esm/utils/index.js.map +1 -1
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,21 @@
1
- # UNI Design System
1
+ <p align="center">
2
+ <a href="https://github.com/uni-design-system" target="_blank">
3
+ <img src="./.github/uni-logo.png" alt="UNI Design System">
4
+ </a>
5
+ </p>
2
6
 
3
- Uni's Core package is a library of types and models for building components in various frameworks.
7
+ <p align="center">
8
+ UNI Design System
9
+ <p>
4
10
 
11
+ <p align="center">
12
+ <a href="https://uni-design-system.github.io/uni-react/"><strong>Browse the React component library &rarr;</strong></a>
13
+ </p>
14
+
15
+ # UNI Core
16
+
17
+ UNI's Core package is a library of types, models, and functions for building UI components for various platforms.
18
+ The core system is focussed on establishing patterns that are most common in modern user interfaces while remaining framework-agnostic.
19
+ UNI Core can be used with React, Angular, Vue, and any TypeScript based system.
20
+
21
+ > **_NOTE:_** UNI Core is currently in its development phase and should be considered experimental.
@@ -3,7 +3,7 @@ import { Color } from '../color';
3
3
  import { BackgroundType } from './background.types';
4
4
  export interface Background {
5
5
  type: BackgroundType;
6
- color: Color;
7
- gradient: Gradient;
8
- image: string;
6
+ color?: Color;
7
+ gradient?: Gradient;
8
+ image?: string;
9
9
  }
@@ -1,11 +1,14 @@
1
1
  import { ColorToken } from '../color';
2
+ import { StrokeWidth } from '../core.types';
2
3
  export interface Border {
3
- colorTop: ColorToken;
4
- colorBottom: ColorToken;
5
- colorLeft: ColorToken;
6
- colorRight: ColorToken;
7
- widthTop: number;
8
- widthBottom: number;
9
- widthLeft: number;
10
- widthRight: number;
4
+ color?: ColorToken;
5
+ colorTop?: ColorToken;
6
+ colorBottom?: ColorToken;
7
+ colorLeft?: ColorToken;
8
+ colorRight?: ColorToken;
9
+ width?: StrokeWidth;
10
+ widthTop?: StrokeWidth;
11
+ widthBottom?: StrokeWidth;
12
+ widthLeft?: StrokeWidth;
13
+ widthRight?: StrokeWidth;
11
14
  }
@@ -1,12 +1,12 @@
1
1
  import { ShadowElevation } from '../shadow';
2
2
  import { ColorToken } from '../color';
3
- import { SizeMap } from '../core.types';
3
+ import { SizeMap, StrokeWidth } from '../core.types';
4
4
  import { Border } from '../border';
5
5
  export interface Button {
6
6
  color: ColorToken;
7
7
  contentColor: ColorToken;
8
8
  elevation?: ShadowElevation;
9
- borderWidth?: number;
9
+ borderWidth?: StrokeWidth;
10
10
  borderColor?: ColorToken;
11
11
  borderRadius?: number;
12
12
  borderRadii?: SizeMap;
@@ -8,3 +8,4 @@ export declare type VerticalBinary = 'top' | 'bottom';
8
8
  export declare type VerticalAlign = VerticalBinary | 'middle';
9
9
  export declare type Apply = HorizontalBinary | VerticalBinary | 'vertical' | 'horizontal' | 'all';
10
10
  export declare type RadiusApply = 'left' | 'right' | 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'all' | 'none';
11
+ export declare type StrokeWidth = string | number;
@@ -1,4 +1,4 @@
1
- import { Color } from '../color/color.model';
1
+ import { Color } from '../color';
2
2
  import { MaskingShape } from './masking.types';
3
3
  export interface Masking {
4
4
  background: Color;
@@ -1,4 +1,4 @@
1
1
  import { ShadowDefinition } from './shadow.model';
2
2
  import { ShadowElevation } from './shadow.types';
3
- export declare const ShadowCssMap: Record<ShadowElevation, string>;
4
3
  export declare const ShadowMap: Record<ShadowElevation, ShadowDefinition>;
4
+ export declare const ShadowCssMap: Record<ShadowElevation, string>;
@@ -1,54 +1,74 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShadowMap = exports.ShadowCssMap = void 0;
4
- // box-shadow: none|h-offset v-offset blur spread color
5
- exports.ShadowCssMap = {
6
- pressed: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
7
- raised: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)',
8
- focussed: '0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)',
9
- navigation: '0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22)',
10
- modal: '0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)'
11
- };
3
+ exports.ShadowCssMap = exports.ShadowMap = void 0;
4
+ const shadow_utils_1 = require("./shadow.utils");
12
5
  exports.ShadowMap = {
13
6
  pressed: {
14
7
  umbra: {
15
- offset: 1, blur: 2, opacity: 24
8
+ offset: 1,
9
+ blur: 2,
10
+ opacity: 24,
16
11
  },
17
12
  penumbra: {
18
- offset: 1, blur: 3, opacity: 12
19
- }
13
+ offset: 1,
14
+ blur: 3,
15
+ opacity: 12,
16
+ },
20
17
  },
21
18
  raised: {
22
19
  umbra: {
23
- offset: 3, blur: 6, opacity: 23
20
+ offset: 3,
21
+ blur: 6,
22
+ opacity: 23,
24
23
  },
25
24
  penumbra: {
26
- offset: 3, blur: 6, opacity: 16
27
- }
25
+ offset: 3,
26
+ blur: 6,
27
+ opacity: 16,
28
+ },
28
29
  },
29
30
  focussed: {
30
31
  umbra: {
31
- offset: 6, blur: 6, opacity: 23
32
+ offset: 6,
33
+ blur: 6,
34
+ opacity: 23,
32
35
  },
33
36
  penumbra: {
34
- offset: 10, blur: 20, opacity: 19
35
- }
37
+ offset: 10,
38
+ blur: 20,
39
+ opacity: 19,
40
+ },
36
41
  },
37
42
  navigation: {
38
43
  umbra: {
39
- offset: 10, blur: 10, opacity: 22
44
+ offset: 10,
45
+ blur: 10,
46
+ opacity: 22,
40
47
  },
41
48
  penumbra: {
42
- offset: 14, blur: 28, opacity: 25
43
- }
49
+ offset: 14,
50
+ blur: 28,
51
+ opacity: 25,
52
+ },
44
53
  },
45
54
  modal: {
46
55
  umbra: {
47
- offset: 15, blur: 12, opacity: 22
56
+ offset: 15,
57
+ blur: 12,
58
+ opacity: 22,
48
59
  },
49
60
  penumbra: {
50
- offset: 19, blur: 38, opacity: 30
51
- }
61
+ offset: 19,
62
+ blur: 38,
63
+ opacity: 30,
64
+ },
52
65
  },
53
66
  };
67
+ exports.ShadowCssMap = {
68
+ pressed: (0, shadow_utils_1.GetBoxShadows)(exports.ShadowMap['pressed']),
69
+ raised: (0, shadow_utils_1.GetBoxShadows)(exports.ShadowMap['raised']),
70
+ focussed: (0, shadow_utils_1.GetBoxShadows)(exports.ShadowMap['focussed']),
71
+ navigation: (0, shadow_utils_1.GetBoxShadows)(exports.ShadowMap['navigation']),
72
+ modal: (0, shadow_utils_1.GetBoxShadows)(exports.ShadowMap['modal']),
73
+ };
54
74
  //# sourceMappingURL=shadow.records.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadow.records.js","sourceRoot":"","sources":["../../../../src/core/shadow/shadow.records.ts"],"names":[],"mappings":";;;AAGA,uDAAuD;AAE1C,QAAA,YAAY,GAAoC;IAC3D,OAAO,EAAE,wDAAwD;IACjE,MAAM,EAAE,wDAAwD;IAChE,QAAQ,EAAE,0DAA0D;IACpE,UAAU,EAAE,4DAA4D;IACxE,KAAK,EAAE,4DAA4D;CACpE,CAAA;AAEY,QAAA,SAAS,GAA8C;IAClE,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;QACnC,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;QACnC,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;KACpC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;QACnC,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;KACtC;IACD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;QACrC,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;KACtC;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;QACrC,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;KACtC;CACF,CAAA"}
1
+ {"version":3,"file":"shadow.records.js","sourceRoot":"","sources":["../../../../src/core/shadow/shadow.records.ts"],"names":[],"mappings":";;;AAEA,iDAA+C;AAElC,QAAA,SAAS,GAA8C;IAClE,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;KACF;IACD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;KACF;CACF,CAAC;AAEW,QAAA,YAAY,GAAoC;IAC3D,OAAO,EAAE,IAAA,4BAAa,EAAC,iBAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,EAAE,IAAA,4BAAa,EAAC,iBAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,QAAQ,EAAE,IAAA,4BAAa,EAAC,iBAAS,CAAC,UAAU,CAAC,CAAC;IAC9C,UAAU,EAAE,IAAA,4BAAa,EAAC,iBAAS,CAAC,YAAY,CAAC,CAAC;IAClD,KAAK,EAAE,IAAA,4BAAa,EAAC,iBAAS,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Shadow, ShadowDefinition } from './shadow.model';
2
+ export declare const GetBoxShadow: ({ offset, blur, opacity }: Shadow) => string;
3
+ export declare const GetBoxShadows: ({ umbra, penumbra }: ShadowDefinition) => string;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetBoxShadows = exports.GetBoxShadow = void 0;
4
+ // box-shadow: none|h-offset v-offset blur spread color
5
+ const GetBoxShadow = ({ offset, blur, opacity }) => {
6
+ return `0 ${offset}px ${blur}px rgba(0,0,0,0.${opacity})`;
7
+ };
8
+ exports.GetBoxShadow = GetBoxShadow;
9
+ const GetBoxShadows = ({ umbra, penumbra }) => {
10
+ return (0, exports.GetBoxShadow)(umbra) + ', ' + (0, exports.GetBoxShadow)(penumbra);
11
+ };
12
+ exports.GetBoxShadows = GetBoxShadows;
13
+ //# sourceMappingURL=shadow.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shadow.utils.js","sourceRoot":"","sources":["../../../../src/core/shadow/shadow.utils.ts"],"names":[],"mappings":";;;AAEA,uDAAuD;AAChD,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,EAAU,EAAE;IACxE,OAAO,KAAK,MAAM,MAAM,IAAI,mBAAmB,OAAO,GAAG,CAAC;AAC5D,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEK,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAoB,EAAU,EAAE;IAC7E,OAAO,IAAA,oBAAY,EAAC,KAAK,CAAC,GAAG,IAAI,GAAG,IAAA,oBAAY,EAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB"}
@@ -0,0 +1 @@
1
+ export declare const debounce: <T extends (...args: any[]) => ReturnType<T>>(callback: T, timeout: number) => (...args: Parameters<T>) => void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.debounce = void 0;
4
+ const debounce = (callback, timeout) => {
5
+ let timer;
6
+ return (...args) => {
7
+ clearTimeout(timer);
8
+ timer = setTimeout(() => {
9
+ callback(...args);
10
+ }, timeout);
11
+ };
12
+ };
13
+ exports.debounce = debounce;
14
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../../src/utils/debounce.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,QAAW,EACX,OAAe,EACqB,EAAE;IACtC,IAAI,KAAoC,CAAC;IAEzC,OAAO,CAAC,GAAG,IAAmB,EAAE,EAAE;QAChC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YACtB,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACpB,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,QAAQ,YAYnB"}
@@ -1 +1,2 @@
1
1
  export * from './getValue';
2
+ export * from './debounce';
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./getValue"), exports);
18
+ __exportStar(require("./debounce"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,6CAA2B"}
@@ -3,7 +3,7 @@ import { Color } from '../color';
3
3
  import { BackgroundType } from './background.types';
4
4
  export interface Background {
5
5
  type: BackgroundType;
6
- color: Color;
7
- gradient: Gradient;
8
- image: string;
6
+ color?: Color;
7
+ gradient?: Gradient;
8
+ image?: string;
9
9
  }
@@ -1,11 +1,14 @@
1
1
  import { ColorToken } from '../color';
2
+ import { StrokeWidth } from '../core.types';
2
3
  export interface Border {
3
- colorTop: ColorToken;
4
- colorBottom: ColorToken;
5
- colorLeft: ColorToken;
6
- colorRight: ColorToken;
7
- widthTop: number;
8
- widthBottom: number;
9
- widthLeft: number;
10
- widthRight: number;
4
+ color?: ColorToken;
5
+ colorTop?: ColorToken;
6
+ colorBottom?: ColorToken;
7
+ colorLeft?: ColorToken;
8
+ colorRight?: ColorToken;
9
+ width?: StrokeWidth;
10
+ widthTop?: StrokeWidth;
11
+ widthBottom?: StrokeWidth;
12
+ widthLeft?: StrokeWidth;
13
+ widthRight?: StrokeWidth;
11
14
  }
@@ -1,12 +1,12 @@
1
1
  import { ShadowElevation } from '../shadow';
2
2
  import { ColorToken } from '../color';
3
- import { SizeMap } from '../core.types';
3
+ import { SizeMap, StrokeWidth } from '../core.types';
4
4
  import { Border } from '../border';
5
5
  export interface Button {
6
6
  color: ColorToken;
7
7
  contentColor: ColorToken;
8
8
  elevation?: ShadowElevation;
9
- borderWidth?: number;
9
+ borderWidth?: StrokeWidth;
10
10
  borderColor?: ColorToken;
11
11
  borderRadius?: number;
12
12
  borderRadii?: SizeMap;
@@ -8,3 +8,4 @@ export declare type VerticalBinary = 'top' | 'bottom';
8
8
  export declare type VerticalAlign = VerticalBinary | 'middle';
9
9
  export declare type Apply = HorizontalBinary | VerticalBinary | 'vertical' | 'horizontal' | 'all';
10
10
  export declare type RadiusApply = 'left' | 'right' | 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'all' | 'none';
11
+ export declare type StrokeWidth = string | number;
@@ -1,4 +1,4 @@
1
- import { Color } from '../color/color.model';
1
+ import { Color } from '../color';
2
2
  import { MaskingShape } from './masking.types';
3
3
  export interface Masking {
4
4
  background: Color;
@@ -1,4 +1,4 @@
1
1
  import { ShadowDefinition } from './shadow.model';
2
2
  import { ShadowElevation } from './shadow.types';
3
- export declare const ShadowCssMap: Record<ShadowElevation, string>;
4
3
  export declare const ShadowMap: Record<ShadowElevation, ShadowDefinition>;
4
+ export declare const ShadowCssMap: Record<ShadowElevation, string>;
@@ -1,51 +1,71 @@
1
- // box-shadow: none|h-offset v-offset blur spread color
2
- export const ShadowCssMap = {
3
- pressed: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
4
- raised: '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)',
5
- focussed: '0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)',
6
- navigation: '0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22)',
7
- modal: '0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)'
8
- };
1
+ import { GetBoxShadows } from './shadow.utils';
9
2
  export const ShadowMap = {
10
3
  pressed: {
11
4
  umbra: {
12
- offset: 1, blur: 2, opacity: 24
5
+ offset: 1,
6
+ blur: 2,
7
+ opacity: 24,
13
8
  },
14
9
  penumbra: {
15
- offset: 1, blur: 3, opacity: 12
16
- }
10
+ offset: 1,
11
+ blur: 3,
12
+ opacity: 12,
13
+ },
17
14
  },
18
15
  raised: {
19
16
  umbra: {
20
- offset: 3, blur: 6, opacity: 23
17
+ offset: 3,
18
+ blur: 6,
19
+ opacity: 23,
21
20
  },
22
21
  penumbra: {
23
- offset: 3, blur: 6, opacity: 16
24
- }
22
+ offset: 3,
23
+ blur: 6,
24
+ opacity: 16,
25
+ },
25
26
  },
26
27
  focussed: {
27
28
  umbra: {
28
- offset: 6, blur: 6, opacity: 23
29
+ offset: 6,
30
+ blur: 6,
31
+ opacity: 23,
29
32
  },
30
33
  penumbra: {
31
- offset: 10, blur: 20, opacity: 19
32
- }
34
+ offset: 10,
35
+ blur: 20,
36
+ opacity: 19,
37
+ },
33
38
  },
34
39
  navigation: {
35
40
  umbra: {
36
- offset: 10, blur: 10, opacity: 22
41
+ offset: 10,
42
+ blur: 10,
43
+ opacity: 22,
37
44
  },
38
45
  penumbra: {
39
- offset: 14, blur: 28, opacity: 25
40
- }
46
+ offset: 14,
47
+ blur: 28,
48
+ opacity: 25,
49
+ },
41
50
  },
42
51
  modal: {
43
52
  umbra: {
44
- offset: 15, blur: 12, opacity: 22
53
+ offset: 15,
54
+ blur: 12,
55
+ opacity: 22,
45
56
  },
46
57
  penumbra: {
47
- offset: 19, blur: 38, opacity: 30
48
- }
58
+ offset: 19,
59
+ blur: 38,
60
+ opacity: 30,
61
+ },
49
62
  },
50
63
  };
64
+ export const ShadowCssMap = {
65
+ pressed: GetBoxShadows(ShadowMap['pressed']),
66
+ raised: GetBoxShadows(ShadowMap['raised']),
67
+ focussed: GetBoxShadows(ShadowMap['focussed']),
68
+ navigation: GetBoxShadows(ShadowMap['navigation']),
69
+ modal: GetBoxShadows(ShadowMap['modal']),
70
+ };
51
71
  //# sourceMappingURL=shadow.records.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadow.records.js","sourceRoot":"","sources":["../../../../src/core/shadow/shadow.records.ts"],"names":[],"mappings":"AAGA,uDAAuD;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAoC;IAC3D,OAAO,EAAE,wDAAwD;IACjE,MAAM,EAAE,wDAAwD;IAChE,QAAQ,EAAE,0DAA0D;IACpE,UAAU,EAAE,4DAA4D;IACxE,KAAK,EAAE,4DAA4D;CACpE,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAA8C;IAClE,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;QACnC,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;KACpC;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;QACnC,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;KACpC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;SAAE;QACnC,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;KACtC;IACD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;QACrC,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;KACtC;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;QACrC,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;SAAE;KACtC;CACF,CAAA"}
1
+ {"version":3,"file":"shadow.records.js","sourceRoot":"","sources":["../../../../src/core/shadow/shadow.records.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAA8C;IAClE,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;KACF;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;KACF;IACD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE;YACL,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,EAAE;YACR,OAAO,EAAE,EAAE;SACZ;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAoC;IAC3D,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,QAAQ,EAAE,aAAa,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC9C,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAClD,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;CACzC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Shadow, ShadowDefinition } from './shadow.model';
2
+ export declare const GetBoxShadow: ({ offset, blur, opacity }: Shadow) => string;
3
+ export declare const GetBoxShadows: ({ umbra, penumbra }: ShadowDefinition) => string;
@@ -0,0 +1,8 @@
1
+ // box-shadow: none|h-offset v-offset blur spread color
2
+ export const GetBoxShadow = ({ offset, blur, opacity }) => {
3
+ return `0 ${offset}px ${blur}px rgba(0,0,0,0.${opacity})`;
4
+ };
5
+ export const GetBoxShadows = ({ umbra, penumbra }) => {
6
+ return GetBoxShadow(umbra) + ', ' + GetBoxShadow(penumbra);
7
+ };
8
+ //# sourceMappingURL=shadow.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shadow.utils.js","sourceRoot":"","sources":["../../../../src/core/shadow/shadow.utils.ts"],"names":[],"mappings":"AAEA,uDAAuD;AACvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAU,EAAU,EAAE;IACxE,OAAO,KAAK,MAAM,MAAM,IAAI,mBAAmB,OAAO,GAAG,CAAC;AAC5D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAoB,EAAU,EAAE;IAC7E,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC7D,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const debounce: <T extends (...args: any[]) => ReturnType<T>>(callback: T, timeout: number) => (...args: Parameters<T>) => void;
@@ -0,0 +1,10 @@
1
+ export const debounce = (callback, timeout) => {
2
+ let timer;
3
+ return (...args) => {
4
+ clearTimeout(timer);
5
+ timer = setTimeout(() => {
6
+ callback(...args);
7
+ }, timeout);
8
+ };
9
+ };
10
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAAW,EACX,OAAe,EACqB,EAAE;IACtC,IAAI,KAAoC,CAAC;IAEzC,OAAO,CAAC,GAAG,IAAmB,EAAE,EAAE;QAChC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YACtB,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QACpB,CAAC,EAAE,OAAO,CAAC,CAAC;IACd,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './getValue';
2
+ export * from './debounce';
@@ -1,2 +1,3 @@
1
1
  export * from './getValue';
2
+ export * from './debounce';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
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.31",
4
+ "version": "0.0.33",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/uni-design-system/uni-core.git"