pxd 0.0.45 → 0.0.46

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 (81) hide show
  1. package/dist/components/_internal/fragment-container.d.ts +2 -0
  2. package/dist/components/_internal/fragment-container.js +25 -0
  3. package/dist/components/badge/index.vue +1 -1
  4. package/dist/components/button/index.vue +1 -1
  5. package/dist/components/carousel-group/index.d.vue.ts +0 -1
  6. package/dist/components/carousel-group/index.vue +16 -4
  7. package/dist/components/carousel-group/index.vue.d.ts +0 -1
  8. package/dist/components/choicebox/index.vue +1 -1
  9. package/dist/components/choicebox-group/index.vue +1 -1
  10. package/dist/components/config-provider/index.vue +1 -1
  11. package/dist/components/error/index.d.vue.ts +2 -2
  12. package/dist/components/error/index.vue +1 -1
  13. package/dist/components/error/index.vue.d.ts +2 -2
  14. package/dist/components/fader/index.vue +4 -21
  15. package/dist/components/index.d.ts +1 -1
  16. package/dist/components/index.js +1 -1
  17. package/dist/components/input/index.d.vue.ts +4 -5
  18. package/dist/components/input/index.vue +67 -71
  19. package/dist/components/input/index.vue.d.ts +4 -5
  20. package/dist/components/intersection-observer/index.vue +3 -3
  21. package/dist/components/link-button/index.vue +1 -1
  22. package/dist/components/list-item/index.vue +1 -1
  23. package/dist/components/menu/index.d.vue.ts +3 -3
  24. package/dist/components/menu/index.vue +1 -7
  25. package/dist/components/menu/index.vue.d.ts +3 -3
  26. package/dist/components/noise-background/index.d.vue.ts +19 -0
  27. package/dist/components/noise-background/index.vue +18 -0
  28. package/dist/components/noise-background/index.vue.d.ts +19 -0
  29. package/dist/components/note/index.d.vue.ts +3 -3
  30. package/dist/components/note/index.vue +1 -1
  31. package/dist/components/note/index.vue.d.ts +3 -3
  32. package/dist/components/number-input/index.vue +1 -1
  33. package/dist/components/pin-input/index.d.vue.ts +3 -14
  34. package/dist/components/pin-input/index.vue +28 -40
  35. package/dist/components/pin-input/index.vue.d.ts +3 -14
  36. package/dist/components/placeholder/index.vue +3 -5
  37. package/dist/components/popover/index.d.vue.ts +6 -16
  38. package/dist/components/popover/index.vue +71 -284
  39. package/dist/components/popover/index.vue.d.ts +6 -16
  40. package/dist/components/stack/index.vue +1 -1
  41. package/dist/components/status-dot/index.d.vue.ts +3 -2
  42. package/dist/components/status-dot/index.vue +1 -1
  43. package/dist/components/status-dot/index.vue.d.ts +3 -2
  44. package/dist/components/text/index.vue +1 -1
  45. package/dist/components/textarea/index.d.vue.ts +2 -13
  46. package/dist/components/textarea/index.vue +25 -33
  47. package/dist/components/textarea/index.vue.d.ts +2 -13
  48. package/dist/components/time-picker/index.d.vue.ts +7 -0
  49. package/dist/components/time-picker/index.vue +76 -93
  50. package/dist/components/time-picker/index.vue.d.ts +7 -0
  51. package/dist/components/toggle/index.d.vue.ts +4 -7
  52. package/dist/components/toggle/index.vue +32 -41
  53. package/dist/components/toggle/index.vue.d.ts +4 -7
  54. package/dist/components/tooltip/index.vue +1 -1
  55. package/dist/composables/use-outside-click.js +8 -2
  56. package/dist/styles/source.css +4 -3
  57. package/dist/styles/styles.css +1 -1
  58. package/dist/styles/tw.css +4 -3
  59. package/dist/types/components/error.d.ts +1 -1
  60. package/dist/types/components/input.d.ts +1 -1
  61. package/dist/utils/debounce.d.ts +1 -1
  62. package/dist/utils/debounce.js +1 -1
  63. package/dist/utils/get.d.ts +0 -8
  64. package/dist/utils/get.js +0 -125
  65. package/dist/utils/index.d.ts +11 -0
  66. package/dist/utils/index.js +11 -0
  67. package/dist/utils/throttle.d.ts +7 -1
  68. package/dist/utils/throttle.js +16 -1
  69. package/package.json +8 -2
  70. package/volar.d.ts +1 -1
  71. package/dist/components/keep-alive-container/index.d.vue.ts +0 -13
  72. package/dist/components/keep-alive-container/index.vue +0 -11
  73. package/dist/components/keep-alive-container/index.vue.d.ts +0 -13
  74. package/dist/utils/debounce/compat.d.ts +0 -143
  75. package/dist/utils/debounce/compat.js +0 -47
  76. package/dist/utils/debounce/index.d.ts +0 -73
  77. package/dist/utils/debounce/index.js +0 -60
  78. package/dist/utils/throttle/compat.d.ts +0 -79
  79. package/dist/utils/throttle/compat.js +0 -9
  80. package/dist/utils/throttle/index.d.ts +0 -53
  81. package/dist/utils/throttle/index.js +0 -34
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { defineComponent, h, version } from "vue";
2
+ export default defineComponent({
3
+ name: "FragmentContainer",
4
+ functional: true,
5
+ render: (() => {
6
+ if (version.startsWith("2")) {
7
+ return function(_, context) {
8
+ const slots = context.slots().default;
9
+ if (!slots || !slots.length) {
10
+ return null;
11
+ }
12
+ let renderAs = slots[0];
13
+ if (slots.length > 1) {
14
+ renderAs = h("div", { class: "pxd-fragment-container", ref: context.data?.ref }, slots);
15
+ } else if (context.data?.ref && !renderAs.data?.ref) {
16
+ renderAs.data.ref = context.data?.ref;
17
+ }
18
+ return renderAs;
19
+ };
20
+ }
21
+ return function() {
22
+ return this.$slots.default?.();
23
+ };
24
+ })()
25
+ });
@@ -68,7 +68,7 @@ const badgeAttrs = computed(() => {
68
68
  <template>
69
69
  <Component :is="as" :class="computedClass" v-bind="badgeAttrs">
70
70
  <slot />
71
- </component>
71
+ </Component>
72
72
  </template>
73
73
 
74
74
  <style lang="postcss">
@@ -106,5 +106,5 @@ function onButtonDblClick(event) {
106
106
  </span>
107
107
 
108
108
  <slot name="suffix" />
109
- </component>
109
+ </Component>
110
110
  </template>
@@ -24,7 +24,6 @@ declare const __VLS_base: import("vue").DefineComponent<CarouselGroupProps, {},
24
24
  indicatorType: "dot" | "line";
25
25
  indicatorPosition: import("../../types/shared").BasePosition;
26
26
  pauseOnHover: boolean;
27
- toggleOnWheel: boolean;
28
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
29
  declare const _default: typeof __VLS_export;
@@ -20,7 +20,7 @@ const props = defineProps({
20
20
  indicatorType: { type: String, required: false, default: "line" },
21
21
  indicatorPosition: { type: String, required: false, default: "bottom" },
22
22
  pauseOnHover: { type: Boolean, required: false, default: true },
23
- toggleOnWheel: { type: Boolean, required: false, default: true }
23
+ toggleOnWheel: { type: Boolean, required: false }
24
24
  });
25
25
  const emits = defineEmits(["change"]);
26
26
  const THROTTLE_INTERVALS = 550;
@@ -71,12 +71,24 @@ function onWheelToggle(ev) {
71
71
  if (!props.toggleOnWheel) {
72
72
  return;
73
73
  }
74
+ const length = carousels.value.length;
75
+ if (length <= 1) {
76
+ return;
77
+ }
74
78
  const delta = ev.deltaY > 0 ? 1 : -1;
75
- onToggleClick(delta);
76
- const index = virtualIndex.value;
77
- if (!props.loop && (index !== 0 && index !== carousels.value.length - 1)) {
79
+ const indexBefore = virtualIndex.value;
80
+ const lastIndex = length - 1;
81
+ if (!props.loop) {
82
+ const isAtFirstAndGoPrev = indexBefore <= 0 && delta < 0;
83
+ const isAtLastAndGoNext = indexBefore >= lastIndex && delta > 0;
84
+ if (isAtFirstAndGoPrev || isAtLastAndGoNext) {
85
+ return;
86
+ }
87
+ }
88
+ if (ev.cancelable) {
78
89
  ev.preventDefault();
79
90
  }
91
+ onToggleClick(delta);
80
92
  }
81
93
  function resetContainerPosition(resetIndex) {
82
94
  const containerClassList = sliderRef.value.classList;
@@ -24,7 +24,6 @@ declare const __VLS_base: import("vue").DefineComponent<CarouselGroupProps, {},
24
24
  indicatorType: "dot" | "line";
25
25
  indicatorPosition: import("../../types/shared").BasePosition;
26
26
  pauseOnHover: boolean;
27
- toggleOnWheel: boolean;
28
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
28
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
30
29
  declare const _default: typeof __VLS_export;
@@ -41,7 +41,7 @@ const computedAttrs = computed(() => {
41
41
  </slot>
42
42
  </span>
43
43
  </div>
44
- </component>
44
+ </Component>
45
45
  </template>
46
46
 
47
47
  <style lang="postcss">
@@ -65,6 +65,6 @@ provideChoiceboxGroupModelValue(modelValue);
65
65
  v-bind="option"
66
66
  />
67
67
  </slot>
68
- </component>
68
+ </Component>
69
69
  </div>
70
70
  </template>
@@ -15,5 +15,5 @@ provideConfigProvider(props);
15
15
  <template>
16
16
  <Component :is="as" class="pxd-config-provider">
17
17
  <slot />
18
- </component>
18
+ </Component>
19
19
  </template>
@@ -1,8 +1,8 @@
1
1
  import type { ErrorType } from '../../types/components/error';
2
- import type { ComponentSizeWithXs } from '../../types/shared';
2
+ import type { ComponentLabel, ComponentSizeWithXs } from '../../types/shared';
3
3
  interface Props {
4
4
  size?: ComponentSizeWithXs;
5
- label?: string;
5
+ label?: ComponentLabel;
6
6
  error?: ErrorType;
7
7
  }
8
8
  declare var __VLS_6: {};
@@ -10,7 +10,7 @@ defineOptions({
10
10
  });
11
11
  const props = defineProps({
12
12
  size: { type: String, required: false, default: "md" },
13
- label: { type: String, required: false },
13
+ label: { type: [String, Number, Array, null], required: false },
14
14
  error: { type: Object, required: false }
15
15
  });
16
16
  const SIZES = {
@@ -1,8 +1,8 @@
1
1
  import type { ErrorType } from '../../types/components/error';
2
- import type { ComponentSizeWithXs } from '../../types/shared';
2
+ import type { ComponentLabel, ComponentSizeWithXs } from '../../types/shared';
3
3
  interface Props {
4
4
  size?: ComponentSizeWithXs;
5
- label?: string;
5
+ label?: ComponentLabel;
6
6
  error?: ErrorType;
7
7
  }
8
8
  declare var __VLS_6: {};
@@ -76,8 +76,7 @@ onBeforeUnmount(() => {
76
76
  </template>
77
77
 
78
78
  <style lang="postcss">
79
- .pxd-fader--item::before,
80
- .pxd-fader--item::after {
79
+ .pxd-fader--item::before {
81
80
  content: '';
82
81
  position: absolute;
83
82
  border-radius: inherit;
@@ -88,15 +87,12 @@ onBeforeUnmount(() => {
88
87
  }
89
88
 
90
89
  .pxd-fader--item.left::before,
91
- .pxd-fader--item.top::before,
92
- .pxd-fader--item.right::after,
93
- .pxd-fader--item.bottom::after {
90
+ .pxd-fader--item.top::before {
94
91
  opacity: 1;
95
92
  }
96
93
 
97
94
  .pxd-fader--item.horizontal {
98
- &::before,
99
- &::after {
95
+ &::before {
100
96
  top: 0;
101
97
  width: var(--fader-size, 16px);
102
98
  height: 100%;
@@ -107,17 +103,10 @@ onBeforeUnmount(() => {
107
103
  --dir: to left;
108
104
  --dir-revert: to right;
109
105
  }
110
-
111
- &::after {
112
- right: 0;
113
- --dir: to right;
114
- --dir-revert: to left;
115
- }
116
106
  }
117
107
 
118
108
  .pxd-fader--item.vertical {
119
- &::before,
120
- &::after {
109
+ &::before {
121
110
  left: 0;
122
111
  width: 100%;
123
112
  height: var(--fader-size, 16px);
@@ -128,11 +117,5 @@ onBeforeUnmount(() => {
128
117
  --dir: to top;
129
118
  --dir-revert: to bottom;
130
119
  }
131
-
132
- &::after {
133
- bottom: 0;
134
- --dir: to bottom;
135
- --dir-revert: to top;
136
- }
137
120
  }
138
121
  </style>
@@ -33,7 +33,6 @@ export { default as HoldButton } from './hold-button/index.vue';
33
33
  export { default as Input } from './input/index.vue';
34
34
  export { default as IntersectionObserver } from './intersection-observer/index.vue';
35
35
  export { default as Kbd } from './kbd/index.vue';
36
- export { default as KeepAliveContainer } from './keep-alive-container/index.vue';
37
36
  export { default as LinkButton } from './link-button/index.vue';
38
37
  export { default as List } from './list/index.vue';
39
38
  export { default as ListItem } from './list-item/index.vue';
@@ -44,6 +43,7 @@ export { default as Menu } from './menu/index.vue';
44
43
  export { default as Message } from './message/index.vue';
45
44
  export { default as Modal } from './modal/index.vue';
46
45
  export { default as MoreButton } from './more-button/index.vue';
46
+ export { default as NoiseBackground } from './noise-background/index.vue';
47
47
  export { default as Note } from './note/index.vue';
48
48
  export { default as NumberInput } from './number-input/index.vue';
49
49
  export { default as Overlay } from './overlay/index.vue';
@@ -33,7 +33,6 @@ export { default as HoldButton } from "./hold-button/index.vue";
33
33
  export { default as Input } from "./input/index.vue";
34
34
  export { default as IntersectionObserver } from "./intersection-observer/index.vue";
35
35
  export { default as Kbd } from "./kbd/index.vue";
36
- export { default as KeepAliveContainer } from "./keep-alive-container/index.vue";
37
36
  export { default as LinkButton } from "./link-button/index.vue";
38
37
  export { default as List } from "./list/index.vue";
39
38
  export { default as ListItem } from "./list-item/index.vue";
@@ -44,6 +43,7 @@ export { default as Menu } from "./menu/index.vue";
44
43
  export { default as Message } from "./message/index.vue";
45
44
  export { default as Modal } from "./modal/index.vue";
46
45
  export { default as MoreButton } from "./more-button/index.vue";
46
+ export { default as NoiseBackground } from "./noise-background/index.vue";
47
47
  export { default as Note } from "./note/index.vue";
48
48
  export { default as NumberInput } from "./number-input/index.vue";
49
49
  export { default as Overlay } from "./overlay/index.vue";
@@ -1,13 +1,11 @@
1
1
  import type { InputProps } from '../../types/components/input';
2
2
  declare function setNativeInputValue(value: any): void;
3
3
  declare function clearValue(): void;
4
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_20: {};
4
+ declare var __VLS_1: {}, __VLS_18: {};
5
5
  type __VLS_Slots = {} & {
6
- label?: (props: typeof __VLS_1) => any;
6
+ prefix?: (props: typeof __VLS_1) => any;
7
7
  } & {
8
- prefix?: (props: typeof __VLS_3) => any;
9
- } & {
10
- suffix?: (props: typeof __VLS_20) => any;
8
+ suffix?: (props: typeof __VLS_18) => any;
11
9
  };
12
10
  declare const __VLS_base: import("vue").DefineComponent<InputProps, {
13
11
  blur: () => void | undefined;
@@ -39,6 +37,7 @@ declare const __VLS_base: import("vue").DefineComponent<InputProps, {
39
37
  "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
40
38
  }>, {
41
39
  placeholder: string;
40
+ error: boolean | string;
42
41
  align: "left" | "center" | "right";
43
42
  modelValue: import("../../types/shared").ComponentLabel;
44
43
  prefixStyle: boolean;
@@ -8,7 +8,6 @@ import { useModelValue } from "../../composables/use-model-value";
8
8
  import { isTruthyProp } from "../../utils/format";
9
9
  import { getFallbackValue } from "../../utils/get";
10
10
  import { getUniqueId } from "../../utils/uid";
11
- import PError from "../error/index.vue";
12
11
  defineOptions({
13
12
  name: "PInput",
14
13
  model: {
@@ -18,7 +17,7 @@ defineOptions({
18
17
  });
19
18
  const props = defineProps({
20
19
  size: { type: String, required: false },
21
- error: { type: String, required: false },
20
+ error: { type: [Boolean, String], required: false, default: false },
22
21
  min: { type: [Number, String], required: false },
23
22
  max: { type: [Number, String], required: false },
24
23
  align: { type: String, required: false, default: "left" },
@@ -42,10 +41,10 @@ const props = defineProps({
42
41
  });
43
42
  const emits = defineEmits(["click", "input", "change", "focus", "blur", "keydown", "update:modelValue", "compositionstart", "compositionupdate", "compositionend"]);
44
43
  const SIZES = {
45
- xs: "h-6 text-xs",
46
- sm: "h-7.5 text-sm",
47
- md: "h-9 text-sm",
48
- lg: "h-10 text-base"
44
+ xs: "h-6 text-xs rounded-sm",
45
+ sm: "h-7.5 text-sm rounded-md",
46
+ md: "h-9 text-sm rounded-md",
47
+ lg: "h-10 text-base rounded-lg"
49
48
  };
50
49
  const ALIGN = {
51
50
  left: "text-left",
@@ -60,7 +59,7 @@ const isComposing = shallowRef(false);
60
59
  const isPasswordVisible = shallowRef(!props.password);
61
60
  const internalInputType = computed(() => props.inputType || isPasswordVisible.value ? "text" : "password");
62
61
  const computedClass = computed(() => {
63
- const classes = ["pxd-input--border group relative flex items-center overflow-hidden rounded-md bg-background-100 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-gray-100 motion-safe:transition-all"];
62
+ const classes = [];
64
63
  classes.push(getFallbackValue(props.size, SIZES, config.size));
65
64
  if (isTruthyProp(props.disabled)) {
66
65
  classes.push("is-disabled");
@@ -162,77 +161,74 @@ defineExpose({
162
161
  </script>
163
162
 
164
163
  <template>
165
- <label class="pxd-input block w-full max-w-full" :for="uniqueId" @click="onClick" @dragstart.prevent>
166
- <div v-if="label || $slots.label" class="pxd-form--label">
167
- <slot name="label">{{ label }}</slot>
164
+ <label
165
+ class="pxd-input pxd-input--border group relative flex w-full max-w-full items-center overflow-hidden bg-background-100 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:bg-gray-100 motion-safe:transition-all"
166
+ :for="uniqueId"
167
+ :data-disabled="disabled"
168
+ :class="computedClass"
169
+ @click="onClick"
170
+ @dragstart.prevent
171
+ >
172
+ <div
173
+ v-if="$slots.prefix"
174
+ class="pxd-input--prefix text-sm pl-3 flex h-full items-center text-gray-700"
175
+ :class="{ 'pr-3 rounded-l-inherit border-r border-gray-300 bg-background-200': prefixStyle }"
176
+ >
177
+ <slot name="prefix" />
168
178
  </div>
169
179
 
170
- <div :data-disabled="disabled" :class="computedClass" tabindex="-1">
171
- <div
172
- v-if="$slots.prefix"
173
- class="pxd-input--prefix text-sm pl-3 flex h-full items-center text-gray-700"
174
- :class="{ 'pr-3 rounded-l-inherit border-r border-gray-300 bg-background-200': prefixStyle }"
175
- >
176
- <slot name="prefix" />
177
- </div>
178
-
179
- <input
180
- :id="uniqueId"
181
- ref="inputRef"
182
- class="px-3 py-0 size-full appearance-none rounded-inherit border-none bg-transparent font-inherit outline-none file:font-medium file:border-0 file:bg-transparent placeholder:text-gray-600 placeholder:select-none disabled:cursor-not-allowed disabled:text-gray-700 disabled:placeholder:text-gray-500"
183
- :class="{ 'pr-9': password || allowClear, [ALIGN[align]]: true }"
184
- :type="internalInputType"
185
- :min="min"
186
- :max="max"
187
- autocorrect="off"
188
- autocomplete="off"
189
- autocapitalize="off"
190
- :readonly="readonly"
191
- :disabled="disabled"
192
- :required="required"
193
- :inputmode="inputmode"
194
- :minlength="minlength"
195
- :maxlength="maxlength"
196
- :autofocus="autofocus"
197
- :placeholder="placeholder"
198
- :aria-disabled="disabled"
199
- :data-value="computedModelValue"
200
- @blur="onBlur"
201
- @focus="onFocus"
202
- @input="onInput"
203
- @change="onChange"
204
- @keydown="onKeydown"
205
- @compositionstart="onCompositionStart"
206
- @compositionupdate="onCompositionUpdate"
207
- @compositionend="onCompositionEnd"
208
- >
180
+ <input
181
+ :id="uniqueId"
182
+ ref="inputRef"
183
+ class="px-3 py-0 size-full appearance-none rounded-inherit border-none bg-transparent font-inherit outline-none file:font-medium file:border-0 file:bg-transparent placeholder:text-gray-600 placeholder:select-none disabled:cursor-not-allowed disabled:text-gray-700 disabled:placeholder:text-gray-500"
184
+ :class="{ 'pr-9': password || allowClear, [ALIGN[align]]: true }"
185
+ :type="internalInputType"
186
+ :min="min"
187
+ :max="max"
188
+ autocorrect="off"
189
+ autocomplete="off"
190
+ autocapitalize="off"
191
+ :readonly="readonly"
192
+ :disabled="disabled"
193
+ :required="required"
194
+ :inputmode="inputmode"
195
+ :minlength="minlength"
196
+ :maxlength="maxlength"
197
+ :autofocus="autofocus"
198
+ :placeholder="placeholder"
199
+ :aria-disabled="disabled"
200
+ :data-value="computedModelValue"
201
+ @blur="onBlur"
202
+ @focus="onFocus"
203
+ @input="onInput"
204
+ @change="onChange"
205
+ @keydown="onKeydown"
206
+ @compositionstart="onCompositionStart"
207
+ @compositionupdate="onCompositionUpdate"
208
+ @compositionend="onCompositionEnd"
209
+ >
209
210
 
210
- <div
211
- v-if="password || allowClear"
212
- v-show="computedModelValue"
213
- class="pxd-input--icon right-0 top-0 flex aspect-square h-full cursor-pointer items-center justify-center rounded-r-inherit text-gray-700"
214
- >
215
- <div v-if="password" class="p-1 rounded-sm hover:bg-background-hover hover:text-foreground active:bg-background-active motion-safe:transition-colors" @click.stop.prevent="toggleType">
216
- <EyeOffIcon v-if="isPasswordVisible" class="size-3" />
217
- <EyeIcon v-else class="size-3" />
218
- </div>
219
- <div v-if="allowClear" class="p-1 rounded-sm hover:bg-background-hover hover:text-foreground active:bg-background-active motion-safe:transition-colors" @click.stop.prevent="clearValue">
220
- <CrossIcon class="size-3" />
221
- </div>
211
+ <div
212
+ v-if="password || allowClear"
213
+ v-show="computedModelValue"
214
+ class="pxd-input--icon right-0 top-0 flex aspect-square h-full cursor-pointer items-center justify-center rounded-r-inherit text-gray-700"
215
+ >
216
+ <div v-if="password" class="p-1 rounded-sm hover:bg-background-hover hover:text-foreground active:bg-background-active motion-safe:transition-colors" @click.stop.prevent="toggleType">
217
+ <EyeOffIcon v-if="isPasswordVisible" class="size-3" />
218
+ <EyeIcon v-else class="size-3" />
222
219
  </div>
223
-
224
- <div
225
- v-if="$slots.suffix"
226
- class="pxd-input--suffix text-sm pr-3 flex h-full items-center text-gray-700"
227
- :class="{ 'pl-3 rounded-r-inherit border-l border-gray-300 bg-background-200': suffixStyle }"
228
- >
229
- <slot name="suffix" />
220
+ <div v-if="allowClear" class="p-1 rounded-sm hover:bg-background-hover hover:text-foreground active:bg-background-active motion-safe:transition-colors" @click.stop.prevent="clearValue">
221
+ <CrossIcon class="size-3" />
230
222
  </div>
231
223
  </div>
232
224
 
233
- <PError v-if="error" class="mt-2" :size="size">
234
- {{ error }}
235
- </PError>
225
+ <div
226
+ v-if="$slots.suffix"
227
+ class="pxd-input--suffix text-sm pr-3 flex h-full items-center text-gray-700"
228
+ :class="{ 'pl-3 rounded-r-inherit border-l border-gray-300 bg-background-200': suffixStyle }"
229
+ >
230
+ <slot name="suffix" />
231
+ </div>
236
232
  </label>
237
233
  </template>
238
234
 
@@ -1,13 +1,11 @@
1
1
  import type { InputProps } from '../../types/components/input';
2
2
  declare function setNativeInputValue(value: any): void;
3
3
  declare function clearValue(): void;
4
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_20: {};
4
+ declare var __VLS_1: {}, __VLS_18: {};
5
5
  type __VLS_Slots = {} & {
6
- label?: (props: typeof __VLS_1) => any;
6
+ prefix?: (props: typeof __VLS_1) => any;
7
7
  } & {
8
- prefix?: (props: typeof __VLS_3) => any;
9
- } & {
10
- suffix?: (props: typeof __VLS_20) => any;
8
+ suffix?: (props: typeof __VLS_18) => any;
11
9
  };
12
10
  declare const __VLS_base: import("vue").DefineComponent<InputProps, {
13
11
  blur: () => void | undefined;
@@ -39,6 +37,7 @@ declare const __VLS_base: import("vue").DefineComponent<InputProps, {
39
37
  "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
40
38
  }>, {
41
39
  placeholder: string;
40
+ error: boolean | string;
42
41
  align: "left" | "center" | "right";
43
42
  modelValue: import("../../types/shared").ComponentLabel;
44
43
  prefixStyle: boolean;
@@ -2,7 +2,7 @@
2
2
  import { nextTick, shallowRef } from "vue";
3
3
  import { useIntersectionObserver } from "../../composables/use-browser-observer";
4
4
  import { getCssUnitValue } from "../../utils/format";
5
- import PKeepAliveContainer from "../keep-alive-container/index.vue";
5
+ import FragmentContainer from "../_internal/fragment-container";
6
6
  defineOptions({
7
7
  name: "PIntersectionObserver"
8
8
  });
@@ -53,9 +53,9 @@ useIntersectionObserver(containerRef, ([entry]) => {
53
53
  <template>
54
54
  <div ref="containerRef" class="pxd-intersection-observer" :style="containerSize">
55
55
  <KeepAlive v-if="keepAlive">
56
- <PKeepAliveContainer v-if="isVisible">
56
+ <FragmentContainer v-if="isVisible">
57
57
  <slot />
58
- </PKeepAliveContainer>
58
+ </FragmentContainer>
59
59
  </KeepAlive>
60
60
  <template v-else>
61
61
  <slot v-if="isVisible" />
@@ -19,7 +19,7 @@ const attrs = useAttrs();
19
19
  const computedClass = computed(() => {
20
20
  const classes = ["pxd-link-button"];
21
21
  if (props.type === "text") {
22
- classes.push("font-medium hover:underline hover:opacity-60 active:opacity-80 motion-safe:transition-opacity");
22
+ classes.push("font-medium hover:underline hover:opacity-70 active:opacity-90 motion-safe:transition-opacity");
23
23
  }
24
24
  return classes.join(" ");
25
25
  });
@@ -71,5 +71,5 @@ onMounted(async () => {
71
71
  <span>{{ label }}</span>
72
72
  <span v-if="description" class="text-foreground-secondary">{{ description }}</span>
73
73
  </slot>
74
- </component>
74
+ </Component>
75
75
  </template>
@@ -6,11 +6,11 @@ interface Props {
6
6
  position?: ComponentPosition;
7
7
  closeOnPressEscape?: boolean;
8
8
  }
9
- declare var __VLS_13: {}, __VLS_24: {};
9
+ declare var __VLS_12: {}, __VLS_23: {};
10
10
  type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_13) => any;
11
+ default?: (props: typeof __VLS_12) => any;
12
12
  } & {
13
- items?: (props: typeof __VLS_24) => any;
13
+ items?: (props: typeof __VLS_23) => any;
14
14
  };
15
15
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
16
  select: (args_0: MouseEvent, args_1: ListOptionSelected) => any;
@@ -17,9 +17,6 @@ const popoverVisible = shallowRef(false);
17
17
  function onVisibleChange(visible) {
18
18
  popoverVisible.value = visible;
19
19
  }
20
- function showPopover() {
21
- onVisibleChange(true);
22
- }
23
20
  function hidePopover() {
24
21
  onVisibleChange(false);
25
22
  }
@@ -32,20 +29,17 @@ function onOptionClick(ev, item) {
32
29
  <template>
33
30
  <PPopover
34
31
  enterable
35
- close-on-scroll
36
32
  class="pxd-menu"
37
- trigger="manual"
33
+ trigger="click"
38
34
  :show-delay="0"
39
35
  :hide-delay="100"
40
36
  :position="position"
41
- :show-transition="false"
42
37
  :visible="popoverVisible"
43
38
  :close-on-press-escape="closeOnPressEscape"
44
39
  transition-name="pxd-transition--fade"
45
40
  v-bind="$attrs"
46
41
  @escape="hidePopover"
47
42
  @outside-click="hidePopover"
48
- @trigger-click="showPopover"
49
43
  @visible-change="onVisibleChange"
50
44
  >
51
45
  <slot />
@@ -6,11 +6,11 @@ interface Props {
6
6
  position?: ComponentPosition;
7
7
  closeOnPressEscape?: boolean;
8
8
  }
9
- declare var __VLS_13: {}, __VLS_24: {};
9
+ declare var __VLS_12: {}, __VLS_23: {};
10
10
  type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_13) => any;
11
+ default?: (props: typeof __VLS_12) => any;
12
12
  } & {
13
- items?: (props: typeof __VLS_24) => any;
13
+ items?: (props: typeof __VLS_23) => any;
14
14
  };
15
15
  declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
16
  select: (args_0: MouseEvent, args_1: ListOptionSelected) => any;
@@ -0,0 +1,19 @@
1
+ import type { ComponentAs } from '../../types/shared';
2
+ interface Props {
3
+ as?: ComponentAs;
4
+ }
5
+ declare var __VLS_8: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_8) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
10
+ as: ComponentAs;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,18 @@
1
+ <script setup>
2
+ defineOptions({
3
+ name: "PNoiseBackground"
4
+ });
5
+ defineProps({
6
+ as: { type: null, required: false, default: "div" }
7
+ });
8
+ </script>
9
+
10
+ <template>
11
+ <Component :is="as" class="pxd-noise-background relative">
12
+ <slot />
13
+ </Component>
14
+ </template>
15
+
16
+ <style>
17
+ .pxd-noise-background:after{background-image:url("data:image/png;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////2wBDAf//////////////////////////////////////////////////////////////////////////////////////wAARCACAAIADASIAAhEBAxEB/8QAFgABAQEAAAAAAAAAAAAAAAAAAAEC/8QAJxAAAQIFBAIDAQEBAAAAAAAAAREhADFBUWFxgZHwobHB0eHxEkL/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AtWI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WptmszJXgLS42XvXiy7fv7GU8E6kbGqrwsKFfktPXpk5gLvOR19ve86xRz9Pi/5ECpmdUn6xCkneWeglavSAmqGdHk9lUzuu0Wrovuvh+ViYIUgKwF5S/dYspDZrvLHu8BHBRQdf7bqmKDu86JcUHKJJJQlNy3i3nGkRih5COmjsuviA1d/y3WiKb+CzLj1BGu3hAnq03gW2pmdXN1FisAC4XAmnfM4UQLJuGdE/cQqfEn/hfeIxAF5lrLzXmABUkgBqLIZLvVItfn1XRfYiBA8wAxqzd+iALJkVedxXbiAfWQ+Hk5lzC2fCgy/CPLxRYTTi1WO3MVyEkt9lbe+NAUyKAptpp7ECiBZFq9pOBGxtdpTkUh974S7nCWgFSnqVd74lWDsjSE1bRU+Ybay18TnWUoSdN2XdDAf/2Q==");background-position:50%;background-size:96px 96px;border-radius:inherit;content:"";inset:0;opacity:.035;pointer-events:none;position:absolute}
18
+ </style>