@invergent/ui-sdk 2.19.0 → 2.19.2
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 +11 -2
- package/dist/badge.d.cts +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/button-group.cjs +80 -0
- package/dist/button-group.cjs.map +1 -0
- package/dist/button-group.d.cts +17 -0
- package/dist/button-group.d.ts +17 -0
- package/dist/button-group.js +75 -0
- package/dist/button-group.js.map +1 -0
- package/dist/button.d.cts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/chip.cjs +3 -3
- package/dist/chip.cjs.map +1 -1
- package/dist/chip.d.cts +2 -4
- package/dist/chip.d.ts +2 -4
- package/dist/chip.js +3 -3
- package/dist/chip.js.map +1 -1
- package/dist/{chunk-IVMZANP7.cjs → chunk-ILCP5QXL.cjs} +6 -3
- package/dist/chunk-ILCP5QXL.cjs.map +1 -0
- package/dist/chunk-NSK344BJ.js +80 -0
- package/dist/chunk-NSK344BJ.js.map +1 -0
- package/dist/chunk-PH733KDD.js +141 -0
- package/dist/chunk-PH733KDD.js.map +1 -0
- package/dist/chunk-QEBQ5NUN.cjs +148 -0
- package/dist/chunk-QEBQ5NUN.cjs.map +1 -0
- package/dist/chunk-UXSDDJXM.cjs +88 -0
- package/dist/chunk-UXSDDJXM.cjs.map +1 -0
- package/dist/{chunk-CPAFEXKR.js → chunk-WO2SXSNH.js} +6 -3
- package/dist/chunk-WO2SXSNH.js.map +1 -0
- package/dist/collapsible-header.cjs +14 -3
- package/dist/collapsible-header.cjs.map +1 -1
- package/dist/collapsible-header.d.cts +4 -1
- package/dist/collapsible-header.d.ts +4 -1
- package/dist/collapsible-header.js +14 -3
- package/dist/collapsible-header.js.map +1 -1
- package/dist/command.cjs +177 -0
- package/dist/command.cjs.map +1 -0
- package/dist/command.d.cts +22 -0
- package/dist/command.d.ts +22 -0
- package/dist/command.js +167 -0
- package/dist/command.js.map +1 -0
- package/dist/confirm-dialog.cjs +5 -3
- package/dist/confirm-dialog.cjs.map +1 -1
- package/dist/confirm-dialog.d.cts +4 -1
- package/dist/confirm-dialog.d.ts +4 -1
- package/dist/confirm-dialog.js +5 -3
- package/dist/confirm-dialog.js.map +1 -1
- package/dist/field.cjs +1 -1
- package/dist/field.js +1 -1
- package/dist/hover-card.cjs +43 -0
- package/dist/hover-card.cjs.map +1 -0
- package/dist/hover-card.d.cts +9 -0
- package/dist/hover-card.d.ts +9 -0
- package/dist/hover-card.js +39 -0
- package/dist/hover-card.js.map +1 -0
- package/dist/input-group.cjs +30 -142
- package/dist/input-group.cjs.map +1 -1
- package/dist/input-group.js +5 -139
- package/dist/input-group.js.map +1 -1
- package/dist/item.cjs +196 -0
- package/dist/item.cjs.map +1 -0
- package/dist/item.d.cts +28 -0
- package/dist/item.d.ts +28 -0
- package/dist/item.js +185 -0
- package/dist/item.js.map +1 -0
- package/dist/popover.cjs +31 -82
- package/dist/popover.cjs.map +1 -1
- package/dist/popover.js +2 -78
- package/dist/popover.js.map +1 -1
- package/dist/progress-bar.cjs +22 -10
- package/dist/progress-bar.cjs.map +1 -1
- package/dist/progress-bar.d.cts +2 -1
- package/dist/progress-bar.d.ts +2 -1
- package/dist/progress-bar.js +22 -10
- package/dist/progress-bar.js.map +1 -1
- package/dist/rabbit-mark.cjs +30 -0
- package/dist/rabbit-mark.cjs.map +1 -0
- package/dist/rabbit-mark.d.cts +16 -0
- package/dist/rabbit-mark.d.ts +16 -0
- package/dist/rabbit-mark.js +26 -0
- package/dist/rabbit-mark.js.map +1 -0
- package/dist/responsive-panel.cjs +85 -0
- package/dist/responsive-panel.cjs.map +1 -0
- package/dist/responsive-panel.d.cts +33 -0
- package/dist/responsive-panel.d.ts +33 -0
- package/dist/responsive-panel.js +83 -0
- package/dist/responsive-panel.js.map +1 -0
- package/dist/tab-strip.cjs +74 -0
- package/dist/tab-strip.cjs.map +1 -0
- package/dist/tab-strip.d.cts +22 -0
- package/dist/tab-strip.d.ts +22 -0
- package/dist/tab-strip.js +71 -0
- package/dist/tab-strip.js.map +1 -0
- package/dist/tabs.d.cts +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/timeline.cjs +171 -0
- package/dist/timeline.cjs.map +1 -0
- package/dist/timeline.d.cts +28 -0
- package/dist/timeline.d.ts +28 -0
- package/dist/timeline.js +162 -0
- package/dist/timeline.js.map +1 -0
- package/dist/toggle-group.cjs +4 -2
- package/dist/toggle-group.cjs.map +1 -1
- package/dist/toggle-group.js +3 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/toggle.cjs +4 -4
- package/dist/toggle.d.cts +1 -1
- package/dist/toggle.d.ts +1 -1
- package/dist/toggle.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-CPAFEXKR.js.map +0 -1
- package/dist/chunk-IVMZANP7.cjs.map +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** The rabbit silhouette, in the coordinate space of {@link RABBIT_MARK_BOX}. */
|
|
4
|
+
declare const RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
|
|
5
|
+
/** The path's bounding box: what to scale against when painting it. */
|
|
6
|
+
declare const RABBIT_MARK_BOX: {
|
|
7
|
+
readonly x: 14.4021;
|
|
8
|
+
readonly y: 11.93;
|
|
9
|
+
readonly w: 95.1813;
|
|
10
|
+
readonly h: 109.058;
|
|
11
|
+
};
|
|
12
|
+
declare function RabbitMark({ className }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { RABBIT_MARK_BOX, RABBIT_MARK_PATH, RabbitMark };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/** The rabbit silhouette, in the coordinate space of {@link RABBIT_MARK_BOX}. */
|
|
4
|
+
declare const RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
|
|
5
|
+
/** The path's bounding box: what to scale against when painting it. */
|
|
6
|
+
declare const RABBIT_MARK_BOX: {
|
|
7
|
+
readonly x: 14.4021;
|
|
8
|
+
readonly y: 11.93;
|
|
9
|
+
readonly w: 95.1813;
|
|
10
|
+
readonly h: 109.058;
|
|
11
|
+
};
|
|
12
|
+
declare function RabbitMark({ className }: {
|
|
13
|
+
className?: string;
|
|
14
|
+
}): react_jsx_runtime.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { RABBIT_MARK_BOX, RABBIT_MARK_PATH, RabbitMark };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
// src/rabbit-mark.tsx
|
|
4
|
+
var RABBIT_MARK_PATH = "M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02";
|
|
5
|
+
var RABBIT_MARK_BOX = {
|
|
6
|
+
x: 14.4021,
|
|
7
|
+
y: 11.93,
|
|
8
|
+
w: 95.1813,
|
|
9
|
+
h: 109.058
|
|
10
|
+
};
|
|
11
|
+
function RabbitMark({ className }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
"svg",
|
|
14
|
+
{
|
|
15
|
+
className,
|
|
16
|
+
viewBox: "14.4021 11.93 95.1813 109.058",
|
|
17
|
+
fill: "currentColor",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: /* @__PURE__ */ jsx("path", { d: RABBIT_MARK_PATH })
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { RABBIT_MARK_BOX, RABBIT_MARK_PATH, RabbitMark };
|
|
25
|
+
//# sourceMappingURL=rabbit-mark.js.map
|
|
26
|
+
//# sourceMappingURL=rabbit-mark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/rabbit-mark.tsx"],"names":[],"mappings":";;;AAeO,IAAM,gBAAA,GACX;AAGK,IAAM,eAAA,GAAkB;AAAA,EAC7B,CAAA,EAAG,OAAA;AAAA,EACH,CAAA,EAAG,KAAA;AAAA,EACH,CAAA,EAAG,OAAA;AAAA,EACH,CAAA,EAAG;AACL;AAEO,SAAS,UAAA,CAAW,EAAE,SAAA,EAAU,EAA2B;AAChE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,OAAA,EAAQ,+BAAA;AAAA,MACR,IAAA,EAAK,cAAA;AAAA,MACL,aAAA,EAAY,MAAA;AAAA,MAEZ,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,CAAA,EAAG,gBAAA,EAAkB;AAAA;AAAA,GAC7B;AAEJ","file":"rabbit-mark.js","sourcesContent":["// Copyright (c) 2026, Invergent SA, developed by Flavius Burca\n// SPDX-License-Identifier: AGPL-3.0-only\n//\n// The Surogate rabbit, as one path.\n//\n// Lifted from the brand favicon and stripped to the silhouette: the\n// circle, the amber ground and the registered mark all belong to the\n// full lockup, not to a 16px glyph. The viewBox is the path's own\n// bounding box, so the mark fills whatever box it is given the way a\n// lucide icon does, and `currentColor` lets it inherit like one too.\n//\n// The path is exported on its own because the whiteboard also paints\n// it onto a canvas, where there is no DOM to render an `<svg>` into.\n\n/** The rabbit silhouette, in the coordinate space of {@link RABBIT_MARK_BOX}. */\nexport const RABBIT_MARK_PATH =\n \"M49.71,46.83c0,.23.02.45.07.67,2.1.49,4.16,1.07,6.18,1.74.58-.64.94-1.48.94-2.42,0-1.98-1.61-3.59-3.59-3.59s-3.59,1.61-3.59,3.59M33.95,78.3c3.1-5.1,6.72-8.89,11.64-12.21.61-.42,1.24-.8,1.88-1.17.44-.25.61-.66.58-1.05,0-.53-.49-.91-.93-1.12-1.34-.62-2.72-1.5-4.06-2.54-1.57-1.22-3.01-2.59-4.36-4.06-.95-1.04-2.02-2.38-3-3.81-.81-1.18-.63-2.77.43-3.73,1.1-1,2.26-1.92,3.48-2.76.36-.25.72-.49,1.1-.73,2.43-1.55,5.05-2.79,7.79-3.7,3.23-1.07,6.62-1.66,10.03-1.74.59-.35,1.19-.69,1.8-1.01,1.66-.88,3.38-1.62,5.17-2.21,1.58-.54,3.2-.95,4.85-1.24,3.28-.59,6.64-.7,9.95-.32,1.23.14,2.45.34,3.68.62,2.87.64,5.59,1.62,8.09,2.9.54.27.71.95.36,1.45-1.58,2.22-3.46,4.25-5.5,6.05-3.01,2.65-6.51,4.75-10.26,6.17-2.32.88-4.75,1.53-7.22,1.91-.62.1-.78.9-.24,1.22,0,0,.01,0,.02.01,6.97,4.05,13.1,9.22,18.36,15.32.72.83,1.42,1.68,2.1,2.53,3.36,4.22,6.23,8.82,8.56,13.68,1.8,3.73,3.27,7.63,4.39,11.62.73,2.6,1.34,5.24,1.76,7.91.11.76-.87,1.16-1.3.53-1.15-1.69-2.31-3.35-3.61-4.93-1.2-1.46-2.46-2.86-3.75-4.24-5.44-5.8-11.84-10.7-18.84-14.48-7.32-3.94-15.09-6.38-23.44-6.53-2.23-.04-4.46.08-6.68.3-4.05.43-8.02,1.28-11.93,2.4-.03,0-.05.01-.08.02,0,0-.01,0-.02,0-.07.02-.14.03-.21.03-.53,0-.91-.6-.61-1.09M50.95,12.97c-1.31,1.16-2.2,2.71-2.9,4.29-1.66,3.74-2.85,7.74-3.52,11.77-.32,1.92-.56,3.87-1.28,5.69-.17.44-.37.87-.6,1.28-1.18,2.1-3.37,3.19-5.6,3.86-4.96,1.47-10.14,1.97-15.25,2.65-2.37.31-8.03,1.12-7.34,4.69.46,2.36,2.26,4.16,4.08,5.6,2.66,2.11,5.44,4.09,8.33,5.88,1.87,1.15,3.85,2.11,5.6,3.44,1.74,1.33,3.15,3.05,3.58,5.25.22,1.16-.18,2.35-1,3.2-1.57,1.63-3,3.41-4.25,5.29-1.32,2.1-2.38,4.35-3.25,6.65-.59,1.44.97,2.98,2.41,2.37.53-.21,1.07-.41,1.61-.61,2.26-.82,4.68.73,4.93,3.12.17,1.61.38,3.17.63,4.57.46,2.57,3.14,3.63,5.32,1.41,2.84-2.88,4.66-6.31,7.84-8.86,2.53-2.03,6.26-4.17,9.71-3.59,3.17.56,6.27,1.52,9.23,2.85,5.32,2.32,10.36,5.29,14.95,8.86,9.17,7.1,16.56,16.51,21.27,27.1.93,2.07,4.03,1.44,4.1-.83.55-17.71-5.72-35.46-17.11-49.01-2.87-3.42-6.07-6.65-9.59-9.44-.88-.8-1.54-1.7-1.38-2.93.38-2.97,2-4.32,4.04-5.85,2.51-1.89,5.02-3.85,7.16-6.21.03-.03.06-.06.09-.1,1.24-1.37,2.38-2.83,3.4-4.37,1.2-1.81.6-4.26-1.3-5.31,0,0-.96-.52-1.45-.76-2.72-1.34-5.61-2.36-8.6-3.03-2.76-.62-5.58-.93-8.38-.93-2.38,0-4.76.22-7.09.67-1.96.37-3.97-.31-5.25-1.84-.28-.34-.54-.69-.79-1.04-.58-.84-1.09-1.71-1.63-2.58-1.29-2.06-1.87-3.63-2.89-5.84-1.06-2.29-1.85-4.73-3.26-6.86-.73-1.11-1.53-1.54-2.32-1.54s-1.54.41-2.24,1.02\";\n\n/** The path's bounding box: what to scale against when painting it. */\nexport const RABBIT_MARK_BOX = {\n x: 14.4021,\n y: 11.93,\n w: 95.1813,\n h: 109.058,\n} as const;\n\nexport function RabbitMark({ className }: { className?: string }) {\n return (\n <svg\n className={className}\n viewBox=\"14.4021 11.93 95.1813 109.058\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d={RABBIT_MARK_PATH} />\n </svg>\n );\n}\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkUXSDDJXM_cjs = require('./chunk-UXSDDJXM.cjs');
|
|
4
|
+
var chunk6YHDDRIM_cjs = require('./chunk-6YHDDRIM.cjs');
|
|
5
|
+
var radixUi = require('radix-ui');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
var MOBILE_QUERY = "(max-width: 767px)";
|
|
10
|
+
function subscribe(onChange) {
|
|
11
|
+
const mql = window.matchMedia(MOBILE_QUERY);
|
|
12
|
+
mql.addEventListener("change", onChange);
|
|
13
|
+
return () => mql.removeEventListener("change", onChange);
|
|
14
|
+
}
|
|
15
|
+
function useIsMobile() {
|
|
16
|
+
return react.useSyncExternalStore(
|
|
17
|
+
subscribe,
|
|
18
|
+
() => window.matchMedia(MOBILE_QUERY).matches,
|
|
19
|
+
// No viewport when server-rendered; assume desktop, as the components do.
|
|
20
|
+
() => false
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function ResponsivePanel({
|
|
24
|
+
open,
|
|
25
|
+
onOpenChange,
|
|
26
|
+
trigger,
|
|
27
|
+
title,
|
|
28
|
+
children,
|
|
29
|
+
align = "start",
|
|
30
|
+
popoverClassName
|
|
31
|
+
}) {
|
|
32
|
+
const isMobile = useIsMobile();
|
|
33
|
+
if (!isMobile) {
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkUXSDDJXM_cjs.Popover, { open, onOpenChange, children: [
|
|
35
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkUXSDDJXM_cjs.PopoverTrigger, { asChild: true, children: trigger }),
|
|
36
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
chunkUXSDDJXM_cjs.PopoverContent,
|
|
38
|
+
{
|
|
39
|
+
side: "top",
|
|
40
|
+
align,
|
|
41
|
+
className: chunk6YHDDRIM_cjs.cn("w-64 overflow-hidden rounded-xl p-1", popoverClassName),
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Root, { open, onOpenChange, children: [
|
|
48
|
+
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Trigger, { asChild: true, children: trigger }),
|
|
49
|
+
/* @__PURE__ */ jsxRuntime.jsxs(radixUi.Dialog.Portal, { children: [
|
|
50
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
51
|
+
radixUi.Dialog.Overlay,
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "responsive-panel-overlay",
|
|
54
|
+
className: "fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
58
|
+
radixUi.Dialog.Content,
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "responsive-panel-sheet",
|
|
61
|
+
"aria-describedby": void 0,
|
|
62
|
+
className: chunk6YHDDRIM_cjs.cn(
|
|
63
|
+
"fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg",
|
|
64
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom"
|
|
65
|
+
),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsxRuntime.jsx(radixUi.Dialog.Title, { className: "sr-only", children: title }),
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
"aria-hidden": "true",
|
|
72
|
+
className: "mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1", children })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] })
|
|
80
|
+
] });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.ResponsivePanel = ResponsivePanel;
|
|
84
|
+
//# sourceMappingURL=responsive-panel.cjs.map
|
|
85
|
+
//# sourceMappingURL=responsive-panel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/use-is-mobile.ts","../src/responsive-panel.tsx"],"names":["useSyncExternalStore","jsxs","Popover","jsx","PopoverTrigger","PopoverContent","cn","DialogPrimitive"],"mappings":";;;;;;;;AAQA,IAAM,YAAA,GAAe,oBAAA;AAOrB,SAAS,UAAU,QAAA,EAAkC;AACnD,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA;AAC1C,EAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,EAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AACzD;AASO,SAAS,WAAA,GAAuB;AACrC,EAAA,OAAOA,0BAAA;AAAA,IACL,SAAA;AAAA,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;AAAA,UACC,WAAA,EAAU,wBAAA;AAAA,UACV,kBAAA,EAAkB,MAAA;AAAA,UAClB,SAAA,EAAWD,oBAAA;AAAA,YACT,8LAAA;AAAA,YACA;AAAA,WACF;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAAH,cAAA,CAACI,cAAA,CAAgB,KAAA,EAAhB,EAAsB,SAAA,EAAU,WAC9B,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,4BAIAJ,cAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAU;AAAA;AAAA,aACZ;AAAA,4BACAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uDAAA,EACZ,QAAA,EACH;AAAA;AAAA;AAAA;AACF,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"responsive-panel.cjs","sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * The `md` breakpoint, matching the Tailwind default the components'\n * responsive classes use. Anything that needs to *render* differently on a\n * phone (rather than just restyle) reads this; a media query alone cannot\n * swap a popover for a sheet, because they are different components.\n */\nconst MOBILE_QUERY = \"(max-width: 767px)\";\n\n// Deliberately not caching the MediaQueryList across calls. getSnapshot does\n// run per render, but matchMedia is ~1µs and a module-level cache would pin\n// the first `window.matchMedia` this module ever saw — which makes the hook\n// untestable by stubbing it, and the sheet branch is only reachable in tests\n// that way. Not a trade worth making for a cost that does not register.\nfunction subscribe(onChange: () => void): () => void {\n const mql = window.matchMedia(MOBILE_QUERY);\n mql.addEventListener(\"change\", onChange);\n return () => mql.removeEventListener(\"change\", onChange);\n}\n\n/**\n * True while the viewport is narrower than `md`.\n *\n * Reads synchronously on the first render rather than filling in from an\n * effect: a value that says \"desktop\" for one frame is invisible for a class\n * name and wrong for anything that decides *which component to mount*.\n */\nexport function useIsMobile(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(MOBILE_QUERY).matches,\n // No viewport when server-rendered; assume desktop, as the components do.\n () => false,\n );\n}\n","// A panel that is a popover with a cursor and a bottom sheet on a phone.\n//\n// The composer's secondary controls (tools, session context) open panels that\n// are anchored above a ~32px button. That is right on a desktop and wrong on a\n// phone: an anchored popover near the bottom of the screen has nowhere to go,\n// its content is capped by whatever space is left above the composer, and the\n// whole thing sits under the thumb that opened it. A sheet rising from the\n// bottom edge has the full width, as much height as it needs, and lands where\n// the hand already is.\n//\n// The two are different components, not one component with different classes,\n// so the choice is made in JS — see useIsMobile.\n\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { useIsMobile } from \"./lib/use-is-mobile\";\nimport { cn } from \"./lib/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface ResponsivePanelProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** The control that opens the panel. Rendered as the trigger in both forms. */\n trigger: ReactNode;\n /**\n * Names the sheet for screen readers. Radix Dialog requires an accessible\n * name; it is visually hidden, since the panel's own contents are labelled.\n */\n title: string;\n children: ReactNode;\n /** Popover-only; the sheet is always full width. */\n align?: ComponentProps<typeof PopoverContent>[\"align\"];\n /**\n * Styling for the popover form only.\n *\n * Deliberately not a shared `className`: `cn` is tailwind-merge, so a class\n * written for the popover silently deletes a conflicting one from the\n * sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are\n * the same conflict group, so passing the popover's `p-0` through dropped\n * the sheet's home-indicator inset — and a `divide-y` meant for the\n * popover's sections drew a rule under the sheet's grab handle instead.\n */\n popoverClassName?: string;\n}\n\nexport function ResponsivePanel({\n open,\n onOpenChange,\n trigger,\n title,\n children,\n align = \"start\",\n popoverClassName,\n}: ResponsivePanelProps) {\n const isMobile = useIsMobile();\n\n if (!isMobile) {\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent\n side=\"top\"\n align={align}\n className={cn(\"w-64 overflow-hidden rounded-xl p-1\", popoverClassName)}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n data-slot=\"responsive-panel-overlay\"\n className=\"fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\"\n />\n <DialogPrimitive.Content\n data-slot=\"responsive-panel-sheet\"\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg\",\n \"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom\",\n )}\n >\n <DialogPrimitive.Title className=\"sr-only\">\n {title}\n </DialogPrimitive.Title>\n {/* Not draggable — Radix has no drag gesture and the sheet is short\n enough that a grab bar would only promise one. It reads as the\n handle the shape implies while staying purely decorative. */}\n <div\n aria-hidden=\"true\"\n className=\"mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30\"\n />\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain p-1\">\n {children}\n </div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
+
import { PopoverContent } from './popover.cjs';
|
|
4
|
+
import 'radix-ui';
|
|
5
|
+
|
|
6
|
+
interface ResponsivePanelProps {
|
|
7
|
+
open: boolean;
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
/** The control that opens the panel. Rendered as the trigger in both forms. */
|
|
10
|
+
trigger: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Names the sheet for screen readers. Radix Dialog requires an accessible
|
|
13
|
+
* name; it is visually hidden, since the panel's own contents are labelled.
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/** Popover-only; the sheet is always full width. */
|
|
18
|
+
align?: ComponentProps<typeof PopoverContent>["align"];
|
|
19
|
+
/**
|
|
20
|
+
* Styling for the popover form only.
|
|
21
|
+
*
|
|
22
|
+
* Deliberately not a shared `className`: `cn` is tailwind-merge, so a class
|
|
23
|
+
* written for the popover silently deletes a conflicting one from the
|
|
24
|
+
* sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are
|
|
25
|
+
* the same conflict group, so passing the popover's `p-0` through dropped
|
|
26
|
+
* the sheet's home-indicator inset — and a `divide-y` meant for the
|
|
27
|
+
* popover's sections drew a rule under the sheet's grab handle instead.
|
|
28
|
+
*/
|
|
29
|
+
popoverClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
declare function ResponsivePanel({ open, onOpenChange, trigger, title, children, align, popoverClassName, }: ResponsivePanelProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { ResponsivePanel, type ResponsivePanelProps };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
+
import { PopoverContent } from './popover.js';
|
|
4
|
+
import 'radix-ui';
|
|
5
|
+
|
|
6
|
+
interface ResponsivePanelProps {
|
|
7
|
+
open: boolean;
|
|
8
|
+
onOpenChange: (open: boolean) => void;
|
|
9
|
+
/** The control that opens the panel. Rendered as the trigger in both forms. */
|
|
10
|
+
trigger: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Names the sheet for screen readers. Radix Dialog requires an accessible
|
|
13
|
+
* name; it is visually hidden, since the panel's own contents are labelled.
|
|
14
|
+
*/
|
|
15
|
+
title: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
/** Popover-only; the sheet is always full width. */
|
|
18
|
+
align?: ComponentProps<typeof PopoverContent>["align"];
|
|
19
|
+
/**
|
|
20
|
+
* Styling for the popover form only.
|
|
21
|
+
*
|
|
22
|
+
* Deliberately not a shared `className`: `cn` is tailwind-merge, so a class
|
|
23
|
+
* written for the popover silently deletes a conflicting one from the
|
|
24
|
+
* sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are
|
|
25
|
+
* the same conflict group, so passing the popover's `p-0` through dropped
|
|
26
|
+
* the sheet's home-indicator inset — and a `divide-y` meant for the
|
|
27
|
+
* popover's sections drew a rule under the sheet's grab handle instead.
|
|
28
|
+
*/
|
|
29
|
+
popoverClassName?: string;
|
|
30
|
+
}
|
|
31
|
+
declare function ResponsivePanel({ open, onOpenChange, trigger, title, children, align, popoverClassName, }: ResponsivePanelProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
|
|
33
|
+
export { ResponsivePanel, type ResponsivePanelProps };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-NSK344BJ.js';
|
|
2
|
+
import { cn } from './chunk-LZGII7SX.js';
|
|
3
|
+
import { Dialog } from 'radix-ui';
|
|
4
|
+
import { useSyncExternalStore } from 'react';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var MOBILE_QUERY = "(max-width: 767px)";
|
|
8
|
+
function subscribe(onChange) {
|
|
9
|
+
const mql = window.matchMedia(MOBILE_QUERY);
|
|
10
|
+
mql.addEventListener("change", onChange);
|
|
11
|
+
return () => mql.removeEventListener("change", onChange);
|
|
12
|
+
}
|
|
13
|
+
function useIsMobile() {
|
|
14
|
+
return useSyncExternalStore(
|
|
15
|
+
subscribe,
|
|
16
|
+
() => window.matchMedia(MOBILE_QUERY).matches,
|
|
17
|
+
// No viewport when server-rendered; assume desktop, as the components do.
|
|
18
|
+
() => false
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function ResponsivePanel({
|
|
22
|
+
open,
|
|
23
|
+
onOpenChange,
|
|
24
|
+
trigger,
|
|
25
|
+
title,
|
|
26
|
+
children,
|
|
27
|
+
align = "start",
|
|
28
|
+
popoverClassName
|
|
29
|
+
}) {
|
|
30
|
+
const isMobile = useIsMobile();
|
|
31
|
+
if (!isMobile) {
|
|
32
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: trigger }),
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
PopoverContent,
|
|
36
|
+
{
|
|
37
|
+
side: "top",
|
|
38
|
+
align,
|
|
39
|
+
className: cn("w-64 overflow-hidden rounded-xl p-1", popoverClassName),
|
|
40
|
+
children
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { open, onOpenChange, children: [
|
|
46
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { asChild: true, children: trigger }),
|
|
47
|
+
/* @__PURE__ */ jsxs(Dialog.Portal, { children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
Dialog.Overlay,
|
|
50
|
+
{
|
|
51
|
+
"data-slot": "responsive-panel-overlay",
|
|
52
|
+
className: "fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0"
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ jsxs(
|
|
56
|
+
Dialog.Content,
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "responsive-panel-sheet",
|
|
59
|
+
"aria-describedby": void 0,
|
|
60
|
+
className: cn(
|
|
61
|
+
"fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg",
|
|
62
|
+
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom"
|
|
63
|
+
),
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Dialog.Title, { className: "sr-only", children: title }),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
className: "mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30"
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain p-1", children })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] })
|
|
78
|
+
] });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { ResponsivePanel };
|
|
82
|
+
//# sourceMappingURL=responsive-panel.js.map
|
|
83
|
+
//# sourceMappingURL=responsive-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/use-is-mobile.ts","../src/responsive-panel.tsx"],"names":["DialogPrimitive"],"mappings":";;;;;;AAQA,IAAM,YAAA,GAAe,oBAAA;AAOrB,SAAS,UAAU,QAAA,EAAkC;AACnD,EAAA,MAAM,GAAA,GAAM,MAAA,CAAO,UAAA,CAAW,YAAY,CAAA;AAC1C,EAAA,GAAA,CAAI,gBAAA,CAAiB,UAAU,QAAQ,CAAA;AACvC,EAAA,OAAO,MAAM,GAAA,CAAI,mBAAA,CAAoB,QAAA,EAAU,QAAQ,CAAA;AACzD;AASO,SAAS,WAAA,GAAuB;AACrC,EAAA,OAAO,oBAAA;AAAA,IACL,SAAA;AAA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A,EAAU,wBAAA;AAAA,UACV,kBAAA,EAAkB,MAAA;AAAA,UAClB,SAAA,EAAW,EAAA;AAAA,YACT,8LAAA;AAAA,YACA;AAAA,WACF;AAAA,UAEA,QAAA,EAAA;AAAA,4BAAA,GAAA,CAACA,MAAA,CAAgB,KAAA,EAAhB,EAAsB,SAAA,EAAU,WAC9B,QAAA,EAAA,KAAA,EACH,CAAA;AAAA,4BAIA,GAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,aAAA,EAAY,MAAA;AAAA,gBACZ,SAAA,EAAU;AAAA;AAAA,aACZ;AAAA,4BACA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,uDAAA,EACZ,QAAA,EACH;AAAA;AAAA;AAAA;AACF,KAAA,EACF;AAAA,GAAA,EACF,CAAA;AAEJ","file":"responsive-panel.js","sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * The `md` breakpoint, matching the Tailwind default the components'\n * responsive classes use. Anything that needs to *render* differently on a\n * phone (rather than just restyle) reads this; a media query alone cannot\n * swap a popover for a sheet, because they are different components.\n */\nconst MOBILE_QUERY = \"(max-width: 767px)\";\n\n// Deliberately not caching the MediaQueryList across calls. getSnapshot does\n// run per render, but matchMedia is ~1µs and a module-level cache would pin\n// the first `window.matchMedia` this module ever saw — which makes the hook\n// untestable by stubbing it, and the sheet branch is only reachable in tests\n// that way. Not a trade worth making for a cost that does not register.\nfunction subscribe(onChange: () => void): () => void {\n const mql = window.matchMedia(MOBILE_QUERY);\n mql.addEventListener(\"change\", onChange);\n return () => mql.removeEventListener(\"change\", onChange);\n}\n\n/**\n * True while the viewport is narrower than `md`.\n *\n * Reads synchronously on the first render rather than filling in from an\n * effect: a value that says \"desktop\" for one frame is invisible for a class\n * name and wrong for anything that decides *which component to mount*.\n */\nexport function useIsMobile(): boolean {\n return useSyncExternalStore(\n subscribe,\n () => window.matchMedia(MOBILE_QUERY).matches,\n // No viewport when server-rendered; assume desktop, as the components do.\n () => false,\n );\n}\n","// A panel that is a popover with a cursor and a bottom sheet on a phone.\n//\n// The composer's secondary controls (tools, session context) open panels that\n// are anchored above a ~32px button. That is right on a desktop and wrong on a\n// phone: an anchored popover near the bottom of the screen has nowhere to go,\n// its content is capped by whatever space is left above the composer, and the\n// whole thing sits under the thumb that opened it. A sheet rising from the\n// bottom edge has the full width, as much height as it needs, and lands where\n// the hand already is.\n//\n// The two are different components, not one component with different classes,\n// so the choice is made in JS — see useIsMobile.\n\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { useIsMobile } from \"./lib/use-is-mobile\";\nimport { cn } from \"./lib/utils\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\";\n\nexport interface ResponsivePanelProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** The control that opens the panel. Rendered as the trigger in both forms. */\n trigger: ReactNode;\n /**\n * Names the sheet for screen readers. Radix Dialog requires an accessible\n * name; it is visually hidden, since the panel's own contents are labelled.\n */\n title: string;\n children: ReactNode;\n /** Popover-only; the sheet is always full width. */\n align?: ComponentProps<typeof PopoverContent>[\"align\"];\n /**\n * Styling for the popover form only.\n *\n * Deliberately not a shared `className`: `cn` is tailwind-merge, so a class\n * written for the popover silently deletes a conflicting one from the\n * sheet's own base list. `p-0` and `pb-[env(safe-area-inset-bottom)]` are\n * the same conflict group, so passing the popover's `p-0` through dropped\n * the sheet's home-indicator inset — and a `divide-y` meant for the\n * popover's sections drew a rule under the sheet's grab handle instead.\n */\n popoverClassName?: string;\n}\n\nexport function ResponsivePanel({\n open,\n onOpenChange,\n trigger,\n title,\n children,\n align = \"start\",\n popoverClassName,\n}: ResponsivePanelProps) {\n const isMobile = useIsMobile();\n\n if (!isMobile) {\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>{trigger}</PopoverTrigger>\n <PopoverContent\n side=\"top\"\n align={align}\n className={cn(\"w-64 overflow-hidden rounded-xl p-1\", popoverClassName)}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n }\n\n return (\n <DialogPrimitive.Root open={open} onOpenChange={onOpenChange}>\n <DialogPrimitive.Trigger asChild>{trigger}</DialogPrimitive.Trigger>\n <DialogPrimitive.Portal>\n <DialogPrimitive.Overlay\n data-slot=\"responsive-panel-overlay\"\n className=\"fixed inset-0 z-50 bg-black/40 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\"\n />\n <DialogPrimitive.Content\n data-slot=\"responsive-panel-sheet\"\n aria-describedby={undefined}\n className={cn(\n \"fixed inset-x-0 bottom-0 z-50 flex max-h-[80svh] flex-col overflow-hidden rounded-t-2xl border-t border-border bg-popover pb-[env(safe-area-inset-bottom)] text-popover-foreground shadow-lg\",\n \"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom\",\n )}\n >\n <DialogPrimitive.Title className=\"sr-only\">\n {title}\n </DialogPrimitive.Title>\n {/* Not draggable — Radix has no drag gesture and the sheet is short\n enough that a grab bar would only promise one. It reads as the\n handle the shape implies while staying purely decorative. */}\n <div\n aria-hidden=\"true\"\n className=\"mx-auto mt-2.5 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/30\"\n />\n <div className=\"min-h-0 flex-1 overflow-y-auto overscroll-contain p-1\">\n {children}\n </div>\n </DialogPrimitive.Content>\n </DialogPrimitive.Portal>\n </DialogPrimitive.Root>\n );\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk6YHDDRIM_cjs = require('./chunk-6YHDDRIM.cjs');
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function TabStrip({ className, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
role: "tablist",
|
|
12
|
+
"data-slot": "tab-strip",
|
|
13
|
+
className: chunk6YHDDRIM_cjs.cn("flex min-w-0 items-center gap-0.5 overflow-x-auto", className),
|
|
14
|
+
...props
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
function TabStripTab({
|
|
19
|
+
active = false,
|
|
20
|
+
onSelect,
|
|
21
|
+
onClose,
|
|
22
|
+
closeLabel = "Close tab",
|
|
23
|
+
className,
|
|
24
|
+
children,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
role: "tab",
|
|
31
|
+
tabIndex: 0,
|
|
32
|
+
"aria-selected": active,
|
|
33
|
+
"data-slot": "tab-strip-tab",
|
|
34
|
+
"data-active": active,
|
|
35
|
+
onClick: onSelect,
|
|
36
|
+
onKeyDown: (event) => {
|
|
37
|
+
if (event.target !== event.currentTarget) return;
|
|
38
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
onSelect();
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
className: chunk6YHDDRIM_cjs.cn(
|
|
44
|
+
"flex h-7 min-h-11 max-w-40 shrink-0 cursor-pointer items-center gap-1 rounded-[7px] pl-2.5 text-[12px] transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/40 pointer-fine:min-h-0",
|
|
45
|
+
onClose ? "pr-1" : "pr-2.5",
|
|
46
|
+
active ? "bg-foreground/[0.08] font-medium text-foreground" : "text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children }),
|
|
52
|
+
onClose && /* @__PURE__ */ jsxRuntime.jsx(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
type: "button",
|
|
56
|
+
"data-slot": "tab-strip-close",
|
|
57
|
+
"aria-label": closeLabel,
|
|
58
|
+
onClick: (event) => {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
onClose();
|
|
61
|
+
},
|
|
62
|
+
className: "relative flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted-foreground transition-colors outline-none after:absolute after:-inset-1.5 hover:bg-foreground/[0.08] hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
63
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, { className: "size-3" })
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
exports.TabStrip = TabStrip;
|
|
72
|
+
exports.TabStripTab = TabStripTab;
|
|
73
|
+
//# sourceMappingURL=tab-strip.cjs.map
|
|
74
|
+
//# sourceMappingURL=tab-strip.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tab-strip.tsx"],"names":["jsx","cn","jsxs","XIcon"],"mappings":";;;;;;AAUA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAgC;AACtE,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,SAAA;AAAA,MACL,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAWC,oBAAA,CAAG,mDAAA,EAAqD,SAAS,CAAA;AAAA,MAC3E,GAAG;AAAA;AAAA,GACN;AAEJ;AAMA,SAAS,WAAA,CAAY;AAAA,EACnB,MAAA,GAAS,KAAA;AAAA,EACT,QAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA,GAAa,WAAA;AAAA,EACb,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAMG;AACD,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","sourcesContent":["import * as React from \"react\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"./lib/utils\"\n\n/**\n * A compact strip of tabs that close (a browser's open pages), drawn as the\n * Work view switch draws its segments: muted text, a faint fill on the open\n * one. It switches nothing itself; each tab says what it does.\n */\nfunction TabStrip({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n role=\"tablist\"\n data-slot=\"tab-strip\"\n className={cn(\"flex min-w-0 items-center gap-0.5 overflow-x-auto\", className)}\n {...props}\n />\n )\n}\n\n/**\n * One tab, with an × once `onClose` is given. A `div` with the tab role, not\n * a button: the × is a button, and a button cannot hold another.\n */\nfunction TabStripTab({\n active = false,\n onSelect,\n onClose,\n closeLabel = \"Close tab\",\n className,\n children,\n ...props\n}: Omit<React.ComponentProps<\"div\">, \"onSelect\"> & {\n active?: boolean\n onSelect: () => void\n onClose?: () => void\n /** The ×'s accessible name. */\n closeLabel?: string\n}) {\n return (\n <div\n role=\"tab\"\n tabIndex={0}\n aria-selected={active}\n data-slot=\"tab-strip-tab\"\n data-active={active}\n onClick={onSelect}\n onKeyDown={(event) => {\n if (event.target !== event.currentTarget) return\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n onSelect()\n }\n }}\n className={cn(\n \"flex h-7 min-h-11 max-w-40 shrink-0 cursor-pointer items-center gap-1 rounded-[7px] pl-2.5 text-[12px] transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/40 pointer-fine:min-h-0\",\n onClose ? \"pr-1\" : \"pr-2.5\",\n active\n ? \"bg-foreground/[0.08] font-medium text-foreground\"\n : \"text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground\",\n className\n )}\n {...props}\n >\n <span className=\"min-w-0 truncate\">{children}</span>\n {onClose && (\n <button\n type=\"button\"\n data-slot=\"tab-strip-close\"\n aria-label={closeLabel}\n onClick={(event) => {\n // Closing a tab is not opening it.\n event.stopPropagation()\n onClose()\n }}\n // The × is 16px; the overlay gives it a usable hit area.\n className=\"relative flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted-foreground transition-colors outline-none after:absolute after:-inset-1.5 hover:bg-foreground/[0.08] hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40\"\n >\n <XIcon className=\"size-3\" />\n </button>\n )}\n </div>\n )\n}\n\nexport { TabStrip, TabStripTab }\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A compact strip of tabs that close (a browser's open pages), drawn as the
|
|
6
|
+
* Work view switch draws its segments: muted text, a faint fill on the open
|
|
7
|
+
* one. It switches nothing itself; each tab says what it does.
|
|
8
|
+
*/
|
|
9
|
+
declare function TabStrip({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* One tab, with an × once `onClose` is given. A `div` with the tab role, not
|
|
12
|
+
* a button: the × is a button, and a button cannot hold another.
|
|
13
|
+
*/
|
|
14
|
+
declare function TabStripTab({ active, onSelect, onClose, closeLabel, className, children, ...props }: Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
15
|
+
active?: boolean;
|
|
16
|
+
onSelect: () => void;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/** The ×'s accessible name. */
|
|
19
|
+
closeLabel?: string;
|
|
20
|
+
}): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { TabStrip, TabStripTab };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A compact strip of tabs that close (a browser's open pages), drawn as the
|
|
6
|
+
* Work view switch draws its segments: muted text, a faint fill on the open
|
|
7
|
+
* one. It switches nothing itself; each tab says what it does.
|
|
8
|
+
*/
|
|
9
|
+
declare function TabStrip({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* One tab, with an × once `onClose` is given. A `div` with the tab role, not
|
|
12
|
+
* a button: the × is a button, and a button cannot hold another.
|
|
13
|
+
*/
|
|
14
|
+
declare function TabStripTab({ active, onSelect, onClose, closeLabel, className, children, ...props }: Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
15
|
+
active?: boolean;
|
|
16
|
+
onSelect: () => void;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/** The ×'s accessible name. */
|
|
19
|
+
closeLabel?: string;
|
|
20
|
+
}): react_jsx_runtime.JSX.Element;
|
|
21
|
+
|
|
22
|
+
export { TabStrip, TabStripTab };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { cn } from './chunk-LZGII7SX.js';
|
|
2
|
+
import { XIcon } from 'lucide-react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function TabStrip({ className, ...props }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
role: "tablist",
|
|
10
|
+
"data-slot": "tab-strip",
|
|
11
|
+
className: cn("flex min-w-0 items-center gap-0.5 overflow-x-auto", className),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function TabStripTab({
|
|
17
|
+
active = false,
|
|
18
|
+
onSelect,
|
|
19
|
+
onClose,
|
|
20
|
+
closeLabel = "Close tab",
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
role: "tab",
|
|
29
|
+
tabIndex: 0,
|
|
30
|
+
"aria-selected": active,
|
|
31
|
+
"data-slot": "tab-strip-tab",
|
|
32
|
+
"data-active": active,
|
|
33
|
+
onClick: onSelect,
|
|
34
|
+
onKeyDown: (event) => {
|
|
35
|
+
if (event.target !== event.currentTarget) return;
|
|
36
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
onSelect();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
className: cn(
|
|
42
|
+
"flex h-7 min-h-11 max-w-40 shrink-0 cursor-pointer items-center gap-1 rounded-[7px] pl-2.5 text-[12px] transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/40 pointer-fine:min-h-0",
|
|
43
|
+
onClose ? "pr-1" : "pr-2.5",
|
|
44
|
+
active ? "bg-foreground/[0.08] font-medium text-foreground" : "text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
...props,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children }),
|
|
50
|
+
onClose && /* @__PURE__ */ jsx(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
type: "button",
|
|
54
|
+
"data-slot": "tab-strip-close",
|
|
55
|
+
"aria-label": closeLabel,
|
|
56
|
+
onClick: (event) => {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
onClose();
|
|
59
|
+
},
|
|
60
|
+
className: "relative flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted-foreground transition-colors outline-none after:absolute after:-inset-1.5 hover:bg-foreground/[0.08] hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
61
|
+
children: /* @__PURE__ */ jsx(XIcon, { className: "size-3" })
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { TabStrip, TabStripTab };
|
|
70
|
+
//# sourceMappingURL=tab-strip.js.map
|
|
71
|
+
//# sourceMappingURL=tab-strip.js.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,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,kBAAA,EAAoB,QAAA,EAAS,CAAA;AAAA,QAC5C,OAAA,oBACC,GAAA;AAAA,UAAC,QAAA;AAAA,UAAA;AAAA,YACC,IAAA,EAAK,QAAA;AAAA,YACL,WAAA,EAAU,iBAAA;AAAA,YACV,YAAA,EAAY,UAAA;AAAA,YACZ,OAAA,EAAS,CAAC,KAAA,KAAU;AAElB,cAAA,KAAA,CAAM,eAAA,EAAgB;AACtB,cAAA,OAAA,EAAQ;AAAA,YACV,CAAA;AAAA,YAEA,SAAA,EAAU,8QAAA;AAAA,YAEV,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA;AAC5B;AAAA;AAAA,GAEJ;AAEJ","file":"tab-strip.js","sourcesContent":["import * as React from \"react\"\nimport { XIcon } from \"lucide-react\"\n\nimport { cn } from \"./lib/utils\"\n\n/**\n * A compact strip of tabs that close (a browser's open pages), drawn as the\n * Work view switch draws its segments: muted text, a faint fill on the open\n * one. It switches nothing itself; each tab says what it does.\n */\nfunction TabStrip({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n role=\"tablist\"\n data-slot=\"tab-strip\"\n className={cn(\"flex min-w-0 items-center gap-0.5 overflow-x-auto\", className)}\n {...props}\n />\n )\n}\n\n/**\n * One tab, with an × once `onClose` is given. A `div` with the tab role, not\n * a button: the × is a button, and a button cannot hold another.\n */\nfunction TabStripTab({\n active = false,\n onSelect,\n onClose,\n closeLabel = \"Close tab\",\n className,\n children,\n ...props\n}: Omit<React.ComponentProps<\"div\">, \"onSelect\"> & {\n active?: boolean\n onSelect: () => void\n onClose?: () => void\n /** The ×'s accessible name. */\n closeLabel?: string\n}) {\n return (\n <div\n role=\"tab\"\n tabIndex={0}\n aria-selected={active}\n data-slot=\"tab-strip-tab\"\n data-active={active}\n onClick={onSelect}\n onKeyDown={(event) => {\n if (event.target !== event.currentTarget) return\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n onSelect()\n }\n }}\n className={cn(\n \"flex h-7 min-h-11 max-w-40 shrink-0 cursor-pointer items-center gap-1 rounded-[7px] pl-2.5 text-[12px] transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/40 pointer-fine:min-h-0\",\n onClose ? \"pr-1\" : \"pr-2.5\",\n active\n ? \"bg-foreground/[0.08] font-medium text-foreground\"\n : \"text-muted-foreground hover:bg-foreground/[0.04] hover:text-foreground\",\n className\n )}\n {...props}\n >\n <span className=\"min-w-0 truncate\">{children}</span>\n {onClose && (\n <button\n type=\"button\"\n data-slot=\"tab-strip-close\"\n aria-label={closeLabel}\n onClick={(event) => {\n // Closing a tab is not opening it.\n event.stopPropagation()\n onClose()\n }}\n // The × is 16px; the overlay gives it a usable hit area.\n className=\"relative flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted-foreground transition-colors outline-none after:absolute after:-inset-1.5 hover:bg-foreground/[0.08] hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/40\"\n >\n <XIcon className=\"size-3\" />\n </button>\n )}\n </div>\n )\n}\n\nexport { TabStrip, TabStripTab }\n"]}
|
package/dist/tabs.d.cts
CHANGED
|
@@ -6,7 +6,7 @@ import { Tabs as Tabs$1 } from 'radix-ui';
|
|
|
6
6
|
|
|
7
7
|
declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime.JSX.Element;
|
|
8
8
|
declare const tabsListVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "line" | "default" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof Tabs$1.List> & VariantProps<typeof tabsListVariants>): react_jsx_runtime.JSX.Element;
|
|
12
12
|
declare function TabsTrigger({ className, children, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): react_jsx_runtime.JSX.Element;
|
package/dist/tabs.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Tabs as Tabs$1 } from 'radix-ui';
|
|
|
6
6
|
|
|
7
7
|
declare function Tabs({ className, orientation, ...props }: React.ComponentProps<typeof Tabs$1.Root>): react_jsx_runtime.JSX.Element;
|
|
8
8
|
declare const tabsListVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "line" | "default" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
11
|
declare function TabsList({ className, variant, ...props }: React.ComponentProps<typeof Tabs$1.List> & VariantProps<typeof tabsListVariants>): react_jsx_runtime.JSX.Element;
|
|
12
12
|
declare function TabsTrigger({ className, children, ...props }: React.ComponentProps<typeof Tabs$1.Trigger>): react_jsx_runtime.JSX.Element;
|