@mgamadeus/ddd-admin-ui 0.0.0-stage → 0.1.0-rc.1
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/.claude/skills/ddd-admin-ui-specialist/SKILL.md +29 -0
- package/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +131 -2
- package/dist/cli/ddd-admin-ui.d.ts +3 -0
- package/dist/cli/ddd-admin-ui.d.ts.map +1 -0
- package/dist/cli/ddd-admin-ui.js +18 -0
- package/dist/cli/ddd-admin-ui.js.map +1 -0
- package/dist/cli/linkSkills.d.ts +25 -0
- package/dist/cli/linkSkills.d.ts.map +1 -0
- package/dist/cli/linkSkills.js +76 -0
- package/dist/cli/linkSkills.js.map +1 -0
- package/dist/components.css +42 -0
- package/dist/data/StatTile.d.ts +8 -0
- package/dist/data/StatTile.d.ts.map +1 -0
- package/dist/data/StatTile.js +6 -0
- package/dist/data/StatTile.js.map +1 -0
- package/dist/data/index.d.ts +2 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/index.js.map +1 -0
- package/dist/form/Form.d.ts +13 -0
- package/dist/form/Form.d.ts.map +1 -0
- package/dist/form/Form.js +11 -0
- package/dist/form/Form.js.map +1 -0
- package/dist/form/fieldLabels.d.ts +10 -0
- package/dist/form/fieldLabels.d.ts.map +1 -0
- package/dist/form/fieldLabels.js +8 -0
- package/dist/form/fieldLabels.js.map +1 -0
- package/dist/form/index.d.ts +3 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/index.js +3 -0
- package/dist/form/index.js.map +1 -0
- package/dist/glass/GlassPanel.d.ts +7 -0
- package/dist/glass/GlassPanel.d.ts.map +1 -0
- package/dist/glass/GlassPanel.js +5 -0
- package/dist/glass/GlassPanel.js.map +1 -0
- package/dist/glass/index.d.ts +2 -0
- package/dist/glass/index.d.ts.map +1 -0
- package/dist/glass/index.js +2 -0
- package/dist/glass/index.js.map +1 -0
- package/dist/i18n/Translate.d.ts +7 -0
- package/dist/i18n/Translate.d.ts.map +1 -0
- package/dist/i18n/Translate.js +9 -0
- package/dist/i18n/Translate.js.map +1 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/m.d.ts +7 -0
- package/dist/i18n/m.d.ts.map +1 -0
- package/dist/i18n/m.js +7 -0
- package/dist/i18n/m.js.map +1 -0
- package/dist/i18n/store.d.ts +24 -0
- package/dist/i18n/store.d.ts.map +1 -0
- package/dist/i18n/store.js +30 -0
- package/dist/i18n/store.js.map +1 -0
- package/dist/i18n/useTranslate.d.ts +9 -0
- package/dist/i18n/useTranslate.d.ts.map +1 -0
- package/dist/i18n/useTranslate.js +12 -0
- package/dist/i18n/useTranslate.js.map +1 -0
- package/dist/i18n-keys.json +32 -0
- package/dist/list/ClearFiltersButton.d.ts +7 -0
- package/dist/list/ClearFiltersButton.d.ts.map +1 -0
- package/dist/list/ClearFiltersButton.js +10 -0
- package/dist/list/ClearFiltersButton.js.map +1 -0
- package/dist/list/DateCell.d.ts +8 -0
- package/dist/list/DateCell.d.ts.map +1 -0
- package/dist/list/DateCell.js +12 -0
- package/dist/list/DateCell.js.map +1 -0
- package/dist/list/index.d.ts +3 -0
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/index.js +3 -0
- package/dist/list/index.js.map +1 -0
- package/dist/logic/index.d.ts +6 -0
- package/dist/logic/index.d.ts.map +1 -0
- package/dist/logic/index.js +6 -0
- package/dist/logic/index.js.map +1 -0
- package/dist/logic/pure/errors.d.ts +3 -0
- package/dist/logic/pure/errors.d.ts.map +1 -0
- package/dist/logic/pure/errors.js +5 -0
- package/dist/logic/pure/errors.js.map +1 -0
- package/dist/logic/pure/format.d.ts +15 -0
- package/dist/logic/pure/format.d.ts.map +1 -0
- package/dist/logic/pure/format.js +32 -0
- package/dist/logic/pure/format.js.map +1 -0
- package/dist/logic/pure/notify.d.ts +19 -0
- package/dist/logic/pure/notify.d.ts.map +1 -0
- package/dist/logic/pure/notify.js +33 -0
- package/dist/logic/pure/notify.js.map +1 -0
- package/dist/logic/pure/statusMap.d.ts +12 -0
- package/dist/logic/pure/statusMap.d.ts.map +1 -0
- package/dist/logic/pure/statusMap.js +5 -0
- package/dist/logic/pure/statusMap.js.map +1 -0
- package/dist/logic/react/useToggle.d.ts +8 -0
- package/dist/logic/react/useToggle.d.ts.map +1 -0
- package/dist/logic/react/useToggle.js +9 -0
- package/dist/logic/react/useToggle.js.map +1 -0
- package/dist/media/MediaItemField.d.ts +6 -0
- package/dist/media/MediaItemField.d.ts.map +1 -0
- package/dist/media/MediaItemField.js +11 -0
- package/dist/media/MediaItemField.js.map +1 -0
- package/dist/media/index.d.ts +3 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +2 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/types.d.ts +7 -0
- package/dist/media/types.d.ts.map +1 -0
- package/dist/media/types.js +2 -0
- package/dist/media/types.js.map +1 -0
- package/dist/next/index.d.ts +3 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +3 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/searchParamsWriter.d.ts +7 -0
- package/dist/next/searchParamsWriter.d.ts.map +1 -0
- package/dist/next/searchParamsWriter.js +34 -0
- package/dist/next/searchParamsWriter.js.map +1 -0
- package/dist/next/useNextSearchParam.d.ts +3 -0
- package/dist/next/useNextSearchParam.d.ts.map +1 -0
- package/dist/next/useNextSearchParam.js +16 -0
- package/dist/next/useNextSearchParam.js.map +1 -0
- package/dist/notify-sonner/index.d.ts +2 -0
- package/dist/notify-sonner/index.d.ts.map +1 -0
- package/dist/notify-sonner/index.js +2 -0
- package/dist/notify-sonner/index.js.map +1 -0
- package/dist/notify-sonner/sonnerNotifications.d.ts +4 -0
- package/dist/notify-sonner/sonnerNotifications.d.ts.map +1 -0
- package/dist/notify-sonner/sonnerNotifications.js +12 -0
- package/dist/notify-sonner/sonnerNotifications.js.map +1 -0
- package/dist/page/PageFrame.d.ts +9 -0
- package/dist/page/PageFrame.d.ts.map +1 -0
- package/dist/page/PageFrame.js +5 -0
- package/dist/page/PageFrame.js.map +1 -0
- package/dist/page/index.d.ts +2 -0
- package/dist/page/index.d.ts.map +1 -0
- package/dist/page/index.js +2 -0
- package/dist/page/index.js.map +1 -0
- package/dist/primitives/button.d.ts +10 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +20 -0
- package/dist/primitives/button.js.map +1 -0
- package/dist/primitives/cn.d.ts +4 -0
- package/dist/primitives/cn.d.ts.map +1 -0
- package/dist/primitives/cn.js +5 -0
- package/dist/primitives/cn.js.map +1 -0
- package/dist/primitives/dialog.d.ts +10 -0
- package/dist/primitives/dialog.d.ts.map +1 -0
- package/dist/primitives/dialog.js +19 -0
- package/dist/primitives/dialog.js.map +1 -0
- package/dist/primitives/index.d.ts +7 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +7 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/portalContainer.d.ts +8 -0
- package/dist/primitives/portalContainer.d.ts.map +1 -0
- package/dist/primitives/portalContainer.js +12 -0
- package/dist/primitives/portalContainer.js.map +1 -0
- package/dist/primitives/select.d.ts +9 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +16 -0
- package/dist/primitives/select.js.map +1 -0
- package/dist/primitives/sheet.d.ts +9 -0
- package/dist/primitives/sheet.d.ts.map +1 -0
- package/dist/primitives/sheet.js +15 -0
- package/dist/primitives/sheet.js.map +1 -0
- package/dist/provider/AdminUiProvider.d.ts +7 -0
- package/dist/provider/AdminUiProvider.d.ts.map +1 -0
- package/dist/provider/AdminUiProvider.js +32 -0
- package/dist/provider/AdminUiProvider.js.map +1 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +2 -0
- package/dist/provider/index.js.map +1 -0
- package/dist/provider/types.d.ts +33 -0
- package/dist/provider/types.d.ts.map +1 -0
- package/dist/provider/types.js +2 -0
- package/dist/provider/types.js.map +1 -0
- package/dist/theme.css +44 -0
- package/dist/tokens.json +66 -0
- package/dist/translations/TranslatableInputField.d.ts +8 -0
- package/dist/translations/TranslatableInputField.d.ts.map +1 -0
- package/dist/translations/TranslatableInputField.js +12 -0
- package/dist/translations/TranslatableInputField.js.map +1 -0
- package/dist/translations/index.d.ts +2 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/index.js +2 -0
- package/dist/translations/index.js.map +1 -0
- package/docs/README.md +11 -0
- package/package.json +158 -3
- package/scripts/check-tokens.mjs +136 -0
- package/scripts/lib/i18n-manifest.mjs +91 -0
- package/scripts/lib/source-scan.mjs +258 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
|
3
|
+
import { useCallback, useEffect } from 'react';
|
|
4
|
+
import { setSearchParamsNavigator, writeSearchParams } from "./searchParamsWriter.js";
|
|
5
|
+
/** One search parameter of the current Next route, written through the shared queue. */
|
|
6
|
+
export const useNextSearchParam = (name) => {
|
|
7
|
+
const router = useRouter();
|
|
8
|
+
const pathname = usePathname();
|
|
9
|
+
const searchParams = useSearchParams();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
setSearchParamsNavigator((href) => router.replace(href, { scroll: false }));
|
|
12
|
+
}, [router, pathname]);
|
|
13
|
+
const setValue = useCallback((value) => writeSearchParams({ [name]: value }), [name]);
|
|
14
|
+
return [searchParams.get(name), setValue];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=useNextSearchParam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNextSearchParam.js","sourceRoot":"","sources":["../../src/next/useNextSearchParam.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,wFAAwF;AACxF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAmD,EAAE;IAClG,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,SAAS,CAAC,GAAG,EAAE;QACb,wBAAwB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEvB,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,KAAoB,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACrG,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notify-sonner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/notify-sonner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NotificationAdapter } from '../logic/pure/notify.js';
|
|
2
|
+
/** The notification adapter for sonner: pass it to `AdminUiProvider` or `setNotificationAdapter`. */
|
|
3
|
+
export declare const sonnerNotifications: NotificationAdapter;
|
|
4
|
+
//# sourceMappingURL=sonnerNotifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonnerNotifications.d.ts","sourceRoot":"","sources":["../../src/notify-sonner/sonnerNotifications.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,qGAAqG;AACrG,eAAO,MAAM,mBAAmB,EAAE,mBAQjC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { toast } from 'sonner';
|
|
2
|
+
/** The notification adapter for sonner: pass it to `AdminUiProvider` or `setNotificationAdapter`. */
|
|
3
|
+
export const sonnerNotifications = {
|
|
4
|
+
success: (message, options) => toast.success(message, options),
|
|
5
|
+
info: (message, options) => toast.info(message, options),
|
|
6
|
+
error: (message, options) => toast.error(message, options),
|
|
7
|
+
loading: (message, options) => toast.loading(message, options),
|
|
8
|
+
dismiss: (id) => {
|
|
9
|
+
toast.dismiss(id);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=sonnerNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sonnerNotifications.js","sourceRoot":"","sources":["../../src/notify-sonner/sonnerNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAG/B,qGAAqG;AACrG,MAAM,CAAC,MAAM,mBAAmB,GAAwB;IACtD,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;IAC9D,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;IACxD,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1D,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC;IAC9D,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE;QACd,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface PageFrameProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/** A full-height page below the host's top chrome (`--nav-h`). No hooks: usable from server components. */
|
|
8
|
+
export declare const PageFrame: ({ title, children, className }: PageFrameProps) => import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=PageFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageFrame.d.ts","sourceRoot":"","sources":["../../src/page/PageFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,2GAA2G;AAC3G,eAAO,MAAM,SAAS,GAAI,gCAAgC,cAAc,gCAKvE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../primitives/cn.js";
|
|
3
|
+
/** A full-height page below the host's top chrome (`--nav-h`). No hooks: usable from server components. */
|
|
4
|
+
export const PageFrame = ({ title, children, className }) => (_jsxs("section", { "data-page-frame": "", className: cn('flex flex-col gap-4 md:h-[calc(100dvh_-_var(--nav-h))]', className), children: [_jsx("h1", { className: "text-title-page", children: title }), children] }));
|
|
5
|
+
//# sourceMappingURL=PageFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageFrame.js","sourceRoot":"","sources":["../../src/page/PageFrame.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAQzC,2GAA2G;AAC3G,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAkB,EAAE,EAAE,CAAC,CAC3E,sCAAyB,EAAE,EAAC,SAAS,EAAE,EAAE,CAAC,wDAAwD,EAAE,SAAS,CAAC,aAC5G,aAAI,SAAS,EAAC,iBAAiB,YAAE,KAAK,GAAM,EAC3C,QAAQ,IACD,CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,gBAAiB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type ButtonProps = ComponentProps<'button'> & VariantProps<typeof buttonVariants>;
|
|
8
|
+
/** A button with the package's variants. No hooks: usable from server components. */
|
|
9
|
+
export declare const Button: ({ className, variant, size, type, ...props }: ButtonProps) => import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/primitives/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,eAAO,MAAM,cAAc;;;8EAgB1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAEzF,qFAAqF;AACrF,eAAO,MAAM,MAAM,GAAI,8CAAyD,WAAW,gCAE1F,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { cn } from "./cn.js";
|
|
4
|
+
export const buttonVariants = cva('inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50', {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: {
|
|
7
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
8
|
+
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
9
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
10
|
+
},
|
|
11
|
+
size: {
|
|
12
|
+
default: 'h-9 px-4 py-2',
|
|
13
|
+
sm: 'h-8 px-3',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: { variant: 'default', size: 'default' },
|
|
17
|
+
});
|
|
18
|
+
/** A button with the package's variants. No hooks: usable from server components. */
|
|
19
|
+
export const Button = ({ className, variant, size, type = 'button', ...props }) => (_jsx("button", { type: type, "data-slot": "button", className: cn(buttonVariants({ variant, size }), className), ...props }));
|
|
20
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/primitives/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAC/B,yNAAyN,EACzN;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,wDAAwD;YACjE,OAAO,EAAE,gFAAgF;YACzF,KAAK,EAAE,8CAA8C;SACtD;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,eAAe;YACxB,EAAE,EAAE,UAAU;SACf;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACzD,CACF,CAAC;AAIF,qFAAqF;AACrF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,EAAE,GAAG,KAAK,EAAe,EAAE,EAAE,CAAC,CAC9F,iBAAQ,IAAI,EAAE,IAAI,eAAY,QAAQ,EAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAClH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../src/primitives/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,sFAAsF;AACtF,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,KAAG,MAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","sourceRoot":"","sources":["../../src/primitives/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,MAAM,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,sFAAsF;AACtF,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAoB,EAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
export declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const DialogClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const DialogTitle: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Title>) => import("react").JSX.Element;
|
|
7
|
+
export declare const DialogDescription: ({ className, ...props }: ComponentProps<typeof DialogPrimitive.Description>) => import("react").JSX.Element;
|
|
8
|
+
/** Centered dialog on the overlay layer (`--layer-overlay`), portalled into the provider's container. */
|
|
9
|
+
export declare const DialogContent: ({ className, children, ...props }: ComponentProps<typeof DialogPrimitive.Content>) => import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/primitives/dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAC3C,eAAO,MAAM,aAAa,kIAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,gIAAwB,CAAC;AAEjD,eAAO,MAAM,WAAW,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,gCAEhG,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,yBAAyB,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,gCAE5G,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,aAAa,GAAI,mCAAmC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,gCAsB9G,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { XIcon } from 'lucide-react';
|
|
4
|
+
import { Dialog as DialogPrimitive } from 'radix-ui';
|
|
5
|
+
import { useTranslate } from "../i18n/useTranslate.js";
|
|
6
|
+
import { cn } from "./cn.js";
|
|
7
|
+
import { usePortalContainer } from "./portalContainer.js";
|
|
8
|
+
export const Dialog = DialogPrimitive.Root;
|
|
9
|
+
export const DialogTrigger = DialogPrimitive.Trigger;
|
|
10
|
+
export const DialogClose = DialogPrimitive.Close;
|
|
11
|
+
export const DialogTitle = ({ className, ...props }) => (_jsx(DialogPrimitive.Title, { className: cn('text-lg font-semibold', className), ...props }));
|
|
12
|
+
export const DialogDescription = ({ className, ...props }) => (_jsx(DialogPrimitive.Description, { className: cn('text-sm text-muted-foreground', className), ...props }));
|
|
13
|
+
/** Centered dialog on the overlay layer (`--layer-overlay`), portalled into the provider's container. */
|
|
14
|
+
export const DialogContent = ({ className, children, ...props }) => {
|
|
15
|
+
const container = usePortalContainer();
|
|
16
|
+
const { t } = useTranslate();
|
|
17
|
+
return (_jsxs(DialogPrimitive.Portal, { container: container, children: [_jsx(DialogPrimitive.Overlay, { className: "fixed inset-0 z-(--layer-overlay) bg-black/50" }), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn('fixed top-1/2 left-1/2 z-(--layer-overlay) grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-popover p-6 text-popover-foreground shadow-lg', className), ...props, children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute top-4 right-4 rounded-sm opacity-70 hover:opacity-100", children: [_jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: t('Close', { context: 'dialog' }) })] })] })] }));
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/primitives/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAuB,CAAC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAEjD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgD,EAAE,EAAE,CAAC,CACpG,KAAC,eAAe,CAAC,KAAK,IAAC,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACxF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAsD,EAAE,EAAE,CAAC,CAChH,KAAC,eAAe,CAAC,WAAW,IAAC,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACtG,CAAC;AAEF,yGAAyG;AACzG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkD,EAAE,EAAE;IACjH,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,MAAM,EAAE,CAAC,EAAE,GAAG,YAAY,EAAE,CAAC;IAC7B,OAAO,CACL,MAAC,eAAe,CAAC,MAAM,IAAC,SAAS,EAAE,SAAS,aAC1C,KAAC,eAAe,CAAC,OAAO,IAAC,SAAS,EAAC,+CAA+C,GAAG,EACrF,MAAC,eAAe,CAAC,OAAO,iBACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CACX,4KAA4K,EAC5K,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,MAAC,eAAe,CAAC,KAAK,IAAC,SAAS,EAAC,gEAAgE,aAC/F,KAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,GAAG,EAC5B,eAAM,SAAS,EAAC,SAAS,YAAE,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAQ,IAC9C,IACA,IACH,CAC1B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { cn } from './cn.js';
|
|
2
|
+
export { Button, buttonVariants, type ButtonProps } from './button.js';
|
|
3
|
+
export { PortalContainerProvider, usePortalContainer } from './portalContainer.js';
|
|
4
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, } from './dialog.js';
|
|
5
|
+
export { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from './sheet.js';
|
|
6
|
+
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { cn } from "./cn.js";
|
|
2
|
+
export { Button, buttonVariants } from "./button.js";
|
|
3
|
+
export { PortalContainerProvider, usePortalContainer } from "./portalContainer.js";
|
|
4
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger, } from "./dialog.js";
|
|
5
|
+
export { Sheet, SheetClose, SheetContent, SheetTitle, SheetTrigger } from "./sheet.js";
|
|
6
|
+
export { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAoB,MAAM,aAAc,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,sBAAuB,CAAC;AACpF,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,aAAc,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAa,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,aAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export declare const PortalContainerProvider: ({ container, children, }: {
|
|
3
|
+
container: HTMLElement | null;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
/** The portal container of the nearest provider, or `undefined` (= `document.body`). */
|
|
7
|
+
export declare const usePortalContainer: () => HTMLElement | undefined;
|
|
8
|
+
//# sourceMappingURL=portalContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portalContainer.d.ts","sourceRoot":"","sources":["../../src/primitives/portalContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQlE,eAAO,MAAM,uBAAuB,GAAI,0BAGrC;IACD,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,gCAAoG,CAAC;AAEtG,wFAAwF;AACxF,eAAO,MAAM,kBAAkB,QAAO,WAAW,GAAG,SAA4D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* The element overlays portal into. Lives in `primitives` (primitives read it); the provider renders it.
|
|
6
|
+
* `null` = `document.body`.
|
|
7
|
+
*/
|
|
8
|
+
const PortalContainerContext = createContext(null);
|
|
9
|
+
export const PortalContainerProvider = ({ container, children, }) => _jsx(PortalContainerContext.Provider, { value: container, children: children });
|
|
10
|
+
/** The portal container of the nearest provider, or `undefined` (= `document.body`). */
|
|
11
|
+
export const usePortalContainer = () => useContext(PortalContainerContext) ?? undefined;
|
|
12
|
+
//# sourceMappingURL=portalContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portalContainer.js","sourceRoot":"","sources":["../../src/primitives/portalContainer.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAkB,MAAM,OAAO,CAAC;AAElE;;;GAGG;AACH,MAAM,sBAAsB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,EACtC,SAAS,EACT,QAAQ,GAIT,EAAE,EAAE,CAAC,KAAC,sBAAsB,CAAC,QAAQ,IAAC,KAAK,EAAE,SAAS,YAAG,QAAQ,GAAmC,CAAC;AAEtG,wFAAwF;AACxF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAA4B,EAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,IAAI,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const Select: import("react").FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
export declare const SelectValue: import("react").ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
export declare const SelectTrigger: ({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Trigger>) => import("react").JSX.Element;
|
|
6
|
+
/** The option list on the popover layer (`--layer-popover`), portalled into the provider's container. */
|
|
7
|
+
export declare const SelectContent: ({ className, children, position, ...props }: ComponentProps<typeof SelectPrimitive.Content>) => import("react").JSX.Element;
|
|
8
|
+
export declare const SelectItem: ({ className, children, ...props }: ComponentProps<typeof SelectPrimitive.Item>) => import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=select.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/primitives/select.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,eAAO,MAAM,MAAM,iDAAuB,CAAC;AAC3C,eAAO,MAAM,WAAW,8HAAwB,CAAC;AAEjD,eAAO,MAAM,aAAa,GAAI,mCAAmC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,gCAc9G,CAAC;AAEF,yGAAyG;AACzG,eAAO,MAAM,aAAa,GAAI,6CAK3B,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,gCAiBhD,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,mCAAmC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,gCAgBxG,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon } from 'lucide-react';
|
|
4
|
+
import { Select as SelectPrimitive } from 'radix-ui';
|
|
5
|
+
import { cn } from "./cn.js";
|
|
6
|
+
import { usePortalContainer } from "./portalContainer.js";
|
|
7
|
+
export const Select = SelectPrimitive.Root;
|
|
8
|
+
export const SelectValue = SelectPrimitive.Value;
|
|
9
|
+
export const SelectTrigger = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", className: cn('flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
10
|
+
/** The option list on the popover layer (`--layer-popover`), portalled into the provider's container. */
|
|
11
|
+
export const SelectContent = ({ className, children, position = 'popper', ...props }) => {
|
|
12
|
+
const container = usePortalContainer();
|
|
13
|
+
return (_jsx(SelectPrimitive.Portal, { container: container, children: _jsx(SelectPrimitive.Content, { "data-slot": "select-content", position: position, className: cn('relative z-(--layer-popover) max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md', className), ...props, children: _jsx(SelectPrimitive.Viewport, { className: "p-1", children: children }) }) }));
|
|
14
|
+
};
|
|
15
|
+
export const SelectItem = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn('relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none select-none focus:bg-accent focus:text-accent-foreground', className), ...props, children: [_jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
|
|
16
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/primitives/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAuB,CAAC;AAE3D,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkD,EAAE,EAAE,CAAC,CAClH,MAAC,eAAe,CAAC,OAAO,iBACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CACX,8GAA8G,EAC9G,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,eAAe,CAAC,IAAI,IAAC,OAAO,kBAC3B,KAAC,eAAe,IAAC,SAAS,EAAC,mBAAmB,GAAG,GAC5B,IACC,CAC3B,CAAC;AAEF,yGAAyG;AACzG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,SAAS,EACT,QAAQ,EACR,QAAQ,GAAG,QAAQ,EACnB,GAAG,KAAK,EACuC,EAAE,EAAE;IACnD,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,OAAO,CACL,KAAC,eAAe,CAAC,MAAM,IAAC,SAAS,EAAE,SAAS,YAC1C,KAAC,eAAe,CAAC,OAAO,iBACZ,gBAAgB,EAC1B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,+HAA+H,EAC/H,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,CAAC,QAAQ,IAAC,SAAS,EAAC,KAAK,YAAE,QAAQ,GAA4B,GACvD,GACH,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAA+C,EAAE,EAAE,CAAC,CAC5G,MAAC,eAAe,CAAC,IAAI,iBACT,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,4JAA4J,EAC5J,SAAS,CACV,KACG,KAAK,aAET,eAAM,SAAS,EAAC,4DAA4D,YAC1E,KAAC,eAAe,CAAC,aAAa,cAC5B,KAAC,SAAS,IAAC,SAAS,EAAC,QAAQ,GAAG,GACF,GAC3B,EACP,KAAC,eAAe,CAAC,QAAQ,cAAE,QAAQ,GAA4B,IAC1C,CACxB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dialog as SheetPrimitive } from 'radix-ui';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
export declare const Sheet: import("react").FC<SheetPrimitive.DialogProps>;
|
|
4
|
+
export declare const SheetTrigger: import("react").ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const SheetClose: import("react").ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const SheetTitle: ({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) => import("react").JSX.Element;
|
|
7
|
+
/** Side panel on the overlay layer (`--layer-overlay`), portalled into the provider's container. */
|
|
8
|
+
export declare const SheetContent: ({ className, children, ...props }: ComponentProps<typeof SheetPrimitive.Content>) => import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../src/primitives/sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,eAAO,MAAM,KAAK,gDAAsB,CAAC;AACzC,eAAO,MAAM,YAAY,iIAAyB,CAAC;AACnD,eAAO,MAAM,UAAU,+HAAuB,CAAC;AAE/C,eAAO,MAAM,UAAU,GAAI,yBAAyB,cAAc,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,gCAE9F,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,YAAY,GAAI,mCAAmC,cAAc,CAAC,OAAO,cAAc,CAAC,OAAO,CAAC,gCAiB5G,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog as SheetPrimitive } from 'radix-ui';
|
|
4
|
+
import { cn } from "./cn.js";
|
|
5
|
+
import { usePortalContainer } from "./portalContainer.js";
|
|
6
|
+
export const Sheet = SheetPrimitive.Root;
|
|
7
|
+
export const SheetTrigger = SheetPrimitive.Trigger;
|
|
8
|
+
export const SheetClose = SheetPrimitive.Close;
|
|
9
|
+
export const SheetTitle = ({ className, ...props }) => (_jsx(SheetPrimitive.Title, { className: cn('text-lg font-semibold', className), ...props }));
|
|
10
|
+
/** Side panel on the overlay layer (`--layer-overlay`), portalled into the provider's container. */
|
|
11
|
+
export const SheetContent = ({ className, children, ...props }) => {
|
|
12
|
+
const container = usePortalContainer();
|
|
13
|
+
return (_jsxs(SheetPrimitive.Portal, { container: container, children: [_jsx(SheetPrimitive.Overlay, { className: "fixed inset-0 z-(--layer-overlay) bg-black/50" }), _jsx(SheetPrimitive.Content, { "data-slot": "sheet-content", className: cn('fixed inset-y-0 right-0 z-(--layer-overlay) flex h-full w-3/4 max-w-sm flex-col gap-4 border-l bg-background p-6 shadow-lg', className), ...props, children: children })] }));
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","sourceRoot":"","sources":["../../src/primitives/sheet.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAuB,CAAC;AAE3D,MAAM,CAAC,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+C,EAAE,EAAE,CAAC,CAClG,KAAC,cAAc,CAAC,KAAK,IAAC,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CACvF,CAAC;AAEF,oGAAoG;AACpG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiD,EAAE,EAAE;IAC/G,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,OAAO,CACL,MAAC,cAAc,CAAC,MAAM,IAAC,SAAS,EAAE,SAAS,aACzC,KAAC,cAAc,CAAC,OAAO,IAAC,SAAS,EAAC,+CAA+C,GAAG,EACpF,KAAC,cAAc,CAAC,OAAO,iBACX,eAAe,EACzB,SAAS,EAAE,EAAE,CACX,4HAA4H,EAC5H,SAAS,CACV,KACG,KAAK,YAER,QAAQ,GACc,IACH,CACzB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AdminUiContextValue, AdminUiProviderProps, StorageKeyFn } from './types.js';
|
|
2
|
+
export declare const defaultStorageKey: StorageKeyFn;
|
|
3
|
+
/** Wires the host's adapters into the package. Adapters passed to a block directly win over these. */
|
|
4
|
+
export declare const AdminUiProvider: ({ children, translations, notifications, storageKey, portalContainer, upload, }: AdminUiProviderProps) => import("react").JSX.Element;
|
|
5
|
+
/** The adapters of the nearest provider (defaults without one). */
|
|
6
|
+
export declare const useAdminUi: () => AdminUiContextValue;
|
|
7
|
+
//# sourceMappingURL=AdminUiProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminUiProvider.d.ts","sourceRoot":"","sources":["../../src/provider/AdminUiProvider.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1F,eAAO,MAAM,iBAAiB,EAAE,YAAyD,CAAC;AAI1F,sGAAsG;AACtG,eAAO,MAAM,eAAe,GAAI,iFAO7B,oBAAoB,gCAuBtB,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,UAAU,QAAO,mBAAiD,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useEffect, useLayoutEffect, useMemo } from 'react';
|
|
4
|
+
import { setTranslations } from "../i18n/store.js";
|
|
5
|
+
import { setNotificationAdapter } from "../logic/pure/notify.js";
|
|
6
|
+
import { PortalContainerProvider } from "../primitives/portalContainer.js";
|
|
7
|
+
export const defaultStorageKey = (kind, id) => `ddd-admin-ui.${kind}.${id}`;
|
|
8
|
+
const AdminUiContext = createContext({ storageKey: defaultStorageKey });
|
|
9
|
+
/** Wires the host's adapters into the package. Adapters passed to a block directly win over these. */
|
|
10
|
+
export const AdminUiProvider = ({ children, translations, notifications, storageKey = defaultStorageKey, portalContainer = null, upload, }) => {
|
|
11
|
+
useLayoutEffect(() => {
|
|
12
|
+
if (!notifications)
|
|
13
|
+
return undefined;
|
|
14
|
+
setNotificationAdapter(notifications);
|
|
15
|
+
return () => setNotificationAdapter(null);
|
|
16
|
+
}, [notifications]);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!translations)
|
|
19
|
+
return undefined;
|
|
20
|
+
const apply = () => {
|
|
21
|
+
const snapshot = translations.getSnapshot();
|
|
22
|
+
setTranslations(snapshot.languageCode, snapshot.writingStyle, snapshot.translations);
|
|
23
|
+
};
|
|
24
|
+
apply();
|
|
25
|
+
return translations.subscribe(apply);
|
|
26
|
+
}, [translations]);
|
|
27
|
+
const value = useMemo(() => ({ storageKey, ...(upload ? { upload } : {}) }), [storageKey, upload]);
|
|
28
|
+
return (_jsx(AdminUiContext.Provider, { value: value, children: _jsx(PortalContainerProvider, { container: portalContainer, children: children }) }));
|
|
29
|
+
};
|
|
30
|
+
/** The adapters of the nearest provider (defaults without one). */
|
|
31
|
+
export const useAdminUi = () => useContext(AdminUiContext);
|
|
32
|
+
//# sourceMappingURL=AdminUiProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdminUiProvider.js","sourceRoot":"","sources":["../../src/provider/AdminUiProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAmC,CAAC;AAG5E,MAAM,CAAC,MAAM,iBAAiB,GAAiB,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,gBAAgB,IAAI,IAAI,EAAE,EAAE,CAAC;AAE1F,MAAM,cAAc,GAAG,aAAa,CAAsB,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAE7F,sGAAsG;AACtG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,UAAU,GAAG,iBAAiB,EAC9B,eAAe,GAAG,IAAI,EACtB,MAAM,GACe,EAAE,EAAE;IACzB,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,aAAa;YAAE,OAAO,SAAS,CAAC;QACrC,sBAAsB,CAAC,aAAa,CAAC,CAAC;QACtC,OAAO,GAAG,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QACpC,MAAM,KAAK,GAAG,GAAG,EAAE;YACjB,MAAM,QAAQ,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;YAC5C,eAAe,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;QACvF,CAAC,CAAC;QACF,KAAK,EAAE,CAAC;QACR,OAAO,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,KAAK,GAAG,OAAO,CAAsB,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IACxH,OAAO,CACL,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YACnC,KAAC,uBAAuB,IAAC,SAAS,EAAE,eAAe,YAAG,QAAQ,GAA2B,GACjE,CAC3B,CAAC;AACJ,CAAC,CAAC;AAEF,mEAAmE;AACnE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAwB,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACvF,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,sBAAuB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { WritingStyle } from '../i18n/store.js';
|
|
3
|
+
import type { NotificationAdapter } from '../logic/pure/notify.js';
|
|
4
|
+
import type { MediaUploadAdapter } from '../media/types.js';
|
|
5
|
+
/** Feeds the package's translation store from a host-owned store. Absent: the host calls `setTranslations`. */
|
|
6
|
+
export interface TranslationAdapter {
|
|
7
|
+
subscribe: (listener: () => void) => () => void;
|
|
8
|
+
getSnapshot: () => {
|
|
9
|
+
languageCode: string;
|
|
10
|
+
/** A host without writing styles answers 'FORMAL'. */
|
|
11
|
+
writingStyle: WritingStyle;
|
|
12
|
+
/** Key = `<text>` or `<text>__<context>`. */
|
|
13
|
+
translations: Readonly<Record<string, string>>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export type StorageKind = 'list-filters' | 'list-view';
|
|
17
|
+
/** Builds a browser storage key. Default `ddd-admin-ui.<kind>.<id>`. Must be pure and stable. */
|
|
18
|
+
export type StorageKeyFn = (kind: StorageKind, id: string) => string;
|
|
19
|
+
export interface AdminUiProviderProps {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
translations?: TranslationAdapter;
|
|
22
|
+
/** Registered with `setNotificationAdapter` (`./logic`) while the provider is mounted. */
|
|
23
|
+
notifications?: NotificationAdapter;
|
|
24
|
+
storageKey?: StorageKeyFn;
|
|
25
|
+
/** Overlays portal into this element; absent = `document.body`. */
|
|
26
|
+
portalContainer?: HTMLElement | null;
|
|
27
|
+
upload?: MediaUploadAdapter;
|
|
28
|
+
}
|
|
29
|
+
export interface AdminUiContextValue {
|
|
30
|
+
storageKey: StorageKeyFn;
|
|
31
|
+
upload?: MediaUploadAdapter;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,+GAA+G;AAC/G,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAChD,WAAW,EAAE,MAAM;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,sDAAsD;QACtD,YAAY,EAAE,YAAY,CAAC;QAC3B,6CAA6C;QAC7C,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KAChD,CAAC;CACH;AAED,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,WAAW,CAAC;AACvD,iGAAiG;AACjG,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;AAErE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,0FAA0F;IAC1F,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,mEAAmE;IACnE,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,YAAY,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/provider/types.ts"],"names":[],"mappings":""}
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @mgamadeus/ddd-admin-ui — theme binding.
|
|
3
|
+
* Registers the colour roles of tokens.json as Tailwind theme colours for a host that declares them as complete CSS
|
|
4
|
+
* colours under their bare names (`--card: #fff` on :root, other values under .dark). A host with another encoding
|
|
5
|
+
* provides the same utility names its own way and does not import this file.
|
|
6
|
+
* Import after `@import "tailwindcss";`.
|
|
7
|
+
*/
|
|
8
|
+
@theme inline {
|
|
9
|
+
--color-background: var(--background);
|
|
10
|
+
--color-foreground: var(--foreground);
|
|
11
|
+
--color-card: var(--card);
|
|
12
|
+
--color-card-foreground: var(--card-foreground);
|
|
13
|
+
--color-popover: var(--popover);
|
|
14
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
15
|
+
--color-primary: var(--primary);
|
|
16
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
17
|
+
--color-primary-emphasis: var(--primary-emphasis);
|
|
18
|
+
--color-secondary: var(--secondary);
|
|
19
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
20
|
+
--color-muted: var(--muted);
|
|
21
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
22
|
+
--color-accent: var(--accent);
|
|
23
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
24
|
+
--color-destructive: var(--destructive);
|
|
25
|
+
--color-success: var(--success);
|
|
26
|
+
--color-warning: var(--warning);
|
|
27
|
+
--color-info: var(--info);
|
|
28
|
+
--color-brand: var(--brand);
|
|
29
|
+
--color-brand-emphasis: var(--brand-emphasis);
|
|
30
|
+
--color-brand-light: var(--brand-light);
|
|
31
|
+
--color-brand-ink: var(--brand-ink);
|
|
32
|
+
--color-border: var(--border);
|
|
33
|
+
--color-input: var(--input);
|
|
34
|
+
--color-ring: var(--ring);
|
|
35
|
+
--color-tint: var(--tint);
|
|
36
|
+
--color-tint-strong: var(--tint-strong);
|
|
37
|
+
--color-segment-active: var(--segment-active);
|
|
38
|
+
--color-field-edge: var(--field-edge);
|
|
39
|
+
--color-field-edge-strong: var(--field-edge-strong);
|
|
40
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
41
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
42
|
+
--radius-lg: var(--radius);
|
|
43
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
44
|
+
}
|
package/dist/tokens.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"colors": {
|
|
4
|
+
"background": { "meaning": "page backdrop", "themed": true },
|
|
5
|
+
"foreground": { "meaning": "default text on background and card", "themed": true },
|
|
6
|
+
"card": { "meaning": "surface fill; components.css mixes it with --surface-alpha", "themed": true },
|
|
7
|
+
"card-foreground": { "meaning": "text on card", "themed": true },
|
|
8
|
+
"popover": { "meaning": "menus, selects, popovers", "themed": true },
|
|
9
|
+
"popover-foreground": { "meaning": "text on popover", "themed": true },
|
|
10
|
+
"primary": { "meaning": "action fill (buttons, active chips, counters)", "themed": true },
|
|
11
|
+
"primary-foreground": { "meaning": "text on a primary fill", "themed": true },
|
|
12
|
+
"primary-emphasis": { "meaning": "primary as legible text on background, card and accent", "themed": true },
|
|
13
|
+
"secondary": { "meaning": "quiet fill", "themed": true },
|
|
14
|
+
"secondary-foreground": { "meaning": "text on secondary", "themed": true },
|
|
15
|
+
"muted": { "meaning": "quiet fill, skeletons", "themed": true },
|
|
16
|
+
"muted-foreground": { "meaning": "secondary text (at least 4.5:1 on card)", "themed": true },
|
|
17
|
+
"accent": { "meaning": "light tint of primary (hover, primary tag)", "themed": true },
|
|
18
|
+
"accent-foreground": { "meaning": "text on accent", "themed": true },
|
|
19
|
+
"destructive": { "meaning": "danger fill and danger text", "themed": true },
|
|
20
|
+
"success": { "meaning": "success fill and text (status tone)", "themed": true },
|
|
21
|
+
"warning": { "meaning": "warning fill and text", "themed": true },
|
|
22
|
+
"info": { "meaning": "info fill and text", "themed": true },
|
|
23
|
+
"brand": { "meaning": "identity fill and marks (with /15 tints)", "themed": true },
|
|
24
|
+
"brand-emphasis": { "meaning": "brand as legible text", "themed": true },
|
|
25
|
+
"brand-light": { "meaning": "light brand tint (brand tag)", "themed": true },
|
|
26
|
+
"brand-ink": { "meaning": "brand text at least 4.5:1 (action rows, two-tone titles)", "themed": true },
|
|
27
|
+
"border": { "meaning": "hairline; also the default border colour", "themed": true },
|
|
28
|
+
"input": { "meaning": "field border, dark-mode field fill", "themed": true },
|
|
29
|
+
"ring": { "meaning": "focus ring", "themed": true },
|
|
30
|
+
"tint": { "meaning": "ink at about 6 %, alpha baked in (no /modifier)", "themed": true },
|
|
31
|
+
"tint-strong": { "meaning": "ink at about 10 %, alpha baked in", "themed": true },
|
|
32
|
+
"segment-active": { "meaning": "active pill of segmented tabs and toggles", "themed": true },
|
|
33
|
+
"field-edge": { "meaning": "form field edge at rest (about 2:1), alpha baked in", "themed": true },
|
|
34
|
+
"field-edge-strong": { "meaning": "field edge on hover or open (about 3:1)", "themed": true }
|
|
35
|
+
},
|
|
36
|
+
"properties": {
|
|
37
|
+
"--nav-h": { "syntax": "<length>", "meaning": "height of the fixed top chrome; sticky offsets and full-height frames", "themed": false },
|
|
38
|
+
"--content-max": { "syntax": "<length-percentage> | none", "meaning": "max width of wide forms", "themed": false },
|
|
39
|
+
"--radius": { "syntax": "<length>", "meaning": "base radius; theme radii sm to xl derive from it", "themed": false },
|
|
40
|
+
"--surface-alpha": { "syntax": "<percentage>", "meaning": "opacity of the card fill of .surface", "themed": true },
|
|
41
|
+
"--surface-shadow": { "syntax": "<shadow>", "meaning": "shadow of .surface", "themed": true },
|
|
42
|
+
"--surface-shadow-raised": { "syntax": "<shadow>", "meaning": "shadow of a raised surface", "themed": true },
|
|
43
|
+
"--glass-alpha": { "syntax": "<percentage>", "meaning": "opacity of glass bars", "themed": true },
|
|
44
|
+
"--surface-glass-alpha": { "syntax": "<percentage>", "meaning": "opacity of the card fill of .surface-glass", "themed": true },
|
|
45
|
+
"--surface-glass-strong-alpha": { "syntax": "<percentage>", "meaning": "opacity of .surface-glass-strong", "themed": true },
|
|
46
|
+
"--glass-shadow": { "syntax": "<shadow>", "meaning": "shadow of glass surfaces", "themed": true },
|
|
47
|
+
"--glass-control-shadow": { "syntax": "<shadow>", "meaning": "shadow of controls on glass", "themed": true }
|
|
48
|
+
},
|
|
49
|
+
"layers": {
|
|
50
|
+
"--layer-raised": { "default": 10, "meaning": "sticky table headers, icons inside fields" },
|
|
51
|
+
"--layer-sticky": { "default": 20, "meaning": "sticky form actions and jump bars" },
|
|
52
|
+
"--layer-overlay": { "default": 50, "meaning": "sheet and dialog overlay and content" },
|
|
53
|
+
"--layer-popover": { "default": 50, "meaning": "popover, select, dropdown menu, tooltip, command list" }
|
|
54
|
+
},
|
|
55
|
+
"dataAttributes": {
|
|
56
|
+
"data-page-frame": { "setBy": "PageFrame", "readBy": "host shell" },
|
|
57
|
+
"data-form-actions": { "setBy": "Form", "readBy": "components.css (order: -1)" },
|
|
58
|
+
"data-list-toolbar": { "setBy": "list toolbar", "readBy": "components.css" },
|
|
59
|
+
"data-slot": { "setBy": "primitives", "readBy": "components.css" }
|
|
60
|
+
},
|
|
61
|
+
"hostRequirements": [
|
|
62
|
+
"dark mode: a .dark class on an ancestor; the dark: variant is defined by the host",
|
|
63
|
+
"default border colour = the border role",
|
|
64
|
+
"animation utilities animate-in/out, fade-*, zoom-*, slide-in-from-* (tw-animate-css or equivalent)"
|
|
65
|
+
]
|
|
66
|
+
}
|