@nanisoft/prism-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/LICENSE +21 -0
- package/README.md +81 -0
- package/THIRD-PARTY-NOTICES.md +48 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/blocks/app-shell-01/app-shell.d.ts +38 -0
- package/dist/blocks/app-shell-01/app-shell.d.ts.map +1 -0
- package/dist/blocks/app-shell-01/app-shell.js +27 -0
- package/dist/blocks/app-shell-01/index.d.ts +3 -0
- package/dist/blocks/app-shell-01/index.d.ts.map +1 -0
- package/dist/blocks/app-shell-01/index.js +1 -0
- package/dist/blocks/auth-form-01/auth-form.d.ts +52 -0
- package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -0
- package/dist/blocks/auth-form-01/auth-form.js +23 -0
- package/dist/blocks/auth-form-01/index.d.ts +3 -0
- package/dist/blocks/auth-form-01/index.d.ts.map +1 -0
- package/dist/blocks/auth-form-01/index.js +1 -0
- package/dist/blocks/cta-01/cta.d.ts +83 -0
- package/dist/blocks/cta-01/cta.d.ts.map +1 -0
- package/dist/blocks/cta-01/cta.js +29 -0
- package/dist/blocks/cta-01/index.d.ts +3 -0
- package/dist/blocks/cta-01/index.d.ts.map +1 -0
- package/dist/blocks/cta-01/index.js +1 -0
- package/dist/blocks/data-table-01/data-table.d.ts +102 -0
- package/dist/blocks/data-table-01/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table-01/data-table.js +116 -0
- package/dist/blocks/data-table-01/index.d.ts +3 -0
- package/dist/blocks/data-table-01/index.d.ts.map +1 -0
- package/dist/blocks/data-table-01/index.js +1 -0
- package/dist/blocks/feature-grid-01/feature-grid.d.ts +78 -0
- package/dist/blocks/feature-grid-01/feature-grid.d.ts.map +1 -0
- package/dist/blocks/feature-grid-01/feature-grid.js +24 -0
- package/dist/blocks/feature-grid-01/index.d.ts +3 -0
- package/dist/blocks/feature-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/feature-grid-01/index.js +1 -0
- package/dist/blocks/hero-01/hero.d.ts +59 -0
- package/dist/blocks/hero-01/hero.d.ts.map +1 -0
- package/dist/blocks/hero-01/hero.js +24 -0
- package/dist/blocks/hero-01/index.d.ts +2 -0
- package/dist/blocks/hero-01/index.d.ts.map +1 -0
- package/dist/blocks/hero-01/index.js +1 -0
- package/dist/blocks/index.d.ts +28 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +26 -0
- package/dist/blocks/instrument-panel-01/index.d.ts +3 -0
- package/dist/blocks/instrument-panel-01/index.d.ts.map +1 -0
- package/dist/blocks/instrument-panel-01/index.js +1 -0
- package/dist/blocks/instrument-panel-01/instrument-panel.d.ts +114 -0
- package/dist/blocks/instrument-panel-01/instrument-panel.d.ts.map +1 -0
- package/dist/blocks/instrument-panel-01/instrument-panel.js +64 -0
- package/dist/blocks/logo-strip-01/index.d.ts +3 -0
- package/dist/blocks/logo-strip-01/index.d.ts.map +1 -0
- package/dist/blocks/logo-strip-01/index.js +1 -0
- package/dist/blocks/logo-strip-01/logo-strip.d.ts +84 -0
- package/dist/blocks/logo-strip-01/logo-strip.d.ts.map +1 -0
- package/dist/blocks/logo-strip-01/logo-strip.js +40 -0
- package/dist/blocks/note-grid-01/index.d.ts +3 -0
- package/dist/blocks/note-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/note-grid-01/index.js +1 -0
- package/dist/blocks/note-grid-01/note-grid.d.ts +79 -0
- package/dist/blocks/note-grid-01/note-grid.d.ts.map +1 -0
- package/dist/blocks/note-grid-01/note-grid.js +37 -0
- package/dist/blocks/page-header-01/index.d.ts +3 -0
- package/dist/blocks/page-header-01/index.d.ts.map +1 -0
- package/dist/blocks/page-header-01/index.js +1 -0
- package/dist/blocks/page-header-01/page-header.d.ts +48 -0
- package/dist/blocks/page-header-01/page-header.d.ts.map +1 -0
- package/dist/blocks/page-header-01/page-header.js +27 -0
- package/dist/blocks/pricing-01/index.d.ts +2 -0
- package/dist/blocks/pricing-01/index.d.ts.map +1 -0
- package/dist/blocks/pricing-01/index.js +1 -0
- package/dist/blocks/pricing-01/pricing.d.ts +35 -0
- package/dist/blocks/pricing-01/pricing.d.ts.map +1 -0
- package/dist/blocks/pricing-01/pricing.js +20 -0
- package/dist/blocks/process-rail-01/index.d.ts +3 -0
- package/dist/blocks/process-rail-01/index.d.ts.map +1 -0
- package/dist/blocks/process-rail-01/index.js +1 -0
- package/dist/blocks/process-rail-01/process-rail.d.ts +99 -0
- package/dist/blocks/process-rail-01/process-rail.d.ts.map +1 -0
- package/dist/blocks/process-rail-01/process-rail.js +58 -0
- package/dist/blocks/product-grid-01/index.d.ts +3 -0
- package/dist/blocks/product-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/product-grid-01/index.js +1 -0
- package/dist/blocks/product-grid-01/product-grid.d.ts +114 -0
- package/dist/blocks/product-grid-01/product-grid.d.ts.map +1 -0
- package/dist/blocks/product-grid-01/product-grid.js +51 -0
- package/dist/blocks/settings-panel-01/index.d.ts +3 -0
- package/dist/blocks/settings-panel-01/index.d.ts.map +1 -0
- package/dist/blocks/settings-panel-01/index.js +1 -0
- package/dist/blocks/settings-panel-01/settings-panel.d.ts +71 -0
- package/dist/blocks/settings-panel-01/settings-panel.d.ts.map +1 -0
- package/dist/blocks/settings-panel-01/settings-panel.js +38 -0
- package/dist/blocks/site-footer/index.d.ts +3 -0
- package/dist/blocks/site-footer/index.d.ts.map +1 -0
- package/dist/blocks/site-footer/index.js +1 -0
- package/dist/blocks/site-footer/site-footer.d.ts +135 -0
- package/dist/blocks/site-footer/site-footer.d.ts.map +1 -0
- package/dist/blocks/site-footer/site-footer.js +41 -0
- package/dist/blocks/site-header/index.d.ts +3 -0
- package/dist/blocks/site-header/index.d.ts.map +1 -0
- package/dist/blocks/site-header/index.js +1 -0
- package/dist/blocks/site-header/site-header.d.ts +142 -0
- package/dist/blocks/site-header/site-header.d.ts.map +1 -0
- package/dist/blocks/site-header/site-header.js +46 -0
- package/dist/blocks/stack-grid-01/index.d.ts +3 -0
- package/dist/blocks/stack-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/stack-grid-01/index.js +1 -0
- package/dist/blocks/stack-grid-01/stack-grid.d.ts +118 -0
- package/dist/blocks/stack-grid-01/stack-grid.d.ts.map +1 -0
- package/dist/blocks/stack-grid-01/stack-grid.js +49 -0
- package/dist/blocks/stats-01/index.d.ts +2 -0
- package/dist/blocks/stats-01/index.d.ts.map +1 -0
- package/dist/blocks/stats-01/index.js +1 -0
- package/dist/blocks/stats-01/stats.d.ts +28 -0
- package/dist/blocks/stats-01/stats.d.ts.map +1 -0
- package/dist/blocks/stats-01/stats.js +27 -0
- package/dist/blocks/status-ledger-01/index.d.ts +3 -0
- package/dist/blocks/status-ledger-01/index.d.ts.map +1 -0
- package/dist/blocks/status-ledger-01/index.js +1 -0
- package/dist/blocks/status-ledger-01/status-ledger.d.ts +131 -0
- package/dist/blocks/status-ledger-01/status-ledger.d.ts.map +1 -0
- package/dist/blocks/status-ledger-01/status-ledger.js +80 -0
- package/dist/catalog.d.ts +28 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +672 -0
- package/dist/components/index.d.ts +64 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +43 -0
- package/dist/components/ui/accordion.d.ts +65 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +30 -0
- package/dist/components/ui/alert.d.ts +19 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +31 -0
- package/dist/components/ui/avatar.d.ts +47 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +30 -0
- package/dist/components/ui/badge.d.ts +14 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/breadcrumb.d.ts +35 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +48 -0
- package/dist/components/ui/button.d.ts +16 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +63 -0
- package/dist/components/ui/card.d.ts +41 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +53 -0
- package/dist/components/ui/checkbox.d.ts +43 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +18 -0
- package/dist/components/ui/cta-link.d.ts +45 -0
- package/dist/components/ui/cta-link.d.ts.map +1 -0
- package/dist/components/ui/cta-link.js +81 -0
- package/dist/components/ui/diagram.d.ts +154 -0
- package/dist/components/ui/diagram.d.ts.map +1 -0
- package/dist/components/ui/diagram.js +150 -0
- package/dist/components/ui/dialog.d.ts +81 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +60 -0
- package/dist/components/ui/dropdown-menu.d.ts +189 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +67 -0
- package/dist/components/ui/fact-list.d.ts +90 -0
- package/dist/components/ui/fact-list.d.ts.map +1 -0
- package/dist/components/ui/fact-list.js +38 -0
- package/dist/components/ui/field.d.ts +36 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +46 -0
- package/dist/components/ui/input.d.ts +12 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/kbd.d.ts +10 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +12 -0
- package/dist/components/ui/pagination.d.ts +40 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +49 -0
- package/dist/components/ui/popover.d.ts +56 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +25 -0
- package/dist/components/ui/product-mark.d.ts +115 -0
- package/dist/components/ui/product-mark.d.ts.map +1 -0
- package/dist/components/ui/product-mark.js +82 -0
- package/dist/components/ui/product-switcher.d.ts +108 -0
- package/dist/components/ui/product-switcher.d.ts.map +1 -0
- package/dist/components/ui/product-switcher.js +47 -0
- package/dist/components/ui/progress.d.ts +38 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +17 -0
- package/dist/components/ui/prose.d.ts +88 -0
- package/dist/components/ui/prose.d.ts.map +1 -0
- package/dist/components/ui/prose.js +53 -0
- package/dist/components/ui/radio-group.d.ts +66 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +30 -0
- package/dist/components/ui/section.d.ts +60 -0
- package/dist/components/ui/section.d.ts.map +1 -0
- package/dist/components/ui/section.js +21 -0
- package/dist/components/ui/select.d.ts +124 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +47 -0
- package/dist/components/ui/separator.d.ts +16 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/skeleton.d.ts +12 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +14 -0
- package/dist/components/ui/slider.d.ts +43 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +23 -0
- package/dist/components/ui/switch.d.ts +42 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +16 -0
- package/dist/components/ui/table.d.ts +27 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +43 -0
- package/dist/components/ui/tabs.d.ts +66 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +29 -0
- package/dist/components/ui/textarea.d.ts +11 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +13 -0
- package/dist/components/ui/tooltip.d.ts +63 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +25 -0
- package/dist/components/ui/typography.d.ts +32 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/components/ui/typography.js +51 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/dist/pages/auth-page/index.d.ts +36 -0
- package/dist/pages/auth-page/index.d.ts.map +1 -0
- package/dist/pages/auth-page/index.js +23 -0
- package/dist/pages/blog-post-page/index.d.ts +174 -0
- package/dist/pages/blog-post-page/index.d.ts.map +1 -0
- package/dist/pages/blog-post-page/index.js +49 -0
- package/dist/pages/dashboard-page/index.d.ts +36 -0
- package/dist/pages/dashboard-page/index.d.ts.map +1 -0
- package/dist/pages/dashboard-page/index.js +24 -0
- package/dist/pages/index.d.ts +21 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +14 -0
- package/dist/pages/marketing-page/index.d.ts +43 -0
- package/dist/pages/marketing-page/index.d.ts.map +1 -0
- package/dist/pages/marketing-page/index.js +25 -0
- package/dist/pages/not-found-page/index.d.ts +112 -0
- package/dist/pages/not-found-page/index.d.ts.map +1 -0
- package/dist/pages/not-found-page/index.js +46 -0
- package/dist/pages/settings-page/index.d.ts +47 -0
- package/dist/pages/settings-page/index.d.ts.map +1 -0
- package/dist/pages/settings-page/index.js +24 -0
- package/dist/provider/index.d.ts +12 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +9 -0
- package/dist/provider/provider.d.ts +42 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.js +178 -0
- package/dist/provider/theme-script.d.ts +55 -0
- package/dist/provider/theme-script.d.ts.map +1 -0
- package/dist/provider/theme-script.js +79 -0
- package/dist/styles.css +2894 -0
- package/dist/theming/index.d.ts +173 -0
- package/dist/theming/index.d.ts.map +1 -0
- package/dist/theming/index.js +186 -0
- package/package.json +89 -18
- package/components.json +0 -21
- package/public/r/badge.json +0 -26
- package/public/r/button.json +0 -26
- package/public/r/card.json +0 -25
- package/public/r/cta-01.json +0 -44
- package/public/r/feature-grid-01.json +0 -44
- package/public/r/hero-01.json +0 -44
- package/public/r/pricing-01.json +0 -46
- package/public/r/registry.json +0 -294
- package/public/r/section.json +0 -25
- package/public/r/stats-01.json +0 -44
- package/registry.json +0 -294
- package/src/components/ds/blocks/cta-01/block.json +0 -8
- package/src/components/ds/blocks/cta-01/cta.tsx +0 -62
- package/src/components/ds/blocks/cta-01/index.tsx +0 -1
- package/src/components/ds/blocks/feature-grid-01/block.json +0 -8
- package/src/components/ds/blocks/feature-grid-01/feature-grid.tsx +0 -69
- package/src/components/ds/blocks/feature-grid-01/index.tsx +0 -1
- package/src/components/ds/blocks/hero-01/block.json +0 -8
- package/src/components/ds/blocks/hero-01/hero.tsx +0 -85
- package/src/components/ds/blocks/hero-01/index.tsx +0 -1
- package/src/components/ds/blocks/pricing-01/block.json +0 -8
- package/src/components/ds/blocks/pricing-01/index.tsx +0 -1
- package/src/components/ds/blocks/pricing-01/pricing.tsx +0 -122
- package/src/components/ds/blocks/section.meta.json +0 -6
- package/src/components/ds/blocks/section.tsx +0 -86
- package/src/components/ds/blocks/stats-01/block.json +0 -8
- package/src/components/ds/blocks/stats-01/index.tsx +0 -1
- package/src/components/ds/blocks/stats-01/stats.tsx +0 -92
- package/src/components/ui/badge.tsx +0 -37
- package/src/components/ui/button.tsx +0 -77
- package/src/components/ui/card.tsx +0 -65
- package/src/lib/utils.ts +0 -6
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
type PaginationSize = 'default' | 'sm' | 'lg' | 'icon';
|
|
3
|
+
/**
|
|
4
|
+
* The control that moves between pages of a paged collection.
|
|
5
|
+
*
|
|
6
|
+
* The root is a `<nav>` with an accessible name, so the page links are grouped
|
|
7
|
+
* as one navigation region.
|
|
8
|
+
*/
|
|
9
|
+
declare function Pagination({ className, ...props }: ComponentProps<'nav'>): import("react").JSX.Element;
|
|
10
|
+
/** The list that holds the page links. */
|
|
11
|
+
declare function PaginationContent({ className, ...props }: ComponentProps<'ul'>): import("react").JSX.Element;
|
|
12
|
+
/** One slot in the list: a page link, a step control or an ellipsis. */
|
|
13
|
+
declare function PaginationItem({ className, ...props }: ComponentProps<'li'>): import("react").JSX.Element;
|
|
14
|
+
/**
|
|
15
|
+
* A link to one page.
|
|
16
|
+
*
|
|
17
|
+
* Renders a native `<a>`; set `isActive` on the current page so it is marked
|
|
18
|
+
* with `aria-current="page"`.
|
|
19
|
+
*/
|
|
20
|
+
declare function PaginationLink({ className, isActive, size, ...props }: ComponentProps<'a'> & {
|
|
21
|
+
isActive?: boolean;
|
|
22
|
+
size?: PaginationSize;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
/** The step back to the previous page, with a hidden label on narrow layouts. */
|
|
25
|
+
declare function PaginationPrevious({ className, text, ...props }: ComponentProps<typeof PaginationLink> & {
|
|
26
|
+
text?: string;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
/** The step forward to the next page, with a hidden label on narrow layouts. */
|
|
29
|
+
declare function PaginationNext({ className, text, ...props }: ComponentProps<typeof PaginationLink> & {
|
|
30
|
+
text?: string;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* A held-back run of page numbers.
|
|
34
|
+
*
|
|
35
|
+
* It is hidden from assistive technology because the page links around it
|
|
36
|
+
* already name the range, and it is not focusable.
|
|
37
|
+
*/
|
|
38
|
+
declare function PaginationEllipsis({ className, ...props }: ComponentProps<'span'>): import("react").JSX.Element;
|
|
39
|
+
export { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
40
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +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;;;;;GAKG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,KAAK,CAAC,+BASjE;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,iFAAiF;AACjF,iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,IAAiB,EACjB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAY3D;AAED,gFAAgF;AAChF,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,IAAa,EACb,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,cAAc,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,+BAY3D;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"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
/**
|
|
5
|
+
* The control that moves between pages of a paged collection.
|
|
6
|
+
*
|
|
7
|
+
* The root is a `<nav>` with an accessible name, so the page links are grouped
|
|
8
|
+
* as one navigation region.
|
|
9
|
+
*/
|
|
10
|
+
function Pagination({ className, ...props }) {
|
|
11
|
+
return (_jsx("nav", { "aria-label": "Pagination", "data-slot": "pagination", className: cn('mx-auto flex w-full justify-center', className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
/** The list that holds the page links. */
|
|
14
|
+
function PaginationContent({ className, ...props }) {
|
|
15
|
+
return (_jsx("ul", { "data-slot": "pagination-content", className: cn('flex flex-row items-center gap-1', className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
/** One slot in the list: a page link, a step control or an ellipsis. */
|
|
18
|
+
function PaginationItem({ className, ...props }) {
|
|
19
|
+
return _jsx("li", { "data-slot": "pagination-item", className: cn(className), ...props });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A link to one page.
|
|
23
|
+
*
|
|
24
|
+
* Renders a native `<a>`; set `isActive` on the current page so it is marked
|
|
25
|
+
* with `aria-current="page"`.
|
|
26
|
+
*/
|
|
27
|
+
function PaginationLink({ className, isActive, size = 'icon', ...props }) {
|
|
28
|
+
return (_jsx("a", { "aria-current": isActive ? 'page' : undefined, "data-slot": "pagination-link", "data-active": isActive ? 'true' : undefined, className: cn('inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap outline-none transition-colors duration-fast ease-out focus-visible:ring-ring focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50', size === 'default' && 'h-9 px-4 py-2', size === 'sm' && 'h-8 px-3', size === 'lg' && 'h-10 px-6', size === 'icon' && 'size-9', isActive
|
|
29
|
+
? 'border-border bg-background text-foreground border'
|
|
30
|
+
: 'text-foreground hover:bg-accent hover:text-accent-foreground', className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
/** The step back to the previous page, with a hidden label on narrow layouts. */
|
|
33
|
+
function PaginationPrevious({ className, text = 'Previous', ...props }) {
|
|
34
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to the previous page", 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
|
+
}
|
|
36
|
+
/** The step forward to the next page, with a hidden label on narrow layouts. */
|
|
37
|
+
function PaginationNext({ className, text = 'Next', ...props }) {
|
|
38
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to the next page", 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
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A held-back run of page numbers.
|
|
42
|
+
*
|
|
43
|
+
* It is hidden from assistive technology because the page links around it
|
|
44
|
+
* already name the range, and it is not focusable.
|
|
45
|
+
*/
|
|
46
|
+
function PaginationEllipsis({ className, ...props }) {
|
|
47
|
+
return (_jsx("span", { "data-slot": "pagination-ellipsis", "aria-hidden": "true", className: cn('flex size-9 items-center justify-center', className), ...props, children: _jsx(MoreHorizontal, { className: "size-4" }) }));
|
|
48
|
+
}
|
|
49
|
+
export { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props the Popover root forwards to Base UI.
|
|
4
|
+
*
|
|
5
|
+
* Declared here rather than re-exported from Base UI so no upstream type
|
|
6
|
+
* crosses the package seam (ticket 07 section 6).
|
|
7
|
+
*/
|
|
8
|
+
export interface PopoverProps {
|
|
9
|
+
/** The controlled open state. */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** The initially open state, for an uncontrolled popover. */
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
/** Called when the open state changes. */
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
/** Whether the popover traps interaction while open. @defaultValue false */
|
|
16
|
+
modal?: boolean | 'trap-focus';
|
|
17
|
+
/** The trigger and content. */
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/** The props PopoverTrigger forwards to Base UI. */
|
|
21
|
+
export interface PopoverTriggerProps extends ComponentProps<'button'> {
|
|
22
|
+
/** Whether the trigger should also open the popover on hover. */
|
|
23
|
+
openOnHover?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The props PopoverContent forwards to Base UI.
|
|
27
|
+
*
|
|
28
|
+
* Declared here rather than re-exported from Base UI so no upstream type
|
|
29
|
+
* crosses the package seam (ticket 07 section 6).
|
|
30
|
+
*/
|
|
31
|
+
export interface PopoverContentProps extends ComponentProps<'div'> {
|
|
32
|
+
/** Which side of the trigger the popover is placed on. @defaultValue bottom */
|
|
33
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
34
|
+
/** How the popover aligns against the trigger. @defaultValue center */
|
|
35
|
+
align?: 'start' | 'center' | 'end';
|
|
36
|
+
/** The distance in pixels between the trigger and the popover. @defaultValue 4 */
|
|
37
|
+
sideOffset?: number;
|
|
38
|
+
/** The offset in pixels along the alignment axis. @defaultValue 0 */
|
|
39
|
+
alignOffset?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A floating surface opened by a trigger.
|
|
43
|
+
*
|
|
44
|
+
* Use a Popover for content that is richer than a tooltip but not a full
|
|
45
|
+
* screen: a settings form, a filter panel, a small detail view. It is
|
|
46
|
+
* dismissible with Escape and an outside press, and it returns focus to the
|
|
47
|
+
* trigger when it closes. Do not put a required step in a Popover, because an
|
|
48
|
+
* outside press can close it.
|
|
49
|
+
*/
|
|
50
|
+
declare function Popover({ ...props }: PopoverProps): import("react").JSX.Element;
|
|
51
|
+
/** The element that opens the popover. */
|
|
52
|
+
declare function PopoverTrigger({ className, ...props }: PopoverTriggerProps): import("react").JSX.Element;
|
|
53
|
+
/** The floating popover surface. */
|
|
54
|
+
declare function PopoverContent({ className, side, align, sideOffset, alignOffset, children, ...props }: PopoverContentProps): import("react").JSX.Element;
|
|
55
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
56
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/ui/popover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,GAAG,YAAY,CAAA;IAC9B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,oDAAoD;AACpD,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IACnE,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,KAAK,CAAC;IAChE,+EAA+E;IAC/E,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1C,uEAAuE;IACvE,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,iBAAS,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAE1C;AAED,0CAA0C;AAC1C,iBAAS,cAAc,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAcnE;AAED,oCAAoC;AACpC,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,IAAe,EACf,KAAgB,EAChB,UAAc,EACd,WAAe,EACf,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,mBAAmB,+BA0BrB;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
/**
|
|
6
|
+
* A floating surface opened by a trigger.
|
|
7
|
+
*
|
|
8
|
+
* Use a Popover for content that is richer than a tooltip but not a full
|
|
9
|
+
* screen: a settings form, a filter panel, a small detail view. It is
|
|
10
|
+
* dismissible with Escape and an outside press, and it returns focus to the
|
|
11
|
+
* trigger when it closes. Do not put a required step in a Popover, because an
|
|
12
|
+
* outside press can close it.
|
|
13
|
+
*/
|
|
14
|
+
function Popover({ ...props }) {
|
|
15
|
+
return _jsx(PopoverPrimitive.Root, { ...props });
|
|
16
|
+
}
|
|
17
|
+
/** The element that opens the popover. */
|
|
18
|
+
function PopoverTrigger({ className, ...props }) {
|
|
19
|
+
return (_jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-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 }));
|
|
20
|
+
}
|
|
21
|
+
/** The floating popover surface. */
|
|
22
|
+
function PopoverContent({ className, side = 'bottom', align = 'center', sideOffset = 4, alignOffset = 0, children, ...props }) {
|
|
23
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Positioner, { side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, className: "z-50", children: _jsx(PopoverPrimitive.Popup, { "data-slot": "popover-content", className: cn('bg-popover text-popover-foreground z-50 w-72 rounded-md border p-4 shadow-md outline-none', 'transition-[opacity,transform] duration-fast ease-out', 'data-[starting-style]:scale-95 data-[starting-style]:opacity-0', 'data-[ending-style]:scale-95 data-[ending-style]:opacity-0', className), ...props, children: children }) }) }));
|
|
24
|
+
}
|
|
25
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { PackId } from '../../theming';
|
|
2
|
+
/**
|
|
3
|
+
* The three sizes a product mark is drawn at: the mark's diameter and the name
|
|
4
|
+
* beside it, taken together so the two parts of the mark stay in proportion.
|
|
5
|
+
*
|
|
6
|
+
* The mark is one of a fixed set rather than something a caller sizes through
|
|
7
|
+
* `className`, because `className` is layout only and a mark sized by a layout
|
|
8
|
+
* class is a mark the layout owns. A product set shows its marks in a switcher,
|
|
9
|
+
* in a row and on a page header, and those three are the sizes a set needs.
|
|
10
|
+
*/
|
|
11
|
+
declare const SIZES: {
|
|
12
|
+
readonly sm: {
|
|
13
|
+
readonly mark: "size-4";
|
|
14
|
+
readonly name: "text-xs";
|
|
15
|
+
};
|
|
16
|
+
readonly md: {
|
|
17
|
+
readonly mark: "size-5";
|
|
18
|
+
readonly name: "text-sm";
|
|
19
|
+
};
|
|
20
|
+
readonly lg: {
|
|
21
|
+
readonly mark: "size-6";
|
|
22
|
+
readonly name: "text-base";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The three sizes a product mark is drawn at.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue 'md'
|
|
29
|
+
*/
|
|
30
|
+
export type ProductMarkSize = keyof typeof SIZES;
|
|
31
|
+
/**
|
|
32
|
+
* The props a ProductMark takes.
|
|
33
|
+
*
|
|
34
|
+
* There is no product directory in this package. A product's identity is the
|
|
35
|
+
* consumer's data, so the Component takes the three facts the mark is drawn
|
|
36
|
+
* from and owns none of them: `id` for the markup, `name` for the second part,
|
|
37
|
+
* and `pack` for the hue. Where the set of products is published is the
|
|
38
|
+
* consumer's decision, and Prism ships the mark rather than a list of products.
|
|
39
|
+
*/
|
|
40
|
+
export type ProductMarkProps = {
|
|
41
|
+
/**
|
|
42
|
+
* The product's key within the set it is distinguished in. It is carried on
|
|
43
|
+
* the markup as `data-product` so a test can name one mark rather than the
|
|
44
|
+
* first one, and so two marks in one document are individually addressable.
|
|
45
|
+
*/
|
|
46
|
+
id: string;
|
|
47
|
+
/**
|
|
48
|
+
* The product's name, which is the mark's second part and the word that
|
|
49
|
+
* carries the identity. The mark sets it in `brand-ink` rather than in
|
|
50
|
+
* `foreground`, which is DESIGN.md's Brand Ink Rule: a name that has to read
|
|
51
|
+
* as the brand reads `brand-ink`, and `foreground` is a tinted neutral with
|
|
52
|
+
* almost no chroma by design.
|
|
53
|
+
*/
|
|
54
|
+
name: string;
|
|
55
|
+
/**
|
|
56
|
+
* The product's pack, which is the mark's hue. Omit it, or pass `null`, for
|
|
57
|
+
* the one entry in a set that has no pack of its own: that entry is drawn as
|
|
58
|
+
* the full spectrum rather than as a colourless mark. See `SPECTRUM` above.
|
|
59
|
+
*
|
|
60
|
+
* `default` is a real answer and not the same as the empty one. The base pack
|
|
61
|
+
* is a pack a product can wear, and it is the absence of a `data-pack`
|
|
62
|
+
* attribute, so a product whose pack is `default` carries no attribute and its
|
|
63
|
+
* core resolves the base pack's `primary` from the page.
|
|
64
|
+
*/
|
|
65
|
+
pack?: PackId | null;
|
|
66
|
+
/**
|
|
67
|
+
* Which of the three drawn sizes to use. @defaultValue 'md'
|
|
68
|
+
*/
|
|
69
|
+
size?: ProductMarkSize;
|
|
70
|
+
/**
|
|
71
|
+
* Layout only, exactly as on every Component. Changing a Prism-owned visual
|
|
72
|
+
* property from here is prohibited, and this Component spreads no other prop,
|
|
73
|
+
* so there is no second route to its ink.
|
|
74
|
+
*/
|
|
75
|
+
className?: string;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* A product's two-part colour mark: a hairline ring in the brand ink around a
|
|
79
|
+
* core in the pack's own fill, beside the product's name in the brand ink.
|
|
80
|
+
*
|
|
81
|
+
* Two parts, and both colours come from tokens, which is the whole reason this
|
|
82
|
+
* is promoted out of the two hand-written copies it replaces. The ring is
|
|
83
|
+
* `brand-ink`, the pack's brand hue as a stroke; the core is `primary`, the
|
|
84
|
+
* pack's brand value as a fill. That split is not a preference. DESIGN.md's Fill,
|
|
85
|
+
* Not the Ink Rule says a pastel brand value is a fill and never text, so the
|
|
86
|
+
* core may be `primary` and the name may not, and the Brand Ink Rule says the
|
|
87
|
+
* name reads `brand-ink` rather than `foreground` or `primary-foreground`. A
|
|
88
|
+
* hand-written copy gets one of those two wrong and nothing in the rendered
|
|
89
|
+
* result says which.
|
|
90
|
+
*
|
|
91
|
+
* Uniqueness across the set comes from the pack: each product wears its own
|
|
92
|
+
* pack's hue, and the one entry with no pack wears the spectrum, so no two marks
|
|
93
|
+
* in a set resolve to the same pair of colours. The set is the consumer's data.
|
|
94
|
+
* This Component draws one member of it, and it is the same member wherever it is
|
|
95
|
+
* drawn from.
|
|
96
|
+
*
|
|
97
|
+
* The mark carries its own `data-pack` boundary on its root, so a product's hue
|
|
98
|
+
* follows from the pack the caller passed rather than from whichever pack the
|
|
99
|
+
* page happens to be wearing, and a boundary lands on the mark rather than on
|
|
100
|
+
* whatever encloses it. The boundary is on a span carrying no radius utility,
|
|
101
|
+
* which is one of the two placements DESIGN.md's pack-boundary law allows, and
|
|
102
|
+
* the disc itself is fully rounded. Nothing about the mark's shape moves when a
|
|
103
|
+
* pack boundary lands above it, which is the half of that law a consumer
|
|
104
|
+
* implementing only the colour half gets wrong.
|
|
105
|
+
*
|
|
106
|
+
* It is a server Component: no hook, no mode, no context, no client code and no
|
|
107
|
+
* `'use client'` line. A consumer renders it from a server file and needs
|
|
108
|
+
* nothing from the provider mounted.
|
|
109
|
+
*
|
|
110
|
+
* The disc is `aria-hidden` and the name is not, so the mark adds a shape beside
|
|
111
|
+
* the word rather than a second reading of it.
|
|
112
|
+
*/
|
|
113
|
+
declare function ProductMark({ id, name, pack, size, className }: ProductMarkProps): import("react").JSX.Element;
|
|
114
|
+
export { ProductMark };
|
|
115
|
+
//# sourceMappingURL=product-mark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-mark.d.ts","sourceRoot":"","sources":["../../../src/components/ui/product-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AA2B3C;;;;;;;;GAQG;AACH,QAAA,MAAM,KAAK;;;;;;;;;;;;;CAID,CAAA;AAEV;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,KAAK,CAAA;AAEhD;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,iBAAS,WAAW,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BA2BhF;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../../lib/utils';
|
|
3
|
+
/**
|
|
4
|
+
* The full spectrum, as the five series tokens and nothing else.
|
|
5
|
+
*
|
|
6
|
+
* A product with no pack of its own is the one entry in a product set that has
|
|
7
|
+
* no single hue, and the standing decision is that it wears the spectrum rather
|
|
8
|
+
* than a colourless mark: a colourless dot reads as a product with no identity,
|
|
9
|
+
* which is the one thing such an entry is not. This line is that decision
|
|
10
|
+
* translated into the current contract.
|
|
11
|
+
*
|
|
12
|
+
* The stops are `chart-1` through `chart-5` because they are the only five-way
|
|
13
|
+
* colour set the token contract publishes, and because `chart-1` starts at the
|
|
14
|
+
* page's own pack hue, so a sweep drawn under a scoped boundary begins in that
|
|
15
|
+
* pack and moves out of it. `chart-1` closes the wheel so the sweep has no seam
|
|
16
|
+
* at 0 degrees.
|
|
17
|
+
*
|
|
18
|
+
* It is the one gradient in the shipped surface. The geometry is Tailwind's and
|
|
19
|
+
* the colour stops are semantic, which is the only gradient DESIGN.md allows,
|
|
20
|
+
* and the element it paints is `aria-hidden`: a gradient is never the carrier of
|
|
21
|
+
* a name, and this one is not.
|
|
22
|
+
*/
|
|
23
|
+
const SPECTRUM = 'bg-[conic-gradient(var(--chart-1),var(--chart-2),var(--chart-3),var(--chart-4),var(--chart-5),var(--chart-1))]';
|
|
24
|
+
/**
|
|
25
|
+
* The three sizes a product mark is drawn at: the mark's diameter and the name
|
|
26
|
+
* beside it, taken together so the two parts of the mark stay in proportion.
|
|
27
|
+
*
|
|
28
|
+
* The mark is one of a fixed set rather than something a caller sizes through
|
|
29
|
+
* `className`, because `className` is layout only and a mark sized by a layout
|
|
30
|
+
* class is a mark the layout owns. A product set shows its marks in a switcher,
|
|
31
|
+
* in a row and on a page header, and those three are the sizes a set needs.
|
|
32
|
+
*/
|
|
33
|
+
const SIZES = {
|
|
34
|
+
sm: { mark: 'size-4', name: 'text-xs' },
|
|
35
|
+
md: { mark: 'size-5', name: 'text-sm' },
|
|
36
|
+
lg: { mark: 'size-6', name: 'text-base' },
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A product's two-part colour mark: a hairline ring in the brand ink around a
|
|
40
|
+
* core in the pack's own fill, beside the product's name in the brand ink.
|
|
41
|
+
*
|
|
42
|
+
* Two parts, and both colours come from tokens, which is the whole reason this
|
|
43
|
+
* is promoted out of the two hand-written copies it replaces. The ring is
|
|
44
|
+
* `brand-ink`, the pack's brand hue as a stroke; the core is `primary`, the
|
|
45
|
+
* pack's brand value as a fill. That split is not a preference. DESIGN.md's Fill,
|
|
46
|
+
* Not the Ink Rule says a pastel brand value is a fill and never text, so the
|
|
47
|
+
* core may be `primary` and the name may not, and the Brand Ink Rule says the
|
|
48
|
+
* name reads `brand-ink` rather than `foreground` or `primary-foreground`. A
|
|
49
|
+
* hand-written copy gets one of those two wrong and nothing in the rendered
|
|
50
|
+
* result says which.
|
|
51
|
+
*
|
|
52
|
+
* Uniqueness across the set comes from the pack: each product wears its own
|
|
53
|
+
* pack's hue, and the one entry with no pack wears the spectrum, so no two marks
|
|
54
|
+
* in a set resolve to the same pair of colours. The set is the consumer's data.
|
|
55
|
+
* This Component draws one member of it, and it is the same member wherever it is
|
|
56
|
+
* drawn from.
|
|
57
|
+
*
|
|
58
|
+
* The mark carries its own `data-pack` boundary on its root, so a product's hue
|
|
59
|
+
* follows from the pack the caller passed rather than from whichever pack the
|
|
60
|
+
* page happens to be wearing, and a boundary lands on the mark rather than on
|
|
61
|
+
* whatever encloses it. The boundary is on a span carrying no radius utility,
|
|
62
|
+
* which is one of the two placements DESIGN.md's pack-boundary law allows, and
|
|
63
|
+
* the disc itself is fully rounded. Nothing about the mark's shape moves when a
|
|
64
|
+
* pack boundary lands above it, which is the half of that law a consumer
|
|
65
|
+
* implementing only the colour half gets wrong.
|
|
66
|
+
*
|
|
67
|
+
* It is a server Component: no hook, no mode, no context, no client code and no
|
|
68
|
+
* `'use client'` line. A consumer renders it from a server file and needs
|
|
69
|
+
* nothing from the provider mounted.
|
|
70
|
+
*
|
|
71
|
+
* The disc is `aria-hidden` and the name is not, so the mark adds a shape beside
|
|
72
|
+
* the word rather than a second reading of it.
|
|
73
|
+
*/
|
|
74
|
+
function ProductMark({ id, name, pack, size = 'md', className }) {
|
|
75
|
+
const drawn = SIZES[size];
|
|
76
|
+
// `default` is the absence of a pack id, spelled the way the token build
|
|
77
|
+
// spells it, so a base-pack product resolves `primary` from the page rather
|
|
78
|
+
// than from an attribute that matches no emitted rule.
|
|
79
|
+
const boundary = pack && pack !== 'default' ? pack : undefined;
|
|
80
|
+
return (_jsxs("span", { "data-slot": "product-mark", "data-pack": boundary, className: cn('inline-flex items-center gap-2', className), children: [_jsx("span", { "data-slot": "product-mark-disc", "data-product": id, "aria-hidden": true, className: cn('inline-block shrink-0 rounded-full border border-brand-ink', drawn.mark, pack ? 'bg-primary' : SPECTRUM) }), _jsx("span", { "data-slot": "product-mark-name", className: cn('font-medium text-brand-ink', drawn.name), children: name })] }));
|
|
81
|
+
}
|
|
82
|
+
export { ProductMark };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { type ProductMarkProps, type ProductMarkSize } from './product-mark';
|
|
3
|
+
/**
|
|
4
|
+
* One product in the set a switcher moves between.
|
|
5
|
+
*
|
|
6
|
+
* The three facts the mark is drawn from, and no directory. Which products exist
|
|
7
|
+
* is the consumer's decision: Prism ships the mark and the switch that reads it,
|
|
8
|
+
* not a list of NaniSoft's products, so a consumer composing a set of its own
|
|
9
|
+
* does not have to name them here to be able to switch between them.
|
|
10
|
+
*/
|
|
11
|
+
export type SwitcherProduct = {
|
|
12
|
+
/**
|
|
13
|
+
* The product's key within the set. It is carried on the markup as
|
|
14
|
+
* `data-product` through `ProductMark`, so a test can name one member rather
|
|
15
|
+
* than the first one, and two members in one document are addressable.
|
|
16
|
+
*/
|
|
17
|
+
id: string;
|
|
18
|
+
/** The product's own name, which is the second part of its mark. */
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* The product's pack, which is the hue of its mark. Omit it, or pass `null`, for
|
|
22
|
+
* the one member of a set that has no pack of its own: that member is drawn as
|
|
23
|
+
* the full spectrum rather than as a colourless mark.
|
|
24
|
+
*/
|
|
25
|
+
pack?: ProductMarkProps['pack'];
|
|
26
|
+
/**
|
|
27
|
+
* Where the member goes. Required, because a switcher whose members do not go
|
|
28
|
+
* anywhere is a list of labels.
|
|
29
|
+
*/
|
|
30
|
+
href: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The props a ProductSwitcher takes.
|
|
34
|
+
*
|
|
35
|
+
* There is no `current` requirement: a switcher marks the member the reader is on
|
|
36
|
+
* with `aria-current="page"`, and the caller's own router is what knows that. The
|
|
37
|
+
* member is passed as `currentId` and the switcher marks it; nothing here is a
|
|
38
|
+
* router and nothing here decides where a link goes.
|
|
39
|
+
*/
|
|
40
|
+
export type ProductSwitcherProps = Omit<ComponentProps<'nav'>, 'children'> & {
|
|
41
|
+
/**
|
|
42
|
+
* The set to move between, in the order a reader should meet it. Order is the
|
|
43
|
+
* caller's because it is a claim about which product matters first.
|
|
44
|
+
*/
|
|
45
|
+
products: readonly SwitcherProduct[];
|
|
46
|
+
/**
|
|
47
|
+
* The `id` of the member the reader is on. Marked `aria-current="page"`, which
|
|
48
|
+
* is how a reader and a screen reader both know where they are. Omit it when
|
|
49
|
+
* the switcher is rendered on a page that is not one of the members.
|
|
50
|
+
*/
|
|
51
|
+
currentId?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The drawn size of every mark, so a set shows one size rather than a mix. See
|
|
54
|
+
* `ProductMarkSize`.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue 'sm'
|
|
57
|
+
*/
|
|
58
|
+
size?: ProductMarkSize;
|
|
59
|
+
/**
|
|
60
|
+
* A heading for the set, for a switcher that is not inside a landmark the
|
|
61
|
+
* reader can already name. Rendered as the navigation's accessible name and as
|
|
62
|
+
* no visible text, because the marks beside it are the labels.
|
|
63
|
+
*/
|
|
64
|
+
label?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Layout only, exactly as on every Component. Changing a Prism-owned visual
|
|
67
|
+
* property from here is prohibited.
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* A switch between the members of a set of products.
|
|
73
|
+
*
|
|
74
|
+
* One job: let a reader who is in one product move to another, and say which one
|
|
75
|
+
* they are in. All four NaniSoft sites need it and each one wrote it: the
|
|
76
|
+
* company's own site moves between its products from a row of coloured dots, and
|
|
77
|
+
* each product site names its siblings in its header. The mark is `ProductMark`,
|
|
78
|
+
* so the two parts of a member's identity - the ring in the brand ink and the
|
|
79
|
+
* core in its own pack fill - are the same two colours wherever the member is
|
|
80
|
+
* drawn, in a switcher, in a row or on a page header.
|
|
81
|
+
*
|
|
82
|
+
* It is a Component rather than a Block because a switcher is not a region of a
|
|
83
|
+
* page: it is a control that appears in one, it fetches nothing, and every
|
|
84
|
+
* member of the set is a prop. The header that carries it is a Block, and it
|
|
85
|
+
* composes this.
|
|
86
|
+
*
|
|
87
|
+
* **The current member is marked, not styled.** A switcher that only colours the
|
|
88
|
+
* current member is a switcher a colourblind reader cannot use and a screen
|
|
89
|
+
* reader cannot read at all, so the current member carries `aria-current="page"`
|
|
90
|
+
* and Prism's focus ring comes from the browser's own link behaviour. There is
|
|
91
|
+
* no `variant` for the current member and no way to override the marking, which
|
|
92
|
+
* is the whole reason this is a Component rather than a list of anchors the
|
|
93
|
+
* caller writes.
|
|
94
|
+
*
|
|
95
|
+
* The set is a `nav` with an accessible name rather than a bare list of links,
|
|
96
|
+
* because a set of links that move between sections of one product is a
|
|
97
|
+
* navigation region and a screen reader should say so. `label` names it; the
|
|
98
|
+
* default name is `Products`, and a consumer whose set is not products passes
|
|
99
|
+
* its own word rather than accepting a claim about what its set is.
|
|
100
|
+
*
|
|
101
|
+
* It is a server Component: no hook, no context, no state and no client code,
|
|
102
|
+
* so a switcher in a static page costs no JavaScript at all. A consumer that
|
|
103
|
+
* wants a menu rather than a row of marks composes `DropdownMenu` with the marks
|
|
104
|
+
* and does not use this.
|
|
105
|
+
*/
|
|
106
|
+
declare function ProductSwitcher({ products, currentId, size, label, className, ...props }: ProductSwitcherProps): import("react").JSX.Element | null;
|
|
107
|
+
export { ProductSwitcher };
|
|
108
|
+
//# sourceMappingURL=product-switcher.d.ts.map
|
|
@@ -0,0 +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;;;;OAIG;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,KAAkB,EAClB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,oBAAoB,sCA+BtB;AAED,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ProductMark } from './product-mark';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
/**
|
|
5
|
+
* A switch between the members of a set of products.
|
|
6
|
+
*
|
|
7
|
+
* One job: let a reader who is in one product move to another, and say which one
|
|
8
|
+
* they are in. All four NaniSoft sites need it and each one wrote it: the
|
|
9
|
+
* company's own site moves between its products from a row of coloured dots, and
|
|
10
|
+
* each product site names its siblings in its header. The mark is `ProductMark`,
|
|
11
|
+
* so the two parts of a member's identity - the ring in the brand ink and the
|
|
12
|
+
* core in its own pack fill - are the same two colours wherever the member is
|
|
13
|
+
* drawn, in a switcher, in a row or on a page header.
|
|
14
|
+
*
|
|
15
|
+
* It is a Component rather than a Block because a switcher is not a region of a
|
|
16
|
+
* page: it is a control that appears in one, it fetches nothing, and every
|
|
17
|
+
* member of the set is a prop. The header that carries it is a Block, and it
|
|
18
|
+
* composes this.
|
|
19
|
+
*
|
|
20
|
+
* **The current member is marked, not styled.** A switcher that only colours the
|
|
21
|
+
* current member is a switcher a colourblind reader cannot use and a screen
|
|
22
|
+
* reader cannot read at all, so the current member carries `aria-current="page"`
|
|
23
|
+
* and Prism's focus ring comes from the browser's own link behaviour. There is
|
|
24
|
+
* no `variant` for the current member and no way to override the marking, which
|
|
25
|
+
* is the whole reason this is a Component rather than a list of anchors the
|
|
26
|
+
* caller writes.
|
|
27
|
+
*
|
|
28
|
+
* The set is a `nav` with an accessible name rather than a bare list of links,
|
|
29
|
+
* because a set of links that move between sections of one product is a
|
|
30
|
+
* navigation region and a screen reader should say so. `label` names it; the
|
|
31
|
+
* default name is `Products`, and a consumer whose set is not products passes
|
|
32
|
+
* its own word rather than accepting a claim about what its set is.
|
|
33
|
+
*
|
|
34
|
+
* It is a server Component: no hook, no context, no state and no client code,
|
|
35
|
+
* so a switcher in a static page costs no JavaScript at all. A consumer that
|
|
36
|
+
* wants a menu rather than a row of marks composes `DropdownMenu` with the marks
|
|
37
|
+
* and does not use this.
|
|
38
|
+
*/
|
|
39
|
+
function ProductSwitcher({ products, currentId, size = 'sm', label = 'Products', className, ...props }) {
|
|
40
|
+
if (products.length === 0)
|
|
41
|
+
return null;
|
|
42
|
+
return (_jsx("nav", { "data-slot": "product-switcher", "aria-label": label, className: cn('flex flex-wrap items-center gap-x-4 gap-y-2', className), ...props, children: products.map((product) => {
|
|
43
|
+
const current = product.id === currentId;
|
|
44
|
+
return (_jsx("a", { href: product.href, "aria-current": current ? 'page' : undefined, "data-current": current ? 'true' : undefined, className: "rounded-sm transition-opacity duration-fast ease-out hover:opacity-80", children: _jsx(ProductMark, { id: product.id, name: product.name, pack: product.pack, size: size }) }, product.id));
|
|
45
|
+
}) }));
|
|
46
|
+
}
|
|
47
|
+
export { ProductSwitcher };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The props the Progress forwards to its Base UI root.
|
|
4
|
+
*
|
|
5
|
+
* Declared here rather than re-exported from Base UI so no upstream type
|
|
6
|
+
* crosses the package seam (ticket 07 section 6).
|
|
7
|
+
*/
|
|
8
|
+
export interface ProgressProps extends ComponentProps<'div'> {
|
|
9
|
+
/**
|
|
10
|
+
* The current value. Pass `null` for an indeterminate task.
|
|
11
|
+
*
|
|
12
|
+
* There is no default: a progress bar without a value is a claim, so the
|
|
13
|
+
* consumer states where the task is.
|
|
14
|
+
*/
|
|
15
|
+
value: number | null;
|
|
16
|
+
/** The maximum value. @defaultValue 100 */
|
|
17
|
+
max?: number;
|
|
18
|
+
/** The minimum value. @defaultValue 0 */
|
|
19
|
+
min?: number;
|
|
20
|
+
/** Options passed to `Intl.NumberFormat` when the value is rendered. */
|
|
21
|
+
format?: Intl.NumberFormatOptions;
|
|
22
|
+
/** The locale used when formatting the value. */
|
|
23
|
+
locale?: Intl.LocalesArgument;
|
|
24
|
+
/** Returns the text alternative announced for a value. */
|
|
25
|
+
getAriaValueText?: (formattedValue: string, value: number | null) => string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A bar that reports how far a task has progressed.
|
|
29
|
+
*
|
|
30
|
+
* The bar exposes its value, minimum and maximum through ARIA, so a screen
|
|
31
|
+
* reader announces the position rather than the pixels. It is a status, not a
|
|
32
|
+
* control: the reader watches it, and an interrupting task uses an Alert
|
|
33
|
+
* instead. Pass `value={null}` for a task of unknown length, where the bar is
|
|
34
|
+
* announced as indeterminate.
|
|
35
|
+
*/
|
|
36
|
+
declare function Progress({ className, ...props }: ProgressProps): import("react").JSX.Element;
|
|
37
|
+
export { Progress };
|
|
38
|
+
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/components/ui/progress.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC1D;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,2CAA2C;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wEAAwE;IACxE,MAAM,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAA;IACjC,iDAAiD;IACjD,MAAM,CAAC,EAAE,IAAI,CAAC,eAAe,CAAA;IAC7B,0DAA0D;IAC1D,gBAAgB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;CAC5E;AAED;;;;;;;;GAQG;AACH,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,+BAkBvD;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Progress as ProgressPrimitive } from '@base-ui/react/progress';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
/**
|
|
6
|
+
* A bar that reports how far a task has progressed.
|
|
7
|
+
*
|
|
8
|
+
* The bar exposes its value, minimum and maximum through ARIA, so a screen
|
|
9
|
+
* reader announces the position rather than the pixels. It is a status, not a
|
|
10
|
+
* control: the reader watches it, and an interrupting task uses an Alert
|
|
11
|
+
* instead. Pass `value={null}` for a task of unknown length, where the bar is
|
|
12
|
+
* announced as indeterminate.
|
|
13
|
+
*/
|
|
14
|
+
function Progress({ className, ...props }) {
|
|
15
|
+
return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", className: cn('flex w-full flex-col gap-2', className), ...props, children: _jsx(ProgressPrimitive.Track, { "data-slot": "progress-track", className: "bg-muted relative h-2 w-full overflow-hidden rounded-full", children: _jsx(ProgressPrimitive.Indicator, { "data-slot": "progress-indicator", className: "bg-primary h-full rounded-full transition-[width] duration-base ease-out" }) }) }));
|
|
16
|
+
}
|
|
17
|
+
export { Progress };
|