@inshorts/glint-ui 0.5.4 → 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/README.md +3 -1
- package/dist/alert.cjs +96 -0
- package/dist/alert.cjs.map +1 -0
- package/dist/alert.d.cts +29 -0
- package/dist/alert.d.ts +29 -0
- package/dist/alert.js +10 -0
- package/dist/alert.js.map +1 -0
- package/dist/autocomplete.cjs +578 -0
- package/dist/autocomplete.cjs.map +1 -0
- package/dist/autocomplete.d.cts +56 -0
- package/dist/autocomplete.d.ts +56 -0
- package/dist/autocomplete.js +11 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/badge.cjs +89 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.d.cts +25 -0
- package/dist/badge.d.ts +25 -0
- package/dist/badge.js +10 -0
- package/dist/badge.js.map +1 -0
- package/dist/breadcrumb.cjs +88 -0
- package/dist/breadcrumb.cjs.map +1 -0
- package/dist/breadcrumb.d.cts +14 -0
- package/dist/breadcrumb.d.ts +14 -0
- package/dist/breadcrumb.js +8 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button.cjs +143 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.d.cts +34 -0
- package/dist/button.d.ts +34 -0
- package/dist/button.js +9 -0
- package/dist/button.js.map +1 -0
- package/dist/card.cjs +111 -0
- package/dist/card.cjs.map +1 -0
- package/dist/card.d.cts +15 -0
- package/dist/card.d.ts +15 -0
- package/dist/card.js +18 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.cjs +66 -0
- package/dist/checkbox.cjs.map +1 -0
- package/{src/checkbox.tsx → dist/checkbox.d.cts} +5 -22
- package/dist/checkbox.d.ts +25 -0
- package/dist/checkbox.js +10 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunk-43ZUFY63.js +85 -0
- package/dist/chunk-43ZUFY63.js.map +1 -0
- package/dist/chunk-67ACNS42.js +29 -0
- package/dist/chunk-67ACNS42.js.map +1 -0
- package/dist/chunk-6URKHMCF.js +76 -0
- package/dist/chunk-6URKHMCF.js.map +1 -0
- package/dist/chunk-ASU6CUTZ.js +85 -0
- package/dist/chunk-ASU6CUTZ.js.map +1 -0
- package/dist/chunk-EWSBFU54.js +53 -0
- package/dist/chunk-EWSBFU54.js.map +1 -0
- package/dist/chunk-G4ZQUSAJ.js +38 -0
- package/dist/chunk-G4ZQUSAJ.js.map +1 -0
- package/dist/chunk-GMCUXEFI.js +67 -0
- package/dist/chunk-GMCUXEFI.js.map +1 -0
- package/dist/chunk-HBBOR43A.js +85 -0
- package/dist/chunk-HBBOR43A.js.map +1 -0
- package/dist/chunk-HCA5ODCD.js +11 -0
- package/dist/chunk-HCA5ODCD.js.map +1 -0
- package/dist/chunk-HYRJYUPI.js +26 -0
- package/dist/chunk-HYRJYUPI.js.map +1 -0
- package/dist/chunk-IRCTGJQB.js +26 -0
- package/dist/chunk-IRCTGJQB.js.map +1 -0
- package/dist/chunk-JDE5XYPT.js +30 -0
- package/dist/chunk-JDE5XYPT.js.map +1 -0
- package/dist/chunk-JSJEEKR3.js +59 -0
- package/dist/chunk-JSJEEKR3.js.map +1 -0
- package/dist/chunk-KR3BCFP7.js +85 -0
- package/dist/chunk-KR3BCFP7.js.map +1 -0
- package/dist/chunk-MQT5RAQV.js +202 -0
- package/dist/chunk-MQT5RAQV.js.map +1 -0
- package/dist/chunk-MUPW2TFJ.js +102 -0
- package/dist/chunk-MUPW2TFJ.js.map +1 -0
- package/dist/chunk-PM2VE7DJ.js +100 -0
- package/dist/chunk-PM2VE7DJ.js.map +1 -0
- package/dist/chunk-PPYR3O3L.js +44 -0
- package/dist/chunk-PPYR3O3L.js.map +1 -0
- package/dist/chunk-PUTC52SI.js +98 -0
- package/dist/chunk-PUTC52SI.js.map +1 -0
- package/dist/chunk-PVK4WQJZ.js +513 -0
- package/dist/chunk-PVK4WQJZ.js.map +1 -0
- package/dist/chunk-PWAKTEXF.js +18 -0
- package/dist/chunk-PWAKTEXF.js.map +1 -0
- package/dist/chunk-QTFWORA7.js +26 -0
- package/dist/chunk-QTFWORA7.js.map +1 -0
- package/dist/chunk-RUPL2H6V.js +49 -0
- package/dist/chunk-RUPL2H6V.js.map +1 -0
- package/dist/chunk-S7PVZAPL.js +28 -0
- package/dist/chunk-S7PVZAPL.js.map +1 -0
- package/dist/chunk-SQDV2AKJ.js +49 -0
- package/dist/chunk-SQDV2AKJ.js.map +1 -0
- package/dist/chunk-T2KXVH3O.js +297 -0
- package/dist/chunk-T2KXVH3O.js.map +1 -0
- package/dist/chunk-T4WCCHJQ.js +29 -0
- package/dist/chunk-T4WCCHJQ.js.map +1 -0
- package/dist/chunk-UC3ZIQPE.js +93 -0
- package/dist/chunk-UC3ZIQPE.js.map +1 -0
- package/dist/chunk-UE7JY7VR.js +28 -0
- package/dist/chunk-UE7JY7VR.js.map +1 -0
- package/dist/chunk-WVNRFO5F.js +70 -0
- package/dist/chunk-WVNRFO5F.js.map +1 -0
- package/dist/chunk-Y5WCT6XN.js +93 -0
- package/dist/chunk-Y5WCT6XN.js.map +1 -0
- package/dist/chunk-YDICVETX.js +151 -0
- package/dist/chunk-YDICVETX.js.map +1 -0
- package/dist/chunk-YSU4VWRD.js +90 -0
- package/dist/chunk-YSU4VWRD.js.map +1 -0
- package/dist/chunk-ZFSQVMLJ.js +126 -0
- package/dist/chunk-ZFSQVMLJ.js.map +1 -0
- package/dist/chunk-ZHATD73Y.js +46 -0
- package/dist/chunk-ZHATD73Y.js.map +1 -0
- package/dist/chunk-ZLAA4DGG.js +111 -0
- package/dist/chunk-ZLAA4DGG.js.map +1 -0
- package/dist/chunk-ZP252OJZ.js +56 -0
- package/dist/chunk-ZP252OJZ.js.map +1 -0
- package/dist/clipboard.cjs +125 -0
- package/dist/clipboard.cjs.map +1 -0
- package/dist/clipboard.d.cts +52 -0
- package/dist/clipboard.d.ts +52 -0
- package/dist/clipboard.js +23 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/collapsible.cjs +94 -0
- package/dist/collapsible.cjs.map +1 -0
- package/dist/collapsible.d.cts +21 -0
- package/dist/collapsible.d.ts +21 -0
- package/dist/collapsible.js +9 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/confirm-dialog.cjs +369 -0
- package/dist/confirm-dialog.cjs.map +1 -0
- package/dist/confirm-dialog.d.cts +16 -0
- package/dist/confirm-dialog.d.ts +16 -0
- package/dist/confirm-dialog.js +13 -0
- package/dist/confirm-dialog.js.map +1 -0
- package/dist/copy-button.cjs +102 -0
- package/dist/copy-button.cjs.map +1 -0
- package/dist/copy-button.d.cts +18 -0
- package/dist/copy-button.d.ts +18 -0
- package/dist/copy-button.js +10 -0
- package/dist/copy-button.js.map +1 -0
- package/dist/data-table.cjs +140 -0
- package/dist/data-table.cjs.map +1 -0
- package/dist/data-table.d.cts +81 -0
- package/dist/data-table.d.ts +81 -0
- package/dist/data-table.js +8 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-range-picker/dateRange.cjs +138 -0
- package/dist/date-range-picker/dateRange.cjs.map +1 -0
- package/dist/date-range-picker/dateRange.d.cts +57 -0
- package/dist/date-range-picker/dateRange.d.ts +57 -0
- package/dist/date-range-picker/dateRange.js +31 -0
- package/dist/date-range-picker/dateRange.js.map +1 -0
- package/dist/date-range-picker/index.cjs +375 -0
- package/dist/date-range-picker/index.cjs.map +1 -0
- package/dist/date-range-picker/index.d.cts +18 -0
- package/dist/date-range-picker/index.d.ts +18 -0
- package/dist/date-range-picker/index.js +10 -0
- package/dist/date-range-picker/index.js.map +1 -0
- package/dist/dialogLayer.cjs +121 -0
- package/dist/dialogLayer.cjs.map +1 -0
- package/dist/dialogLayer.d.cts +11 -0
- package/dist/dialogLayer.d.ts +11 -0
- package/dist/dialogLayer.js +8 -0
- package/dist/dialogLayer.js.map +1 -0
- package/dist/feature-access-gate.cjs +160 -0
- package/dist/feature-access-gate.cjs.map +1 -0
- package/dist/feature-access-gate.d.cts +14 -0
- package/dist/feature-access-gate.d.ts +14 -0
- package/dist/feature-access-gate.js +11 -0
- package/dist/feature-access-gate.js.map +1 -0
- package/dist/field.cjs +58 -0
- package/dist/field.cjs.map +1 -0
- package/dist/field.d.cts +23 -0
- package/dist/field.d.ts +23 -0
- package/dist/field.js +8 -0
- package/dist/field.js.map +1 -0
- package/dist/image-uploader.cjs +293 -0
- package/dist/image-uploader.cjs.map +1 -0
- package/dist/image-uploader.d.cts +34 -0
- package/dist/image-uploader.d.ts +34 -0
- package/dist/image-uploader.js +12 -0
- package/dist/image-uploader.js.map +1 -0
- package/dist/index.cjs +3012 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +232 -0
- package/dist/index.js.map +1 -0
- package/dist/input.cjs +58 -0
- package/dist/input.cjs.map +1 -0
- package/dist/input.d.cts +7 -0
- package/dist/input.d.ts +7 -0
- package/dist/input.js +10 -0
- package/dist/input.js.map +1 -0
- package/dist/label.cjs +67 -0
- package/dist/label.cjs.map +1 -0
- package/dist/label.d.cts +7 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.js +9 -0
- package/dist/label.js.map +1 -0
- package/dist/modal.cjs +212 -0
- package/dist/modal.cjs.map +1 -0
- package/dist/modal.d.cts +39 -0
- package/dist/modal.d.ts +39 -0
- package/dist/modal.js +12 -0
- package/dist/modal.js.map +1 -0
- package/dist/page-header.cjs +78 -0
- package/dist/page-header.cjs.map +1 -0
- package/dist/page-header.d.cts +35 -0
- package/dist/page-header.d.ts +35 -0
- package/dist/page-header.js +8 -0
- package/dist/page-header.js.map +1 -0
- package/dist/pagination.cjs +237 -0
- package/dist/pagination.cjs.map +1 -0
- package/dist/pagination.d.cts +15 -0
- package/dist/pagination.d.ts +15 -0
- package/dist/pagination.js +11 -0
- package/dist/pagination.js.map +1 -0
- package/dist/panel-brand-mark.cjs +59 -0
- package/dist/panel-brand-mark.cjs.map +1 -0
- package/dist/panel-brand-mark.d.cts +13 -0
- package/dist/panel-brand-mark.d.ts +13 -0
- package/dist/panel-brand-mark.js +8 -0
- package/dist/panel-brand-mark.js.map +1 -0
- package/dist/panel-sign-in.cjs +256 -0
- package/dist/panel-sign-in.cjs.map +1 -0
- package/dist/panel-sign-in.d.cts +31 -0
- package/dist/panel-sign-in.d.ts +31 -0
- package/dist/panel-sign-in.js +14 -0
- package/dist/panel-sign-in.js.map +1 -0
- package/dist/segmented-control.cjs +126 -0
- package/dist/segmented-control.cjs.map +1 -0
- package/dist/segmented-control.d.cts +60 -0
- package/dist/segmented-control.d.ts +60 -0
- package/dist/segmented-control.js +9 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/select.cjs +648 -0
- package/dist/select.cjs.map +1 -0
- package/dist/select.d.cts +30 -0
- package/dist/select.d.ts +30 -0
- package/dist/select.js +12 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.cjs +70 -0
- package/dist/separator.cjs.map +1 -0
- package/dist/separator.d.cts +13 -0
- package/dist/separator.d.ts +13 -0
- package/dist/separator.js +9 -0
- package/dist/separator.js.map +1 -0
- package/dist/side-drawer.cjs +321 -0
- package/dist/side-drawer.cjs.map +1 -0
- package/dist/side-drawer.d.cts +21 -0
- package/dist/side-drawer.d.ts +21 -0
- package/dist/side-drawer.js +13 -0
- package/dist/side-drawer.js.map +1 -0
- package/dist/spinner.cjs +57 -0
- package/dist/spinner.cjs.map +1 -0
- package/{src/spinner.tsx → dist/spinner.d.cts} +11 -22
- package/dist/spinner.d.ts +27 -0
- package/dist/spinner.js +8 -0
- package/dist/spinner.js.map +1 -0
- package/dist/spreadsheet-grid.cjs +238 -0
- package/dist/spreadsheet-grid.cjs.map +1 -0
- package/dist/spreadsheet-grid.d.cts +48 -0
- package/dist/spreadsheet-grid.d.ts +48 -0
- package/dist/spreadsheet-grid.js +8 -0
- package/dist/spreadsheet-grid.js.map +1 -0
- package/dist/state-panel.cjs +86 -0
- package/dist/state-panel.cjs.map +1 -0
- package/dist/state-panel.d.cts +23 -0
- package/dist/state-panel.d.ts +23 -0
- package/dist/state-panel.js +9 -0
- package/dist/state-panel.js.map +1 -0
- package/dist/switch.cjs +87 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.d.cts +13 -0
- package/dist/switch.d.ts +13 -0
- package/dist/switch.js +9 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.cjs +139 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +16 -0
- package/dist/table.d.ts +16 -0
- package/dist/table.js +22 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.cjs +168 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.d.cts +59 -0
- package/dist/tabs.d.ts +59 -0
- package/dist/tabs.js +11 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.cjs +66 -0
- package/dist/textarea.cjs.map +1 -0
- package/dist/textarea.d.cts +18 -0
- package/dist/textarea.d.ts +18 -0
- package/dist/textarea.js +10 -0
- package/dist/textarea.js.map +1 -0
- package/dist/utils.cjs +35 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +5 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/package.json +390 -13
- package/src/alert.tsx +0 -74
- package/src/autocomplete.tsx +0 -666
- package/src/badge.tsx +0 -60
- package/src/breadcrumb.tsx +0 -71
- package/src/button.tsx +0 -113
- package/src/card.tsx +0 -79
- package/src/clipboard.ts +0 -144
- package/src/collapsible.tsx +0 -63
- package/src/confirm-dialog.tsx +0 -84
- package/src/copy-button.tsx +0 -58
- package/src/data-table.tsx +0 -190
- package/src/date-range-picker/dateRange.ts +0 -142
- package/src/date-range-picker/index.tsx +0 -366
- package/src/dialogLayer.ts +0 -142
- package/src/feature-access-gate.tsx +0 -38
- package/src/field.tsx +0 -56
- package/src/image-uploader.tsx +0 -181
- package/src/index.ts +0 -37
- package/src/input.tsx +0 -16
- package/src/label.tsx +0 -23
- package/src/modal.tsx +0 -117
- package/src/page-header.tsx +0 -75
- package/src/pagination.tsx +0 -116
- package/src/panel-brand-mark.tsx +0 -32
- package/src/panel-sign-in.tsx +0 -134
- package/src/segmented-control.tsx +0 -155
- package/src/select.tsx +0 -105
- package/src/separator.tsx +0 -32
- package/src/side-drawer.tsx +0 -87
- package/src/spreadsheet-grid.tsx +0 -264
- package/src/state-panel.tsx +0 -46
- package/src/switch.tsx +0 -47
- package/src/table.tsx +0 -110
- package/src/tabs.tsx +0 -201
- package/src/textarea.tsx +0 -32
- package/src/utils.ts +0 -6
package/dist/modal.d.cts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns false during SSR and the first client render, then true once mounted.
|
|
5
|
+
* `useSyncExternalStore` is the React-recommended way to read client-only state
|
|
6
|
+
* without a setState-in-effect (which triggers cascading renders).
|
|
7
|
+
*/
|
|
8
|
+
declare function useHasMounted(): boolean;
|
|
9
|
+
interface ModalProps {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
/** id of the element labelling the dialog; wired to aria-labelledby. */
|
|
12
|
+
labelledBy: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional id(s) of elements describing the dialog (APG alertdialog body).
|
|
15
|
+
* Space-separated when multiple.
|
|
16
|
+
*/
|
|
17
|
+
describedBy?: string;
|
|
18
|
+
/** Accessible label for the backdrop dismiss button. */
|
|
19
|
+
closeLabel: string;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* When false, Escape and backdrop clicks do not close the modal (e.g. while a
|
|
24
|
+
* save is in flight). Defaults to true.
|
|
25
|
+
*/
|
|
26
|
+
dismissible?: boolean;
|
|
27
|
+
/** Use "alertdialog" for destructive confirmations. Defaults to "dialog". */
|
|
28
|
+
role?: "dialog" | "alertdialog";
|
|
29
|
+
/** Tailwind max-width class for the panel. Defaults to "max-w-md". */
|
|
30
|
+
panelClassName?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Shared modal shell: renders a portal-backed, scroll-locked, Escape-dismissible
|
|
34
|
+
* overlay with a centered panel. Callers provide the panel body (heading, form,
|
|
35
|
+
* footer). Consolidates the boilerplate previously copied across every dialog.
|
|
36
|
+
*/
|
|
37
|
+
declare function Modal({ isOpen, labelledBy, describedBy, closeLabel, onClose, children, dismissible, role, panelClassName, }: ModalProps): React.ReactPortal | null;
|
|
38
|
+
|
|
39
|
+
export { Modal, useHasMounted };
|
package/dist/modal.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns false during SSR and the first client render, then true once mounted.
|
|
5
|
+
* `useSyncExternalStore` is the React-recommended way to read client-only state
|
|
6
|
+
* without a setState-in-effect (which triggers cascading renders).
|
|
7
|
+
*/
|
|
8
|
+
declare function useHasMounted(): boolean;
|
|
9
|
+
interface ModalProps {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
/** id of the element labelling the dialog; wired to aria-labelledby. */
|
|
12
|
+
labelledBy: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional id(s) of elements describing the dialog (APG alertdialog body).
|
|
15
|
+
* Space-separated when multiple.
|
|
16
|
+
*/
|
|
17
|
+
describedBy?: string;
|
|
18
|
+
/** Accessible label for the backdrop dismiss button. */
|
|
19
|
+
closeLabel: string;
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* When false, Escape and backdrop clicks do not close the modal (e.g. while a
|
|
24
|
+
* save is in flight). Defaults to true.
|
|
25
|
+
*/
|
|
26
|
+
dismissible?: boolean;
|
|
27
|
+
/** Use "alertdialog" for destructive confirmations. Defaults to "dialog". */
|
|
28
|
+
role?: "dialog" | "alertdialog";
|
|
29
|
+
/** Tailwind max-width class for the panel. Defaults to "max-w-md". */
|
|
30
|
+
panelClassName?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Shared modal shell: renders a portal-backed, scroll-locked, Escape-dismissible
|
|
34
|
+
* overlay with a centered panel. Callers provide the panel body (heading, form,
|
|
35
|
+
* footer). Consolidates the boilerplate previously copied across every dialog.
|
|
36
|
+
*/
|
|
37
|
+
declare function Modal({ isOpen, labelledBy, describedBy, closeLabel, onClose, children, dismissible, role, panelClassName, }: ModalProps): React.ReactPortal | null;
|
|
38
|
+
|
|
39
|
+
export { Modal, useHasMounted };
|
package/dist/modal.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/page-header.tsx
|
|
21
|
+
var page_header_exports = {};
|
|
22
|
+
__export(page_header_exports, {
|
|
23
|
+
PageHeader: () => PageHeader
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(page_header_exports);
|
|
26
|
+
|
|
27
|
+
// src/utils.ts
|
|
28
|
+
var import_clsx = require("clsx");
|
|
29
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
30
|
+
function cn(...inputs) {
|
|
31
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/page-header.tsx
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
function PageHeader({
|
|
37
|
+
title,
|
|
38
|
+
description,
|
|
39
|
+
eyebrow,
|
|
40
|
+
actions,
|
|
41
|
+
className
|
|
42
|
+
}) {
|
|
43
|
+
const heading = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "min-w-0", children: [
|
|
44
|
+
eyebrow,
|
|
45
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
"h1",
|
|
47
|
+
{
|
|
48
|
+
className: cn(
|
|
49
|
+
"text-2xl font-semibold tracking-tight",
|
|
50
|
+
eyebrow != null && "mt-1"
|
|
51
|
+
),
|
|
52
|
+
children: title
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
description != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-muted-foreground mt-1 text-sm", children: description }) : null
|
|
56
|
+
] });
|
|
57
|
+
if (!actions) {
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className, children: heading });
|
|
59
|
+
}
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: cn(
|
|
64
|
+
"flex flex-wrap items-center justify-between gap-3",
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
children: [
|
|
68
|
+
heading,
|
|
69
|
+
actions
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
PageHeader
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=page-header.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/page-header.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * The title block every panel opens with.\n *\n * Twenty Managers wrote the same `<h1>` and subtitle by hand, differing only in\n * whether the row said `gap-3` or `gap-x-4 gap-y-2` and whether the inner block\n * carried `min-w-0` — differences nobody chose, which is what made them worth\n * removing.\n *\n * `description` takes a node rather than a string because several panels put a\n * `<code>` in theirs, naming the Firebase field they write. That is the useful\n * kind of subtitle and it should not have to opt out of the shared component to\n * stay.\n *\n * `min-w-0` is not optional here. Without it a long title refuses to shrink and\n * pushes the actions off the row instead of wrapping — which is the bug the\n * three panels that set it had already hit, and the seven that did not had not\n * yet.\n */\nexport interface PageHeaderProps {\n title: React.ReactNode;\n description?: React.ReactNode;\n /**\n * Sits above the title: a breadcrumb, or the back link the filter editors\n * use. Four panels had one, each spacing it by hand.\n */\n eyebrow?: React.ReactNode;\n /** Buttons belonging to the page, laid out at the end of the title row. */\n actions?: React.ReactNode;\n className?: string;\n}\n\nexport function PageHeader({\n title,\n description,\n eyebrow,\n actions,\n className,\n}: PageHeaderProps) {\n const heading = (\n <div className=\"min-w-0\">\n {eyebrow}\n <h1\n className={cn(\n \"text-2xl font-semibold tracking-tight\",\n eyebrow != null && \"mt-1\",\n )}\n >\n {title}\n </h1>\n {description != null ? (\n <p className=\"text-muted-foreground mt-1 text-sm\">{description}</p>\n ) : null}\n </div>\n );\n\n if (!actions) {\n return <div className={className}>{heading}</div>;\n }\n\n return (\n <div\n className={cn(\n \"flex flex-wrap items-center justify-between gap-3\",\n className,\n )}\n >\n {heading}\n {actions}\n </div>\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADsCI;AARG,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoB;AAClB,QAAM,UACJ,6CAAC,SAAI,WAAU,WACZ;AAAA;AAAA,IACD;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA,WAAW,QAAQ;AAAA,QACrB;AAAA,QAEC;AAAA;AAAA,IACH;AAAA,IACC,eAAe,OACd,4CAAC,OAAE,WAAU,sCAAsC,uBAAY,IAC7D;AAAA,KACN;AAGF,MAAI,CAAC,SAAS;AACZ,WAAO,4CAAC,SAAI,WAAuB,mBAAQ;AAAA,EAC7C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MAEC;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The title block every panel opens with.
|
|
5
|
+
*
|
|
6
|
+
* Twenty Managers wrote the same `<h1>` and subtitle by hand, differing only in
|
|
7
|
+
* whether the row said `gap-3` or `gap-x-4 gap-y-2` and whether the inner block
|
|
8
|
+
* carried `min-w-0` — differences nobody chose, which is what made them worth
|
|
9
|
+
* removing.
|
|
10
|
+
*
|
|
11
|
+
* `description` takes a node rather than a string because several panels put a
|
|
12
|
+
* `<code>` in theirs, naming the Firebase field they write. That is the useful
|
|
13
|
+
* kind of subtitle and it should not have to opt out of the shared component to
|
|
14
|
+
* stay.
|
|
15
|
+
*
|
|
16
|
+
* `min-w-0` is not optional here. Without it a long title refuses to shrink and
|
|
17
|
+
* pushes the actions off the row instead of wrapping — which is the bug the
|
|
18
|
+
* three panels that set it had already hit, and the seven that did not had not
|
|
19
|
+
* yet.
|
|
20
|
+
*/
|
|
21
|
+
interface PageHeaderProps {
|
|
22
|
+
title: React.ReactNode;
|
|
23
|
+
description?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Sits above the title: a breadcrumb, or the back link the filter editors
|
|
26
|
+
* use. Four panels had one, each spacing it by hand.
|
|
27
|
+
*/
|
|
28
|
+
eyebrow?: React.ReactNode;
|
|
29
|
+
/** Buttons belonging to the page, laid out at the end of the title row. */
|
|
30
|
+
actions?: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
declare function PageHeader({ title, description, eyebrow, actions, className, }: PageHeaderProps): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { PageHeader, type PageHeaderProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The title block every panel opens with.
|
|
5
|
+
*
|
|
6
|
+
* Twenty Managers wrote the same `<h1>` and subtitle by hand, differing only in
|
|
7
|
+
* whether the row said `gap-3` or `gap-x-4 gap-y-2` and whether the inner block
|
|
8
|
+
* carried `min-w-0` — differences nobody chose, which is what made them worth
|
|
9
|
+
* removing.
|
|
10
|
+
*
|
|
11
|
+
* `description` takes a node rather than a string because several panels put a
|
|
12
|
+
* `<code>` in theirs, naming the Firebase field they write. That is the useful
|
|
13
|
+
* kind of subtitle and it should not have to opt out of the shared component to
|
|
14
|
+
* stay.
|
|
15
|
+
*
|
|
16
|
+
* `min-w-0` is not optional here. Without it a long title refuses to shrink and
|
|
17
|
+
* pushes the actions off the row instead of wrapping — which is the bug the
|
|
18
|
+
* three panels that set it had already hit, and the seven that did not had not
|
|
19
|
+
* yet.
|
|
20
|
+
*/
|
|
21
|
+
interface PageHeaderProps {
|
|
22
|
+
title: React.ReactNode;
|
|
23
|
+
description?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Sits above the title: a breadcrumb, or the back link the filter editors
|
|
26
|
+
* use. Four panels had one, each spacing it by hand.
|
|
27
|
+
*/
|
|
28
|
+
eyebrow?: React.ReactNode;
|
|
29
|
+
/** Buttons belonging to the page, laid out at the end of the title row. */
|
|
30
|
+
actions?: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
declare function PageHeader({ title, description, eyebrow, actions, className, }: PageHeaderProps): React.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { PageHeader, type PageHeaderProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/pagination.tsx
|
|
33
|
+
var pagination_exports = {};
|
|
34
|
+
__export(pagination_exports, {
|
|
35
|
+
Pagination: () => Pagination
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(pagination_exports);
|
|
38
|
+
var import_lucide_react2 = require("lucide-react");
|
|
39
|
+
var React2 = __toESM(require("react"), 1);
|
|
40
|
+
|
|
41
|
+
// src/button.tsx
|
|
42
|
+
var React = __toESM(require("react"), 1);
|
|
43
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
44
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
45
|
+
|
|
46
|
+
// src/spinner.tsx
|
|
47
|
+
var import_lucide_react = require("lucide-react");
|
|
48
|
+
|
|
49
|
+
// src/utils.ts
|
|
50
|
+
var import_clsx = require("clsx");
|
|
51
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
52
|
+
function cn(...inputs) {
|
|
53
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// src/spinner.tsx
|
|
57
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
58
|
+
var SIZES = {
|
|
59
|
+
sm: "size-3.5",
|
|
60
|
+
md: "size-4",
|
|
61
|
+
lg: "size-5",
|
|
62
|
+
xl: "size-10 border-2"
|
|
63
|
+
};
|
|
64
|
+
function Spinner({ size = "md", className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
66
|
+
import_lucide_react.Loader2,
|
|
67
|
+
{
|
|
68
|
+
"aria-hidden": true,
|
|
69
|
+
className: cn("animate-spin", SIZES[size], className),
|
|
70
|
+
...props
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// src/button.tsx
|
|
76
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
77
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
78
|
+
"inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
79
|
+
{
|
|
80
|
+
variants: {
|
|
81
|
+
variant: {
|
|
82
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
83
|
+
secondary: "bg-muted text-foreground hover:bg-muted/80",
|
|
84
|
+
ghost: "hover:bg-muted",
|
|
85
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
86
|
+
outline: "border border-border bg-background hover:bg-muted"
|
|
87
|
+
},
|
|
88
|
+
size: {
|
|
89
|
+
sm: "h-8 px-2.5",
|
|
90
|
+
md: "h-9 px-3",
|
|
91
|
+
lg: "h-10 px-4",
|
|
92
|
+
icon: "h-9 w-9 px-0",
|
|
93
|
+
// Square, matching `sm`'s height — for an icon-only control sitting in
|
|
94
|
+
// a table row or beside `sm` buttons, where `icon` is a row taller.
|
|
95
|
+
"icon-sm": "h-8 w-8 px-0"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
variant: "default",
|
|
100
|
+
size: "md"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
var ICON_SIZES = /* @__PURE__ */ new Set(["icon", "icon-sm"]);
|
|
105
|
+
var Button = React.forwardRef(
|
|
106
|
+
({
|
|
107
|
+
className,
|
|
108
|
+
variant,
|
|
109
|
+
size,
|
|
110
|
+
asChild = false,
|
|
111
|
+
loading,
|
|
112
|
+
disabled,
|
|
113
|
+
children,
|
|
114
|
+
...props
|
|
115
|
+
}, ref) => {
|
|
116
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
117
|
+
if (asChild) {
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
119
|
+
Comp,
|
|
120
|
+
{
|
|
121
|
+
ref,
|
|
122
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
123
|
+
...props,
|
|
124
|
+
children
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
ref,
|
|
132
|
+
disabled: disabled || loading,
|
|
133
|
+
"aria-busy": loading || void 0,
|
|
134
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
135
|
+
...props,
|
|
136
|
+
children: [
|
|
137
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spinner, { size: "sm" }) : null,
|
|
138
|
+
loading && size != null && ICON_SIZES.has(size) ? null : children
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
Button.displayName = "Button";
|
|
145
|
+
|
|
146
|
+
// src/pagination.tsx
|
|
147
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
148
|
+
function Pagination({
|
|
149
|
+
currentPage,
|
|
150
|
+
totalPages,
|
|
151
|
+
onPageChange,
|
|
152
|
+
loading = false,
|
|
153
|
+
showPageInfo = true
|
|
154
|
+
}) {
|
|
155
|
+
const visiblePages = React2.useMemo(() => {
|
|
156
|
+
const delta = 2;
|
|
157
|
+
const range = [];
|
|
158
|
+
const rangeWithDots = [];
|
|
159
|
+
for (let i = Math.max(2, currentPage - delta); i <= Math.min(totalPages - 1, currentPage + delta); i++) {
|
|
160
|
+
range.push(i);
|
|
161
|
+
}
|
|
162
|
+
if (currentPage - delta > 2) {
|
|
163
|
+
rangeWithDots.push(1, "...");
|
|
164
|
+
} else {
|
|
165
|
+
rangeWithDots.push(1);
|
|
166
|
+
}
|
|
167
|
+
rangeWithDots.push(...range);
|
|
168
|
+
if (currentPage + delta < totalPages - 1) {
|
|
169
|
+
rangeWithDots.push("...", totalPages);
|
|
170
|
+
} else if (totalPages > 1) {
|
|
171
|
+
rangeWithDots.push(totalPages);
|
|
172
|
+
}
|
|
173
|
+
return rangeWithDots;
|
|
174
|
+
}, [currentPage, totalPages]);
|
|
175
|
+
if (totalPages <= 1) return null;
|
|
176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col items-center justify-between gap-4 sm:flex-row", children: [
|
|
177
|
+
showPageInfo ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "text-muted-foreground order-2 text-sm sm:order-1", children: [
|
|
178
|
+
"Page ",
|
|
179
|
+
currentPage,
|
|
180
|
+
" of ",
|
|
181
|
+
totalPages
|
|
182
|
+
] }) : null,
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "order-1 flex items-center space-x-1 sm:order-2 sm:space-x-2", children: [
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
185
|
+
Button,
|
|
186
|
+
{
|
|
187
|
+
variant: "outline",
|
|
188
|
+
size: "sm",
|
|
189
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
190
|
+
disabled: currentPage <= 1 || loading,
|
|
191
|
+
className: "h-8 min-w-8 px-2",
|
|
192
|
+
"aria-label": "Previous page",
|
|
193
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronLeft, { className: "h-4 w-4" })
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex max-w-[200px] items-center space-x-1 overflow-x-auto sm:max-w-none", children: visiblePages.map(
|
|
197
|
+
(page, index) => page === "..." ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
198
|
+
"div",
|
|
199
|
+
{
|
|
200
|
+
className: "flex h-8 w-8 shrink-0 items-center justify-center",
|
|
201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.MoreHorizontal, { className: "h-4 w-4" })
|
|
202
|
+
},
|
|
203
|
+
`dots-${index}`
|
|
204
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
205
|
+
Button,
|
|
206
|
+
{
|
|
207
|
+
variant: page === currentPage ? "default" : "outline",
|
|
208
|
+
size: "sm",
|
|
209
|
+
onClick: () => onPageChange(page),
|
|
210
|
+
disabled: loading,
|
|
211
|
+
className: "h-8 min-w-8 shrink-0 px-2",
|
|
212
|
+
"aria-current": page === currentPage ? "page" : void 0,
|
|
213
|
+
children: page
|
|
214
|
+
},
|
|
215
|
+
page
|
|
216
|
+
)
|
|
217
|
+
) }),
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
219
|
+
Button,
|
|
220
|
+
{
|
|
221
|
+
variant: "outline",
|
|
222
|
+
size: "sm",
|
|
223
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
224
|
+
disabled: currentPage >= totalPages || loading,
|
|
225
|
+
className: "h-8 min-w-8 px-2",
|
|
226
|
+
"aria-label": "Next page",
|
|
227
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronRight, { className: "h-4 w-4" })
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] })
|
|
231
|
+
] });
|
|
232
|
+
}
|
|
233
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
234
|
+
0 && (module.exports = {
|
|
235
|
+
Pagination
|
|
236
|
+
});
|
|
237
|
+
//# sourceMappingURL=pagination.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pagination.tsx","../src/button.tsx","../src/spinner.tsx","../src/utils.ts"],"sourcesContent":["\"use client\";\n\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { Button } from \"./button\";\n\nexport type PaginationProps = {\n currentPage: number;\n totalPages: number;\n onPageChange: (page: number) => void;\n loading?: boolean;\n showPageInfo?: boolean;\n};\n\n/**\n * Numbered pager for list panels. Hides itself when there is only one page.\n */\nexport function Pagination({\n currentPage,\n totalPages,\n onPageChange,\n loading = false,\n showPageInfo = true,\n}: PaginationProps) {\n const visiblePages = React.useMemo(() => {\n const delta = 2;\n const range: number[] = [];\n const rangeWithDots: Array<number | \"...\"> = [];\n\n for (\n let i = Math.max(2, currentPage - delta);\n i <= Math.min(totalPages - 1, currentPage + delta);\n i++\n ) {\n range.push(i);\n }\n\n if (currentPage - delta > 2) {\n rangeWithDots.push(1, \"...\");\n } else {\n rangeWithDots.push(1);\n }\n\n rangeWithDots.push(...range);\n\n if (currentPage + delta < totalPages - 1) {\n rangeWithDots.push(\"...\", totalPages);\n } else if (totalPages > 1) {\n rangeWithDots.push(totalPages);\n }\n\n return rangeWithDots;\n }, [currentPage, totalPages]);\n\n if (totalPages <= 1) return null;\n\n return (\n <div className=\"flex flex-col items-center justify-between gap-4 sm:flex-row\">\n {showPageInfo ? (\n <div className=\"text-muted-foreground order-2 text-sm sm:order-1\">\n Page {currentPage} of {totalPages}\n </div>\n ) : null}\n\n <div className=\"order-1 flex items-center space-x-1 sm:order-2 sm:space-x-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(currentPage - 1)}\n disabled={currentPage <= 1 || loading}\n className=\"h-8 min-w-8 px-2\"\n aria-label=\"Previous page\"\n >\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n\n <div className=\"flex max-w-[200px] items-center space-x-1 overflow-x-auto sm:max-w-none\">\n {visiblePages.map((page, index) =>\n page === \"...\" ? (\n <div\n key={`dots-${index}`}\n className=\"flex h-8 w-8 shrink-0 items-center justify-center\"\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </div>\n ) : (\n <Button\n key={page}\n variant={page === currentPage ? \"default\" : \"outline\"}\n size=\"sm\"\n onClick={() => onPageChange(page)}\n disabled={loading}\n className=\"h-8 min-w-8 shrink-0 px-2\"\n aria-current={page === currentPage ? \"page\" : undefined}\n >\n {page}\n </Button>\n ),\n )}\n </div>\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(currentPage + 1)}\n disabled={currentPage >= totalPages || loading}\n className=\"h-8 min-w-8 px-2\"\n aria-label=\"Next page\"\n >\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n );\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nimport { Spinner } from \"./spinner\";\nimport { cn } from \"./utils\";\n\nconst buttonVariants = cva(\n \"inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"bg-muted text-foreground hover:bg-muted/80\",\n ghost: \"hover:bg-muted\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-border bg-background hover:bg-muted\",\n },\n size: {\n sm: \"h-8 px-2.5\",\n md: \"h-9 px-3\",\n lg: \"h-10 px-4\",\n icon: \"h-9 w-9 px-0\",\n // Square, matching `sm`'s height — for an icon-only control sitting in\n // a table row or beside `sm` buttons, where `icon` is a row taller.\n \"icon-sm\": \"h-8 w-8 px-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Work is in flight: shows a spinner, disables the button, and sets\n * `aria-busy`.\n *\n * This exists because the panel had 272 disabled buttons and only 22 that\n * said anything about why — the rest went dead on click with no spinner and\n * no label change, which reads as a broken button rather than a busy one.\n * Making the feedback part of `disabled` rather than something each caller\n * remembers separately is the only way that ratio stays fixed.\n *\n * The label is kept rather than swapped. \"Saving…\" loses which button you\n * pressed, and the spinner already says it is working. An icon-only button\n * is the exception — there is no room beside the glyph, so the spinner takes\n * its place; the `aria-label` is what names the button either way.\n *\n * \"Icon-only\" means an icon `size`. A square button that grew a spinner\n * beside its glyph would not just look wrong, it would resize mid-request\n * and shove whatever sits next to it sideways.\n */\n loading?: boolean;\n}\n\n/** Sizes with no room for a spinner beside the glyph. */\nconst ICON_SIZES = new Set<string>([\"icon\", \"icon-sm\"]);\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n\n // `asChild` renders someone else's element, which may not take a spinner or\n // a disabled attribute — so the busy treatment is only applied to a real\n // button, and passing both is a mistake worth not papering over.\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <button\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {loading ? <Spinner size=\"sm\" /> : null}\n {loading && size != null && ICON_SIZES.has(size) ? null : children}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n","import * as React from \"react\";\nimport { Loader2 } from \"lucide-react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * The one spinner.\n *\n * There were five spellings of `animate-spin` across twelve files — `h-4 w-4`,\n * `h-5 w-5`, `size-4`, bare, and a hand-drawn ring in `ProtectedRoute` — so the\n * same \"working\" signal came out a different size depending on which panel you\n * were on.\n *\n * It is `aria-hidden` on purpose. A spinner is decoration; what a screen reader\n * needs is the surrounding control's `aria-busy` or the panel's status text,\n * and announcing \"loading\" twice is worse than once. `Button` and `StatePanel`\n * both supply that.\n */\nconst SIZES = {\n sm: \"size-3.5\",\n md: \"size-4\",\n lg: \"size-5\",\n xl: \"size-10 border-2\",\n} as const;\n\nexport interface SpinnerProps extends React.SVGProps<SVGSVGElement> {\n size?: keyof typeof SIZES;\n}\n\nexport function Spinner({ size = \"md\", className, ...props }: SpinnerProps) {\n return (\n <Loader2\n aria-hidden\n className={cn(\"animate-spin\", SIZES[size], className)}\n {...props}\n />\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":"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","names":["import_lucide_react","React","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type PaginationProps = {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
onPageChange: (page: number) => void;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
showPageInfo?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Numbered pager for list panels. Hides itself when there is only one page.
|
|
12
|
+
*/
|
|
13
|
+
declare function Pagination({ currentPage, totalPages, onPageChange, loading, showPageInfo, }: PaginationProps): React.JSX.Element | null;
|
|
14
|
+
|
|
15
|
+
export { Pagination, type PaginationProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type PaginationProps = {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
onPageChange: (page: number) => void;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
showPageInfo?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Numbered pager for list panels. Hides itself when there is only one page.
|
|
12
|
+
*/
|
|
13
|
+
declare function Pagination({ currentPage, totalPages, onPageChange, loading, showPageInfo, }: PaginationProps): React.JSX.Element | null;
|
|
14
|
+
|
|
15
|
+
export { Pagination, type PaginationProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/panel-brand-mark.tsx
|
|
21
|
+
var panel_brand_mark_exports = {};
|
|
22
|
+
__export(panel_brand_mark_exports, {
|
|
23
|
+
PanelBrandMark: () => PanelBrandMark
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(panel_brand_mark_exports);
|
|
26
|
+
|
|
27
|
+
// src/utils.ts
|
|
28
|
+
var import_clsx = require("clsx");
|
|
29
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
30
|
+
function cn(...inputs) {
|
|
31
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/panel-brand-mark.tsx
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
function PanelBrandMark({
|
|
37
|
+
children,
|
|
38
|
+
size = "md",
|
|
39
|
+
className,
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: cn(
|
|
46
|
+
"bg-primary text-primary-foreground grid shrink-0 place-items-center rounded-lg",
|
|
47
|
+
size === "sm" ? "h-9 w-9" : "h-10 w-10",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props,
|
|
51
|
+
children
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
PanelBrandMark
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=panel-brand-mark.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/panel-brand-mark.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\nexport type PanelBrandMarkProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Icon inside the mark (lucide, etc.). */\n children: React.ReactNode;\n size?: \"sm\" | \"md\";\n};\n\n/**\n * Quiet brand tile for sidebar / sign-in — solid primary, no decorative gradients.\n */\nexport function PanelBrandMark({\n children,\n size = \"md\",\n className,\n ...props\n}: PanelBrandMarkProps) {\n return (\n <div\n className={cn(\n \"bg-primary text-primary-foreground grid shrink-0 place-items-center rounded-lg\",\n size === \"sm\" ? \"h-9 w-9\" : \"h-10 w-10\",\n className,\n )}\n {...props}\n >\n {children}\n </div>\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADeI;AAPG,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,SAAS,OAAO,YAAY;AAAA,QAC5B;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type PanelBrandMarkProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
/** Icon inside the mark (lucide, etc.). */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
size?: "sm" | "md";
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Quiet brand tile for sidebar / sign-in — solid primary, no decorative gradients.
|
|
10
|
+
*/
|
|
11
|
+
declare function PanelBrandMark({ children, size, className, ...props }: PanelBrandMarkProps): React.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { PanelBrandMark, type PanelBrandMarkProps };
|