@pallamart/pm-core-components 2.1.0 → 2.2.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/dist/components/internal/avatar/pm-avatar.js +2 -1
- package/dist/components/internal/badge/pm-badge.d.ts +1 -1
- package/dist/components/internal/badge/pm-badge.js +4 -1
- package/dist/components/internal/card/pm-card.js +2 -1
- package/dist/components/internal/input/pm-input.js +4 -1
- package/dist/components/internal/select/pm-select-trigger.js +2 -1
- package/dist/components/internal/skeleton/pm-skeleton.js +1 -1
- package/dist/models/internal/avatar/pm-avatar-props.d.ts +1 -0
- package/dist/models/internal/badge/pm-badge-props.d.ts +1 -0
- package/dist/models/internal/card/pm-card-props.d.ts +1 -0
- package/dist/models/internal/input/pm-input-props.d.ts +1 -0
- package/dist/models/internal/select/pm-select-trigger-props.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,5 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { PallamartClassNameService } from '@pallamart/pm-design-system';
|
|
4
4
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
5
|
-
|
|
5
|
+
import { PmSkeleton } from '../skeleton/pm-skeleton.js';
|
|
6
|
+
export const PmAvatar = React.forwardRef(({ className, isLoading = false, ...props }, ref) => isLoading ? (_jsx(PmSkeleton, { className: PallamartClassNameService.merge('h-10 w-10 shrink-0 rounded-full', className) })) : (_jsx(AvatarPrimitive.Root, { ref: ref, className: PallamartClassNameService.merge('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className), ...props })));
|
|
6
7
|
PmAvatar.displayName = AvatarPrimitive.Root.displayName;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { PmBadgeProps } from '../../../models/internal/badge/pm-badge-props.js';
|
|
2
|
-
export declare const PmBadge: ({ className, variant, ...props }: PmBadgeProps) => import("react").JSX.Element;
|
|
2
|
+
export declare const PmBadge: ({ className, isLoading, variant, ...props }: PmBadgeProps) => import("react").JSX.Element;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PallamartClassNameService } from '@pallamart/pm-design-system';
|
|
3
3
|
import { PmBadgeVariants } from '../../../constants/internal/pm-badge-variants.js';
|
|
4
|
-
|
|
4
|
+
import { PmSkeleton } from '../skeleton/pm-skeleton.js';
|
|
5
|
+
export const PmBadge = ({ className, isLoading = false, variant, ...props }) => {
|
|
6
|
+
if (isLoading)
|
|
7
|
+
return (_jsx(PmSkeleton, { className: PallamartClassNameService.merge('h-5 w-16 rounded-full', className) }));
|
|
5
8
|
return (_jsx("div", { className: PallamartClassNameService.merge(PmBadgeVariants({ variant }), className), ...props }));
|
|
6
9
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { PallamartClassNameService } from '@pallamart/pm-design-system';
|
|
4
|
-
|
|
4
|
+
import { PmSkeleton } from '../skeleton/pm-skeleton.js';
|
|
5
|
+
export const PmCard = React.forwardRef(({ className, isLoading = false, ...props }, ref) => isLoading ? (_jsx(PmSkeleton, { className: PallamartClassNameService.merge('h-40 w-full rounded-xl', className) })) : (_jsx("div", { ref: ref, className: PallamartClassNameService.merge('rounded-xl border bg-card text-card-foreground shadow', className), ...props })));
|
|
5
6
|
PmCard.displayName = 'PmCard';
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { PallamartClassNameService } from '@pallamart/pm-design-system';
|
|
4
|
-
|
|
4
|
+
import { PmSkeleton } from '../skeleton/pm-skeleton.js';
|
|
5
|
+
export const PmInput = React.forwardRef(({ className, isLoading = false, type, ...props }, ref) => {
|
|
6
|
+
if (isLoading)
|
|
7
|
+
return (_jsx(PmSkeleton, { className: PallamartClassNameService.merge('h-9 w-full rounded-md', className) }));
|
|
5
8
|
return (_jsx("input", { type: type, className: PallamartClassNameService.merge('flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm', className), ref: ref, ...props }));
|
|
6
9
|
});
|
|
7
10
|
PmInput.displayName = 'PmInput';
|
|
@@ -3,5 +3,6 @@ import * as React from 'react';
|
|
|
3
3
|
import { PallamartClassNameService } from '@pallamart/pm-design-system';
|
|
4
4
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
5
|
import { ChevronDown } from 'lucide-react';
|
|
6
|
-
|
|
6
|
+
import { PmSkeleton } from '../skeleton/pm-skeleton.js';
|
|
7
|
+
export const PmSelectTrigger = React.forwardRef(({ className, children, isLoading = false, ...props }, ref) => isLoading ? (_jsx(PmSkeleton, { className: PallamartClassNameService.merge('h-9 w-full rounded-md', className) })) : (_jsxs(SelectPrimitive.Trigger, { ref: ref, className: PallamartClassNameService.merge('flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1', className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDown, { className: 'h-4 w-4 opacity-50' }) })] })));
|
|
7
8
|
PmSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PallamartClassNameService } from '@pallamart/pm-design-system';
|
|
3
3
|
export const PmSkeleton = ({ className, ...props }) => {
|
|
4
|
-
return (_jsx("div", { className: PallamartClassNameService.merge('
|
|
4
|
+
return (_jsx("div", { className: PallamartClassNameService.merge('pm-skeleton rounded-md', className), ...props }));
|
|
5
5
|
};
|
|
@@ -2,4 +2,5 @@ import type * as React from 'react';
|
|
|
2
2
|
import type { VariantProps } from 'class-variance-authority';
|
|
3
3
|
import type { PmBadgeVariants } from '../../../constants/internal/pm-badge-variants.js';
|
|
4
4
|
export interface PmBadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof PmBadgeVariants> {
|
|
5
|
+
isLoading?: boolean;
|
|
5
6
|
}
|