@comms-id/australian-address-autocomplete-react 0.0.0-stage → 0.2.3
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/LICENSE +15 -0
- package/README.md +54 -2
- package/dist/address-autocomplete.d.ts +21 -0
- package/dist/address-autocomplete.js +80 -0
- package/dist/highlight.d.ts +4 -0
- package/dist/highlight.js +4 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/use-address.d.ts +23 -0
- package/dist/use-address.js +76 -0
- package/package.json +54 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Copyright (c) 2026 COMMS.ID PTY LTD. Proprietary software; not open source.
|
|
2
|
+
|
|
3
|
+
Subject to the Comms.ID policy agreement, you may install, copy, bundle, run and
|
|
4
|
+
deliver this client or component within your applications, adapt the supplied
|
|
5
|
+
component source, and use the designated local functions and fixtures offline.
|
|
6
|
+
Hosted operations are provided by the Comms.ID service.
|
|
7
|
+
|
|
8
|
+
You may keep replies for your own customers and transactions, and your registered
|
|
9
|
+
application may relay requests for its own users.
|
|
10
|
+
|
|
11
|
+
You may not republish these packages as a standalone offering, resell access, offer
|
|
12
|
+
a substitute lookup service, or harvest replies to reconstruct or redistribute a
|
|
13
|
+
source dataset.
|
|
14
|
+
|
|
15
|
+
Preserve this notice and any applicable third-party notices.
|
package/README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @comms-id/australian-address-autocomplete-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A React hook and a finished component for Comms.ID Address autocomplete. Accessible, no layout shift, with the data attribution always shown. React 18 or later; it depends on `@comms-id/australian-address-autocomplete` and nothing else.
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import { createAustralianAddressAutocompleteBrowserClient } from "@comms-id/australian-address-autocomplete/browser";
|
|
7
|
+
import { AustralianAddressAutocomplete } from "@comms-id/australian-address-autocomplete-react";
|
|
8
|
+
|
|
9
|
+
const client = createAustralianAddressAutocompleteBrowserClient({ relayUrl: "/api/comms-id/address" });
|
|
10
|
+
|
|
11
|
+
export const Checkout = () => (
|
|
12
|
+
<AustralianAddressAutocomplete
|
|
13
|
+
client={client}
|
|
14
|
+
label="Delivery address"
|
|
15
|
+
onSelect={(address, timing) => console.log(address.displayAddress, `${timing.ms} ms`)}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`relayUrl` is your own server route, set up with `@comms-id/relay`: your server signs the call as your registered app, so the browser holds no credential.
|
|
21
|
+
|
|
22
|
+
## Your own markup: `useAustralianAddressAutocomplete`
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
const address = useAustralianAddressAutocomplete({ client, onSelect });
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<input {...address.getInputProps()} />
|
|
29
|
+
<ul {...address.getListboxProps("Matches")} hidden={!address.state.open}>
|
|
30
|
+
{address.state.suggestions.map((s, i) => (
|
|
31
|
+
<li key={s.id} {...address.getOptionProps(i)}>{s.label}</li>
|
|
32
|
+
))}
|
|
33
|
+
</ul>
|
|
34
|
+
<p {...address.getStatusProps()}>{address.state.announcement}</p>
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The prop getters carry the WAI-ARIA combobox contract: roles, `aria-expanded`, `aria-controls`, `aria-activedescendant`, key handling (arrows, Enter, Escape, Tab) and a polite live region. Render the attribution yourself when you use the hook: `import { ATTRIBUTION } from "@comms-id/australian-address-autocomplete-react"`.
|
|
40
|
+
|
|
41
|
+
## The component
|
|
42
|
+
|
|
43
|
+
Props: `client` and `label` (required), `onSelect`, `minChars` (3), `debounceMs` (400), `limit` (8), `within`, `idPrefix`, `name`, `placeholder`, `disabled`, `required`, `className`, `listLabel`, `showTiming` (true), `renderOption`.
|
|
44
|
+
|
|
45
|
+
Style it with the custom properties `--comms-id-text`, `--comms-id-surface`, `--comms-id-border`, `--comms-id-active`, `--comms-id-radius` or the `comms-id-australian-address-autocomplete__*` class names. It needs no stylesheet.
|
|
46
|
+
|
|
47
|
+
- The list floats under the input; opening it moves nothing. The status line has a reserved height.
|
|
48
|
+
- A failed lookup says why (`Address search is unavailable`) and offers "Try again"; it is never shown as "no match".
|
|
49
|
+
- It renders on the server with the same structure, and works under StrictMode.
|
|
50
|
+
|
|
51
|
+
## Data attribution
|
|
52
|
+
|
|
53
|
+
Address data is G-NAF. The component always shows the required wording. Do not hide it.
|
|
54
|
+
|
|
55
|
+
`LICENSE` is the consumer client licence.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type AddressSuggestion } from "@comms-id/australian-address-autocomplete/controller";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type UseAddressOptions } from "./use-address.js";
|
|
4
|
+
export interface AustralianAddressAutocompleteProps extends UseAddressOptions {
|
|
5
|
+
readonly className?: string;
|
|
6
|
+
readonly disabled?: boolean;
|
|
7
|
+
/** The visible label of the field. Required: a field without a label is not accessible. */
|
|
8
|
+
readonly label: string;
|
|
9
|
+
/** The accessible name of the list of suggestions. */
|
|
10
|
+
readonly listLabel?: string;
|
|
11
|
+
readonly name?: string;
|
|
12
|
+
readonly placeholder?: string;
|
|
13
|
+
/** Your own content for one suggestion. */
|
|
14
|
+
readonly renderOption?: (suggestion: AddressSuggestion, state: {
|
|
15
|
+
readonly active: boolean;
|
|
16
|
+
}) => ReactNode;
|
|
17
|
+
readonly required?: boolean;
|
|
18
|
+
/** Show how long the chosen address took to resolve. True by default. */
|
|
19
|
+
readonly showTiming?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const AustralianAddressAutocomplete: (props: AustralianAddressAutocompleteProps) => ReactNode;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// <AustralianAddressAutocomplete>: the Address field as one component. It is accessible (WAI-ARIA combobox),
|
|
3
|
+
// it never shifts the page (the list floats, every other line has a fixed place), and it always
|
|
4
|
+
// shows the data attribution. Style it with the --comms-id-* variables or the comms-id-australian-address-autocomplete
|
|
5
|
+
// class names; it needs no stylesheet.
|
|
6
|
+
import { ATTRIBUTION, } from "@comms-id/australian-address-autocomplete/controller";
|
|
7
|
+
import { highlight } from "./highlight.js";
|
|
8
|
+
import { useAustralianAddressAutocomplete } from "./use-address.js";
|
|
9
|
+
const HIDDEN_FROM_SIGHT = {
|
|
10
|
+
position: "absolute",
|
|
11
|
+
width: 1,
|
|
12
|
+
height: 1,
|
|
13
|
+
margin: -1,
|
|
14
|
+
padding: 0,
|
|
15
|
+
overflow: "hidden",
|
|
16
|
+
clip: "rect(0 0 0 0)",
|
|
17
|
+
whiteSpace: "nowrap",
|
|
18
|
+
border: 0,
|
|
19
|
+
};
|
|
20
|
+
const ROOT = { position: "relative", color: "var(--comms-id-text, inherit)", font: "inherit" };
|
|
21
|
+
const LABEL = { display: "block", marginBottom: 4 };
|
|
22
|
+
const FIELD = { position: "relative" };
|
|
23
|
+
const INPUT = {
|
|
24
|
+
boxSizing: "border-box",
|
|
25
|
+
width: "100%",
|
|
26
|
+
padding: "0.5rem 0.75rem",
|
|
27
|
+
font: "inherit",
|
|
28
|
+
color: "inherit",
|
|
29
|
+
background: "var(--comms-id-surface, #fff)",
|
|
30
|
+
border: "1px solid var(--comms-id-border, #767676)",
|
|
31
|
+
borderRadius: "var(--comms-id-radius, 4px)",
|
|
32
|
+
};
|
|
33
|
+
// The list floats under the input, so opening and closing it moves nothing else on the page.
|
|
34
|
+
const LIST = {
|
|
35
|
+
position: "absolute",
|
|
36
|
+
top: "100%",
|
|
37
|
+
left: 0,
|
|
38
|
+
right: 0,
|
|
39
|
+
zIndex: 1000,
|
|
40
|
+
maxHeight: "16rem",
|
|
41
|
+
overflowY: "auto",
|
|
42
|
+
margin: "4px 0 0",
|
|
43
|
+
padding: 0,
|
|
44
|
+
listStyle: "none",
|
|
45
|
+
background: "var(--comms-id-surface, #fff)",
|
|
46
|
+
color: "var(--comms-id-text, #111)",
|
|
47
|
+
border: "1px solid var(--comms-id-border, #767676)",
|
|
48
|
+
borderRadius: "var(--comms-id-radius, 4px)",
|
|
49
|
+
boxShadow: "0 4px 12px rgb(0 0 0 / 15%)",
|
|
50
|
+
};
|
|
51
|
+
const OPTION = { padding: "0.5rem 0.75rem", cursor: "pointer" };
|
|
52
|
+
const NOTE = { minHeight: "1.6em", margin: "4px 0 0", fontSize: "0.85em", lineHeight: "1.5em" };
|
|
53
|
+
const ATTRIBUTION_TEXT = { margin: "2px 0 0", fontSize: "0.75em", lineHeight: 1.4, opacity: 0.8 };
|
|
54
|
+
const FOOTER = {
|
|
55
|
+
...ATTRIBUTION_TEXT,
|
|
56
|
+
padding: "0.5rem 0.75rem",
|
|
57
|
+
borderTop: "1px solid var(--comms-id-border, #767676)",
|
|
58
|
+
};
|
|
59
|
+
const defaultOption = (suggestion) => (_jsxs(_Fragment, { children: [suggestion.unitLabel === undefined ? null : (_jsxs("span", { className: "comms-id-australian-address-autocomplete__unit", children: [suggestion.unitLabel, " "] })), _jsx("span", { className: "comms-id-australian-address-autocomplete__label-text", children: highlight(suggestion.label, suggestion.matchedRanges) }), suggestion.secondaryLabel === undefined ? null : (_jsx("span", { className: "comms-id-australian-address-autocomplete__secondary", style: { display: "block", fontSize: "0.85em", opacity: 0.75 }, children: suggestion.secondaryLabel }))] }));
|
|
60
|
+
const noteFor = (state, showTiming, retry) => {
|
|
61
|
+
if (state.status === "error" && state.error !== undefined) {
|
|
62
|
+
return (_jsxs(_Fragment, { children: [state.error.message, " ", state.error.retryable ? (_jsx("button", { className: "comms-id-australian-address-autocomplete__retry", onClick: retry, type: "button", children: "Try again" })) : null] }));
|
|
63
|
+
}
|
|
64
|
+
if (state.status === "resolved" && state.resolved !== undefined && showTiming) {
|
|
65
|
+
return `Resolved in ${state.resolved.timing.ms} ms by Comms.ID address search.`;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
export const AustralianAddressAutocomplete = (props) => {
|
|
70
|
+
const { label, name, placeholder, disabled, required, className, listLabel, showTiming, renderOption, ...options } = props;
|
|
71
|
+
const address = useAustralianAddressAutocomplete(options);
|
|
72
|
+
const { state } = address;
|
|
73
|
+
const note = noteFor(state, showTiming !== false, address.retry);
|
|
74
|
+
return (_jsxs("div", { className: className === undefined
|
|
75
|
+
? "comms-id-australian-address-autocomplete"
|
|
76
|
+
: `comms-id-australian-address-autocomplete ${className}`, style: ROOT, children: [_jsx("label", { className: "comms-id-australian-address-autocomplete__label", htmlFor: address.ids.input, style: LABEL, children: label }), _jsxs("div", { style: FIELD, children: [_jsx("input", { ...address.getInputProps(), className: "comms-id-australian-address-autocomplete__input", disabled: disabled, name: name, placeholder: placeholder, required: required, style: INPUT }), _jsxs("ul", { ...address.getListboxProps(listLabel ?? "Address suggestions"), className: "comms-id-australian-address-autocomplete__list", hidden: !state.open, style: LIST, children: [state.suggestions.map((suggestion, index) => {
|
|
77
|
+
const active = index === state.activeIndex;
|
|
78
|
+
return (_jsx("li", { ...address.getOptionProps(index), className: "comms-id-australian-address-autocomplete__option", style: { ...OPTION, background: active ? "var(--comms-id-active, #e8f0fe)" : "transparent" }, children: renderOption === undefined ? defaultOption(suggestion) : renderOption(suggestion, { active }) }, suggestion.id));
|
|
79
|
+
}), _jsx("li", { "aria-hidden": "true", className: "comms-id-australian-address-autocomplete__list-attribution", style: FOOTER, children: ATTRIBUTION })] })] }), _jsx("span", { ...address.getStatusProps(), style: HIDDEN_FROM_SIGHT, children: state.announcement }), _jsx("p", { "aria-hidden": "true", className: "comms-id-australian-address-autocomplete__note", style: NOTE, children: note }), _jsx("p", { className: "comms-id-australian-address-autocomplete__attribution", style: ATTRIBUTION_TEXT, children: ATTRIBUTION })] }));
|
|
80
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MatchRange } from "@comms-id/australian-address-autocomplete/controller";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
/** The label with the matched parts in <strong>. Ranges are [start, end) offsets into the label. */
|
|
4
|
+
export declare const highlight: (label: string, ranges: readonly MatchRange[]) => ReactNode[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { splitMatches } from "@comms-id/australian-address-autocomplete/controller";
|
|
3
|
+
/** The label with the matched parts in <strong>. Ranges are [start, end) offsets into the label. */
|
|
4
|
+
export const highlight = (label, ranges) => splitMatches(label, ranges).map((segment, index) => segment.match ? _jsx("strong", { children: segment.text }, `${index}-${segment.text}`) : segment.text);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { AddressState, AddressStatus, AddressSuggestion, } from "@comms-id/australian-address-autocomplete/controller";
|
|
2
|
+
export { ATTRIBUTION } from "@comms-id/australian-address-autocomplete/controller";
|
|
3
|
+
export type { AustralianAddressAutocompleteProps } from "./address-autocomplete.js";
|
|
4
|
+
export { AustralianAddressAutocomplete } from "./address-autocomplete.js";
|
|
5
|
+
export { highlight } from "./highlight.js";
|
|
6
|
+
export type { UseAddressOptions, UseAddressResult } from "./use-address.js";
|
|
7
|
+
export { useAustralianAddressAutocomplete } from "./use-address.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ATTRIBUTION } from "@comms-id/australian-address-autocomplete/controller";
|
|
2
|
+
export { AustralianAddressAutocomplete } from "./address-autocomplete.js";
|
|
3
|
+
export { highlight } from "./highlight.js";
|
|
4
|
+
export { useAustralianAddressAutocomplete } from "./use-address.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AddressControllerOptions, type AddressIds, type AddressState } from "@comms-id/australian-address-autocomplete/controller";
|
|
2
|
+
export interface UseAddressOptions extends AddressControllerOptions {
|
|
3
|
+
/** Prefix of the element ids. A generated one by default; set it to name the input yourself. */
|
|
4
|
+
readonly idPrefix?: string;
|
|
5
|
+
}
|
|
6
|
+
type Props = Record<string, unknown>;
|
|
7
|
+
export interface UseAddressResult {
|
|
8
|
+
close: () => void;
|
|
9
|
+
/** Props for the text input: role, aria-*, value and the handlers. */
|
|
10
|
+
getInputProps: () => Props;
|
|
11
|
+
/** Props for the list element (role listbox). It must always be rendered; hide it while closed. */
|
|
12
|
+
getListboxProps: (label: string) => Props;
|
|
13
|
+
/** Props for the option at `index` (role option). */
|
|
14
|
+
getOptionProps: (index: number) => Props;
|
|
15
|
+
/** Props for the polite live region that says what just happened. */
|
|
16
|
+
getStatusProps: () => Props;
|
|
17
|
+
readonly ids: AddressIds;
|
|
18
|
+
retry: () => void;
|
|
19
|
+
select: (index?: number) => void;
|
|
20
|
+
readonly state: AddressState;
|
|
21
|
+
}
|
|
22
|
+
export declare const useAustralianAddressAutocomplete: (options: UseAddressOptions) => UseAddressResult;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// The headless hook: the Address controller as React state, plus prop getters that carry the
|
|
2
|
+
// WAI-ARIA combobox contract. Use it with your own markup, or use <AustralianAddressAutocomplete>.
|
|
3
|
+
import { createAddressController, handleKey, IDLE_STATE, inputAttributes, listboxAttributes, optionAttributes, statusAttributes, } from "@comms-id/australian-address-autocomplete/controller";
|
|
4
|
+
import { useEffect, useId, useRef, useState, useSyncExternalStore, } from "react";
|
|
5
|
+
const EMPTY = { getState: () => IDLE_STATE, subscribe: () => () => undefined };
|
|
6
|
+
// React's names for three attributes the framework-neutral helpers write in HTML case.
|
|
7
|
+
const REACT_NAMES = {
|
|
8
|
+
autocomplete: "autoComplete",
|
|
9
|
+
autocapitalize: "autoCapitalize",
|
|
10
|
+
spellcheck: "spellCheck",
|
|
11
|
+
};
|
|
12
|
+
const toProps = (attributes) => Object.fromEntries(Object.entries(attributes)
|
|
13
|
+
.filter(([, value]) => value !== undefined)
|
|
14
|
+
.map(([name, value]) => [REACT_NAMES[name] ?? name, value]));
|
|
15
|
+
const COLONS = /:/g;
|
|
16
|
+
export const useAustralianAddressAutocomplete = (options) => {
|
|
17
|
+
const generated = useId().replace(COLONS, "");
|
|
18
|
+
const prefix = options.idPrefix ?? `comms-id-address-${generated}`;
|
|
19
|
+
const ids = { input: `${prefix}-input`, listbox: `${prefix}-list`, status: `${prefix}-status` };
|
|
20
|
+
// The latest options, read at call time, so a new client or callback never recreates the controller.
|
|
21
|
+
const latest = useRef(options);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
latest.current = options;
|
|
24
|
+
});
|
|
25
|
+
const [controller, setController] = useState(undefined);
|
|
26
|
+
const { minChars, debounceMs, limit, within } = options;
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const created = createAddressController({
|
|
29
|
+
client: {
|
|
30
|
+
suggest: (input, callOptions) => latest.current.client.suggest(input, callOptions),
|
|
31
|
+
resolve: (input, callOptions) => latest.current.client.resolve(input, callOptions),
|
|
32
|
+
},
|
|
33
|
+
...(minChars === undefined ? {} : { minChars }),
|
|
34
|
+
...(debounceMs === undefined ? {} : { debounceMs }),
|
|
35
|
+
...(limit === undefined ? {} : { limit }),
|
|
36
|
+
...(within === undefined ? {} : { within }),
|
|
37
|
+
...(latest.current.now === undefined ? {} : { now: () => latest.current.now?.() ?? 0 }),
|
|
38
|
+
onSelect: (address, timing) => latest.current.onSelect?.(address, timing),
|
|
39
|
+
});
|
|
40
|
+
setController(created);
|
|
41
|
+
return () => {
|
|
42
|
+
created.dispose();
|
|
43
|
+
setController(undefined);
|
|
44
|
+
};
|
|
45
|
+
}, [minChars, debounceMs, limit, within]);
|
|
46
|
+
const store = controller ?? EMPTY;
|
|
47
|
+
const state = useSyncExternalStore(store.subscribe, store.getState, store.getState);
|
|
48
|
+
return {
|
|
49
|
+
state,
|
|
50
|
+
ids,
|
|
51
|
+
getInputProps: () => ({
|
|
52
|
+
...toProps(inputAttributes(state, ids)),
|
|
53
|
+
value: state.query,
|
|
54
|
+
onChange: (event) => controller?.setQuery(event.target.value),
|
|
55
|
+
onKeyDown: (event) => {
|
|
56
|
+
if (controller !== undefined && handleKey(controller, event.key)) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
onFocus: () => controller?.open(),
|
|
61
|
+
onBlur: () => controller?.close(),
|
|
62
|
+
}),
|
|
63
|
+
getListboxProps: (label) => toProps(listboxAttributes(ids, label)),
|
|
64
|
+
getOptionProps: (index) => ({
|
|
65
|
+
...toProps(optionAttributes(state, ids, index)),
|
|
66
|
+
// The input keeps focus while the pointer chooses an option.
|
|
67
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
68
|
+
onMouseMove: () => controller?.setActive(index),
|
|
69
|
+
onClick: () => controller?.select(index),
|
|
70
|
+
}),
|
|
71
|
+
getStatusProps: () => toProps(statusAttributes(ids)),
|
|
72
|
+
select: (index) => controller?.select(index),
|
|
73
|
+
retry: () => controller?.retry(),
|
|
74
|
+
close: () => controller?.close(),
|
|
75
|
+
};
|
|
76
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comms-id/australian-address-autocomplete-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "React hook and component for Comms.ID Address autocomplete: accessible, no layout shift, with the data attribution",
|
|
5
|
+
"homepage": "https://comms.id",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/comms-id/platform/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
10
|
+
"author": "COMMS.ID PTY LTD",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/comms-id/platform.git",
|
|
14
|
+
"directory": "packages/australian-address-autocomplete-react"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@comms-id/australian-address-autocomplete": "0.3.2"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": ">=18"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/node": "24.19.2",
|
|
43
|
+
"@types/react": "19.3.0",
|
|
44
|
+
"@types/react-dom": "19.3.0",
|
|
45
|
+
"happy-dom": "21.0.3",
|
|
46
|
+
"react": "19.3.1",
|
|
47
|
+
"react-dom": "19.3.1",
|
|
48
|
+
"typescript": "7.0.2",
|
|
49
|
+
"vitest": "5.0.4"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsc -p tsconfig.build.json",
|
|
53
|
+
"lint": "biome check .",
|
|
54
|
+
"check-types": "tsc -p tsconfig.json --noEmit",
|
|
55
|
+
"test": "vitest run"
|
|
56
|
+
}
|
|
6
57
|
}
|