@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 +19 -2
- package/dist/cjs/core/background/background.model.d.ts +3 -3
- package/dist/cjs/core/border/border.model.d.ts +11 -8
- package/dist/cjs/core/button/button.model.d.ts +2 -2
- package/dist/cjs/core/core.types.d.ts +1 -0
- package/dist/cjs/core/masking/masking.model.d.ts +1 -1
- package/dist/cjs/utils/debounce.d.ts +1 -0
- package/dist/cjs/utils/debounce.js +14 -0
- package/dist/cjs/utils/debounce.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +1 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/esm/core/background/background.model.d.ts +3 -3
- package/dist/esm/core/border/border.model.d.ts +11 -8
- package/dist/esm/core/button/button.model.d.ts +2 -2
- package/dist/esm/core/core.types.d.ts +1 -0
- package/dist/esm/core/masking/masking.model.d.ts +1 -1
- package/dist/esm/utils/debounce.d.ts +1 -0
- package/dist/esm/utils/debounce.js +10 -0
- package/dist/esm/utils/debounce.js.map +1 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 →</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.
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ColorToken } from '../color';
|
|
2
|
+
import { StrokeWidth } from '../core.types';
|
|
2
3
|
export interface Border {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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?:
|
|
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;
|
|
@@ -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"}
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -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"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ColorToken } from '../color';
|
|
2
|
+
import { StrokeWidth } from '../core.types';
|
|
2
3
|
export interface Border {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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?:
|
|
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;
|
|
@@ -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 @@
|
|
|
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"}
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -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