@fakeoai/ui 0.0.4 → 0.0.6

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.
@@ -0,0 +1,9 @@
1
+ export * from "./filter";
2
+ export * from "./input";
3
+ export * from "./loading";
4
+ export * from "./pagination";
5
+ export * from "./ace-editor";
6
+ export * from "./sheet";
7
+ export * from "./table";
8
+ export * from "./tooltip";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,9 @@
1
+ export * from "./filter";
2
+ export * from "./input";
3
+ export * from "./loading";
4
+ export * from "./pagination";
5
+ export * from "./ace-editor";
6
+ export * from "./sheet";
7
+ export * from "./table";
8
+ export * from "./tooltip";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./use-page-store";
2
+ export * from "./use-confirm";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./use-page-store";
2
+ export * from "./use-confirm";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,5 @@
1
- export * from "./components/filter";
2
- export * from "./components/input";
3
- export * from "./components/loading";
4
- export * from "./components/pagination";
5
- export * from "./components/ace-editor";
6
- export * from "./components/sheet";
7
- export * from "./components/table";
8
- export * from "./components/tooltip";
9
- export * from "./utils/cn";
1
+ export * from "./utils";
2
+ export * from "./components";
10
3
  export * from "./types";
4
+ export * from "./hooks";
11
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -1,11 +1,5 @@
1
- export * from "./components/filter";
2
- export * from "./components/input";
3
- export * from "./components/loading";
4
- export * from "./components/pagination";
5
- export * from "./components/ace-editor";
6
- export * from "./components/sheet";
7
- export * from "./components/table";
8
- export * from "./components/tooltip";
9
- export * from "./utils/cn";
1
+ export * from "./utils";
2
+ export * from "./components";
10
3
  export * from "./types";
4
+ export * from "./hooks";
11
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,4 @@
1
+ import Dayjs from 'dayjs';
2
+ export declare const dayjs: typeof Dayjs;
3
+ export declare const formatClears: (date: string) => string;
4
+ //# sourceMappingURL=dayjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayjs.d.ts","sourceRoot":"","sources":["../../src/utils/dayjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAiBzB,eAAO,MAAM,KAAK,cAAQ,CAAA;AAE1B,eAAO,MAAM,YAAY,GAAI,MAAM,MAAM,WAaxC,CAAA"}
@@ -0,0 +1,35 @@
1
+ import Dayjs from 'dayjs';
2
+ import isBetween from 'dayjs/plugin/isBetween';
3
+ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
4
+ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
5
+ import relativeTime from 'dayjs/plugin/relativeTime';
6
+ import zhCn from 'dayjs/locale/zh-cn';
7
+ import utc from 'dayjs/plugin/utc';
8
+ import timezone from 'dayjs/plugin/timezone';
9
+ Dayjs.extend(isBetween);
10
+ Dayjs.extend(isSameOrBefore);
11
+ Dayjs.extend(isSameOrAfter);
12
+ Dayjs.extend(relativeTime);
13
+ Dayjs.locale(zhCn);
14
+ Dayjs.extend(utc);
15
+ Dayjs.extend(timezone);
16
+ Dayjs.tz.setDefault('Asia/Shanghai');
17
+ export const dayjs = Dayjs;
18
+ export const formatClears = (date) => {
19
+ let d = dayjs(date);
20
+ let now = dayjs();
21
+ let diff = d.diff(now, 'second');
22
+ if (diff > 60 * 60 * 24) {
23
+ return `${d.diff(now, 'days')}天`;
24
+ }
25
+ else if (diff > 60 * 60) {
26
+ return `${d.diff(now, 'hours')}小时`;
27
+ }
28
+ else if (diff > 60) {
29
+ return `${d.diff(now, 'minutes')}分钟`;
30
+ }
31
+ else {
32
+ return `${d.diff(now, 'seconds')}秒`;
33
+ }
34
+ };
35
+ //# sourceMappingURL=dayjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayjs.js","sourceRoot":"","sources":["../../src/utils/dayjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,SAAS,MAAM,wBAAwB,CAAA;AAC9C,OAAO,cAAc,MAAM,6BAA6B,CAAA;AACxD,OAAO,aAAa,MAAM,4BAA4B,CAAA;AACtD,OAAO,YAAY,MAAM,2BAA2B,CAAA;AACpD,OAAO,IAAI,MAAM,oBAAoB,CAAA;AACrC,OAAO,GAAG,MAAM,kBAAkB,CAAA;AAClC,OAAO,QAAQ,MAAM,uBAAuB,CAAA;AAE5C,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACvB,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AAC5B,KAAK,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;AAC3B,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AAC1B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAClB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACjB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACtB,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;AACpC,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAA;AAE1B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IAC3C,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACnB,IAAI,GAAG,GAAG,KAAK,EAAE,CAAA;IACjB,IAAI,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;IAChC,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;QACxB,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAA;IAClC,CAAC;SAAM,IAAI,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;QAC1B,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAA;IACpC,CAAC;SAAM,IAAI,IAAI,GAAG,EAAE,EAAE,CAAC;QACrB,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,CAAA;IACtC,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAA;IACrC,CAAC;AACH,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./cn";
2
+ export * from "./dayjs";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./cn";
2
+ export * from "./dayjs";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fakeoai/ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Reusable UI components and common table logic extracted from tokens2.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -26,6 +26,7 @@
26
26
  "zustand": "^4.5.5"
27
27
  },
28
28
  "dependencies": {
29
+ "dayjs": "^1.11.12",
29
30
  "class-variance-authority": "^0.7.0",
30
31
  "@internationalized/date": "^3.8.0",
31
32
  "@radix-ui/react-dialog": "^1.1.2",