@aurora-ds/components 1.1.6 → 1.1.7

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, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes } from 'react';
1
+ import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes, AriaRole, AriaAttributes } from 'react';
2
2
 
3
3
  declare const lightPalette: {
4
4
  surfaceBackground: string;
@@ -188,13 +188,19 @@ declare const themeShadows: {
188
188
 
189
189
  /**
190
190
  * Default spacing tokens
191
+ *
192
+ * ⚠️ Token keys MUST stay CSS-custom-property safe (letters, digits, hyphens only).
193
+ * They are turned into CSS variables (e.g. `smPlus` → `--theme-spacing-sm-plus`) by
194
+ * the theme proxy, so characters like `+` would produce invalid variable names and
195
+ * silently break any style that uses them.
191
196
  */
192
197
  declare const themeSpacing: {
193
198
  none: string;
194
199
  '2xs': string;
195
200
  xs: string;
196
- 'xs+': string;
201
+ xsPlus: string;
197
202
  sm: string;
203
+ smPlus: string;
198
204
  md: string;
199
205
  lg: string;
200
206
  xl: string;
@@ -754,6 +760,24 @@ type SelectProps = {
754
760
 
755
761
  declare const Select: FC<SelectProps>;
756
762
 
763
+ type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> & {
764
+ ref?: Ref<HTMLInputElement>;
765
+ /** Visible label rendered next to the checkbox. */
766
+ label?: ReactNode;
767
+ /** Helper text or validation message rendered below the checkbox row. */
768
+ helperText?: string;
769
+ /** Size variant controlling checkbox box size and text scale. @default 'md' */
770
+ size?: TextFieldSize;
771
+ /** Semantic status affecting border and helper text color. @default 'default' */
772
+ status?: TextFieldStatus;
773
+ /** Sets the native checkbox in indeterminate (mixed) state. */
774
+ indeterminate?: boolean;
775
+ /** @deprecated Use `status='error'` instead. Kept for backward compatibility. */
776
+ error?: boolean;
777
+ };
778
+
779
+ declare const Checkbox: FC<CheckboxProps>;
780
+
757
781
  type BoxProps = HTMLAttributes<HTMLDivElement> & BoxStyleProps & {
758
782
  ref?: Ref<HTMLDivElement>;
759
783
  };
@@ -926,6 +950,128 @@ declare const Grid: FC<GridProps>;
926
950
  */
927
951
  declare const Stack: FC<StackProps>;
928
952
 
953
+ /**
954
+ * Layout variant for the Drawer.
955
+ * - `'permanent'` — inline drawer that pushes page content (default on desktop).
956
+ * - `'temporary'` — portal overlay with backdrop that slides in from the left (default on mobile).
957
+ *
958
+ * Omitting the prop enables auto-detection based on viewport width.
959
+ */
960
+ type DrawerVariant = 'permanent' | 'temporary';
961
+ type DrawerProps = {
962
+ /** Height of the drawer container. @default '100dvh' */
963
+ height?: CSSProperties['height'];
964
+ /** Content of the drawer — use Drawer.Header, Drawer.Body, Drawer.Footer. */
965
+ children: ReactNode;
966
+ /** Controlled expanded/collapsed state. For `temporary` variant, controls open/closed. */
967
+ isExpanded: boolean;
968
+ /** Callback fired when the consumer should toggle the expanded state. */
969
+ onExpandedChange?: (expanded: boolean) => void;
970
+ /**
971
+ * Layout variant.
972
+ * - `'permanent'`: inline, pushes content (default on desktop).
973
+ * - `'temporary'`: portal overlay with backdrop (default on mobile).
974
+ *
975
+ * If omitted, auto-detects based on viewport width.
976
+ */
977
+ variant?: DrawerVariant;
978
+ /**
979
+ * Called when the temporary drawer overlay requests to be closed
980
+ * (backdrop click or Escape key). Falls back to `onExpandedChange(false)`
981
+ * if not provided.
982
+ */
983
+ onClose?: () => void;
984
+ /** ARIA role applied to the root navigation container. @default 'navigation' */
985
+ role?: AriaRole;
986
+ /** Accessible name for the drawer landmark. @default 'Navigation' */
987
+ ariaLabel?: string;
988
+ /** Id of the element that labels the drawer landmark. */
989
+ ariaLabelledBy?: string;
990
+ /** Id of the element that describes the drawer landmark. */
991
+ ariaDescribedBy?: string;
992
+ };
993
+
994
+ type DrawerHeaderProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
995
+ /** ARIA role applied to the header container. */
996
+ role?: AriaRole;
997
+ /** Accessible name for the header region. */
998
+ ariaLabel?: string;
999
+ /** Id of the element that labels the header region. */
1000
+ ariaLabelledBy?: string;
1001
+ /** Id of the element that describes the header region. */
1002
+ ariaDescribedBy?: string;
1003
+ };
1004
+
1005
+ type DrawerBodyProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
1006
+ /** ARIA role applied to the body container. */
1007
+ role?: AriaRole;
1008
+ /** Accessible name for the body region. */
1009
+ ariaLabel?: string;
1010
+ /** Id of the element that labels the body region. */
1011
+ ariaLabelledBy?: string;
1012
+ /** Id of the element that describes the body region. */
1013
+ ariaDescribedBy?: string;
1014
+ };
1015
+
1016
+ type DrawerFooterProps = Omit<BoxProps, 'aria-label' | 'aria-labelledby' | 'aria-describedby'> & {
1017
+ /** ARIA role applied to the footer container. */
1018
+ role?: AriaRole;
1019
+ /** Accessible name for the footer region. */
1020
+ ariaLabel?: string;
1021
+ /** Id of the element that labels the footer region. */
1022
+ ariaLabelledBy?: string;
1023
+ /** Id of the element that describes the footer region. */
1024
+ ariaDescribedBy?: string;
1025
+ };
1026
+
1027
+ /** SVG icon component for DrawerItem slots. */
1028
+ type DrawerItemIcon = ComponentType<SVGProps<SVGSVGElement>>;
1029
+ type DrawerItemProps = {
1030
+ /** SVG icon shown in both expanded and collapsed states. */
1031
+ startIcon: DrawerItemIcon;
1032
+ /** Text label — visible when expanded, shown as tooltip when collapsed. */
1033
+ label: string;
1034
+ /** Marks the item as selected/active. @default false */
1035
+ selected?: boolean;
1036
+ /** Extra content rendered after the label in expanded mode only (e.g. a badge). */
1037
+ endContent?: ReactNode;
1038
+ /** When provided, renders the item as an anchor `<a>` for navigation. */
1039
+ href?: string;
1040
+ /** Click handler (used for simple actions when no `href` is set). */
1041
+ onClick?: () => void;
1042
+ /** Prevents interaction and dims the item. @default false */
1043
+ disabled?: boolean;
1044
+ /** Accessible label override (by default uses `label` when collapsed). */
1045
+ ariaLabel?: string;
1046
+ /** Id of the element that labels this item. */
1047
+ ariaLabelledBy?: string;
1048
+ /** Id of the element that describes this item. */
1049
+ ariaDescribedBy?: string;
1050
+ /** Id of the element controlled by this item. */
1051
+ ariaControls?: string;
1052
+ /** Whether the controlled element is expanded/collapsed. */
1053
+ ariaExpanded?: boolean;
1054
+ /** Indicates popup behavior when item triggers a menu/dialog/listbox/tree/grid. */
1055
+ ariaHasPopup?: AriaAttributes['aria-haspopup'];
1056
+ /** Explicit current state. Defaults to `page` when `selected` is true. */
1057
+ ariaCurrent?: AriaAttributes['aria-current'];
1058
+ };
1059
+
1060
+ type DrawerComponent = FC<DrawerProps> & {
1061
+ Header: FC<DrawerHeaderProps>;
1062
+ Body: FC<DrawerBodyProps>;
1063
+ Footer: FC<DrawerFooterProps>;
1064
+ Item: FC<DrawerItemProps>;
1065
+ };
1066
+
1067
+ declare const Drawer: DrawerComponent;
1068
+
1069
+ type DrawerContextValue = {
1070
+ /** Whether the drawer is in expanded (true) or collapsed (false) state. */
1071
+ isExpanded: boolean;
1072
+ };
1073
+ declare const useDrawerContext: () => DrawerContextValue;
1074
+
929
1075
  type AlertProps = {
930
1076
  /** Visual style of the alert. @default 'default' */
931
1077
  variant?: AlertVariant;
@@ -966,6 +1112,25 @@ type AlertComponent = FC<AlertProps> & {
966
1112
 
967
1113
  declare const Alert: AlertComponent;
968
1114
 
1115
+ type BackdropProps = {
1116
+ /** Whether the backdrop is fully visible (opacity 1). Transition is handled internally. */
1117
+ visible: boolean;
1118
+ /** Click handler — typically used to close the overlay. */
1119
+ onClick?: () => void;
1120
+ };
1121
+
1122
+ /**
1123
+ * Semi-transparent full-screen overlay used to visually block page content
1124
+ * while a modal element (dialog, temporary drawer…) is open.
1125
+ *
1126
+ * The `visible` prop drives the opacity transition: `false` = transparent,
1127
+ * `true` = `rgba(0,0,0,0.5)`. Mount/unmount is managed by the parent.
1128
+ *
1129
+ * @example
1130
+ * <Backdrop visible={isFadingIn} onClick={onClose} />
1131
+ */
1132
+ declare const Backdrop: FC<BackdropProps>;
1133
+
969
1134
  type DialogProps = {
970
1135
  /** Whether the dialog is visible. */
971
1136
  open: boolean;
@@ -1080,5 +1245,5 @@ declare const lightTheme: Theme;
1080
1245
 
1081
1246
  declare const darkTheme: Theme;
1082
1247
 
1083
- export { Alert, Badge, Box, Button, Card, Dialog, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Text, TextField, Tooltip, darkTheme, lightTheme };
1084
- 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 };
1248
+ export { Alert, Backdrop, Badge, Box, Button, Card, Checkbox, Dialog, Drawer, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Text, TextField, Tooltip, darkTheme, lightTheme, useDrawerContext };
1249
+ export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, 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.1.6",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "description": "Aurora DS - React Components Library",
6
6
  "main": "dist/cjs/index.js",