@donotdev/ui 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/common/TechBento.d.ts +2 -6
- package/dist/components/common/TechBento.d.ts.map +1 -1
- package/dist/components/common/TechBento.js +14 -16
- package/dist/crud/components/EntityDisplayRenderer.d.ts +1 -1
- package/dist/crud/components/EntityDisplayRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityDisplayRenderer.js +13 -57
- package/dist/crud/components/EntityFormRenderer.d.ts.map +1 -1
- package/dist/crud/components/EntityFormRenderer.js +2 -2
- package/dist/crud/crudImports.d.ts +1 -0
- package/dist/crud/crudImports.d.ts.map +1 -1
- package/dist/crud/crudImports.js +1 -0
- package/dist/dndev-next.css +35 -46
- package/dist/dndev.css +35 -46
- package/dist/index.js +4 -4
- package/dist/internal/layout/components/AutoMetaTags.d.ts.map +1 -1
- package/dist/internal/layout/components/AutoMetaTags.js +6 -22
- package/dist/internal/layout/components/footer/FooterLegalLinks.js +2 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts +0 -2
- package/dist/internal/layout/components/footer/useLegalLinks.d.ts.map +1 -1
- package/dist/internal/layout/components/footer/useLegalLinks.js +0 -2
- package/dist/internal/layout/components/i18nSeoMeta.d.ts +54 -0
- package/dist/internal/layout/components/i18nSeoMeta.d.ts.map +1 -0
- package/dist/internal/layout/components/i18nSeoMeta.js +52 -0
- package/dist/internal/layout/components/index.d.ts +1 -1
- package/dist/internal/layout/components/index.js +1 -1
- package/dist/providers/NextJsAppProviders.d.ts.map +1 -1
- package/dist/providers/NextJsAppProviders.js +0 -1
- package/dist/routing/AuthGuard.d.ts +0 -4
- package/dist/routing/AuthGuard.d.ts.map +1 -1
- package/dist/routing/AuthGuard.js +0 -4
- package/dist/styles/index.css +35 -46
- package/dist/symbol-index.json +1 -1
- package/guidelines/SEO.md +12 -0
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AutoMetaTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/AutoMetaTags.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA4M3C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY,EAAE,aA6S1B,CAAC;AAEF;;;GAGG;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -27,6 +27,7 @@ import { AssetResolver } from '@donotdev/ui';
|
|
|
27
27
|
// Platform-specific hooks via conditional exports
|
|
28
28
|
import { useLocation } from '@donotdev/ui/routing/hooks';
|
|
29
29
|
import { HeadTags } from './HeadTags';
|
|
30
|
+
import { readI18nSeoMeta, resolveSeoField } from './i18nSeoMeta';
|
|
30
31
|
/**
|
|
31
32
|
* Match pathname against route path pattern (e.g. /cars/:id or /blog/:slug/comments/:id).
|
|
32
33
|
* Supports arbitrary nesting: any depth, any mix of static and :param segments.
|
|
@@ -48,22 +49,6 @@ function matchRoutePath(pattern, pathname) {
|
|
|
48
49
|
}
|
|
49
50
|
return true;
|
|
50
51
|
}
|
|
51
|
-
/**
|
|
52
|
-
* Resolve SEO field with i18n fallback
|
|
53
|
-
* @description
|
|
54
|
-
* - `undefined` → i18n lookup
|
|
55
|
-
* - `string` → use literal value
|
|
56
|
-
* - `null` → omit (return undefined)
|
|
57
|
-
*/
|
|
58
|
-
function resolveSeoField(seoValue, translationKey, t) {
|
|
59
|
-
if (seoValue === null)
|
|
60
|
-
return undefined; // Explicit null = omit
|
|
61
|
-
if (seoValue !== undefined)
|
|
62
|
-
return seoValue; // Explicit string = use it
|
|
63
|
-
// undefined = i18n lookup
|
|
64
|
-
const translated = t(translationKey);
|
|
65
|
-
return translated !== translationKey ? translated : undefined;
|
|
66
|
-
}
|
|
67
52
|
/**
|
|
68
53
|
* Get route metadata from window object (injected by build system).
|
|
69
54
|
* Resolves dynamic routes by pattern (e.g. /cars/:id) so PageMeta (including namespace) is used for SEO.
|
|
@@ -231,13 +216,13 @@ export const AutoMetaTags = () => {
|
|
|
231
216
|
const metaData = useMemo(() => {
|
|
232
217
|
if (!seoConfig)
|
|
233
218
|
return null;
|
|
234
|
-
const { defaultNamespace = 'home', defaultImage } = seoConfig;
|
|
219
|
+
const { defaultNamespace = 'home', defaultImage = '/og-image.png' } = seoConfig;
|
|
235
220
|
// Construct absolute URL for canonical link
|
|
236
221
|
const currentUrl = `${baseUrl}${location.pathname}`;
|
|
237
222
|
const ns = routeMeta.namespace || defaultNamespace;
|
|
238
223
|
const seo = routeMeta.seo;
|
|
239
|
-
// Get the meta
|
|
240
|
-
const metaObject = t
|
|
224
|
+
// Get the meta fields from i18n (image, type, keywords, author, fullTitle)
|
|
225
|
+
const metaObject = readI18nSeoMeta(t, ns);
|
|
241
226
|
// Title resolution priority:
|
|
242
227
|
// 1. i18n meta.fullTitle → translated, language-aware (wins)
|
|
243
228
|
// 2. seo.fullTitle (static PageMeta) → fallback for non-i18n apps
|
|
@@ -269,9 +254,8 @@ export const AutoMetaTags = () => {
|
|
|
269
254
|
const type = pageType || 'website';
|
|
270
255
|
const keywords = pageKeywords || undefined;
|
|
271
256
|
const author = pageAuthor || undefined;
|
|
272
|
-
//
|
|
273
|
-
|
|
274
|
-
const imagePath = image && image.startsWith('http') ? image : image ? image : undefined;
|
|
257
|
+
// Link-preview crawlers need an absolute URL
|
|
258
|
+
const imagePath = image && !image.startsWith('http') ? `${baseUrl}${image}` : image;
|
|
275
259
|
return {
|
|
276
260
|
title: fullTitle,
|
|
277
261
|
description,
|
|
@@ -11,7 +11,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
11
11
|
import { Stack } from '@donotdev/components';
|
|
12
12
|
import { useTranslation, maybeTranslate, useAppConfig } from '@donotdev/core';
|
|
13
13
|
import { FooterBranding } from './FooterBranding';
|
|
14
|
-
import {
|
|
14
|
+
import { getLegalLinks } from './useLegalLinks';
|
|
15
15
|
import { Link } from '../../../../routing/Link';
|
|
16
16
|
/**
|
|
17
17
|
* FooterLegalLinks - Legal links component
|
|
@@ -28,7 +28,7 @@ export const FooterLegalLinks = ({ app, direction = 'column', gap = 'tight', ali
|
|
|
28
28
|
const { t } = useTranslation('dndev');
|
|
29
29
|
const appConfig = useAppConfig('app');
|
|
30
30
|
const resolvedApp = app || appConfig || {};
|
|
31
|
-
const links =
|
|
31
|
+
const links = getLegalLinks(resolvedApp.footer);
|
|
32
32
|
const linkStyle = {
|
|
33
33
|
transition: 'color var(--dur-fast) ease-out',
|
|
34
34
|
textDecoration: 'underline',
|
|
@@ -10,6 +10,4 @@ export interface FooterLegalLink {
|
|
|
10
10
|
* @remarks Not a hook — no React state or effects. Named with `get` prefix.
|
|
11
11
|
*/
|
|
12
12
|
export declare const getLegalLinks: (footerConfig: AppMetadata["footer"]) => FooterLegalLink[];
|
|
13
|
-
/** @deprecated Use getLegalLinks instead */
|
|
14
|
-
export declare const useLegalLinks: (footerConfig: AppMetadata["footer"]) => FooterLegalLink[];
|
|
15
13
|
//# sourceMappingURL=useLegalLinks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLegalLinks.d.ts","sourceRoot":"","sources":["../../../../../src/internal/layout/components/footer/useLegalLinks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAQD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,cAAc,WAAW,CAAC,QAAQ,CAAC,KAClC,eAAe,EAQjB,CAAC
|
|
1
|
+
{"version":3,"file":"useLegalLinks.d.ts","sourceRoot":"","sources":["../../../../../src/internal/layout/components/footer/useLegalLinks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAQD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,cAAc,WAAW,CAAC,QAAQ,CAAC,KAClC,eAAe,EAQjB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview SEO fields from a namespace's `meta` translations
|
|
3
|
+
* @description Reads `<ns>:meta.*` key by key, as the i18n convention requires:
|
|
4
|
+
* `useTranslation` returns strings only, never objects or arrays.
|
|
5
|
+
*
|
|
6
|
+
* @version 0.2.2
|
|
7
|
+
* @since 0.2.2
|
|
8
|
+
* @author AMBROISE PARK Consulting
|
|
9
|
+
*/
|
|
10
|
+
import type { TFunction } from 'i18next';
|
|
11
|
+
/**
|
|
12
|
+
* Resolves a title or description: explicit value, else its translation.
|
|
13
|
+
*
|
|
14
|
+
* @param seoValue - `null` omits the field, a string is used as is, `undefined` looks up the translation
|
|
15
|
+
* @param translationKey - Namespaced key, e.g. `home:description`
|
|
16
|
+
* @param t - Translation function loaded with the key's namespace
|
|
17
|
+
* @returns The resolved text, or undefined when omitted or not translated
|
|
18
|
+
*
|
|
19
|
+
* @version 0.2.2
|
|
20
|
+
* @since 0.2.2
|
|
21
|
+
* @author AMBROISE PARK Consulting
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveSeoField(seoValue: string | null | undefined, translationKey: string, t: TFunction): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* SEO fields a namespace can define under `meta`.
|
|
26
|
+
*
|
|
27
|
+
* @version 0.2.2
|
|
28
|
+
* @since 0.2.2
|
|
29
|
+
* @author AMBROISE PARK Consulting
|
|
30
|
+
*/
|
|
31
|
+
export interface I18nSeoMeta {
|
|
32
|
+
fullTitle?: string;
|
|
33
|
+
image?: string;
|
|
34
|
+
type?: string;
|
|
35
|
+
keywords?: string[];
|
|
36
|
+
author?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Reads the SEO fields of a namespace from its translations.
|
|
40
|
+
*
|
|
41
|
+
* @param t - Translation function loaded with `ns`
|
|
42
|
+
* @param ns - Namespace holding the `meta` object
|
|
43
|
+
* @returns The defined fields; a missing or empty field is undefined
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // JSON: { "meta": { "image": "/og.png", "keywords": ["a", "b"] } }
|
|
47
|
+
* readI18nSeoMeta(t, 'home'); // { image: '/og.png', keywords: ['a', 'b'] }
|
|
48
|
+
*
|
|
49
|
+
* @version 0.2.2
|
|
50
|
+
* @since 0.2.2
|
|
51
|
+
* @author AMBROISE PARK Consulting
|
|
52
|
+
*/
|
|
53
|
+
export declare function readI18nSeoMeta(t: TFunction, ns: string): I18nSeoMeta;
|
|
54
|
+
//# sourceMappingURL=i18nSeoMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18nSeoMeta.d.ts","sourceRoot":"","sources":["../../../../src/internal/layout/components/i18nSeoMeta.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAUzC;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,cAAc,EAAE,MAAM,EACtB,CAAC,EAAE,SAAS,GACX,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAkBrE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// packages/ui/src/internal/layout/components/i18nSeoMeta.ts
|
|
2
|
+
import { translateArray } from '@donotdev/core';
|
|
3
|
+
/** Upper bound for translateArray: keywords past it are not emitted. */
|
|
4
|
+
const MAX_KEYWORDS = 20;
|
|
5
|
+
/** An empty default is how a missing key is detected: on a namespaced key, i18next returns the key without its namespace. */
|
|
6
|
+
const EMPTY_WHEN_MISSING = { defaultValue: '' };
|
|
7
|
+
/**
|
|
8
|
+
* Resolves a title or description: explicit value, else its translation.
|
|
9
|
+
*
|
|
10
|
+
* @param seoValue - `null` omits the field, a string is used as is, `undefined` looks up the translation
|
|
11
|
+
* @param translationKey - Namespaced key, e.g. `home:description`
|
|
12
|
+
* @param t - Translation function loaded with the key's namespace
|
|
13
|
+
* @returns The resolved text, or undefined when omitted or not translated
|
|
14
|
+
*
|
|
15
|
+
* @version 0.2.2
|
|
16
|
+
* @since 0.2.2
|
|
17
|
+
* @author AMBROISE PARK Consulting
|
|
18
|
+
*/
|
|
19
|
+
export function resolveSeoField(seoValue, translationKey, t) {
|
|
20
|
+
if (seoValue === null)
|
|
21
|
+
return undefined;
|
|
22
|
+
if (seoValue !== undefined)
|
|
23
|
+
return seoValue;
|
|
24
|
+
return t(translationKey, EMPTY_WHEN_MISSING) || undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Reads the SEO fields of a namespace from its translations.
|
|
28
|
+
*
|
|
29
|
+
* @param t - Translation function loaded with `ns`
|
|
30
|
+
* @param ns - Namespace holding the `meta` object
|
|
31
|
+
* @returns The defined fields; a missing or empty field is undefined
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // JSON: { "meta": { "image": "/og.png", "keywords": ["a", "b"] } }
|
|
35
|
+
* readI18nSeoMeta(t, 'home'); // { image: '/og.png', keywords: ['a', 'b'] }
|
|
36
|
+
*
|
|
37
|
+
* @version 0.2.2
|
|
38
|
+
* @since 0.2.2
|
|
39
|
+
* @author AMBROISE PARK Consulting
|
|
40
|
+
*/
|
|
41
|
+
export function readI18nSeoMeta(t, ns) {
|
|
42
|
+
const translateOrEmpty = ((key) => t(key, EMPTY_WHEN_MISSING));
|
|
43
|
+
const field = (name) => translateOrEmpty(`${ns}:meta.${name}`) || undefined;
|
|
44
|
+
const keywords = translateArray(translateOrEmpty, `${ns}:meta.keywords`, MAX_KEYWORDS);
|
|
45
|
+
return {
|
|
46
|
+
fullTitle: field('fullTitle'),
|
|
47
|
+
image: field('image'),
|
|
48
|
+
type: field('type'),
|
|
49
|
+
keywords: keywords.length > 0 ? keywords : undefined,
|
|
50
|
+
author: field('author'),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
export { FooterCopyright } from './footer/FooterCopyright';
|
|
10
10
|
export { FooterLegalLinks } from './footer/FooterLegalLinks';
|
|
11
11
|
export { FooterBranding } from './footer/FooterBranding';
|
|
12
|
-
export {
|
|
12
|
+
export { getLegalLinks } from './footer/useLegalLinks';
|
|
13
13
|
export type { FooterLegalLink } from './footer/useLegalLinks';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
export { FooterCopyright } from './footer/FooterCopyright';
|
|
11
11
|
export { FooterLegalLinks } from './footer/FooterLegalLinks';
|
|
12
12
|
export { FooterBranding } from './footer/FooterBranding';
|
|
13
|
-
export {
|
|
13
|
+
export { getLegalLinks } from './footer/useLegalLinks';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"NextJsAppProviders.d.ts","sourceRoot":"","sources":["../../src/providers/NextJsAppProviders.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAuDxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAQD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BAuFhE"}
|
|
@@ -16,7 +16,6 @@ import { useConsent } from '@donotdev/core';
|
|
|
16
16
|
import { NextJsStoresInitializer } from '../internal/initializers/NextJsStoresInitializer';
|
|
17
17
|
import FaviconHead from '../internal/layout/components/FaviconHead';
|
|
18
18
|
import PerformanceHints from '../internal/layout/components/PerformanceHints';
|
|
19
|
-
// import NextJsAutoMetaTags from '../internal/layout/components/NextJsAutoMetaTags'; // Deprecated - metadata now server-side
|
|
20
19
|
import { DnDevLayout } from '../internal/layout/DnDevLayout';
|
|
21
20
|
import { SentryInitializer } from '../internal/providers/SentryInitializer';
|
|
22
21
|
import { UIProviders } from '../internal/providers/UIProviders';
|
|
@@ -33,10 +33,6 @@ export declare function AuthGuard({ auth, children, fallback: Fallback, }: AuthG
|
|
|
33
33
|
* @author AMBROISE PARK Consulting
|
|
34
34
|
*/
|
|
35
35
|
export declare function useCanNavigate(auth: PageAuth | false): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated Use useCanNavigate instead
|
|
38
|
-
*/
|
|
39
|
-
export declare const useCanAccess: typeof useCanNavigate;
|
|
40
36
|
/**
|
|
41
37
|
* Hook to get current user's role - directly from store
|
|
42
38
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../src/routing/AuthGuard.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAEL,UAAU,EACV,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C;;GAEG;AACH,UAAU,cAAc;IACtB,wCAAwC;IACxC,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EACR,QAAQ,EAAE,QAAoC,GAC/C,EAAE,cAAc,+BA0ChB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAG9D;AAED
|
|
1
|
+
{"version":3,"file":"AuthGuard.d.ts","sourceRoot":"","sources":["../../src/routing/AuthGuard.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtD,OAAO,EAEL,UAAU,EACV,kBAAkB,EAGnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C;;GAEG;AACH,UAAU,cAAc;IACtB,wCAAwC;IACxC,IAAI,EAAE,QAAQ,GAAG,KAAK,CAAC;IACvB,wCAAwC;IACxC,QAAQ,EAAE,SAAS,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,QAAQ,EACR,QAAQ,EAAE,QAAoC,GAC/C,EAAE,cAAc,+BA0ChB;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,OAAO,CAG9D;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IACvB,OAAO,UAAU,CAAC,KAAK,GACvB,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,UAAU,CAAC,KAAK,CAS1B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,IAAI,EACA,OAAO,UAAU,CAAC,KAAK,GACvB,OAAO,UAAU,CAAC,IAAI,GACtB,OAAO,UAAU,CAAC,KAAK,GAC1B,OAAO,CAIT;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY;;;;;;EAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE,QAAQ,GAAG,KAAK,WAEW,CAAC,iCAOnC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;IAC3B,iCAAiC;kBACrB,KAAK;IAEjB,oCAAoC;oBACtB,QAAQ;IAEtB,yCAAyC;gBAC/B,QAAQ;IAKlB,uDAAuD;iBAC5C,QAAQ;IAKnB,gCAAgC;iBAExB,CAAC,OAAO,kBAAkB,EAAE,MAAM,OAAO,kBAAkB,CAAC,KACjE,QAAQ;IAKX,eAAe;eACN,QAAQ;IAKjB,mBAAmB;mBACN,QAAQ;IAKrB,sCAAsC;oBACxB,QAAQ;IAMtB,wBAAwB;uBACL,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,KAAG,QAAQ;CAItE,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -72,10 +72,6 @@ export function useCanNavigate(auth) {
|
|
|
72
72
|
const can = useAuthSafe('can');
|
|
73
73
|
return can?.navigate(auth) ?? false;
|
|
74
74
|
}
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated Use useCanNavigate instead
|
|
77
|
-
*/
|
|
78
|
-
export const useCanAccess = useCanNavigate;
|
|
79
75
|
/**
|
|
80
76
|
* Hook to get current user's role - directly from store
|
|
81
77
|
*
|
package/dist/styles/index.css
CHANGED
|
@@ -189,7 +189,6 @@
|
|
|
189
189
|
--font-size-xs: 0.75rem; /* 12px - captions, shortcuts, meta */
|
|
190
190
|
--font-size-sm: 0.875rem; /* 14px - small text, captions */
|
|
191
191
|
--font-size-base: 1rem; /* 16px - body text, DEFAULT */
|
|
192
|
-
--font-size-input: 16px; /* Form field text - hardcoded for iOS zoom + density-proof */
|
|
193
192
|
--font-size-lg: 1.25rem; /* 20px - base × 1.25¹ - emphasized text */
|
|
194
193
|
--font-size-xl: 1.563rem; /* 25px - base × 1.25² - headings */
|
|
195
194
|
--font-size-2xl: 1.953rem; /* 31px - base × 1.25³ - large headings */
|
|
@@ -443,6 +442,13 @@
|
|
|
443
442
|
); /* 32-48px fluid, 2vw floor */
|
|
444
443
|
--line-height: 1.33; /* Perfect Fourth - All text */
|
|
445
444
|
}
|
|
445
|
+
|
|
446
|
+
/* Form field text: follows density, never below 16px (iOS focus zoom).
|
|
447
|
+
Declared on [data-density] too, so nested densities resolve their own base. */
|
|
448
|
+
:root,
|
|
449
|
+
[data-density] {
|
|
450
|
+
--font-size-input: max(16px, var(--font-size-base));
|
|
451
|
+
}
|
|
446
452
|
/* 2. Theme system - color palette definitions */
|
|
447
453
|
/* packages/components/src/styles/themes.css */
|
|
448
454
|
|
|
@@ -1394,6 +1400,14 @@ em {
|
|
|
1394
1400
|
pointer-events: none;
|
|
1395
1401
|
opacity: var(--opacity-muted);
|
|
1396
1402
|
}
|
|
1403
|
+
/* Ripple clip layer (injected by JS) - contains the ripple regardless of the host's overflow */
|
|
1404
|
+
.dndev-interactive .dndev-ripple-clip {
|
|
1405
|
+
position: absolute;
|
|
1406
|
+
inset: 0;
|
|
1407
|
+
overflow: hidden;
|
|
1408
|
+
border-radius: inherit;
|
|
1409
|
+
pointer-events: none;
|
|
1410
|
+
}
|
|
1397
1411
|
/* Ripple effect element (injected by JS) */
|
|
1398
1412
|
.dndev-interactive .dndev-ripple {
|
|
1399
1413
|
position: absolute;
|
|
@@ -1402,6 +1416,9 @@ em {
|
|
|
1402
1416
|
pointer-events: none;
|
|
1403
1417
|
animation: dndev-ripple var(--dur-slow) var(--ease-in-out) forwards;
|
|
1404
1418
|
}
|
|
1419
|
+
.dndev-interactive[data-variant='ghost'],.dndev-interactive[data-variant='link'] {
|
|
1420
|
+
--ripple-opacity: 0;
|
|
1421
|
+
}
|
|
1405
1422
|
.dndev-interactive[data-display='compact'] {
|
|
1406
1423
|
width: var(--touch-target);
|
|
1407
1424
|
height: var(--touch-target);
|
|
@@ -1546,8 +1563,12 @@ em {
|
|
|
1546
1563
|
.dndev-interactive[data-role='menu-item']:focus-visible,.dndev-interactive[data-role='menu-item'][data-highlighted] {
|
|
1547
1564
|
background: rgb(from var(--primary) r g b / 0.1);
|
|
1548
1565
|
color: var(--primary);
|
|
1549
|
-
outline:
|
|
1550
|
-
|
|
1566
|
+
outline: none;
|
|
1567
|
+
box-shadow: none;
|
|
1568
|
+
}
|
|
1569
|
+
/* Items fill their clipped container: scaling would expose its edges */
|
|
1570
|
+
.dndev-interactive[data-role='menu-item']:active:not(:disabled) {
|
|
1571
|
+
transform: none;
|
|
1551
1572
|
}
|
|
1552
1573
|
.dndev-interactive[data-role='menu-item'][data-disabled] {
|
|
1553
1574
|
pointer-events: none;
|
|
@@ -4261,6 +4282,7 @@ em {
|
|
|
4261
4282
|
padding: var(--gap-sm) var(--gap-md);
|
|
4262
4283
|
cursor: pointer;
|
|
4263
4284
|
border-radius: var(--radius-interactive);
|
|
4285
|
+
font-weight: var(--font-weight-normal);
|
|
4264
4286
|
transition: background-color var(--dur-fast) var(--ease-in-out);
|
|
4265
4287
|
}
|
|
4266
4288
|
|
|
@@ -4291,7 +4313,7 @@ em {
|
|
|
4291
4313
|
}
|
|
4292
4314
|
|
|
4293
4315
|
.dndev-combobox-option-label {
|
|
4294
|
-
font-size: var(--font-size-
|
|
4316
|
+
font-size: var(--font-size-input);
|
|
4295
4317
|
color: var(--foreground);
|
|
4296
4318
|
}
|
|
4297
4319
|
|
|
@@ -6772,39 +6794,20 @@ input[type='number'] {
|
|
|
6772
6794
|
border-top-color: transparent;
|
|
6773
6795
|
}
|
|
6774
6796
|
|
|
6775
|
-
.dndev-select-trigger [data-radix-select-icon] {
|
|
6776
|
-
opacity: var(--opacity-muted);
|
|
6777
|
-
width: var(--icon-md);
|
|
6778
|
-
height: var(--icon-md);
|
|
6779
|
-
}
|
|
6780
|
-
|
|
6781
|
-
.dndev-select-trigger [data-radix-select-value] {
|
|
6782
|
-
font-size: var(--font-size-input);
|
|
6783
|
-
}
|
|
6784
|
-
|
|
6785
6797
|
.dndev-select-content {
|
|
6786
6798
|
width: var(--radix-select-trigger-width);
|
|
6787
6799
|
min-width: var(--radix-select-trigger-width);
|
|
6788
6800
|
}
|
|
6789
6801
|
|
|
6790
|
-
[data-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
padding: 0;
|
|
6794
|
-
}
|
|
6795
|
-
|
|
6796
|
-
.dndev-interactive[data-radix-select-item] {
|
|
6797
|
-
width: 100%;
|
|
6798
|
-
justify-content: flex-start;
|
|
6799
|
-
text-align: start;
|
|
6802
|
+
.dndev-select-content .dndev-interactive[data-role='menu-item'] {
|
|
6803
|
+
font-size: var(--font-size-input);
|
|
6804
|
+
font-weight: var(--font-weight-normal);
|
|
6800
6805
|
}
|
|
6801
6806
|
|
|
6802
|
-
|
|
6807
|
+
[data-radix-select-viewport] {
|
|
6803
6808
|
display: flex;
|
|
6804
6809
|
flex-direction: column;
|
|
6805
|
-
|
|
6806
|
-
text-align: start;
|
|
6807
|
-
flex: 1;
|
|
6810
|
+
padding: 0;
|
|
6808
6811
|
}
|
|
6809
6812
|
|
|
6810
6813
|
.dndev-select-item-description {
|
|
@@ -6812,20 +6815,6 @@ input[type='number'] {
|
|
|
6812
6815
|
color: var(--muted-foreground);
|
|
6813
6816
|
}
|
|
6814
6817
|
|
|
6815
|
-
.dndev-interactive[data-radix-select-item] [data-radix-select-item-indicator] {
|
|
6816
|
-
display: flex;
|
|
6817
|
-
align-items: center;
|
|
6818
|
-
justify-content: center;
|
|
6819
|
-
color: currentColor;
|
|
6820
|
-
}
|
|
6821
|
-
|
|
6822
|
-
.dndev-interactive[data-radix-select-item]
|
|
6823
|
-
[data-radix-select-item-indicator]
|
|
6824
|
-
svg {
|
|
6825
|
-
width: 1rem;
|
|
6826
|
-
height: 1rem;
|
|
6827
|
-
}
|
|
6828
|
-
|
|
6829
6818
|
/* packages/components/src/atomic/ScrollArea/ScrollArea.css */
|
|
6830
6819
|
|
|
6831
6820
|
.dndev-scroll-area {
|
|
@@ -7972,9 +7961,9 @@ input[type='number'] {
|
|
|
7972
7961
|
overflow: hidden;
|
|
7973
7962
|
}
|
|
7974
7963
|
|
|
7975
|
-
/* Default: show overflow when wrap is enabled (allows wrapping) */
|
|
7964
|
+
/* Default: show overflow when wrap is enabled (allows wrapping); interactive elements keep their own clipping */
|
|
7976
7965
|
|
|
7977
|
-
.dndev-stack[data-direction='row'][data-wrap='wrap']:not([data-overflow]) >
|
|
7966
|
+
.dndev-stack[data-direction='row'][data-wrap='wrap']:not([data-overflow]) > *:not(.dndev-interactive),.dndev-stack[data-direction='row'][data-wrap='wrap-reverse']:not([data-overflow]) > *:not(.dndev-interactive) {
|
|
7978
7967
|
overflow: visible;
|
|
7979
7968
|
}
|
|
7980
7969
|
|
|
@@ -10467,11 +10456,11 @@ input[type='number'] {
|
|
|
10467
10456
|
/* ========== RIPPLE EFFECT ========== */
|
|
10468
10457
|
@keyframes dndev-ripple {
|
|
10469
10458
|
0% {
|
|
10470
|
-
transform:
|
|
10459
|
+
transform: scale(0);
|
|
10471
10460
|
opacity: var(--ripple-opacity);
|
|
10472
10461
|
}
|
|
10473
10462
|
100% {
|
|
10474
|
-
transform:
|
|
10463
|
+
transform: scale(4);
|
|
10475
10464
|
opacity: 0;
|
|
10476
10465
|
}
|
|
10477
10466
|
}
|