@okshaun/components 0.4.6 → 0.5.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AriaAttributes } from 'react';
2
+ import { AvatarVariantProps } from '../../../styled-system/recipes';
2
3
  import { BadgeVariantProps } from '../../../styled-system/recipes';
3
4
  import { BoxVariantProps } from '../../../styled-system/recipes';
4
5
  import { ButtonVariantProps } from '../../../styled-system/recipes';
@@ -26,6 +27,7 @@ import { LabelVariantProps } from '../../../styled-system/recipes';
26
27
  import { LinkVariantProps } from '../../../styled-system/recipes';
27
28
  import { menu } from '../../../styled-system/recipes';
28
29
  import { MenuVariantProps } from '../../../styled-system/recipes';
30
+ import { NumericSizeToken } from '../../../styled-system/tokens';
29
31
  import { Placement } from '@floating-ui/react';
30
32
  import { RadioInputVariantProps } from '../../../styled-system/recipes';
31
33
  import { RadioVariantProps } from '../../../styled-system/recipes';
@@ -42,6 +44,7 @@ import { TextVariantProps } from '../../../styled-system/recipes';
42
44
  import { ToggleInputVariantProps } from '../../../styled-system/recipes';
43
45
  import { ToggleVariantProps } from '../../../styled-system/recipes';
44
46
  import { TooltipVariantProps } from '../../../styled-system/recipes';
47
+ import { WrapProps } from '../../../styled-system/jsx';
45
48
 
46
49
  declare type AllowedIconSizes = keyof typeof numericSizes;
47
50
 
@@ -92,25 +95,66 @@ export declare type AutocompleteProps = MenuVariantProps & {
92
95
  };
93
96
 
94
97
  /**
95
- * The Badge component uses the polymorphic Box as its base.
96
- * Renders as a <span> by default but can be changed via the 'as' prop.
98
+ * Avatar component for displaying user or entity images with optional
99
+ * presence and status indicators.
97
100
  */
98
- export declare const Badge: BadgeComponent;
101
+ export declare const Avatar: React_2.ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
102
+
103
+ export declare type AvatarPresence = 'online' | 'busy' | 'offline' | 'focus';
104
+
105
+ export declare type AvatarProps = BoxProps & Omit<AvatarVariantProps, 'size' | 'shape'> & {
106
+ /** Image source URL */
107
+ src?: string;
108
+ /** Alt text for image */
109
+ alt?: string;
110
+ /** Name for generating initials fallback */
111
+ name?: string;
112
+ /** Size of the avatar */
113
+ size?: AvatarSize;
114
+ /** Shape of the avatar */
115
+ shape?: AvatarShape;
116
+ /** Presence indicator (bottom-right) */
117
+ presence?: AvatarPresence;
118
+ /** Status indicator (top-right) */
119
+ status?: AvatarStatus;
120
+ /** Custom fallback content (overrides initials) */
121
+ fallback?: React_2.ReactNode;
122
+ /** Border color for the avatar */
123
+ borderColor?: string;
124
+ /** Additional class name */
125
+ className?: string;
126
+ };
99
127
 
100
- /**
101
- * Define a polymorphic BadgeComponent type.
102
- */
103
- declare type BadgeComponent = <E extends React_2.ElementType = 'span'>(props: BadgeProps<E> & {
104
- ref?: React_2.ForwardedRef<Element>;
105
- }) => React_2.ReactElement;
128
+ export declare type AvatarShape = 'circle' | 'square' | 'hexagon';
129
+
130
+ export declare type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
131
+
132
+ export declare type AvatarStatus = 'approved' | 'declined' | 'locked';
106
133
 
107
134
  /**
108
- * BadgeProps is generic and manages its own polymorphism.
109
- * It includes props for the element type E (default "span") and BadgeVariantProps.
135
+ * Badge component for displaying notification counts or status indicators.
136
+ *
137
+ * - Without children: renders as standalone badge
138
+ * - With children: wraps content and positions badge at top-right
139
+ * - Without count prop: shows as dot
140
+ * - With count prop: shows the number (or "99+" if exceeds overflowCount)
110
141
  */
111
- export declare type BadgeProps<E extends React_2.ElementType = 'span'> = React_2.ComponentPropsWithoutRef<E> & BadgeVariantProps & {
112
- as?: E;
142
+ export declare const Badge: React_2.ForwardRefExoticComponent<Omit<BadgeProps, "ref"> & React_2.RefAttributes<HTMLSpanElement>>;
143
+
144
+ export declare type BadgeAppearance = 'neutral' | 'inverted' | 'subtle' | 'subtle-inverted' | 'success' | 'danger' | 'warning' | 'info';
145
+
146
+ export declare type BadgeProps = BoxProps & Omit<BadgeVariantProps, 'standalone' | 'dot'> & {
147
+ /** Number to show in badge. If provided, switches to count mode. */
148
+ count?: number;
149
+ /** Show badge when count is zero. Default: false */
150
+ showZero?: boolean;
151
+ /** Max count to show. Displays "99+" when exceeded. Default: 99 */
152
+ overflowCount?: number;
153
+ /** Color scheme of the badge. Default: 'danger' */
154
+ appearance?: BadgeAppearance;
155
+ /** Additional class name */
113
156
  className?: string;
157
+ /** Content to wrap with the badge */
114
158
  children?: React_2.ReactNode;
115
159
  };
116
160
 
@@ -172,6 +216,7 @@ export declare type ButtonProps<E extends React_2.ElementType = 'button'> = Reac
172
216
  disabled?: boolean;
173
217
  iconBefore?: IconNamesList;
174
218
  iconAfter?: IconNamesList;
219
+ gap?: NumericSizeToken;
175
220
  };
176
221
 
177
222
  export declare const Card: React.FC<CardProps>;
@@ -227,9 +272,33 @@ export declare type CheckboxProps = {
227
272
 
228
273
  export declare const Chip: React.FC<ChipProps>;
229
274
 
230
- export declare type ChipProps = BoxProps & ChipVariantProps & {
275
+ export declare const ChipGroup: React.FC<ChipGroupProps>;
276
+
277
+ export declare type ChipGroupProps = Omit<WrapProps, 'role'> & {
278
+ type: ChipGroupType;
279
+ value: string | string[];
280
+ onChange: (value: string | string[]) => void;
281
+ children: ReactNode;
282
+ label?: string;
283
+ id?: string;
284
+ name?: string;
285
+ };
286
+
287
+ export declare type ChipGroupType = 'single' | 'multi';
288
+
289
+ export declare type ChipProps = BoxProps & Omit<ChipVariantProps, 'before' | 'after'> & {
231
290
  children: string | ReactNode;
232
- iconName?: IconNamesList;
291
+ /** Content to render before the label (e.g., Icon, Avatar) */
292
+ before?: ReactNode;
293
+ /** Content to render after the label (e.g., Badge, Icon) */
294
+ after?: ReactNode;
295
+ disabled?: boolean;
296
+ loading?: boolean;
297
+ deleted?: boolean;
298
+ dismissable?: boolean;
299
+ onDismiss?: () => void;
300
+ value?: string;
301
+ gap?: NumericSizeToken;
233
302
  };
234
303
 
235
304
  export declare const Code: React.FC<CodeProps>;