@uni-design-system/uni-core 0.0.32 → 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.
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;
@@ -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;
@@ -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.32",
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"