@tetherto/dev-websites-core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -9
- package/dist/cms/index.d.mts +3 -0
- package/dist/cms/index.mjs +3 -0
- package/dist/cms.mjs +1419 -0
- package/dist/cms.mjs.map +1 -0
- package/dist/i18n/index.d.mts +2 -0
- package/dist/i18n/index.mjs +2 -0
- package/dist/i18n.mjs +10 -0
- package/dist/i18n.mjs.map +1 -0
- package/dist/index.d.mts +214 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +7 -0
- package/dist/index2.d.mts +8 -0
- package/dist/index2.d.mts.map +1 -0
- package/dist/index3.d.mts +63 -0
- package/dist/index3.d.mts.map +1 -0
- package/dist/index4.d.mts +23 -0
- package/dist/index4.d.mts.map +1 -0
- package/dist/index5.d.mts +6 -0
- package/dist/logger.mjs +44 -0
- package/dist/logger.mjs.map +1 -0
- package/dist/readMediaBuffer.d.mts +15 -0
- package/dist/readMediaBuffer.d.mts.map +1 -0
- package/dist/readMediaBuffer.mjs +62 -0
- package/dist/readMediaBuffer.mjs.map +1 -0
- package/dist/seo/index.d.mts +2 -0
- package/dist/seo/index.mjs +2 -0
- package/dist/seo.mjs +124 -0
- package/dist/seo.mjs.map +1 -0
- package/dist/ui/a11y/focus.d.mts +6 -0
- package/dist/ui/a11y/focus.d.mts.map +1 -0
- package/dist/ui/a11y/focus.mjs +7 -0
- package/dist/ui/a11y/focus.mjs.map +1 -0
- package/dist/ui/a11y/index.d.mts +4 -0
- package/dist/ui/a11y/index.mjs +4 -0
- package/dist/ui/carousel/index.d.mts +3 -0
- package/dist/ui/carousel/index.mjs +3 -0
- package/dist/ui/components/Accordion/Accordion.d.mts +16 -0
- package/dist/ui/components/Accordion/Accordion.d.mts.map +1 -0
- package/dist/ui/components/Accordion/Accordion.mjs +51 -0
- package/dist/ui/components/Accordion/Accordion.mjs.map +1 -0
- package/dist/ui/components/Accordion/index.d.mts +2 -0
- package/dist/ui/components/Accordion/index.mjs +2 -0
- package/dist/ui/components/Avatar/Avatar.d.mts +9 -0
- package/dist/ui/components/Avatar/Avatar.d.mts.map +1 -0
- package/dist/ui/components/Avatar/Avatar.mjs +15 -0
- package/dist/ui/components/Avatar/Avatar.mjs.map +1 -0
- package/dist/ui/components/Avatar/index.d.mts +2 -0
- package/dist/ui/components/Avatar/index.mjs +2 -0
- package/dist/ui/components/Badge/Badge.d.mts +14 -0
- package/dist/ui/components/Badge/Badge.d.mts.map +1 -0
- package/dist/ui/components/Badge/Badge.mjs +30 -0
- package/dist/ui/components/Badge/Badge.mjs.map +1 -0
- package/dist/ui/components/Badge/index.d.mts +2 -0
- package/dist/ui/components/Badge/index.mjs +2 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.d.mts +24 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.d.mts.map +1 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.mjs +66 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.mjs.map +1 -0
- package/dist/ui/components/BadgeVersion/index.d.mts +2 -0
- package/dist/ui/components/BadgeVersion/index.mjs +2 -0
- package/dist/ui/components/Button/Button.d.mts +14 -0
- package/dist/ui/components/Button/Button.d.mts.map +1 -0
- package/dist/ui/components/Button/Button.mjs +48 -0
- package/dist/ui/components/Button/Button.mjs.map +1 -0
- package/dist/ui/components/Button/index.d.mts +2 -0
- package/dist/ui/components/Button/index.mjs +2 -0
- package/dist/ui/components/Card/Card.d.mts +14 -0
- package/dist/ui/components/Card/Card.d.mts.map +1 -0
- package/dist/ui/components/Card/Card.mjs +40 -0
- package/dist/ui/components/Card/Card.mjs.map +1 -0
- package/dist/ui/components/Card/index.d.mts +2 -0
- package/dist/ui/components/Card/index.mjs +2 -0
- package/dist/ui/components/Carousel/Carousel.d.mts +42 -0
- package/dist/ui/components/Carousel/Carousel.d.mts.map +1 -0
- package/dist/ui/components/Carousel/Carousel.mjs +164 -0
- package/dist/ui/components/Carousel/Carousel.mjs.map +1 -0
- package/dist/ui/components/Carousel/index.d.mts +2 -0
- package/dist/ui/components/Carousel/index.mjs +2 -0
- package/dist/ui/components/Checkbox/Checkbox.d.mts +8 -0
- package/dist/ui/components/Checkbox/Checkbox.d.mts.map +1 -0
- package/dist/ui/components/Checkbox/Checkbox.mjs +39 -0
- package/dist/ui/components/Checkbox/Checkbox.mjs.map +1 -0
- package/dist/ui/components/Checkbox/index.d.mts +2 -0
- package/dist/ui/components/Checkbox/index.mjs +2 -0
- package/dist/ui/components/CodeBlock/CodeBlock.d.mts +22 -0
- package/dist/ui/components/CodeBlock/CodeBlock.d.mts.map +1 -0
- package/dist/ui/components/CodeBlock/CodeBlock.mjs +66 -0
- package/dist/ui/components/CodeBlock/CodeBlock.mjs.map +1 -0
- package/dist/ui/components/CodeBlock/index.d.mts +2 -0
- package/dist/ui/components/CodeBlock/index.mjs +2 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.d.mts +19 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.d.mts.map +1 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.mjs +59 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.mjs.map +1 -0
- package/dist/ui/components/CodeBlockTabs/index.d.mts +2 -0
- package/dist/ui/components/CodeBlockTabs/index.mjs +2 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.d.mts +13 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.d.mts.map +1 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.mjs +55 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.mjs.map +1 -0
- package/dist/ui/components/CollapsibleSection/index.d.mts +2 -0
- package/dist/ui/components/CollapsibleSection/index.mjs +2 -0
- package/dist/ui/components/CopyButton/CopyButton.d.mts +12 -0
- package/dist/ui/components/CopyButton/CopyButton.d.mts.map +1 -0
- package/dist/ui/components/CopyButton/CopyButton.mjs +45 -0
- package/dist/ui/components/CopyButton/CopyButton.mjs.map +1 -0
- package/dist/ui/components/CopyButton/index.d.mts +2 -0
- package/dist/ui/components/CopyButton/index.mjs +2 -0
- package/dist/ui/components/Dialog/Dialog.d.mts +26 -0
- package/dist/ui/components/Dialog/Dialog.d.mts.map +1 -0
- package/dist/ui/components/Dialog/Dialog.mjs +79 -0
- package/dist/ui/components/Dialog/Dialog.mjs.map +1 -0
- package/dist/ui/components/Dialog/index.d.mts +2 -0
- package/dist/ui/components/Dialog/index.mjs +2 -0
- package/dist/ui/components/EmptyState/EmptyState.d.mts +18 -0
- package/dist/ui/components/EmptyState/EmptyState.d.mts.map +1 -0
- package/dist/ui/components/EmptyState/EmptyState.mjs +36 -0
- package/dist/ui/components/EmptyState/EmptyState.mjs.map +1 -0
- package/dist/ui/components/EmptyState/index.d.mts +2 -0
- package/dist/ui/components/EmptyState/index.mjs +2 -0
- package/dist/ui/components/FieldError/FieldError.d.mts +14 -0
- package/dist/ui/components/FieldError/FieldError.d.mts.map +1 -0
- package/dist/ui/components/FieldError/FieldError.mjs +19 -0
- package/dist/ui/components/FieldError/FieldError.mjs.map +1 -0
- package/dist/ui/components/FieldError/index.d.mts +2 -0
- package/dist/ui/components/FieldError/index.mjs +2 -0
- package/dist/ui/components/FormattedDate/FormattedDate.d.mts +15 -0
- package/dist/ui/components/FormattedDate/FormattedDate.d.mts.map +1 -0
- package/dist/ui/components/FormattedDate/FormattedDate.mjs +23 -0
- package/dist/ui/components/FormattedDate/FormattedDate.mjs.map +1 -0
- package/dist/ui/components/FormattedDate/index.d.mts +2 -0
- package/dist/ui/components/FormattedDate/index.mjs +2 -0
- package/dist/ui/components/IconButton/IconButton.d.mts +10 -0
- package/dist/ui/components/IconButton/IconButton.d.mts.map +1 -0
- package/dist/ui/components/IconButton/IconButton.mjs +19 -0
- package/dist/ui/components/IconButton/IconButton.mjs.map +1 -0
- package/dist/ui/components/IconButton/index.d.mts +2 -0
- package/dist/ui/components/IconButton/index.mjs +2 -0
- package/dist/ui/components/Input/Input.d.mts +12 -0
- package/dist/ui/components/Input/Input.d.mts.map +1 -0
- package/dist/ui/components/Input/Input.mjs +43 -0
- package/dist/ui/components/Input/Input.mjs.map +1 -0
- package/dist/ui/components/Input/index.d.mts +2 -0
- package/dist/ui/components/Input/index.mjs +2 -0
- package/dist/ui/components/Label/Label.d.mts +11 -0
- package/dist/ui/components/Label/Label.d.mts.map +1 -0
- package/dist/ui/components/Label/Label.mjs +18 -0
- package/dist/ui/components/Label/Label.mjs.map +1 -0
- package/dist/ui/components/Label/index.d.mts +2 -0
- package/dist/ui/components/Label/index.mjs +2 -0
- package/dist/ui/components/LazyVideo/LazyVideo.d.mts +23 -0
- package/dist/ui/components/LazyVideo/LazyVideo.d.mts.map +1 -0
- package/dist/ui/components/LazyVideo/LazyVideo.mjs +57 -0
- package/dist/ui/components/LazyVideo/LazyVideo.mjs.map +1 -0
- package/dist/ui/components/LazyVideo/index.d.mts +2 -0
- package/dist/ui/components/LazyVideo/index.mjs +2 -0
- package/dist/ui/components/Pagination/Pagination.d.mts +38 -0
- package/dist/ui/components/Pagination/Pagination.d.mts.map +1 -0
- package/dist/ui/components/Pagination/Pagination.mjs +110 -0
- package/dist/ui/components/Pagination/Pagination.mjs.map +1 -0
- package/dist/ui/components/Pagination/index.d.mts +2 -0
- package/dist/ui/components/Pagination/index.mjs +2 -0
- package/dist/ui/components/PaginationItem/PaginationItem.d.mts +15 -0
- package/dist/ui/components/PaginationItem/PaginationItem.d.mts.map +1 -0
- package/dist/ui/components/PaginationItem/PaginationItem.mjs +34 -0
- package/dist/ui/components/PaginationItem/PaginationItem.mjs.map +1 -0
- package/dist/ui/components/PaginationItem/index.d.mts +2 -0
- package/dist/ui/components/PaginationItem/index.mjs +2 -0
- package/dist/ui/components/PasswordInput/PasswordInput.d.mts +10 -0
- package/dist/ui/components/PasswordInput/PasswordInput.d.mts.map +1 -0
- package/dist/ui/components/PasswordInput/PasswordInput.mjs +39 -0
- package/dist/ui/components/PasswordInput/PasswordInput.mjs.map +1 -0
- package/dist/ui/components/PasswordInput/index.d.mts +2 -0
- package/dist/ui/components/PasswordInput/index.mjs +2 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.d.mts +20 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.d.mts.map +1 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.mjs +39 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.mjs.map +1 -0
- package/dist/ui/components/ProgressStepper/index.d.mts +2 -0
- package/dist/ui/components/ProgressStepper/index.mjs +2 -0
- package/dist/ui/components/Prose/Prose.d.mts +10 -0
- package/dist/ui/components/Prose/Prose.d.mts.map +1 -0
- package/dist/ui/components/Prose/Prose.mjs +19 -0
- package/dist/ui/components/Prose/Prose.mjs.map +1 -0
- package/dist/ui/components/Prose/index.d.mts +2 -0
- package/dist/ui/components/Prose/index.mjs +2 -0
- package/dist/ui/components/Radio/Radio.d.mts +8 -0
- package/dist/ui/components/Radio/Radio.d.mts.map +1 -0
- package/dist/ui/components/Radio/Radio.mjs +25 -0
- package/dist/ui/components/Radio/Radio.mjs.map +1 -0
- package/dist/ui/components/Radio/index.d.mts +2 -0
- package/dist/ui/components/Radio/index.mjs +2 -0
- package/dist/ui/components/Reveal/Reveal.d.mts +10 -0
- package/dist/ui/components/Reveal/Reveal.d.mts.map +1 -0
- package/dist/ui/components/Reveal/Reveal.mjs +18 -0
- package/dist/ui/components/Reveal/Reveal.mjs.map +1 -0
- package/dist/ui/components/Reveal/index.d.mts +2 -0
- package/dist/ui/components/Reveal/index.mjs +2 -0
- package/dist/ui/components/SearchInput/SearchInput.d.mts +15 -0
- package/dist/ui/components/SearchInput/SearchInput.d.mts.map +1 -0
- package/dist/ui/components/SearchInput/SearchInput.mjs +28 -0
- package/dist/ui/components/SearchInput/SearchInput.mjs.map +1 -0
- package/dist/ui/components/SearchInput/index.d.mts +2 -0
- package/dist/ui/components/SearchInput/index.mjs +2 -0
- package/dist/ui/components/Select/Select.d.mts +34 -0
- package/dist/ui/components/Select/Select.d.mts.map +1 -0
- package/dist/ui/components/Select/Select.mjs +167 -0
- package/dist/ui/components/Select/Select.mjs.map +1 -0
- package/dist/ui/components/Select/index.d.mts +2 -0
- package/dist/ui/components/Select/index.mjs +2 -0
- package/dist/ui/components/Sheet/Sheet.d.mts +19 -0
- package/dist/ui/components/Sheet/Sheet.d.mts.map +1 -0
- package/dist/ui/components/Sheet/Sheet.mjs +59 -0
- package/dist/ui/components/Sheet/Sheet.mjs.map +1 -0
- package/dist/ui/components/Sheet/index.d.mts +2 -0
- package/dist/ui/components/Sheet/index.mjs +2 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.d.mts +10 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.d.mts.map +1 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.mjs +31 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.mjs.map +1 -0
- package/dist/ui/components/StaggerReveal/index.d.mts +2 -0
- package/dist/ui/components/StaggerReveal/index.mjs +2 -0
- package/dist/ui/components/Stepper/Stepper.d.mts +15 -0
- package/dist/ui/components/Stepper/Stepper.d.mts.map +1 -0
- package/dist/ui/components/Stepper/Stepper.mjs +38 -0
- package/dist/ui/components/Stepper/Stepper.mjs.map +1 -0
- package/dist/ui/components/Stepper/index.d.mts +2 -0
- package/dist/ui/components/Stepper/index.mjs +2 -0
- package/dist/ui/components/Switch/Switch.d.mts +12 -0
- package/dist/ui/components/Switch/Switch.d.mts.map +1 -0
- package/dist/ui/components/Switch/Switch.mjs +34 -0
- package/dist/ui/components/Switch/Switch.mjs.map +1 -0
- package/dist/ui/components/Switch/index.d.mts +2 -0
- package/dist/ui/components/Switch/index.mjs +2 -0
- package/dist/ui/components/TextButton/TextButton.d.mts +9 -0
- package/dist/ui/components/TextButton/TextButton.d.mts.map +1 -0
- package/dist/ui/components/TextButton/TextButton.mjs +16 -0
- package/dist/ui/components/TextButton/TextButton.mjs.map +1 -0
- package/dist/ui/components/TextButton/index.d.mts +2 -0
- package/dist/ui/components/TextButton/index.mjs +2 -0
- package/dist/ui/components/Textarea/Textarea.d.mts +9 -0
- package/dist/ui/components/Textarea/Textarea.d.mts.map +1 -0
- package/dist/ui/components/Textarea/Textarea.mjs +27 -0
- package/dist/ui/components/Textarea/Textarea.mjs.map +1 -0
- package/dist/ui/components/Textarea/index.d.mts +2 -0
- package/dist/ui/components/Textarea/index.mjs +2 -0
- package/dist/ui/components/Toast/Toast.d.mts +20 -0
- package/dist/ui/components/Toast/Toast.d.mts.map +1 -0
- package/dist/ui/components/Toast/Toast.mjs +128 -0
- package/dist/ui/components/Toast/Toast.mjs.map +1 -0
- package/dist/ui/components/Toast/index.d.mts +2 -0
- package/dist/ui/components/Toast/index.mjs +2 -0
- package/dist/ui/components/Tooltip/Tooltip.d.mts +11 -0
- package/dist/ui/components/Tooltip/Tooltip.d.mts.map +1 -0
- package/dist/ui/components/Tooltip/Tooltip.mjs +20 -0
- package/dist/ui/components/Tooltip/Tooltip.mjs.map +1 -0
- package/dist/ui/components/Tooltip/index.d.mts +2 -0
- package/dist/ui/components/Tooltip/index.mjs +2 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.d.mts +7 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.d.mts.map +1 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.mjs +13 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -0
- package/dist/ui/components/VisuallyHidden/index.d.mts +2 -0
- package/dist/ui/components/VisuallyHidden/index.mjs +2 -0
- package/dist/ui/hooks/index.d.mts +2 -0
- package/dist/ui/hooks/index.mjs +2 -0
- package/dist/ui/hooks/useInView.d.mts +13 -0
- package/dist/ui/hooks/useInView.d.mts.map +1 -0
- package/dist/ui/hooks/useInView.mjs +37 -0
- package/dist/ui/hooks/useInView.mjs.map +1 -0
- package/dist/ui/index.d.mts +81 -0
- package/dist/ui/index.mjs +40 -0
- package/dist/ui/theme/preset.d.mts +170 -0
- package/dist/ui/theme/preset.d.mts.map +1 -0
- package/dist/ui/theme/preset.mjs +143 -0
- package/dist/ui/theme/preset.mjs.map +1 -0
- package/dist/ui/utils/cn.d.mts +6 -0
- package/dist/ui/utils/cn.d.mts.map +1 -0
- package/dist/ui/utils/cn.mjs +42 -0
- package/dist/ui/utils/cn.mjs.map +1 -0
- package/dist/ui/utils/index.d.mts +2 -0
- package/dist/ui/utils/index.mjs +2 -0
- package/dist/utils/index.d.mts +2 -0
- package/dist/utils/index.mjs +3 -0
- package/dist/utils.mjs +18 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +66 -7
- package/src/ui/theme/preset.css +53 -0
- package/src/ui/theme/preset.ts +131 -0
- package/src/ui/theme/theme.css +12 -0
- package/src/ui/theme/tokens.css +57 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
//#region src/ui/components/CodeBlockTabs/CodeBlockTabs.tsx
|
|
6
|
+
const PRE_CLASS = "[&>pre]:m-0 [&>pre]:font-mono [&>pre]:text-[13px] [&>pre]:leading-[22px] [&>pre]:wrap-break-word [&>pre]:whitespace-pre-wrap";
|
|
7
|
+
const SHELL = {
|
|
8
|
+
light: "border-border bg-foreground/5",
|
|
9
|
+
dark: "border-border bg-surface-elevated"
|
|
10
|
+
};
|
|
11
|
+
const TAB_IDLE = {
|
|
12
|
+
light: "border-border text-muted hover:text-foreground",
|
|
13
|
+
dark: "border-border bg-card text-muted hover:text-foreground"
|
|
14
|
+
};
|
|
15
|
+
function CodeBlockTabs({ tabs, className, theme = "light", tabsAriaLabel }) {
|
|
16
|
+
const [active, setActive] = useState(0);
|
|
17
|
+
if (tabs.length === 0) return null;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: cn("flex flex-col gap-4 overflow-hidden rounded-card border p-5", SHELL[theme], className),
|
|
20
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
21
|
+
role: "tablist",
|
|
22
|
+
"aria-label": tabsAriaLabel,
|
|
23
|
+
className: "flex flex-wrap gap-2 print:hidden",
|
|
24
|
+
children: tabs.map((tab, idx) => {
|
|
25
|
+
const isActive = idx === active;
|
|
26
|
+
return /* @__PURE__ */ jsx("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
role: "tab",
|
|
29
|
+
id: `code-tab-${tab.id}`,
|
|
30
|
+
"aria-selected": isActive,
|
|
31
|
+
"aria-controls": `code-tab-panel-${tab.id}`,
|
|
32
|
+
onClick: () => setActive(idx),
|
|
33
|
+
className: cn("rounded-full border px-4 py-2 text-btn font-medium transition-colors", isActive ? "border-accent/30 bg-accent/12 text-accent" : TAB_IDLE[theme]),
|
|
34
|
+
children: tab.label
|
|
35
|
+
}, tab.id);
|
|
36
|
+
})
|
|
37
|
+
}), tabs.map((tab, idx) => {
|
|
38
|
+
const isActive = idx === active;
|
|
39
|
+
return /* @__PURE__ */ jsx("div", {
|
|
40
|
+
id: `code-tab-panel-${tab.id}`,
|
|
41
|
+
role: "tabpanel",
|
|
42
|
+
"aria-labelledby": `code-tab-${tab.id}`,
|
|
43
|
+
hidden: !isActive,
|
|
44
|
+
className: cn("overflow-hidden rounded-card border text-foreground", SHELL[theme], isActive ? "block" : "hidden print:block"),
|
|
45
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
46
|
+
className: "overflow-x-auto px-[18px] py-4",
|
|
47
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: PRE_CLASS,
|
|
49
|
+
dangerouslySetInnerHTML: { __html: tab.html }
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}, tab.id);
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { CodeBlockTabs };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=CodeBlockTabs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockTabs.mjs","names":[],"sources":["../../../../src/ui/components/CodeBlockTabs/CodeBlockTabs.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\n\nimport { cn } from '../../utils/cn.js'\n\nexport type CodeBlockTabsTheme = 'light' | 'dark'\n\nexport type CodeBlockTab = {\n id: string\n label: string\n /** Pre-highlighted HTML (e.g. from shiki). */\n html: string\n}\n\nexport type CodeBlockTabsProps = {\n tabs: CodeBlockTab[]\n className?: string\n theme?: CodeBlockTabsTheme\n /** Apps own i18n — aria-label for the tablist. */\n tabsAriaLabel: string\n}\n\nconst PRE_CLASS =\n '[&>pre]:m-0 [&>pre]:font-mono [&>pre]:text-[13px] [&>pre]:leading-[22px] [&>pre]:wrap-break-word [&>pre]:whitespace-pre-wrap'\n\nconst SHELL: Record<CodeBlockTabsTheme, string> = {\n light: 'border-border bg-foreground/5',\n dark: 'border-border bg-surface-elevated',\n}\n\nconst TAB_IDLE: Record<CodeBlockTabsTheme, string> = {\n light: 'border-border text-muted hover:text-foreground',\n dark: 'border-border bg-card text-muted hover:text-foreground',\n}\n\nfunction CodeBlockTabs({ tabs, className, theme = 'light', tabsAriaLabel }: CodeBlockTabsProps) {\n const [active, setActive] = useState(0)\n\n if (tabs.length === 0) return null\n\n return (\n <div\n className={cn(\n 'flex flex-col gap-4 overflow-hidden rounded-card border p-5',\n SHELL[theme],\n className\n )}\n >\n <div role=\"tablist\" aria-label={tabsAriaLabel} className=\"flex flex-wrap gap-2 print:hidden\">\n {tabs.map((tab, idx) => {\n const isActive = idx === active\n return (\n <button\n key={tab.id}\n type=\"button\"\n role=\"tab\"\n id={`code-tab-${tab.id}`}\n aria-selected={isActive}\n aria-controls={`code-tab-panel-${tab.id}`}\n onClick={() => setActive(idx)}\n className={cn(\n 'rounded-full border px-4 py-2 text-btn font-medium transition-colors',\n isActive ? 'border-accent/30 bg-accent/12 text-accent' : TAB_IDLE[theme]\n )}\n >\n {tab.label}\n </button>\n )\n })}\n </div>\n\n {tabs.map((tab, idx) => {\n const isActive = idx === active\n return (\n <div\n key={tab.id}\n id={`code-tab-panel-${tab.id}`}\n role=\"tabpanel\"\n aria-labelledby={`code-tab-${tab.id}`}\n hidden={!isActive}\n className={cn(\n 'overflow-hidden rounded-card border text-foreground',\n SHELL[theme],\n isActive ? 'block' : 'hidden print:block'\n )}\n >\n <div className=\"overflow-x-auto px-[18px] py-4\">\n <div className={PRE_CLASS} dangerouslySetInnerHTML={{ __html: tab.html }} />\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nexport { CodeBlockTabs }\n"],"mappings":";;;;;AAuBA,MAAM,YACJ;AAEF,MAAM,QAA4C;CAChD,OAAO;CACP,MAAM;AACR;AAEA,MAAM,WAA+C;CACnD,OAAO;CACP,MAAM;AACR;AAEA,SAAS,cAAc,EAAE,MAAM,WAAW,QAAQ,SAAS,iBAAqC;CAC9F,MAAM,CAAC,QAAQ,aAAa,SAAS,CAAC;CAEtC,IAAI,KAAK,WAAW,GAAG,OAAO;CAE9B,OACE,qBAAC,OAAD;EACE,WAAW,GACT,+DACA,MAAM,QACN,SACF;EALF,UAAA,CAOE,oBAAC,OAAD;GAAK,MAAK;GAAU,cAAY;GAAe,WAAU;GACtD,UAAA,KAAK,KAAK,KAAK,QAAQ;IACtB,MAAM,WAAW,QAAQ;IACzB,OACE,oBAAC,UAAD;KAEE,MAAK;KACL,MAAK;KACL,IAAI,YAAY,IAAI;KACpB,iBAAe;KACf,iBAAe,kBAAkB,IAAI;KACrC,eAAe,UAAU,GAAG;KAC5B,WAAW,GACT,wEACA,WAAW,8CAA8C,SAAS,MACpE;KAEC,UAAA,IAAI;IACC,GAbD,IAAI,EAaH;GAEZ,CAAC;EACE,CAAA,GAEJ,KAAK,KAAK,KAAK,QAAQ;GACtB,MAAM,WAAW,QAAQ;GACzB,OACE,oBAAC,OAAD;IAEE,IAAI,kBAAkB,IAAI;IAC1B,MAAK;IACL,mBAAiB,YAAY,IAAI;IACjC,QAAQ,CAAC;IACT,WAAW,GACT,uDACA,MAAM,QACN,WAAW,UAAU,oBACvB;IAEA,UAAA,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,OAAD;MAAK,WAAW;MAAW,yBAAyB,EAAE,QAAQ,IAAI,KAAK;KAAI,CAAA;IACxE,CAAA;GACF,GAdE,IAAI,EAcN;EAET,CAAC,CACE;;AAET"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/ui/components/CollapsibleSection/CollapsibleSection.d.ts
|
|
3
|
+
type CollapsibleSectionProps = {
|
|
4
|
+
collapsedHeight: number;
|
|
5
|
+
toggleLabel: string;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
declare function CollapsibleSection({ collapsedHeight, toggleLabel, defaultOpen, className, children }: CollapsibleSectionProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { CollapsibleSection, CollapsibleSectionProps };
|
|
13
|
+
//# sourceMappingURL=CollapsibleSection.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.d.mts","names":[],"sources":["../../../../src/ui/components/CollapsibleSection/CollapsibleSection.tsx"],"mappings":";;KASY;EACV;EACA;EACA;EACA;EACA,UAAU;;iBAwBH,qBACP,iBACA,aACA,aACA,WACA,YACC,0CAAuB,IAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { Button } from "../Button/Button.mjs";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useId, useState } from "react";
|
|
6
|
+
//#region src/ui/components/CollapsibleSection/CollapsibleSection.tsx
|
|
7
|
+
function ChevronDownIcon({ className }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
width: "16",
|
|
12
|
+
height: "16",
|
|
13
|
+
fill: "none",
|
|
14
|
+
className,
|
|
15
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
16
|
+
d: "M3.5 6 8 10.5 12.5 6",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeWidth: "1.5",
|
|
19
|
+
strokeLinecap: "round",
|
|
20
|
+
strokeLinejoin: "round"
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function CollapsibleSection({ collapsedHeight, toggleLabel, defaultOpen = false, className, children }) {
|
|
25
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
26
|
+
const bodyId = useId();
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: cn("flex flex-col gap-4", className),
|
|
29
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
30
|
+
className: "relative",
|
|
31
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
32
|
+
id: bodyId,
|
|
33
|
+
className: "overflow-hidden",
|
|
34
|
+
style: !open ? { maxHeight: collapsedHeight } : void 0,
|
|
35
|
+
children
|
|
36
|
+
}), !open ? /* @__PURE__ */ jsx("div", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 h-40 bg-linear-to-b from-surface/0 to-surface"
|
|
39
|
+
}) : null]
|
|
40
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
41
|
+
variant: "ghost",
|
|
42
|
+
size: "sm",
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: () => setOpen((value) => !value),
|
|
45
|
+
"aria-expanded": open,
|
|
46
|
+
"aria-controls": bodyId,
|
|
47
|
+
className: "gap-1.5 self-center",
|
|
48
|
+
children: [/* @__PURE__ */ jsx(ChevronDownIcon, { className: open ? "rotate-180" : void 0 }), toggleLabel]
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { CollapsibleSection };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=CollapsibleSection.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapsibleSection.mjs","names":[],"sources":["../../../../src/ui/components/CollapsibleSection/CollapsibleSection.tsx"],"sourcesContent":["'use client'\n\nimport { useId, useState } from 'react'\n\nimport { Button } from '../Button/Button.js'\nimport { cn } from '../../utils/cn.js'\n\nimport type { ReactNode } from 'react'\n\nexport type CollapsibleSectionProps = {\n collapsedHeight: number\n toggleLabel: string\n defaultOpen?: boolean\n className?: string\n children: ReactNode\n}\n\nfunction ChevronDownIcon({ className }: { className?: string }) {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n className={className}\n >\n <path\n d=\"M3.5 6 8 10.5 12.5 6\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nfunction CollapsibleSection({\n collapsedHeight,\n toggleLabel,\n defaultOpen = false,\n className,\n children,\n}: CollapsibleSectionProps) {\n const [open, setOpen] = useState(defaultOpen)\n const bodyId = useId()\n\n return (\n <div className={cn('flex flex-col gap-4', className)}>\n <div className=\"relative\">\n <div\n id={bodyId}\n className=\"overflow-hidden\"\n style={!open ? { maxHeight: collapsedHeight } : undefined}\n >\n {children}\n </div>\n\n {!open ? (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0 bottom-0 h-40 bg-linear-to-b from-surface/0 to-surface\"\n />\n ) : null}\n </div>\n\n <Button\n variant=\"ghost\"\n size=\"sm\"\n type=\"button\"\n onClick={() => setOpen((value) => !value)}\n aria-expanded={open}\n aria-controls={bodyId}\n className=\"gap-1.5 self-center\"\n >\n <ChevronDownIcon className={open ? 'rotate-180' : undefined} />\n {toggleLabel}\n </Button>\n </div>\n )\n}\n\nexport { CollapsibleSection }\n"],"mappings":";;;;;;AAiBA,SAAS,gBAAgB,EAAE,aAAqC;CAC9D,OACE,oBAAC,OAAD;EACE,eAAY;EACZ,SAAQ;EACR,OAAM;EACN,QAAO;EACP,MAAK;EACM;EAEX,UAAA,oBAAC,QAAD;GACE,GAAE;GACF,QAAO;GACP,aAAY;GACZ,eAAc;GACd,gBAAe;EAChB,CAAA;CACE,CAAA;AAET;AAEA,SAAS,mBAAmB,EAC1B,iBACA,aACA,cAAc,OACd,WACA,YAC0B;CAC1B,MAAM,CAAC,MAAM,WAAW,SAAS,WAAW;CAC5C,MAAM,SAAS,MAAM;CAErB,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,uBAAuB,SAAS;EAAnD,UAAA,CACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,OAAD;IACE,IAAI;IACJ,WAAU;IACV,OAAO,CAAC,OAAO,EAAE,WAAW,gBAAgB,IAAI;IAE/C;GACE,CAAA,GAEJ,CAAC,OACA,oBAAC,OAAD;IACE,eAAY;IACZ,WAAU;GACX,CAAA,IACC,IACD;EAEL,CAAA,GAAA,qBAAC,QAAD;GACE,SAAQ;GACR,MAAK;GACL,MAAK;GACL,eAAe,SAAS,UAAU,CAAC,KAAK;GACxC,iBAAe;GACf,iBAAe;GACf,WAAU;GAPZ,UAAA,CASE,oBAAC,iBAAD,EAAiB,WAAW,OAAO,eAAe,OAAY,CAAA,GAC7D,WACK;EACL,CAAA,CAAA;;AAET"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IconButtonProps } from "../IconButton/IconButton.mjs";
|
|
2
|
+
//#region src/ui/components/CopyButton/CopyButton.d.ts
|
|
3
|
+
type CopyButtonProps = Omit<IconButtonProps, 'children' | 'onClick' | 'value'> & {
|
|
4
|
+
text: string;
|
|
5
|
+
copiedAriaLabel?: string;
|
|
6
|
+
iconSize?: number;
|
|
7
|
+
onCopied?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare function CopyButton({ text, copiedAriaLabel, iconSize, className, 'aria-label': ariaLabel, onCopied, ...props }: CopyButtonProps): import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { CopyButton, CopyButtonProps };
|
|
12
|
+
//# sourceMappingURL=CopyButton.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.d.mts","names":[],"sources":["../../../../src/ui/components/CopyButton/CopyButton.tsx"],"mappings":";;KAUY,kBAAkB,KAAK;EACjC;EACA;EACA;EACA;;iBAGO,aACP,MACA,iBACA,UACA,yBACc,WACd,aACG,SACF,kCAAe,IAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { IconButton } from "../IconButton/IconButton.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { MdCheck, MdContentCopy } from "react-icons/md";
|
|
7
|
+
//#region src/ui/components/CopyButton/CopyButton.tsx
|
|
8
|
+
const COPIED_DISPLAY_MS = 1500;
|
|
9
|
+
function CopyButton({ text, copiedAriaLabel, iconSize = 14, className, "aria-label": ariaLabel, onCopied, ...props }) {
|
|
10
|
+
const [copied, setCopied] = useState(false);
|
|
11
|
+
const timerRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
return () => {
|
|
14
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
function handleCopy() {
|
|
18
|
+
if (typeof navigator === "undefined" || !navigator.clipboard) return;
|
|
19
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
20
|
+
setCopied(true);
|
|
21
|
+
onCopied?.();
|
|
22
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
23
|
+
timerRef.current = setTimeout(() => setCopied(false), COPIED_DISPLAY_MS);
|
|
24
|
+
}).catch(() => {});
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
27
|
+
type: "button",
|
|
28
|
+
...props,
|
|
29
|
+
onClick: handleCopy,
|
|
30
|
+
"aria-label": copied && copiedAriaLabel ? copiedAriaLabel : ariaLabel,
|
|
31
|
+
className: cn("size-7", className),
|
|
32
|
+
children: copied ? /* @__PURE__ */ jsx(MdCheck, {
|
|
33
|
+
size: iconSize,
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
className: "text-success"
|
|
36
|
+
}) : /* @__PURE__ */ jsx(MdContentCopy, {
|
|
37
|
+
size: iconSize,
|
|
38
|
+
"aria-hidden": "true"
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { CopyButton };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=CopyButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.mjs","names":[],"sources":["../../../../src/ui/components/CopyButton/CopyButton.tsx"],"sourcesContent":["'use client'\n\nimport { useEffect, useRef, useState } from 'react'\nimport { MdCheck, MdContentCopy } from 'react-icons/md'\n\nimport { IconButton, type IconButtonProps } from '../IconButton/IconButton.js'\nimport { cn } from '../../utils/cn.js'\n\nconst COPIED_DISPLAY_MS = 1500\n\nexport type CopyButtonProps = Omit<IconButtonProps, 'children' | 'onClick' | 'value'> & {\n text: string\n copiedAriaLabel?: string\n iconSize?: number\n onCopied?: () => void\n}\n\nfunction CopyButton({\n text,\n copiedAriaLabel,\n iconSize = 14,\n className,\n 'aria-label': ariaLabel,\n onCopied,\n ...props\n}: CopyButtonProps) {\n const [copied, setCopied] = useState(false)\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current)\n }\n }, [])\n\n function handleCopy() {\n if (typeof navigator === 'undefined' || !navigator.clipboard) return\n navigator.clipboard\n .writeText(text)\n .then(() => {\n setCopied(true)\n onCopied?.()\n if (timerRef.current) clearTimeout(timerRef.current)\n timerRef.current = setTimeout(() => setCopied(false), COPIED_DISPLAY_MS)\n })\n .catch(() => {\n // Silent — caller's value remains visible for manual copy.\n })\n }\n\n return (\n <IconButton\n type=\"button\"\n {...props}\n onClick={handleCopy}\n aria-label={copied && copiedAriaLabel ? copiedAriaLabel : ariaLabel}\n className={cn('size-7', className)}\n >\n {copied ? (\n <MdCheck size={iconSize} aria-hidden=\"true\" className=\"text-success\" />\n ) : (\n <MdContentCopy size={iconSize} aria-hidden=\"true\" />\n )}\n </IconButton>\n )\n}\n\nexport { CopyButton }\n"],"mappings":";;;;;;;AAQA,MAAM,oBAAoB;AAS1B,SAAS,WAAW,EAClB,MACA,iBACA,WAAW,IACX,WACA,cAAc,WACd,UACA,GAAG,SACe;CAClB,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,WAAW,OAA6C,IAAI;CAElE,gBAAgB;EACd,aAAa;GACX,IAAI,SAAS,SAAS,aAAa,SAAS,OAAO;EACrD;CACF,GAAG,CAAC,CAAC;CAEL,SAAS,aAAa;EACpB,IAAI,OAAO,cAAc,eAAe,CAAC,UAAU,WAAW;EAC9D,UAAU,UACP,UAAU,IAAI,CAAC,CACf,WAAW;GACV,UAAU,IAAI;GACd,WAAW;GACX,IAAI,SAAS,SAAS,aAAa,SAAS,OAAO;GACnD,SAAS,UAAU,iBAAiB,UAAU,KAAK,GAAG,iBAAiB;EACzE,CAAC,CAAC,CACD,YAAY,CAEb,CAAC;CACL;CAEA,OACE,oBAAC,YAAD;EACE,MAAK;EACL,GAAI;EACJ,SAAS;EACT,cAAY,UAAU,kBAAkB,kBAAkB;EAC1D,WAAW,GAAG,UAAU,SAAS;EAEhC,UAAA,SACC,oBAAC,SAAD;GAAS,MAAM;GAAU,eAAY;GAAO,WAAU;EAAgB,CAAA,IAEtE,oBAAC,eAAD;GAAe,MAAM;GAAU,eAAY;EAAQ,CAAA;CAE3C,CAAA;AAEhB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentProps, HTMLAttributes } from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
//#region src/ui/components/Dialog/Dialog.d.ts
|
|
4
|
+
declare const Dialog: import("react").FC<DialogPrimitive.DialogProps>;
|
|
5
|
+
declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DialogPortal: import("react").FC<DialogPrimitive.DialogPortalProps>;
|
|
7
|
+
declare const DialogClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const dialogFullscreenOnMobile: string;
|
|
9
|
+
type DialogOverlayProps = ComponentProps<typeof DialogPrimitive.Overlay>;
|
|
10
|
+
declare function DialogOverlay({ className, ...props }: DialogOverlayProps): import("react").JSX.Element;
|
|
11
|
+
type DialogContentProps = ComponentProps<typeof DialogPrimitive.Content> & {
|
|
12
|
+
closeLabel?: string;
|
|
13
|
+
showClose?: boolean;
|
|
14
|
+
closeClassName?: string;
|
|
15
|
+
};
|
|
16
|
+
declare function DialogContent({ className, children, closeLabel, showClose, closeClassName, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
17
|
+
declare function DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
18
|
+
declare function DialogBody({ className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
19
|
+
declare function DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
20
|
+
type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title>;
|
|
21
|
+
declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
|
|
22
|
+
type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
|
|
23
|
+
declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react").JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, DialogOverlayProps, DialogPortal, DialogTitle, DialogTitleProps, DialogTrigger, dialogFullscreenOnMobile };
|
|
26
|
+
//# sourceMappingURL=Dialog.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.d.mts","names":[],"sources":["../../../../src/ui/components/Dialog/Dialog.tsx"],"mappings":";;;cAQM,wBAAM,GAAA,gBAAA;cACN,+BAAa,0BAAA,gBAAA,qCAAA,cAAA;cACb,8BAAY,GAAA,gBAAA;cACZ,6BAAW,0BAAA,gBAAA,mCAAA,cAAA;cAEX;KAOM,qBAAqB,sBAAsB,gBAAgB;iBAE9D,gBAAgB,cAAc,SAAS,qCAAkB,IAAA;KAqBtD,qBAAqB,sBAAsB,gBAAgB;EACrE;EACA;EACA;;iBAGO,gBACP,WACA,UACA,YACA,WACA,mBACG,SACF,qCAAkB,IAAA;iBAqCZ,eAAe,cAAc,SAAS,eAAe,kCAAe,IAAA;iBAUpE,aAAa,cAAc,SAAS,wCAAqB,IAAA;iBAUzD,eAAe,cAAc,SAAS,eAAe,kCAAe,IAAA;KAajE,mBAAmB,sBAAsB,gBAAgB;iBAE5D,cAAc,cAAc,SAAS,mCAAgB,IAAA;KASlD,yBAAyB,sBAAsB,gBAAgB;iBAElE,oBAAoB,cAAc,SAAS,yCAAsB,IAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
5
|
+
//#region src/ui/components/Dialog/Dialog.tsx
|
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
|
7
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
9
|
+
const DialogClose = DialogPrimitive.Close;
|
|
10
|
+
const dialogFullscreenOnMobile = cn("max-md:top-0 max-md:right-0 max-md:bottom-0 max-md:left-0", "max-md:h-dvh max-md:max-h-none max-md:w-full max-md:max-w-none", "max-md:translate-x-0 max-md:translate-y-0", "max-md:rounded-none max-md:border-0");
|
|
11
|
+
function DialogOverlay({ className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
|
|
13
|
+
className: cn("fixed inset-0 z-50 bg-background/75 backdrop-blur-sm transition-opacity duration-150", "data-[state=closed]:opacity-0 data-[state=open]:opacity-100", className),
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function CloseIcon() {
|
|
18
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
19
|
+
"aria-hidden": "true",
|
|
20
|
+
viewBox: "0 0 14 14",
|
|
21
|
+
width: "14",
|
|
22
|
+
height: "14",
|
|
23
|
+
fill: "none",
|
|
24
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
25
|
+
d: "M3 3l8 8M11 3l-8 8",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeWidth: "1.5",
|
|
28
|
+
strokeLinecap: "round"
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function DialogContent({ className, children, closeLabel = "Close", showClose = true, closeClassName, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(DialogPrimitive.Content, {
|
|
34
|
+
className: cn("fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2", "flex max-h-[calc(100vh-2rem)] w-[calc(100vw-2rem)] max-w-md flex-col overflow-hidden", "rounded-card border border-border bg-surface text-foreground shadow-xl", "transition-opacity duration-150 data-[state=closed]:opacity-0 data-[state=open]:opacity-100", "focus:outline-none", className),
|
|
35
|
+
...props,
|
|
36
|
+
children: [children, showClose ? /* @__PURE__ */ jsx(DialogPrimitive.Close, {
|
|
37
|
+
"aria-label": closeLabel,
|
|
38
|
+
className: cn("absolute top-6 right-5 inline-flex size-7 cursor-pointer items-center justify-center rounded-control", "border border-border text-secondary transition-colors", "hover:bg-card hover:text-foreground", "focus-visible:ring-1 focus-visible:ring-accent focus-visible:outline-none", "disabled:pointer-events-none disabled:cursor-not-allowed", closeClassName),
|
|
39
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
40
|
+
}) : null]
|
|
41
|
+
})] });
|
|
42
|
+
}
|
|
43
|
+
function DialogHeader({ className, ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsx("div", {
|
|
45
|
+
"data-slot": "dialog-header",
|
|
46
|
+
className: cn("flex flex-col gap-1.5 px-5 pt-6 pr-14", className),
|
|
47
|
+
...props
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function DialogBody({ className, ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsx("div", {
|
|
52
|
+
"data-slot": "dialog-body",
|
|
53
|
+
className: cn("flex flex-col gap-3.5 overflow-y-auto px-5 py-5", className),
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function DialogFooter({ className, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsx("div", {
|
|
59
|
+
"data-slot": "dialog-footer",
|
|
60
|
+
className: cn("flex flex-col-reverse gap-2 border-t border-border px-5 py-4 sm:flex-row sm:justify-between", className),
|
|
61
|
+
...props
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function DialogTitle({ className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Title, {
|
|
66
|
+
className: cn("text-lg font-semibold text-foreground", className),
|
|
67
|
+
...props
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function DialogDescription({ className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(DialogPrimitive.Description, {
|
|
72
|
+
className: cn("text-sm font-normal text-secondary", className),
|
|
73
|
+
...props
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogFullscreenOnMobile };
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=Dialog.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.mjs","names":[],"sources":["../../../../src/ui/components/Dialog/Dialog.tsx"],"sourcesContent":["'use client'\n\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\n\nimport { cn } from '../../utils/cn.js'\n\nimport type { ComponentProps, HTMLAttributes } from 'react'\n\nconst Dialog = DialogPrimitive.Root\nconst DialogTrigger = DialogPrimitive.Trigger\nconst DialogPortal = DialogPrimitive.Portal\nconst DialogClose = DialogPrimitive.Close\n\nconst dialogFullscreenOnMobile = cn(\n 'max-md:top-0 max-md:right-0 max-md:bottom-0 max-md:left-0',\n 'max-md:h-dvh max-md:max-h-none max-md:w-full max-md:max-w-none',\n 'max-md:translate-x-0 max-md:translate-y-0',\n 'max-md:rounded-none max-md:border-0'\n)\n\nexport type DialogOverlayProps = ComponentProps<typeof DialogPrimitive.Overlay>\n\nfunction DialogOverlay({ className, ...props }: DialogOverlayProps) {\n return (\n <DialogPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-50 bg-background/75 backdrop-blur-sm transition-opacity duration-150',\n 'data-[state=closed]:opacity-0 data-[state=open]:opacity-100',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CloseIcon() {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 14 14\" width=\"14\" height=\"14\" fill=\"none\">\n <path d=\"M3 3l8 8M11 3l-8 8\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\nexport type DialogContentProps = ComponentProps<typeof DialogPrimitive.Content> & {\n closeLabel?: string\n showClose?: boolean\n closeClassName?: string\n}\n\nfunction DialogContent({\n className,\n children,\n closeLabel = 'Close',\n showClose = true,\n closeClassName,\n ...props\n}: DialogContentProps) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n className={cn(\n 'fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2',\n 'flex max-h-[calc(100vh-2rem)] w-[calc(100vw-2rem)] max-w-md flex-col overflow-hidden',\n 'rounded-card border border-border bg-surface text-foreground shadow-xl',\n 'transition-opacity duration-150 data-[state=closed]:opacity-0 data-[state=open]:opacity-100',\n 'focus:outline-none',\n className\n )}\n {...props}\n >\n {children}\n\n {showClose ? (\n <DialogPrimitive.Close\n aria-label={closeLabel}\n className={cn(\n 'absolute top-6 right-5 inline-flex size-7 cursor-pointer items-center justify-center rounded-control',\n 'border border-border text-secondary transition-colors',\n 'hover:bg-card hover:text-foreground',\n 'focus-visible:ring-1 focus-visible:ring-accent focus-visible:outline-none',\n 'disabled:pointer-events-none disabled:cursor-not-allowed',\n closeClassName\n )}\n >\n <CloseIcon />\n </DialogPrimitive.Close>\n ) : null}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn('flex flex-col gap-1.5 px-5 pt-6 pr-14', className)}\n {...props}\n />\n )\n}\n\nfunction DialogBody({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"dialog-body\"\n className={cn('flex flex-col gap-3.5 overflow-y-auto px-5 py-5', className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 border-t border-border px-5 py-4 sm:flex-row sm:justify-between',\n className\n )}\n {...props}\n />\n )\n}\n\nexport type DialogTitleProps = ComponentProps<typeof DialogPrimitive.Title>\n\nfunction DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <DialogPrimitive.Title\n className={cn('text-lg font-semibold text-foreground', className)}\n {...props}\n />\n )\n}\n\nexport type DialogDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>\n\nfunction DialogDescription({ className, ...props }: DialogDescriptionProps) {\n return (\n <DialogPrimitive.Description\n className={cn('text-sm font-normal text-secondary', className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogTrigger,\n DialogPortal,\n DialogOverlay,\n DialogContent,\n DialogHeader,\n DialogBody,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n DialogClose,\n dialogFullscreenOnMobile,\n}\n"],"mappings":";;;;;AAQA,MAAM,SAAS,gBAAgB;AAC/B,MAAM,gBAAgB,gBAAgB;AACtC,MAAM,eAAe,gBAAgB;AACrC,MAAM,cAAc,gBAAgB;AAEpC,MAAM,2BAA2B,GAC/B,6DACA,kEACA,6CACA,qCACF;AAIA,SAAS,cAAc,EAAE,WAAW,GAAG,SAA6B;CAClE,OACE,oBAAC,gBAAgB,SAAjB;EACE,WAAW,GACT,wFACA,+DACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY;CACnB,OACE,oBAAC,OAAD;EAAK,eAAY;EAAO,SAAQ;EAAY,OAAM;EAAK,QAAO;EAAK,MAAK;EACtE,UAAA,oBAAC,QAAD;GAAM,GAAE;GAAqB,QAAO;GAAe,aAAY;GAAM,eAAc;EAAS,CAAA;CACzF,CAAA;AAET;AAQA,SAAS,cAAc,EACrB,WACA,UACA,aAAa,SACb,YAAY,MACZ,gBACA,GAAG,SACkB;CACrB,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAAC,gBAAgB,SAAjB;EACE,WAAW,GACT,iEACA,wFACA,0EACA,+FACA,sBACA,SACF;EACA,GAAI;EATN,UAAA,CAWG,UAEA,YACC,oBAAC,gBAAgB,OAAjB;GACE,cAAY;GACZ,WAAW,GACT,wGACA,yDACA,uCACA,6EACA,4DACA,cACF;GAEA,UAAA,oBAAC,WAAD,CAAY,CAAA;EACS,CAAA,IACrB,IACmB;CACb,CAAA,CAAA,EAAA,CAAA;AAElB;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAyC;CAC7E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAgC;CAClE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mDAAmD,SAAS;EAC1E,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAyC;CAC7E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,+FACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAIA,SAAS,YAAY,EAAE,WAAW,GAAG,SAA2B;CAC9D,OACE,oBAAC,gBAAgB,OAAjB;EACE,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAIA,SAAS,kBAAkB,EAAE,WAAW,GAAG,SAAiC;CAC1E,OACE,oBAAC,gBAAgB,aAAjB;EACE,WAAW,GAAG,sCAAsC,SAAS;EAC7D,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Dialog, DialogBody, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, DialogOverlayProps, DialogPortal, DialogTitle, DialogTitleProps, DialogTrigger, dialogFullscreenOnMobile } from "./Dialog.mjs";
|
|
2
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, type DialogOverlayProps, DialogPortal, DialogTitle, type DialogTitleProps, DialogTrigger, dialogFullscreenOnMobile };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogFullscreenOnMobile } from "./Dialog.mjs";
|
|
2
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, dialogFullscreenOnMobile };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
//#region src/ui/components/EmptyState/EmptyState.d.ts
|
|
4
|
+
declare const emptyStateVariants: (props?: ({
|
|
5
|
+
tone?: "dark" | "light" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> & VariantProps<typeof emptyStateVariants> & {
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
actions?: ReactNode;
|
|
12
|
+
titleClassName?: string;
|
|
13
|
+
descriptionClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
declare function EmptyState({ icon, title, description, actions, tone, className, titleClassName, descriptionClassName, ...props }: EmptyStateProps): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { EmptyState, EmptyStateProps, emptyStateVariants };
|
|
18
|
+
//# sourceMappingURL=EmptyState.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.d.mts","names":[],"sources":["../../../../src/ui/components/EmptyState/EmptyState.tsx"],"mappings":";;;cAMM,qBAAkB;;6CAavB;KAEW,kBAAkB,KAAK,eAAe,4BAChD,oBAAoB;EAClB,OAAO;EACP,OAAO;EACP,cAAc;EACd,UAAU;EACV;EACA;;iBAGK,aACP,MACA,OACA,aACA,SACA,MACA,WACA,gBACA,yBACG,SACF,kCAAe,IAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.mjs";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/ui/components/EmptyState/EmptyState.tsx
|
|
5
|
+
const emptyStateVariants = cva("flex w-full flex-col items-center justify-center gap-6 rounded-card px-10 py-20 text-center", {
|
|
6
|
+
variants: { tone: {
|
|
7
|
+
dark: "bg-card/40",
|
|
8
|
+
light: "bg-foreground/5"
|
|
9
|
+
} },
|
|
10
|
+
defaultVariants: { tone: "dark" }
|
|
11
|
+
});
|
|
12
|
+
function EmptyState({ icon, title, description, actions, tone, className, titleClassName, descriptionClassName, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
className: cn(emptyStateVariants({ tone }), className),
|
|
15
|
+
...props,
|
|
16
|
+
children: [
|
|
17
|
+
icon,
|
|
18
|
+
/* @__PURE__ */ jsx("h2", {
|
|
19
|
+
className: cn("text-2xl font-semibold text-foreground", titleClassName),
|
|
20
|
+
children: title
|
|
21
|
+
}),
|
|
22
|
+
description ? /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: cn("max-w-[560px] text-base text-secondary", descriptionClassName),
|
|
24
|
+
children: description
|
|
25
|
+
}) : null,
|
|
26
|
+
actions ? /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "flex flex-wrap items-center justify-center gap-3 pt-4",
|
|
28
|
+
children: actions
|
|
29
|
+
}) : null
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { EmptyState, emptyStateVariants };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=EmptyState.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmptyState.mjs","names":[],"sources":["../../../../src/ui/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority'\n\nimport { cn } from '../../utils/cn.js'\n\nimport type { HTMLAttributes, ReactNode } from 'react'\n\nconst emptyStateVariants = cva(\n 'flex w-full flex-col items-center justify-center gap-6 rounded-card px-10 py-20 text-center',\n {\n variants: {\n tone: {\n dark: 'bg-card/40',\n light: 'bg-foreground/5',\n },\n },\n defaultVariants: {\n tone: 'dark',\n },\n }\n)\n\nexport type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, 'title'> &\n VariantProps<typeof emptyStateVariants> & {\n icon?: ReactNode\n title: ReactNode\n description?: ReactNode\n actions?: ReactNode\n titleClassName?: string\n descriptionClassName?: string\n }\n\nfunction EmptyState({\n icon,\n title,\n description,\n actions,\n tone,\n className,\n titleClassName,\n descriptionClassName,\n ...props\n}: EmptyStateProps) {\n return (\n <div className={cn(emptyStateVariants({ tone }), className)} {...props}>\n {icon}\n\n <h2 className={cn('text-2xl font-semibold text-foreground', titleClassName)}>{title}</h2>\n\n {description ? (\n <div className={cn('max-w-[560px] text-base text-secondary', descriptionClassName)}>\n {description}\n </div>\n ) : null}\n\n {actions ? (\n <div className=\"flex flex-wrap items-center justify-center gap-3 pt-4\">{actions}</div>\n ) : null}\n </div>\n )\n}\n\nexport { EmptyState, emptyStateVariants }\n"],"mappings":";;;;AAMA,MAAM,qBAAqB,IACzB,+FACA;CACE,UAAU,EACR,MAAM;EACJ,MAAM;EACN,OAAO;CACT,EACF;CACA,iBAAiB,EACf,MAAM,OACR;AACF,CACF;AAYA,SAAS,WAAW,EAClB,MACA,OACA,aACA,SACA,MACA,WACA,gBACA,sBACA,GAAG,SACe;CAClB,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,mBAAmB,EAAE,KAAK,CAAC,GAAG,SAAS;EAAG,GAAI;EAAjE,UAAA;GACG;GAED,oBAAC,MAAD;IAAI,WAAW,GAAG,0CAA0C,cAAc;IAAI,UAAA;GAAU,CAAA;GAEvF,cACC,oBAAC,OAAD;IAAK,WAAW,GAAG,0CAA0C,oBAAoB;IAC9E,UAAA;GACE,CAAA,IACH;GAEH,UACC,oBAAC,OAAD;IAAK,WAAU;IAAyD,UAAA;GAAa,CAAA,IACnF;EACD;;AAET"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/ui/components/FieldError/FieldError.d.ts
|
|
3
|
+
type FieldErrorProps = {
|
|
4
|
+
id?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Presentational field error. Apps wire react-hook-form (or other) and pass the message.
|
|
10
|
+
*/
|
|
11
|
+
declare function FieldError({ id, children, className }: FieldErrorProps): import("react").JSX.Element | null;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { FieldError, FieldErrorProps };
|
|
14
|
+
//# sourceMappingURL=FieldError.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldError.d.mts","names":[],"sources":["../../../../src/ui/components/FieldError/FieldError.tsx"],"mappings":";;KAIY;EACV;EACA,WAAW;EACX;;;;;iBAMO,aAAa,IAAI,UAAU,aAAa,kCAAe,IAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/ui/components/FieldError/FieldError.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Presentational field error. Apps wire react-hook-form (or other) and pass the message.
|
|
6
|
+
*/
|
|
7
|
+
function FieldError({ id, children, className }) {
|
|
8
|
+
if (!children) return null;
|
|
9
|
+
return /* @__PURE__ */ jsx("p", {
|
|
10
|
+
id,
|
|
11
|
+
"data-slot": "field-error",
|
|
12
|
+
className: cn("text-xs text-destructive", className),
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { FieldError };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=FieldError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldError.mjs","names":[],"sources":["../../../../src/ui/components/FieldError/FieldError.tsx"],"sourcesContent":["import { cn } from '../../utils/cn.js'\n\nimport type { ReactNode } from 'react'\n\nexport type FieldErrorProps = {\n id?: string\n children?: ReactNode\n className?: string\n}\n\n/**\n * Presentational field error. Apps wire react-hook-form (or other) and pass the message.\n */\nfunction FieldError({ id, children, className }: FieldErrorProps) {\n if (!children) return null\n\n return (\n <p id={id} data-slot=\"field-error\" className={cn('text-xs text-destructive', className)}>\n {children}\n </p>\n )\n}\n\nexport { FieldError }\n"],"mappings":";;;;;;AAaA,SAAS,WAAW,EAAE,IAAI,UAAU,aAA8B;CAChE,IAAI,CAAC,UAAU,OAAO;CAEtB,OACE,oBAAC,KAAD;EAAO;EAAI,aAAU;EAAc,WAAW,GAAG,4BAA4B,SAAS;EACnF;CACA,CAAA;AAEP"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/ui/components/FormattedDate/FormattedDate.d.ts
|
|
2
|
+
type FormatDateOptions = {
|
|
3
|
+
month?: 'short' | 'long';
|
|
4
|
+
};
|
|
5
|
+
type FormattedDateProps = {
|
|
6
|
+
iso: string | null | undefined;
|
|
7
|
+
locale: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
month?: FormatDateOptions['month'];
|
|
10
|
+
};
|
|
11
|
+
declare function formatDate(iso: string | null | undefined, locale: string, options?: FormatDateOptions): string;
|
|
12
|
+
declare function FormattedDate({ iso, locale, className, month }: FormattedDateProps): import("react").JSX.Element | null;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { FormatDateOptions, FormattedDate, FormattedDateProps, formatDate };
|
|
15
|
+
//# sourceMappingURL=FormattedDate.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormattedDate.d.mts","names":[],"sources":["../../../../src/ui/components/FormattedDate/FormattedDate.tsx"],"mappings":";KAEY;EACV;;KAGU;EACV;EACA;EACA;EACA,QAAQ;;iBAGD,WACP,gCACA,gBACA,UAAU;iBAUH,gBAAgB,KAAK,QAAQ,WAAW,SAAS,qCAAkB,IAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/ui/components/FormattedDate/FormattedDate.tsx
|
|
4
|
+
function formatDate(iso, locale, options) {
|
|
5
|
+
if (!iso) return "";
|
|
6
|
+
return new Date(iso).toLocaleDateString(locale, {
|
|
7
|
+
year: "numeric",
|
|
8
|
+
month: options?.month ?? "long",
|
|
9
|
+
day: "numeric"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function FormattedDate({ iso, locale, className, month }) {
|
|
13
|
+
if (!iso) return null;
|
|
14
|
+
return /* @__PURE__ */ jsx("time", {
|
|
15
|
+
dateTime: iso,
|
|
16
|
+
className: cn(className),
|
|
17
|
+
children: formatDate(iso, locale, { month })
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { FormattedDate, formatDate };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=FormattedDate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormattedDate.mjs","names":[],"sources":["../../../../src/ui/components/FormattedDate/FormattedDate.tsx"],"sourcesContent":["import { cn } from '../../utils/cn.js'\n\nexport type FormatDateOptions = {\n month?: 'short' | 'long'\n}\n\nexport type FormattedDateProps = {\n iso: string | null | undefined\n locale: string\n className?: string\n month?: FormatDateOptions['month']\n}\n\nfunction formatDate(\n iso: string | null | undefined,\n locale: string,\n options?: FormatDateOptions\n): string {\n if (!iso) return ''\n return new Date(iso).toLocaleDateString(locale, {\n year: 'numeric',\n month: options?.month ?? 'long',\n day: 'numeric',\n })\n}\n\nfunction FormattedDate({ iso, locale, className, month }: FormattedDateProps) {\n if (!iso) return null\n\n return (\n <time dateTime={iso} className={cn(className)}>\n {formatDate(iso, locale, { month })}\n </time>\n )\n}\n\nexport { FormattedDate, formatDate }\n"],"mappings":";;;AAaA,SAAS,WACP,KACA,QACA,SACQ;CACR,IAAI,CAAC,KAAK,OAAO;CACjB,OAAO,IAAI,KAAK,GAAG,CAAC,CAAC,mBAAmB,QAAQ;EAC9C,MAAM;EACN,OAAO,SAAS,SAAS;EACzB,KAAK;CACP,CAAC;AACH;AAEA,SAAS,cAAc,EAAE,KAAK,QAAQ,WAAW,SAA6B;CAC5E,IAAI,CAAC,KAAK,OAAO;CAEjB,OACE,oBAAC,QAAD;EAAM,UAAU;EAAK,WAAW,GAAG,SAAS;EACzC,UAAA,WAAW,KAAK,QAAQ,EAAE,MAAM,CAAC;CAC9B,CAAA;AAEV"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
+
//#region src/ui/components/IconButton/IconButton.d.ts
|
|
4
|
+
type IconButtonProps = ComponentProps<typeof Primitive.button> & {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare function IconButton({ className, asChild, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { IconButton, IconButtonProps };
|
|
10
|
+
//# sourceMappingURL=IconButton.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.d.mts","names":[],"sources":["../../../../src/ui/components/IconButton/IconButton.tsx"],"mappings":";;;KAUY,kBAAkB,sBAAsB,UAAU;EAC5D;;iBAGO,aAAa,WAAW,YAAoB,SAAS,kCAAe,IAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { focusRingClassName } from "../../a11y/focus.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
7
|
+
//#region src/ui/components/IconButton/IconButton.tsx
|
|
8
|
+
function IconButton({ className, asChild = false, ...props }) {
|
|
9
|
+
const Comp = asChild ? Slot : Primitive.button;
|
|
10
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
11
|
+
"data-slot": "icon-button",
|
|
12
|
+
className: cn("inline-flex h-10 w-10 items-center justify-center rounded-btn text-foreground transition-colors outline-none hover:bg-foreground/5 focus:bg-foreground/5 disabled:pointer-events-none disabled:opacity-50", focusRingClassName, className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { IconButton };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=IconButton.mjs.map
|