@aurora-ds/components 1.0.0 → 1.1.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,4 @@
1
- import { ComponentType, SVGProps, HTMLAttributes, Ref, FC, ReactNode, ButtonHTMLAttributes, CSSProperties, FormEvent, InputHTMLAttributes } from 'react';
1
+ import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes } from 'react';
2
2
 
3
3
  declare const lightPalette: {
4
4
  surfaceBackground: string;
@@ -249,6 +249,106 @@ declare module '@aurora-ds/theme' {
249
249
  }
250
250
  }
251
251
 
252
+ /** SVG icon component used by button slots and loading state. */
253
+ type ButtonIcon = ComponentType<SVGProps<SVGSVGElement>>;
254
+ /** Visual style of the button surface. */
255
+ type ButtonVariant = 'contained' | 'outlined' | 'text';
256
+ /** Semantic color intent of the button. */
257
+ type ButtonColor = 'primary' | 'secondary' | 'neutral' | 'info' | 'success' | 'warning' | 'error';
258
+ /** Size token controlling height, padding and label scale. */
259
+ type ButtonSize = 'sm' | 'md' | 'lg';
260
+
261
+ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
262
+ ref?: Ref<HTMLButtonElement>;
263
+ /** Visual style. @default 'contained' */
264
+ variant?: ButtonVariant;
265
+ /** Semantic color. @default 'primary' */
266
+ color?: ButtonColor;
267
+ /** Size token controlling height, padding and font size. @default 'md' */
268
+ size?: ButtonSize;
269
+ /** Explicit width for the button. Accepts numbers (px) or any CSS width value. */
270
+ width?: number | string;
271
+ /** Flex grow factor applied to the button container. */
272
+ flexGrow?: number;
273
+ /** Flex shrink factor applied to the button container. */
274
+ flexShrink?: number;
275
+ /** Show a spinner and disable interaction. */
276
+ isLoading?: boolean;
277
+ /** Native button type. @default 'button' */
278
+ type?: 'button' | 'submit' | 'reset';
279
+ /** SVG icon component rendered before the label (inherits the button color). */
280
+ startIcon?: ButtonIcon;
281
+ /** SVG icon component rendered after the label (inherits the button color). */
282
+ endIcon?: ButtonIcon;
283
+ };
284
+
285
+ /**
286
+ * Theme-aware button built on `createVariants`.
287
+ *
288
+ * @example <Button onClick={save}>Save</Button>
289
+ * @example <Button variant='outlined' color='error' startIcon={IconRegistry.CloseIcon}>Delete</Button>
290
+ * @example <Button color='success' isLoading width='100%'>Submitting…</Button>
291
+ */
292
+ declare const Button: FC<ButtonProps>;
293
+
294
+ type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
295
+ /** Ref forwarded to the underlying button element. */
296
+ ref?: Ref<HTMLButtonElement>;
297
+ /** SVG icon component to render inside the button. */
298
+ icon: ButtonIcon;
299
+ /** Accessible label — required since there is no visible text. */
300
+ ariaLabel: string;
301
+ /** Visual style. @default 'contained' */
302
+ variant?: ButtonVariant;
303
+ /** Semantic color. @default 'primary' */
304
+ color?: ButtonColor;
305
+ /** Size token controlling width, height and padding. @default 'md' */
306
+ size?: ButtonSize;
307
+ /** Show a spinner and disable interaction. */
308
+ isLoading?: boolean;
309
+ /** Native button type. @default 'button' */
310
+ type?: 'button' | 'submit' | 'reset';
311
+ };
312
+
313
+ /**
314
+ * Square icon-only button.
315
+ * `ariaLabel` is mandatory since there is no visible text.
316
+ *
317
+ * @example <IconButton icon={CloseIcon} ariaLabel={t('common.close')} />
318
+ * @example <IconButton icon={DeleteIcon} ariaLabel={t('actions.delete')} variant='outlined' color='error' />
319
+ * @example <IconButton icon={SaveIcon} ariaLabel={t('actions.save')} isLoading />
320
+ */
321
+ declare const IconButton: FC<IconButtonProps>;
322
+
323
+ type LinkUnderline = 'always' | 'hover' | 'none';
324
+
325
+ /** SVG icon component, e.g. imported via `?react` or taken from the `IconRegistry`. */
326
+ type LinkIcon = ComponentType<SVGProps<SVGSVGElement>>;
327
+ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
328
+ /** React 19 ref prop. */
329
+ ref?: Ref<HTMLAnchorElement>;
330
+ /** Controls when the underline is visible. @default 'hover' */
331
+ underline?: LinkUnderline;
332
+ /** Open in a new tab with `rel="noopener noreferrer"`. */
333
+ external?: boolean;
334
+ /** Prevent navigation and style as inactive. */
335
+ disabled?: boolean;
336
+ /** SVG icon rendered before the text. */
337
+ startIcon?: LinkIcon;
338
+ /** SVG icon rendered after the text. */
339
+ endIcon?: LinkIcon;
340
+ };
341
+
342
+ /**
343
+ * Theme-aware anchor element with optional icons and underline control.
344
+ *
345
+ * @example <Link href='/about'>About</Link>
346
+ * @example <Link href='https://example.com' external>External site</Link>
347
+ * @example <Link href='/profile' underline='always' startIcon={UserIcon}>Profile</Link>
348
+ * @example <Link href='/terms' underline='none'>Terms</Link>
349
+ */
350
+ declare const Link: FC<LinkProps>;
351
+
252
352
  /** SVG icon component used by badge icon slots. */
253
353
  type BadgeIcon = ComponentType<SVGProps<SVGSVGElement>>;
254
354
  /** Visual style of the badge surface. */
@@ -366,77 +466,6 @@ interface InfoBubbleProps {
366
466
  */
367
467
  declare const InfoBubble: FC<InfoBubbleProps>;
368
468
 
369
- /** SVG icon component used by button slots and loading state. */
370
- type ButtonIcon = ComponentType<SVGProps<SVGSVGElement>>;
371
- /** Visual style of the button surface. */
372
- type ButtonVariant = 'contained' | 'outlined' | 'text';
373
- /** Semantic color intent of the button. */
374
- type ButtonColor = 'primary' | 'secondary' | 'neutral' | 'info' | 'success' | 'warning' | 'error';
375
- /** Size token controlling height, padding and label scale. */
376
- type ButtonSize = 'sm' | 'md' | 'lg';
377
-
378
- type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
379
- ref?: Ref<HTMLButtonElement>;
380
- /** Visual style. @default 'contained' */
381
- variant?: ButtonVariant;
382
- /** Semantic color. @default 'primary' */
383
- color?: ButtonColor;
384
- /** Size token controlling height, padding and font size. @default 'md' */
385
- size?: ButtonSize;
386
- /** Explicit width for the button. Accepts numbers (px) or any CSS width value. */
387
- width?: number | string;
388
- /** Flex grow factor applied to the button container. */
389
- flexGrow?: number;
390
- /** Flex shrink factor applied to the button container. */
391
- flexShrink?: number;
392
- /** Show a spinner and disable interaction. */
393
- isLoading?: boolean;
394
- /** Native button type. @default 'button' */
395
- type?: 'button' | 'submit' | 'reset';
396
- /** SVG icon component rendered before the label (inherits the button color). */
397
- startIcon?: ButtonIcon;
398
- /** SVG icon component rendered after the label (inherits the button color). */
399
- endIcon?: ButtonIcon;
400
- };
401
-
402
- /**
403
- * Theme-aware button built on `createVariants`.
404
- *
405
- * @example <Button onClick={save}>Save</Button>
406
- * @example <Button variant='outlined' color='error' startIcon={IconRegistry.CloseIcon}>Delete</Button>
407
- * @example <Button color='success' isLoading width='100%'>Submitting…</Button>
408
- */
409
- declare const Button: FC<ButtonProps>;
410
-
411
- type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
412
- /** Ref forwarded to the underlying button element. */
413
- ref?: Ref<HTMLButtonElement>;
414
- /** SVG icon component to render inside the button. */
415
- icon: ButtonIcon;
416
- /** Accessible label — required since there is no visible text. */
417
- ariaLabel: string;
418
- /** Visual style. @default 'contained' */
419
- variant?: ButtonVariant;
420
- /** Semantic color. @default 'primary' */
421
- color?: ButtonColor;
422
- /** Size token controlling width, height and padding. @default 'md' */
423
- size?: ButtonSize;
424
- /** Show a spinner and disable interaction. */
425
- isLoading?: boolean;
426
- /** Native button type. @default 'button' */
427
- type?: 'button' | 'submit' | 'reset';
428
- };
429
-
430
- /**
431
- * Square icon-only button.
432
- * `ariaLabel` is mandatory since there is no visible text.
433
- *
434
- * @example <IconButton icon={CloseIcon} ariaLabel={t('common.close')} />
435
- * @example <IconButton icon={DeleteIcon} ariaLabel={t('actions.delete')} variant='outlined' color='error' />
436
- * @example <IconButton icon={SaveIcon} ariaLabel={t('actions.save')} isLoading />
437
- */
438
- declare const IconButton: FC<IconButtonProps>;
439
-
440
469
  type IconProps = HTMLAttributes<HTMLDivElement> & {
441
470
  ref?: Ref<HTMLDivElement>;
442
471
  /** SVG component to render — import with `?react` (e.g. `import MyIcon from './my-icon.svg?react'`). */
@@ -471,6 +500,44 @@ type IconStyleParams = {
471
500
  */
472
501
  declare const Icon: FC<IconProps>;
473
502
 
503
+ /** Shape variant of the Skeleton placeholder. */
504
+ type SkeletonVariant = 'text' | 'circular' | 'rectangular' | 'rounded';
505
+ /**
506
+ * Animation applied to the Skeleton.
507
+ * - `'shimmer'` — sliding gradient highlight (default).
508
+ * - `false` — no animation (useful when `prefers-reduced-motion` is handled manually).
509
+ */
510
+ type SkeletonAnimation = 'shimmer' | false;
511
+
512
+ type SkeletonProps = HTMLAttributes<HTMLSpanElement> & {
513
+ ref?: Ref<HTMLSpanElement>;
514
+ /** Shape of the placeholder: `'text'` | `'circular'` | `'rectangular'` | `'rounded'`. @default 'rounded' */
515
+ variant?: SkeletonVariant;
516
+ /** Loading animation: `'shimmer'` (default) or `false` to disable. */
517
+ animation?: SkeletonAnimation;
518
+ /** Explicit width; falls back to `100%` when omitted. */
519
+ width?: CSSProperties['width'];
520
+ /** Explicit height; falls back to the variant default when omitted. */
521
+ height?: CSSProperties['height'];
522
+ };
523
+
524
+ /**
525
+ * Block-level placeholder rendered while content is loading.
526
+ *
527
+ * @example // Text line
528
+ * <Skeleton variant='text' width={200} />
529
+ *
530
+ * @example // Avatar
531
+ * <Skeleton variant='circular' width={40} height={40} />
532
+ *
533
+ * @example // Card thumbnail
534
+ * <Skeleton variant='rounded' width='100%' height={160} />
535
+ *
536
+ * @example // No animation
537
+ * <Skeleton variant='rectangular' width='100%' height={80} animation={false} />
538
+ */
539
+ declare const Skeleton: FC<SkeletonProps>;
540
+
474
541
  type TextVariants = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label' | 'strong';
475
542
  type TextVariantStyle = {
476
543
  /** HTML tag to render. */
@@ -685,6 +752,172 @@ type SelectProps = {
685
752
 
686
753
  declare const Select: FC<SelectProps>;
687
754
 
755
+ type BoxProps = HTMLAttributes<HTMLDivElement> & BoxStyleProps & {
756
+ ref?: Ref<HTMLDivElement>;
757
+ };
758
+ /** Style props accepted by Box — token-aware for spacing/color/radius/shadow/zIndex. */
759
+ type BoxStyleProps = {
760
+ display?: CSSProperties['display'];
761
+ width?: CSSProperties['width'];
762
+ height?: CSSProperties['height'];
763
+ minWidth?: CSSProperties['minWidth'];
764
+ maxWidth?: CSSProperties['maxWidth'];
765
+ minHeight?: CSSProperties['minHeight'];
766
+ maxHeight?: CSSProperties['maxHeight'];
767
+ padding?: keyof Theme['spacing'];
768
+ paddingTop?: keyof Theme['spacing'];
769
+ paddingRight?: keyof Theme['spacing'];
770
+ paddingBottom?: keyof Theme['spacing'];
771
+ paddingLeft?: keyof Theme['spacing'];
772
+ /** Horizontal padding (left + right). */
773
+ px?: keyof Theme['spacing'];
774
+ /** Vertical padding (top + bottom). */
775
+ py?: keyof Theme['spacing'];
776
+ margin?: keyof Theme['spacing'];
777
+ marginTop?: keyof Theme['spacing'];
778
+ marginRight?: keyof Theme['spacing'];
779
+ marginBottom?: keyof Theme['spacing'];
780
+ marginLeft?: keyof Theme['spacing'];
781
+ /** Horizontal margin (left + right). */
782
+ mx?: keyof Theme['spacing'];
783
+ /** Vertical margin (top + bottom). */
784
+ my?: keyof Theme['spacing'];
785
+ gap?: keyof Theme['spacing'];
786
+ rowGap?: keyof Theme['spacing'];
787
+ columnGap?: keyof Theme['spacing'];
788
+ flexDirection?: CSSProperties['flexDirection'];
789
+ flexWrap?: CSSProperties['flexWrap'];
790
+ alignItems?: CSSProperties['alignItems'];
791
+ justifyContent?: CSSProperties['justifyContent'];
792
+ gridTemplateColumns?: CSSProperties['gridTemplateColumns'];
793
+ gridTemplateRows?: CSSProperties['gridTemplateRows'];
794
+ flex?: CSSProperties['flex'];
795
+ flexGrow?: CSSProperties['flexGrow'];
796
+ flexShrink?: CSSProperties['flexShrink'];
797
+ flexBasis?: CSSProperties['flexBasis'];
798
+ alignSelf?: CSSProperties['alignSelf'];
799
+ justifySelf?: CSSProperties['justifySelf'];
800
+ gridColumn?: CSSProperties['gridColumn'];
801
+ gridRow?: CSSProperties['gridRow'];
802
+ order?: CSSProperties['order'];
803
+ position?: CSSProperties['position'];
804
+ top?: CSSProperties['top'];
805
+ right?: CSSProperties['right'];
806
+ bottom?: CSSProperties['bottom'];
807
+ left?: CSSProperties['left'];
808
+ inset?: CSSProperties['inset'];
809
+ zIndex?: keyof Theme['zIndex'];
810
+ overflow?: CSSProperties['overflow'];
811
+ overflowX?: CSSProperties['overflowX'];
812
+ overflowY?: CSSProperties['overflowY'];
813
+ backgroundColor?: keyof Theme['colors'];
814
+ color?: keyof Theme['colors'];
815
+ borderRadius?: keyof Theme['radius'];
816
+ boxShadow?: keyof Theme['shadows'];
817
+ border?: CSSProperties['border'];
818
+ borderColor?: keyof Theme['colors'];
819
+ borderWidth?: CSSProperties['borderWidth'];
820
+ borderStyle?: CSSProperties['borderStyle'];
821
+ textAlign?: CSSProperties['textAlign'];
822
+ cursor?: CSSProperties['cursor'];
823
+ opacity?: CSSProperties['opacity'];
824
+ };
825
+
826
+ /**
827
+ * A plain `div` enriched with convenient, token-aware style props.
828
+ *
829
+ * Spacing / color / radius / shadow / z-index props accept theme tokens only
830
+ * (e.g. `padding='md'`, `backgroundColor='surfacePaper'`).
831
+ * Dimensions and position offsets accept any CSS value.
832
+ * All native `div` attributes are forwarded, and `ref` points to the element.
833
+ *
834
+ * @example <Box padding='md' backgroundColor='surfacePaper' borderRadius='lg'>Content</Box>
835
+ * @example <Box display='flex' gap='sm' alignItems='center'>…</Box>
836
+ */
837
+ declare const Box: FC<BoxProps>;
838
+
839
+ type CardProps = BoxProps & {
840
+ /** Visual style. @default 'outlined' */
841
+ variant?: CardVariant;
842
+ };
843
+
844
+ type CardHeaderProps = {
845
+ /** Main label of the card header. */
846
+ label: string;
847
+ /** Optional icon rendered before the label. */
848
+ icon?: ComponentType<SVGProps<SVGSVGElement>>;
849
+ /** Optional actions rendered on the right side (e.g. buttons, IconButton). */
850
+ actions?: ReactNode;
851
+ };
852
+
853
+ type CardBodyProps = {
854
+ /** Card body content. */
855
+ children: ReactNode;
856
+ /** Vertical padding using a spacing token. @default 'md' */
857
+ py?: keyof Theme['spacing'];
858
+ /** Horizontal padding using a spacing token. @default 'md' */
859
+ px?: keyof Theme['spacing'];
860
+ };
861
+
862
+ type CardVariant = 'elevated' | 'outlined';
863
+ type CardComponent = FC<CardProps> & {
864
+ Header: FC<CardHeaderProps>;
865
+ Body: FC<CardBodyProps>;
866
+ };
867
+
868
+ declare const Card: CardComponent;
869
+
870
+ /**
871
+ * Extra CSS Grid props not covered by BoxProps.
872
+ * `columns` and `rows` are convenience shorthands:
873
+ * a number is expanded to `repeat(n, 1fr)`, a string is forwarded as-is.
874
+ */
875
+ type GridStyleProps = {
876
+ /** Shorthand for `gridTemplateColumns`. A number expands to `repeat(n, 1fr)`. */
877
+ columns?: number | CSSProperties['gridTemplateColumns'];
878
+ /** Shorthand for `gridTemplateRows`. A number expands to `repeat(n, 1fr)`. */
879
+ rows?: number | CSSProperties['gridTemplateRows'];
880
+ autoFlow?: CSSProperties['gridAutoFlow'];
881
+ autoColumns?: CSSProperties['gridAutoColumns'];
882
+ autoRows?: CSSProperties['gridAutoRows'];
883
+ alignContent?: CSSProperties['alignContent'];
884
+ justifyItems?: CSSProperties['justifyItems'];
885
+ placeItems?: CSSProperties['placeItems'];
886
+ placeContent?: CSSProperties['placeContent'];
887
+ };
888
+ type GridProps = Omit<BoxProps, 'display'> & GridStyleProps & {
889
+ /** Defaults to `'grid'`. */
890
+ display?: 'grid' | 'inline-grid';
891
+ };
892
+
893
+ /**
894
+ * A CSS Grid `Box` with convenience props for common grid patterns.
895
+ *
896
+ * Defaults to `display: grid`. The `columns` and `rows` shorthands accept either a
897
+ * number (expanded to `repeat(n, 1fr)`) or any valid CSS `grid-template-*` string.
898
+ * All `Box` style props remain available (`gap`, `rowGap`, `columnGap`,
899
+ * `gridTemplateColumns`, `gridTemplateRows`, `alignItems`, `justifyContent`, …).
900
+ *
901
+ * @example <Grid columns={3} gap='md'>…</Grid>
902
+ * @example <Grid columns='repeat(auto-fill, minmax(200px, 1fr))' gap='lg'>…</Grid>
903
+ * @example <Grid rows={2} autoFlow='column' gap='sm' alignItems='center'>…</Grid>
904
+ */
905
+ declare const Grid: FC<GridProps>;
906
+
907
+ type StackProps = BoxProps;
908
+
909
+ /**
910
+ * A flex `Box` for laying out children along a single axis.
911
+ *
912
+ * Defaults to `display: flex` and a vertical (`column`) direction. Every
913
+ * `Box` style prop is available (`gap`, `alignItems`, `justifyContent`, …),
914
+ * and `display` can still be overridden (e.g. `'inline-flex'`).
915
+ *
916
+ * @example <Stack gap='sm'>…</Stack>
917
+ * @example <Stack flexDirection='row' gap='md' alignItems='center' justifyContent='space-between'>…</Stack>
918
+ */
919
+ declare const Stack: FC<StackProps>;
920
+
688
921
  type AlertProps = {
689
922
  /** Visual style of the alert. @default 'default' */
690
923
  variant?: AlertVariant;
@@ -826,5 +1059,5 @@ declare const lightTheme: Theme;
826
1059
 
827
1060
  declare const darkTheme: Theme;
828
1061
 
829
- export { Alert, Badge, Button, Dialog, Form, Icon, IconButton, InfoBubble, Menu, Select, Switch, Text, TextField, Tooltip, darkTheme, lightTheme };
830
- export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, DialogBodyProps, DialogHeaderProps, DialogProps, FormProps, IconButtonProps, IconProps, IconStyleParams, InfoBubbleProps, MenuGroupProps, MenuItemProps, MenuProps, Palette, SelectOption, SelectProps, SwitchColor, SwitchProps, SwitchSize, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, TooltipPlacement, TooltipProps };
1062
+ export { Alert, Badge, Box, Button, Card, Dialog, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Text, TextField, Tooltip, darkTheme, lightTheme };
1063
+ export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, DialogBodyProps, DialogHeaderProps, DialogProps, FormProps, GridProps, GridStyleProps, IconButtonProps, IconProps, IconStyleParams, InfoBubbleProps, LinkIcon, LinkProps, LinkUnderline, MenuGroupProps, MenuItemProps, MenuProps, Palette, SelectOption, SelectProps, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SwitchColor, SwitchProps, SwitchSize, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, TooltipPlacement, TooltipProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurora-ds/components",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "description": "Aurora DS - React Components Library",
6
6
  "main": "dist/cjs/index.js",