@boostdev/design-system-react-native 0.5.0 → 0.6.0

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +35 -1
  3. package/dist/index.cjs +596 -545
  4. package/dist/index.d.cts +17 -1
  5. package/dist/index.d.ts +17 -1
  6. package/dist/index.js +488 -437
  7. package/package.json +1 -1
  8. package/src/components/interaction/Button/Button.mdx +13 -1
  9. package/src/components/interaction/Button/Button.spec.tsx +83 -0
  10. package/src/components/interaction/Button/Button.tsx +9 -8
  11. package/src/components/interaction/form/Combobox/Combobox.spec.tsx +22 -0
  12. package/src/components/interaction/form/Combobox/Combobox.tsx +4 -3
  13. package/src/components/interaction/form/FileInput/FileInput.spec.tsx +18 -0
  14. package/src/components/interaction/form/FileInput/FileInput.tsx +3 -3
  15. package/src/components/interaction/form/FormInput/FormInput.spec.tsx +20 -0
  16. package/src/components/interaction/form/FormInput/FormInput.tsx +5 -4
  17. package/src/components/interaction/form/NumberInput/NumberInput.spec.tsx +21 -0
  18. package/src/components/interaction/form/NumberInput/NumberInput.tsx +7 -6
  19. package/src/components/interaction/form/Select/Select.mdx +2 -1
  20. package/src/components/interaction/form/Select/Select.spec.tsx +35 -1
  21. package/src/components/interaction/form/Select/Select.tsx +8 -7
  22. package/src/components/interaction/form/Textarea/Textarea.spec.tsx +18 -0
  23. package/src/components/interaction/form/Textarea/Textarea.tsx +3 -3
  24. package/src/components/ui/Collapsible/Collapsible.spec.tsx +1 -1
  25. package/src/components/ui/Collapsible/Collapsible.tsx +5 -10
  26. package/src/index.ts +1 -1
  27. package/src/native/Chevron.spec.tsx +34 -0
  28. package/src/native/Chevron.tsx +50 -0
  29. package/src/native/ThemeContext.spec.tsx +81 -1
  30. package/src/native/ThemeContext.tsx +32 -3
  31. package/src/test/cornerRadii.ts +15 -0
package/dist/index.d.cts CHANGED
@@ -18,6 +18,15 @@ declare const lineHeight: {
18
18
  type ThemeColorName = keyof typeof colors.light;
19
19
  /** Semantic theme colors, widened to `string` so brand overrides typecheck. */
20
20
  type ThemeColors = Readonly<Record<ThemeColorName, string>>;
21
+ /** Corner radii of the controls, in points. */
22
+ interface ThemeRadius {
23
+ /** Buttons with a text label. */
24
+ button: number;
25
+ /** Icon-only buttons (`isIconOnly`). */
26
+ iconButton: number;
27
+ /** Input fields: FormInput, Select, Combobox, Textarea, FileInput, NumberInput. */
28
+ field: number;
29
+ }
21
30
  /**
22
31
  * Per-scheme token overrides, merged over the foundation colors.
23
32
  * The React Native equivalent of overriding tokens in the web
@@ -26,10 +35,17 @@ type ThemeColors = Readonly<Record<ThemeColorName, string>>;
26
35
  interface ThemeTokenOverrides {
27
36
  light?: Partial<Record<ThemeColorName, string>>;
28
37
  dark?: Partial<Record<ThemeColorName, string>>;
38
+ /**
39
+ * Radius overrides, the same in light and dark. The native equivalent of the
40
+ * web `--button_radius` custom property. Merged over the parent provider's
41
+ * radii, so a nested provider that only overrides colors keeps the app's radii.
42
+ */
43
+ radius?: Partial<ThemeRadius>;
29
44
  }
30
45
  interface ThemeContextValue {
31
46
  colors: ThemeColors;
32
47
  isDark: boolean;
48
+ radius: ThemeRadius;
33
49
  }
34
50
  interface ThemeProviderProps {
35
51
  children: ReactNode;
@@ -667,4 +683,4 @@ interface MessageProps {
667
683
  }
668
684
  declare function Message({ message, type, style }: MessageProps): react_jsx_runtime.JSX.Element | null;
669
685
 
670
- export { Accordion, type AccordionItem, Alert, Avatar, Badge, Breadcrumb, type BreadcrumbItem, Button, ButtonContainer, type ButtonContainerProps, ButtonGroup, type ButtonGroupProps, type ButtonProps, Calendar, Card, Carousel, Checkbox, CheckboxGroup, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type CreateReactNavigationThemeOptions, type DescriptionItem, DescriptionList, Dialog, DropdownMenu, type DropdownMenuItem, FileInput, FormInput, IconWrapper, type IconWrapperProps, Label, Link, Loading, Message, NotificationBanner, NumberInput, Pagination, Popover, Progress, ProgressCircle, Radio, RadioGroup, Rating, type ReactNavigationFontStyle, type ReactNavigationTheme, type ReactNavigationThemeColors, type ReactNavigationThemeFonts, ScaledText, ScaledTextInput, SectionHeader, SegmentedControl, Select, type SelectOption, Separator, SideSheet, Skeleton, Slider, Switch, type TabItem, Table, type TableColumn, Tabs, Textarea, type ThemeColorName, type ThemeColors, ThemeProvider, type ThemeTokenOverrides, ToastProvider, Tooltip, Typography, createReactNavigationTheme, lineHeight, maxFontScaleFor, maxFontScaleForStyle, useReactNavigationTheme, useTheme, useToast };
686
+ export { Accordion, type AccordionItem, Alert, Avatar, Badge, Breadcrumb, type BreadcrumbItem, Button, ButtonContainer, type ButtonContainerProps, ButtonGroup, type ButtonGroupProps, type ButtonProps, Calendar, Card, Carousel, Checkbox, CheckboxGroup, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type CreateReactNavigationThemeOptions, type DescriptionItem, DescriptionList, Dialog, DropdownMenu, type DropdownMenuItem, FileInput, FormInput, IconWrapper, type IconWrapperProps, Label, Link, Loading, Message, NotificationBanner, NumberInput, Pagination, Popover, Progress, ProgressCircle, Radio, RadioGroup, Rating, type ReactNavigationFontStyle, type ReactNavigationTheme, type ReactNavigationThemeColors, type ReactNavigationThemeFonts, ScaledText, ScaledTextInput, SectionHeader, SegmentedControl, Select, type SelectOption, Separator, SideSheet, Skeleton, Slider, Switch, type TabItem, Table, type TableColumn, Tabs, Textarea, type ThemeColorName, type ThemeColors, ThemeProvider, type ThemeRadius, type ThemeTokenOverrides, ToastProvider, Tooltip, Typography, createReactNavigationTheme, lineHeight, maxFontScaleFor, maxFontScaleForStyle, useReactNavigationTheme, useTheme, useToast };
package/dist/index.d.ts CHANGED
@@ -18,6 +18,15 @@ declare const lineHeight: {
18
18
  type ThemeColorName = keyof typeof colors.light;
19
19
  /** Semantic theme colors, widened to `string` so brand overrides typecheck. */
20
20
  type ThemeColors = Readonly<Record<ThemeColorName, string>>;
21
+ /** Corner radii of the controls, in points. */
22
+ interface ThemeRadius {
23
+ /** Buttons with a text label. */
24
+ button: number;
25
+ /** Icon-only buttons (`isIconOnly`). */
26
+ iconButton: number;
27
+ /** Input fields: FormInput, Select, Combobox, Textarea, FileInput, NumberInput. */
28
+ field: number;
29
+ }
21
30
  /**
22
31
  * Per-scheme token overrides, merged over the foundation colors.
23
32
  * The React Native equivalent of overriding tokens in the web
@@ -26,10 +35,17 @@ type ThemeColors = Readonly<Record<ThemeColorName, string>>;
26
35
  interface ThemeTokenOverrides {
27
36
  light?: Partial<Record<ThemeColorName, string>>;
28
37
  dark?: Partial<Record<ThemeColorName, string>>;
38
+ /**
39
+ * Radius overrides, the same in light and dark. The native equivalent of the
40
+ * web `--button_radius` custom property. Merged over the parent provider's
41
+ * radii, so a nested provider that only overrides colors keeps the app's radii.
42
+ */
43
+ radius?: Partial<ThemeRadius>;
29
44
  }
30
45
  interface ThemeContextValue {
31
46
  colors: ThemeColors;
32
47
  isDark: boolean;
48
+ radius: ThemeRadius;
33
49
  }
34
50
  interface ThemeProviderProps {
35
51
  children: ReactNode;
@@ -667,4 +683,4 @@ interface MessageProps {
667
683
  }
668
684
  declare function Message({ message, type, style }: MessageProps): react_jsx_runtime.JSX.Element | null;
669
685
 
670
- export { Accordion, type AccordionItem, Alert, Avatar, Badge, Breadcrumb, type BreadcrumbItem, Button, ButtonContainer, type ButtonContainerProps, ButtonGroup, type ButtonGroupProps, type ButtonProps, Calendar, Card, Carousel, Checkbox, CheckboxGroup, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type CreateReactNavigationThemeOptions, type DescriptionItem, DescriptionList, Dialog, DropdownMenu, type DropdownMenuItem, FileInput, FormInput, IconWrapper, type IconWrapperProps, Label, Link, Loading, Message, NotificationBanner, NumberInput, Pagination, Popover, Progress, ProgressCircle, Radio, RadioGroup, Rating, type ReactNavigationFontStyle, type ReactNavigationTheme, type ReactNavigationThemeColors, type ReactNavigationThemeFonts, ScaledText, ScaledTextInput, SectionHeader, SegmentedControl, Select, type SelectOption, Separator, SideSheet, Skeleton, Slider, Switch, type TabItem, Table, type TableColumn, Tabs, Textarea, type ThemeColorName, type ThemeColors, ThemeProvider, type ThemeTokenOverrides, ToastProvider, Tooltip, Typography, createReactNavigationTheme, lineHeight, maxFontScaleFor, maxFontScaleForStyle, useReactNavigationTheme, useTheme, useToast };
686
+ export { Accordion, type AccordionItem, Alert, Avatar, Badge, Breadcrumb, type BreadcrumbItem, Button, ButtonContainer, type ButtonContainerProps, ButtonGroup, type ButtonGroupProps, type ButtonProps, Calendar, Card, Carousel, Checkbox, CheckboxGroup, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type CreateReactNavigationThemeOptions, type DescriptionItem, DescriptionList, Dialog, DropdownMenu, type DropdownMenuItem, FileInput, FormInput, IconWrapper, type IconWrapperProps, Label, Link, Loading, Message, NotificationBanner, NumberInput, Pagination, Popover, Progress, ProgressCircle, Radio, RadioGroup, Rating, type ReactNavigationFontStyle, type ReactNavigationTheme, type ReactNavigationThemeColors, type ReactNavigationThemeFonts, ScaledText, ScaledTextInput, SectionHeader, SegmentedControl, Select, type SelectOption, Separator, SideSheet, Skeleton, Slider, Switch, type TabItem, Table, type TableColumn, Tabs, Textarea, type ThemeColorName, type ThemeColors, ThemeProvider, type ThemeRadius, type ThemeTokenOverrides, ToastProvider, Tooltip, Typography, createReactNavigationTheme, lineHeight, maxFontScaleFor, maxFontScaleForStyle, useReactNavigationTheme, useTheme, useToast };