@typlog/ui 0.14.0 → 0.16.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typlog/ui",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Themed components for Reka UI with Radix colors.",
@@ -9,31 +9,43 @@
9
9
  "url": "https://github.com/typlog/ui"
10
10
  },
11
11
  "sideEffects": false,
12
- "module": "./components.js",
13
- "types": "./components.d.ts",
12
+ "module": "./index.js",
13
+ "types": "./index.d.ts",
14
14
  "exports": {
15
15
  ".": {
16
- "types": "./components.d.ts",
16
+ "types": "./index.d.ts",
17
17
  "style": "./index.css",
18
- "import": "./components.js"
19
- },
20
- "./components": {
21
- "types": "./components.d.ts",
22
- "style": "./components.css",
23
- "import": "./components.js"
18
+ "import": "./index.js"
24
19
  },
25
20
  "./addons": {
26
21
  "types": "./addons.d.ts",
27
22
  "style": "./addons.css",
28
23
  "import": "./addons.js"
29
24
  },
30
- "./base.css": "./base.css",
31
- "./components.css": "./components.css",
32
- "./tailwind.css": "./tailwind.css"
25
+ "./charts": {
26
+ "types": "./charts.d.ts",
27
+ "style": "./charts.css",
28
+ "import": "./charts.js"
29
+ }
33
30
  },
34
31
  "dependencies": {
35
32
  "@iconify/vue": "^5.0.0",
36
- "reka-ui": "^2.4.0",
33
+ "@tanstack/vue-virtual": "^3.13.36",
34
+ "@vueuse/core": "^14.4.0",
35
+ "ohash": "^2.0.12",
36
+ "reka-ui": "^2.10.4",
37
37
  "vue": "^3.5.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@unovis/ts": "^1.6.7",
41
+ "@unovis/vue": "^1.6.7"
42
+ },
43
+ "peerDependenciesMeta": {
44
+ "@unovis/ts": {
45
+ "optional": true
46
+ },
47
+ "@unovis/vue": {
48
+ "optional": true
49
+ }
38
50
  }
39
- }
51
+ }
@@ -0,0 +1,42 @@
1
+ import { computed } from "vue";
2
+ import { useEmitAsProps, useForwardProps } from "reka-ui";
3
+ //#region src/components/util.ts
4
+ function useForwardPropsWithout(props, exclude) {
5
+ const parsedProps = useForwardProps(props);
6
+ return computed(() => ({ ..._excludeProps(parsedProps.value, exclude) }));
7
+ }
8
+ function useForwardPropsEmitsWithout(props, emit, exclude) {
9
+ const parsedProps = useForwardProps(props);
10
+ const emitsAsProps = useEmitAsProps(emit);
11
+ return computed(() => ({
12
+ ..._excludeProps(parsedProps.value, exclude),
13
+ ...emitsAsProps
14
+ }));
15
+ }
16
+ var buildPropsClass = (props, keys) => {
17
+ return computed(() => {
18
+ const rv = [];
19
+ keys.forEach((key) => {
20
+ const value = props[key];
21
+ if (key === "class") rv.push(value);
22
+ if (value === true) rv.push(`r-${kebabize(key)}`);
23
+ else if (value) rv.push(`r-${kebabize(key)}-${value}`);
24
+ });
25
+ return rv;
26
+ });
27
+ };
28
+ function _excludeProps(props, exclude) {
29
+ const rv = {};
30
+ Object.keys(props).forEach((k) => {
31
+ if (exclude.indexOf(k) === -1) rv[k] = props[k];
32
+ });
33
+ return rv;
34
+ }
35
+ function kebabize(str) {
36
+ return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, _kebabReplace);
37
+ }
38
+ function _kebabReplace(str, ofs) {
39
+ return (ofs ? "-" : "") + str.toLowerCase();
40
+ }
41
+ //#endregion
42
+ export { useForwardPropsEmitsWithout as n, useForwardPropsWithout as r, buildPropsClass as t };