@player-ui/reference-assets-plugin-react 0.10.0-next.0 → 0.10.0-next.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/cjs/index.cjs +35 -28
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.css +125 -378
- package/dist/index.legacy-esm.js +35 -28
- package/dist/index.mjs +35 -28
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/assets/choice/Choice.tsx +4 -4
- package/src/assets/collection/Collection.tsx +1 -1
- package/src/assets/image/Image.tsx +7 -3
- package/src/assets/info/Info.tsx +8 -8
- package/src/assets/input/Input.tsx +3 -3
- package/src/assets/text/Text.tsx +1 -1
- package/src/components/Button.tsx +11 -11
- package/src/components/ChoiceItem.tsx +2 -2
- package/src/components/Input.tsx +1 -1
- package/src/components/Label.tsx +1 -1
- package/src/components/Separator.tsx +4 -2
- package/src/global.css +41 -53
|
@@ -18,7 +18,7 @@ export const Choice = (props: TransformedChoice) => {
|
|
|
18
18
|
));
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<div className="grid w-full max-w-sm items-center gap-3">
|
|
21
|
+
<div className="player-grid player-w-full player-max-w-sm player-items-center player-gap-3">
|
|
22
22
|
{title && (
|
|
23
23
|
<Label htmlFor={id}>
|
|
24
24
|
<ReactAsset {...title} />
|
|
@@ -26,7 +26,7 @@ export const Choice = (props: TransformedChoice) => {
|
|
|
26
26
|
)}
|
|
27
27
|
<div
|
|
28
28
|
id={props.id}
|
|
29
|
-
className="grid gap-2"
|
|
29
|
+
className="player-grid player-gap-2"
|
|
30
30
|
aria-invalid={Boolean(validation)}
|
|
31
31
|
aria-describedby={validation ? `${id}-validation` : undefined}
|
|
32
32
|
>
|
|
@@ -35,13 +35,13 @@ export const Choice = (props: TransformedChoice) => {
|
|
|
35
35
|
{validation && (
|
|
36
36
|
<Label
|
|
37
37
|
id={`${id}-validation`}
|
|
38
|
-
className="text-[0.8rem] font-medium text-destructive"
|
|
38
|
+
className="player-text-[0.8rem] player-font-medium player-text-destructive"
|
|
39
39
|
>
|
|
40
40
|
{validation.message}
|
|
41
41
|
</Label>
|
|
42
42
|
)}
|
|
43
43
|
{note && (
|
|
44
|
-
<Label className="text-[0.8rem] text-muted-foreground">
|
|
44
|
+
<Label className="player-text-[0.8rem] player-text-muted-foreground">
|
|
45
45
|
<ReactAsset {...note} />
|
|
46
46
|
</Label>
|
|
47
47
|
)}
|
|
@@ -4,7 +4,7 @@ import type { CollectionAsset } from "@player-ui/reference-assets-plugin";
|
|
|
4
4
|
|
|
5
5
|
export const Collection = (props: CollectionAsset) => {
|
|
6
6
|
return (
|
|
7
|
-
<div className="flex flex-col gap-4">
|
|
7
|
+
<div className="player-flex player-flex-col player-gap-4">
|
|
8
8
|
{props.label && (
|
|
9
9
|
<h3>
|
|
10
10
|
<ReactAsset {...props.label} />
|
|
@@ -6,10 +6,14 @@ export const Image = (props: TransformedImage) => {
|
|
|
6
6
|
const { metaData, caption, altText } = props;
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<figure className="figure">
|
|
10
|
-
<img
|
|
9
|
+
<figure className="player-figure">
|
|
10
|
+
<img
|
|
11
|
+
className="player-figure-img player-img-fluid"
|
|
12
|
+
src={metaData.ref}
|
|
13
|
+
alt={altText}
|
|
14
|
+
/>
|
|
11
15
|
{caption && (
|
|
12
|
-
<figcaption className="figure-caption" style={{ marginTop: 15 }}>
|
|
16
|
+
<figcaption className="player-figure-caption" style={{ marginTop: 15 }}>
|
|
13
17
|
<ReactAsset {...caption} />
|
|
14
18
|
</figcaption>
|
|
15
19
|
)}
|
package/src/assets/info/Info.tsx
CHANGED
|
@@ -6,15 +6,15 @@ import { Separator } from "../../components/Separator";
|
|
|
6
6
|
/** The info view type is used to show information to the user */
|
|
7
7
|
export const Info = (props: InfoAssetTransform) => {
|
|
8
8
|
return (
|
|
9
|
-
<div className="max-w-full">
|
|
10
|
-
<div className="flex flex-col gap-4">
|
|
9
|
+
<div className="player-max-w-full">
|
|
10
|
+
<div className="player-flex player-flex-col player-gap-4">
|
|
11
11
|
{props.title && (
|
|
12
|
-
<h1 className="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">
|
|
12
|
+
<h1 className="player-scroll-m-20 player-text-4xl player-font-extrabold player-tracking-tight lg:player-text-5xl">
|
|
13
13
|
<ReactAsset {...props.title} />
|
|
14
14
|
</h1>
|
|
15
15
|
)}
|
|
16
16
|
{props.subTitle && (
|
|
17
|
-
<h3 className="scroll-m-20 text-2xl font-semibold tracking-tight">
|
|
17
|
+
<h3 className="player-scroll-m-20 player-text-2xl player-font-semibold player-tracking-tight">
|
|
18
18
|
<ReactAsset {...props.subTitle} />
|
|
19
19
|
</h3>
|
|
20
20
|
)}
|
|
@@ -23,15 +23,15 @@ export const Info = (props: InfoAssetTransform) => {
|
|
|
23
23
|
<ReactAsset {...props.primaryInfo} />
|
|
24
24
|
</div>
|
|
25
25
|
)}
|
|
26
|
-
<div className="flex flex-col gap-4">
|
|
26
|
+
<div className="player-flex player-flex-col player-gap-4">
|
|
27
27
|
{props?.segmentedActions && <Separator />}
|
|
28
|
-
<div className="flex justify-between sm:flex-row flex-col-reverse gap-4">
|
|
29
|
-
<div className="flex gap-4">
|
|
28
|
+
<div className="player-flex player-justify-between sm:player-flex-row player-flex-col-reverse player-gap-4">
|
|
29
|
+
<div className="player-flex player-gap-4">
|
|
30
30
|
{props?.segmentedActions?.prev?.map((a) => (
|
|
31
31
|
<ReactAsset key={a.asset.id} {...a} />
|
|
32
32
|
))}
|
|
33
33
|
</div>
|
|
34
|
-
<div className="flex gap-4">
|
|
34
|
+
<div className="player-flex player-gap-4">
|
|
35
35
|
{props?.segmentedActions?.next?.map((a) => (
|
|
36
36
|
<ReactAsset key={a.asset.id} {...a} />
|
|
37
37
|
))}
|
|
@@ -12,7 +12,7 @@ export const Input = (props: TransformedInput) => {
|
|
|
12
12
|
const inputProps = useInputAsset(props);
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<div className="grid w-full max-w-sm items-center gap-1.5">
|
|
15
|
+
<div className="player-grid player-w-full player-max-w-sm player-items-center player-gap-1.5">
|
|
16
16
|
{label && (
|
|
17
17
|
<Label htmlFor={id}>
|
|
18
18
|
<ReactAsset {...label} />
|
|
@@ -27,13 +27,13 @@ export const Input = (props: TransformedInput) => {
|
|
|
27
27
|
{validation && (
|
|
28
28
|
<Label
|
|
29
29
|
id={`${id}-validation`}
|
|
30
|
-
className="text-[0.8rem] font-medium text-destructive"
|
|
30
|
+
className="player-text-[0.8rem] player-font-medium player-text-destructive"
|
|
31
31
|
>
|
|
32
32
|
{validation.message}
|
|
33
33
|
</Label>
|
|
34
34
|
)}
|
|
35
35
|
{note && (
|
|
36
|
-
<Label className="text-[0.8rem] text-muted-foreground">
|
|
36
|
+
<Label className="player-text-[0.8rem] player-text-muted-foreground">
|
|
37
37
|
<ReactAsset {...note} />
|
|
38
38
|
</Label>
|
|
39
39
|
)}
|
package/src/assets/text/Text.tsx
CHANGED
|
@@ -23,7 +23,7 @@ export const Text = (props: TextAsset) => {
|
|
|
23
23
|
if (linkModifier) {
|
|
24
24
|
return (
|
|
25
25
|
<a
|
|
26
|
-
className="underline text-blue-600 hover:text-blue-800 visited:text-purple-600"
|
|
26
|
+
className="player-underline player-text-blue-600 hover:player-text-blue-800 visited:player-text-purple-600"
|
|
27
27
|
href={linkModifier.metaData.ref}
|
|
28
28
|
>
|
|
29
29
|
{value}
|
|
@@ -4,26 +4,26 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
4
4
|
import { cn } from "../utils";
|
|
5
5
|
|
|
6
6
|
const buttonVariants = cva(
|
|
7
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
7
|
+
"player-inline-flex player-items-center player-justify-center player-whitespace-nowrap player-rounded-md player-text-sm player-font-medium player-transition-colors focus-visible:player-outline-none focus-visible:player-ring-1 focus-visible:player-ring-ring disabled:player-pointer-events-none disabled:player-opacity-50",
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default:
|
|
12
|
-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
12
|
+
"player-bg-primary player-text-primary-foreground player-shadow hover:player-bg-primary/90",
|
|
13
13
|
destructive:
|
|
14
|
-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
14
|
+
"player-bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
15
15
|
outline:
|
|
16
|
-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
16
|
+
"player-border player-border-input player-bg-background player-shadow-sm hover:player-bg-accent hover:player-text-accent-foreground",
|
|
17
17
|
secondary:
|
|
18
|
-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
19
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
18
|
+
"player-bg-secondary player-text-secondary-foreground player-shadow-sm hover:player-bg-secondary/80",
|
|
19
|
+
ghost: "hover:player-bg-accent hover:player-text-accent-foreground",
|
|
20
|
+
link: "player-text-primary player-underline-offset-4 hover:player-underline",
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
23
|
-
default: "h-9 px-4 py-2",
|
|
24
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
25
|
-
lg: "h-10 rounded-md px-8",
|
|
26
|
-
icon: "h-9 w-9",
|
|
23
|
+
default: "player-h-9 player-px-4 player-py-2",
|
|
24
|
+
sm: "player-h-8 player-rounded-md player-px-3 player-text-xs",
|
|
25
|
+
lg: "player-h-10 player-rounded-md player-px-8",
|
|
26
|
+
icon: "player-h-9 player-w-9",
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: {
|
|
@@ -12,10 +12,10 @@ export const ChoiceItem = (props: ChoiceItemProps) => {
|
|
|
12
12
|
const { label, id, ...rest } = props;
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<div className="flex items-center gap-1.5">
|
|
15
|
+
<div className="player-flex player-items-center player-gap-1.5">
|
|
16
16
|
<InputComp
|
|
17
17
|
type="radio"
|
|
18
|
-
className="h-fit w-fit shadow-none"
|
|
18
|
+
className="player-h-fit player-w-fit player-shadow-none"
|
|
19
19
|
id={id}
|
|
20
20
|
{...rest}
|
|
21
21
|
/>
|
package/src/components/Input.tsx
CHANGED
|
@@ -12,7 +12,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
12
12
|
<input
|
|
13
13
|
type={type}
|
|
14
14
|
className={cn(
|
|
15
|
-
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
|
+
"player-flex player-h-9 player-w-full player-rounded-md player-border player-border-input player-bg-transparent player-px-3 player-py-1 player-text-sm player-shadow-sm player-transition-colors file:player-border-0 file:player-bg-transparent file:player-text-sm file:player-font-medium placeholder:player-text-muted-foreground focus-visible:player-outline-none focus-visible:player-ring-1 focus-visible:player-ring-ring player-disabled:player-cursor-not-allowed disabled:player-opacity-50",
|
|
16
16
|
className,
|
|
17
17
|
)}
|
|
18
18
|
ref={ref}
|
package/src/components/Label.tsx
CHANGED
|
@@ -7,7 +7,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
7
7
|
import { cn } from "../utils";
|
|
8
8
|
|
|
9
9
|
const labelVariants = cva(
|
|
10
|
-
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
10
|
+
"player-text-sm player-font-medium player-leading-none peer-disabled:player-cursor-not-allowed peer-disabled:player-opacity-70",
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
const Label = React.forwardRef<
|
|
@@ -17,8 +17,10 @@ const Separator = React.forwardRef<
|
|
|
17
17
|
decorative={decorative}
|
|
18
18
|
orientation={orientation}
|
|
19
19
|
className={cn(
|
|
20
|
-
"shrink-0 bg-border",
|
|
21
|
-
orientation === "horizontal"
|
|
20
|
+
"player-shrink-0 player-bg-border",
|
|
21
|
+
orientation === "horizontal"
|
|
22
|
+
? "player-h-[1px] player-w-full"
|
|
23
|
+
: "player-h-full player-w-[1px]",
|
|
22
24
|
className,
|
|
23
25
|
)}
|
|
24
26
|
{...props}
|
package/src/global.css
CHANGED
|
@@ -4,80 +4,68 @@
|
|
|
4
4
|
|
|
5
5
|
@layer base {
|
|
6
6
|
:root {
|
|
7
|
-
--background: 0 0% 100%;
|
|
8
|
-
--foreground: 222.2 47.4% 11.2%;
|
|
7
|
+
--player-background: 0 0% 100%;
|
|
8
|
+
--player-foreground: 222.2 47.4% 11.2%;
|
|
9
9
|
|
|
10
|
-
--muted: 210 40% 96.1%;
|
|
11
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
10
|
+
--player-muted: 210 40% 96.1%;
|
|
11
|
+
--player-muted-foreground: 215.4 16.3% 46.9%;
|
|
12
12
|
|
|
13
|
-
--popover: 0 0% 100%;
|
|
14
|
-
--popover-foreground: 222.2 47.4% 11.2%;
|
|
13
|
+
--player-popover: 0 0% 100%;
|
|
14
|
+
--player-popover-foreground: 222.2 47.4% 11.2%;
|
|
15
15
|
|
|
16
|
-
--border: 214.3 31.8% 91.4%;
|
|
17
|
-
--input: 214.3 31.8% 91.4%;
|
|
16
|
+
--player-border: 214.3 31.8% 91.4%;
|
|
17
|
+
--player-input: 214.3 31.8% 91.4%;
|
|
18
18
|
|
|
19
|
-
--card: 0 0% 100%;
|
|
20
|
-
--card-foreground: 222.2 47.4% 11.2%;
|
|
19
|
+
--player-card: 0 0% 100%;
|
|
20
|
+
--player-card-foreground: 222.2 47.4% 11.2%;
|
|
21
21
|
|
|
22
|
-
--primary: 222.2 47.4% 11.2%;
|
|
23
|
-
--primary-foreground: 210 40% 98%;
|
|
22
|
+
--player-primary: 222.2 47.4% 11.2%;
|
|
23
|
+
--player-primary-foreground: 210 40% 98%;
|
|
24
24
|
|
|
25
|
-
--secondary: 210 40% 96.1%;
|
|
26
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
25
|
+
--player-secondary: 210 40% 96.1%;
|
|
26
|
+
--player-secondary-foreground: 222.2 47.4% 11.2%;
|
|
27
27
|
|
|
28
|
-
--accent: 210 40% 96.1%;
|
|
29
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
28
|
+
--player-accent: 210 40% 96.1%;
|
|
29
|
+
--player-accent-foreground: 222.2 47.4% 11.2%;
|
|
30
30
|
|
|
31
|
-
--destructive: 0 100% 50%;
|
|
32
|
-
--destructive-foreground: 210 40% 98%;
|
|
31
|
+
--player-destructive: 0 100% 50%;
|
|
32
|
+
--player-destructive-foreground: 210 40% 98%;
|
|
33
33
|
|
|
34
|
-
--ring: 215 20.2% 65.1%;
|
|
34
|
+
--player-ring: 215 20.2% 65.1%;
|
|
35
35
|
|
|
36
|
-
--radius: 0.5rem;
|
|
36
|
+
--player-radius: 0.5rem;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.dark {
|
|
40
|
-
--background: 224 71% 4%;
|
|
41
|
-
--foreground: 213 31% 91%;
|
|
39
|
+
.player-dark {
|
|
40
|
+
--player-background: 224 71% 4%;
|
|
41
|
+
--player-foreground: 213 31% 91%;
|
|
42
42
|
|
|
43
|
-
--muted: 223 47% 11%;
|
|
44
|
-
--muted-foreground: 215.4 16.3% 56.9%;
|
|
43
|
+
--player-muted: 223 47% 11%;
|
|
44
|
+
--player-muted-foreground: 215.4 16.3% 56.9%;
|
|
45
45
|
|
|
46
|
-
--accent: 216 34% 17%;
|
|
47
|
-
--accent-foreground: 210 40% 98%;
|
|
46
|
+
--player-accent: 216 34% 17%;
|
|
47
|
+
--player-accent-foreground: 210 40% 98%;
|
|
48
48
|
|
|
49
|
-
--popover: 224 71% 4%;
|
|
50
|
-
--popover-foreground: 215 20.2% 65.1%;
|
|
49
|
+
--player-popover: 224 71% 4%;
|
|
50
|
+
--player-popover-foreground: 215 20.2% 65.1%;
|
|
51
51
|
|
|
52
|
-
--border: 216 34% 17%;
|
|
53
|
-
--input: 216 34% 17%;
|
|
52
|
+
--player-border: 216 34% 17%;
|
|
53
|
+
--player-input: 216 34% 17%;
|
|
54
54
|
|
|
55
|
-
--card: 224 71% 4%;
|
|
56
|
-
--card-foreground: 213 31% 91%;
|
|
55
|
+
--player-card: 224 71% 4%;
|
|
56
|
+
--player-card-foreground: 213 31% 91%;
|
|
57
57
|
|
|
58
|
-
--primary: 210 40% 98%;
|
|
59
|
-
--primary-foreground: 222.2 47.4% 1.2%;
|
|
58
|
+
--player-primary: 210 40% 98%;
|
|
59
|
+
--player-primary-foreground: 222.2 47.4% 1.2%;
|
|
60
60
|
|
|
61
|
-
--secondary: 222.2 47.4% 11.2%;
|
|
62
|
-
--secondary-foreground: 210 40% 98%;
|
|
61
|
+
--player-secondary: 222.2 47.4% 11.2%;
|
|
62
|
+
--player-secondary-foreground: 210 40% 98%;
|
|
63
63
|
|
|
64
|
-
--destructive: 0 63% 31%;
|
|
65
|
-
--destructive-foreground: 210 40% 98%;
|
|
64
|
+
--player-destructive: 0 63% 31%;
|
|
65
|
+
--player-destructive-foreground: 210 40% 98%;
|
|
66
66
|
|
|
67
|
-
--ring: 216 34% 17%;
|
|
67
|
+
--player-ring: 216 34% 17%;
|
|
68
68
|
|
|
69
|
-
--radius: 0.5rem;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
@layer base {
|
|
74
|
-
* {
|
|
75
|
-
@apply border-border;
|
|
76
|
-
}
|
|
77
|
-
body {
|
|
78
|
-
@apply bg-background text-foreground;
|
|
79
|
-
font-feature-settings:
|
|
80
|
-
"rlig" 1,
|
|
81
|
-
"calt" 1;
|
|
69
|
+
--player-radius: 0.5rem;
|
|
82
70
|
}
|
|
83
71
|
}
|