@mucsi96/react-ui 0.2.0 → 0.3.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.
package/README.md CHANGED
@@ -27,6 +27,21 @@ export function SaveAction() {
27
27
 
28
28
  Components need no theme provider. The stylesheet defines the dark `--bt-*` tokens and `color-scheme` on `:root`; all component selectors and animations are locally scoped. It does not reset your application's typography or layout. The library entry is marked as a client boundary for React Server Component frameworks.
29
29
 
30
+ For applications migrating from `@mucsi96/angular-material-theme`, opt in to the
31
+ matching typography baseline before your application styles:
32
+
33
+ ```tsx
34
+ import '@mucsi96/react-ui/styles.css';
35
+ import '@mucsi96/react-ui/typography.css';
36
+ import './styles.css';
37
+ ```
38
+
39
+ This restores normal-weight, unscaled native headings with no default margins.
40
+ Set page-specific heading sizes and spacing in your CSS Modules. `--bt-font`
41
+ matches Angular Material's system-font stack; `--bt-font-body` matches Cooking's
42
+ Apple/Roboto body stack. Bundle Roboto locally if your application uses that
43
+ fallback. The optional stylesheet does not import fonts or reset page layouts.
44
+
30
45
  ## Buttons
31
46
 
32
47
  ```tsx
@@ -35,6 +50,7 @@ Components need no theme provider. The stylesheet defines the dark `--bt-*` toke
35
50
  <Button variant="outlined">Secondary</Button>
36
51
  <Button variant="text">Cancel</Button>
37
52
  <Button variant="icon" aria-label="Search"><SearchIcon /></Button>
53
+ <Button variant="avatar" aria-label="User menu">IB</Button>
38
54
  <Button variant="fab"><PlusIcon />New item</Button>
39
55
  <Button variant="mini-fab" aria-label="Add"><PlusIcon /></Button>
40
56
  <Button isDisabled>Unavailable</Button>
@@ -45,6 +61,10 @@ Components need no theme provider. The stylesheet defines the dark `--bt-*` toke
45
61
 
46
62
  Buttons expose React Aria's press API (`onPress`, `isDisabled`) and React 19's `ref` prop. Set `type="submit"` for form submission. Supply an accessible label for icon-only actions. Icons are ordinary React children; no icon package is imposed on consumers.
47
63
 
64
+ Use `avatar` for initials-based profile/menu triggers: a 40px filled circle with
65
+ normal-weight 18px initials, matching Cooking's Angular avatar. Compose it with
66
+ `MenuTrigger` just like other buttons; keep the accessible name on the button.
67
+
48
68
  ## Forms
49
69
 
50
70
  ```tsx
@@ -68,6 +88,19 @@ Labels, descriptions, and validation messages are associated with the input auto
68
88
 
69
89
  Select options have `{ id, label, isDisabled? }`; React Aria handles selection, typeahead, and filtering. Checkbox and switch controlled state uses `isSelected`/`onChange`; radio group state uses `value`/`onChange`. React Aria form `name` props support native form submissions.
70
90
 
91
+ ### Angular field and button baseline
92
+
93
+ Fields default to `appearance="filled"`, with always-visible floating labels and
94
+ the Angular theme's 56px content height (58px including its border). `TextField`,
95
+ `Select`, and `ComboBox` also accept `appearance="outlined"`. On an outlined field
96
+ over a custom surface, set `--bt-field-label-background` to that surface color.
97
+ Required markers are visual only; the accessible name remains the supplied label.
98
+
99
+ Buttons use Angular's 40px default height; icon buttons are circular, and FABs
100
+ use 56px/40px sizes. Consumers needing taller touch targets can set `min-height`
101
+ on their CSS Module class. See the repository's `docs/angular-component-audit.md`
102
+ for the component-by-component comparison and remaining differences.
103
+
71
104
  ## Donut slider
72
105
 
73
106
  ```tsx
@@ -1,7 +1,7 @@
1
1
  import type { ButtonProps as AriaButtonProps, LinkProps } from 'react-aria-components';
2
2
  import type { CSSProperties, ReactNode, Ref } from 'react';
3
3
  import type { Tone } from '../../types';
4
- export type ButtonVariant = 'filled' | 'raised' | 'outlined' | 'text' | 'icon' | 'fab' | 'mini-fab';
4
+ export type ButtonVariant = 'filled' | 'raised' | 'outlined' | 'text' | 'icon' | 'avatar' | 'fab' | 'mini-fab';
5
5
  interface Appearance {
6
6
  variant?: ButtonVariant;
7
7
  tone?: Tone;
@@ -11,12 +11,13 @@ interface FieldProps {
11
11
  description?: ReactNode;
12
12
  error?: ReactNode;
13
13
  placeholder?: string;
14
+ appearance?: 'outlined' | 'filled';
14
15
  className?: string;
15
16
  }
16
17
  export interface SelectProps extends Omit<AriaSelectProps<SelectOption>, keyof FieldProps | 'children' | 'items'>, FieldProps {
17
18
  }
18
- export declare function Select({ label, options, description, error, placeholder, className, ...props }: SelectProps): import("react").JSX.Element;
19
+ export declare function Select({ label, options, description, error, placeholder, appearance, className, ...props }: SelectProps): import("react").JSX.Element;
19
20
  export interface ComboBoxProps extends Omit<AriaComboBoxProps<SelectOption>, keyof FieldProps | 'children' | 'items' | 'defaultItems'>, FieldProps {
20
21
  }
21
- export declare function ComboBox({ label, options, description, error, placeholder, className, ...props }: ComboBoxProps): import("react").JSX.Element;
22
+ export declare function ComboBox({ label, options, description, error, placeholder, appearance, className, ...props }: ComboBoxProps): import("react").JSX.Element;
22
23
  export {};