@npm-questionpro/wick-ui-lib 2.0.0-next.15 → 2.0.0-next.17

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,13 +1,34 @@
1
- export interface IWuButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
2
- variant?: 'primary' | 'secondary' | 'outline' | 'rounded' | 'link' | 'iconOnly';
3
- size?: 'md' | 'sm' | 'mobile';
4
- color?: 'primary' | 'upgrade' | 'error' | 'neutral';
1
+ import { Button } from '@base-ui/react/button';
2
+ export type IWuButtonProps = Button.Props & {
3
+ ref?: React.Ref<HTMLButtonElement | null>;
4
+ /** Icon node rendered alongside the label. Position controlled by `iconPosition`. */
5
5
  Icon?: React.ReactNode;
6
+ /** Custom spinner shown while `loading=true`. Defaults to `<WuLoader color="white" size="sm" />`. */
7
+ Loader?: React.ReactNode;
8
+ /** Which side the icon appears on. @default 'left' */
6
9
  iconPosition?: 'left' | 'right';
7
- floating?: boolean;
8
- disabled?: boolean;
10
+ /** Visual structure of the button. @default 'primary' */
11
+ variant?: 'primary' | 'secondary' | 'outline' | 'link'
12
+ /** @deprecated use size="icon" and variant="secondary" instead */
13
+ | 'iconOnly'
14
+ /** @deprecated use shape="rounded" instead */
15
+ | 'rounded';
16
+ /** Touch target and density. @default 'md' */
17
+ size?: 'sm' | 'md' | 'mobile' | 'icon';
18
+ /** Semantic color palette. @default 'primary' */
19
+ color?: 'primary' | 'error' | 'upgrade';
20
+ /** Border-radius style. */
21
+ shape?: 'rounded' | 'square';
22
+ /** Shows spinner and blocks interaction. Sets `aria-busy`. */
9
23
  loading?: boolean;
24
+ /** Adds elevation shadow. Use for FAB-style buttons. */
25
+ floating?: boolean;
26
+ /** Toggled/active state. Sets `aria-pressed`. */
10
27
  selected?: boolean;
11
- dir?: 'rtl' | 'ltr';
12
- }
13
- export declare const WuButton: import("react").ForwardRefExoticComponent<IWuButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
28
+ };
29
+ /**
30
+ * Primary action trigger for user interactions.
31
+ *
32
+ * @summary action trigger — use variant + color to set visual weight and semantic intent
33
+ */
34
+ export declare const WuButton: React.FC<IWuButtonProps>;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { IWuSegmentOption } from './types/IWuSegmentOption';
3
+ export interface IWuSegmentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
4
+ options: IWuSegmentOption[];
5
+ value?: string;
6
+ defaultValue?: string;
7
+ onChange?: (value: string) => void;
8
+ size?: 'sm' | 'md' | 'lg';
9
+ variant?: 'text' | 'icon';
10
+ disabled?: boolean;
11
+ dir?: 'ltr' | 'rtl';
12
+ }
13
+ export declare const WuSegment: React.ForwardRefExoticComponent<IWuSegmentProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,3 @@
1
+ export type { IWuSegmentOption } from './types/IWuSegmentOption';
2
+ export { WuSegment } from './WuSegment';
3
+ export type { IWuSegmentProps } from './WuSegment';
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ export interface IWuSegmentOption {
3
+ value: string;
4
+ label?: string;
5
+ icon?: ReactNode;
6
+ children?: ReactNode;
7
+ disabled?: boolean;
8
+ }
package/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ export * from './components/pagination';
33
33
  export * from './components/popover';
34
34
  export * from './components/radio';
35
35
  export * from './components/scrollArea';
36
+ export * from './components/segment';
36
37
  export * from './components/select';
37
38
  export * from './components/sidebar';
38
39
  export * from './components/spotlight';