@setsquare/ui 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.
- package/CHANGELOG.md +58 -0
- package/README.md +37 -2
- package/dist/index.d.ts +10 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/english.d.ts +11 -0
- package/dist/lib/english.d.ts.map +1 -0
- package/dist/lib/english.js +65 -0
- package/dist/lib/english.js.map +1 -0
- package/dist/lib/labels.d.ts +38 -8
- package/dist/lib/labels.d.ts.map +1 -1
- package/dist/lib/labels.js +97 -9
- package/dist/lib/labels.js.map +1 -1
- package/dist/lib/locale.d.ts +105 -0
- package/dist/lib/locale.d.ts.map +1 -0
- package/dist/lib/locale.js +42 -0
- package/dist/lib/locale.js.map +1 -0
- package/dist/shell/dashboard-shell.d.ts +4 -1
- package/dist/shell/dashboard-shell.d.ts.map +1 -1
- package/dist/shell/dashboard-shell.js +3 -2
- package/dist/shell/dashboard-shell.js.map +1 -1
- package/dist/shell/landmarks.d.ts +33 -0
- package/dist/shell/landmarks.d.ts.map +1 -0
- package/dist/shell/landmarks.js +20 -0
- package/dist/shell/landmarks.js.map +1 -0
- package/dist/shell/right-panel.d.ts +7 -2
- package/dist/shell/right-panel.d.ts.map +1 -1
- package/dist/shell/right-panel.js +13 -7
- package/dist/shell/right-panel.js.map +1 -1
- package/dist/shell/sidebar.d.ts +10 -2
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +31 -14
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/shell/site-menu.d.ts +11 -3
- package/dist/shell/site-menu.d.ts.map +1 -1
- package/dist/shell/site-menu.js +7 -1
- package/dist/shell/site-menu.js.map +1 -1
- package/dist/shell/site-nav.d.ts +4 -1
- package/dist/shell/site-nav.d.ts.map +1 -1
- package/dist/shell/site-nav.js +3 -3
- package/dist/shell/site-nav.js.map +1 -1
- package/dist/shell/site-shell.d.ts +4 -2
- package/dist/shell/site-shell.d.ts.map +1 -1
- package/dist/shell/site-shell.js +3 -2
- package/dist/shell/site-shell.js.map +1 -1
- package/dist/ui/alert.d.ts +2 -0
- package/dist/ui/alert.d.ts.map +1 -1
- package/dist/ui/alert.js +11 -9
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/breadcrumbs.d.ts +9 -1
- package/dist/ui/breadcrumbs.d.ts.map +1 -1
- package/dist/ui/breadcrumbs.js +5 -2
- package/dist/ui/breadcrumbs.js.map +1 -1
- package/dist/ui/calendar.d.ts +1 -0
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/calendar.js +7 -1
- package/dist/ui/calendar.js.map +1 -1
- package/dist/ui/checkbox.d.ts.map +1 -1
- package/dist/ui/checkbox.js +7 -7
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/code-block-parts.d.ts +30 -0
- package/dist/ui/code-block-parts.d.ts.map +1 -0
- package/dist/ui/code-block-parts.js +27 -0
- package/dist/ui/code-block-parts.js.map +1 -0
- package/dist/ui/code-block.d.ts +4 -10
- package/dist/ui/code-block.d.ts.map +1 -1
- package/dist/ui/code-block.js +4 -9
- package/dist/ui/code-block.js.map +1 -1
- package/dist/ui/combo-box.d.ts +7 -1
- package/dist/ui/combo-box.d.ts.map +1 -1
- package/dist/ui/combo-box.js +9 -2
- package/dist/ui/combo-box.js.map +1 -1
- package/dist/ui/copy-button.d.ts +7 -1
- package/dist/ui/copy-button.d.ts.map +1 -1
- package/dist/ui/copy-button.js +11 -10
- package/dist/ui/copy-button.js.map +1 -1
- package/dist/ui/date-field.d.ts +1 -0
- package/dist/ui/date-field.d.ts.map +1 -1
- package/dist/ui/date-field.js +20 -16
- package/dist/ui/date-field.js.map +1 -1
- package/dist/ui/dialog.d.ts +6 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +11 -8
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/error-state.d.ts +17 -2
- package/dist/ui/error-state.d.ts.map +1 -1
- package/dist/ui/error-state.js +32 -34
- package/dist/ui/error-state.js.map +1 -1
- package/dist/ui/feature-card.d.ts +18 -3
- package/dist/ui/feature-card.d.ts.map +1 -1
- package/dist/ui/feature-card.js +18 -3
- package/dist/ui/feature-card.js.map +1 -1
- package/dist/ui/field.d.ts +28 -9
- package/dist/ui/field.d.ts.map +1 -1
- package/dist/ui/field.js +22 -10
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/file-upload.d.ts +23 -5
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +54 -36
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts +11 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +7 -4
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/number-field.d.ts.map +1 -1
- package/dist/ui/number-field.js +5 -3
- package/dist/ui/number-field.js.map +1 -1
- package/dist/ui/pagination.d.ts +11 -3
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +30 -23
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +4 -4
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/search.d.ts +3 -0
- package/dist/ui/search.d.ts.map +1 -1
- package/dist/ui/search.js +11 -10
- package/dist/ui/search.js.map +1 -1
- package/dist/ui/select.d.ts +7 -1
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +7 -3
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/selection-bar.d.ts +17 -4
- package/dist/ui/selection-bar.d.ts.map +1 -1
- package/dist/ui/selection-bar.js +15 -11
- package/dist/ui/selection-bar.js.map +1 -1
- package/dist/ui/sheet.d.ts +1 -0
- package/dist/ui/sheet.d.ts.map +1 -1
- package/dist/ui/sheet.js +4 -1
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/slider.d.ts +9 -2
- package/dist/ui/slider.d.ts.map +1 -1
- package/dist/ui/slider.js +13 -5
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/tabs.d.ts +1 -0
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +13 -12
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/text-field.d.ts.map +1 -1
- package/dist/ui/text-field.js +7 -3
- package/dist/ui/text-field.js.map +1 -1
- package/dist/ui/theme-switcher.d.ts +1 -0
- package/dist/ui/theme-switcher.d.ts.map +1 -1
- package/dist/ui/theme-switcher.js +7 -7
- package/dist/ui/theme-switcher.js.map +1 -1
- package/dist/ui/toast.d.ts +1 -0
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +4 -1
- package/dist/ui/toast.js.map +1 -1
- package/dist/ui/tree.d.ts.map +1 -1
- package/dist/ui/tree.js +5 -5
- package/dist/ui/tree.js.map +1 -1
- package/package.json +2 -1
package/dist/ui/error-state.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { Component, type ErrorInfo, type ReactNode } from 'react';
|
|
2
2
|
export type ErrorKind = 'load' | 'offline' | 'forbidden' | 'not-found' | 'server';
|
|
3
3
|
/**
|
|
4
|
-
* An error state's words, for the `labels` prop; `{reference}` is the reference. Each kind
|
|
5
|
-
* `title` and `children
|
|
4
|
+
* An error state's words, for the `labels` prop; `{reference}` is the reference. Each kind has a title and a
|
|
5
|
+
* body, which an instance's `title` and `children` replace.
|
|
6
6
|
*/
|
|
7
7
|
export interface ErrorStateLabels {
|
|
8
|
+
loadTitle: string;
|
|
9
|
+
loadBody: string;
|
|
10
|
+
offlineTitle: string;
|
|
11
|
+
offlineBody: string;
|
|
12
|
+
forbiddenTitle: string;
|
|
13
|
+
forbiddenBody: string;
|
|
14
|
+
notFoundTitle: string;
|
|
15
|
+
notFoundBody: string;
|
|
16
|
+
serverTitle: string;
|
|
17
|
+
serverBody: string;
|
|
8
18
|
retry: string;
|
|
9
19
|
/** Before the reference. */
|
|
10
20
|
reference: string;
|
|
@@ -15,6 +25,11 @@ export interface ErrorStateLabels {
|
|
|
15
25
|
/** When the browser refuses to copy. */
|
|
16
26
|
copyFailed: string;
|
|
17
27
|
}
|
|
28
|
+
export declare const errorStateLabels: ErrorStateLabels;
|
|
29
|
+
export declare const kindLabels: Record<ErrorKind, {
|
|
30
|
+
title: keyof ErrorStateLabels;
|
|
31
|
+
body: keyof ErrorStateLabels;
|
|
32
|
+
}>;
|
|
18
33
|
export interface ErrorStateProps {
|
|
19
34
|
kind?: ErrorKind;
|
|
20
35
|
/** Override the default title — name the thing: "Projects didn't load". */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-state.d.ts","sourceRoot":"","sources":["../../src/ui/error-state.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EAKT,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgBf,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"error-state.d.ts","sourceRoot":"","sources":["../../src/ui/error-state.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EAKT,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAgBf,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;AAUlF;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,M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SAAS,GACV,EAAE,eAAe,+BA8FjB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC;IAC1D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACnD;AAED,8GAA8G;AAC9G,qBAAa,aAAc,SAAQ,SAAS,CAAC,kBAAkB,EAAE;IAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;IAC9E,KAAK;QAAK,KAAK,EAAU,KAAK,GAAG,IAAI;MAAG;IACjD,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;MAE3C;IACQ,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,QAEvD;IACD,KAAK,aAAwC;IACpC,MAAM,gUASd;CACF"}
|
package/dist/ui/error-state.js
CHANGED
|
@@ -3,37 +3,27 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { Component, useEffect, useId, useRef, useState, } from 'react';
|
|
4
4
|
import { CircleAlert, Copy, FileQuestionMark, Lock, RefreshCw, ServerCrash, WifiOff, } from 'lucide-react';
|
|
5
5
|
import { cn } from '../lib/cn.js';
|
|
6
|
-
import {
|
|
6
|
+
import { useLabels } from '../lib/locale.js';
|
|
7
7
|
import { Button } from './button.js';
|
|
8
8
|
import { StatusMessage } from './form.js';
|
|
9
|
-
const
|
|
10
|
-
load:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
offline: {
|
|
16
|
-
Icon: WifiOff,
|
|
17
|
-
title: "You're offline",
|
|
18
|
-
body: "This page needs a connection. It will load when you're back online, or you can try again now.",
|
|
19
|
-
},
|
|
20
|
-
forbidden: {
|
|
21
|
-
Icon: Lock,
|
|
22
|
-
title: "You don't have access to this",
|
|
23
|
-
body: 'Ask a workspace owner to give you access, or switch to a workspace you belong to.',
|
|
24
|
-
},
|
|
25
|
-
'not-found': {
|
|
26
|
-
Icon: FileQuestionMark,
|
|
27
|
-
title: 'Page not found',
|
|
28
|
-
body: 'The link may be out of date, or the page was moved or deleted. Check the address, or go back to the overview.',
|
|
29
|
-
},
|
|
30
|
-
server: {
|
|
31
|
-
Icon: ServerCrash,
|
|
32
|
-
title: 'Something went wrong on our side',
|
|
33
|
-
body: "It isn't anything you did. Try again in a minute; if it keeps happening, contact support and quote the reference below.",
|
|
34
|
-
},
|
|
9
|
+
const icons = {
|
|
10
|
+
load: CircleAlert,
|
|
11
|
+
offline: WifiOff,
|
|
12
|
+
forbidden: Lock,
|
|
13
|
+
'not-found': FileQuestionMark,
|
|
14
|
+
server: ServerCrash,
|
|
35
15
|
};
|
|
36
|
-
const errorStateLabels = {
|
|
16
|
+
export const errorStateLabels = {
|
|
17
|
+
loadTitle: "This didn't load",
|
|
18
|
+
loadBody: 'Check your connection and try again. If it keeps happening, contact support and quote the reference below.',
|
|
19
|
+
offlineTitle: "You're offline",
|
|
20
|
+
offlineBody: "This page needs a connection. It will load when you're back online, or you can try again now.",
|
|
21
|
+
forbiddenTitle: "You don't have access to this",
|
|
22
|
+
forbiddenBody: 'Ask a workspace owner to give you access, or switch to a workspace you belong to.',
|
|
23
|
+
notFoundTitle: 'Page not found',
|
|
24
|
+
notFoundBody: 'The link may be out of date, or the page was moved or deleted. Check the address, or go back to the overview.',
|
|
25
|
+
serverTitle: 'Something went wrong on our side',
|
|
26
|
+
serverBody: "It isn't anything you did. Try again in a minute; if it keeps happening, contact support and quote the reference below.",
|
|
37
27
|
retry: 'Try again',
|
|
38
28
|
reference: 'Reference',
|
|
39
29
|
copy: 'Copy',
|
|
@@ -41,13 +31,21 @@ const errorStateLabels = {
|
|
|
41
31
|
copied: 'Reference copied',
|
|
42
32
|
copyFailed: 'Select the reference and copy it',
|
|
43
33
|
};
|
|
34
|
+
export const kindLabels = {
|
|
35
|
+
load: { title: 'loadTitle', body: 'loadBody' },
|
|
36
|
+
offline: { title: 'offlineTitle', body: 'offlineBody' },
|
|
37
|
+
forbidden: { title: 'forbiddenTitle', body: 'forbiddenBody' },
|
|
38
|
+
'not-found': { title: 'notFoundTitle', body: 'notFoundBody' },
|
|
39
|
+
server: { title: 'serverTitle', body: 'serverBody' },
|
|
40
|
+
};
|
|
44
41
|
/**
|
|
45
42
|
* Something failed: says what happened in plain words, that it isn't the person's fault when it isn't,
|
|
46
43
|
* and what to do next. Never a raw error message or stack trace.
|
|
47
44
|
*/
|
|
48
45
|
export function ErrorState({ kind = 'load', title, children, onRetry, reference, actions, headingLevel = 2, autoFocus, size = 'page', labels: given, className, }) {
|
|
49
|
-
const
|
|
50
|
-
const
|
|
46
|
+
const t = useLabels('errorState', errorStateLabels, given);
|
|
47
|
+
const Icon = icons[kind];
|
|
48
|
+
const words = kindLabels[kind];
|
|
51
49
|
const H = `h${headingLevel}`;
|
|
52
50
|
const headingRef = useRef(null);
|
|
53
51
|
const headingId = useId();
|
|
@@ -68,15 +66,15 @@ export function ErrorState({ kind = 'load', title, children, onRetry, reference,
|
|
|
68
66
|
setPending(false);
|
|
69
67
|
}
|
|
70
68
|
};
|
|
71
|
-
return (_jsxs("div", { role: "group", "aria-labelledby": headingId, className: cn('mx-auto flex max-w-(--measure) flex-col items-center px-6 text-center', size === 'page' ? 'py-16' : 'py-10', className), children: [_jsx("span", { "aria-hidden": "true", className: cn('mb-4 grid place-items-center rounded-full bg-destructive-subtle text-destructive', size === 'page' ? 'size-14' : 'size-11'), children: _jsx(
|
|
69
|
+
return (_jsxs("div", { role: "group", "aria-labelledby": headingId, className: cn('mx-auto flex max-w-(--measure) flex-col items-center px-6 text-center', size === 'page' ? 'py-16' : 'py-10', className), children: [_jsx("span", { "aria-hidden": "true", className: cn('mb-4 grid place-items-center rounded-full bg-destructive-subtle text-destructive', size === 'page' ? 'size-14' : 'size-11'), children: _jsx(Icon, { className: size === 'page' ? 'size-7' : 'size-5' }) }), _jsx(H, { ref: headingRef, id: headingId, tabIndex: -1, className: cn('outline-none focus-visible:focus-ring rounded-sm', size === 'page' ? 'text-heading' : 'text-subheading'), children: title ?? t(words.title) }), _jsx("div", { className: "mt-2 text-[15px] leading-6 text-muted-foreground", children: children ?? t(words.body) }), (onRetry || actions) && (_jsxs("div", { className: "mt-6 flex flex-wrap items-center justify-center gap-(--control-gap)", children: [onRetry && (_jsxs(Button, { variant: "primary", isPending: pending, onPress: retry, children: [_jsx(RefreshCw, { "aria-hidden": "true" }), t('retry')] })), actions] })), reference && (_jsxs("div", { className: "mt-6 flex flex-col items-center gap-1", children: [_jsxs("p", { className: "flex flex-wrap items-center justify-center gap-2 text-[13px] text-muted-foreground", children: [t('reference'), ' ', _jsx("code", { className: "rounded-sm bg-muted px-1.5 py-0.5 font-mono text-foreground", children: reference }), _jsxs(Button, { variant: "ghost", visualSize: "sm", "aria-label": t('copyReference', { reference }), onPress: async () => {
|
|
72
70
|
try {
|
|
73
71
|
await navigator.clipboard.writeText(reference);
|
|
74
|
-
setCopied(
|
|
72
|
+
setCopied(t('copied'));
|
|
75
73
|
}
|
|
76
74
|
catch {
|
|
77
|
-
setCopied(
|
|
75
|
+
setCopied(t('copyFailed'));
|
|
78
76
|
}
|
|
79
|
-
}, children: [_jsx(Copy, { "aria-hidden": "true" }),
|
|
77
|
+
}, children: [_jsx(Copy, { "aria-hidden": "true" }), t('copy')] })] }), _jsx(StatusMessage, { tone: "neutral", children: copied })] }))] }));
|
|
80
78
|
}
|
|
81
79
|
/** Contains a failing widget so the rest of the page keeps working. (Route segments use Next's error.tsx.) */
|
|
82
80
|
export class ErrorBoundary extends Component {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-state.js","sourceRoot":"","sources":["../../src/ui/error-state.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAA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AAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IACQ,iBAAiB,CAAC,KAAY,EAAE,IAAe;QACtD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM;QACb,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7B,IAAI,KAAK;YACP,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CACvC,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IAAC,IAAI,EAAC,SAAS,EAAC,OAAO,EAAE,IAAI,CAAC,KAAK,GAAI,CACnD,CAAC;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -2,6 +2,20 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { type DisclosureProps as RACDisclosureProps } from 'react-aria-components';
|
|
3
3
|
import { type IconProp } from './icon.js';
|
|
4
4
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5;
|
|
5
|
+
/**
|
|
6
|
+
* A feature card's words, for the `labels` prop. `{label}` is what the panel holds: `label`, or the `label` word
|
|
7
|
+
* here. The toggle shows `show` or `hide` and is named by `showName` or `hideName`, which should contain the word
|
|
8
|
+
* it shows, so a voice command for what's on screen reaches it.
|
|
9
|
+
*/
|
|
10
|
+
export interface FeatureCardLabels {
|
|
11
|
+
/** What the panel holds, when there is no `label` prop. */
|
|
12
|
+
label: string;
|
|
13
|
+
show: string;
|
|
14
|
+
hide: string;
|
|
15
|
+
showName: string;
|
|
16
|
+
hideName: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const featureCardLabels: FeatureCardLabels;
|
|
5
19
|
export interface FeatureCardProps extends Omit<RACDisclosureProps, 'children' | 'className'> {
|
|
6
20
|
/** The heading: a greeting ("Good morning, Ana") or what the card holds ("What's new"). */
|
|
7
21
|
title: ReactNode;
|
|
@@ -10,8 +24,8 @@ export interface FeatureCardProps extends Omit<RACDisclosureProps, 'children' |
|
|
|
10
24
|
/** In a tile before the title: a `TimeOfDayIcon` beside a greeting, or any icon. Decorative. */
|
|
11
25
|
icon?: IconProp;
|
|
12
26
|
/**
|
|
13
|
-
* What the panel holds, default "What's new". It
|
|
14
|
-
* shown while the card is closed, and is the panel's heading, which only a screen reader shows.
|
|
27
|
+
* What the panel holds, default "What's new" (`labels.label`). It fills the toggle's name ("Show What's new"),
|
|
28
|
+
* leads the line shown while the card is closed, and is the panel's heading, which only a screen reader shows.
|
|
15
29
|
*/
|
|
16
30
|
label?: string;
|
|
17
31
|
/** Under the title while the card is open: "Here's what's new since you were last here on 28 September." */
|
|
@@ -29,6 +43,7 @@ export interface FeatureCardProps extends Omit<RACDisclosureProps, 'children' |
|
|
|
29
43
|
featured?: ReactNode;
|
|
30
44
|
/** The other updates: `FeatureCardItem`s, beside the featured one on a wide card and under it on a narrow one. */
|
|
31
45
|
children?: ReactNode;
|
|
46
|
+
labels?: Partial<FeatureCardLabels>;
|
|
32
47
|
className?: string;
|
|
33
48
|
}
|
|
34
49
|
/**
|
|
@@ -46,7 +61,7 @@ export interface FeatureCardProps extends Omit<RACDisclosureProps, 'children' |
|
|
|
46
61
|
* first frame. At AAA nothing moves (the icon only fades in) and the card has no dots or ripple; under reduced
|
|
47
62
|
* motion nothing animates.
|
|
48
63
|
*/
|
|
49
|
-
export declare function FeatureCard({ title, headingLevel, icon, label, description, count, summary, action, featured, children, defaultExpanded, className, ...props }: FeatureCardProps): import("react").JSX.Element;
|
|
64
|
+
export declare function FeatureCard({ title, headingLevel, icon, label: givenLabel, description, count, summary, action, featured, children, defaultExpanded, labels, className, ...props }: FeatureCardProps): import("react").JSX.Element;
|
|
50
65
|
interface FeatureCardItemBase {
|
|
51
66
|
/** The update's name: "Visual comparisons for every run". */
|
|
52
67
|
title: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-card.d.ts","sourceRoot":"","sources":["../../src/ui/feature-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,
|
|
1
|
+
{"version":3,"file":"feature-card.d.ts","sourceRoot":"","sources":["../../src/ui/feature-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAKL,KAAK,eAAe,IAAI,kBAAkB,EAC3C,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGtD,KAAK,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAQtC;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAM/B,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,WAAW,CAAC;IAC1F,2FAA2F;IAC3F,KAAK,EAAE,SAAS,CAAC;IACjB,kHAAkH;IAClH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,gGAAgG;IAChG,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4GAA4G;IAC5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AAC;CACrB,CACJ,CAAC;AAEJ;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,GAAG,EACH,IAAI,EACJ,WAAW,EACX,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,SAAS,GACV,EAAE,oBAAoB,+BA0FtB"}
|
package/dist/ui/feature-card.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Children, createContext, useContext, useId, } from 'react';
|
|
4
4
|
import { ArrowRight, ChevronDown } from 'lucide-react';
|
|
5
|
-
import { Disclosure as RACDisclosure, DisclosurePanel, Link as RACLink, } from 'react-aria-components';
|
|
5
|
+
import { Disclosure as RACDisclosure, DisclosurePanel, DisclosureStateContext, Link as RACLink, } from 'react-aria-components';
|
|
6
6
|
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { useLabels } from '../lib/locale.js';
|
|
7
8
|
import { Button } from './button.js';
|
|
8
9
|
import { renderIcon } from './icon.js';
|
|
9
10
|
import { Tag } from './tag.js';
|
|
@@ -12,6 +13,13 @@ const ItemContext = createContext({
|
|
|
12
13
|
headingLevel: 3,
|
|
13
14
|
featured: false,
|
|
14
15
|
});
|
|
16
|
+
export const featureCardLabels = {
|
|
17
|
+
label: "What's new",
|
|
18
|
+
show: 'Show',
|
|
19
|
+
hide: 'Hide',
|
|
20
|
+
showName: 'Show {label}',
|
|
21
|
+
hideName: 'Hide {label}',
|
|
22
|
+
};
|
|
15
23
|
/**
|
|
16
24
|
* The card at the top of an overview: a title (a greeting, often) with an icon, and a panel of what's new that
|
|
17
25
|
* the person can show and hide. React Aria's Disclosure: the Show/Hide button is the trigger, with
|
|
@@ -27,19 +35,26 @@ const ItemContext = createContext({
|
|
|
27
35
|
* first frame. At AAA nothing moves (the icon only fades in) and the card has no dots or ripple; under reduced
|
|
28
36
|
* motion nothing animates.
|
|
29
37
|
*/
|
|
30
|
-
export function FeatureCard({ title, headingLevel = 2, icon, label
|
|
38
|
+
export function FeatureCard({ title, headingLevel = 2, icon, label: givenLabel, description, count, summary, action, featured, children, defaultExpanded = true, labels, className, ...props }) {
|
|
39
|
+
const t = useLabels('featureCard', featureCardLabels, labels);
|
|
40
|
+
const label = givenLabel ?? t('label');
|
|
31
41
|
const Heading = `h${headingLevel}`;
|
|
32
42
|
const PanelHeading = `h${headingLevel + 1}`;
|
|
33
43
|
const itemLevel = (headingLevel + 2);
|
|
34
44
|
const itemCount = Children.toArray(children).length;
|
|
35
45
|
return (_jsxs(RACDisclosure, { ...props, defaultExpanded: defaultExpanded, className: cn('group/feature-card @container/feature-card arrive-rise relative overflow-clip rounded-lg border border-border bg-card text-card-foreground shadow-(--shadow-sm)', className), children: [_jsx("div", { "aria-hidden": "true", className: "feature-dots" }), _jsx("div", { "aria-hidden": "true", className: "feature-ripple [--feature-ripple-origin:40px_40px] @min-[35rem]/feature-card:[--feature-ripple-origin:48px_44px]" }), _jsxs("div", { className: cn('relative grid items-center gap-x-4 gap-y-3 p-4 @min-[35rem]/feature-card:px-6 @min-[35rem]/feature-card:py-5', icon
|
|
36
46
|
? "grid-cols-[auto_minmax(0,1fr)] [grid-template-areas:'icon_toggle'_'text_text'] @min-[35rem]/feature-card:grid-cols-[auto_minmax(0,1fr)_auto] @min-[35rem]/feature-card:[grid-template-areas:'icon_text_toggle']"
|
|
37
|
-
: "grid-cols-[minmax(0,1fr)_auto] [grid-template-areas:'text_toggle']"), children: [icon && (_jsx("span", { "aria-hidden": "true", className: "arrive-pop grid size-12 place-items-center rounded-xl border border-border bg-background text-foreground [grid-area:icon]", style: { animationDelay: '60ms' }, children: renderIcon(icon, 'size-8') })), _jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-3.5 gap-y-1 [grid-area:text]", children: [_jsx(Heading, { className: "text-title text-foreground", children: title }), description && (_jsx("p", { className: "hidden basis-full text-body text-muted-foreground group-data-expanded/feature-card:block", children: description })), _jsxs("p", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1 text-ui text-muted-foreground group-data-expanded/feature-card:hidden", children: [_jsx("span", { "aria-hidden": "true", className: "hidden h-5 w-px bg-border @min-[35rem]/feature-card:block" }), _jsx("strong", { className: "text-ui-strong text-foreground", children: label }), count && (_jsx("span", { className: "inline-flex h-[22px] items-center rounded-full bg-foreground px-2 text-caption-strong text-background", children: count })), summary && _jsx("span", { children: summary })] })] }), _jsxs("div", { className: "flex items-center gap-(--control-gap) justify-self-end [grid-area:toggle]", children: [action && (_jsx("div", { className: "hidden items-center gap-(--control-gap) group-data-expanded/feature-card:flex", children: action })),
|
|
47
|
+
: "grid-cols-[minmax(0,1fr)_auto] [grid-template-areas:'text_toggle']"), children: [icon && (_jsx("span", { "aria-hidden": "true", className: "arrive-pop grid size-12 place-items-center rounded-xl border border-border bg-background text-foreground [grid-area:icon]", style: { animationDelay: '60ms' }, children: renderIcon(icon, 'size-8') })), _jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-x-3.5 gap-y-1 [grid-area:text]", children: [_jsx(Heading, { className: "text-title text-foreground", children: title }), description && (_jsx("p", { className: "hidden basis-full text-body text-muted-foreground group-data-expanded/feature-card:block", children: description })), _jsxs("p", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1 text-ui text-muted-foreground group-data-expanded/feature-card:hidden", children: [_jsx("span", { "aria-hidden": "true", className: "hidden h-5 w-px bg-border @min-[35rem]/feature-card:block" }), _jsx("strong", { className: "text-ui-strong text-foreground", children: label }), count && (_jsx("span", { className: "inline-flex h-[22px] items-center rounded-full bg-foreground px-2 text-caption-strong text-background", children: count })), summary && _jsx("span", { children: summary })] })] }), _jsxs("div", { className: "flex items-center gap-(--control-gap) justify-self-end [grid-area:toggle]", children: [action && (_jsx("div", { className: "hidden items-center gap-(--control-gap) group-data-expanded/feature-card:flex", children: action })), _jsx(FeatureCardToggle, { label: label, t: t })] })] }), _jsx(DisclosurePanel, { className: "relative", children: _jsxs("div", { className: "flex flex-col px-4 pb-4 @min-[35rem]/feature-card:px-6 @min-[35rem]/feature-card:pb-6", children: [_jsx(PanelHeading, { className: "sr-only", children: label }), _jsxs("ul", {
|
|
38
48
|
// oxlint-disable-next-line jsx-a11y/no-redundant-roles -- VoiceOver in Safari drops a list with no markers.
|
|
39
49
|
role: "list", style: { '--feature-card-rows': Math.max(1, itemCount) }, className: cn('grid gap-4', featured
|
|
40
50
|
? '@min-[56rem]/feature-card:grid-cols-[minmax(0,1.7fr)_minmax(0,1fr)]'
|
|
41
51
|
: 'grid-cols-[repeat(auto-fit,minmax(min(18rem,100%),1fr))]'), children: [featured && (_jsx("li", { className: "arrive-rise grid @min-[56rem]/feature-card:row-span-(--feature-card-rows)", style: { animationDelay: '200ms' }, children: _jsx(ItemContext.Provider, { value: { headingLevel: itemLevel, featured: true }, children: featured }) })), _jsx(ItemContext.Provider, { value: { headingLevel: itemLevel, featured: false }, children: Children.map(children, (child, i) => child == null || typeof child === 'boolean' ? null : (_jsx("li", { className: "arrive-rise grid", style: { animationDelay: `${(featured ? 280 : 200) + i * 80}ms` }, children: child }))) })] })] }) })] }));
|
|
42
52
|
}
|
|
53
|
+
/** Show or Hide, named with what the panel holds. Reads the open state from the Disclosure around it. */
|
|
54
|
+
function FeatureCardToggle({ label, t }) {
|
|
55
|
+
const expanded = useContext(DisclosureStateContext)?.isExpanded ?? false;
|
|
56
|
+
return (_jsxs(Button, { slot: "trigger", variant: "ghost", "aria-label": expanded ? t('hideName', { label }) : t('showName', { label }), children: [_jsx(ChevronDown, { "aria-hidden": "true", className: "group-data-expanded/feature-card:rotate-180" }), expanded ? t('hide') : t('show')] }));
|
|
57
|
+
}
|
|
43
58
|
/**
|
|
44
59
|
* One update in a FeatureCard: a picture, a tag and a date, a title and a description. In the card's `featured`
|
|
45
60
|
* slot it is larger. With `href` the whole item is a link named by everything it shows, as LinkCard is, with
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-card.js","sourceRoot":"","sources":["../../src/ui/feature-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,KAAK,GAGN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,UAAU,IAAI,aAAa,EAC3B,eAAe,EACf,IAAI,IAAI,OAAO,GAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,+FAA+F;AAC/F,MAAM,WAAW,GAAG,aAAa,CAAoD;IACnF,YAAY,EAAE,CAAC;IACf,QAAQ,EAAE,KAAK;CAChB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"feature-card.js","sourceRoot":"","sources":["../../src/ui/feature-card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,KAAK,GAGN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,UAAU,IAAI,aAAa,EAC3B,eAAe,EACf,sBAAsB,EACtB,IAAI,IAAI,OAAO,GAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAkB,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAiB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,+FAA+F;AAC/F,MAAM,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EAAE,CAAC;QACT,OAAO,CACL,KAAC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CACX,qHAAqH,EACrH,SAAS,CACV,YAED,eACE,SAAS,EAAE,EAAE,CACX,OAAO,EACP,6MAA6M,CAC9M,aAEA,OAAO,EACR,eAAK,SAAS,EAAE,KAAK,aAClB,IAAI,EACL,MAAC,OAAO,IACN,SAAS,EAAE,EAAE,CACX,oFAAoF,EACpF,SAAS,CACV,aAED,eAAM,SAAS,EAAC,SAAS,YAAE,KAAK,GAAQ,EACxC,KAAC,UAAU,mBAAa,MAAM,EAAC,SAAS,EAAC,sBAAsB,GAAG,IAC1D,EACT,WAAW,IAAI,CACd,YAAG,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,eAAe,CAAC,YACpE,WAAW,GACV,CACL,IACG,IACF,GACE,CACX,CAAC;IACJ,CAAC;IAED,OAAO,CACL,sCAA0B,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,aACjE,OAAO,EACR,eAAK,SAAS,EAAE,KAAK,aAClB,IAAI,EACL,KAAC,OAAO,IAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC,YAC9D,KAAK,GACE,EACT,WAAW,IAAI,CACd,YAAG,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,eAAe,CAAC,YAAG,WAAW,GAAK,CAC3F,EACA,OAAO,IAAI,CACV,cAAK,SAAS,EAAC,8DAA8D,YAC1E,OAAO,GACJ,CACP,IACG,IACE,CACX,CAAC;AACJ,CAAC"}
|
package/dist/ui/field.d.ts
CHANGED
|
@@ -11,25 +11,46 @@ export declare const fieldBox: string;
|
|
|
11
11
|
export declare const fieldInput = "field-input flex-1 cursor-text px-(--control-pad-x) text-sm text-foreground placeholder:text-muted-foreground data-disabled:cursor-not-allowed";
|
|
12
12
|
/** A multi-line input is taller than any target, so it is one layer: the textarea paints its own box. */
|
|
13
13
|
export declare const textAreaStyles: string;
|
|
14
|
+
/**
|
|
15
|
+
* A field's words, for the `labels` prop on every field. `{label}` is the field's label as written: the default
|
|
16
|
+
* required messages say "Enter Email address", so give a field `requiredMessage` where a sentence of its own
|
|
17
|
+
* reads better ("Enter your email address").
|
|
18
|
+
*/
|
|
19
|
+
export interface FieldLabels {
|
|
20
|
+
/** Said before the error, to a screen reader. */
|
|
21
|
+
errorPrefix: string;
|
|
22
|
+
/** After the label of a required field, when the form marks required fields. */
|
|
23
|
+
requiredMarker: string;
|
|
24
|
+
/** After the label of an optional field, when the form marks optional ones. */
|
|
25
|
+
optionalMarker: string;
|
|
26
|
+
/** A required text, number or date field left empty. */
|
|
27
|
+
enterValue: string;
|
|
28
|
+
/** A required select, combo box or radio group left empty. */
|
|
29
|
+
chooseValue: string;
|
|
30
|
+
/** A required checkbox left unticked. */
|
|
31
|
+
checkRequired: string;
|
|
32
|
+
/** A required checkbox group with nothing ticked. */
|
|
33
|
+
checkGroupRequired: string;
|
|
34
|
+
}
|
|
35
|
+
export declare const fieldLabels: FieldLabels;
|
|
36
|
+
/** A field's words: the English defaults, the app's from `SetsquareLocale`, then the field's own `labels`. */
|
|
37
|
+
export declare function useFieldLabels(given: Partial<FieldLabels> | undefined): import("../lib/locale.js").Translate<FieldLabels>;
|
|
14
38
|
export interface FieldLabelProps {
|
|
15
39
|
children: ReactNode;
|
|
16
40
|
isRequired?: boolean;
|
|
17
41
|
/** Render as a plain span (group labels that are not <label>). */
|
|
18
42
|
elementType?: 'label' | 'span';
|
|
43
|
+
/** The field's `labels`, for its marker. */
|
|
44
|
+
labels?: Partial<FieldLabels>;
|
|
19
45
|
className?: string;
|
|
20
46
|
}
|
|
21
47
|
/** The visible label. Adds "(required)" or "(optional)" per the form's NecessityIndicator — hidden from AT, which gets aria-required instead. */
|
|
22
|
-
export declare function FieldLabel({ children, isRequired, elementType, className, }: FieldLabelProps): import("react").JSX.Element;
|
|
48
|
+
export declare function FieldLabel({ children, isRequired, elementType, labels, className, }: FieldLabelProps): import("react").JSX.Element;
|
|
23
49
|
/** Hint text under the label: what to enter, in what format. Linked to the input by aria-describedby. */
|
|
24
50
|
export declare function FieldDescription({ children, className, }: {
|
|
25
51
|
children: ReactNode;
|
|
26
52
|
className?: string;
|
|
27
53
|
}): import("react").JSX.Element;
|
|
28
|
-
/** A field's words, for the `labels` prop on every field. Its required message is `requiredMessage`. */
|
|
29
|
-
export interface FieldLabels {
|
|
30
|
-
/** Said before the error, to a screen reader. */
|
|
31
|
-
errorPrefix: string;
|
|
32
|
-
}
|
|
33
54
|
/**
|
|
34
55
|
* The error, shown only when the field is invalid. Sits between the hint and the input so it is next to the
|
|
35
56
|
* label at high zoom, starts with an icon and a hidden "Error:", and is linked by aria-describedby.
|
|
@@ -37,12 +58,10 @@ export interface FieldLabels {
|
|
|
37
58
|
export declare function FieldError({ children, requiredMessage, errorPrefix, className, }: {
|
|
38
59
|
children?: ReactNode;
|
|
39
60
|
requiredMessage?: string;
|
|
40
|
-
/** `labels.errorPrefix` from the field. */
|
|
61
|
+
/** `labels.errorPrefix` from the field. Default: the app's, from `SetsquareLocale`, or "Error: ". */
|
|
41
62
|
errorPrefix?: string;
|
|
42
63
|
className?: string;
|
|
43
64
|
}): import("react").JSX.Element;
|
|
44
|
-
/** Lower-case the first letter unless the label starts with an acronym ("VAT number"). */
|
|
45
|
-
export declare function lcFirst(label: string): string;
|
|
46
65
|
/**
|
|
47
66
|
* Wrap a field's validate function so an empty required field gets a message that says what to do,
|
|
48
67
|
* instead of the browser's "Please fill out this field".
|
package/dist/ui/field.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/ui/field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/ui/field.tsx"],"names":[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AAO,CAAC,WAAW,CAAC,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iJAAiJ;AACjJ,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,WAAqB,EACrB,MAAM,EACN,SAAS,GACV,EAAE,eAAe,+BAyBjB;AAED,yGAAyG;AACzG,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BAYA;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,eAAe,EACf,WAAW,EACX,SAAS,GACV,EAAE;IACD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA0BA;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,UAAU,EAAE,OAAO,GAAG,SAAS,EAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,EAC9B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,YAGrD,CAAC,8DAIjB;AAED,oEAAoE;AACpE,eAAO,MAAM,UAAU,sDAAsD,CAAC"}
|
package/dist/ui/field.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createContext, useContext } from 'react';
|
|
|
4
4
|
import { FieldError as RACFieldError, Label as RACLabel, Text } from 'react-aria-components';
|
|
5
5
|
import { CircleAlert } from 'lucide-react';
|
|
6
6
|
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { useLabels } from '../lib/locale.js';
|
|
7
8
|
export const NecessityContext = createContext('required');
|
|
8
9
|
/** Size a field to the answer it expects: a postcode is not as wide as an address. */
|
|
9
10
|
export const fieldWidths = {
|
|
@@ -33,15 +34,29 @@ export const fieldInput = 'field-input flex-1 cursor-text px-(--control-pad-x) t
|
|
|
33
34
|
export const textAreaStyles = 'w-full min-w-0 min-h-[calc(var(--control-height)*2)] cursor-text resize-y rounded-md border border-input bg-background px-(--control-pad-x) py-2 text-sm leading-6 text-foreground outline-none ' +
|
|
34
35
|
'placeholder:text-muted-foreground data-focused:focus-ring data-invalid:border-destructive data-invalid:shadow-[inset_0_0_0_1px_var(--destructive)] ' +
|
|
35
36
|
'data-disabled:cursor-not-allowed data-disabled:bg-muted data-disabled:opacity-60 read-only:bg-muted';
|
|
37
|
+
export const fieldLabels = {
|
|
38
|
+
errorPrefix: 'Error: ',
|
|
39
|
+
requiredMarker: '(required)',
|
|
40
|
+
optionalMarker: '(optional)',
|
|
41
|
+
enterValue: 'Enter {label}',
|
|
42
|
+
chooseValue: 'Choose {label}',
|
|
43
|
+
checkRequired: 'Select this to continue',
|
|
44
|
+
checkGroupRequired: 'Select at least one option',
|
|
45
|
+
};
|
|
46
|
+
/** A field's words: the English defaults, the app's from `SetsquareLocale`, then the field's own `labels`. */
|
|
47
|
+
export function useFieldLabels(given) {
|
|
48
|
+
return useLabels('field', fieldLabels, given);
|
|
49
|
+
}
|
|
36
50
|
/** The visible label. Adds "(required)" or "(optional)" per the form's NecessityIndicator — hidden from AT, which gets aria-required instead. */
|
|
37
|
-
export function FieldLabel({ children, isRequired, elementType = 'label', className, }) {
|
|
51
|
+
export function FieldLabel({ children, isRequired, elementType = 'label', labels, className, }) {
|
|
38
52
|
const necessity = useContext(NecessityContext);
|
|
53
|
+
const t = useFieldLabels(labels);
|
|
39
54
|
const marker = necessity === 'required' && isRequired
|
|
40
|
-
? '
|
|
55
|
+
? t('requiredMarker')
|
|
41
56
|
: necessity === 'optional' && !isRequired
|
|
42
|
-
? '
|
|
57
|
+
? t('optionalMarker')
|
|
43
58
|
: '';
|
|
44
|
-
return (_jsxs(RACLabel, { elementType: elementType, className: cn('block text-sm leading-5 font-semibold text-foreground', className), children: [children, marker && (_jsx("span", { "aria-hidden": "true", className: "font-normal text-muted-foreground", children: marker }))] }));
|
|
59
|
+
return (_jsxs(RACLabel, { elementType: elementType, className: cn('block text-sm leading-5 font-semibold text-foreground', className), children: [children, marker && (_jsxs(_Fragment, { children: [' ', _jsx("span", { "aria-hidden": "true", className: "font-normal text-muted-foreground", children: marker })] }))] }));
|
|
45
60
|
}
|
|
46
61
|
/** Hint text under the label: what to enter, in what format. Linked to the input by aria-describedby. */
|
|
47
62
|
export function FieldDescription({ children, className, }) {
|
|
@@ -51,16 +66,13 @@ export function FieldDescription({ children, className, }) {
|
|
|
51
66
|
* The error, shown only when the field is invalid. Sits between the hint and the input so it is next to the
|
|
52
67
|
* label at high zoom, starts with an icon and a hidden "Error:", and is linked by aria-describedby.
|
|
53
68
|
*/
|
|
54
|
-
export function FieldError({ children, requiredMessage, errorPrefix
|
|
55
|
-
|
|
69
|
+
export function FieldError({ children, requiredMessage, errorPrefix, className, }) {
|
|
70
|
+
const t = useFieldLabels(undefined);
|
|
71
|
+
return (_jsx(RACFieldError, { "data-field-error": true, className: cn('flex items-start gap-1.5 text-[13px] leading-5 font-semibold text-destructive', className), children: ({ validationErrors, validationDetails }) => (_jsxs(_Fragment, { children: [_jsx(CircleAlert, { "aria-hidden": "true", className: "mt-0.5 size-4 shrink-0" }), _jsxs("span", { "data-field-error-text": true, children: [_jsx("span", { className: "sr-only", "data-field-error-prefix": true, children: errorPrefix ?? t('errorPrefix') }), children ??
|
|
56
72
|
(requiredMessage && validationDetails?.valueMissing && !validationDetails.customError
|
|
57
73
|
? requiredMessage
|
|
58
74
|
: validationErrors.join(' '))] })] })) }));
|
|
59
75
|
}
|
|
60
|
-
/** Lower-case the first letter unless the label starts with an acronym ("VAT number"). */
|
|
61
|
-
export function lcFirst(label) {
|
|
62
|
-
return /^[A-Z][a-z]/.test(label) ? label[0].toLowerCase() + label.slice(1) : label;
|
|
63
|
-
}
|
|
64
76
|
/**
|
|
65
77
|
* Wrap a field's validate function so an empty required field gets a message that says what to do,
|
|
66
78
|
* instead of the browser's "Please fill out this field".
|
package/dist/ui/field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/ui/field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,KAAK,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/ui/field.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAClE,OAAO,EAAE,UAAU,IAAI,aAAa,EAAE,KAAK,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAqB,UAAU,CAAC,CAAC;AAG9E,sFAAsF;AACtF,MAAM,CAAC,MAAM,WAAW,GAA+B;IACrD,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,EAAE;CACT,CAAC;AAEF;;;;;;;;GAQG;AAEH,8GA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AI,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,OAAO,CAAC;QACjD,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3C,CAAC,CAAC;AACJ,CAAC;AAED,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG,mDAAmD,CAAC"}
|
package/dist/ui/file-upload.d.ts
CHANGED
|
@@ -17,20 +17,31 @@ export interface FileRejection {
|
|
|
17
17
|
reason: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* A file upload's words, for the `labels` prop. `{name}` is a file's name; `{types}` is `acceptedTypesLabel
|
|
21
|
-
*
|
|
20
|
+
* A file upload's words, for the `labels` prop. `{name}` is a file's name; `{types}` is `acceptedTypesLabel`, or
|
|
21
|
+
* `typesList` with the extensions; `{size}` and `{max}` are sizes in the page's locale, or a count; `{count}` is a
|
|
22
|
+
* number, for an ICU `plural`.
|
|
22
23
|
*/
|
|
23
24
|
export interface FileUploadLabels {
|
|
24
25
|
/** On the drop area while something is dragged over it. */
|
|
25
26
|
dropToAdd: string;
|
|
26
27
|
dropFiles: string;
|
|
27
28
|
dropFile: string;
|
|
29
|
+
/** Between the drop area's words and the button, shown only. */
|
|
30
|
+
or: string;
|
|
28
31
|
chooseFiles: string;
|
|
29
32
|
chooseFile: string;
|
|
33
|
+
/** Names the list of files; `{label}` is the upload's label. */
|
|
34
|
+
fileList: string;
|
|
35
|
+
/** Under a file's name; `{size}` is its size and `{status}` one of the four words that follow. */
|
|
36
|
+
sizeAndStatus: string;
|
|
30
37
|
/** A file's progress bar. */
|
|
31
38
|
uploadingFile: string;
|
|
32
39
|
uploading: string;
|
|
33
40
|
uploaded: string;
|
|
41
|
+
/** A file turned away before it uploaded. */
|
|
42
|
+
notAdded: string;
|
|
43
|
+
/** A file whose upload failed. */
|
|
44
|
+
notUploaded: string;
|
|
34
45
|
/** Said before an error, to a screen reader. */
|
|
35
46
|
errorPrefix: string;
|
|
36
47
|
/** A failed upload with no `error` of its own. */
|
|
@@ -39,21 +50,28 @@ export interface FileUploadLabels {
|
|
|
39
50
|
dismiss: string;
|
|
40
51
|
cancel: string;
|
|
41
52
|
remove: string;
|
|
53
|
+
/** Announced when files are chosen or dropped and pass the checks; `{name}` is the first one's name. */
|
|
54
|
+
announceAdded: string;
|
|
55
|
+
/** Announced when more than one file is turned away at once (one is announced with its reason). */
|
|
56
|
+
announceRejected: string;
|
|
42
57
|
/** Announced when a file finishes. */
|
|
43
58
|
announceUploaded: string;
|
|
44
59
|
/** Announced when one fails; `{error}` is its `error`, or nothing. */
|
|
45
60
|
announceFailed: string;
|
|
46
61
|
wrongType: string;
|
|
62
|
+
/** `{types}` without `acceptedTypesLabel`; `{list}` is the extensions, as "PDF, PNG or JPEG" in the locale. */
|
|
63
|
+
typesList: string;
|
|
47
64
|
tooBig: string;
|
|
48
65
|
tooMany: string;
|
|
49
66
|
}
|
|
67
|
+
export declare const fileUploadLabels: FileUploadLabels;
|
|
50
68
|
export interface FileUploadProps {
|
|
51
69
|
label: string;
|
|
52
70
|
/** What to upload, and the limits in words: "PDF or PNG, up to 10 MB each". */
|
|
53
71
|
description?: ReactNode;
|
|
54
72
|
/** MIME types ("application/pdf", "image/*") and/or extensions (".csv"). */
|
|
55
73
|
acceptedFileTypes?: string[];
|
|
56
|
-
/** How to name the accepted types in messages: "a PDF or PNG". Default
|
|
74
|
+
/** How to name the accepted types in messages: "a PDF or PNG". Default: `labels.typesList` with the extensions. */
|
|
57
75
|
acceptedTypesLabel?: string;
|
|
58
76
|
/** Bytes. */
|
|
59
77
|
maxFileSize?: number;
|
|
@@ -72,8 +90,8 @@ export interface FileUploadProps {
|
|
|
72
90
|
labels?: Partial<FileUploadLabels>;
|
|
73
91
|
className?: string;
|
|
74
92
|
}
|
|
75
|
-
/** "2.4 MB"
|
|
76
|
-
export declare function formatBytes(bytes: number): string;
|
|
93
|
+
/** "2.4 MB" in `locale` (FileUpload passes the one from `SetsquareLocale`). Without one, the runtime's default. */
|
|
94
|
+
export declare function formatBytes(bytes: number, locale?: string): string;
|
|
77
95
|
/**
|
|
78
96
|
* Upload files by choosing them or dropping them. "Choose files" is always there, so dragging is never the
|
|
79
97
|
* only way (a keyboard or switch user never has to drag). Pasting a file onto the drop area also works.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/ui/file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"file-upload.d.ts","sourceRoot":"","sources":["../../src/ui/file-upload.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkBhE,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9D,0GAA0G;AAC1G,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,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