@jetcrab/pi-desk-sdk 1.0.1-dev.9001 → 1.1.0-dev.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.
@@ -1,5 +1,5 @@
1
1
  import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu';
2
- import { type ButtonHTMLAttributes, type HTMLAttributes, type InputHTMLAttributes, type ReactNode, type Ref, type SelectHTMLAttributes, type TextareaHTMLAttributes, type UIEventHandler } from 'react';
2
+ import { type ButtonHTMLAttributes, type HTMLAttributes, type InputHTMLAttributes, type ReactNode, type Ref, type TextareaHTMLAttributes, type UIEventHandler } from 'react';
3
3
  export declare function PluginSurface({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
4
4
  export type PluginScrollOrientation = 'vertical' | 'horizontal' | 'both';
5
5
  export type PluginScrollProps = Omit<HTMLAttributes<HTMLDivElement>, 'onScroll'> & {
@@ -161,17 +161,13 @@ export type PluginSecretInputProps = Omit<InputHTMLAttributes<HTMLInputElement>,
161
161
  controlSize?: PluginControlSize;
162
162
  };
163
163
  export declare function PluginSecretInput({ controlSize, className, disabled, id, ...props }: PluginSecretInputProps): React.JSX.Element;
164
- export interface PluginSelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
165
- controlSize?: PluginControlSize;
166
- }
167
- export declare function PluginSelect({ controlSize, className, ...props }: PluginSelectProps): React.JSX.Element;
168
164
  export interface PluginSelectOption {
169
165
  value: string;
170
166
  label: ReactNode;
171
167
  disabled?: boolean;
172
168
  textValue?: string;
173
169
  }
174
- export interface PluginSelectFieldProps {
170
+ export interface PluginSelectProps {
175
171
  id?: string;
176
172
  name?: string;
177
173
  label: ReactNode;
@@ -189,7 +185,7 @@ export interface PluginSelectFieldProps {
189
185
  popupClassName?: string;
190
186
  onValueChange?: (value: string | null) => void;
191
187
  }
192
- export declare function PluginSelectField({ id, name, label, description, error, value, defaultValue, options, placeholder, disabled, required, size, className, triggerClassName, popupClassName, onValueChange }: PluginSelectFieldProps): React.JSX.Element;
188
+ export declare function PluginSelect({ id, name, label, description, error, value, defaultValue, options, placeholder, disabled, required, size, className, triggerClassName, popupClassName, onValueChange }: PluginSelectProps): React.JSX.Element;
193
189
  export interface PluginTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
194
190
  controlSize?: PluginControlSize;
195
191
  }
package/dist/react-ui.js CHANGED
@@ -270,7 +270,6 @@ export function PluginField({ label, htmlFor, description, error, density = 'reg
270
270
  children.type === 'select' ||
271
271
  children.type === PluginInput ||
272
272
  children.type === PluginTextarea ||
273
- children.type === PluginSelect ||
274
273
  children.type === PluginSecretInput)
275
274
  ? children
276
275
  : null;
@@ -289,16 +288,13 @@ export function PluginSecretInput({ controlSize = 'default', className, disabled
289
288
  const actionLabel = visible ? '隐藏原文' : '显示原文';
290
289
  return (_jsxs("div", { className: "pi-desk-ui-secret", children: [_jsx("input", { ...props, id: id, disabled: disabled, type: "text", autoComplete: "off", autoCapitalize: "none", spellCheck: false, className: classNames('pi-desk-ui-control', controlSize === 'sm' && 'pi-desk-ui-control-sm', !visible && 'pi-desk-ui-secret-control', className) }), _jsx("button", { type: "button", className: "pi-desk-ui-secret-toggle", "aria-label": actionLabel, "aria-controls": id, "aria-pressed": visible, title: actionLabel, disabled: disabled, onClick: () => setVisible((current) => !current), children: visible ? _jsx(EyeOffIcon, { "aria-hidden": "true" }) : _jsx(EyeIcon, { "aria-hidden": "true" }) })] }));
291
290
  }
292
- export function PluginSelect({ controlSize = 'default', className, ...props }) {
293
- return (_jsx("select", { ...props, className: classNames('pi-desk-ui-control', controlSize === 'sm' && 'pi-desk-ui-control-sm', className) }));
294
- }
295
291
  function PluginSelectChevronIcon() {
296
292
  return (_jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "m7 9 5 5 5-5" }) }));
297
293
  }
298
294
  function PluginSelectCheckIcon() {
299
295
  return (_jsx("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "m5 12 4 4L19 6" }) }));
300
296
  }
301
- export function PluginSelectField({ id, name, label, description, error, value, defaultValue, options, placeholder = '请选择', disabled = false, required = false, size = 'default', className, triggerClassName, popupClassName, onValueChange }) {
297
+ export function PluginSelect({ id, name, label, description, error, value, defaultValue, options, placeholder = '请选择', disabled = false, required = false, size = 'default', className, triggerClassName, popupClassName, onValueChange }) {
302
298
  const generatedId = useId();
303
299
  const triggerId = id ?? generatedId;
304
300
  const items = options.map((option) => ({ value: option.value, label: option.label }));
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/JetCrab/pi-desk.git",
6
6
  "directory": "plugins/pi-desk-sdk"
7
7
  },
8
- "version": "1.0.1-dev.9001",
8
+ "version": "1.1.0-dev.1",
9
9
  "license": "Apache-2.0",
10
10
  "publishConfig": {
11
11
  "registry": "https://registry.npmjs.org",