@asteby/metacore-ui 0.6.0 → 2.0.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/get-initials.d.ts +19 -0
- package/dist/lib/get-initials.d.ts.map +1 -0
- package/dist/lib/get-initials.js +31 -0
- package/dist/lib/get-initials.js.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/shared/coming-soon.d.ts +19 -0
- package/dist/shared/coming-soon.d.ts.map +1 -0
- package/dist/shared/coming-soon.js +26 -0
- package/dist/shared/coming-soon.js.map +1 -0
- package/dist/shared/date-picker.d.ts +8 -0
- package/dist/shared/date-picker.d.ts.map +1 -0
- package/dist/shared/date-picker.js +10 -0
- package/dist/shared/date-picker.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/search.d.ts +18 -0
- package/dist/shared/search.d.ts.map +1 -0
- package/dist/shared/search.js +16 -0
- package/dist/shared/search.js.map +1 -0
- package/package.json +14 -5
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface GetInitialsOptions {
|
|
2
|
+
/** Maximum number of initials to take. Defaults to 2. */
|
|
3
|
+
max?: number;
|
|
4
|
+
/** Fallback when the input is empty / nullish. Defaults to '?'. */
|
|
5
|
+
fallback?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Returns the uppercase initials of a name. Splits on whitespace, takes the
|
|
9
|
+
* first character of each token, caps at `max` (default 2). Trims the input
|
|
10
|
+
* and returns `fallback` when the result would be empty.
|
|
11
|
+
*
|
|
12
|
+
* getInitials('Alice Johnson') // 'AJ'
|
|
13
|
+
* getInitials(' alice johnson ') // 'AJ'
|
|
14
|
+
* getInitials('Maria del Carmen', { max: 3 }) // 'MDC'
|
|
15
|
+
* getInitials('') // '?'
|
|
16
|
+
* getInitials(undefined) // '?'
|
|
17
|
+
*/
|
|
18
|
+
export declare function getInitials(name: string | null | undefined, options?: GetInitialsOptions): string;
|
|
19
|
+
//# sourceMappingURL=get-initials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-initials.d.ts","sourceRoot":"","sources":["../../src/lib/get-initials.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IAC/B,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC/B,OAAO,GAAE,kBAAuB,GACjC,MAAM,CAaR"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Tiny helper used by every avatar in the platform — chat headers, profile
|
|
2
|
+
// dropdowns, dynamic-table avatar cells, sidebar nav, etc. Lived inline in
|
|
3
|
+
// each app for too long. Centralised here so a single fix propagates.
|
|
4
|
+
/**
|
|
5
|
+
* Returns the uppercase initials of a name. Splits on whitespace, takes the
|
|
6
|
+
* first character of each token, caps at `max` (default 2). Trims the input
|
|
7
|
+
* and returns `fallback` when the result would be empty.
|
|
8
|
+
*
|
|
9
|
+
* getInitials('Alice Johnson') // 'AJ'
|
|
10
|
+
* getInitials(' alice johnson ') // 'AJ'
|
|
11
|
+
* getInitials('Maria del Carmen', { max: 3 }) // 'MDC'
|
|
12
|
+
* getInitials('') // '?'
|
|
13
|
+
* getInitials(undefined) // '?'
|
|
14
|
+
*/
|
|
15
|
+
export function getInitials(name, options = {}) {
|
|
16
|
+
const { max = 2, fallback = '?' } = options;
|
|
17
|
+
if (!name)
|
|
18
|
+
return fallback;
|
|
19
|
+
const trimmed = name.trim();
|
|
20
|
+
if (!trimmed)
|
|
21
|
+
return fallback;
|
|
22
|
+
const initials = trimmed
|
|
23
|
+
.split(/\s+/)
|
|
24
|
+
.map((part) => part[0] ?? '')
|
|
25
|
+
.filter(Boolean)
|
|
26
|
+
.slice(0, max)
|
|
27
|
+
.join('')
|
|
28
|
+
.toUpperCase();
|
|
29
|
+
return initials || fallback;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=get-initials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-initials.js","sourceRoot":"","sources":["../../src/lib/get-initials.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,2EAA2E;AAC3E,sEAAsE;AAStE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACvB,IAA+B,EAC/B,UAA8B,EAAE;IAEhC,MAAM,EAAE,GAAG,GAAG,CAAC,EAAE,QAAQ,GAAG,GAAG,EAAE,GAAG,OAAO,CAAA;IAC3C,IAAI,CAAC,IAAI;QAAE,OAAO,QAAQ,CAAA;IAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAC3B,IAAI,CAAC,OAAO;QAAE,OAAO,QAAQ,CAAA;IAC7B,MAAM,QAAQ,GAAG,OAAO;SACnB,KAAK,CAAC,KAAK,CAAC;SACZ,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAC5B,MAAM,CAAC,OAAO,CAAC;SACf,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;SACb,IAAI,CAAC,EAAE,CAAC;SACR,WAAW,EAAE,CAAA;IAClB,OAAO,QAAQ,IAAI,QAAQ,CAAA;AAC/B,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { cn, getPageNumbers, sleep } from './utils';
|
|
2
2
|
export { getCookie, setCookie, removeCookie } from './cookies';
|
|
3
3
|
export { resolveColorHex, resolveColorCss, generateBadgeStyles, } from './option-colors';
|
|
4
|
+
export { getInitials, type GetInitialsOptions } from './get-initials';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/lib/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { cn, getPageNumbers, sleep } from './utils';
|
|
2
2
|
export { getCookie, setCookie, removeCookie } from './cookies';
|
|
3
3
|
export { resolveColorHex, resolveColorCss, generateBadgeStyles, } from './option-colors';
|
|
4
|
+
export { getInitials } from './get-initials';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EACL,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,WAAW,EAA2B,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface ComingSoonProps {
|
|
2
|
+
title?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
icon?: 'construction' | 'sparkles' | 'rocket';
|
|
5
|
+
/** Additional class names to merge into the wrapping `<main>` element. */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Brand-neutral "coming soon" placeholder used by metacore apps to render
|
|
10
|
+
* routes that are not yet implemented. Translation keys live under
|
|
11
|
+
* `coming_soon.*` (`default_title`, `default_description`, `access_soon`).
|
|
12
|
+
*
|
|
13
|
+
* The component renders its own `<main>` wrapper with the same fixed-layout
|
|
14
|
+
* styling that `Main` provides in the starter, so it can be dropped directly
|
|
15
|
+
* into a route component.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ComingSoon({ title, description, icon, className, }: ComingSoonProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=coming-soon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coming-soon.d.ts","sourceRoot":"","sources":["../../src/shared/coming-soon.tsx"],"names":[],"mappings":"AAIA,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAA;IAC7C,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAqB,EACrB,SAAS,GACV,EAAE,eAAe,2CA4DjB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Construction, Sparkles, Rocket } from 'lucide-react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { cn } from '../lib/utils';
|
|
5
|
+
/**
|
|
6
|
+
* Brand-neutral "coming soon" placeholder used by metacore apps to render
|
|
7
|
+
* routes that are not yet implemented. Translation keys live under
|
|
8
|
+
* `coming_soon.*` (`default_title`, `default_description`, `access_soon`).
|
|
9
|
+
*
|
|
10
|
+
* The component renders its own `<main>` wrapper with the same fixed-layout
|
|
11
|
+
* styling that `Main` provides in the starter, so it can be dropped directly
|
|
12
|
+
* into a route component.
|
|
13
|
+
*/
|
|
14
|
+
export function ComingSoon({ title, description, icon = 'construction', className, }) {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const icons = {
|
|
17
|
+
construction: Construction,
|
|
18
|
+
sparkles: Sparkles,
|
|
19
|
+
rocket: Rocket,
|
|
20
|
+
};
|
|
21
|
+
const Icon = icons[icon];
|
|
22
|
+
const displayTitle = title || t('coming_soon.default_title');
|
|
23
|
+
const displayDescription = description || t('coming_soon.default_description');
|
|
24
|
+
return (_jsx("main", { "data-layout": 'fixed', className: cn('flex grow flex-col overflow-hidden px-4 py-6', '@7xl/content:mx-auto @7xl/content:w-full @7xl/content:max-w-7xl', className), children: _jsxs("div", { className: 'flex h-full flex-col items-center justify-center', children: [_jsxs("div", { className: 'relative', children: [_jsx("div", { className: 'absolute inset-0 blur-3xl opacity-20 bg-primary rounded-full scale-150' }), _jsx("div", { className: 'relative h-24 w-24 rounded-2xl bg-gradient-to-br from-primary/20 to-primary/5 border border-primary/20 flex items-center justify-center mb-8', children: _jsx(Icon, { className: 'h-12 w-12 text-primary' }) })] }), _jsxs("div", { className: 'text-center space-y-3 max-w-md', children: [_jsxs("h1", { className: 'text-2xl font-bold tracking-tight', children: [displayTitle, ' ', _jsx("span", { className: 'inline-block animate-bounce', children: "\uD83D\uDE80" })] }), _jsx("p", { className: 'text-muted-foreground', children: displayDescription }), _jsx("p", { className: 'text-sm text-muted-foreground/60 pt-4', children: t('coming_soon.access_soon') })] }), _jsxs("div", { className: 'flex gap-1.5 mt-8', children: [_jsx("div", { className: 'h-2 w-2 rounded-full bg-primary animate-pulse' }), _jsx("div", { className: 'h-2 w-2 rounded-full bg-primary/60 animate-pulse', style: { animationDelay: '150ms' } }), _jsx("div", { className: 'h-2 w-2 rounded-full bg-primary/30 animate-pulse', style: { animationDelay: '300ms' } })] })] }) }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=coming-soon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coming-soon.js","sourceRoot":"","sources":["../../src/shared/coming-soon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AAUjC;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,GAAG,cAAc,EACrB,SAAS,GACO;IAChB,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAE9B,MAAM,KAAK,GAAG;QACZ,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,MAAM;KACf,CAAA;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACxB,MAAM,YAAY,GAAG,KAAK,IAAI,CAAC,CAAC,2BAA2B,CAAC,CAAA;IAC5D,MAAM,kBAAkB,GACtB,WAAW,IAAI,CAAC,CAAC,iCAAiC,CAAC,CAAA;IAErD,OAAO,CACL,8BACc,OAAO,EACnB,SAAS,EAAE,EAAE,CACX,8CAA8C,EAC9C,iEAAiE,EACjE,SAAS,CACV,YAED,eAAK,SAAS,EAAC,kDAAkD,aAC/D,eAAK,SAAS,EAAC,UAAU,aAEvB,cAAK,SAAS,EAAC,wEAAwE,GAAG,EAG1F,cAAK,SAAS,EAAC,8IAA8I,YAC3J,KAAC,IAAI,IAAC,SAAS,EAAC,wBAAwB,GAAG,GACvC,IACF,EAEN,eAAK,SAAS,EAAC,gCAAgC,aAC7C,cAAI,SAAS,EAAC,mCAAmC,aAC9C,YAAY,EAAE,GAAG,EAClB,eAAM,SAAS,EAAC,6BAA6B,6BAAU,IACpD,EACL,YAAG,SAAS,EAAC,uBAAuB,YAAE,kBAAkB,GAAK,EAC7D,YAAG,SAAS,EAAC,uCAAuC,YACjD,CAAC,CAAC,yBAAyB,CAAC,GAC3B,IACA,EAGN,eAAK,SAAS,EAAC,mBAAmB,aAChC,cAAK,SAAS,EAAC,+CAA+C,GAAG,EACjE,cACE,SAAS,EAAC,kDAAkD,EAC5D,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,GAClC,EACF,cACE,SAAS,EAAC,kDAAkD,EAC5D,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,GAClC,IACE,IACF,GACD,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type DatePickerProps = {
|
|
2
|
+
selected: Date | undefined;
|
|
3
|
+
onSelect: (date: Date | undefined) => void;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function DatePicker({ selected, onSelect, placeholder, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=date-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../src/shared/date-picker.tsx"],"names":[],"mappings":"AAUA,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,IAAI,GAAG,SAAS,CAAA;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,WAA2B,GAC5B,EAAE,eAAe,2CA8BjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { format } from 'date-fns';
|
|
3
|
+
import { Calendar as CalendarIcon } from 'lucide-react';
|
|
4
|
+
import { Button } from '../primitives/button';
|
|
5
|
+
import { Calendar } from '../primitives/calendar';
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger, } from '../primitives/popover';
|
|
7
|
+
export function DatePicker({ selected, onSelect, placeholder = 'Pick a date', }) {
|
|
8
|
+
return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: 'outline', "data-empty": !selected, className: 'data-[empty=true]:text-muted-foreground w-[240px] justify-start text-start font-normal', children: [selected ? (format(selected, 'MMM d, yyyy')) : (_jsx("span", { children: placeholder })), _jsx(CalendarIcon, { className: 'ms-auto h-4 w-4 opacity-50' })] }) }), _jsx(PopoverContent, { className: 'w-auto p-0', children: _jsx(Calendar, { mode: 'single', captionLayout: 'dropdown', selected: selected, onSelect: onSelect, disabled: (date) => date > new Date() || date < new Date('1900-01-01') }) })] }));
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../src/shared/date-picker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,uBAAuB,CAAA;AAQ9B,MAAM,UAAU,UAAU,CAAC,EACzB,QAAQ,EACR,QAAQ,EACR,WAAW,GAAG,aAAa,GACX;IAChB,OAAO,CACL,MAAC,OAAO,eACN,KAAC,cAAc,IAAC,OAAO,kBACrB,MAAC,MAAM,IACL,OAAO,EAAC,SAAS,gBACL,CAAC,QAAQ,EACrB,SAAS,EAAC,wFAAwF,aAEjG,QAAQ,CAAC,CAAC,CAAC,CACV,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAChC,CAAC,CAAC,CAAC,CACF,yBAAO,WAAW,GAAQ,CAC3B,EACD,KAAC,YAAY,IAAC,SAAS,EAAC,4BAA4B,GAAG,IAChD,GACM,EACjB,KAAC,cAAc,IAAC,SAAS,EAAC,YAAY,YACpC,KAAC,QAAQ,IACP,IAAI,EAAC,QAAQ,EACb,aAAa,EAAC,UAAU,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,IAAU,EAAE,EAAE,CACvB,IAAI,GAAG,IAAI,IAAI,EAAE,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,GAEpD,GACa,IACT,CACX,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type SearchProps = {
|
|
2
|
+
className?: string;
|
|
3
|
+
type?: React.HTMLInputTypeAttribute;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Called when the user clicks the trigger. Apps typically wire this to
|
|
7
|
+
* `useSearch().setOpen(true)` from `@asteby/metacore-app-providers`, but it
|
|
8
|
+
* is left injectable so the component stays transport-agnostic.
|
|
9
|
+
*/
|
|
10
|
+
onOpen?: () => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Search trigger button rendered in app headers. Opens the consumer-provided
|
|
14
|
+
* command menu when clicked. Brand-neutral: the placeholder defaults to the
|
|
15
|
+
* `common.search` translation key.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Search({ className, placeholder, onOpen, }: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/shared/search.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,sBAAsB,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACrB,SAAc,EACd,WAAW,EACX,MAAM,GACP,EAAE,WAAW,2CAwBb"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SearchIcon } from 'lucide-react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { cn } from '../lib/utils';
|
|
5
|
+
import { Button } from '../primitives/button';
|
|
6
|
+
/**
|
|
7
|
+
* Search trigger button rendered in app headers. Opens the consumer-provided
|
|
8
|
+
* command menu when clicked. Brand-neutral: the placeholder defaults to the
|
|
9
|
+
* `common.search` translation key.
|
|
10
|
+
*/
|
|
11
|
+
export function Search({ className = '', placeholder, onOpen, }) {
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
const displayPlaceholder = placeholder || t('common.search');
|
|
14
|
+
return (_jsxs(Button, { variant: 'outline', className: cn('bg-muted/25 group text-muted-foreground hover:bg-accent relative h-8 w-full flex-1 justify-start rounded-md text-sm font-normal shadow-none sm:w-40 sm:pe-12 md:flex-none lg:w-52 xl:w-64', className), onClick: onOpen, children: [_jsx(SearchIcon, { "aria-hidden": 'true', className: 'absolute start-1.5 top-1/2 -translate-y-1/2', size: 16 }), _jsx("span", { className: 'ms-4', children: displayPlaceholder }), _jsxs("kbd", { className: 'bg-muted group-hover:bg-accent pointer-events-none absolute end-[0.3rem] top-[0.3rem] hidden h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none sm:flex', children: [_jsx("span", { className: 'text-xs', children: "\u2318" }), "K"] })] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/shared/search.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAc7C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,EACrB,SAAS,GAAG,EAAE,EACd,WAAW,EACX,MAAM,GACM;IACZ,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,kBAAkB,GAAG,WAAW,IAAI,CAAC,CAAC,eAAe,CAAC,CAAA;IAE5D,OAAO,CACL,MAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,SAAS,EAAE,EAAE,CACX,2LAA2L,EAC3L,SAAS,CACV,EACD,OAAO,EAAE,MAAM,aAEf,KAAC,UAAU,mBACG,MAAM,EAClB,SAAS,EAAC,6CAA6C,EACvD,IAAI,EAAE,EAAE,GACR,EACF,eAAM,SAAS,EAAC,MAAM,YAAE,kBAAkB,GAAQ,EAClD,eAAK,SAAS,EAAC,6MAA6M,aAC1N,eAAM,SAAS,EAAC,SAAS,uBAAS,SAC9B,IACC,CACV,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asteby/metacore-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Metacore UI kit — data-table, layout shell, command-menu, hooks y primitives shadcn reutilizables",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
"./lib": {
|
|
67
67
|
"types": "./dist/lib/index.d.ts",
|
|
68
68
|
"import": "./dist/lib/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./shared": {
|
|
71
|
+
"types": "./dist/shared/index.d.ts",
|
|
72
|
+
"import": "./dist/shared/index.js"
|
|
69
73
|
}
|
|
70
74
|
},
|
|
71
75
|
"peerDependencies": {
|
|
@@ -76,6 +80,7 @@
|
|
|
76
80
|
"@tanstack/react-table": ">=8",
|
|
77
81
|
"@tanstack/react-query": ">=5",
|
|
78
82
|
"@tanstack/react-router": ">=1.100",
|
|
83
|
+
"date-fns": ">=3",
|
|
79
84
|
"tailwindcss": ">=4"
|
|
80
85
|
},
|
|
81
86
|
"peerDependenciesMeta": {
|
|
@@ -87,6 +92,9 @@
|
|
|
87
92
|
},
|
|
88
93
|
"@tanstack/react-router": {
|
|
89
94
|
"optional": true
|
|
95
|
+
},
|
|
96
|
+
"date-fns": {
|
|
97
|
+
"optional": true
|
|
90
98
|
}
|
|
91
99
|
},
|
|
92
100
|
"dependencies": {
|
|
@@ -114,21 +122,22 @@
|
|
|
114
122
|
"clsx": "^2.1.1",
|
|
115
123
|
"cmdk": "^1.0.4",
|
|
116
124
|
"input-otp": "^1.4.2",
|
|
117
|
-
"lucide-react": "^0.
|
|
125
|
+
"lucide-react": "^1.0.0",
|
|
118
126
|
"react-day-picker": "^9.4.0",
|
|
119
|
-
"sonner": "^
|
|
120
|
-
"tailwind-merge": "^
|
|
127
|
+
"sonner": "^2.0.0",
|
|
128
|
+
"tailwind-merge": "^3.0.0"
|
|
121
129
|
},
|
|
122
130
|
"devDependencies": {
|
|
123
131
|
"@tanstack/react-query": "^5.95.0",
|
|
124
132
|
"@tanstack/react-router": "^1.168.0",
|
|
133
|
+
"date-fns": "^4.1.0",
|
|
125
134
|
"@tanstack/react-table": "^8.20.0",
|
|
126
135
|
"@types/react": "^19.0.0",
|
|
127
136
|
"@types/react-dom": "^19.0.0",
|
|
128
137
|
"react": "^19.2.4",
|
|
129
138
|
"react-dom": "^19.2.4",
|
|
130
139
|
"react-hook-form": "^7.54.0",
|
|
131
|
-
"react-i18next": "^
|
|
140
|
+
"react-i18next": "^17.0.0",
|
|
132
141
|
"tsc-alias": "^1.8.10",
|
|
133
142
|
"typescript": "^5.6.0"
|
|
134
143
|
},
|