@tryghost/shade 0.1.0-alpha.4 → 0.1.0-alpha.41
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 +31 -65
- package/es/assets/images/index.js +2 -2
- package/es/components/page-templates/list-page.js +2 -1
- package/es/components/page-templates/list-page.js.map +1 -1
- package/es/components/patterns/filter-bar.js +4 -6
- package/es/components/patterns/filter-bar.js.map +1 -1
- package/es/components/patterns/filters.js +35 -22
- package/es/components/patterns/filters.js.map +1 -1
- package/es/components/patterns/gh-chart.js +6 -3
- package/es/components/patterns/gh-chart.js.map +1 -1
- package/es/components/patterns/image-upload.js +20 -15
- package/es/components/patterns/image-upload.js.map +1 -1
- package/es/components/patterns/kpi-tabs.js +4 -1
- package/es/components/patterns/kpi-tabs.js.map +1 -1
- package/es/components/patterns/page-header.js +20 -44
- package/es/components/patterns/page-header.js.map +1 -1
- package/es/components/patterns/setting-group-variants.js +1 -1
- package/es/components/patterns/setting-group-variants.js.map +1 -1
- package/es/components/patterns/setting-group.js +2 -2
- package/es/components/patterns/setting-group.js.map +1 -1
- package/es/components/patterns/settings-modal-variants.js +3 -0
- package/es/components/patterns/settings-modal-variants.js.map +1 -1
- package/es/components/patterns/settings-modal.js +9 -2
- package/es/components/patterns/settings-modal.js.map +1 -1
- package/es/components/patterns/share-modal.js +5 -17
- package/es/components/patterns/share-modal.js.map +1 -1
- package/es/components/ui/alert-dialog.js +5 -7
- package/es/components/ui/alert-dialog.js.map +1 -1
- package/es/components/ui/avatar.js +8 -4
- package/es/components/ui/avatar.js.map +1 -1
- package/es/components/ui/badge-variants.js +2 -1
- package/es/components/ui/badge-variants.js.map +1 -1
- package/es/components/ui/banner-variants.js +13 -5
- package/es/components/ui/banner-variants.js.map +1 -1
- package/es/components/ui/banner.js +9 -3
- package/es/components/ui/banner.js.map +1 -1
- package/es/components/ui/button-variants.js +2 -33
- package/es/components/ui/button-variants.js.map +1 -1
- package/es/components/ui/button.js +17 -5
- package/es/components/ui/button.js.map +1 -1
- package/es/components/ui/calendar.js +5 -6
- package/es/components/ui/calendar.js.map +1 -1
- package/es/components/ui/card-variants.js +3 -2
- package/es/components/ui/card-variants.js.map +1 -1
- package/es/components/ui/card.js +7 -4
- package/es/components/ui/card.js.map +1 -1
- package/es/components/ui/chart.js +2 -29
- package/es/components/ui/chart.js.map +1 -1
- package/es/components/ui/checkbox.js +1 -1
- package/es/components/ui/checkbox.js.map +1 -1
- package/es/components/ui/code-editor-view.js +1 -1
- package/es/components/ui/code-editor-view.js.map +1 -1
- package/es/components/ui/combobox.js +2 -2
- package/es/components/ui/combobox.js.map +1 -1
- package/es/components/ui/copy-field.js +2 -4
- package/es/components/ui/copy-field.js.map +1 -1
- package/es/components/ui/data-list.js +2 -4
- package/es/components/ui/data-list.js.map +1 -1
- package/es/components/ui/dialog.js +34 -10
- package/es/components/ui/dialog.js.map +1 -1
- package/es/components/ui/dropzone-variants.js +26 -10
- package/es/components/ui/dropzone-variants.js.map +1 -1
- package/es/components/ui/dropzone.js +2 -2
- package/es/components/ui/dropzone.js.map +1 -1
- package/es/components/ui/field.js +4 -4
- package/es/components/ui/field.js.map +1 -1
- package/es/components/ui/floating-sidebar.js +49 -16
- package/es/components/ui/floating-sidebar.js.map +1 -1
- package/es/components/ui/image-overlay-button.js +2 -2
- package/es/components/ui/image-overlay-button.js.map +1 -1
- package/es/components/ui/indicator-variants.js +2 -2
- package/es/components/ui/indicator-variants.js.map +1 -1
- package/es/components/ui/input-group-variants.js +5 -5
- package/es/components/ui/input-group-variants.js.map +1 -1
- package/es/components/ui/input-group.js +4 -7
- package/es/components/ui/input-group.js.map +1 -1
- package/es/components/ui/input-surface.js +3 -3
- package/es/components/ui/input-surface.js.map +1 -1
- package/es/components/ui/input.js +1 -1
- package/es/components/ui/input.js.map +1 -1
- package/es/components/ui/navbar.js +1 -3
- package/es/components/ui/navbar.js.map +1 -1
- package/es/components/ui/pagemenu.js +51 -15
- package/es/components/ui/pagemenu.js.map +1 -1
- package/es/components/ui/radio-group-variants.js +1 -1
- package/es/components/ui/radio-group-variants.js.map +1 -1
- package/es/components/ui/select-variants.js +6 -14
- package/es/components/ui/select-variants.js.map +1 -1
- package/es/components/ui/select.js +1 -4
- package/es/components/ui/select.js.map +1 -1
- package/es/components/ui/sheet.js +1 -1
- package/es/components/ui/sheet.js.map +1 -1
- package/es/components/ui/sidebar.js +1 -1
- package/es/components/ui/simple-pagination.js +4 -7
- package/es/components/ui/simple-pagination.js.map +1 -1
- package/es/components/ui/sticky-footer.js +59 -22
- package/es/components/ui/sticky-footer.js.map +1 -1
- package/es/components/ui/table.js +2 -2
- package/es/components/ui/table.js.map +1 -1
- package/es/components/ui/tabs-variants.js +23 -1
- package/es/components/ui/tabs-variants.js.map +1 -1
- package/es/components/ui/tabs.js +102 -21
- package/es/components/ui/tabs.js.map +1 -1
- package/es/components/ui/textarea.js +1 -1
- package/es/components/ui/textarea.js.map +1 -1
- package/es/components/ui/toast.js +2 -0
- package/es/components/ui/toggle-group.js +1 -3
- package/es/components/ui/toggle-group.js.map +1 -1
- package/es/components/ui/toggle-variants.js +1 -7
- package/es/components/ui/toggle-variants.js.map +1 -1
- package/es/components/ui/toggle.js +1 -2
- package/es/components/ui/toggle.js.map +1 -1
- package/es/components/ui/token-field.js +4 -4
- package/es/components/ui/token-field.js.map +1 -1
- package/es/components/ui/tooltip.js +8 -17
- package/es/components/ui/tooltip.js.map +1 -1
- package/es/components/ui/trend-badge.js +46 -12
- package/es/components/ui/trend-badge.js.map +1 -1
- package/es/components.js +7 -6
- package/es/{images-CUcakpOD.js → images-DtbFINdz.js} +3 -23
- package/es/images-DtbFINdz.js.map +1 -0
- package/es/index.js +7 -6
- package/es/lib/date-utils.js +151 -0
- package/es/lib/date-utils.js.map +1 -0
- package/es/lib/ds-utils.js +16 -72
- package/es/lib/ds-utils.js.map +1 -1
- package/es/lib/utils.js +3 -2
- package/es/providers/header-tooltip-provider.js +1 -4
- package/es/providers/header-tooltip-provider.js.map +1 -1
- package/es/providers/shade-context.js +2 -1
- package/es/providers/shade-context.js.map +1 -1
- package/es/providers/shade-provider.js +4 -3
- package/es/providers/shade-provider.js.map +1 -1
- package/es/shade-app.js +5 -3
- package/es/shade-app.js.map +1 -1
- package/es/shade-scope.js +3 -2
- package/es/shade-scope.js.map +1 -1
- package/es/tokens.js +56 -8
- package/es/tokens.js.map +1 -1
- package/es/utils.js +3 -2
- package/package.json +6 -6
- package/preflight.css +0 -10
- package/styles.css +118 -12
- package/tailwind.theme.css +237 -187
- package/theme-variables.css +412 -44
- package/types/app.d.ts +5 -5
- package/types/assets/images/index.d.ts +0 -1
- package/types/assets/images/index.d.ts.map +1 -1
- package/types/components/page-templates/list-page.d.ts +2 -1
- package/types/components/page-templates/list-page.d.ts.map +1 -1
- package/types/components/page-templates/modal-page.d.ts +1 -1
- package/types/components/patterns/color-picker.d.ts +2 -2
- package/types/components/patterns/filter-bar.d.ts +2 -2
- package/types/components/patterns/filter-bar.d.ts.map +1 -1
- package/types/components/patterns/filters-helpers.d.ts +1 -1
- package/types/components/patterns/filters.d.ts +2 -4
- package/types/components/patterns/filters.d.ts.map +1 -1
- package/types/components/patterns/gh-chart.d.ts.map +1 -1
- package/types/components/patterns/image-upload.d.ts +3 -3
- package/types/components/patterns/image-upload.d.ts.map +1 -1
- package/types/components/patterns/kpi-tabs.d.ts +5 -2
- package/types/components/patterns/kpi-tabs.d.ts.map +1 -1
- package/types/components/patterns/page-header.d.ts +17 -14
- package/types/components/patterns/page-header.d.ts.map +1 -1
- package/types/components/patterns/setting-group.d.ts +8 -8
- package/types/components/patterns/settings-modal-variants.d.ts +3 -0
- package/types/components/patterns/settings-modal-variants.d.ts.map +1 -1
- package/types/components/patterns/settings-modal.d.ts +12 -3
- package/types/components/patterns/settings-modal.d.ts.map +1 -1
- package/types/components/patterns/share-modal.d.ts +3 -3
- package/types/components/patterns/share-modal.d.ts.map +1 -1
- package/types/components/patterns/use-dirty-confirmation.d.ts +1 -1
- package/types/components/ui/alert-dialog.d.ts +1 -1
- package/types/components/ui/alert-dialog.d.ts.map +1 -1
- package/types/components/ui/avatar.d.ts.map +1 -1
- package/types/components/ui/badge-variants.d.ts +1 -1
- package/types/components/ui/badge-variants.d.ts.map +1 -1
- package/types/components/ui/badge.d.ts +1 -1
- package/types/components/ui/banner-variants.d.ts +1 -1
- package/types/components/ui/banner-variants.d.ts.map +1 -1
- package/types/components/ui/banner.d.ts +3 -1
- package/types/components/ui/banner.d.ts.map +1 -1
- package/types/components/ui/button-variants.d.ts +0 -1
- package/types/components/ui/button-variants.d.ts.map +1 -1
- package/types/components/ui/button.d.ts +7 -2
- package/types/components/ui/button.d.ts.map +1 -1
- package/types/components/ui/calendar.d.ts +1 -1
- package/types/components/ui/calendar.d.ts.map +1 -1
- package/types/components/ui/card-variants.d.ts +1 -1
- package/types/components/ui/card-variants.d.ts.map +1 -1
- package/types/components/ui/card.d.ts +1 -1
- package/types/components/ui/card.d.ts.map +1 -1
- package/types/components/ui/chart.d.ts +1 -17
- package/types/components/ui/chart.d.ts.map +1 -1
- package/types/components/ui/code-editor.d.ts +1 -1
- package/types/components/ui/combobox.d.ts.map +1 -1
- package/types/components/ui/copy-field.d.ts +1 -1
- package/types/components/ui/copy-field.d.ts.map +1 -1
- package/types/components/ui/data-list.d.ts.map +1 -1
- package/types/components/ui/dialog.d.ts +11 -2
- package/types/components/ui/dialog.d.ts.map +1 -1
- package/types/components/ui/dropzone-variants.d.ts +3 -2
- package/types/components/ui/dropzone-variants.d.ts.map +1 -1
- package/types/components/ui/dropzone.d.ts +1 -1
- package/types/components/ui/field.d.ts +1 -1
- package/types/components/ui/field.d.ts.map +1 -1
- package/types/components/ui/floating-sidebar.d.ts +12 -3
- package/types/components/ui/floating-sidebar.d.ts.map +1 -1
- package/types/components/ui/image-overlay-button.d.ts +1 -1
- package/types/components/ui/image-overlay-button.d.ts.map +1 -1
- package/types/components/ui/indicator.d.ts +1 -1
- package/types/components/ui/input-group-variants.d.ts.map +1 -1
- package/types/components/ui/input-group.d.ts +2 -2
- package/types/components/ui/input-group.d.ts.map +1 -1
- package/types/components/ui/input-surface.d.ts +3 -3
- package/types/components/ui/input-surface.d.ts.map +1 -1
- package/types/components/ui/multi-select-combobox.d.ts +1 -1
- package/types/components/ui/navbar.d.ts.map +1 -1
- package/types/components/ui/pagemenu.d.ts +3 -0
- package/types/components/ui/pagemenu.d.ts.map +1 -1
- package/types/components/ui/preview-chrome.d.ts +1 -1
- package/types/components/ui/select-variants.d.ts +0 -1
- package/types/components/ui/select-variants.d.ts.map +1 -1
- package/types/components/ui/select.d.ts +2 -2
- package/types/components/ui/select.d.ts.map +1 -1
- package/types/components/ui/sheet.d.ts.map +1 -1
- package/types/components/ui/sidebar.d.ts +2 -2
- package/types/components/ui/simple-pagination.d.ts.map +1 -1
- package/types/components/ui/sticky-footer.d.ts +9 -2
- package/types/components/ui/sticky-footer.d.ts.map +1 -1
- package/types/components/ui/tabs-variants.d.ts +5 -1
- package/types/components/ui/tabs-variants.d.ts.map +1 -1
- package/types/components/ui/tabs.d.ts.map +1 -1
- package/types/components/ui/toast.d.ts +2 -0
- package/types/components/ui/toast.d.ts.map +1 -0
- package/types/components/ui/toggle-group.d.ts +4 -6
- package/types/components/ui/toggle-group.d.ts.map +1 -1
- package/types/components/ui/toggle-variants.d.ts +0 -1
- package/types/components/ui/toggle-variants.d.ts.map +1 -1
- package/types/components/ui/toggle.d.ts +2 -3
- package/types/components/ui/toggle.d.ts.map +1 -1
- package/types/components/ui/token-field.d.ts +3 -3
- package/types/components/ui/token-field.d.ts.map +1 -1
- package/types/components/ui/tooltip.d.ts.map +1 -1
- package/types/components/ui/trend-badge.d.ts +1 -0
- package/types/components/ui/trend-badge.d.ts.map +1 -1
- package/types/components.d.ts +2 -1
- package/types/components.d.ts.map +1 -1
- package/types/lib/date-utils.d.ts +17 -0
- package/types/lib/date-utils.d.ts.map +1 -0
- package/types/lib/ds-utils.d.ts +2 -16
- package/types/lib/ds-utils.d.ts.map +1 -1
- package/types/lib/utils.d.ts +1 -0
- package/types/lib/utils.d.ts.map +1 -1
- package/types/providers/header-tooltip-provider.d.ts.map +1 -1
- package/types/providers/shade-context.d.ts +4 -1
- package/types/providers/shade-context.d.ts.map +1 -1
- package/types/providers/shade-provider.d.ts +3 -2
- package/types/providers/shade-provider.d.ts.map +1 -1
- package/types/shade-app.d.ts +8 -3
- package/types/shade-app.d.ts.map +1 -1
- package/types/shade-scope.d.ts.map +1 -1
- package/types/tokens.d.ts +1 -1
- package/types/tokens.d.ts.map +1 -1
- package/types/utils.d.ts +2 -1
- package/types/utils.d.ts.map +1 -1
- package/es/images-CUcakpOD.js.map +0 -1
|
@@ -3,10 +3,10 @@ import { inputSurface } from "./input-surface.js";
|
|
|
3
3
|
//#region src/components/ui/token-field.ts
|
|
4
4
|
/** Shared chip density for token inputs such as labels, tags and authors. */
|
|
5
5
|
var tokenFieldClasses = {
|
|
6
|
-
field: cn(inputSurface("within"), "relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-
|
|
7
|
-
input: "min-w-20 flex-1 bg-transparent px-2 text-
|
|
8
|
-
chip: "h-6 max-w-full cursor-pointer gap-1 rounded-
|
|
9
|
-
chevron: "pointer-events-none absolute top-[calc((var(--control-height)-var(--spacing)*4)/2)] right-
|
|
6
|
+
field: cn(inputSurface("within"), "relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-(length:--text-field)"),
|
|
7
|
+
input: "min-w-20 flex-1 bg-transparent px-2 text-(length:--text-field) outline-hidden placeholder:text-muted-foreground",
|
|
8
|
+
chip: "h-auto min-h-6 max-w-full cursor-pointer gap-1 rounded-xl border-transparent bg-field-chip-surface px-2 py-0.75 pr-1.5 text-left text-sm leading-4 whitespace-normal",
|
|
9
|
+
chevron: "pointer-events-none absolute top-[calc((var(--control-height)-var(--spacing)*4)/2-1px)] right-1.5 size-4 text-muted-foreground"
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
12
12
|
export { tokenFieldClasses };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-field.js","names":[],"sources":["../../../src/components/ui/token-field.ts"],"sourcesContent":["import { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\n/** Shared chip density for token inputs such as labels, tags and authors. */\nexport const tokenFieldClasses = {\n field: cn(\n inputSurface('within'),\n 'relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-
|
|
1
|
+
{"version":3,"file":"token-field.js","names":[],"sources":["../../../src/components/ui/token-field.ts"],"sourcesContent":["import { inputSurface } from '@/components/ui/input-surface';\nimport { cn } from '@/lib/utils';\n\n/** Shared chip density for token inputs such as labels, tags and authors. */\nexport const tokenFieldClasses = {\n field: cn(\n inputSurface('within'),\n 'relative flex min-h-(--control-height) w-full cursor-text flex-wrap items-center gap-1 p-0.75 text-(length:--text-field)',\n ),\n input:\n 'min-w-20 flex-1 bg-transparent px-2 text-(length:--text-field) outline-hidden placeholder:text-muted-foreground',\n // 24px on one line; long names wrap.\n chip: 'h-auto min-h-6 max-w-full cursor-pointer gap-1 rounded-xl border-transparent bg-field-chip-surface px-2 py-0.75 pr-1.5 text-left text-sm leading-4 whitespace-normal',\n // Matches Select's chevron; offsets start inside the 1px border.\n chevron:\n 'pointer-events-none absolute top-[calc((var(--control-height)-var(--spacing)*4)/2-1px)] right-1.5 size-4 text-muted-foreground',\n} as const;\n"],"mappings":";;;;AAIA,IAAa,oBAAoB;CAC/B,OAAO,GACL,aAAa,QAAQ,GACrB,0HACF;CACA,OACE;CAEF,MAAM;CAEN,SACE;AACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
-
import { useShade } from "../../providers/shade-context.js";
|
|
3
2
|
import { ShadeScope } from "../../shade-scope.js";
|
|
4
3
|
import * as React$1 from "react";
|
|
5
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -17,9 +16,7 @@ function TooltipProvider({ children, ...props }) {
|
|
|
17
16
|
suppressFocus: false,
|
|
18
17
|
windowBlurred: false
|
|
19
18
|
});
|
|
20
|
-
const { isAdmin7 } = useShade();
|
|
21
19
|
React$1.useEffect(() => {
|
|
22
|
-
if (!isAdmin7) return;
|
|
23
20
|
const suppressFocus = () => {
|
|
24
21
|
inputState.current.suppressFocus = true;
|
|
25
22
|
};
|
|
@@ -44,18 +41,17 @@ function TooltipProvider({ children, ...props }) {
|
|
|
44
41
|
window.removeEventListener("blur", onWindowBlur);
|
|
45
42
|
document.removeEventListener("keydown", onKeyDown, true);
|
|
46
43
|
};
|
|
47
|
-
}, [
|
|
44
|
+
}, []);
|
|
48
45
|
return /* @__PURE__ */ jsx(TooltipInputContext.Provider, {
|
|
49
|
-
value:
|
|
46
|
+
value: inputState,
|
|
50
47
|
children: /* @__PURE__ */ jsx(TooltipPrimitive.Provider, {
|
|
51
|
-
delayDuration:
|
|
48
|
+
delayDuration: 1e3,
|
|
52
49
|
...props,
|
|
53
50
|
children
|
|
54
51
|
})
|
|
55
52
|
});
|
|
56
53
|
}
|
|
57
54
|
function Tooltip({ open: controlledOpen, defaultOpen = false, onOpenChange, ...props }) {
|
|
58
|
-
const { isAdmin7 } = useShade();
|
|
59
55
|
const inputState = React$1.useContext(TooltipInputContext);
|
|
60
56
|
const [uncontrolledOpen, setUncontrolledOpen] = React$1.useState(defaultOpen);
|
|
61
57
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
@@ -65,20 +61,16 @@ function Tooltip({ open: controlledOpen, defaultOpen = false, onOpenChange, ...p
|
|
|
65
61
|
onOpenChange?.(nextOpen);
|
|
66
62
|
}, [inputState, onOpenChange]);
|
|
67
63
|
React$1.useEffect(() => {
|
|
68
|
-
if (!
|
|
64
|
+
if (!open) return;
|
|
69
65
|
const close = () => handleOpenChange(false);
|
|
70
66
|
window.addEventListener("blur", close);
|
|
71
67
|
return () => window.removeEventListener("blur", close);
|
|
72
|
-
}, [
|
|
73
|
-
isAdmin7,
|
|
74
|
-
open,
|
|
75
|
-
handleOpenChange
|
|
76
|
-
]);
|
|
68
|
+
}, [open, handleOpenChange]);
|
|
77
69
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Root, {
|
|
78
70
|
...props,
|
|
79
71
|
defaultOpen,
|
|
80
|
-
open
|
|
81
|
-
onOpenChange:
|
|
72
|
+
open,
|
|
73
|
+
onOpenChange: handleOpenChange
|
|
82
74
|
});
|
|
83
75
|
}
|
|
84
76
|
var TooltipTrigger = React$1.forwardRef(({ onFocus, ...props }, ref) => {
|
|
@@ -101,10 +93,9 @@ var tooltipContentVariants = cva("z-50 animate-in overflow-hidden rounded-menu p
|
|
|
101
93
|
defaultVariants: { variant: "default" }
|
|
102
94
|
});
|
|
103
95
|
var TooltipContent = React$1.forwardRef(({ className, sideOffset = 4, variant, ...props }, ref) => {
|
|
104
|
-
const { isAdmin7 } = useShade();
|
|
105
96
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx(ShadeScope, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Content, {
|
|
106
97
|
ref,
|
|
107
|
-
className: cn(tooltipContentVariants({ variant: variant ??
|
|
98
|
+
className: cn(tooltipContentVariants({ variant: variant ?? "white" }), className),
|
|
108
99
|
sideOffset,
|
|
109
100
|
...props
|
|
110
101
|
}) }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../../../src/components/ui/tooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\nconst TooltipInputContext = React.createContext<React.RefObject<{\n suppressFocus: boolean;\n windowBlurred: boolean;\n}> | null>(null);\n\n/**\n * Shared hover timing: `delayDuration` (ms) waits before the first tooltip;\n * `skipDelayDuration` (ms) lets nearby triggers open immediately after it.\n * Individual Tooltip roots can override delayDuration. Keyboard focus opens immediately.\n */\nfunction TooltipProvider({\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n const inputState = React.useRef({ suppressFocus: false, windowBlurred: false });\n\n React.useEffect(() => {\n const suppressFocus = () => {\n inputState.current.suppressFocus = true;\n };\n const onWindowBlur = () => {\n suppressFocus();\n inputState.current.windowBlurred = true;\n };\n const onKeyDown = () => {\n inputState.current.suppressFocus = false;\n inputState.current.windowBlurred = false;\n };\n const onPointerMove = () => {\n inputState.current.windowBlurred = false;\n };\n document.addEventListener('pointerdown', suppressFocus, true);\n document.addEventListener('pointermove', onPointerMove, true);\n window.addEventListener('blur', onWindowBlur);\n document.addEventListener('keydown', onKeyDown, true);\n return () => {\n document.removeEventListener('pointerdown', suppressFocus, true);\n document.removeEventListener('pointermove', onPointerMove, true);\n window.removeEventListener('blur', onWindowBlur);\n document.removeEventListener('keydown', onKeyDown, true);\n };\n }, []);\n\n return (\n <TooltipInputContext.Provider value={inputState}>\n <TooltipPrimitive.Provider delayDuration={1000} {...props}>\n {children}\n </TooltipPrimitive.Provider>\n </TooltipInputContext.Provider>\n );\n}\n\nfunction Tooltip({\n open: controlledOpen,\n defaultOpen = false,\n onOpenChange,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n const inputState = React.useContext(TooltipInputContext);\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);\n const open = controlledOpen ?? uncontrolledOpen;\n const handleOpenChange = React.useCallback(\n (nextOpen: boolean) => {\n // Radix may finish a hover timer after window blur. Wait for fresh input.\n if (nextOpen && inputState?.current?.windowBlurred) {\n return;\n }\n setUncontrolledOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [inputState, onOpenChange],\n );\n\n React.useEffect(() => {\n if (!open) {\n return;\n }\n const close = () => handleOpenChange(false);\n window.addEventListener('blur', close);\n return () => window.removeEventListener('blur', close);\n }, [open, handleOpenChange]);\n\n return (\n <TooltipPrimitive.Root\n {...props}\n defaultOpen={defaultOpen}\n open={open}\n onOpenChange={handleOpenChange}\n />\n );\n}\n\nconst TooltipTrigger = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>\n>(({ onFocus, ...props }, ref) => {\n const inputState = React.useContext(TooltipInputContext);\n\n return (\n <TooltipPrimitive.Trigger\n ref={ref}\n {...props}\n onFocus={(event) => {\n onFocus?.(event);\n // Menus and browser windows restore focus without a new interaction.\n // Only deliberate keyboard focus or normal hover should show a tooltip.\n if (inputState?.current?.suppressFocus) {\n event.preventDefault();\n }\n }}\n />\n );\n});\nTooltipTrigger.displayName = TooltipPrimitive.Trigger.displayName;\n\nconst tooltipContentVariants = cva(\n 'z-50 animate-in overflow-hidden rounded-menu px-3 py-1.5 text-xs fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground dark:bg-popover dark:text-popover-foreground',\n white: 'bg-surface-elevated-2 text-foreground shadow-md',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nexport interface TooltipContentProps\n extends\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,\n VariantProps<typeof tooltipContentVariants> {}\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n TooltipContentProps\n>(({ className, sideOffset = 4, variant, ...props }, ref) => {\n return (\n <TooltipPrimitive.Portal>\n <ShadeScope>\n <TooltipPrimitive.Content\n ref={ref}\n className={cn(tooltipContentVariants({ variant: variant ?? 'white' }), className)}\n sideOffset={sideOffset}\n {...props}\n />\n </ShadeScope>\n </TooltipPrimitive.Portal>\n );\n});\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n"],"mappings":";;;;;;;AAOA,IAAM,sBAAsB,QAAM,cAGvB,IAAI;;;;;;AAOf,SAAS,gBAAgB,EACvB,UACA,GAAG,SACsD;CACzD,MAAM,aAAa,QAAM,OAAO;EAAE,eAAe;EAAO,eAAe;CAAM,CAAC;CAE9E,QAAM,gBAAgB;EACpB,MAAM,sBAAsB;GAC1B,WAAW,QAAQ,gBAAgB;EACrC;EACA,MAAM,qBAAqB;GACzB,cAAc;GACd,WAAW,QAAQ,gBAAgB;EACrC;EACA,MAAM,kBAAkB;GACtB,WAAW,QAAQ,gBAAgB;GACnC,WAAW,QAAQ,gBAAgB;EACrC;EACA,MAAM,sBAAsB;GAC1B,WAAW,QAAQ,gBAAgB;EACrC;EACA,SAAS,iBAAiB,eAAe,eAAe,IAAI;EAC5D,SAAS,iBAAiB,eAAe,eAAe,IAAI;EAC5D,OAAO,iBAAiB,QAAQ,YAAY;EAC5C,SAAS,iBAAiB,WAAW,WAAW,IAAI;EACpD,aAAa;GACX,SAAS,oBAAoB,eAAe,eAAe,IAAI;GAC/D,SAAS,oBAAoB,eAAe,eAAe,IAAI;GAC/D,OAAO,oBAAoB,QAAQ,YAAY;GAC/C,SAAS,oBAAoB,WAAW,WAAW,IAAI;EACzD;CACF,GAAG,CAAC,CAAC;CAEL,OACE,oBAAC,oBAAoB,UAArB;EAA8B,OAAO;YACnC,oBAAC,iBAAiB,UAAlB;GAA2B,eAAe;GAAM,GAAI;GACjD;EACwB,CAAA;CACC,CAAA;AAElC;AAEA,SAAS,QAAQ,EACf,MAAM,gBACN,cAAc,OACd,cACA,GAAG,SACkD;CACrD,MAAM,aAAa,QAAM,WAAW,mBAAmB;CACvD,MAAM,CAAC,kBAAkB,uBAAuB,QAAM,SAAS,WAAW;CAC1E,MAAM,OAAO,kBAAkB;CAC/B,MAAM,mBAAmB,QAAM,aAC5B,aAAsB;EAErB,IAAI,YAAY,YAAY,SAAS,eACnC;EAEF,oBAAoB,QAAQ;EAC5B,eAAe,QAAQ;CACzB,GACA,CAAC,YAAY,YAAY,CAC3B;CAEA,QAAM,gBAAgB;EACpB,IAAI,CAAC,MACH;EAEF,MAAM,cAAc,iBAAiB,KAAK;EAC1C,OAAO,iBAAiB,QAAQ,KAAK;EACrC,aAAa,OAAO,oBAAoB,QAAQ,KAAK;CACvD,GAAG,CAAC,MAAM,gBAAgB,CAAC;CAE3B,OACE,oBAAC,iBAAiB,MAAlB;EACE,GAAI;EACS;EACP;EACN,cAAc;CACf,CAAA;AAEL;AAEA,IAAM,iBAAiB,QAAM,YAG1B,EAAE,SAAS,GAAG,SAAS,QAAQ;CAChC,MAAM,aAAa,QAAM,WAAW,mBAAmB;CAEvD,OACE,oBAAC,iBAAiB,SAAlB;EACO;EACL,GAAI;EACJ,UAAU,UAAU;GAClB,UAAU,KAAK;GAGf,IAAI,YAAY,SAAS,eACvB,MAAM,eAAe;EAEzB;CACD,CAAA;AAEL,CAAC;AACD,eAAe,cAAc,iBAAiB,QAAQ;AAEtD,IAAM,yBAAyB,IAC7B,oVACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,OAAO;CACT,EACF;CACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CACF;AAOA,IAAM,iBAAiB,QAAM,YAG1B,EAAE,WAAW,aAAa,GAAG,SAAS,GAAG,SAAS,QAAQ;CAC3D,OACE,oBAAC,iBAAiB,QAAlB,EAAA,UACE,oBAAC,YAAD,EAAA,UACE,oBAAC,iBAAiB,SAAlB;EACO;EACL,WAAW,GAAG,uBAAuB,EAAE,SAAS,WAAW,QAAQ,CAAC,GAAG,SAAS;EACpE;EACZ,GAAI;CACL,CAAA,EACS,CAAA,EACW,CAAA;AAE7B,CAAC;AACD,eAAe,cAAc,iBAAiB,QAAQ"}
|
|
@@ -16,37 +16,71 @@ var trendBadgeVariants = cva("group/trend-badge inline-flex h-[22px] cursor-defa
|
|
|
16
16
|
interactive: {
|
|
17
17
|
true: "focus-visible:ring-2 focus-visible:ring-focus-ring/25 focus-visible:outline-hidden",
|
|
18
18
|
false: ""
|
|
19
|
+
},
|
|
20
|
+
inverted: {
|
|
21
|
+
true: "",
|
|
22
|
+
false: ""
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
|
-
compoundVariants: [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
compoundVariants: [
|
|
26
|
+
{
|
|
27
|
+
direction: "up",
|
|
28
|
+
interactive: true,
|
|
29
|
+
className: "hover:bg-state-success/20"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
direction: "down",
|
|
33
|
+
interactive: true,
|
|
34
|
+
className: "hover:bg-state-danger/20"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
direction: "up",
|
|
38
|
+
inverted: true,
|
|
39
|
+
className: "bg-state-danger/10 text-state-danger"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
direction: "down",
|
|
43
|
+
inverted: true,
|
|
44
|
+
className: "bg-state-success/10 text-state-success"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
direction: "up",
|
|
48
|
+
inverted: true,
|
|
49
|
+
interactive: true,
|
|
50
|
+
className: "hover:bg-state-danger/20"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
direction: "down",
|
|
54
|
+
inverted: true,
|
|
55
|
+
interactive: true,
|
|
56
|
+
className: "hover:bg-state-success/20"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
30
59
|
defaultVariants: {
|
|
31
60
|
direction: "same",
|
|
32
|
-
interactive: false
|
|
61
|
+
interactive: false,
|
|
62
|
+
inverted: false
|
|
33
63
|
}
|
|
34
64
|
});
|
|
35
|
-
var TrendBadge = React$1.forwardRef(({ className, direction = "same", value, tooltip, ...props }, ref) => {
|
|
65
|
+
var TrendBadge = React$1.forwardRef(({ className, direction = "same", inverted, value, tooltip, ...props }, ref) => {
|
|
36
66
|
if (direction === "hidden") return null;
|
|
37
67
|
const interactive = Boolean(tooltip);
|
|
38
68
|
const badge = /* @__PURE__ */ jsxs("div", {
|
|
39
69
|
ref,
|
|
40
70
|
className: cn(trendBadgeVariants({
|
|
41
71
|
direction,
|
|
72
|
+
inverted,
|
|
42
73
|
interactive
|
|
43
74
|
}), className),
|
|
44
75
|
tabIndex: interactive ? 0 : void 0,
|
|
45
76
|
...props,
|
|
46
77
|
children: [
|
|
47
|
-
/* @__PURE__ */ jsx("span", {
|
|
78
|
+
value !== "" ? /* @__PURE__ */ jsx("span", {
|
|
48
79
|
className: "leading-none font-medium",
|
|
49
80
|
children: value
|
|
81
|
+
}) : tooltip && /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: "sr-only",
|
|
83
|
+
children: tooltip
|
|
50
84
|
}),
|
|
51
85
|
direction === "up" && /* @__PURE__ */ jsx(TrendingUp, {
|
|
52
86
|
className: "size-3!",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trend-badge.js","names":[],"sources":["../../../src/components/ui/trend-badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { TrendingDown, TrendingUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nconst trendBadgeVariants = cva(\n 'group/trend-badge inline-flex h-[22px] cursor-default items-center gap-1 rounded-trend-badge px-1.5 text-xs',\n {\n variants: {\n direction: {\n up: 'bg-state-success/10 text-state-success',\n down: 'bg-state-danger/10 text-state-danger',\n same: 'bg-muted text-text-secondary',\n hidden: 'hidden',\n },\n interactive: {\n true: 'focus-visible:ring-2 focus-visible:ring-focus-ring/25 focus-visible:outline-hidden',\n false: '',\n },\n },\n compoundVariants: [\n { direction: 'up', interactive: true, className: 'hover:bg-state-success/20' },\n { direction: 'down', interactive: true, className: 'hover:bg-state-danger/20' },\n ],\n defaultVariants: {\n direction: 'same',\n interactive: false,\n },\n },\n);\n\nexport interface TrendBadgeProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof trendBadgeVariants> {\n value: string | number;\n tooltip?: React.ReactNode;\n}\n\nconst TrendBadge = React.forwardRef<HTMLDivElement, TrendBadgeProps>(\n ({ className, direction = 'same', value, tooltip, ...props }, ref) => {\n if (direction === 'hidden') {\n return null;\n }\n\n const interactive = Boolean(tooltip);\n\n const badge = (\n <div\n ref={ref}\n className={cn(trendBadgeVariants({ direction, interactive }), className)}\n tabIndex={interactive ? 0 : undefined}\n {...props}\n >\n <span className=\"leading-none font-medium\">{value}</span>\n {direction === 'up' && <TrendingUp className=\"size-3!\" strokeWidth={2} />}\n {direction === 'down' && <TrendingDown className=\"size-3!\" strokeWidth={2} />}\n </div>\n );\n\n if (!tooltip) {\n return badge;\n }\n\n return (\n <TooltipProvider delayDuration={0}>\n <Tooltip>\n <TooltipTrigger asChild>{badge}</TooltipTrigger>\n <TooltipContent className=\"max-w-[240px] bg-background text-sm text-pretty text-foreground shadow-md dark:bg-popover\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n },\n);\nTrendBadge.displayName = 'TrendBadge';\n\nexport { TrendBadge };\n"],"mappings":";;;;;;;AAOA,IAAM,qBAAqB,IACzB,+GACA;CACE,UAAU;EACR,WAAW;GACT,IAAI;GACJ,MAAM;GACN,MAAM;GACN,QAAQ;EACV;EACA,aAAa;GACX,MAAM;GACN,OAAO;EACT;CACF;CACA,kBAAkB,
|
|
1
|
+
{"version":3,"file":"trend-badge.js","names":[],"sources":["../../../src/components/ui/trend-badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { TrendingDown, TrendingUp } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';\n\nconst trendBadgeVariants = cva(\n 'group/trend-badge inline-flex h-[22px] cursor-default items-center gap-1 rounded-trend-badge px-1.5 text-xs',\n {\n variants: {\n direction: {\n up: 'bg-state-success/10 text-state-success',\n down: 'bg-state-danger/10 text-state-danger',\n same: 'bg-muted text-text-secondary',\n hidden: 'hidden',\n },\n interactive: {\n true: 'focus-visible:ring-2 focus-visible:ring-focus-ring/25 focus-visible:outline-hidden',\n false: '',\n },\n // For metrics where a rise is bad, such as reports: up reads as danger\n inverted: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n { direction: 'up', interactive: true, className: 'hover:bg-state-success/20' },\n { direction: 'down', interactive: true, className: 'hover:bg-state-danger/20' },\n { direction: 'up', inverted: true, className: 'bg-state-danger/10 text-state-danger' },\n { direction: 'down', inverted: true, className: 'bg-state-success/10 text-state-success' },\n {\n direction: 'up',\n inverted: true,\n interactive: true,\n className: 'hover:bg-state-danger/20',\n },\n {\n direction: 'down',\n inverted: true,\n interactive: true,\n className: 'hover:bg-state-success/20',\n },\n ],\n defaultVariants: {\n direction: 'same',\n interactive: false,\n inverted: false,\n },\n },\n);\n\nexport interface TrendBadgeProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n VariantProps<typeof trendBadgeVariants> {\n value: string | number;\n tooltip?: React.ReactNode;\n}\n\nconst TrendBadge = React.forwardRef<HTMLDivElement, TrendBadgeProps>(\n ({ className, direction = 'same', inverted, value, tooltip, ...props }, ref) => {\n if (direction === 'hidden') {\n return null;\n }\n\n const interactive = Boolean(tooltip);\n\n const badge = (\n <div\n ref={ref}\n className={cn(trendBadgeVariants({ direction, inverted, interactive }), className)}\n tabIndex={interactive ? 0 : undefined}\n {...props}\n >\n {value !== '' ? (\n <span className=\"leading-none font-medium\">{value}</span>\n ) : (\n tooltip && <span className=\"sr-only\">{tooltip}</span>\n )}\n {direction === 'up' && <TrendingUp className=\"size-3!\" strokeWidth={2} />}\n {direction === 'down' && <TrendingDown className=\"size-3!\" strokeWidth={2} />}\n </div>\n );\n\n if (!tooltip) {\n return badge;\n }\n\n return (\n <TooltipProvider delayDuration={0}>\n <Tooltip>\n <TooltipTrigger asChild>{badge}</TooltipTrigger>\n <TooltipContent className=\"max-w-[240px] bg-background text-sm text-pretty text-foreground shadow-md dark:bg-popover\">\n {tooltip}\n </TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n },\n);\nTrendBadge.displayName = 'TrendBadge';\n\nexport { TrendBadge };\n"],"mappings":";;;;;;;AAOA,IAAM,qBAAqB,IACzB,+GACA;CACE,UAAU;EACR,WAAW;GACT,IAAI;GACJ,MAAM;GACN,MAAM;GACN,QAAQ;EACV;EACA,aAAa;GACX,MAAM;GACN,OAAO;EACT;EAEA,UAAU;GACR,MAAM;GACN,OAAO;EACT;CACF;CACA,kBAAkB;EAChB;GAAE,WAAW;GAAM,aAAa;GAAM,WAAW;EAA4B;EAC7E;GAAE,WAAW;GAAQ,aAAa;GAAM,WAAW;EAA2B;EAC9E;GAAE,WAAW;GAAM,UAAU;GAAM,WAAW;EAAuC;EACrF;GAAE,WAAW;GAAQ,UAAU;GAAM,WAAW;EAAyC;EACzF;GACE,WAAW;GACX,UAAU;GACV,aAAa;GACb,WAAW;EACb;EACA;GACE,WAAW;GACX,UAAU;GACV,aAAa;GACb,WAAW;EACb;CACF;CACA,iBAAiB;EACf,WAAW;EACX,aAAa;EACb,UAAU;CACZ;AACF,CACF;AAUA,IAAM,aAAa,QAAM,YACtB,EAAE,WAAW,YAAY,QAAQ,UAAU,OAAO,SAAS,GAAG,SAAS,QAAQ;CAC9E,IAAI,cAAc,UAChB,OAAO;CAGT,MAAM,cAAc,QAAQ,OAAO;CAEnC,MAAM,QACJ,qBAAC,OAAD;EACO;EACL,WAAW,GAAG,mBAAmB;GAAE;GAAW;GAAU;EAAY,CAAC,GAAG,SAAS;EACjF,UAAU,cAAc,IAAI,KAAA;EAC5B,GAAI;YAJN;GAMG,UAAU,KACT,oBAAC,QAAD;IAAM,WAAU;cAA4B;GAAY,CAAA,IAExD,WAAW,oBAAC,QAAD;IAAM,WAAU;cAAW;GAAc,CAAA;GAErD,cAAc,QAAQ,oBAAC,YAAD;IAAY,WAAU;IAAU,aAAa;GAAI,CAAA;GACvE,cAAc,UAAU,oBAAC,cAAD;IAAc,WAAU;IAAU,aAAa;GAAI,CAAA;EACzE;;CAGP,IAAI,CAAC,SACH,OAAO;CAGT,OACE,oBAAC,iBAAD;EAAiB,eAAe;YAC9B,qBAAC,SAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;GAAgB,SAAA;aAAS;EAAsB,CAAA,GAC/C,oBAAC,gBAAD;GAAgB,WAAU;aACvB;EACa,CAAA,CACT,EAAA,CAAA;CACM,CAAA;AAErB,CACF;AACA,WAAW,cAAc"}
|
package/es/components.js
CHANGED
|
@@ -3,12 +3,15 @@ import { Toaster } from "./components/ui/sonner.js";
|
|
|
3
3
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
4
4
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
5
5
|
import { buttonVariants } from "./components/ui/button-variants.js";
|
|
6
|
+
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
7
|
+
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
6
8
|
import { Button } from "./components/ui/button.js";
|
|
7
9
|
import { selectTriggerVariants } from "./components/ui/select-variants.js";
|
|
8
10
|
import { inputSurface, inputSurfaceClasses } from "./components/ui/input-surface.js";
|
|
9
11
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/ui/select.js";
|
|
10
12
|
import { Kbd, KbdGroup } from "./components/ui/kbd.js";
|
|
11
|
-
import { AlignedAxisTick, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent
|
|
13
|
+
import { AlignedAxisTick, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
14
|
+
import { tabSurfaceVariants, tabsVariants } from "./components/ui/tabs-variants.js";
|
|
12
15
|
import { Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount } from "./components/ui/tabs.js";
|
|
13
16
|
import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
14
17
|
import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./components/ui/dialog.js";
|
|
@@ -21,8 +24,6 @@ import { dropzoneVariants } from "./components/ui/dropzone-variants.js";
|
|
|
21
24
|
import { Dropzone } from "./components/ui/dropzone.js";
|
|
22
25
|
import { imageOverlayButton, imageOverlayButtonClasses } from "./components/ui/image-overlay-button.js";
|
|
23
26
|
import { Input } from "./components/ui/input.js";
|
|
24
|
-
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
25
|
-
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
26
27
|
import { StickyFooter } from "./components/ui/sticky-footer.js";
|
|
27
28
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/ui/accordion.js";
|
|
28
29
|
import { ActionList, ActionListItem, ActionListItemActions, ActionListItemContent } from "./components/ui/action-list.js";
|
|
@@ -69,11 +70,11 @@ import { useSidebar } from "./components/ui/sidebar-context.js";
|
|
|
69
70
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger } from "./components/ui/sidebar.js";
|
|
70
71
|
import { DragIndicator, SortableList } from "./components/ui/sortable-list.js";
|
|
71
72
|
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow } from "./components/ui/table.js";
|
|
72
|
-
import { tabsVariants } from "./components/ui/tabs-variants.js";
|
|
73
73
|
import { Textarea } from "./components/ui/textarea.js";
|
|
74
|
+
import { toast } from "./components/ui/toast.js";
|
|
74
75
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
75
|
-
import { a as
|
|
76
|
+
import { a as XLogo, i as GoogleLogo, n as GhostLogo, r as GhostOrb, t as FacebookLogo } from "./images-DtbFINdz.js";
|
|
76
77
|
import { TimePicker } from "./components/ui/time-picker.js";
|
|
77
78
|
import { tokenFieldClasses } from "./components/ui/token-field.js";
|
|
78
79
|
import { defaultFilter as commandDefaultFilter } from "cmdk";
|
|
79
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow,
|
|
80
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragIndicator, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, EmptyBadge, EmptyCard, EmptyIndicator, FLOATING_SIDEBAR_BUMP, FLOATING_SIDEBAR_CLOSED_FOOTPRINT, FLOATING_SIDEBAR_CLOSED_SIZE, FLOATING_SIDEBAR_DURATION, FLOATING_SIDEBAR_EASE, FLOATING_SIDEBAR_EASE_DURATION, FLOATING_SIDEBAR_INSET, FLOATING_SIDEBAR_OPEN_WIDTH, FLOATING_SIDEBAR_SPRING, FacebookLogo, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flag, FloatingSidebar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GhostLogo, GhostOrb, GoogleLogo, HoverCard, HoverCardContent, HoverCardTrigger, IconComponents as Icon, Indicator, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, Label, Link, LoadingIndicator, MultiSelectCombobox, Navbar, NavbarActions, NavbarNavigation, NoValueLabel, NoValueLabelIcon, PageMenu, PageMenuItem, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PreviewChrome, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimplePagination, SimplePaginationNavigation, SimplePaginationNextButton, SimplePaginationPages, SimplePaginationPreviousButton, Skeleton, SkeletonTable, SortableList, StickyFooter, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow, Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount, Textarea, TimePicker, Toaster, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, XLogo, badgeVariants, bannerVariants, buttonVariants, cardVariants, commandDefaultFilter, dropzoneVariants, getFloatingSidebarGapWidth, getFloatingSidebarTiming, imageOverlayButton, imageOverlayButtonClasses, indicatorVariants, inputGroupVariants, inputSurface, inputSurfaceClasses, previewChromeVariants, radioGroupItemVariants, selectTriggerVariants, tabSurfaceVariants, tabsVariants, toast, tokenFieldClasses, useFormField, useSidebar };
|
|
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
//#region src/assets/images/facebook-logo.svg?react
|
|
4
4
|
var SvgFacebookLogo = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
5
5
|
fill: "none",
|
|
6
|
+
viewBox: "0 0 40 40",
|
|
6
7
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
8
|
...props,
|
|
8
9
|
children: [
|
|
@@ -80,26 +81,6 @@ var SvgGoogleLogo = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
80
81
|
]
|
|
81
82
|
});
|
|
82
83
|
//#endregion
|
|
83
|
-
//#region src/assets/images/twitter-logo.svg?react
|
|
84
|
-
var SvgTwitterLogo = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
85
|
-
fill: "none",
|
|
86
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
87
|
-
...props,
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ jsx("title", { children: "social-twitter" }),
|
|
90
|
-
/* @__PURE__ */ jsx("circle", {
|
|
91
|
-
cx: 20,
|
|
92
|
-
cy: 20,
|
|
93
|
-
r: 20,
|
|
94
|
-
fill: "#51B1EF"
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ jsx("path", {
|
|
97
|
-
d: "M30.905 14.268a8.63 8.63 0 0 1-2.49.686 4.36 4.36 0 0 0 1.902-2.403 8.602 8.602 0 0 1-2.753 1.054c-3.512-3.488-8.463.13-7.396 3.969a12.284 12.284 0 0 1-8.942-4.543c-1.228 2.093-.428 4.667 1.343 5.798a4.31 4.31 0 0 1-1.965-.544v.055a4.35 4.35 0 0 0 3.48 4.263 4.569 4.569 0 0 1-1.964.074 4.367 4.367 0 0 0 4.053 3.023c-1.918 1.46-4.146 2.062-6.42 1.798 9.793 5.767 19.029-1.783 18.998-10.417 0-.187-.004-.374-.012-.561a9 9 0 0 0 2.166-2.248",
|
|
98
|
-
fill: "#fff"
|
|
99
|
-
})
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
//#endregion
|
|
103
84
|
//#region src/assets/images/x-logo.svg?react
|
|
104
85
|
var SvgXLogo = (props) => /* @__PURE__ */ jsx("svg", {
|
|
105
86
|
viewBox: "0 0 24 24",
|
|
@@ -116,9 +97,8 @@ var FacebookLogo = SvgFacebookLogo;
|
|
|
116
97
|
var GhostLogo = SvgGhostLogo;
|
|
117
98
|
var GhostOrb = SvgGhostOrb;
|
|
118
99
|
var GoogleLogo = SvgGoogleLogo;
|
|
119
|
-
var TwitterLogo = SvgTwitterLogo;
|
|
120
100
|
var XLogo = SvgXLogo;
|
|
121
101
|
//#endregion
|
|
122
|
-
export {
|
|
102
|
+
export { XLogo as a, GoogleLogo as i, GhostLogo as n, GhostOrb as r, FacebookLogo as t };
|
|
123
103
|
|
|
124
|
-
//# sourceMappingURL=images-
|
|
104
|
+
//# sourceMappingURL=images-DtbFINdz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images-DtbFINdz.js","names":[],"sources":["../src/assets/images/facebook-logo.svg?react","../src/assets/images/ghost-logo.svg?react","../src/assets/images/ghost-orb.svg?react","../src/assets/images/google-logo.svg?react","../src/assets/images/x-logo.svg?react","../src/assets/images/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgFacebookLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\tviewBox: \"0 0 40 40\",\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"social-facebook\" }),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z\",\n\t\t\tfill: \"#1977F3\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"m27.785 25.785.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 0 0 3.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z\",\n\t\t\tfill: \"#fff\"\n\t\t})\n\t]\n});\nexport default SvgFacebookLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgGhostLogo = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tviewBox: \"0 0 770 294\",\n\tstyle: {\n\t\tbackgroundSize: \"100% 100%\",\n\t\tbackgroundRepeat: \"no-repeat\",\n\t\tbackgroundImage: \"url(https://assets.ghost.io/admin/1597/assets/img/logos/ghost-logo-black-1-fb561a374422b405ec90fa586b05ebdf.png)\"\n\t},\n\talt: \"Ghost\",\n\t...props\n});\nexport default SvgGhostLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgGhostOrb = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tfill: \"none\",\n\theight: 24,\n\tviewBox: \"0 0 24 24\",\n\twidth: 24,\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: /* @__PURE__ */ _jsx(\"path\", {\n\t\tclipRule: \"evenodd\",\n\t\td: \"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM11.8326 2.33879C6.37785 2.95189 3.95901 5.20797 3.41126 9.74699C3.34896 10.2632 3.22642 10.7805 3.10443 11.2954C2.93277 12.02 2.76221 12.74 2.76221 13.4458C2.76221 17.9885 6.5856 21.556 11.1283 21.556C12.8959 21.556 14.4433 20.8144 15.8756 20.048C19.0536 18.3478 22.0328 16.2597 22.0328 12.5411C22.0328 9.91512 20.1051 7.56932 18.466 5.5747C18.3834 5.47416 18.3015 5.37451 18.2206 5.27577C17.3866 4.25742 14.4333 2.04643 11.8326 2.33879Z\",\n\t\tfill: \"currentColor\",\n\t\tfillRule: \"evenodd\"\n\t})\n});\nexport default SvgGhostOrb;\n","import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgGoogleLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\tviewBox: \"0 0 92 31\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"google\" }),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M39.15 15.898c0 4.303-3.378 7.473-7.525 7.473s-7.526-3.17-7.526-7.473c0-4.334 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.958-4.529-4.231-4.529-2.273 0-4.231 1.84-4.231 4.529 0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.231-1.87 4.231-4.528z\",\n\t\t\tfill: \"#EA4335\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M55.386 15.898c0 4.303-3.379 7.473-7.526 7.473-4.146 0-7.526-3.17-7.526-7.473 0-4.33 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.959-4.529-4.232-4.529s-4.231 1.84-4.231 4.529c0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.232-1.87 4.232-4.528z\",\n\t\t\tfill: \"#FBBC05\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M70.945 8.875v13.418c0 5.52-3.267 7.774-7.13 7.774-3.636 0-5.825-2.423-6.65-4.404l2.868-1.19c.511 1.217 1.763 2.652 3.779 2.652 2.472 0 4.004-1.52 4.004-4.38V21.67h-.115c-.737.906-2.158 1.698-3.95 1.698-3.751 0-7.188-3.255-7.188-7.443 0-4.22 3.437-7.501 7.188-7.501 1.789 0 3.21.792 3.95 1.671h.115V8.88h3.129v-.004zm-2.895 7.05c0-2.632-1.763-4.556-4.005-4.556-2.273 0-4.177 1.924-4.177 4.556 0 2.604 1.904 4.501 4.177 4.501 2.242 0 4.005-1.897 4.005-4.501z\",\n\t\t\tfill: \"#4285F4\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M76.103 1.01v21.903H72.89V1.011h3.213z\",\n\t\t\tfill: \"#34A853\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M88.624 18.357l2.558 1.699c-.826 1.216-2.815 3.312-6.251 3.312-4.262 0-7.445-3.282-7.445-7.474 0-4.444 3.21-7.473 7.076-7.473 3.893 0 5.798 3.086 6.42 4.754l.341.85-10.028 4.137c.768 1.5 1.962 2.264 3.636 2.264 1.678 0 2.841-.822 3.693-2.069zm-7.87-2.688l6.703-2.774c-.368-.933-1.478-1.583-2.783-1.583-1.674 0-4.005 1.472-3.92 4.357z\",\n\t\t\tfill: \"#EA4335\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M11.936 13.953v-3.17h10.726c.105.552.159 1.206.159 1.914 0 2.378-.653 5.32-2.757 7.416-2.046 2.123-4.66 3.255-8.124 3.255-6.42 0-11.818-5.21-11.818-11.605C.122 5.368 5.52.158 11.94.158c3.551 0 6.081 1.389 7.982 3.198l-2.246 2.237c-1.363-1.273-3.21-2.264-5.74-2.264-4.688 0-8.354 3.764-8.354 8.434s3.666 8.434 8.354 8.434c3.041 0 4.773-1.216 5.882-2.322.9-.896 1.492-2.176 1.725-3.925l-7.607.003z\",\n\t\t\tfill: \"#4285F4\"\n\t\t})\n\t]\n});\nexport default SvgGoogleLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgXLogo = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tviewBox: \"0 0 24 24\",\n\t\"aria-hidden\": \"true\",\n\t...props,\n\tchildren: /* @__PURE__ */ _jsx(\"g\", { children: /* @__PURE__ */ _jsx(\"path\", {\n\t\td: \"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\",\n\t\tfill: \"currentColor\"\n\t}) })\n});\nexport default SvgXLogo;\n","import type { FunctionComponent, SVGProps } from 'react';\nimport FacebookLogoSvg from './facebook-logo.svg?react';\nimport GhostLogoSvg from './ghost-logo.svg?react';\nimport GhostOrbSvg from './ghost-orb.svg?react';\nimport GoogleLogoSvg from './google-logo.svg?react';\nimport XLogoSvg from './x-logo.svg?react';\n\n// Explicit types keep the `?react` asset imports out of the published\n// declarations, where consumers can't resolve them.\ntype Logo = FunctionComponent<SVGProps<SVGSVGElement>>;\n\nexport const FacebookLogo: Logo = FacebookLogoSvg;\nexport const GhostLogo: Logo = GhostLogoSvg;\nexport const GhostOrb: Logo = GhostOrbSvg;\nexport const GoogleLogo: Logo = GoogleLogoSvg;\nexport const XLogo: Logo = XLogoSvg;\n"],"mappings":";;;AAEA,IAAM,mBAAmB,UAA0B,qBAAM,OAAO;CAC/D,MAAM;CACN,SAAS;CACT,OAAO;CACP,GAAG;CACH,UAAU;EACO,oBAAK,SAAS,EAAE,UAAU,kBAAkB,CAAC;EAC7C,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;CACF;AACD,CAAC;;;AChBD,IAAM,gBAAgB,UAA0B,oBAAK,OAAO;CAC3D,SAAS;CACT,OAAO;EACN,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;CAClB;CACA,KAAK;CACL,GAAG;AACJ,CAAC;;;ACTD,IAAM,eAAe,UAA0B,oBAAK,OAAO;CAC1D,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,OAAO;CACP,GAAG;CACH,UAA0B,oBAAK,QAAQ;EACtC,UAAU;EACV,GAAG;EACH,MAAM;EACN,UAAU;CACX,CAAC;AACF,CAAC;;;ACbD,IAAM,iBAAiB,UAA0B,qBAAM,OAAO;CAC7D,MAAM;CACN,SAAS;CACT,GAAG;CACH,UAAU;EACO,oBAAK,SAAS,EAAE,UAAU,SAAS,CAAC;EACpC,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;CACF;AACD,CAAC;;;AC/BD,IAAM,YAAY,UAA0B,oBAAK,OAAO;CACvD,SAAS;CACT,eAAe;CACf,GAAG;CACH,UAA0B,oBAAK,KAAK,EAAE,UAA0B,oBAAK,QAAQ;EAC5E,GAAG;EACH,MAAM;CACP,CAAC,EAAE,CAAC;AACL,CAAC;;;ACCD,IAAa,eAAqB;AAClC,IAAa,YAAkB;AAC/B,IAAa,WAAiB;AAC9B,IAAa,aAAmB;AAChC,IAAa,QAAc"}
|
package/es/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import { H1, H2, H3, H4, HTable } from "./components/layout/heading.js";
|
|
|
13
13
|
import "./primitives.js";
|
|
14
14
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
15
15
|
import { buttonVariants } from "./components/ui/button-variants.js";
|
|
16
|
+
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
17
|
+
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
16
18
|
import { Button } from "./components/ui/button.js";
|
|
17
19
|
import { selectTriggerVariants } from "./components/ui/select-variants.js";
|
|
18
20
|
import { inputSurface, inputSurfaceClasses } from "./components/ui/input-surface.js";
|
|
@@ -21,9 +23,10 @@ import { Kbd, KbdGroup } from "./components/ui/kbd.js";
|
|
|
21
23
|
import { PageHeader, PageHeaderActionGroup, PageHeaderActionGroupMobileMenu, PageHeaderActionGroupMobileMenuContent, PageHeaderActionGroupMobileMenuTrigger, PageHeaderActionGroupPrimary, PageHeaderActions, PageHeaderBreadcrumb, PageHeaderCount, PageHeaderDescription, PageHeaderLeft, PageHeaderMeta, PageHeaderTitle } from "./components/patterns/page-header.js";
|
|
22
24
|
import { ViewBar, ViewBarActions, ViewBarNav } from "./components/patterns/view-bar.js";
|
|
23
25
|
import { FilterBar } from "./components/patterns/filter-bar.js";
|
|
24
|
-
import { AlignedAxisTick, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent
|
|
26
|
+
import { AlignedAxisTick, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from "./components/ui/chart.js";
|
|
25
27
|
import { GhAreaChart, GhCustomTooltipContent } from "./components/patterns/gh-chart.js";
|
|
26
28
|
import { KpiCardHeader, KpiCardHeaderLabel, KpiCardHeaderValue } from "./components/patterns/kpi-card.js";
|
|
29
|
+
import { tabSurfaceVariants, tabsVariants } from "./components/ui/tabs-variants.js";
|
|
27
30
|
import { Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount } from "./components/ui/tabs.js";
|
|
28
31
|
import { KpiDropdownButton, KpiTabTrigger, KpiTabValue } from "./components/patterns/kpi-tabs.js";
|
|
29
32
|
import { Calendar, CalendarDayButton } from "./components/ui/calendar.js";
|
|
@@ -48,8 +51,6 @@ import { Input } from "./components/ui/input.js";
|
|
|
48
51
|
import ColorPicker, { ColorPickerTrigger, ColorSwatch, ColorSwatchRow } from "./components/patterns/color-picker.js";
|
|
49
52
|
import ShareModal from "./components/patterns/share-modal.js";
|
|
50
53
|
import { settingsModalVariants } from "./components/patterns/settings-modal-variants.js";
|
|
51
|
-
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
52
|
-
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
53
54
|
import { StickyFooter } from "./components/ui/sticky-footer.js";
|
|
54
55
|
import { SettingsModal } from "./components/patterns/settings-modal.js";
|
|
55
56
|
import "./patterns.js";
|
|
@@ -103,11 +104,11 @@ import { useSidebar } from "./components/ui/sidebar-context.js";
|
|
|
103
104
|
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger } from "./components/ui/sidebar.js";
|
|
104
105
|
import { DragIndicator, SortableList } from "./components/ui/sortable-list.js";
|
|
105
106
|
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow } from "./components/ui/table.js";
|
|
106
|
-
import { tabsVariants } from "./components/ui/tabs-variants.js";
|
|
107
107
|
import { Textarea } from "./components/ui/textarea.js";
|
|
108
|
+
import { toast } from "./components/ui/toast.js";
|
|
108
109
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
109
|
-
import { a as
|
|
110
|
+
import { a as XLogo, i as GoogleLogo, n as GhostLogo, r as GhostOrb, t as FacebookLogo } from "./images-DtbFINdz.js";
|
|
110
111
|
import { TimePicker } from "./components/ui/time-picker.js";
|
|
111
112
|
import { tokenFieldClasses } from "./components/ui/token-field.js";
|
|
112
113
|
import { commandDefaultFilter } from "./components.js";
|
|
113
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, ColorPicker, ColorPickerTrigger, ColorSwatch, ColorSwatchRow, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DEFAULT_I18N, DEFAULT_OPERATORS, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow,
|
|
114
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, ColorPicker, ColorPickerTrigger, ColorSwatch, ColorSwatchRow, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DEFAULT_I18N, DEFAULT_OPERATORS, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirtyConfirmDialog, DragIndicator, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, EmptyBadge, EmptyCard, EmptyIndicator, ErrorPage, FLOATING_SIDEBAR_BUMP, FLOATING_SIDEBAR_CLOSED_FOOTPRINT, FLOATING_SIDEBAR_CLOSED_SIZE, FLOATING_SIDEBAR_DURATION, FLOATING_SIDEBAR_EASE, FLOATING_SIDEBAR_EASE_DURATION, FLOATING_SIDEBAR_INSET, FLOATING_SIDEBAR_OPEN_WIDTH, FLOATING_SIDEBAR_SPRING, FacebookLogo, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FilterBar, FilterDatePicker, FilterSegmentInput, FilterSegmentMultiSelect, FilterSegmentSelect, Filters, FiltersContent, Flag, FloatingSidebar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GhAreaChart, GhCustomTooltipContent, GhostLogo, GhostOrb, GoogleLogo, Grid, H1, H2, H3, H4, HTable, HoverCard, HoverCardContent, HoverCardTrigger, IconComponents as Icon, ImageUpload, ImageUploadAction, ImageUploadActions, ImageUploadDropzone, ImageUploadImage, ImageUploadPreview, Indicator, Inline, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, KpiCardHeader, KpiCardHeaderLabel, KpiCardHeaderValue, KpiDropdownButton, KpiTabTrigger, KpiTabValue, Label, Link, ListPage, ListPageBody, ListPageHeader, LoadingIndicator, ModalPage, ModalPageTitle, MultiSelectCombobox, Navbar, NavbarActions, NavbarNavigation, NoValueLabel, NoValueLabelIcon, PageChromeProvider, PageHeader, PageHeaderActionGroup, PageHeaderActionGroupMobileMenu, PageHeaderActionGroupMobileMenuContent, PageHeaderActionGroupMobileMenuTrigger, PageHeaderActionGroupPrimary, PageHeaderActions, PageHeaderBreadcrumb, PageHeaderCount, PageHeaderDescription, PageHeaderLeft, PageHeaderMeta, PageHeaderTitle, PageMenu, PageMenuItem, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PreviewChrome, RadioGroup, RadioGroupItem, SHADE_TOKEN_NAMES, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingGroup, SettingGroupActions, SettingGroupContent, SettingGroupDescription, SettingGroupDetails, SettingGroupHeader, SettingGroupTitle, SettingGroupValue, SettingGroupValueContent, SettingGroupValueTitle, SettingsModal, ShareModal, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimplePagination, SimplePaginationNavigation, SimplePaginationNextButton, SimplePaginationPages, SimplePaginationPreviousButton, Skeleton, SkeletonTable, SortableList, Stack, StickyFooter, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow, Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount, Text, Textarea, TimePicker, Toaster, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, ViewBar, ViewBarActions, ViewBarNav, XLogo, badgeVariants, bannerVariants, buttonVariants, cardVariants, commandDefaultFilter, createFilter, createFilterGroup, dropzoneVariants, getFloatingSidebarGapWidth, getFloatingSidebarTiming, imageOverlayButton, imageOverlayButtonClasses, imageUploadPreviewVariants, indicatorVariants, inputGroupVariants, inputSurface, inputSurfaceClasses, previewChromeVariants, radioGroupItemVariants, selectTriggerVariants, settingGroupVariants, settingsModalVariants, shadeToken, tabSurfaceVariants, tabsVariants, toast, tokenFieldClasses, useDirtyConfirmation, useFormField, usePageChrome, useSidebar };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
//#region src/lib/date-utils.ts
|
|
2
|
+
var MONTHS = [
|
|
3
|
+
"Jan",
|
|
4
|
+
"Feb",
|
|
5
|
+
"Mar",
|
|
6
|
+
"Apr",
|
|
7
|
+
"May",
|
|
8
|
+
"Jun",
|
|
9
|
+
"Jul",
|
|
10
|
+
"Aug",
|
|
11
|
+
"Sep",
|
|
12
|
+
"Oct",
|
|
13
|
+
"Nov",
|
|
14
|
+
"Dec"
|
|
15
|
+
];
|
|
16
|
+
var DAY_MS = 1440 * 60 * 1e3;
|
|
17
|
+
var INVALID_DATE = "Invalid date";
|
|
18
|
+
var zonedFormatters = /* @__PURE__ */ new Map();
|
|
19
|
+
var getZonedFormatter = (timeZone) => {
|
|
20
|
+
let formatter = zonedFormatters.get(timeZone);
|
|
21
|
+
if (!formatter) {
|
|
22
|
+
try {
|
|
23
|
+
formatter = new Intl.DateTimeFormat("en-US", {
|
|
24
|
+
timeZone,
|
|
25
|
+
hourCycle: "h23",
|
|
26
|
+
year: "numeric",
|
|
27
|
+
month: "numeric",
|
|
28
|
+
day: "numeric",
|
|
29
|
+
hour: "numeric",
|
|
30
|
+
minute: "numeric",
|
|
31
|
+
second: "numeric"
|
|
32
|
+
});
|
|
33
|
+
} catch (error) {
|
|
34
|
+
if (!(error instanceof RangeError)) throw error;
|
|
35
|
+
formatter = getZonedFormatter("UTC");
|
|
36
|
+
}
|
|
37
|
+
zonedFormatters.set(timeZone, formatter);
|
|
38
|
+
}
|
|
39
|
+
return formatter;
|
|
40
|
+
};
|
|
41
|
+
var getDateTimeParts = (date, timeZone) => {
|
|
42
|
+
if (!timeZone) return {
|
|
43
|
+
year: date.getFullYear(),
|
|
44
|
+
month: date.getMonth(),
|
|
45
|
+
day: date.getDate(),
|
|
46
|
+
hour: date.getHours(),
|
|
47
|
+
minute: date.getMinutes(),
|
|
48
|
+
second: date.getSeconds()
|
|
49
|
+
};
|
|
50
|
+
const parts = getZonedFormatter(timeZone).formatToParts(date);
|
|
51
|
+
const get = (type) => Number(parts.find((part) => part.type === type)?.value);
|
|
52
|
+
return {
|
|
53
|
+
year: get("year"),
|
|
54
|
+
month: get("month") - 1,
|
|
55
|
+
day: get("day"),
|
|
56
|
+
hour: get("hour"),
|
|
57
|
+
minute: get("minute"),
|
|
58
|
+
second: get("second")
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
var toUTCTime = ({ year, month, day, hour, minute, second }) => {
|
|
62
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
63
|
+
date.setUTCFullYear(year, month, day);
|
|
64
|
+
date.setUTCHours(hour, minute, second);
|
|
65
|
+
return date.getTime();
|
|
66
|
+
};
|
|
67
|
+
var fromWallClockTime = (parts, timeZone) => {
|
|
68
|
+
if (!timeZone) {
|
|
69
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
70
|
+
date.setFullYear(parts.year, parts.month, parts.day);
|
|
71
|
+
date.setHours(parts.hour, parts.minute, parts.second, 0);
|
|
72
|
+
return date;
|
|
73
|
+
}
|
|
74
|
+
const wallClockTime = toUTCTime(parts);
|
|
75
|
+
const readWallClockTime = (time) => toUTCTime(getDateTimeParts(new Date(time), timeZone));
|
|
76
|
+
const getOffset = (time) => readWallClockTime(time) - time;
|
|
77
|
+
const withOffsetBefore = wallClockTime - getOffset(wallClockTime - DAY_MS);
|
|
78
|
+
const withOffsetAfter = wallClockTime - getOffset(wallClockTime + DAY_MS);
|
|
79
|
+
if (withOffsetBefore === withOffsetAfter) return new Date(withOffsetBefore);
|
|
80
|
+
const occurrences = [withOffsetBefore, withOffsetAfter].filter((time) => readWallClockTime(time) === wallClockTime).sort((a, b) => a - b);
|
|
81
|
+
return new Date(occurrences[0] ?? withOffsetBefore);
|
|
82
|
+
};
|
|
83
|
+
var ISO_EXTENDED_DATE_TIME = /^(?<year>\d{4})-(?<month>\d{2})(?:-(?<day>\d{2})(?:[T ](?<hour>\d{2})(?::(?<minute>\d{2})(?::(?<second>\d{2})(?:[.,]\d+)?)?)?(?<offset>Z|(?<offsetSign>[+-])(?<offsetHours>\d{2}):?(?<offsetMinutes>\d{2})?)?)?)?$/;
|
|
84
|
+
var ISO_BASIC_DATE_TIME = /^(?<year>\d{4})(?<month>\d{2})(?<day>\d{2})(?:[T ](?<hour>\d{2})(?:(?<minute>\d{2})(?:(?<second>\d{2})(?:[.,]\d+)?)?)?(?<offset>Z|(?<offsetSign>[+-])(?<offsetHours>\d{2}):?(?<offsetMinutes>\d{2})?)?)?$/;
|
|
85
|
+
var parseDate = (value, timeZone) => {
|
|
86
|
+
const match = ISO_EXTENDED_DATE_TIME.exec(value) ?? ISO_BASIC_DATE_TIME.exec(value);
|
|
87
|
+
if (!match?.groups) {
|
|
88
|
+
const date = new Date(value);
|
|
89
|
+
return isNaN(date.getTime()) ? null : date;
|
|
90
|
+
}
|
|
91
|
+
const { year, month, day = "1", hour = "0", minute = "0", second = "0", offset, offsetSign, offsetHours = "0", offsetMinutes = "0" } = match.groups;
|
|
92
|
+
const parts = {
|
|
93
|
+
year: Number(year),
|
|
94
|
+
month: Number(month) - 1,
|
|
95
|
+
day: Number(day),
|
|
96
|
+
hour: Number(hour),
|
|
97
|
+
minute: Number(minute),
|
|
98
|
+
second: Number(second)
|
|
99
|
+
};
|
|
100
|
+
const utc = new Date(toUTCTime(parts));
|
|
101
|
+
if (!(utc.getUTCMonth() === parts.month && utc.getUTCDate() === parts.day && utc.getUTCHours() === parts.hour && utc.getUTCMinutes() === parts.minute && utc.getUTCSeconds() === parts.second && Number(offsetHours) < 24 && Number(offsetMinutes) < 60)) return null;
|
|
102
|
+
if (!offset) return fromWallClockTime(parts, timeZone);
|
|
103
|
+
const offsetMs = (Number(offsetHours) * 60 + Number(offsetMinutes)) * 60 * 1e3;
|
|
104
|
+
return new Date(utc.getTime() - (offsetSign === "-" ? -offsetMs : offsetMs));
|
|
105
|
+
};
|
|
106
|
+
var formatTime = ({ hour, minute }) => `${hour % 12 || 12}:${String(minute).padStart(2, "0")}${hour < 12 ? "am" : "pm"}`;
|
|
107
|
+
var formatDate = ({ year, month, day }, timeZone) => {
|
|
108
|
+
const date = `${day} ${MONTHS[month]}`;
|
|
109
|
+
return year === getDateTimeParts(/* @__PURE__ */ new Date(), timeZone).year ? date : `${date} ${year}`;
|
|
110
|
+
};
|
|
111
|
+
var formatDisplayDate = (dateString, timezone) => {
|
|
112
|
+
if (dateString instanceof Date) dateString = dateString.toISOString();
|
|
113
|
+
if (!dateString || dateString.length === 0 || typeof dateString !== "string") return "";
|
|
114
|
+
const timeZone = timezone || "UTC";
|
|
115
|
+
const date = parseDate(dateString, timeZone);
|
|
116
|
+
return date ? formatDate(getDateTimeParts(date, timeZone), timeZone) : INVALID_DATE;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Format a plain time in a given time zone.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* formatDisplayTime('2020-04-20T18:09:12.345Z', 'Africa/Lagos')
|
|
123
|
+
* // 7:09pm
|
|
124
|
+
*/
|
|
125
|
+
var formatDisplayTime = (dateString, timezone) => {
|
|
126
|
+
if (!dateString) return "";
|
|
127
|
+
const timeZone = timezone || "UTC";
|
|
128
|
+
const date = parseDate(dateString, timeZone);
|
|
129
|
+
return date ? formatTime(getDateTimeParts(date, timeZone)) : INVALID_DATE;
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Formats a date based on the range, in the browser's time zone
|
|
133
|
+
* - For ranges of 365 days or more: shows month and year (e.g. "Apr 2025")
|
|
134
|
+
* - For ranges of 90 days or more: shows "Week of [date]"
|
|
135
|
+
* - For other ranges: shows the date in the same format as formatDisplayDate
|
|
136
|
+
*/
|
|
137
|
+
var formatDisplayDateWithRange = (date, range, showHours = false, hoursOnly = false) => {
|
|
138
|
+
if (!date) return "";
|
|
139
|
+
const parsed = parseDate(date);
|
|
140
|
+
if (!parsed) return INVALID_DATE;
|
|
141
|
+
const parts = getDateTimeParts(parsed);
|
|
142
|
+
if (range === 1 && hoursOnly) return formatTime(parts);
|
|
143
|
+
else if (range === 1 && showHours) return `${MONTHS[parts.month]} ${parts.day}, ${formatTime(parts)}`;
|
|
144
|
+
else if (range >= 365) return `${MONTHS[parts.month]} ${parts.year}`;
|
|
145
|
+
else if (range >= 90) return `Week of ${formatDate(parts)}`;
|
|
146
|
+
return formatDate(parts);
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { formatDisplayDate, formatDisplayDateWithRange, formatDisplayTime };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=date-utils.js.map
|