pxd 0.0.1

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 (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/dist/_hooks/index.d.ts +7 -0
  4. package/dist/_hooks/use-disabled/index.d.ts +2 -0
  5. package/dist/_hooks/use-disabled/index.js +9 -0
  6. package/dist/_hooks/use-event-listener/index.d.ts +2 -0
  7. package/dist/_hooks/use-focus-trap/index.d.ts +8 -0
  8. package/dist/_hooks/use-focus-trap/index.js +35 -0
  9. package/dist/_hooks/use-size/index.d.ts +5 -0
  10. package/dist/_hooks/use-size/index.js +9 -0
  11. package/dist/_hooks/use-toggle/index.d.ts +6 -0
  12. package/dist/_hooks/use-toggle/index.js +13 -0
  13. package/dist/_hooks/use-z-index/index.d.ts +2 -0
  14. package/dist/_hooks/use-z-index/index.js +9 -0
  15. package/dist/_internal/constants.d.ts +4 -0
  16. package/dist/_internal/constants.js +7 -0
  17. package/dist/_internal/index.d.ts +3 -0
  18. package/dist/_internal/injectKeys.d.ts +5 -0
  19. package/dist/_internal/injectKeys.js +7 -0
  20. package/dist/_internal/props.d.ts +3 -0
  21. package/dist/_internal/props.js +5 -0
  22. package/dist/_styles/atoms.css +1 -0
  23. package/dist/_styles/base.css +1 -0
  24. package/dist/_styles/button.css +1 -0
  25. package/dist/_styles/checkbox.css +1 -0
  26. package/dist/_styles/dialog.css +1 -0
  27. package/dist/_styles/icon.css +1 -0
  28. package/dist/_styles/index.css +1 -0
  29. package/dist/_styles/input.css +1 -0
  30. package/dist/_styles/radio.css +1 -0
  31. package/dist/_styles/space.css +1 -0
  32. package/dist/_styles/spinner.css +1 -0
  33. package/dist/_styles/switch.css +1 -0
  34. package/dist/_styles/tokens.css +1 -0
  35. package/dist/_styles/transitions.css +1 -0
  36. package/dist/_types/component.d.ts +7 -0
  37. package/dist/_types/imports.d.ts +55 -0
  38. package/dist/_types/index.d.ts +2 -0
  39. package/dist/_types/props.d.ts +5 -0
  40. package/dist/_utils/index.d.ts +4 -0
  41. package/dist/_utils/install.d.ts +2 -0
  42. package/dist/_utils/install.js +7 -0
  43. package/dist/_utils/styles.d.ts +3 -0
  44. package/dist/_utils/styles.js +11 -0
  45. package/dist/_utils/typeof.d.ts +3 -0
  46. package/dist/_utils/typeof.js +14 -0
  47. package/dist/_utils/watchers.d.ts +8 -0
  48. package/dist/_utils/watchers.js +12 -0
  49. package/dist/button/index.d.ts +4 -0
  50. package/dist/button/index.js +9 -0
  51. package/dist/button/src/button.js +5 -0
  52. package/dist/button/src/button.vue.d.ts +14 -0
  53. package/dist/button/src/button.vue_vue_type_script_setup_true_name_CButton_lang.js +37 -0
  54. package/dist/button/src/constraints.d.ts +58 -0
  55. package/dist/button/src/constraints.js +36 -0
  56. package/dist/checkbox/index.d.ts +4 -0
  57. package/dist/checkbox/index.js +9 -0
  58. package/dist/checkbox/src/checkbox.js +5 -0
  59. package/dist/checkbox/src/checkbox.vue.d.ts +23 -0
  60. package/dist/checkbox/src/checkbox.vue_vue_type_script_setup_true_name_CCheckbox_lang.js +49 -0
  61. package/dist/checkbox/src/constraints.d.ts +26 -0
  62. package/dist/checkbox/src/constraints.js +19 -0
  63. package/dist/dialog/index.d.ts +4 -0
  64. package/dist/dialog/index.js +9 -0
  65. package/dist/dialog/src/constraints.d.ts +72 -0
  66. package/dist/dialog/src/constraints.js +41 -0
  67. package/dist/dialog/src/dialog.js +5 -0
  68. package/dist/dialog/src/dialog.vue.d.ts +37 -0
  69. package/dist/dialog/src/dialog.vue_vue_type_script_setup_true_name_CDialog_lang.js +143 -0
  70. package/dist/icon/index.d.ts +4 -0
  71. package/dist/icon/index.js +9 -0
  72. package/dist/icon/src/composables/use-icon.d.ts +8 -0
  73. package/dist/icon/src/composables/use-icon.js +15 -0
  74. package/dist/icon/src/constraints.d.ts +14 -0
  75. package/dist/icon/src/constraints.js +13 -0
  76. package/dist/icon/src/icon.js +5 -0
  77. package/dist/icon/src/icon.vue.d.ts +3 -0
  78. package/dist/icon/src/icon.vue_vue_type_script_setup_true_name_CIcon_lang.js +24 -0
  79. package/dist/index.d.ts +18 -0
  80. package/dist/index.js +52 -0
  81. package/dist/input/index.d.ts +4 -0
  82. package/dist/input/index.js +9 -0
  83. package/dist/input/src/constraints.d.ts +55 -0
  84. package/dist/input/src/constraints.js +33 -0
  85. package/dist/input/src/input.js +5 -0
  86. package/dist/input/src/input.vue.d.ts +13 -0
  87. package/dist/input/src/input.vue_vue_type_script_setup_true_name_CInput_lang.js +54 -0
  88. package/dist/provider/index.d.ts +4 -0
  89. package/dist/provider/index.js +9 -0
  90. package/dist/provider/src/constraints.d.ts +14 -0
  91. package/dist/provider/src/constraints.js +13 -0
  92. package/dist/provider/src/provider.js +5 -0
  93. package/dist/provider/src/provider.vue.d.ts +3 -0
  94. package/dist/provider/src/provider.vue_vue_type_script_setup_true_name_CProvider_lang.js +15 -0
  95. package/dist/radio/index.d.ts +4 -0
  96. package/dist/radio/index.js +9 -0
  97. package/dist/radio/src/constraints.d.ts +13 -0
  98. package/dist/radio/src/constraints.js +9 -0
  99. package/dist/radio/src/radio.js +5 -0
  100. package/dist/radio/src/radio.vue.d.ts +3 -0
  101. package/dist/radio/src/radio.vue_vue_type_script_setup_true_name_CRadio_lang.js +39 -0
  102. package/dist/resolver.d.ts +2 -0
  103. package/dist/resolver.js +23 -0
  104. package/dist/space/index.d.ts +4 -0
  105. package/dist/space/index.js +9 -0
  106. package/dist/space/src/constraints.d.ts +27 -0
  107. package/dist/space/src/constraints.js +17 -0
  108. package/dist/space/src/space.js +5 -0
  109. package/dist/space/src/space.vue.d.ts +3 -0
  110. package/dist/space/src/space.vue_vue_type_script_setup_true_name_CSpace_lang.js +30 -0
  111. package/dist/spinner/index.d.ts +4 -0
  112. package/dist/spinner/index.js +9 -0
  113. package/dist/spinner/src/spinner.js +5 -0
  114. package/dist/spinner/src/spinner.vue.d.ts +3 -0
  115. package/dist/spinner/src/spinner.vue_vue_type_script_setup_true_name_CSpinner_lang.js +48 -0
  116. package/dist/switch/index.d.ts +4 -0
  117. package/dist/switch/index.js +9 -0
  118. package/dist/switch/src/constraints.d.ts +59 -0
  119. package/dist/switch/src/constraints.js +37 -0
  120. package/dist/switch/src/switch.js +5 -0
  121. package/dist/switch/src/switch.vue.d.ts +21 -0
  122. package/dist/switch/src/switch.vue_vue_type_script_setup_true_name_CSwitch_lang.js +50 -0
  123. package/package.json +89 -0
@@ -0,0 +1,59 @@
1
+ import type { ExtractPropTypes } from 'vue';
2
+ import type Switch from './switch.vue';
3
+ export declare const switchProps: {
4
+ modelValue: {
5
+ type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
6
+ default: boolean;
7
+ };
8
+ /**
9
+ * @zh 按钮的尺寸
10
+ */
11
+ size: {
12
+ type: (StringConstructor | NumberConstructor)[];
13
+ default: null;
14
+ };
15
+ /**
16
+ * @zh 是否禁用
17
+ */
18
+ disabled: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ /**
23
+ * @zh 是否处于加载中
24
+ */
25
+ loading: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ /**
30
+ * @zh 真值,用于切换为激活时的值
31
+ */
32
+ activeValue: {
33
+ type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
34
+ default: boolean;
35
+ };
36
+ /**
37
+ * @zh 假值,用于切换为未激活时的值
38
+ */
39
+ inactiveValue: {
40
+ type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
41
+ default: boolean;
42
+ };
43
+ /**
44
+ * @zh 激活时的背景颜色
45
+ */
46
+ activeColor: {
47
+ type: StringConstructor;
48
+ default: null;
49
+ };
50
+ /**
51
+ * @zh 未激活时的背景颜色
52
+ */
53
+ inactiveColor: {
54
+ type: StringConstructor;
55
+ default: null;
56
+ };
57
+ };
58
+ export declare type SwitchProps = ExtractPropTypes<typeof switchProps>;
59
+ export declare type SwitchInstance = InstanceType<typeof Switch>;
@@ -0,0 +1,37 @@
1
+ const e = {
2
+ modelValue: {
3
+ type: [String, Number, Boolean],
4
+ default: !1
5
+ },
6
+ size: {
7
+ type: [String, Number],
8
+ default: null
9
+ },
10
+ disabled: {
11
+ type: Boolean,
12
+ default: !1
13
+ },
14
+ loading: {
15
+ type: Boolean,
16
+ default: !1
17
+ },
18
+ activeValue: {
19
+ type: [String, Number, Boolean],
20
+ default: !0
21
+ },
22
+ inactiveValue: {
23
+ type: [String, Number, Boolean],
24
+ default: !1
25
+ },
26
+ activeColor: {
27
+ type: String,
28
+ default: null
29
+ },
30
+ inactiveColor: {
31
+ type: String,
32
+ default: null
33
+ }
34
+ };
35
+ export {
36
+ e as switchProps
37
+ };
@@ -0,0 +1,5 @@
1
+ import "./switch.vue_vue_type_script_setup_true_name_CSwitch_lang.js";
2
+ import { default as t } from "./switch.vue_vue_type_script_setup_true_name_CSwitch_lang.js";
3
+ export {
4
+ t as default
5
+ };
@@ -0,0 +1,21 @@
1
+ import type { DefineComponent, ComputedOptions, MethodOptions, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ComputedRef, WritableComputedRef, ExtractPropTypes } from 'vue';
2
+ declare const _sfc_main: DefineComponent<{}, {
3
+ LoadingSpinner: DefineComponent<unknown, object, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<unknown>, {}>;
4
+ props: any;
5
+ emits: {
6
+ (event: 'change', evt: any): void;
7
+ (event: 'update:modelValue', value: any): void;
8
+ };
9
+ computedStyle: ComputedRef<{
10
+ '--size': string | undefined;
11
+ '--active-color': any;
12
+ '--inactive-color': any;
13
+ }>;
14
+ modelValue: WritableComputedRef<any>;
15
+ toggle: (value?: any) => any;
16
+ onSwitchClick: () => void;
17
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{}>> & {
18
+ onChange?: ((...args: any[]) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
20
+ }, {}>;
21
+ export default _sfc_main;
@@ -0,0 +1,50 @@
1
+ import { defineComponent as c, defineAsyncComponent as u, computed as n, openBlock as l, createElementBlock as f, normalizeClass as h, normalizeStyle as g, unref as i, createElementVNode as x, createBlock as v, createCommentVNode as V } from "vue";
2
+ import { switchProps as C } from "./constraints.js";
3
+ import { appendCSSUnit as k } from "../../_utils/styles.js";
4
+ import { useToggle as y } from "../../_hooks/use-toggle/index.js";
5
+ const _ = ["disabled", "aria-checked"], b = { class: "px-switch--node px-flex px-items-center px-justify-center px-transition px-relative" }, S = c({
6
+ name: "CSwitch"
7
+ }), j = /* @__PURE__ */ c({
8
+ ...S,
9
+ props: C,
10
+ emits: ["change", "update:modelValue"],
11
+ setup(r, { emit: a }) {
12
+ const e = r, s = u(() => import("../../spinner/index.js")), p = n(() => ({
13
+ "--size": k(e.size),
14
+ "--active-color": e.activeColor,
15
+ "--inactive-color": e.inactiveColor
16
+ })), o = n({
17
+ get() {
18
+ return e.modelValue;
19
+ },
20
+ set(t) {
21
+ a("update:modelValue", t);
22
+ }
23
+ }), d = y(o, {
24
+ truthyValue: e.activeValue,
25
+ falsyValue: e.inactiveValue
26
+ });
27
+ function m() {
28
+ d(), a("change", o.value);
29
+ }
30
+ return (t, w) => (l(), f("button", {
31
+ class: h(["px-switch px-transition px-inline-block px-cursor-pointer px-relative", { "px-switch--loading": t.loading }]),
32
+ disabled: t.disabled,
33
+ style: g(i(p)),
34
+ "aria-label": "toggle button",
35
+ "aria-checked": i(o) === e.activeValue,
36
+ onClick: m
37
+ }, [
38
+ x("i", b, [
39
+ t.loading ? (l(), v(i(s), {
40
+ key: 0,
41
+ size: ".68em",
42
+ color: "var(--primary-6)"
43
+ })) : V("", !0)
44
+ ])
45
+ ], 14, _));
46
+ }
47
+ });
48
+ export {
49
+ j as default
50
+ };
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "pxd",
3
+ "type": "module",
4
+ "version": "0.0.1",
5
+ "description": "A stylish modern component library for Vue3. 一个别具一格的现代 Vue3 组件库。",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "style": "dist/_styles/index.css",
10
+ "sideEffects": ["dist/*"],
11
+ "files": ["dist/*"],
12
+ "exports": {
13
+ ".": "./dist/index.js",
14
+ "./*": "./dist/*"
15
+ },
16
+ "scripts": {
17
+ "gen": "zx ./scripts/gc.mjs",
18
+ "dev": "cd ./playground && npm run dev",
19
+ "build": "npm run build:lib && npm run build:styles",
20
+ "build:lib": "vite build -c ./scripts/build-lib.mjs",
21
+ "build:styles": "node ./scripts/build-styles.mjs",
22
+ "stylelint": "stylelint --fix src/**/*.{css,scss}",
23
+ "eslint": "eslint ./src --ext .vue,.ts,.tsx --fix --ignore-path .gitignore"
24
+ },
25
+ "keywords": [
26
+ "ui",
27
+ "vue",
28
+ "vue3",
29
+ "ui framework",
30
+ "component library"
31
+ ],
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "license": "MIT",
36
+ "author": "banlify <banlify@163.com>",
37
+ "homepage": "https://github.com/banlify/px-ui#readme",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/banlify/px-ui.git"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/banlify/px-ui/issues"
44
+ },
45
+ "peerDependencies": {
46
+ "vue": "^3.2.0"
47
+ },
48
+ "devDependencies": {
49
+ "@typescript-eslint/eslint-plugin": "^5.40.1",
50
+ "@typescript-eslint/parser": "^5.40.1",
51
+ "@vitejs/plugin-vue": "^3.1.2",
52
+ "@vitejs/plugin-vue-jsx": "^2.0.1",
53
+ "@vue/eslint-config-typescript": "^11.0.2",
54
+ "csso": "^5.0.5",
55
+ "eslint": "^8.25.0",
56
+ "eslint-config-standard-with-typescript": "^23.0.0",
57
+ "eslint-plugin-import": "^2.26.0",
58
+ "eslint-plugin-n": "^15.3.0",
59
+ "eslint-plugin-promise": "^6.1.1",
60
+ "eslint-plugin-unicorn": "^43.0.2",
61
+ "eslint-plugin-vue": "^9.6.0",
62
+ "fast-glob": "^3.2.12",
63
+ "fs-extra": "^10.1.0",
64
+ "kolorist": "^1.6.0",
65
+ "magic-string": "^0.26.7",
66
+ "sass": "^1.55.0",
67
+ "stylelint": "^14.14.0",
68
+ "stylelint-config-recommended-scss": "^6.0.0",
69
+ "stylelint-config-standard": "^26.0.0",
70
+ "stylelint-scss": "^4.3.0",
71
+ "typescript": "^4.8.4",
72
+ "unplugin-auto-import": "^0.11.2",
73
+ "unplugin-vue-components": "^0.22.8",
74
+ "unplugin-vue-setup-extend-plus": "^0.3.2",
75
+ "vite": "^3.1.8",
76
+ "vite-plugin-dts": "^1.6.6",
77
+ "vue": "^3.2.41",
78
+ "zx": "^7.1.1"
79
+ },
80
+ "dependencies": {
81
+ "@vueuse/core": "^9.3.1",
82
+ "focus-trap": "^7.0.0"
83
+ },
84
+ "browserslist": [
85
+ "> 1%",
86
+ "not ie 11",
87
+ "not op_mini all"
88
+ ]
89
+ }