@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/button.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "secondary" | "ghost" | "destructive" | "outline" | null | undefined;
|
|
7
|
+
size?: "sm" | "md" | "lg" | "icon" | "icon-sm" | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Work is in flight: shows a spinner, disables the button, and sets
|
|
13
|
+
* `aria-busy`.
|
|
14
|
+
*
|
|
15
|
+
* This exists because the panel had 272 disabled buttons and only 22 that
|
|
16
|
+
* said anything about why — the rest went dead on click with no spinner and
|
|
17
|
+
* no label change, which reads as a broken button rather than a busy one.
|
|
18
|
+
* Making the feedback part of `disabled` rather than something each caller
|
|
19
|
+
* remembers separately is the only way that ratio stays fixed.
|
|
20
|
+
*
|
|
21
|
+
* The label is kept rather than swapped. "Saving…" loses which button you
|
|
22
|
+
* pressed, and the spinner already says it is working. An icon-only button
|
|
23
|
+
* is the exception — there is no room beside the glyph, so the spinner takes
|
|
24
|
+
* its place; the `aria-label` is what names the button either way.
|
|
25
|
+
*
|
|
26
|
+
* "Icon-only" means an icon `size`. A square button that grew a spinner
|
|
27
|
+
* beside its glyph would not just look wrong, it would resize mid-request
|
|
28
|
+
* and shove whatever sits next to it sideways.
|
|
29
|
+
*/
|
|
30
|
+
loading?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
|
|
34
|
+
export { Button, type ButtonProps };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/card.cjs
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/card.tsx
|
|
31
|
+
var card_exports = {};
|
|
32
|
+
__export(card_exports, {
|
|
33
|
+
Card: () => Card,
|
|
34
|
+
CardContent: () => CardContent,
|
|
35
|
+
CardDescription: () => CardDescription,
|
|
36
|
+
CardFooter: () => CardFooter,
|
|
37
|
+
CardHeader: () => CardHeader,
|
|
38
|
+
CardTitle: () => CardTitle
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(card_exports);
|
|
41
|
+
var React = __toESM(require("react"), 1);
|
|
42
|
+
|
|
43
|
+
// src/utils.ts
|
|
44
|
+
var import_clsx = require("clsx");
|
|
45
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
46
|
+
function cn(...inputs) {
|
|
47
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/card.tsx
|
|
51
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
+
var Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
ref,
|
|
56
|
+
className: cn(
|
|
57
|
+
"bg-card text-card-foreground rounded-xl border shadow",
|
|
58
|
+
className
|
|
59
|
+
),
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
));
|
|
63
|
+
Card.displayName = "Card";
|
|
64
|
+
var CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
ref,
|
|
68
|
+
className: cn("flex flex-col space-y-1.5 p-6", className),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
CardHeader.displayName = "CardHeader";
|
|
73
|
+
var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
className: cn("leading-none font-semibold tracking-tight", className),
|
|
78
|
+
...props
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
CardTitle.displayName = "CardTitle";
|
|
82
|
+
var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref,
|
|
86
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
CardDescription.displayName = "CardDescription";
|
|
91
|
+
var CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
92
|
+
CardContent.displayName = "CardContent";
|
|
93
|
+
var CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
94
|
+
"div",
|
|
95
|
+
{
|
|
96
|
+
ref,
|
|
97
|
+
className: cn("flex items-center p-6 pt-0", className),
|
|
98
|
+
...props
|
|
99
|
+
}
|
|
100
|
+
));
|
|
101
|
+
CardFooter.displayName = "CardFooter";
|
|
102
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
103
|
+
0 && (module.exports = {
|
|
104
|
+
Card,
|
|
105
|
+
CardContent,
|
|
106
|
+
CardDescription,
|
|
107
|
+
CardFooter,
|
|
108
|
+
CardHeader,
|
|
109
|
+
CardTitle
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=card.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/card.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * Surface container for grouped content. Prefer a bare section when there is\n * no need for border / padding chrome — cards are for interactive or\n * self-contained blocks, not every stack of text.\n */\nexport const Card = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"bg-card text-card-foreground rounded-xl border shadow\",\n className,\n )}\n {...props}\n />\n));\nCard.displayName = \"Card\";\n\nexport const CardHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nexport const CardTitle = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"leading-none font-semibold tracking-tight\", className)}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nexport const CardDescription = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nexport const CardContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6 pt-0\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nexport const CardFooter = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADQE;AAJK,IAAM,OAAa,iBAGxB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,KAAK,cAAc;AAEZ,IAAM,aAAmB,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;AAElB,IAAM,YAAkB,iBAG7B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,6CAA6C,SAAS;AAAA,IACnE,GAAG;AAAA;AACN,CACD;AACD,UAAU,cAAc;AAEjB,IAAM,kBAAwB,iBAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,iCAAiC,SAAS;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAgB,cAAc;AAEvB,IAAM,cAAoB,iBAG/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,4CAAC,SAAI,KAAU,WAAW,GAAG,YAAY,SAAS,GAAI,GAAG,OAAO,CACjE;AACD,YAAY,cAAc;AAEnB,IAAM,aAAmB,iBAG9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,WAAW,GAAG,8BAA8B,SAAS;AAAA,IACpD,GAAG;AAAA;AACN,CACD;AACD,WAAW,cAAc;","names":[]}
|
package/dist/card.d.cts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Surface container for grouped content. Prefer a bare section when there is
|
|
5
|
+
* no need for border / padding chrome — cards are for interactive or
|
|
6
|
+
* self-contained blocks, not every stack of text.
|
|
7
|
+
*/
|
|
8
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Surface container for grouped content. Prefer a bare section when there is
|
|
5
|
+
* no need for border / padding chrome — cards are for interactive or
|
|
6
|
+
* self-contained blocks, not every stack of text.
|
|
7
|
+
*/
|
|
8
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
|
|
15
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Card,
|
|
3
|
+
CardContent,
|
|
4
|
+
CardDescription,
|
|
5
|
+
CardFooter,
|
|
6
|
+
CardHeader,
|
|
7
|
+
CardTitle
|
|
8
|
+
} from "./chunk-GMCUXEFI.js";
|
|
9
|
+
import "./chunk-HCA5ODCD.js";
|
|
10
|
+
export {
|
|
11
|
+
Card,
|
|
12
|
+
CardContent,
|
|
13
|
+
CardDescription,
|
|
14
|
+
CardFooter,
|
|
15
|
+
CardHeader,
|
|
16
|
+
CardTitle
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=card.js.map
|
package/dist/card.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/checkbox.tsx
|
|
31
|
+
var checkbox_exports = {};
|
|
32
|
+
__export(checkbox_exports, {
|
|
33
|
+
Checkbox: () => Checkbox,
|
|
34
|
+
checkboxClass: () => checkboxClass
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(checkbox_exports);
|
|
37
|
+
var React = __toESM(require("react"), 1);
|
|
38
|
+
|
|
39
|
+
// src/utils.ts
|
|
40
|
+
var import_clsx = require("clsx");
|
|
41
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
42
|
+
function cn(...inputs) {
|
|
43
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/checkbox.tsx
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
var checkboxClass = "accent-primary border-border focus-visible:ring-ring size-4 shrink-0 cursor-pointer rounded border focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
|
|
49
|
+
var Checkbox = React.forwardRef(
|
|
50
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
"input",
|
|
52
|
+
{
|
|
53
|
+
ref,
|
|
54
|
+
type: "checkbox",
|
|
55
|
+
className: cn(checkboxClass, className),
|
|
56
|
+
...props
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
Checkbox.displayName = "Checkbox";
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
Checkbox,
|
|
64
|
+
checkboxClass
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=checkbox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/checkbox.tsx","../src/utils.ts"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * The native checkbox, sized and coloured once.\n *\n * Twenty-six of these were scattered across thirteen files and twenty of them\n * carried **no class at all** — browser defaults, so they were a different size\n * to the six that set `size-4` and drew their tick in the operating system's\n * accent rather than the panel's.\n *\n * This deliberately stays a native `<input type=\"checkbox\">` rather than an\n * `appearance-none` box with an SVG tick. Native gets indeterminate state,\n * form participation, platform focus behaviour and assistive-technology support\n * for free, and a custom one would have to re-earn all of it to look slightly\n * different.\n *\n * `border` and `rounded` mostly do not render on a native checkbox — they are\n * kept because the six styled copies had them and removing them would be a\n * silent change to those. `accent-primary` and `size-4` are what actually show.\n */\nexport const checkboxClass =\n \"accent-primary border-border focus-visible:ring-ring size-4 shrink-0 cursor-pointer rounded border focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\";\n\nexport type CheckboxProps = Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\nexport const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(\n ({ className, ...props }, ref) => (\n <input\n ref={ref}\n type=\"checkbox\"\n className={cn(checkboxClass, className)}\n {...props}\n />\n ),\n);\n\nCheckbox.displayName = \"Checkbox\";\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;AAAA;AAAA,YAAuB;;;ACAvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD2BI;AAVG,IAAM,gBACX;AAOK,IAAM,WAAiB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,WAAW,GAAG,eAAe,SAAS;AAAA,MACrC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc;","names":[]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
|
|
3
|
-
import { cn } from "./utils";
|
|
1
|
+
import * as React from 'react';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* The native checkbox, sized and coloured once.
|
|
@@ -20,23 +18,8 @@ import { cn } from "./utils";
|
|
|
20
18
|
* kept because the six styled copies had them and removing them would be a
|
|
21
19
|
* silent change to those. `accent-primary` and `size-4` are what actually show.
|
|
22
20
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export type CheckboxProps = Omit<
|
|
27
|
-
React.InputHTMLAttributes<HTMLInputElement>,
|
|
28
|
-
"type"
|
|
29
|
-
>;
|
|
30
|
-
|
|
31
|
-
export const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
|
|
32
|
-
({ className, ...props }, ref) => (
|
|
33
|
-
<input
|
|
34
|
-
ref={ref}
|
|
35
|
-
type="checkbox"
|
|
36
|
-
className={cn(checkboxClass, className)}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
),
|
|
40
|
-
);
|
|
21
|
+
declare const checkboxClass = "accent-primary border-border focus-visible:ring-ring size-4 shrink-0 cursor-pointer rounded border focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
|
|
22
|
+
type CheckboxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type">;
|
|
23
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
41
24
|
|
|
42
|
-
Checkbox
|
|
25
|
+
export { Checkbox, type CheckboxProps, checkboxClass };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The native checkbox, sized and coloured once.
|
|
5
|
+
*
|
|
6
|
+
* Twenty-six of these were scattered across thirteen files and twenty of them
|
|
7
|
+
* carried **no class at all** — browser defaults, so they were a different size
|
|
8
|
+
* to the six that set `size-4` and drew their tick in the operating system's
|
|
9
|
+
* accent rather than the panel's.
|
|
10
|
+
*
|
|
11
|
+
* This deliberately stays a native `<input type="checkbox">` rather than an
|
|
12
|
+
* `appearance-none` box with an SVG tick. Native gets indeterminate state,
|
|
13
|
+
* form participation, platform focus behaviour and assistive-technology support
|
|
14
|
+
* for free, and a custom one would have to re-earn all of it to look slightly
|
|
15
|
+
* different.
|
|
16
|
+
*
|
|
17
|
+
* `border` and `rounded` mostly do not render on a native checkbox — they are
|
|
18
|
+
* kept because the six styled copies had them and removing them would be a
|
|
19
|
+
* silent change to those. `accent-primary` and `size-4` are what actually show.
|
|
20
|
+
*/
|
|
21
|
+
declare const checkboxClass = "accent-primary border-border focus-visible:ring-ring size-4 shrink-0 cursor-pointer rounded border focus-visible:ring-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
|
|
22
|
+
type CheckboxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type">;
|
|
23
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
24
|
+
|
|
25
|
+
export { Checkbox, type CheckboxProps, checkboxClass };
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useHasMounted
|
|
3
|
+
} from "./chunk-YSU4VWRD.js";
|
|
4
|
+
import {
|
|
5
|
+
useDialogLayer
|
|
6
|
+
} from "./chunk-HBBOR43A.js";
|
|
7
|
+
import {
|
|
8
|
+
Button
|
|
9
|
+
} from "./chunk-KR3BCFP7.js";
|
|
10
|
+
import {
|
|
11
|
+
cn
|
|
12
|
+
} from "./chunk-HCA5ODCD.js";
|
|
13
|
+
|
|
14
|
+
// src/side-drawer.tsx
|
|
15
|
+
import { X } from "lucide-react";
|
|
16
|
+
import * as React from "react";
|
|
17
|
+
import { createPortal } from "react-dom";
|
|
18
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
+
function SideDrawer({
|
|
20
|
+
isOpen,
|
|
21
|
+
title,
|
|
22
|
+
onClose,
|
|
23
|
+
children,
|
|
24
|
+
panelClassName
|
|
25
|
+
}) {
|
|
26
|
+
const mounted = useHasMounted();
|
|
27
|
+
const headingId = React.useId();
|
|
28
|
+
const panelRef = React.useRef(null);
|
|
29
|
+
useDialogLayer({
|
|
30
|
+
// Gated on `mounted` too: before that the panel is not rendered, so there
|
|
31
|
+
// would be nothing to move focus into.
|
|
32
|
+
active: isOpen && mounted,
|
|
33
|
+
containerRef: panelRef,
|
|
34
|
+
onEscape: onClose
|
|
35
|
+
});
|
|
36
|
+
if (!mounted || !isOpen) return null;
|
|
37
|
+
return createPortal(
|
|
38
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
"aria-hidden": true,
|
|
43
|
+
onClick: onClose,
|
|
44
|
+
className: "fixed inset-0 z-[90] bg-slate-950/30"
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ jsxs(
|
|
48
|
+
"aside",
|
|
49
|
+
{
|
|
50
|
+
ref: panelRef,
|
|
51
|
+
role: "dialog",
|
|
52
|
+
"aria-modal": "true",
|
|
53
|
+
"aria-labelledby": headingId,
|
|
54
|
+
tabIndex: -1,
|
|
55
|
+
className: cn(
|
|
56
|
+
"border-border bg-background fixed inset-y-0 right-0 z-[95] flex flex-col border-l shadow-2xl outline-none",
|
|
57
|
+
panelClassName ?? "w-full max-w-md"
|
|
58
|
+
),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "border-border flex items-center justify-between gap-3 border-b px-4 py-3", children: [
|
|
61
|
+
/* @__PURE__ */ jsx("h2", { id: headingId, className: "truncate text-base font-semibold", children: title }),
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
Button,
|
|
64
|
+
{
|
|
65
|
+
variant: "ghost",
|
|
66
|
+
size: "icon",
|
|
67
|
+
"aria-label": "Close panel",
|
|
68
|
+
onClick: onClose,
|
|
69
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4", "aria-hidden": true })
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto p-4", children })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] }),
|
|
78
|
+
document.body
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export {
|
|
83
|
+
SideDrawer
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=chunk-43ZUFY63.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/side-drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport { X } from \"lucide-react\";\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { Button } from \"./button\";\nimport { useDialogLayer } from \"./dialogLayer\";\nimport { useHasMounted } from \"./modal\";\nimport { cn } from \"./utils\";\n\ninterface SideDrawerProps {\n isOpen: boolean;\n title: string;\n onClose: () => void;\n children: React.ReactNode;\n /** Tailwind width class for the panel. Defaults to a reading-width column. */\n panelClassName?: string;\n}\n\n/**\n * A panel that slides in from the right.\n *\n * For content that belongs beside the page rather than on top of it — a queue\n * you glance at and dismiss, not a decision you have to answer. Unlike\n * `Modal`, it does not centre or dim the whole page to a stop: the table\n * underneath stays readable, which is the point of looking at both.\n */\nexport function SideDrawer({\n isOpen,\n title,\n onClose,\n children,\n panelClassName,\n}: SideDrawerProps) {\n const mounted = useHasMounted();\n const headingId = React.useId();\n const panelRef = React.useRef<HTMLElement>(null);\n\n useDialogLayer({\n // Gated on `mounted` too: before that the panel is not rendered, so there\n // would be nothing to move focus into.\n active: isOpen && mounted,\n containerRef: panelRef,\n onEscape: onClose,\n });\n\n if (!mounted || !isOpen) return null;\n\n return createPortal(\n <>\n <div\n aria-hidden\n onClick={onClose}\n className=\"fixed inset-0 z-[90] bg-slate-950/30\"\n />\n <aside\n ref={panelRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={headingId}\n tabIndex={-1}\n className={cn(\n \"border-border bg-background fixed inset-y-0 right-0 z-[95] flex flex-col border-l shadow-2xl outline-none\",\n panelClassName ?? \"w-full max-w-md\",\n )}\n >\n <div className=\"border-border flex items-center justify-between gap-3 border-b px-4 py-3\">\n <h2 id={headingId} className=\"truncate text-base font-semibold\">\n {title}\n </h2>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label=\"Close panel\"\n onClick={onClose}\n >\n <X className=\"h-4 w-4\" aria-hidden />\n </Button>\n </div>\n\n <div className=\"min-h-0 flex-1 overflow-y-auto p-4\">{children}</div>\n </aside>\n </>,\n document.body,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,SAAS,SAAS;AAClB,YAAY,WAAW;AACvB,SAAS,oBAAoB;AA8CzB,mBACE,KAgBE,YAjBJ;AAtBG,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoB;AAClB,QAAM,UAAU,cAAc;AAC9B,QAAM,YAAkB,YAAM;AAC9B,QAAM,WAAiB,aAAoB,IAAI;AAE/C,iBAAe;AAAA;AAAA;AAAA,IAGb,QAAQ,UAAU;AAAA,IAClB,cAAc;AAAA,IACd,UAAU;AAAA,EACZ,CAAC;AAED,MAAI,CAAC,WAAW,CAAC,OAAQ,QAAO;AAEhC,SAAO;AAAA,IACL,iCACE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,eAAW;AAAA,UACX,SAAS;AAAA,UACT,WAAU;AAAA;AAAA,MACZ;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,MAAK;AAAA,UACL,cAAW;AAAA,UACX,mBAAiB;AAAA,UACjB,UAAU;AAAA,UACV,WAAW;AAAA,YACT;AAAA,YACA,kBAAkB;AAAA,UACpB;AAAA,UAEA;AAAA,iCAAC,SAAI,WAAU,4EACb;AAAA,kCAAC,QAAG,IAAI,WAAW,WAAU,oCAC1B,iBACH;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,cAAW;AAAA,kBACX,SAAS;AAAA,kBAET,8BAAC,KAAE,WAAU,WAAU,eAAW,MAAC;AAAA;AAAA,cACrC;AAAA,eACF;AAAA,YAEA,oBAAC,SAAI,WAAU,sCAAsC,UAAS;AAAA;AAAA;AAAA,MAChE;AAAA,OACF;AAAA,IACA,SAAS;AAAA,EACX;AACF;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-HCA5ODCD.js";
|
|
4
|
+
|
|
5
|
+
// src/field.tsx
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function Field({
|
|
8
|
+
label,
|
|
9
|
+
required,
|
|
10
|
+
htmlFor,
|
|
11
|
+
as = "div",
|
|
12
|
+
className,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
const Wrapper = as;
|
|
16
|
+
const labelNode = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
label,
|
|
18
|
+
required ? /* @__PURE__ */ jsx("span", { className: "text-destructive ml-0.5", "aria-hidden": "true", children: "*" }) : null
|
|
19
|
+
] });
|
|
20
|
+
return /* @__PURE__ */ jsxs(Wrapper, { className: cn("space-y-1 text-sm", className), children: [
|
|
21
|
+
htmlFor && as === "div" ? /* @__PURE__ */ jsx("label", { htmlFor, className: "text-muted-foreground", children: labelNode }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: labelNode }),
|
|
22
|
+
children
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
Field
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=chunk-67ACNS42.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/field.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\ninterface FieldProps {\n label: React.ReactNode;\n required?: boolean;\n /**\n * Associates the label with a control via `htmlFor` / `id`. Prefer this for\n * native inputs rendered as siblings (not wrapped). For composite controls\n * (Autocomplete), omit and use `as=\"label\"` wrapping or an `aria-label`.\n */\n htmlFor?: string;\n /**\n * Render as a `<label>` (wraps a native control so clicking the text focuses\n * it) or a `<div>` (for composite controls like Autocomplete that manage\n * their own focus / render in a portal). Defaults to `div`.\n */\n as?: \"label\" | \"div\";\n className?: string;\n children: React.ReactNode;\n}\n\nexport function Field({\n label,\n required,\n htmlFor,\n as = \"div\",\n className,\n children,\n}: FieldProps) {\n const Wrapper = as;\n const labelNode = (\n <>\n {label}\n {required ? (\n <span className=\"text-destructive ml-0.5\" aria-hidden=\"true\">\n *\n </span>\n ) : null}\n </>\n );\n\n return (\n <Wrapper className={cn(\"space-y-1 text-sm\", className)}>\n {htmlFor && as === \"div\" ? (\n <label htmlFor={htmlFor} className=\"text-muted-foreground\">\n {labelNode}\n </label>\n ) : (\n <span className=\"text-muted-foreground\">{labelNode}</span>\n )}\n {children}\n </Wrapper>\n );\n}\n"],"mappings":";;;;;AAiCI,mBAGI,KAHJ;AAVG,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,KAAK;AAAA,EACL;AAAA,EACA;AACF,GAAe;AACb,QAAM,UAAU;AAChB,QAAM,YACJ,iCACG;AAAA;AAAA,IACA,WACC,oBAAC,UAAK,WAAU,2BAA0B,eAAY,QAAO,eAE7D,IACE;AAAA,KACN;AAGF,SACE,qBAAC,WAAQ,WAAW,GAAG,qBAAqB,SAAS,GAClD;AAAA,eAAW,OAAO,QACjB,oBAAC,WAAM,SAAkB,WAAU,yBAChC,qBACH,IAEA,oBAAC,UAAK,WAAU,yBAAyB,qBAAU;AAAA,IAEpD;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Autocomplete
|
|
3
|
+
} from "./chunk-PVK4WQJZ.js";
|
|
4
|
+
|
|
5
|
+
// src/select.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function optionText(node) {
|
|
9
|
+
if (node == null || typeof node === "boolean") return "";
|
|
10
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
11
|
+
if (Array.isArray(node)) return node.map(optionText).join("");
|
|
12
|
+
if (React.isValidElement(node)) {
|
|
13
|
+
return optionText(node.props.children);
|
|
14
|
+
}
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
function optionsFromChildren(children) {
|
|
18
|
+
const options = [];
|
|
19
|
+
React.Children.forEach(children, (child) => {
|
|
20
|
+
if (!React.isValidElement(child)) return;
|
|
21
|
+
if (child.type === React.Fragment) {
|
|
22
|
+
options.push(
|
|
23
|
+
...optionsFromChildren(
|
|
24
|
+
child.props.children
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const props = child.props;
|
|
30
|
+
const value = props.value == null ? "" : String(props.value);
|
|
31
|
+
options.push({
|
|
32
|
+
value,
|
|
33
|
+
label: optionText(props.children).trim() || value,
|
|
34
|
+
disabled: Boolean(props.disabled)
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
return options;
|
|
38
|
+
}
|
|
39
|
+
function Select({
|
|
40
|
+
id,
|
|
41
|
+
className,
|
|
42
|
+
disabled,
|
|
43
|
+
value,
|
|
44
|
+
placeholder,
|
|
45
|
+
children,
|
|
46
|
+
onChange,
|
|
47
|
+
size = "default",
|
|
48
|
+
"aria-label": ariaLabel
|
|
49
|
+
}) {
|
|
50
|
+
const options = optionsFromChildren(children);
|
|
51
|
+
const current = Array.isArray(value) ? String(value[0] ?? "") : value == null ? "" : String(value);
|
|
52
|
+
const blank = options.find((option) => option.value === "");
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
Autocomplete,
|
|
55
|
+
{
|
|
56
|
+
id,
|
|
57
|
+
className,
|
|
58
|
+
disabled: Boolean(disabled),
|
|
59
|
+
ariaLabel,
|
|
60
|
+
size,
|
|
61
|
+
options,
|
|
62
|
+
value: current,
|
|
63
|
+
clearable: false,
|
|
64
|
+
placeholder: placeholder ?? blank?.label ?? "Search\u2026",
|
|
65
|
+
onChange: (next) => onChange?.({
|
|
66
|
+
target: { value: next },
|
|
67
|
+
currentTarget: { value: next }
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
Select
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=chunk-6URKHMCF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/select.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { Autocomplete, type AutocompleteOption } from \"./autocomplete\";\n\ntype SelectChange = {\n target: { value: string };\n currentTarget: { value: string };\n};\n\nexport type SelectProps = {\n id?: string;\n className?: string;\n disabled?: boolean;\n /** Accessible name when the control is not wrapped in a label. */\n \"aria-label\"?: string;\n /** `compact` fits a spreadsheet cell. Typing still filters the list. */\n size?: \"default\" | \"compact\";\n value?: string | number | readonly string[];\n placeholder?: string;\n children?: React.ReactNode;\n onChange?: (event: SelectChange) => void;\n};\n\nfunction optionText(node: React.ReactNode): string {\n if (node == null || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\" || typeof node === \"number\") return String(node);\n if (Array.isArray(node)) return node.map(optionText).join(\"\");\n if (React.isValidElement<{ children?: React.ReactNode }>(node)) {\n return optionText(node.props.children);\n }\n return \"\";\n}\n\nfunction optionsFromChildren(children: React.ReactNode): AutocompleteOption[] {\n const options: AutocompleteOption[] = [];\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) return;\n if (child.type === React.Fragment) {\n options.push(\n ...optionsFromChildren(\n (child.props as { children?: React.ReactNode }).children,\n ),\n );\n return;\n }\n const props = child.props as {\n value?: string | number;\n disabled?: boolean;\n children?: React.ReactNode;\n };\n const value = props.value == null ? \"\" : String(props.value);\n options.push({\n value,\n label: optionText(props.children).trim() || value,\n disabled: Boolean(props.disabled),\n });\n });\n return options;\n}\n\n/**\n * The dropdown. It is the searchable autocomplete, not a native `<select>`,\n * so a long list can be typed into and an empty list still opens.\n */\nexport function Select({\n id,\n className,\n disabled,\n value,\n placeholder,\n children,\n onChange,\n size = \"default\",\n \"aria-label\": ariaLabel,\n}: SelectProps) {\n const options = optionsFromChildren(children);\n const current = Array.isArray(value)\n ? String(value[0] ?? \"\")\n : value == null\n ? \"\"\n : String(value);\n const blank = options.find((option) => option.value === \"\");\n\n return (\n <Autocomplete\n id={id}\n className={className}\n disabled={Boolean(disabled)}\n ariaLabel={ariaLabel}\n size={size}\n options={options}\n value={current}\n clearable={false}\n placeholder={placeholder ?? blank?.label ?? \"Search…\"}\n onChange={(next) =>\n onChange?.({\n target: { value: next },\n currentTarget: { value: next },\n })\n }\n />\n );\n}\n"],"mappings":";;;;;AAEA,YAAY,WAAW;AAoFnB;AA7DJ,SAAS,WAAW,MAA+B;AACjD,MAAI,QAAQ,QAAQ,OAAO,SAAS,UAAW,QAAO;AACtD,MAAI,OAAO,SAAS,YAAY,OAAO,SAAS,SAAU,QAAO,OAAO,IAAI;AAC5E,MAAI,MAAM,QAAQ,IAAI,EAAG,QAAO,KAAK,IAAI,UAAU,EAAE,KAAK,EAAE;AAC5D,MAAU,qBAA+C,IAAI,GAAG;AAC9D,WAAO,WAAW,KAAK,MAAM,QAAQ;AAAA,EACvC;AACA,SAAO;AACT;AAEA,SAAS,oBAAoB,UAAiD;AAC5E,QAAM,UAAgC,CAAC;AACvC,EAAM,eAAS,QAAQ,UAAU,CAAC,UAAU;AAC1C,QAAI,CAAO,qBAAe,KAAK,EAAG;AAClC,QAAI,MAAM,SAAe,gBAAU;AACjC,cAAQ;AAAA,QACN,GAAG;AAAA,UACA,MAAM,MAAyC;AAAA,QAClD;AAAA,MACF;AACA;AAAA,IACF;AACA,UAAM,QAAQ,MAAM;AAKpB,UAAM,QAAQ,MAAM,SAAS,OAAO,KAAK,OAAO,MAAM,KAAK;AAC3D,YAAQ,KAAK;AAAA,MACX;AAAA,MACA,OAAO,WAAW,MAAM,QAAQ,EAAE,KAAK,KAAK;AAAA,MAC5C,UAAU,QAAQ,MAAM,QAAQ;AAAA,IAClC,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AAMO,SAAS,OAAO;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,cAAc;AAChB,GAAgB;AACd,QAAM,UAAU,oBAAoB,QAAQ;AAC5C,QAAM,UAAU,MAAM,QAAQ,KAAK,IAC/B,OAAO,MAAM,CAAC,KAAK,EAAE,IACrB,SAAS,OACP,KACA,OAAO,KAAK;AAClB,QAAM,QAAQ,QAAQ,KAAK,CAAC,WAAW,OAAO,UAAU,EAAE;AAE1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU,QAAQ,QAAQ;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAa,eAAe,OAAO,SAAS;AAAA,MAC5C,UAAU,CAAC,SACT,WAAW;AAAA,QACT,QAAQ,EAAE,OAAO,KAAK;AAAA,QACtB,eAAe,EAAE,OAAO,KAAK;AAAA,MAC/B,CAAC;AAAA;AAAA,EAEL;AAEJ;","names":[]}
|