pxd 0.0.18 → 0.0.20

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 (71) hide show
  1. package/README.md +2 -0
  2. package/dist/components/avatar/index.vue +34 -7
  3. package/dist/components/avatar/index.vue.d.ts +2 -1
  4. package/dist/components/book/index.vue +46 -9
  5. package/dist/components/book/index.vue.d.ts +7 -5
  6. package/dist/components/button/index.vue +2 -2
  7. package/dist/components/collapse/index.vue +6 -4
  8. package/dist/components/empty-state/index.vue +37 -0
  9. package/dist/components/empty-state/index.vue.d.ts +22 -0
  10. package/dist/components/hold-button/index.vue +1 -1
  11. package/dist/components/index.d.ts +9 -0
  12. package/dist/components/index.js +9 -0
  13. package/dist/components/input/index.vue +2 -2
  14. package/dist/components/input/index.vue.d.ts +2 -2
  15. package/dist/components/link-button/index.vue +2 -2
  16. package/dist/components/material/index.vue +52 -0
  17. package/dist/components/material/index.vue.d.ts +17 -0
  18. package/dist/components/menu/index.vue +46 -0
  19. package/dist/components/menu/index.vue.d.ts +27 -0
  20. package/dist/components/menu-item/index.vue +81 -0
  21. package/dist/components/menu-item/index.vue.d.ts +22 -0
  22. package/dist/components/menu-list/index.vue +157 -0
  23. package/dist/components/menu-list/index.vue.d.ts +23 -0
  24. package/dist/components/note/index.vue +2 -2
  25. package/dist/components/pagination/index.vue +43 -0
  26. package/dist/components/pagination/index.vue.d.ts +20 -0
  27. package/dist/components/pin-input/index.vue +2 -2
  28. package/dist/components/popover/index.vue +140 -62
  29. package/dist/components/popover/index.vue.d.ts +10 -3
  30. package/dist/components/resizable/index.vue +185 -0
  31. package/dist/components/resizable/index.vue.d.ts +17 -0
  32. package/dist/components/resizable-handle/index.vue +85 -0
  33. package/dist/components/resizable-handle/index.vue.d.ts +2 -0
  34. package/dist/components/resizable-panel/index.vue +57 -0
  35. package/dist/components/resizable-panel/index.vue.d.ts +19 -0
  36. package/dist/components/scrollable/index.vue +36 -29
  37. package/dist/components/scrollable/index.vue.d.ts +2 -0
  38. package/dist/components/skeleton/index.vue +2 -2
  39. package/dist/components/snippet/index.vue +2 -2
  40. package/dist/components/stack/index.vue +3 -3
  41. package/dist/components/switch/index.vue +3 -3
  42. package/dist/components/text/index.vue +2 -2
  43. package/dist/components/textarea/index.vue +2 -2
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.js +1 -1
  46. package/dist/locales/en-US.d.ts +2 -0
  47. package/dist/locales/en-US.js +3 -1
  48. package/dist/locales/zh-CN.d.ts +2 -0
  49. package/dist/locales/zh-CN.js +3 -1
  50. package/dist/styles/dst.css +54 -28
  51. package/dist/styles/styles.css +1 -1
  52. package/dist/styles/tw.css +64 -47
  53. package/dist/types/components/button.d.ts +12 -0
  54. package/dist/types/components/error.d.ts +6 -0
  55. package/dist/types/components/index.d.ts +6 -0
  56. package/dist/types/components/menu.d.ts +10 -0
  57. package/dist/types/components/popover.d.ts +7 -0
  58. package/dist/types/components/resizable.d.ts +19 -0
  59. package/dist/types/{components.d.ts → components/shared.d.ts} +0 -19
  60. package/dist/types/index.js +2 -2
  61. package/dist/types/shared/index.d.ts +1 -0
  62. package/dist/types/shared/utils.d.ts +2 -0
  63. package/dist/utils/dates.d.ts +11 -0
  64. package/dist/utils/dates.js +9 -0
  65. package/dist/utils/dom.js +1 -1
  66. package/dist/utils/format.d.ts +1 -0
  67. package/dist/utils/format.js +4 -0
  68. package/package.json +1 -1
  69. package/dist/types/components.js +0 -0
  70. package/dist/types/shared.d.ts +0 -2
  71. /package/dist/types/{shared.js → components/shared.js} +0 -0
package/README.md CHANGED
@@ -4,6 +4,8 @@ A universal UI component library for Vue2&3
4
4
  > [!WARNING]
5
5
  > The project is under active development and is not ready for production.
6
6
 
7
+ [Online Preview](https://pxd-ui.netlify.app/)
8
+
7
9
  ## Contribution
8
10
 
9
11
  ### Dev
@@ -8,13 +8,14 @@ const props = defineProps({
8
8
  src: { type: String, required: false },
9
9
  alt: { type: String, required: false },
10
10
  size: { type: [Number, String], required: false },
11
- loading: { type: Boolean, required: false }
11
+ loading: { type: Boolean, required: false },
12
+ placeholder: { type: Boolean, required: false }
12
13
  });
13
14
  const emits = defineEmits(["load", "error", "loadstart"]);
14
15
  const loadingStatus = shallowRef("idle");
15
16
  const groupSize = inject("groupSize", 32);
16
17
  const computedSize = computed(() => getCssUnitValue(props.size || groupSize));
17
- const computedLoading = computed(() => props.loading || loadingStatus.value === "error");
18
+ const hideAvatar = computed(() => !props.src || props.placeholder || loadingStatus.value === "error");
18
19
  function onLoadError(event) {
19
20
  loadingStatus.value = "error";
20
21
  emits("error", event);
@@ -37,12 +38,12 @@ defineExpose({
37
38
 
38
39
  <template>
39
40
  <div
40
- class="pxd-avatar inline-flex items-center justify-center relative rounded-full border border-white select-none"
41
+ class="pxd-avatar inline-flex items-center justify-center relative rounded-full border border-background select-none"
41
42
  :style="{ '--size': computedSize }"
42
43
  >
43
44
  <slot>
44
45
  <img
45
- v-if="!computedLoading"
46
+ v-if="!hideAvatar"
46
47
  :src="src"
47
48
  :alt="alt"
48
49
  loading="lazy"
@@ -58,11 +59,13 @@ defineExpose({
58
59
  >
59
60
  </slot>
60
61
 
62
+ <div v-if="loading" class="pxd-avatar--loading" />
63
+
61
64
  <div
62
- v-if="$slots.badge"
63
- class="absolute -bottom-1 -left-1 z-10 w-1/2 h-1/2 flex items-center rounded-full border border-white bg-white overflow-hidden"
65
+ v-if="$slots.icon"
66
+ class="absolute -bottom-1 -left-1 z-10 w-1/2 h-1/2 flex items-center rounded-full border border-background bg-background overflow-hidden"
64
67
  >
65
- <slot name="badge" />
68
+ <slot name="icon" />
66
69
  </div>
67
70
  </div>
68
71
  </template>
@@ -92,6 +95,30 @@ defineExpose({
92
95
  }
93
96
  }
94
97
 
98
+ .pxd-avatar--loading {
99
+ position: absolute;
100
+ inset: 0;
101
+ border-radius: inherit;
102
+ backdrop-filter: blur(1px);
103
+ z-index: 1;
104
+
105
+ &::after {
106
+ content: '';
107
+ position: absolute;
108
+ inset: 0;
109
+ border-radius: inherit;
110
+ border-style: solid;
111
+ border-width: 2px 2px 1px 0;
112
+ border-color: var(--color-primary) var(--color-primary) transparent transparent;
113
+ }
114
+ }
115
+
116
+ @media (prefers-reduced-motion: no-preference) {
117
+ .pxd-avatar--loading::after {
118
+ animation: var(--animate-spin);
119
+ }
120
+ }
121
+
95
122
  @keyframes placeholder {
96
123
  0% {
97
124
  background-position: 200% 0;
@@ -3,6 +3,7 @@ interface Props {
3
3
  alt?: string;
4
4
  size?: number | string;
5
5
  loading?: boolean;
6
+ placeholder?: boolean;
6
7
  }
7
8
  type LoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';
8
9
  declare function getLoadingStatus(): LoadingStatus;
@@ -10,7 +11,7 @@ declare var __VLS_1: {}, __VLS_3: {};
10
11
  type __VLS_Slots = {} & {
11
12
  default?: (props: typeof __VLS_1) => any;
12
13
  } & {
13
- badge?: (props: typeof __VLS_3) => any;
14
+ icon?: (props: typeof __VLS_3) => any;
14
15
  };
15
16
  declare const __VLS_component: import("vue").DefineComponent<Props, {
16
17
  getLoadingStatus: typeof getLoadingStatus;
@@ -1,21 +1,56 @@
1
1
  <script setup>
2
+ import { computed } from "vue";
2
3
  defineOptions({
3
4
  name: "PBook"
4
5
  });
5
- defineProps({
6
+ const props = defineProps({
6
7
  color: { type: String, required: false },
7
8
  title: { type: [String, Number, Array, null], required: false },
8
- width: { type: [Number, String], required: false, default: 196 },
9
+ width: { type: null, required: false, default: 196 },
9
10
  variant: { type: String, required: false, default: "stripe" },
10
11
  textured: { type: Boolean, required: false, default: false }
11
12
  });
13
+ const presetWidthClasses = {
14
+ "--width-xs": "[--book-width:var(--width-xs)]",
15
+ "--width-sm": "sm:[--book-width:var(--width-sm)]",
16
+ "--width-md": "md:[--book-width:var(--width-md)]",
17
+ "--width-lg": "lg:[--book-width:var(--width-lg)]",
18
+ "--width-xl": "xl:[--book-width:var(--width-xl)]"
19
+ };
20
+ const formattedWidth = computed(() => {
21
+ const { width } = props;
22
+ const defaultWidth = {
23
+ "--width-xs": typeof width === "object" ? width.xs || 196 : width
24
+ };
25
+ if (typeof width === "object") {
26
+ return Object.entries(width).reduce((acc, [bp, value]) => {
27
+ acc[`--width-${bp}`] = value;
28
+ return acc;
29
+ }, defaultWidth);
30
+ }
31
+ return defaultWidth;
32
+ });
33
+ const computedStyle = computed(() => {
34
+ const { color } = props;
35
+ return {
36
+ ...formattedWidth.value,
37
+ "--book-color": color
38
+ };
39
+ });
40
+ const computedClass = computed(() => {
41
+ const basic = ["pxd-book--container w-fit relative transform-3d duration-300 motion-safe:transition-transform"];
42
+ basic.push(
43
+ ...Object.keys(formattedWidth.value).map((bp) => presetWidthClasses[bp])
44
+ );
45
+ return basic;
46
+ });
12
47
  </script>
13
48
 
14
49
  <template>
15
50
  <div class="pxd-book inline-flex w-fit">
16
51
  <div
17
- class="pxd-book--container w-fit relative transform-3d cursor-default duration-300 motion-safe:transition-transform"
18
- :style="{ '--book-width': width, '--book-color': color }"
52
+ :class="computedClass"
53
+ :style="computedStyle"
19
54
  >
20
55
  <div class="pxd-book--content flex flex-col h-full overflow-hidden translate-z-0 relative bg-background-secondary">
21
56
  <div
@@ -37,7 +72,11 @@ defineProps({
37
72
  <div aria-hidden="true" class="pxd-book--spine h-full opacity-20" />
38
73
 
39
74
  <div class="pxd-book--content-inner flex flex-col w-full">
40
- <span class="pxd-book--title font-semibold text-balance pr-2">{{ title }}</span>
75
+ <span class="pxd-book--title font-semibold text-balance pr-2">
76
+ <slot name="title">
77
+ {{ title }}
78
+ </slot>
79
+ </span>
41
80
 
42
81
  <div v-if="variant === 'simple'" class="pxd-book--icon">
43
82
  <slot name="icon">
@@ -146,9 +185,7 @@ defineProps({
146
185
  transform: translateZ(calc(-1 * var(--book-depth)));
147
186
  }
148
187
 
149
- @media (hover: hover) {
150
- .pxd-book:hover .pxd-book--container {
151
- transform: rotateY(var(--hover-rotate)) scale(var(--hover-scale)) translateX(var(--hover-translate-x));
152
- }
188
+ .pxd-book:hover .pxd-book--container {
189
+ transform: rotateY(var(--hover-rotate)) scale(var(--hover-scale)) translateX(var(--hover-translate-x));
153
190
  }
154
191
  </style>
@@ -1,20 +1,22 @@
1
- import type { ComponentLabel } from '../../types/components';
1
+ import type { ComponentLabel, ResponsiveValue } from '../../types/components';
2
2
  interface Props {
3
3
  color?: string;
4
4
  title?: ComponentLabel;
5
- width?: number | string;
5
+ width?: number | string | ResponsiveValue<number>;
6
6
  variant?: 'simple' | 'stripe';
7
7
  textured?: boolean;
8
8
  }
9
- declare var __VLS_1: {}, __VLS_3: {};
9
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
10
10
  type __VLS_Slots = {} & {
11
11
  icon?: (props: typeof __VLS_1) => any;
12
12
  } & {
13
- icon?: (props: typeof __VLS_3) => any;
13
+ title?: (props: typeof __VLS_3) => any;
14
+ } & {
15
+ icon?: (props: typeof __VLS_5) => any;
14
16
  };
15
17
  declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
16
18
  variant: "simple" | "stripe";
17
- width: number | string;
19
+ width: number;
18
20
  textured: boolean;
19
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
22
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -47,7 +47,7 @@ const DISABLED_CLASS_NAMES = "is-disabled bg-gray-100 hover:bg-gray-100 active:b
47
47
  const computedSize = useComputedSize(props.size, SIZES);
48
48
  const computedFontSize = useComputedSize(props.size, FONT_SIZES);
49
49
  const computedDisabled = computed(() => props.disabled || props.loading);
50
- const computedClasses = computed(() => {
50
+ const computedClass = computed(() => {
51
51
  const classNames = ["pxd-button cursor-pointer select-none items-center motion-safe:transition-all", ALIGNMENTS[props.align]];
52
52
  classNames.push(computedFontSize.value);
53
53
  if (props.variant !== "simple") {
@@ -78,7 +78,7 @@ function onButtonDblClick(event) {
78
78
  <component
79
79
  :is="as"
80
80
  role="button"
81
- :class="computedClasses"
81
+ :class="computedClass"
82
82
  :disabled="computedDisabled"
83
83
  @click="onButtonClick"
84
84
  @dblclick.prevent="onButtonDblClick"
@@ -74,7 +74,7 @@ onMounted(() => {
74
74
  {{ title }}
75
75
  </slot>
76
76
 
77
- <ChevronDownIcon class="flex-shrink-0 size-4 group-data-[state=open]/collapse:-rotate-180 motion-safe:transition-transform motion-safe:duration-200" />
77
+ <ChevronDownIcon class="flex-shrink-0 size-4 group-data-[state=open]/collapse:-rotate-180 motion-safe:transition-transform" />
78
78
  </button>
79
79
  </h3>
80
80
 
@@ -104,8 +104,10 @@ onMounted(() => {
104
104
  will-change: height;
105
105
  }
106
106
 
107
- .pxd-transition--collapse-enter-active,
108
- .pxd-transition--collapse-leave-active {
109
- transition: height 0.2s cubic-bezier(0.33, 1, 0.68, 1);
107
+ @media (prefers-reduced-motion: no-preference) {
108
+ .pxd-transition--collapse-enter-active,
109
+ .pxd-transition--collapse-leave-active {
110
+ transition: height var(--default-transition-duration) var(--default-transition-timing-function);
111
+ }
110
112
  }
111
113
  </style>
@@ -0,0 +1,37 @@
1
+ <script setup>
2
+ defineOptions({
3
+ name: "PEmptyState"
4
+ });
5
+ defineProps({
6
+ title: { type: String, required: false },
7
+ description: { type: String, required: false }
8
+ });
9
+ </script>
10
+
11
+ <template>
12
+ <div class="pxd-empty-state border rounded-lg py-12 px-18 bg-background w-full">
13
+ <div class="max-w-sm mx-auto flex flex-col space-y-6">
14
+ <template v-if="$slots.icon">
15
+ <div class="pxd-empty-state--icon border rounded-md p-3.5 size-15 flex items-center justify-center mx-auto text-foreground-secondary">
16
+ <slot name="icon" />
17
+ </div>
18
+ </template>
19
+
20
+ <div class="pxd-empty-state--content flex flex-col gap-2">
21
+ <p class="pxd-empty-state--title text-foreground text-base text-center font-medium">
22
+ <slot name="title">
23
+ {{ title }}
24
+ </slot>
25
+ </p>
26
+
27
+ <p class="pxd-empty-state--description text-foreground-secondary text-sm text-center">
28
+ <slot name="description">
29
+ {{ description }}
30
+ </slot>
31
+ </p>
32
+ </div>
33
+
34
+ <slot />
35
+ </div>
36
+ </div>
37
+ </template>
@@ -0,0 +1,22 @@
1
+ interface Props {
2
+ title?: string;
3
+ description?: string;
4
+ }
5
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {}, __VLS_7: {};
6
+ type __VLS_Slots = {} & {
7
+ icon?: (props: typeof __VLS_1) => any;
8
+ } & {
9
+ title?: (props: typeof __VLS_3) => any;
10
+ } & {
11
+ description?: (props: typeof __VLS_5) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_7) => any;
14
+ };
15
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -138,7 +138,7 @@ onBeforeUnmount(() => {
138
138
 
139
139
  &.effective:not(.is-disabled):active .pxd-hold-button--overlay {
140
140
  clip-path: inset(0px);
141
- transition: clip-path var(--ds) ease-out, opacity .2s ease-out;
141
+ transition: clip-path var(--ds) ease-out, opacity var(--default-transition-duration) var(--default-transition-timing-function);
142
142
  }
143
143
  }
144
144
  </style>
@@ -12,6 +12,7 @@ export { default as Collapse } from './collapse/index.vue';
12
12
  export { default as CollapseGroup } from './collapse-group/index.vue';
13
13
  export { default as ConfigProvider } from './config-provider/index.vue';
14
14
  export { default as Description } from './description/index.vue';
15
+ export { default as EmptyState } from './empty-state/index.vue';
15
16
  export { default as Error } from './error/index.vue';
16
17
  export { default as Gauge } from './gauge/index.vue';
17
18
  export { default as HoldButton } from './hold-button/index.vue';
@@ -19,13 +20,21 @@ export { default as Input } from './input/index.vue';
19
20
  export { default as Kbd } from './kbd/index.vue';
20
21
  export { default as LinkButton } from './link-button/index.vue';
21
22
  export { default as LoadingDots } from './loading-dots/index.vue';
23
+ export { default as Material } from './material/index.vue';
24
+ export { default as Menu } from './menu/index.vue';
25
+ export { default as MenuItem } from './menu-item/index.vue';
26
+ export { default as MenuList } from './menu-list/index.vue';
22
27
  export { default as MoreButton } from './more-button/index.vue';
23
28
  export { default as Note } from './note/index.vue';
29
+ export { default as Pagination } from './pagination/index.vue';
24
30
  export { default as PinInput } from './pin-input/index.vue';
25
31
  export { default as Popover } from './popover/index.vue';
26
32
  export { default as Progress } from './progress/index.vue';
27
33
  export { default as Radio } from './radio/index.vue';
28
34
  export { default as RadioGroup } from './radio-group/index.vue';
35
+ export { default as Resizable } from './resizable/index.vue';
36
+ export { default as ResizableHandle } from './resizable-handle/index.vue';
37
+ export { default as ResizablePanel } from './resizable-panel/index.vue';
29
38
  export { default as Scrollable } from './scrollable/index.vue';
30
39
  export { default as Skeleton } from './skeleton/index.vue';
31
40
  export { default as Slider } from './slider/index.vue';
@@ -12,6 +12,7 @@ export { default as Collapse } from "./collapse/index.vue";
12
12
  export { default as CollapseGroup } from "./collapse-group/index.vue";
13
13
  export { default as ConfigProvider } from "./config-provider/index.vue";
14
14
  export { default as Description } from "./description/index.vue";
15
+ export { default as EmptyState } from "./empty-state/index.vue";
15
16
  export { default as Error } from "./error/index.vue";
16
17
  export { default as Gauge } from "./gauge/index.vue";
17
18
  export { default as HoldButton } from "./hold-button/index.vue";
@@ -19,13 +20,21 @@ export { default as Input } from "./input/index.vue";
19
20
  export { default as Kbd } from "./kbd/index.vue";
20
21
  export { default as LinkButton } from "./link-button/index.vue";
21
22
  export { default as LoadingDots } from "./loading-dots/index.vue";
23
+ export { default as Material } from "./material/index.vue";
24
+ export { default as Menu } from "./menu/index.vue";
25
+ export { default as MenuItem } from "./menu-item/index.vue";
26
+ export { default as MenuList } from "./menu-list/index.vue";
22
27
  export { default as MoreButton } from "./more-button/index.vue";
23
28
  export { default as Note } from "./note/index.vue";
29
+ export { default as Pagination } from "./pagination/index.vue";
24
30
  export { default as PinInput } from "./pin-input/index.vue";
25
31
  export { default as Popover } from "./popover/index.vue";
26
32
  export { default as Progress } from "./progress/index.vue";
27
33
  export { default as Radio } from "./radio/index.vue";
28
34
  export { default as RadioGroup } from "./radio-group/index.vue";
35
+ export { default as Resizable } from "./resizable/index.vue";
36
+ export { default as ResizableHandle } from "./resizable-handle/index.vue";
37
+ export { default as ResizablePanel } from "./resizable-panel/index.vue";
29
38
  export { default as Scrollable } from "./scrollable/index.vue";
30
39
  export { default as Skeleton } from "./skeleton/index.vue";
31
40
  export { default as Slider } from "./slider/index.vue";
@@ -43,7 +43,7 @@ const SIZES = {
43
43
  const modelValue = useModelValue(props, emits);
44
44
  const internalInputType = shallowRef(props.password ? "password" : "text");
45
45
  const computedSize = useComputedSize(props.size, SIZES);
46
- const computedClasses = computed(() => {
46
+ const computedClass = computed(() => {
47
47
  const basic = ["pxd-input--border flex items-center relative h-full overflow-hidden rounded-md bg-background motion-safe:transition-all"];
48
48
  basic.push(computedSize.value);
49
49
  if (props.disabled) {
@@ -80,7 +80,7 @@ function clearInputValue() {
80
80
  <slot name="label">{{ label }}</slot>
81
81
  </div>
82
82
 
83
- <div :class="computedClasses">
83
+ <div :class="computedClass">
84
84
  <div
85
85
  v-if="$slots.prefix"
86
86
  aria-hidden="true"
@@ -28,12 +28,12 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
28
28
  blur: (args_0: FocusEvent) => any;
29
29
  change: (args_0: Event) => any;
30
30
  focus: (args_0: FocusEvent) => any;
31
- "update:modelValue": (args_0: NonNullable<ComponentLabel>) => any;
31
+ "update:modelValue": (args_0: string) => any;
32
32
  }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
33
33
  onBlur?: (args_0: FocusEvent) => any;
34
34
  onChange?: (args_0: Event) => any;
35
35
  onFocus?: (args_0: FocusEvent) => any;
36
- "onUpdate:modelValue"?: (args_0: NonNullable<ComponentLabel>) => any;
36
+ "onUpdate:modelValue"?: (args_0: string) => any;
37
37
  }>, {
38
38
  modelValue: ComponentLabel;
39
39
  prefixStyle: boolean;
@@ -16,7 +16,7 @@ const props = defineProps({
16
16
  });
17
17
  const emits = defineEmits(["click"]);
18
18
  const attrs = useAttrs();
19
- const computedClasses = computed(() => {
19
+ const computedClass = computed(() => {
20
20
  const basic = ["pxd-link-button"];
21
21
  if (props.type === "text") {
22
22
  basic.push("font-medium hover:underline hover:opacity-60 active:opacity-80 motion-safe:transition-opacity");
@@ -52,7 +52,7 @@ function onLinkClick(ev) {
52
52
  <template>
53
53
  <PButton
54
54
  :align="align"
55
- :class="computedClasses"
55
+ :class="computedClass"
56
56
  v-bind="computedAttrs"
57
57
  @click="onLinkClick"
58
58
  >
@@ -0,0 +1,52 @@
1
+ <script setup>
2
+ import PStack from "../stack/index.vue";
3
+ defineOptions({
4
+ name: "PMaterial"
5
+ });
6
+ defineProps({
7
+ variant: { type: String, required: false, default: "default" }
8
+ });
9
+ </script>
10
+
11
+ <template>
12
+ <PStack class="pxd-material bg-background" :class="variant">
13
+ <slot />
14
+ </PStack>
15
+ </template>
16
+
17
+ <style lang="postcss">
18
+ .pxd-material {
19
+ &.default {
20
+ border-radius: 6px;
21
+ box-shadow: var(--shadow-border-default);
22
+ }
23
+ &.small {
24
+ border-radius: 6px;
25
+ box-shadow: var(--shadow-border-small);
26
+ }
27
+ &.medium {
28
+ border-radius: 12px;
29
+ box-shadow: var(--shadow-border-medium);
30
+ }
31
+ &.large {
32
+ border-radius: 12px;
33
+ box-shadow: var(--shadow-border-large);
34
+ }
35
+ &.tooltip {
36
+ border-radius: 6px;
37
+ box-shadow: var(--shadow-border-tooltip);
38
+ }
39
+ &.menu {
40
+ border-radius: 12px;
41
+ box-shadow: var(--shadow-border-menu);
42
+ }
43
+ &.modal {
44
+ border-radius: 12px;
45
+ box-shadow: var(--shadow-border-modal);
46
+ }
47
+ &.fullscreen {
48
+ border-radius: 16px;
49
+ box-shadow: var(--shadow-border-fullscreen);
50
+ }
51
+ }
52
+ </style>
@@ -0,0 +1,17 @@
1
+ interface Props {
2
+ variant?: 'default' | 'small' | 'medium' | 'large' | 'tooltip' | 'menu' | 'modal' | 'fullscreen';
3
+ }
4
+ declare var __VLS_5: {};
5
+ type __VLS_Slots = {} & {
6
+ default?: (props: typeof __VLS_5) => any;
7
+ };
8
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
9
+ variant: "default" | "small" | "medium" | "large" | "tooltip" | "menu" | "modal" | "fullscreen";
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
11
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,46 @@
1
+ <script setup>
2
+ import { shallowRef } from "vue";
3
+ import PMenuList from "../menu-list/index.vue";
4
+ import PPopover from "../popover/index.vue";
5
+ defineOptions({
6
+ name: "PMenu"
7
+ });
8
+ defineProps({
9
+ options: { type: Array, required: false, default: () => [] },
10
+ position: { type: null, required: false, default: "bottom-start" },
11
+ menuWidth: { type: [String, Number], required: false }
12
+ });
13
+ const emits = defineEmits(["optionClick"]);
14
+ const popoverRef = shallowRef();
15
+ function onOptionClick(option, index) {
16
+ emits("optionClick", option, index);
17
+ popoverRef.value.hide();
18
+ }
19
+ </script>
20
+
21
+ <template>
22
+ <PPopover
23
+ ref="popoverRef"
24
+ trigger="click"
25
+ class="pxd-menu"
26
+ scroll-hidden
27
+ :open-delay="0"
28
+ :hide-delay="200"
29
+ :show-arrow="false"
30
+ :position="position"
31
+ :show-transition="false"
32
+ enterable
33
+ >
34
+ <slot />
35
+
36
+ <template #content>
37
+ <PMenuList
38
+ :width="menuWidth"
39
+ :options="options"
40
+ @option-click="onOptionClick"
41
+ >
42
+ <slot name="items" />
43
+ </PMenuList>
44
+ </template>
45
+ </PPopover>
46
+ </template>
@@ -0,0 +1,27 @@
1
+ import type { MenuListOption, PopoverPosition } from '../../types/components';
2
+ interface Props {
3
+ options?: MenuListOption[];
4
+ position?: PopoverPosition;
5
+ menuWidth?: string | number;
6
+ }
7
+ declare var __VLS_6: {}, __VLS_15: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_6) => any;
10
+ } & {
11
+ items?: (props: typeof __VLS_15) => any;
12
+ };
13
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ optionClick: (option: MenuListOption, index: number) => any;
15
+ }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
16
+ onOptionClick?: (option: MenuListOption, index: number) => any;
17
+ }>, {
18
+ position: PopoverPosition;
19
+ options: MenuListOption[];
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
21
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };