@nanisoft/prism-ui 0.6.0 → 0.8.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/dist/.tsbuildinfo +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +40 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -0
- package/dist/components/ui/breadcrumb.d.ts +6 -2
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.js +5 -3
- package/dist/components/ui/dialog.d.ts +12 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +2 -2
- package/dist/components/ui/live-region.d.ts +78 -0
- package/dist/components/ui/live-region.d.ts.map +1 -0
- package/dist/components/ui/live-region.js +48 -0
- package/dist/components/ui/mark.d.ts +44 -0
- package/dist/components/ui/mark.d.ts.map +1 -0
- package/dist/components/ui/mark.js +79 -0
- package/dist/components/ui/pagination.d.ts +24 -6
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js +23 -9
- package/dist/components/ui/product-switcher.d.ts +7 -0
- package/dist/components/ui/product-switcher.d.ts.map +1 -1
- package/dist/components/ui/product-switcher.js +2 -2
- package/dist/components/ui/slider.d.ts +1 -1
- package/dist/components/ui/slider.d.ts.map +1 -1
- package/dist/components/ui/tree.d.ts +115 -0
- package/dist/components/ui/tree.d.ts.map +1 -0
- package/dist/components/ui/tree.js +137 -0
- package/dist/pages/docs-shell/docs-shell.d.ts +250 -0
- package/dist/pages/docs-shell/docs-shell.d.ts.map +1 -0
- package/dist/pages/docs-shell/docs-shell.js +197 -0
- package/dist/pages/docs-shell/index.d.ts +3 -0
- package/dist/pages/docs-shell/index.d.ts.map +1 -0
- package/dist/pages/docs-shell/index.js +1 -0
- package/dist/pages/index.d.ts +9 -2
- package/dist/pages/index.d.ts.map +1 -1
- package/dist/pages/index.js +8 -2
- package/dist/styles.css +93 -0
- package/gates/README.md +98 -0
- package/gates/cli.mjs +133 -0
- package/gates/hidden-state.mjs +243 -0
- package/gates/index.mjs +81 -0
- package/gates/laws.mjs +170 -0
- package/gates/links.mjs +187 -0
- package/gates/pack-boundary.mjs +421 -0
- package/gates/pin.mjs +130 -0
- package/gates/retired-line.mjs +314 -0
- package/gates/run.mjs +320 -0
- package/gates/runtime-token-read.mjs +129 -0
- package/gates/stylesheet-ownership.mjs +207 -0
- package/package.json +14 -2
package/dist/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,yCAA0C,CAAA;AACpE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAExD,eAAO,MAAM,oBAAoB,sHAQvB,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAA;CAChC;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,WAAW,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,yCAA0C,CAAA;AACpE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAExD,eAAO,MAAM,oBAAoB,sHAQvB,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAA;CAChC;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,WAAW,EAmsBzC,CAAA;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,KAAK,GAAE,SAAS,WAAW,EAAY,GAAG,WAAW,EAAE,CAEnF;AAED,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAE1D,CAAA"}
|
package/dist/catalog.js
CHANGED
|
@@ -153,6 +153,16 @@ export const catalog = [
|
|
|
153
153
|
exports: ['Skeleton'],
|
|
154
154
|
status: 'stable',
|
|
155
155
|
},
|
|
156
|
+
{
|
|
157
|
+
name: 'LiveRegion',
|
|
158
|
+
slug: 'live-region',
|
|
159
|
+
kind: 'component',
|
|
160
|
+
category: 'Feedback',
|
|
161
|
+
description: 'A region that announces what just changed in it, and renders nothing when it has nothing to say.',
|
|
162
|
+
source: 'src/components/ui/live-region.tsx',
|
|
163
|
+
exports: ['LiveRegion'],
|
|
164
|
+
status: 'stable',
|
|
165
|
+
},
|
|
156
166
|
{
|
|
157
167
|
name: 'Separator',
|
|
158
168
|
slug: 'separator',
|
|
@@ -202,6 +212,26 @@ export const catalog = [
|
|
|
202
212
|
exports: ['Kbd'],
|
|
203
213
|
status: 'stable',
|
|
204
214
|
},
|
|
215
|
+
{
|
|
216
|
+
name: 'Mark',
|
|
217
|
+
slug: 'mark',
|
|
218
|
+
kind: 'component',
|
|
219
|
+
category: 'Typography',
|
|
220
|
+
description: 'A run of text with its matches visibly marked, and nothing announced.',
|
|
221
|
+
source: 'src/components/ui/mark.tsx',
|
|
222
|
+
exports: ['Mark'],
|
|
223
|
+
status: 'stable',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: 'Tree',
|
|
227
|
+
slug: 'tree',
|
|
228
|
+
kind: 'component',
|
|
229
|
+
category: 'Layout',
|
|
230
|
+
description: 'A tree of nodes given as data, navigable by the arrow keys.',
|
|
231
|
+
source: 'src/components/ui/tree.tsx',
|
|
232
|
+
exports: ['Tree'],
|
|
233
|
+
status: 'stable',
|
|
234
|
+
},
|
|
205
235
|
{
|
|
206
236
|
name: 'Diagram',
|
|
207
237
|
slug: 'diagram',
|
|
@@ -664,6 +694,16 @@ export const catalog = [
|
|
|
664
694
|
exports: ['BlogPostPage'],
|
|
665
695
|
status: 'stable',
|
|
666
696
|
},
|
|
697
|
+
{
|
|
698
|
+
name: 'DocsShell',
|
|
699
|
+
slug: 'docs-shell',
|
|
700
|
+
kind: 'page',
|
|
701
|
+
category: null,
|
|
702
|
+
description: 'A documentation screen: a navigation rail whose shape arrives as data, the document at the measure, a contents rail, and a pager derived from the navigation rather than passed.',
|
|
703
|
+
source: 'src/pages/docs-shell/index.tsx',
|
|
704
|
+
exports: ['DocsShell'],
|
|
705
|
+
status: 'stable',
|
|
706
|
+
},
|
|
667
707
|
];
|
|
668
708
|
/** Returns the catalogue ordered for display and keyed for lookup. */
|
|
669
709
|
export function buildCatalog(items = catalog) {
|
|
@@ -20,11 +20,17 @@ export { Input } from './ui/input';
|
|
|
20
20
|
export { Textarea } from './ui/textarea';
|
|
21
21
|
export { Alert, AlertTitle, AlertDescription } from './ui/alert';
|
|
22
22
|
export { Skeleton } from './ui/skeleton';
|
|
23
|
+
export { LiveRegion } from './ui/live-region';
|
|
24
|
+
export type { LiveRegionProps, LivePoliteness } from './ui/live-region';
|
|
23
25
|
export { Separator } from './ui/separator';
|
|
24
26
|
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption, } from './ui/table';
|
|
25
27
|
export { Heading, Text } from './ui/typography';
|
|
26
28
|
export type { HeadingElement } from './ui/typography';
|
|
27
29
|
export { Kbd } from './ui/kbd';
|
|
30
|
+
export { Mark } from './ui/mark';
|
|
31
|
+
export type { MatchProps, MatchRange } from './ui/mark';
|
|
32
|
+
export { Tree } from './ui/tree';
|
|
33
|
+
export type { TreeProps, TreeNode, TreeNodePage, TreeNodeGroup, TreeNodeDivider } from './ui/tree';
|
|
28
34
|
export { Diagram } from './ui/diagram';
|
|
29
35
|
export type { DiagramProps, DiagramNode, DiagramRelation } from './ui/diagram';
|
|
30
36
|
export { ProductMark } from './ui/product-mark';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EACL,IAAI,EACJ,UAAU,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACX,UAAU,GACX,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACtD,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,MAAM,iBAA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6BAA6B,EAC7B,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACtE,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACpE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC7F,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/components/index.js
CHANGED
|
@@ -19,10 +19,13 @@ export { Input } from './ui/input';
|
|
|
19
19
|
export { Textarea } from './ui/textarea';
|
|
20
20
|
export { Alert, AlertTitle, AlertDescription } from './ui/alert';
|
|
21
21
|
export { Skeleton } from './ui/skeleton';
|
|
22
|
+
export { LiveRegion } from './ui/live-region';
|
|
22
23
|
export { Separator } from './ui/separator';
|
|
23
24
|
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption, } from './ui/table';
|
|
24
25
|
export { Heading, Text } from './ui/typography';
|
|
25
26
|
export { Kbd } from './ui/kbd';
|
|
27
|
+
export { Mark } from './ui/mark';
|
|
28
|
+
export { Tree } from './ui/tree';
|
|
26
29
|
export { Diagram } from './ui/diagram';
|
|
27
30
|
export { ProductMark } from './ui/product-mark';
|
|
28
31
|
export { Prose } from './ui/prose';
|
|
@@ -3,9 +3,13 @@ import type { ComponentProps } from 'react';
|
|
|
3
3
|
* The trail of ancestor links that shows where the current page sits.
|
|
4
4
|
*
|
|
5
5
|
* The root is a `<nav>` with an accessible name so the trail is announced as
|
|
6
|
-
* one region rather than as an unexplained list of links.
|
|
6
|
+
* one region rather than as an unexplained list of links. The name is a prop and
|
|
7
|
+
* the default is the word Prism would have used, so a product that calls its
|
|
8
|
+
* trail something else is not made to ship a landmark named "Breadcrumb".
|
|
7
9
|
*/
|
|
8
|
-
declare function Breadcrumb({ className, ...props }: ComponentProps<'nav'>
|
|
10
|
+
declare function Breadcrumb({ className, label, ...props }: ComponentProps<'nav'> & {
|
|
11
|
+
label?: string;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
9
13
|
/** The ordered list that holds the trail's items and separators. */
|
|
10
14
|
declare function BreadcrumbList({ className, ...props }: ComponentProps<'ol'>): import("react").JSX.Element;
|
|
11
15
|
/** One step in the trail. Holds a link, the current page, or a separator. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/ui/breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/components/ui/breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C;;;;;;;GAOG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,KAAoB,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAS5G;AAED,oEAAoE;AACpE,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,+BAWpE;AAED,6EAA6E;AAC7E,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,+BAQpE;AAED;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,GAAG,CAAC,+BAWnE;AAED;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,+BAStE;AAED;;;;;GAKG;AACH,iBAAS,mBAAmB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,IAAI,CAAC,+BAYtB;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,CAAA"}
|
|
@@ -5,10 +5,12 @@ import { cn } from '../../lib/utils';
|
|
|
5
5
|
* The trail of ancestor links that shows where the current page sits.
|
|
6
6
|
*
|
|
7
7
|
* The root is a `<nav>` with an accessible name so the trail is announced as
|
|
8
|
-
* one region rather than as an unexplained list of links.
|
|
8
|
+
* one region rather than as an unexplained list of links. The name is a prop and
|
|
9
|
+
* the default is the word Prism would have used, so a product that calls its
|
|
10
|
+
* trail something else is not made to ship a landmark named "Breadcrumb".
|
|
9
11
|
*/
|
|
10
|
-
function Breadcrumb({ className, ...props }) {
|
|
11
|
-
return (_jsx("nav", { "aria-label":
|
|
12
|
+
function Breadcrumb({ className, label = 'Breadcrumb', ...props }) {
|
|
13
|
+
return (_jsx("nav", { "aria-label": label, "data-slot": "breadcrumb", className: cn(className), ...props }));
|
|
12
14
|
}
|
|
13
15
|
/** The ordered list that holds the trail's items and separators. */
|
|
14
16
|
function BreadcrumbList({ className, ...props }) {
|
|
@@ -37,6 +37,17 @@ export interface DialogContentProps extends ComponentProps<'div'> {
|
|
|
37
37
|
side?: 'center' | 'top' | 'bottom' | 'left' | 'right';
|
|
38
38
|
/** Whether the built-in close control is rendered. @defaultValue true */
|
|
39
39
|
showCloseButton?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The accessible name of the built-in close control, when it is rendered.
|
|
42
|
+
*
|
|
43
|
+
* A prop and not a fixed word, because a consumer that localises its dialog
|
|
44
|
+
* cannot otherwise localise the one control that dismisses it, and a dialog
|
|
45
|
+
* that announces "Close" in a product that never uses that word is a control
|
|
46
|
+
* the consumer cannot fix.
|
|
47
|
+
*
|
|
48
|
+
* @defaultValue 'Close'
|
|
49
|
+
*/
|
|
50
|
+
closeLabel?: string;
|
|
40
51
|
}
|
|
41
52
|
/** The props DialogHeader forwards to a plain container. */
|
|
42
53
|
export interface DialogHeaderProps extends ComponentProps<'div'> {
|
|
@@ -66,7 +77,7 @@ declare function Dialog({ ...props }: DialogProps): import("react").JSX.Element;
|
|
|
66
77
|
/** The element that opens the dialog. */
|
|
67
78
|
declare function DialogTrigger({ className, ...props }: DialogTriggerProps): import("react").JSX.Element;
|
|
68
79
|
/** The dialog panel, its backdrop and its portal. */
|
|
69
|
-
declare function DialogContent({ className, side, showCloseButton, children, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
80
|
+
declare function DialogContent({ className, side, showCloseButton, closeLabel, children, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
70
81
|
/** The dialog's heading area, above the body. */
|
|
71
82
|
declare function DialogHeader({ className, ...props }: DialogHeaderProps): import("react").JSX.Element;
|
|
72
83
|
/** The dialog's action area, below the body. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,4DAA4D;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,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AAE,sBAAsB,+BAQzE;AAED,gEAAgE;AAChE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,+BAc7D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,WAAW,GACZ,CAAA"}
|
|
@@ -34,8 +34,8 @@ function DialogTrigger({ className, ...props }) {
|
|
|
34
34
|
return (_jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", className: cn('bg-background shadow-xs inline-flex h-9 items-center justify-center gap-2 rounded-md border px-3 text-sm font-medium outline-none', 'transition-[color,box-shadow,background-color] duration-fast ease-out', 'hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px]', 'disabled:pointer-events-none disabled:opacity-50', className), ...props }));
|
|
35
35
|
}
|
|
36
36
|
/** The dialog panel, its backdrop and its portal. */
|
|
37
|
-
function DialogContent({ className, side = 'center', showCloseButton = true, children, ...props }) {
|
|
38
|
-
return (_jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-backdrop", className: "bg-background/80 fixed inset-0 z-50 backdrop-blur-sm transition-opacity duration-base ease-out data-[starting-style]:opacity-0 data-[ending-style]:opacity-0" }), _jsx(DialogPrimitive.Viewport, { "data-slot": "dialog-viewport", className: VIEWPORT[side], children: _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: cn('bg-background shadow-md relative grid gap-4 p-6 outline-none', 'transition-[opacity,transform] duration-base ease-out data-[starting-style]:opacity-0 data-[ending-style]:opacity-0', POPUP[side], className), ...props, children: [children, showCloseButton ? (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", "aria-label":
|
|
37
|
+
function DialogContent({ className, side = 'center', showCloseButton = true, closeLabel = 'Close', children, ...props }) {
|
|
38
|
+
return (_jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Backdrop, { "data-slot": "dialog-backdrop", className: "bg-background/80 fixed inset-0 z-50 backdrop-blur-sm transition-opacity duration-base ease-out data-[starting-style]:opacity-0 data-[ending-style]:opacity-0" }), _jsx(DialogPrimitive.Viewport, { "data-slot": "dialog-viewport", className: VIEWPORT[side], children: _jsxs(DialogPrimitive.Popup, { "data-slot": "dialog-content", className: cn('bg-background shadow-md relative grid gap-4 p-6 outline-none', 'transition-[opacity,transform] duration-base ease-out data-[starting-style]:opacity-0 data-[ending-style]:opacity-0', POPUP[side], className), ...props, children: [children, showCloseButton ? (_jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", "aria-label": closeLabel, className: "ring-offset-background focus-visible:ring-ring absolute top-4 right-4 rounded-sm opacity-70 outline-none transition-opacity duration-fast ease-out hover:opacity-100 focus-visible:ring-[3px] disabled:pointer-events-none", children: _jsx(XIcon, { className: "size-4" }) })) : null] }) })] }));
|
|
39
39
|
}
|
|
40
40
|
/** The dialog's heading area, above the body. */
|
|
41
41
|
function DialogHeader({ className, ...props }) {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* How insistently a change is announced.
|
|
4
|
+
*
|
|
5
|
+
* `polite` waits for a pause, which is right for a log that grows, a result count
|
|
6
|
+
* that updates while someone types, and every other change that is not waiting
|
|
7
|
+
* for an answer. `assertive` interrupts, which is right for a run that failed or a
|
|
8
|
+
* payment that was declined and nothing else.
|
|
9
|
+
*
|
|
10
|
+
* There is no `off` here, deliberately. A live region with no politeness is not
|
|
11
|
+
* silent, it is a region whose behaviour a screen reader guesses at, and the
|
|
12
|
+
* component that wants no announcement is a component that should not be a live
|
|
13
|
+
* region.
|
|
14
|
+
*/
|
|
15
|
+
export type LivePoliteness = 'polite' | 'assertive';
|
|
16
|
+
/** The props the Live region accepts. */
|
|
17
|
+
export interface LiveRegionProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
18
|
+
/**
|
|
19
|
+
* The content whose arrival is announced.
|
|
20
|
+
*
|
|
21
|
+
* This is the whole job of the component: the region renders exactly what it is
|
|
22
|
+
* given and announces the change. A consumer owns the words.
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* How insistently a change is announced. @defaultValue 'polite'
|
|
27
|
+
*
|
|
28
|
+
* The default is the least interruptive value that is still announced, because
|
|
29
|
+
* a run log that announces assertively interrupts a screen reader mid-sentence
|
|
30
|
+
* and a consumer with a genuinely urgent event can say so here.
|
|
31
|
+
*/
|
|
32
|
+
politeness?: LivePoliteness;
|
|
33
|
+
/**
|
|
34
|
+
* Whether more content is expected.
|
|
35
|
+
*
|
|
36
|
+
* This is about the caller's knowledge rather than about an animation: a region
|
|
37
|
+
* that is busy is still readable, and a caller that sets it permanently has told
|
|
38
|
+
* assistive technology the stream never ends. A caller that leaves it false
|
|
39
|
+
* while appending to the region is announcing every chunk, which is usually what
|
|
40
|
+
* a log that has finished wants and usually not what one still running wants.
|
|
41
|
+
*
|
|
42
|
+
* @defaultValue false
|
|
43
|
+
*/
|
|
44
|
+
busy?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* An accessible name for the region, read before its content.
|
|
47
|
+
*
|
|
48
|
+
* A live region is announced by what arrives, so a name is only worth passing
|
|
49
|
+
* when a reader would otherwise hear an update with nothing to place it. A
|
|
50
|
+
* streamed run whose messages are self-describing does not need one; a region
|
|
51
|
+
* that announces bare status needs it to say what the status is about.
|
|
52
|
+
*/
|
|
53
|
+
label?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A region that announces what just changed in it.
|
|
57
|
+
*
|
|
58
|
+
* The first of the three primitives the expansion found missing, and the one the
|
|
59
|
+
* fourth Kind is specified to depend on: an event log surface is a live region,
|
|
60
|
+
* and an unannounced append is not accessible, so a run log built before this
|
|
61
|
+
* existed is a run log a screen reader cannot follow.
|
|
62
|
+
*
|
|
63
|
+
* **The empty case is the one that matters.** A region that is always present
|
|
64
|
+
* announces on every state change of its container, so a live region that renders
|
|
65
|
+
* nothing focusable when it has nothing to say is the correct shape and a region
|
|
66
|
+
* that renders an empty div forever is a defect. When `children` is empty this
|
|
67
|
+
* renders no element at all rather than an empty one, which is also why there is
|
|
68
|
+
* no focusable child to put in it.
|
|
69
|
+
*
|
|
70
|
+
* **This owns the region, not the transport.** A consumer owns the connection: the
|
|
71
|
+
* socket, the retry, the persistence, and the order the events arrive in. This
|
|
72
|
+
* receives what has arrived and announces it. That split is the same one the
|
|
73
|
+
* documentation Page makes with its navigation, and the reason Prism stays
|
|
74
|
+
* transport-agnostic and no consumer inherits a connection it did not ask for.
|
|
75
|
+
*/
|
|
76
|
+
declare function LiveRegion({ className, children, politeness, busy, label, ...props }: LiveRegionProps): import("react").JSX.Element | null;
|
|
77
|
+
export { LiveRegion };
|
|
78
|
+
//# sourceMappingURL=live-region.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-region.d.ts","sourceRoot":"","sources":["../../../src/components/ui/live-region.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAA;AAEnD,yCAAyC;AACzC,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC9E;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,UAAqB,EACrB,IAAY,EACZ,KAAK,EACL,GAAG,KAAK,EACT,EAAE,eAAe,sCAiCjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
/**
|
|
5
|
+
* A region that announces what just changed in it.
|
|
6
|
+
*
|
|
7
|
+
* The first of the three primitives the expansion found missing, and the one the
|
|
8
|
+
* fourth Kind is specified to depend on: an event log surface is a live region,
|
|
9
|
+
* and an unannounced append is not accessible, so a run log built before this
|
|
10
|
+
* existed is a run log a screen reader cannot follow.
|
|
11
|
+
*
|
|
12
|
+
* **The empty case is the one that matters.** A region that is always present
|
|
13
|
+
* announces on every state change of its container, so a live region that renders
|
|
14
|
+
* nothing focusable when it has nothing to say is the correct shape and a region
|
|
15
|
+
* that renders an empty div forever is a defect. When `children` is empty this
|
|
16
|
+
* renders no element at all rather than an empty one, which is also why there is
|
|
17
|
+
* no focusable child to put in it.
|
|
18
|
+
*
|
|
19
|
+
* **This owns the region, not the transport.** A consumer owns the connection: the
|
|
20
|
+
* socket, the retry, the persistence, and the order the events arrive in. This
|
|
21
|
+
* receives what has arrived and announces it. That split is the same one the
|
|
22
|
+
* documentation Page makes with its navigation, and the reason Prism stays
|
|
23
|
+
* transport-agnostic and no consumer inherits a connection it did not ask for.
|
|
24
|
+
*/
|
|
25
|
+
function LiveRegion({ className, children, politeness = 'polite', busy = false, label, ...props }) {
|
|
26
|
+
// An empty region is not a region. Rendering the element with nothing in it
|
|
27
|
+
// would put a live region on the page permanently, and a permanently present
|
|
28
|
+
// live region announces every unrelated state change of its ancestors, which is
|
|
29
|
+
// the noise this component exists to avoid as well as to cause.
|
|
30
|
+
//
|
|
31
|
+
// The test is "renders nothing" rather than a list of the nothing values, because
|
|
32
|
+
// a caller passing an empty string, a null from a state that has not resolved, or
|
|
33
|
+
// a false from a condition are three routes to the same state and a list of three
|
|
34
|
+
// is a list the fourth route would miss.
|
|
35
|
+
if (children === undefined || children === null || children === false || children === '')
|
|
36
|
+
return null;
|
|
37
|
+
return (_jsx("div", { "data-slot": "live-region",
|
|
38
|
+
// `role="status"` and not a bare div, and the reason is that a `div` with no
|
|
39
|
+
// role has no accessible name: `aria-label` on one is prohibited rather than
|
|
40
|
+
// merely ignored, which the accessibility gate in this repository caught the
|
|
41
|
+
// first time this Component was rendered. A status is also the honest role,
|
|
42
|
+
// because it is what this is: content that changed and is not waiting for
|
|
43
|
+
// the reader. The role carries an implicit `aria-live="polite"`, and the
|
|
44
|
+
// explicit attribute is written anyway so that `assertive` is a real
|
|
45
|
+
// override rather than an implication the reader has to infer.
|
|
46
|
+
role: "status", "aria-live": politeness, "aria-busy": busy || undefined, ...(label === undefined ? null : { 'aria-label': label }), className: cn(className), ...props, children: children }));
|
|
47
|
+
}
|
|
48
|
+
export { LiveRegion };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* One continuous run of text, which is what a search matches on.
|
|
4
|
+
*
|
|
5
|
+
* A caller passes the string and the ranges inside it that matched, rather than
|
|
6
|
+
* passing pre-split nodes, because a caller that assembled the nodes had to
|
|
7
|
+
* compute the ranges and this Component has the string. A range that is out of
|
|
8
|
+
* order, overlapping or past the end of the string is not a defect: a search
|
|
9
|
+
* backend that reports two overlapping hits is normal, so the ranges are sorted
|
|
10
|
+
* and merged rather than rejected.
|
|
11
|
+
*/
|
|
12
|
+
export type MatchRange = {
|
|
13
|
+
/** The index the matched run starts at, inclusive. */
|
|
14
|
+
start: number;
|
|
15
|
+
/** The index the matched run ends at, exclusive. */
|
|
16
|
+
end: number;
|
|
17
|
+
};
|
|
18
|
+
/** The props the Mark treatment accepts. */
|
|
19
|
+
export interface MatchProps extends Omit<ComponentProps<'mark'>, 'children'> {
|
|
20
|
+
/** The text, which the ranges index into. */
|
|
21
|
+
text: string;
|
|
22
|
+
/** The runs that matched, in any order and possibly overlapping. */
|
|
23
|
+
ranges: readonly MatchRange[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A run of text with its matches visibly marked.
|
|
27
|
+
*
|
|
28
|
+
* A command palette and a search result list both need to show why a result
|
|
29
|
+
* matched, and until this existed the only way to do that inside Prism was to drop
|
|
30
|
+
* a span with hand-written styling into a consumer's own markup, which the
|
|
31
|
+
* authoring contract does not permit.
|
|
32
|
+
*
|
|
33
|
+
* **It adds no semantics, and that is the decision.** A consumer marking a search
|
|
34
|
+
* hit wants a visual difference, not a screen reader that announces the word
|
|
35
|
+
* "highlighted" between every character of a result. So this styles a `mark` and
|
|
36
|
+
* puts nothing else on it: no role, no `aria-label`, no live region. A consumer
|
|
37
|
+
* who wants the announcement writes it, because a Component that announced every
|
|
38
|
+
* match would make a result list unreadable rather than clearer, and the failure
|
|
39
|
+
* would be invisible to review because nothing looks different on screen.
|
|
40
|
+
*/
|
|
41
|
+
declare function Mark({ className, text, ranges, ...props }: MatchProps): import("react").JSX.Element;
|
|
42
|
+
export { Mark };
|
|
43
|
+
export type { MatchProps as MarkProps };
|
|
44
|
+
//# sourceMappingURL=mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mark.d.ts","sourceRoot":"","sources":["../../../src/components/ui/mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,OAAO,CAAA;AAItD;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,4CAA4C;AAC5C,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC1E,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;CAC9B;AAkCD;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAsC9D;AAED,OAAO,EAAE,IAAI,EAAE,CAAA;AACf,YAAY,EAAE,UAAU,IAAI,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/utils';
|
|
3
|
+
/**
|
|
4
|
+
* The ranges as merged runs, with anything malformed dropped.
|
|
5
|
+
*
|
|
6
|
+
* Three things are handled rather than refused, and each is a thing a search
|
|
7
|
+
* backend does: ranges that arrive out of order, ranges that overlap because two
|
|
8
|
+
* matches share a character, and a range that runs past the end of the string
|
|
9
|
+
* because the index is of a normalised form rather than this one. A Component
|
|
10
|
+
* that threw on any of them would be a Component a consumer wraps in a try, which
|
|
11
|
+
* is a worse failure than a slightly short highlight.
|
|
12
|
+
*/
|
|
13
|
+
function mergedRanges(ranges, length) {
|
|
14
|
+
const valid = ranges
|
|
15
|
+
.filter((range) => Number.isInteger(range.start) && Number.isInteger(range.end))
|
|
16
|
+
.map((range) => ({
|
|
17
|
+
start: Math.max(0, Math.min(range.start, length)),
|
|
18
|
+
end: Math.max(0, Math.min(range.end, length)),
|
|
19
|
+
}))
|
|
20
|
+
.filter((range) => range.end > range.start)
|
|
21
|
+
.sort((a, b) => a.start - b.start);
|
|
22
|
+
const merged = [];
|
|
23
|
+
for (const range of valid) {
|
|
24
|
+
const last = merged.at(-1);
|
|
25
|
+
if (last !== undefined && range.start <= last.end) {
|
|
26
|
+
last.end = Math.max(last.end, range.end);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
merged.push({ ...range });
|
|
30
|
+
}
|
|
31
|
+
return merged;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A run of text with its matches visibly marked.
|
|
35
|
+
*
|
|
36
|
+
* A command palette and a search result list both need to show why a result
|
|
37
|
+
* matched, and until this existed the only way to do that inside Prism was to drop
|
|
38
|
+
* a span with hand-written styling into a consumer's own markup, which the
|
|
39
|
+
* authoring contract does not permit.
|
|
40
|
+
*
|
|
41
|
+
* **It adds no semantics, and that is the decision.** A consumer marking a search
|
|
42
|
+
* hit wants a visual difference, not a screen reader that announces the word
|
|
43
|
+
* "highlighted" between every character of a result. So this styles a `mark` and
|
|
44
|
+
* puts nothing else on it: no role, no `aria-label`, no live region. A consumer
|
|
45
|
+
* who wants the announcement writes it, because a Component that announced every
|
|
46
|
+
* match would make a result list unreadable rather than clearer, and the failure
|
|
47
|
+
* would be invisible to review because nothing looks different on screen.
|
|
48
|
+
*/
|
|
49
|
+
function Mark({ className, text, ranges, ...props }) {
|
|
50
|
+
const runs = mergedRanges(ranges, text.length);
|
|
51
|
+
if (runs.length === 0) {
|
|
52
|
+
// Unmatched text is still text, and returning the bare string rather than an
|
|
53
|
+
// element keeps a result row that has no match from carrying a `mark` that
|
|
54
|
+
// marks nothing.
|
|
55
|
+
return _jsx(_Fragment, { children: text });
|
|
56
|
+
}
|
|
57
|
+
const parts = [];
|
|
58
|
+
let at = 0;
|
|
59
|
+
runs.forEach((run, index) => {
|
|
60
|
+
if (run.start > at)
|
|
61
|
+
parts.push(text.slice(at, run.start));
|
|
62
|
+
parts.push(_jsx("mark", { "data-slot": "match",
|
|
63
|
+
// The one treatment this Component authors, and it is a surface rather than
|
|
64
|
+
// a colour: a mark sits behind the text it marks, so it needs a ground and
|
|
65
|
+
// the foreground that reads on that ground. `warning` is the pair for that
|
|
66
|
+
// already, and it is used here rather than a new role because a search hit
|
|
67
|
+
// is emphasis and not a caution, which is a distinction worth keeping by
|
|
68
|
+
// spending the existing token rather than by adding one that means
|
|
69
|
+
// "highlighted" and will be re-pointed at something else within a year.
|
|
70
|
+
// The contrast gate measures this pair against every surface it can land
|
|
71
|
+
// on, in every pack and both modes.
|
|
72
|
+
className: cn('bg-warning text-warning-foreground rounded-sm px-0.5', className), ...props, children: text.slice(run.start, run.end) }, `${run.start}-${run.end}-${index}`));
|
|
73
|
+
at = run.end;
|
|
74
|
+
});
|
|
75
|
+
if (at < text.length)
|
|
76
|
+
parts.push(text.slice(at));
|
|
77
|
+
return _jsx(_Fragment, { children: parts });
|
|
78
|
+
}
|
|
79
|
+
export { Mark };
|
|
@@ -4,9 +4,14 @@ type PaginationSize = 'default' | 'sm' | 'lg' | 'icon';
|
|
|
4
4
|
* The control that moves between pages of a paged collection.
|
|
5
5
|
*
|
|
6
6
|
* The root is a `<nav>` with an accessible name, so the page links are grouped
|
|
7
|
-
* as one navigation region.
|
|
7
|
+
* as one navigation region. The name is a prop and the default is the word Prism
|
|
8
|
+
* would have used: a product that calls its paging something else announces the
|
|
9
|
+
* wrong region to a screen reader, and the default is a convenience rather than
|
|
10
|
+
* the right answer for a consumer whose product is not a generic library.
|
|
8
11
|
*/
|
|
9
|
-
declare function Pagination({ className, ...props }: ComponentProps<'nav'>
|
|
12
|
+
declare function Pagination({ className, label, ...props }: ComponentProps<'nav'> & {
|
|
13
|
+
label?: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
10
15
|
/** The list that holds the page links. */
|
|
11
16
|
declare function PaginationContent({ className, ...props }: ComponentProps<'ul'>): import("react").JSX.Element;
|
|
12
17
|
/** One slot in the list: a page link, a step control or an ellipsis. */
|
|
@@ -21,13 +26,26 @@ declare function PaginationLink({ className, isActive, size, ...props }: Compone
|
|
|
21
26
|
isActive?: boolean;
|
|
22
27
|
size?: PaginationSize;
|
|
23
28
|
}): import("react").JSX.Element;
|
|
24
|
-
/**
|
|
25
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The step back to the previous page, with a hidden label on narrow layouts.
|
|
31
|
+
*
|
|
32
|
+
* `text` and `label` are separate props and they move together or not at all: a
|
|
33
|
+
* caller that localises the visible word and not the announced one gets a control
|
|
34
|
+
* that looks localised and is half of it, which is the state this shape was
|
|
35
|
+
* written to end. Both default to the word Prism would have used.
|
|
36
|
+
*/
|
|
37
|
+
declare function PaginationPrevious({ className, text, label, ...props }: ComponentProps<typeof PaginationLink> & {
|
|
26
38
|
text?: string;
|
|
39
|
+
label?: string;
|
|
27
40
|
}): import("react").JSX.Element;
|
|
28
|
-
/**
|
|
29
|
-
|
|
41
|
+
/**
|
|
42
|
+
* The step forward to the next page, with a hidden label on narrow layouts.
|
|
43
|
+
*
|
|
44
|
+
* `text` and `label` move together for the reason `PaginationPrevious` states.
|
|
45
|
+
*/
|
|
46
|
+
declare function PaginationNext({ className, text, label, ...props }: ComponentProps<typeof PaginationLink> & {
|
|
30
47
|
text?: string;
|
|
48
|
+
label?: string;
|
|
31
49
|
}): import("react").JSX.Element;
|
|
32
50
|
/**
|
|
33
51
|
* A held-back run of page numbers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/ui/pagination.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C,KAAK,cAAc,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;AAEtD
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/components/ui/pagination.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C,KAAK,cAAc,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;AAEtD;;;;;;;;GAQG;AACH,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,KAAoB,EACpB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAS5C;AAED,0CAA0C;AAC1C,iBAAS,iBAAiB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,+BAQvE;AAED,wEAAwE;AACxE,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,+BAEpE;AAED;;;;;GAKG;AACH,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,IAAa,EACb,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,GAAG,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,cAAc,CAAA;CAAE,+BAoBrE;AAED;;;;;;;GAOG;AACH,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,IAAiB,EACjB,KAAiC,EACjC,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAY3E;AAED;;;;GAIG;AACH,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,IAAa,EACb,KAA6B,EAC7B,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,+BAY3E;AAED;;;;;GAKG;AACH,iBAAS,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,+BAW1E;AAED,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,GACnB,CAAA"}
|
|
@@ -5,10 +5,13 @@ import { cn } from '../../lib/utils';
|
|
|
5
5
|
* The control that moves between pages of a paged collection.
|
|
6
6
|
*
|
|
7
7
|
* The root is a `<nav>` with an accessible name, so the page links are grouped
|
|
8
|
-
* as one navigation region.
|
|
8
|
+
* as one navigation region. The name is a prop and the default is the word Prism
|
|
9
|
+
* would have used: a product that calls its paging something else announces the
|
|
10
|
+
* wrong region to a screen reader, and the default is a convenience rather than
|
|
11
|
+
* the right answer for a consumer whose product is not a generic library.
|
|
9
12
|
*/
|
|
10
|
-
function Pagination({ className, ...props }) {
|
|
11
|
-
return (_jsx("nav", { "aria-label":
|
|
13
|
+
function Pagination({ className, label = 'Pagination', ...props }) {
|
|
14
|
+
return (_jsx("nav", { "aria-label": label, "data-slot": "pagination", className: cn('mx-auto flex w-full justify-center', className), ...props }));
|
|
12
15
|
}
|
|
13
16
|
/** The list that holds the page links. */
|
|
14
17
|
function PaginationContent({ className, ...props }) {
|
|
@@ -29,13 +32,24 @@ function PaginationLink({ className, isActive, size = 'icon', ...props }) {
|
|
|
29
32
|
? 'border-border bg-background text-foreground border'
|
|
30
33
|
: 'text-foreground hover:bg-accent hover:text-accent-foreground', className), ...props }));
|
|
31
34
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The step back to the previous page, with a hidden label on narrow layouts.
|
|
37
|
+
*
|
|
38
|
+
* `text` and `label` are separate props and they move together or not at all: a
|
|
39
|
+
* caller that localises the visible word and not the announced one gets a control
|
|
40
|
+
* that looks localised and is half of it, which is the state this shape was
|
|
41
|
+
* written to end. Both default to the word Prism would have used.
|
|
42
|
+
*/
|
|
43
|
+
function PaginationPrevious({ className, text = 'Previous', label = 'Go to the previous page', ...props }) {
|
|
44
|
+
return (_jsxs(PaginationLink, { "aria-label": label, size: "default", className: cn('gap-1 px-2.5 sm:pl-2.5', className), ...props, children: [_jsx(ChevronLeft, {}), _jsx("span", { className: "hidden sm:block", children: text })] }));
|
|
35
45
|
}
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
46
|
+
/**
|
|
47
|
+
* The step forward to the next page, with a hidden label on narrow layouts.
|
|
48
|
+
*
|
|
49
|
+
* `text` and `label` move together for the reason `PaginationPrevious` states.
|
|
50
|
+
*/
|
|
51
|
+
function PaginationNext({ className, text = 'Next', label = 'Go to the next page', ...props }) {
|
|
52
|
+
return (_jsxs(PaginationLink, { "aria-label": label, size: "default", className: cn('gap-1 px-2.5 sm:pr-2.5', className), ...props, children: [_jsx("span", { className: "hidden sm:block", children: text }), _jsx(ChevronRight, {})] }));
|
|
39
53
|
}
|
|
40
54
|
/**
|
|
41
55
|
* A held-back run of page numbers.
|
|
@@ -60,6 +60,13 @@ export type ProductSwitcherProps = Omit<ComponentProps<'nav'>, 'children'> & {
|
|
|
60
60
|
* A heading for the set, for a switcher that is not inside a landmark the
|
|
61
61
|
* reader can already name. Rendered as the navigation's accessible name and as
|
|
62
62
|
* no visible text, because the marks beside it are the labels.
|
|
63
|
+
*
|
|
64
|
+
* It defaults to nothing rather than to a word. A switcher in a product that
|
|
65
|
+
* calls its products something else announces the wrong name, and a default of
|
|
66
|
+
* "Products" is a claim about a consumer's product that the prop exists so they
|
|
67
|
+
* do not have to make. A switcher with no `label` renders a navigation with no
|
|
68
|
+
* accessible name, which is a real state and the caller's to resolve, rather than
|
|
69
|
+
* one that is quietly wrong.
|
|
63
70
|
*/
|
|
64
71
|
label?: string;
|
|
65
72
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-switcher.d.ts","sourceRoot":"","sources":["../../../src/components/ui/product-switcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAe,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGzF;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC/B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAC3E;;;OAGG;IACH,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAA;IACpC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB
|
|
1
|
+
{"version":3,"file":"product-switcher.d.ts","sourceRoot":"","sources":["../../../src/components/ui/product-switcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAe,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGzF;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAC/B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IAC3E;;;OAGG;IACH,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAA;IACpC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,IAAW,EACX,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,sCA+BtB;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|