@auldrant/ui 0.11.1 → 0.12.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.
@@ -0,0 +1,16 @@
1
+ import { IBaseProps } from '../scripts/types';
2
+ import { ComponentChildren, FunctionComponent } from 'preact';
3
+ /** Props for {@link Badge}. */
4
+ interface IBadgeProps extends IBaseProps {
5
+ /**
6
+ * Badge label content. Should be self-describing text — avoid relying on
7
+ * color alone to convey meaning (WCAG 1.4.1). Prefer `"3 errors"` over a
8
+ * bare `"3"` on an error variant.
9
+ */
10
+ children: ComponentChildren;
11
+ /** Color variant. Defaults to `'neutral'`. */
12
+ variant?: 'neutral' | 'success' | 'warning' | 'error';
13
+ }
14
+ /** Inline status or count indicator rendered as a styled pill. */
15
+ declare const Badge: FunctionComponent<IBadgeProps>;
16
+ export default Badge;
@@ -1,9 +1,6 @@
1
1
  import { IBaseProps } from '../scripts/types';
2
- import { FunctionComponent } from 'preact';
3
- /** Props for {@link Button}. */
4
- interface IButtonProps extends IBaseProps {
5
- /** Visible button text. */
6
- label: string;
2
+ import { FunctionComponent, VNode } from 'preact';
3
+ interface IButtonBaseProps extends IBaseProps {
7
4
  /** Click handler. */
8
5
  onClick?: () => void;
9
6
  /** HTML button type. Defaults to `'button'`. */
@@ -11,6 +8,19 @@ interface IButtonProps extends IBaseProps {
11
8
  /** Whether the button is disabled. */
12
9
  disabled?: boolean;
13
10
  }
14
- /** Standard button with configurable type and click handler. */
11
+ /** Props for a text-label button. */
12
+ interface ITextButtonProps extends IButtonBaseProps {
13
+ /** Visible button text. */
14
+ label: string;
15
+ }
16
+ /** Props for an icon-only button. */
17
+ interface IIconButtonProps extends IButtonBaseProps {
18
+ /** Icon element rendered inside the button. */
19
+ icon: VNode;
20
+ /** Accessible name for icon-only buttons. Required when `icon` is set. */
21
+ 'aria-label': string;
22
+ }
23
+ type IButtonProps = ITextButtonProps | IIconButtonProps;
24
+ /** Standard button with configurable type and click handler. Supports text-label and icon-only variants. */
15
25
  declare const Button: FunctionComponent<IButtonProps>;
16
26
  export default Button;
@@ -0,0 +1,26 @@
1
+ import { FunctionComponent } from 'preact';
2
+ /** Props for {@link Head}. */
3
+ interface IHeadProps {
4
+ /** Document title. */
5
+ title?: string;
6
+ /** Meta description content. */
7
+ description?: string;
8
+ /** Canonical URL. */
9
+ canonical?: string;
10
+ /** Open Graph title. */
11
+ ogTitle?: string;
12
+ /** Open Graph description. */
13
+ ogDescription?: string;
14
+ /** Open Graph image URL. */
15
+ ogImage?: string;
16
+ }
17
+ /**
18
+ * Declarative document head manager. Render-less component that syncs props
19
+ * to head signals, which are then reflected in the actual document `<head>`.
20
+ *
21
+ * ```tsx
22
+ * <Head title="My Page" description="Page description" canonical="https://example.com/page" />
23
+ * ```
24
+ */
25
+ declare const Head: FunctionComponent<IHeadProps>;
26
+ export default Head;
@@ -0,0 +1,12 @@
1
+ import { IBaseProps } from '../scripts/types';
2
+ import { FunctionComponent } from 'preact';
3
+ /** Props for {@link Spinner}. */
4
+ interface ISpinnerProps extends IBaseProps {
5
+ /** Visually-hidden label announced by screen readers. Defaults to `'Loading…'`. */
6
+ label?: string;
7
+ /** Size variant. Defaults to `'md'`. */
8
+ size?: 'sm' | 'md' | 'lg';
9
+ }
10
+ /** Animated loading indicator with an accessible live region. */
11
+ declare const Spinner: FunctionComponent<ISpinnerProps>;
12
+ export default Spinner;
@@ -1,5 +1,5 @@
1
1
  import { IBaseProps } from '../scripts/types';
2
- import { ComponentChildren, FunctionComponent } from 'preact';
2
+ import { ComponentChild, FunctionComponent } from 'preact';
3
3
  /** Props for {@link Table}. */
4
4
  interface ITableProps extends IBaseProps {
5
5
  /** Accessible table name. Rendered as a `<caption>` element. */
@@ -7,7 +7,7 @@ interface ITableProps extends IBaseProps {
7
7
  /** Column header labels. */
8
8
  headers: string[];
9
9
  /** Row data as a 2D array of renderable content. */
10
- data: ComponentChildren[][];
10
+ data: ComponentChild[][];
11
11
  /** Render the first column as `<th scope="row">` for row identification. */
12
12
  rowHeader?: boolean;
13
13
  /** Apply alternating row backgrounds for improved scanability. */
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as Badge } from './components/Badge';
1
2
  export { default as Button } from './components/Button';
2
3
  export { default as Card } from './components/Card';
3
4
  export { default as Checkbox } from './components/Checkbox';
@@ -5,6 +6,7 @@ export { default as Dialog } from './components/Dialog';
5
6
  export type { IDialogAction } from './components/DialogBase';
6
7
  export { default as DownloadLink } from './components/DownloadLink';
7
8
  export { default as Form } from './components/Form';
9
+ export { default as Head } from './components/Head';
8
10
  export { default as Input } from './components/Input';
9
11
  export { default as Link } from './components/Link';
10
12
  export { default as Modal } from './components/Modal';
@@ -18,10 +20,11 @@ export { default as Section } from './components/Section';
18
20
  export type { ISelectGroup, ISelectOption } from './components/Select';
19
21
  export { default as Select } from './components/Select';
20
22
  export { default as SkipLink } from './components/SkipLink';
23
+ export { default as Spinner } from './components/Spinner';
21
24
  export { default as Table } from './components/Table';
22
25
  export { default as Textarea } from './components/Textarea';
23
26
  export { default as Theme, Palette } from './components/Theme';
24
27
  export { default as VisuallyHidden } from './components/VisuallyHidden';
25
28
  export { cx } from './scripts/utils';
26
- export { title } from './signals/head';
29
+ export { canonical, description, ogDescription, ogImage, ogTitle, title } from './signals/head';
27
30
  export { hash, location, navigate } from './signals/routing';
@@ -1,2 +1,12 @@
1
1
  /** Document title signal. Changes are synced to `document.title`. */
2
2
  export declare const title: import('@preact/signals-core').Signal<string>;
3
+ /** Meta description signal. Empty string removes the tag. */
4
+ export declare const description: import('@preact/signals-core').Signal<string>;
5
+ /** Canonical URL signal. Empty string removes the link tag. */
6
+ export declare const canonical: import('@preact/signals-core').Signal<string>;
7
+ /** Open Graph title signal. Empty string removes the tag. */
8
+ export declare const ogTitle: import('@preact/signals-core').Signal<string>;
9
+ /** Open Graph description signal. Empty string removes the tag. */
10
+ export declare const ogDescription: import('@preact/signals-core').Signal<string>;
11
+ /** Open Graph image URL signal. Empty string removes the tag. */
12
+ export declare const ogImage: import('@preact/signals-core').Signal<string>;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@auldrant/ui",
3
- "version": "0.11.1",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "description": "Accessible Preact component library with design tokens and CSS modules",
6
6
  "author": "Colonel Jade",
7
7
  "license": "MIT",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "https://github.com/coloneljade/auldrant-ui"
10
+ "url": "git+https://github.com/coloneljade/auldrant-ui.git"
11
11
  },
12
12
  "homepage": "https://github.com/coloneljade/auldrant-ui",
13
13
  "bugs": "https://github.com/coloneljade/auldrant-ui/issues",