@umituz/atomic-next 2.0.2 → 2.1.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.mts +82 -84
- package/dist/index.d.ts +82 -84
- package/dist/index.js +400 -543
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +400 -543
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -4
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { clsx } from 'clsx';
|
|
2
3
|
import { twMerge } from 'tailwind-merge';
|
|
3
4
|
import React5, { createContext, useState, useEffect, useContext } from 'react';
|
|
@@ -9,20 +10,14 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
|
9
10
|
import Image2 from 'next/image';
|
|
10
11
|
import Link from 'next/link';
|
|
11
12
|
|
|
12
|
-
/**
|
|
13
|
-
* @umituz/atomic-next
|
|
14
|
-
* Atomic design system for Next.js
|
|
15
|
-
* https://umituz.com/opensource/atomic-next
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
13
|
// src/tokens/colors/atomic-colors.ts
|
|
19
14
|
var colors = {
|
|
20
|
-
primary: "#
|
|
21
|
-
primaryLight: "#
|
|
22
|
-
primaryDark: "#
|
|
23
|
-
secondary: "#
|
|
24
|
-
secondaryLight: "#
|
|
25
|
-
secondaryDark: "#
|
|
15
|
+
primary: "#2563eb",
|
|
16
|
+
primaryLight: "#3b82f6",
|
|
17
|
+
primaryDark: "#1d4ed8",
|
|
18
|
+
secondary: "#0d9488",
|
|
19
|
+
secondaryLight: "#14b8a6",
|
|
20
|
+
secondaryDark: "#0f766e",
|
|
26
21
|
accent: "#F59E0B",
|
|
27
22
|
accentLight: "#FBBF24",
|
|
28
23
|
accentDark: "#D97706",
|
|
@@ -150,7 +145,15 @@ var AtomicSpacingCss = {
|
|
|
150
145
|
// src/tokens/typography/atomic-typography.ts
|
|
151
146
|
var typography = {
|
|
152
147
|
fontFamily: {
|
|
153
|
-
sans: [
|
|
148
|
+
sans: [
|
|
149
|
+
"Inter",
|
|
150
|
+
"system-ui",
|
|
151
|
+
"-apple-system",
|
|
152
|
+
"BlinkMacSystemFont",
|
|
153
|
+
"Segoe UI",
|
|
154
|
+
"Roboto",
|
|
155
|
+
"sans-serif"
|
|
156
|
+
],
|
|
154
157
|
serif: ["Charter", "Georgia", "Cambria", "Times New Roman", "Times", "serif"],
|
|
155
158
|
mono: ["JetBrains Mono", "Fira Code", "Consolas", "Monaco", "Courier New", "monospace"]
|
|
156
159
|
},
|
|
@@ -249,14 +252,14 @@ var AtomicShadows = {
|
|
|
249
252
|
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
250
253
|
xxl: "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
251
254
|
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
252
|
-
focusPrimary: "0 0 0 3px rgb(
|
|
253
|
-
focusSecondary: "0 0 0 3px rgb(
|
|
255
|
+
focusPrimary: "0 0 0 3px rgb(37 99 235 / 0.2)",
|
|
256
|
+
focusSecondary: "0 0 0 3px rgb(13 148 136 / 0.2)",
|
|
254
257
|
focusSuccess: "0 0 0 3px rgb(16 185 129 / 0.2)",
|
|
255
258
|
focusWarning: "0 0 0 3px rgb(245 158 11 / 0.2)",
|
|
256
259
|
focusError: "0 0 0 3px rgb(239 68 68 / 0.2)",
|
|
257
260
|
focusInfo: "0 0 0 3px rgb(59 130 246 / 0.2)",
|
|
258
|
-
glowPrimary: "0 0 20px rgb(
|
|
259
|
-
glowSecondary: "0 0 20px rgb(
|
|
261
|
+
glowPrimary: "0 0 20px rgb(37 99 235 / 0.3)",
|
|
262
|
+
glowSecondary: "0 0 20px rgb(13 148 136 / 0.3)",
|
|
260
263
|
glowSuccess: "0 0 20px rgb(16 185 129 / 0.3)",
|
|
261
264
|
glowWarning: "0 0 20px rgb(245 158 11 / 0.3)",
|
|
262
265
|
glowError: "0 0 20px rgb(239 68 68 / 0.3)",
|
|
@@ -278,10 +281,10 @@ var ShadowUtils = {
|
|
|
278
281
|
combine: (...shadows) => {
|
|
279
282
|
return shadows.map((shadow) => AtomicShadows[shadow]).join(", ");
|
|
280
283
|
},
|
|
281
|
-
focus: (color = "
|
|
284
|
+
focus: (color = "37 99 235", opacity = 0.2) => {
|
|
282
285
|
return `0 0 0 3px rgb(${color} / ${opacity})`;
|
|
283
286
|
},
|
|
284
|
-
glow: (size = 20, color = "
|
|
287
|
+
glow: (size = 20, color = "37 99 235", opacity = 0.3) => {
|
|
285
288
|
return `0 0 ${size}px rgb(${color} / ${opacity})`;
|
|
286
289
|
}
|
|
287
290
|
};
|
|
@@ -552,7 +555,7 @@ var AtomicAnimationPresets = {
|
|
|
552
555
|
duration: "normal",
|
|
553
556
|
easing: "smooth"
|
|
554
557
|
}),
|
|
555
|
-
transform: "translateY(
|
|
558
|
+
transform: "translateY(-100%)"
|
|
556
559
|
},
|
|
557
560
|
buttonHover: {
|
|
558
561
|
...AnimationUtils.transition({
|
|
@@ -833,11 +836,7 @@ var AtomicButton = React5.forwardRef(
|
|
|
833
836
|
return /* @__PURE__ */ jsxs(
|
|
834
837
|
Comp,
|
|
835
838
|
{
|
|
836
|
-
className: cn(
|
|
837
|
-
buttonVariants({ variant, size }),
|
|
838
|
-
fullWidth && "w-full",
|
|
839
|
-
className
|
|
840
|
-
),
|
|
839
|
+
className: cn(buttonVariants({ variant, size }), fullWidth && "w-full", className),
|
|
841
840
|
style: {
|
|
842
841
|
...variant === "brand" && {
|
|
843
842
|
background: "linear-gradient(to right, var(--atomic-primary), var(--atomic-secondary))"
|
|
@@ -858,17 +857,29 @@ var AtomicButton = React5.forwardRef(
|
|
|
858
857
|
)
|
|
859
858
|
}
|
|
860
859
|
),
|
|
861
|
-
!loading && leftIcon && /* @__PURE__ */ jsx(
|
|
862
|
-
"
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
860
|
+
!loading && leftIcon && /* @__PURE__ */ jsx(
|
|
861
|
+
"span",
|
|
862
|
+
{
|
|
863
|
+
className: cn(
|
|
864
|
+
"inline-flex items-center",
|
|
865
|
+
size === "sm" ? "mr-1" : "mr-2",
|
|
866
|
+
size === "sm" ? "[&>*]:h-3 [&>*]:w-3" : size === "lg" ? "[&>*]:h-5 [&>*]:w-5" : "[&>*]:h-4 [&>*]:w-4"
|
|
867
|
+
),
|
|
868
|
+
children: leftIcon
|
|
869
|
+
}
|
|
870
|
+
),
|
|
866
871
|
children,
|
|
867
|
-
!loading && rightIcon && /* @__PURE__ */ jsx(
|
|
868
|
-
"
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
+
!loading && rightIcon && /* @__PURE__ */ jsx(
|
|
873
|
+
"span",
|
|
874
|
+
{
|
|
875
|
+
className: cn(
|
|
876
|
+
"inline-flex items-center",
|
|
877
|
+
size === "sm" ? "ml-1" : "ml-2",
|
|
878
|
+
size === "sm" ? "[&>*]:h-3 [&>*]:w-3" : size === "lg" ? "[&>*]:h-5 [&>*]:w-5" : "[&>*]:h-4 [&>*]:w-4"
|
|
879
|
+
),
|
|
880
|
+
children: rightIcon
|
|
881
|
+
}
|
|
882
|
+
)
|
|
872
883
|
]
|
|
873
884
|
}
|
|
874
885
|
);
|
|
@@ -971,25 +982,22 @@ var AtomicText = React5.forwardRef(
|
|
|
971
982
|
}
|
|
972
983
|
);
|
|
973
984
|
AtomicText.displayName = "AtomicText";
|
|
974
|
-
var avatarVariants = cva(
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
xxl: "h-20 w-20",
|
|
985
|
-
xxxl: "h-24 w-24"
|
|
986
|
-
}
|
|
987
|
-
},
|
|
988
|
-
defaultVariants: {
|
|
989
|
-
size: "default"
|
|
985
|
+
var avatarVariants = cva("relative flex shrink-0 overflow-hidden rounded-full", {
|
|
986
|
+
variants: {
|
|
987
|
+
size: {
|
|
988
|
+
xs: "h-6 w-6",
|
|
989
|
+
sm: "h-8 w-8",
|
|
990
|
+
default: "h-10 w-10",
|
|
991
|
+
lg: "h-12 w-12",
|
|
992
|
+
xl: "h-16 w-16",
|
|
993
|
+
xxl: "h-20 w-20",
|
|
994
|
+
xxxl: "h-24 w-24"
|
|
990
995
|
}
|
|
996
|
+
},
|
|
997
|
+
defaultVariants: {
|
|
998
|
+
size: "default"
|
|
991
999
|
}
|
|
992
|
-
);
|
|
1000
|
+
});
|
|
993
1001
|
var avatarImageVariants = cva("aspect-square h-full w-full object-cover");
|
|
994
1002
|
var avatarFallbackVariants = cva(
|
|
995
1003
|
"flex h-full w-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground",
|
|
@@ -1045,21 +1053,8 @@ var AtomicAvatar = React5.forwardRef(
|
|
|
1045
1053
|
className: cn(avatarVariants({ size }), className),
|
|
1046
1054
|
...props,
|
|
1047
1055
|
children: [
|
|
1048
|
-
/* @__PURE__ */ jsx(
|
|
1049
|
-
|
|
1050
|
-
{
|
|
1051
|
-
className: avatarImageVariants(),
|
|
1052
|
-
src,
|
|
1053
|
-
alt
|
|
1054
|
-
}
|
|
1055
|
-
),
|
|
1056
|
-
/* @__PURE__ */ jsx(
|
|
1057
|
-
AvatarPrimitive.Fallback,
|
|
1058
|
-
{
|
|
1059
|
-
className: avatarFallbackVariants({ size }),
|
|
1060
|
-
children: fallbackElement || initials
|
|
1061
|
-
}
|
|
1062
|
-
)
|
|
1056
|
+
/* @__PURE__ */ jsx(AvatarPrimitive.Image, { className: avatarImageVariants(), src, alt }),
|
|
1057
|
+
/* @__PURE__ */ jsx(AvatarPrimitive.Fallback, { className: avatarFallbackVariants({ size }), children: fallbackElement || initials })
|
|
1063
1058
|
]
|
|
1064
1059
|
}
|
|
1065
1060
|
),
|
|
@@ -1078,14 +1073,7 @@ var AtomicAvatar = React5.forwardRef(
|
|
|
1078
1073
|
}
|
|
1079
1074
|
);
|
|
1080
1075
|
AtomicAvatar.displayName = "AtomicAvatar";
|
|
1081
|
-
var AtomicAvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1082
|
-
AvatarPrimitive.Image,
|
|
1083
|
-
{
|
|
1084
|
-
ref,
|
|
1085
|
-
className: cn(avatarImageVariants(), className),
|
|
1086
|
-
...props
|
|
1087
|
-
}
|
|
1088
|
-
));
|
|
1076
|
+
var AtomicAvatarImage = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Image, { ref, className: cn(avatarImageVariants(), className), ...props }));
|
|
1089
1077
|
AtomicAvatarImage.displayName = "AtomicAvatarImage";
|
|
1090
1078
|
var AtomicAvatarFallback = React5.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1091
1079
|
AvatarPrimitive.Fallback,
|
|
@@ -1139,112 +1127,108 @@ var imageVariants = cva("transition-all duration-200", {
|
|
|
1139
1127
|
objectPosition: "center"
|
|
1140
1128
|
}
|
|
1141
1129
|
});
|
|
1142
|
-
var AtomicImage = React5.forwardRef(
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
variants: {
|
|
1181
|
-
variant: {
|
|
1182
|
-
default: "border-border bg-card shadow-sm",
|
|
1183
|
-
elevated: "border-0 bg-card shadow-lg",
|
|
1184
|
-
outlined: "border-2 border-border bg-card shadow-none",
|
|
1185
|
-
filled: "border-0 bg-muted shadow-none"
|
|
1186
|
-
},
|
|
1187
|
-
size: {
|
|
1188
|
-
sm: "p-4",
|
|
1189
|
-
md: "p-6",
|
|
1190
|
-
lg: "p-8",
|
|
1191
|
-
xl: "p-10"
|
|
1130
|
+
var AtomicImage = React5.forwardRef(
|
|
1131
|
+
({
|
|
1132
|
+
className,
|
|
1133
|
+
containerClassName,
|
|
1134
|
+
rounded,
|
|
1135
|
+
aspectRatio,
|
|
1136
|
+
objectFit,
|
|
1137
|
+
objectPosition,
|
|
1138
|
+
enableBlur = false,
|
|
1139
|
+
placeholderSrc,
|
|
1140
|
+
...props
|
|
1141
|
+
}, ref) => {
|
|
1142
|
+
return /* @__PURE__ */ jsx(
|
|
1143
|
+
"div",
|
|
1144
|
+
{
|
|
1145
|
+
className: cn(
|
|
1146
|
+
"relative overflow-hidden",
|
|
1147
|
+
aspectRatio && imageVariants({ aspectRatio }),
|
|
1148
|
+
containerClassName
|
|
1149
|
+
),
|
|
1150
|
+
children: /* @__PURE__ */ jsx(
|
|
1151
|
+
Image2,
|
|
1152
|
+
{
|
|
1153
|
+
ref,
|
|
1154
|
+
className: cn(
|
|
1155
|
+
imageVariants({
|
|
1156
|
+
rounded,
|
|
1157
|
+
objectFit,
|
|
1158
|
+
objectPosition,
|
|
1159
|
+
aspectRatio: void 0
|
|
1160
|
+
}),
|
|
1161
|
+
className
|
|
1162
|
+
),
|
|
1163
|
+
placeholder: enableBlur || placeholderSrc ? "blur" : "empty",
|
|
1164
|
+
blurDataURL: placeholderSrc,
|
|
1165
|
+
...props
|
|
1166
|
+
}
|
|
1167
|
+
)
|
|
1192
1168
|
}
|
|
1193
|
-
|
|
1194
|
-
defaultVariants: {
|
|
1195
|
-
variant: "default",
|
|
1196
|
-
size: "md"
|
|
1197
|
-
}
|
|
1169
|
+
);
|
|
1198
1170
|
}
|
|
1199
1171
|
);
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
{
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
xl: "pb-8"
|
|
1209
|
-
}
|
|
1172
|
+
AtomicImage.displayName = "AtomicImage";
|
|
1173
|
+
var cardVariants = cva("rounded-lg border text-card-foreground", {
|
|
1174
|
+
variants: {
|
|
1175
|
+
variant: {
|
|
1176
|
+
default: "border-border bg-card shadow-sm",
|
|
1177
|
+
elevated: "border-0 bg-card shadow-lg",
|
|
1178
|
+
outlined: "border-2 border-border bg-card shadow-none",
|
|
1179
|
+
filled: "border-0 bg-muted shadow-none"
|
|
1210
1180
|
},
|
|
1211
|
-
|
|
1212
|
-
|
|
1181
|
+
size: {
|
|
1182
|
+
sm: "p-4",
|
|
1183
|
+
md: "p-6",
|
|
1184
|
+
lg: "p-8",
|
|
1185
|
+
xl: "p-10"
|
|
1213
1186
|
}
|
|
1187
|
+
},
|
|
1188
|
+
defaultVariants: {
|
|
1189
|
+
variant: "default",
|
|
1190
|
+
size: "md"
|
|
1214
1191
|
}
|
|
1215
|
-
);
|
|
1216
|
-
var
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
lg: "text-2xl",
|
|
1224
|
-
xl: "text-3xl"
|
|
1225
|
-
}
|
|
1226
|
-
},
|
|
1227
|
-
defaultVariants: {
|
|
1228
|
-
size: "md"
|
|
1192
|
+
});
|
|
1193
|
+
var cardHeaderVariants = cva("flex flex-col space-y-1.5", {
|
|
1194
|
+
variants: {
|
|
1195
|
+
size: {
|
|
1196
|
+
sm: "pb-3",
|
|
1197
|
+
md: "pb-4",
|
|
1198
|
+
lg: "pb-6",
|
|
1199
|
+
xl: "pb-8"
|
|
1229
1200
|
}
|
|
1201
|
+
},
|
|
1202
|
+
defaultVariants: {
|
|
1203
|
+
size: "md"
|
|
1230
1204
|
}
|
|
1231
|
-
);
|
|
1232
|
-
var
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
lg: "text-base",
|
|
1240
|
-
xl: "text-lg"
|
|
1241
|
-
}
|
|
1242
|
-
},
|
|
1243
|
-
defaultVariants: {
|
|
1244
|
-
size: "md"
|
|
1205
|
+
});
|
|
1206
|
+
var cardTitleVariants = cva("font-semibold leading-none tracking-tight", {
|
|
1207
|
+
variants: {
|
|
1208
|
+
size: {
|
|
1209
|
+
sm: "text-lg",
|
|
1210
|
+
md: "text-xl",
|
|
1211
|
+
lg: "text-2xl",
|
|
1212
|
+
xl: "text-3xl"
|
|
1245
1213
|
}
|
|
1214
|
+
},
|
|
1215
|
+
defaultVariants: {
|
|
1216
|
+
size: "md"
|
|
1246
1217
|
}
|
|
1247
|
-
);
|
|
1218
|
+
});
|
|
1219
|
+
var cardDescriptionVariants = cva("text-muted-foreground", {
|
|
1220
|
+
variants: {
|
|
1221
|
+
size: {
|
|
1222
|
+
sm: "text-sm",
|
|
1223
|
+
md: "text-sm",
|
|
1224
|
+
lg: "text-base",
|
|
1225
|
+
xl: "text-lg"
|
|
1226
|
+
}
|
|
1227
|
+
},
|
|
1228
|
+
defaultVariants: {
|
|
1229
|
+
size: "md"
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1248
1232
|
var cardContentVariants = cva("", {
|
|
1249
1233
|
variants: {
|
|
1250
1234
|
size: {
|
|
@@ -1258,22 +1242,19 @@ var cardContentVariants = cva("", {
|
|
|
1258
1242
|
size: "md"
|
|
1259
1243
|
}
|
|
1260
1244
|
});
|
|
1261
|
-
var cardFooterVariants = cva(
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
lg: "pt-6",
|
|
1269
|
-
xl: "pt-8"
|
|
1270
|
-
}
|
|
1271
|
-
},
|
|
1272
|
-
defaultVariants: {
|
|
1273
|
-
size: "md"
|
|
1245
|
+
var cardFooterVariants = cva("flex items-center", {
|
|
1246
|
+
variants: {
|
|
1247
|
+
size: {
|
|
1248
|
+
sm: "pt-3",
|
|
1249
|
+
md: "pt-4",
|
|
1250
|
+
lg: "pt-6",
|
|
1251
|
+
xl: "pt-8"
|
|
1274
1252
|
}
|
|
1253
|
+
},
|
|
1254
|
+
defaultVariants: {
|
|
1255
|
+
size: "md"
|
|
1275
1256
|
}
|
|
1276
|
-
);
|
|
1257
|
+
});
|
|
1277
1258
|
var AtomicCard = React5.forwardRef(
|
|
1278
1259
|
({ className, variant, size, interactive = false, fullWidth = false, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1279
1260
|
"div",
|
|
@@ -1291,58 +1272,23 @@ var AtomicCard = React5.forwardRef(
|
|
|
1291
1272
|
);
|
|
1292
1273
|
AtomicCard.displayName = "AtomicCard";
|
|
1293
1274
|
var AtomicCardHeader = React5.forwardRef(
|
|
1294
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1295
|
-
"div",
|
|
1296
|
-
{
|
|
1297
|
-
ref,
|
|
1298
|
-
className: cn(cardHeaderVariants({ size }), className),
|
|
1299
|
-
...props
|
|
1300
|
-
}
|
|
1301
|
-
)
|
|
1275
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(cardHeaderVariants({ size }), className), ...props })
|
|
1302
1276
|
);
|
|
1303
1277
|
AtomicCardHeader.displayName = "AtomicCardHeader";
|
|
1304
1278
|
var AtomicCardTitle = React5.forwardRef(
|
|
1305
|
-
({ className, size, as: Component = "h3", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1306
|
-
Component,
|
|
1307
|
-
{
|
|
1308
|
-
ref,
|
|
1309
|
-
className: cn(cardTitleVariants({ size }), className),
|
|
1310
|
-
...props
|
|
1311
|
-
}
|
|
1312
|
-
)
|
|
1279
|
+
({ className, size, as: Component = "h3", ...props }, ref) => /* @__PURE__ */ jsx(Component, { ref, className: cn(cardTitleVariants({ size }), className), ...props })
|
|
1313
1280
|
);
|
|
1314
1281
|
AtomicCardTitle.displayName = "AtomicCardTitle";
|
|
1315
1282
|
var AtomicCardDescription = React5.forwardRef(
|
|
1316
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1317
|
-
"p",
|
|
1318
|
-
{
|
|
1319
|
-
ref,
|
|
1320
|
-
className: cn(cardDescriptionVariants({ size }), className),
|
|
1321
|
-
...props
|
|
1322
|
-
}
|
|
1323
|
-
)
|
|
1283
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn(cardDescriptionVariants({ size }), className), ...props })
|
|
1324
1284
|
);
|
|
1325
1285
|
AtomicCardDescription.displayName = "AtomicCardDescription";
|
|
1326
1286
|
var AtomicCardContent = React5.forwardRef(
|
|
1327
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1328
|
-
"div",
|
|
1329
|
-
{
|
|
1330
|
-
ref,
|
|
1331
|
-
className: cn(cardContentVariants({ size }), className),
|
|
1332
|
-
...props
|
|
1333
|
-
}
|
|
1334
|
-
)
|
|
1287
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(cardContentVariants({ size }), className), ...props })
|
|
1335
1288
|
);
|
|
1336
1289
|
AtomicCardContent.displayName = "AtomicCardContent";
|
|
1337
1290
|
var AtomicCardFooter = React5.forwardRef(
|
|
1338
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1339
|
-
"div",
|
|
1340
|
-
{
|
|
1341
|
-
ref,
|
|
1342
|
-
className: cn(cardFooterVariants({ size }), className),
|
|
1343
|
-
...props
|
|
1344
|
-
}
|
|
1345
|
-
)
|
|
1291
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn(cardFooterVariants({ size }), className), ...props })
|
|
1346
1292
|
);
|
|
1347
1293
|
AtomicCardFooter.displayName = "AtomicCardFooter";
|
|
1348
1294
|
var getSpacingClass = (spacing2, prefix) => {
|
|
@@ -1509,18 +1455,30 @@ var AtomicInput = React5.forwardRef(
|
|
|
1509
1455
|
const messageText = error || success || warning || helperText;
|
|
1510
1456
|
const messageColor = error ? "text-destructive" : success ? "text-green-600 dark:text-green-400" : warning ? "text-amber-600 dark:text-amber-400" : "text-muted-foreground";
|
|
1511
1457
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-2", containerClassName), children: [
|
|
1512
|
-
label && /* @__PURE__ */ jsx(
|
|
1513
|
-
"
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1458
|
+
label && /* @__PURE__ */ jsx(
|
|
1459
|
+
"label",
|
|
1460
|
+
{
|
|
1461
|
+
className: cn(
|
|
1462
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
1463
|
+
disabled && "opacity-50",
|
|
1464
|
+
labelClassName
|
|
1465
|
+
),
|
|
1466
|
+
children: label
|
|
1467
|
+
}
|
|
1468
|
+
),
|
|
1517
1469
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1518
|
-
leftIcon && /* @__PURE__ */ jsx(
|
|
1519
|
-
"
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1470
|
+
leftIcon && /* @__PURE__ */ jsx(
|
|
1471
|
+
"div",
|
|
1472
|
+
{
|
|
1473
|
+
className: cn(
|
|
1474
|
+
"absolute left-0 top-0 h-full flex items-center justify-center",
|
|
1475
|
+
size === "sm" ? "w-8 pl-2" : size === "lg" ? "w-12 pl-4" : "w-10 pl-3",
|
|
1476
|
+
"text-muted-foreground pointer-events-none",
|
|
1477
|
+
"[&>*]:h-4 [&>*]:w-4"
|
|
1478
|
+
),
|
|
1479
|
+
children: leftIcon
|
|
1480
|
+
}
|
|
1481
|
+
),
|
|
1524
1482
|
/* @__PURE__ */ jsx(
|
|
1525
1483
|
"input",
|
|
1526
1484
|
{
|
|
@@ -1538,38 +1496,40 @@ var AtomicInput = React5.forwardRef(
|
|
|
1538
1496
|
...props
|
|
1539
1497
|
}
|
|
1540
1498
|
),
|
|
1541
|
-
(rightIcon || showClearButton || showPasswordToggleButton) && /* @__PURE__ */ jsxs(
|
|
1542
|
-
"
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1499
|
+
(rightIcon || showClearButton || showPasswordToggleButton) && /* @__PURE__ */ jsxs(
|
|
1500
|
+
"div",
|
|
1501
|
+
{
|
|
1502
|
+
className: cn(
|
|
1503
|
+
"absolute right-0 top-0 h-full flex items-center justify-center gap-1",
|
|
1504
|
+
size === "sm" ? "w-8 pr-2" : size === "lg" ? "w-12 pr-4" : "w-10 pr-3"
|
|
1505
|
+
),
|
|
1506
|
+
children: [
|
|
1507
|
+
rightIcon && !showClearButton && !showPasswordToggleButton && /* @__PURE__ */ jsx("div", { className: "text-muted-foreground [&>*]:h-4 [&>*]:w-4", children: rightIcon }),
|
|
1508
|
+
showClearButton && /* @__PURE__ */ jsx(
|
|
1509
|
+
"button",
|
|
1510
|
+
{
|
|
1511
|
+
type: "button",
|
|
1512
|
+
onClick: handleClear,
|
|
1513
|
+
className: "text-muted-foreground hover:text-foreground transition-colors [&>*]:h-4 [&>*]:w-4",
|
|
1514
|
+
tabIndex: -1,
|
|
1515
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
1516
|
+
}
|
|
1517
|
+
),
|
|
1518
|
+
showPasswordToggleButton && /* @__PURE__ */ jsx(
|
|
1519
|
+
"button",
|
|
1520
|
+
{
|
|
1521
|
+
type: "button",
|
|
1522
|
+
onClick: () => setShowPassword(!showPassword),
|
|
1523
|
+
className: "text-muted-foreground hover:text-foreground transition-colors [&>*]:h-4 [&>*]:w-4",
|
|
1524
|
+
tabIndex: -1,
|
|
1525
|
+
children: showPassword ? /* @__PURE__ */ jsx(EyeOff, {}) : /* @__PURE__ */ jsx(Eye, {})
|
|
1526
|
+
}
|
|
1527
|
+
)
|
|
1528
|
+
]
|
|
1529
|
+
}
|
|
1530
|
+
)
|
|
1567
1531
|
] }),
|
|
1568
|
-
messageText && /* @__PURE__ */ jsx("p", { className: cn(
|
|
1569
|
-
"text-xs",
|
|
1570
|
-
messageColor,
|
|
1571
|
-
helperClassName
|
|
1572
|
-
), children: messageText })
|
|
1532
|
+
messageText && /* @__PURE__ */ jsx("p", { className: cn("text-xs", messageColor, helperClassName), children: messageText })
|
|
1573
1533
|
] });
|
|
1574
1534
|
}
|
|
1575
1535
|
);
|
|
@@ -1653,7 +1613,8 @@ var AtomicCheckbox = React5.forwardRef(
|
|
|
1653
1613
|
id,
|
|
1654
1614
|
...rest
|
|
1655
1615
|
}, ref) => {
|
|
1656
|
-
const
|
|
1616
|
+
const generatedId = React5.useId();
|
|
1617
|
+
const checkboxId = id || `checkbox-${generatedId}`;
|
|
1657
1618
|
const sizeClasses = getSizeClasses(size);
|
|
1658
1619
|
const colorClasses = getColorClasses(color, error);
|
|
1659
1620
|
const handleChange = (event) => {
|
|
@@ -1733,10 +1694,7 @@ var AtomicCheckbox = React5.forwardRef(
|
|
|
1733
1694
|
children: label
|
|
1734
1695
|
}
|
|
1735
1696
|
),
|
|
1736
|
-
description && /* @__PURE__ */ jsx("p", { className: cn(
|
|
1737
|
-
"text-sm leading-5",
|
|
1738
|
-
error ? "text-red-600" : "text-gray-500"
|
|
1739
|
-
), children: description }),
|
|
1697
|
+
description && /* @__PURE__ */ jsx("p", { className: cn("text-sm leading-5", error ? "text-red-600" : "text-gray-500"), children: description }),
|
|
1740
1698
|
error && errorMessage && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-red-600", children: errorMessage })
|
|
1741
1699
|
] })
|
|
1742
1700
|
] });
|
|
@@ -1825,7 +1783,8 @@ var AtomicSwitch = React5.forwardRef(
|
|
|
1825
1783
|
id,
|
|
1826
1784
|
...rest
|
|
1827
1785
|
}, ref) => {
|
|
1828
|
-
const
|
|
1786
|
+
const generatedId = React5.useId();
|
|
1787
|
+
const switchId = id || `switch-${generatedId}`;
|
|
1829
1788
|
const sizeClasses = getSizeClasses2(size);
|
|
1830
1789
|
const colorClasses = getColorClasses2(color, checked);
|
|
1831
1790
|
const handleChange = (event) => {
|
|
@@ -1898,10 +1857,7 @@ var AtomicSwitch = React5.forwardRef(
|
|
|
1898
1857
|
}
|
|
1899
1858
|
) })
|
|
1900
1859
|
] });
|
|
1901
|
-
const labelElement = (label || description) && /* @__PURE__ */ jsxs("div", { className: cn(
|
|
1902
|
-
"flex-1",
|
|
1903
|
-
labelPosition === "left" ? "mr-3" : "ml-3"
|
|
1904
|
-
), children: [
|
|
1860
|
+
const labelElement = (label || description) && /* @__PURE__ */ jsxs("div", { className: cn("flex-1", labelPosition === "left" ? "mr-3" : "ml-3"), children: [
|
|
1905
1861
|
label && /* @__PURE__ */ jsx(
|
|
1906
1862
|
"label",
|
|
1907
1863
|
{
|
|
@@ -1950,71 +1906,34 @@ var spinnerVariants = cva("animate-spin", {
|
|
|
1950
1906
|
}
|
|
1951
1907
|
});
|
|
1952
1908
|
var AtomicSpinner = React5.forwardRef(
|
|
1953
|
-
({
|
|
1954
|
-
className,
|
|
1955
|
-
size,
|
|
1956
|
-
color,
|
|
1957
|
-
label,
|
|
1958
|
-
inline = false,
|
|
1959
|
-
icon: Icon = Loader2,
|
|
1960
|
-
...props
|
|
1961
|
-
}, ref) => {
|
|
1962
|
-
const spinner = /* @__PURE__ */ jsx(
|
|
1963
|
-
Icon,
|
|
1964
|
-
{
|
|
1965
|
-
ref,
|
|
1966
|
-
className: cn(spinnerVariants({ size, color }), className),
|
|
1967
|
-
...props
|
|
1968
|
-
}
|
|
1969
|
-
);
|
|
1909
|
+
({ className, size, color, label, inline = false, icon: Icon = Loader2, ...props }, ref) => {
|
|
1910
|
+
const spinner = /* @__PURE__ */ jsx(Icon, { ref, className: cn(spinnerVariants({ size, color }), className), ...props });
|
|
1970
1911
|
if (!label) {
|
|
1971
1912
|
return spinner;
|
|
1972
1913
|
}
|
|
1973
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
1974
|
-
"flex items-center gap-2",
|
|
1975
|
-
inline ? "inline-flex" : "flex"
|
|
1976
|
-
), children: [
|
|
1914
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", inline ? "inline-flex" : "flex"), children: [
|
|
1977
1915
|
spinner,
|
|
1978
|
-
/* @__PURE__ */ jsx(
|
|
1979
|
-
"
|
|
1980
|
-
|
|
1981
|
-
|
|
1916
|
+
/* @__PURE__ */ jsx(
|
|
1917
|
+
"span",
|
|
1918
|
+
{
|
|
1919
|
+
className: cn(
|
|
1920
|
+
"text-sm",
|
|
1921
|
+
color === "muted" ? "text-muted-foreground" : color === "white" ? "text-white" : color === "primary" ? "text-primary" : "text-foreground"
|
|
1922
|
+
),
|
|
1923
|
+
children: label
|
|
1924
|
+
}
|
|
1925
|
+
)
|
|
1982
1926
|
] });
|
|
1983
1927
|
}
|
|
1984
1928
|
);
|
|
1985
1929
|
AtomicSpinner.displayName = "AtomicSpinner";
|
|
1986
|
-
var AtomicButtonSpinner = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1987
|
-
AtomicSpinner,
|
|
1988
|
-
{
|
|
1989
|
-
ref,
|
|
1990
|
-
size: "sm",
|
|
1991
|
-
color: "white",
|
|
1992
|
-
className: cn("mr-2", className),
|
|
1993
|
-
...props
|
|
1994
|
-
}
|
|
1995
|
-
));
|
|
1930
|
+
var AtomicButtonSpinner = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AtomicSpinner, { ref, size: "sm", color: "white", className: cn("mr-2", className), ...props }));
|
|
1996
1931
|
AtomicButtonSpinner.displayName = "AtomicButtonSpinner";
|
|
1997
|
-
var AtomicPageSpinner = React5.forwardRef(
|
|
1998
|
-
AtomicSpinner,
|
|
1999
|
-
|
|
2000
|
-
ref,
|
|
2001
|
-
size: "lg",
|
|
2002
|
-
className,
|
|
2003
|
-
...props
|
|
2004
|
-
}
|
|
2005
|
-
) }));
|
|
1932
|
+
var AtomicPageSpinner = React5.forwardRef(
|
|
1933
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ jsx(AtomicSpinner, { ref, size: "lg", className, ...props }) })
|
|
1934
|
+
);
|
|
2006
1935
|
AtomicPageSpinner.displayName = "AtomicPageSpinner";
|
|
2007
|
-
var AtomicInlineSpinner = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2008
|
-
AtomicSpinner,
|
|
2009
|
-
{
|
|
2010
|
-
ref,
|
|
2011
|
-
inline: true,
|
|
2012
|
-
size: "sm",
|
|
2013
|
-
color: "muted",
|
|
2014
|
-
className,
|
|
2015
|
-
...props
|
|
2016
|
-
}
|
|
2017
|
-
));
|
|
1936
|
+
var AtomicInlineSpinner = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AtomicSpinner, { ref, inline: true, size: "sm", color: "muted", className, ...props }));
|
|
2018
1937
|
AtomicInlineSpinner.displayName = "AtomicInlineSpinner";
|
|
2019
1938
|
var badgeVariants = cva(
|
|
2020
1939
|
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
@@ -2065,59 +1984,52 @@ var AtomicBadge = React5.forwardRef(
|
|
|
2065
1984
|
...props
|
|
2066
1985
|
}, ref) => {
|
|
2067
1986
|
const iconSize = size === "sm" ? "h-3 w-3" : size === "lg" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
1987
|
+
const iconClasses = size === "sm" ? "[&>*]:h-3 [&>*]:w-3" : size === "lg" ? "[&>*]:h-4 [&>*]:w-4" : "[&>*]:h-3.5 [&>*]:w-3.5";
|
|
2068
1988
|
const dotSize = size === "sm" ? "h-1.5 w-1.5" : size === "lg" ? "h-2.5 w-2.5" : "h-2 w-2";
|
|
2069
|
-
return /* @__PURE__ */ jsxs(
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
"span",
|
|
2078
|
-
{
|
|
2079
|
-
className: cn(
|
|
2080
|
-
"mr-1.5 rounded-full",
|
|
2081
|
-
dotSize,
|
|
2082
|
-
!dotColor && (variant === "success" ? "bg-green-600" : variant === "warning" ? "bg-amber-600" : variant === "info" ? "bg-blue-600" : variant === "destructive" ? "bg-red-600" : variant === "gray" ? "bg-gray-600" : "bg-current")
|
|
2083
|
-
),
|
|
2084
|
-
style: dotColor ? { backgroundColor: dotColor } : void 0
|
|
2085
|
-
}
|
|
1989
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn(badgeVariants({ variant, size, shape }), className), ...props, children: [
|
|
1990
|
+
dot && /* @__PURE__ */ jsx(
|
|
1991
|
+
"span",
|
|
1992
|
+
{
|
|
1993
|
+
className: cn(
|
|
1994
|
+
"mr-1.5 rounded-full",
|
|
1995
|
+
dotSize,
|
|
1996
|
+
!dotColor && (variant === "success" ? "bg-green-600" : variant === "warning" ? "bg-amber-600" : variant === "info" ? "bg-blue-600" : variant === "destructive" ? "bg-red-600" : variant === "gray" ? "bg-gray-600" : "bg-current")
|
|
2086
1997
|
),
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
1998
|
+
style: dotColor ? { backgroundColor: dotColor } : void 0
|
|
1999
|
+
}
|
|
2000
|
+
),
|
|
2001
|
+
leftIcon && /* @__PURE__ */ jsx("span", { className: cn("mr-1 flex items-center", iconClasses), children: leftIcon }),
|
|
2002
|
+
children,
|
|
2003
|
+
rightIcon && !removable && /* @__PURE__ */ jsx("span", { className: cn("ml-1 flex items-center", iconClasses), children: rightIcon }),
|
|
2004
|
+
removable && /* @__PURE__ */ jsx(
|
|
2005
|
+
"button",
|
|
2006
|
+
{
|
|
2007
|
+
type: "button",
|
|
2008
|
+
onClick: onRemove,
|
|
2009
|
+
className: cn(
|
|
2010
|
+
"ml-1 flex items-center rounded-full hover:bg-black/10 dark:hover:bg-white/10",
|
|
2011
|
+
"transition-colors focus:outline-none focus:ring-1 focus:ring-current",
|
|
2012
|
+
size === "sm" ? "p-0.5" : "p-1"
|
|
2013
|
+
),
|
|
2014
|
+
children: removeIcon ? /* @__PURE__ */ jsx("span", { className: cn("flex items-center", iconClasses), children: removeIcon }) : /* @__PURE__ */ jsxs(
|
|
2015
|
+
"svg",
|
|
2092
2016
|
{
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
children:
|
|
2101
|
-
"
|
|
2102
|
-
{
|
|
2103
|
-
|
|
2104
|
-
viewBox: "0 0 24 24",
|
|
2105
|
-
fill: "none",
|
|
2106
|
-
stroke: "currentColor",
|
|
2107
|
-
strokeWidth: "2",
|
|
2108
|
-
strokeLinecap: "round",
|
|
2109
|
-
strokeLinejoin: "round",
|
|
2110
|
-
children: [
|
|
2111
|
-
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2112
|
-
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2113
|
-
]
|
|
2114
|
-
}
|
|
2115
|
-
)
|
|
2017
|
+
className: iconSize,
|
|
2018
|
+
viewBox: "0 0 24 24",
|
|
2019
|
+
fill: "none",
|
|
2020
|
+
stroke: "currentColor",
|
|
2021
|
+
strokeWidth: "2",
|
|
2022
|
+
strokeLinecap: "round",
|
|
2023
|
+
strokeLinejoin: "round",
|
|
2024
|
+
children: [
|
|
2025
|
+
/* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2026
|
+
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2027
|
+
]
|
|
2116
2028
|
}
|
|
2117
2029
|
)
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
);
|
|
2030
|
+
}
|
|
2031
|
+
)
|
|
2032
|
+
] });
|
|
2121
2033
|
}
|
|
2122
2034
|
);
|
|
2123
2035
|
AtomicBadge.displayName = "AtomicBadge";
|
|
@@ -2129,31 +2041,13 @@ var AtomicStatusBadge = React5.forwardRef(({ status, variant, ...props }, ref) =
|
|
|
2129
2041
|
away: { variant: "warning", dot: true, children: "Away" }
|
|
2130
2042
|
};
|
|
2131
2043
|
const config = statusConfig[status];
|
|
2132
|
-
return /* @__PURE__ */ jsx(
|
|
2133
|
-
AtomicBadge,
|
|
2134
|
-
{
|
|
2135
|
-
ref,
|
|
2136
|
-
variant: variant || config.variant,
|
|
2137
|
-
dot: config.dot,
|
|
2138
|
-
...props,
|
|
2139
|
-
children: props.children || config.children
|
|
2140
|
-
}
|
|
2141
|
-
);
|
|
2044
|
+
return /* @__PURE__ */ jsx(AtomicBadge, { ref, variant: variant || config.variant, dot: config.dot, ...props, children: props.children || config.children });
|
|
2142
2045
|
});
|
|
2143
2046
|
AtomicStatusBadge.displayName = "AtomicStatusBadge";
|
|
2144
2047
|
var AtomicCountBadge = React5.forwardRef(({ count, max = 99, ...props }, ref) => {
|
|
2145
2048
|
const displayCount = count > max ? `${max}+` : count.toString();
|
|
2146
2049
|
if (count <= 0) return null;
|
|
2147
|
-
return /* @__PURE__ */ jsx(
|
|
2148
|
-
AtomicBadge,
|
|
2149
|
-
{
|
|
2150
|
-
ref,
|
|
2151
|
-
variant: "destructive",
|
|
2152
|
-
size: "sm",
|
|
2153
|
-
...props,
|
|
2154
|
-
children: displayCount
|
|
2155
|
-
}
|
|
2156
|
-
);
|
|
2050
|
+
return /* @__PURE__ */ jsx(AtomicBadge, { ref, variant: "destructive", size: "sm", ...props, children: displayCount });
|
|
2157
2051
|
});
|
|
2158
2052
|
AtomicCountBadge.displayName = "AtomicCountBadge";
|
|
2159
2053
|
var getSpacingClass4 = (spacing2, prefix) => {
|
|
@@ -2259,27 +2153,9 @@ var AtomicTag = React5.forwardRef(
|
|
|
2259
2153
|
className
|
|
2260
2154
|
);
|
|
2261
2155
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2262
|
-
LeftIcon && /* @__PURE__ */ jsx(
|
|
2263
|
-
LeftIcon,
|
|
2264
|
-
{
|
|
2265
|
-
size: iconSize,
|
|
2266
|
-
className: cn(
|
|
2267
|
-
"flex-shrink-0",
|
|
2268
|
-
children ? "mr-1.5" : ""
|
|
2269
|
-
)
|
|
2270
|
-
}
|
|
2271
|
-
),
|
|
2156
|
+
LeftIcon && /* @__PURE__ */ jsx(LeftIcon, { size: iconSize, className: cn("flex-shrink-0", children ? "mr-1.5" : "") }),
|
|
2272
2157
|
children && /* @__PURE__ */ jsx("span", { className: "truncate", children }),
|
|
2273
|
-
RightIcon && /* @__PURE__ */ jsx(
|
|
2274
|
-
RightIcon,
|
|
2275
|
-
{
|
|
2276
|
-
size: iconSize,
|
|
2277
|
-
className: cn(
|
|
2278
|
-
"flex-shrink-0",
|
|
2279
|
-
children ? "ml-1.5" : ""
|
|
2280
|
-
)
|
|
2281
|
-
}
|
|
2282
|
-
),
|
|
2158
|
+
RightIcon && /* @__PURE__ */ jsx(RightIcon, { size: iconSize, className: cn("flex-shrink-0", children ? "ml-1.5" : "") }),
|
|
2283
2159
|
removable && /* @__PURE__ */ jsx(
|
|
2284
2160
|
"button",
|
|
2285
2161
|
{
|
|
@@ -2296,24 +2172,15 @@ var AtomicTag = React5.forwardRef(
|
|
|
2296
2172
|
},
|
|
2297
2173
|
disabled,
|
|
2298
2174
|
"aria-label": "Remove",
|
|
2299
|
-
children: /* @__PURE__ */ jsx(
|
|
2300
|
-
"
|
|
2175
|
+
children: /* @__PURE__ */ jsx("svg", { className: "w-3 h-3", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx(
|
|
2176
|
+
"path",
|
|
2301
2177
|
{
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
children: /* @__PURE__ */ jsx(
|
|
2307
|
-
"path",
|
|
2308
|
-
{
|
|
2309
|
-
strokeLinecap: "round",
|
|
2310
|
-
strokeLinejoin: "round",
|
|
2311
|
-
strokeWidth: 2,
|
|
2312
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
2313
|
-
}
|
|
2314
|
-
)
|
|
2178
|
+
strokeLinecap: "round",
|
|
2179
|
+
strokeLinejoin: "round",
|
|
2180
|
+
strokeWidth: 2,
|
|
2181
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
2315
2182
|
}
|
|
2316
|
-
)
|
|
2183
|
+
) })
|
|
2317
2184
|
}
|
|
2318
2185
|
)
|
|
2319
2186
|
] });
|
|
@@ -2322,114 +2189,102 @@ var AtomicTag = React5.forwardRef(
|
|
|
2322
2189
|
onClick?.(e);
|
|
2323
2190
|
}
|
|
2324
2191
|
};
|
|
2325
|
-
return
|
|
2192
|
+
return React5.createElement(
|
|
2326
2193
|
Component,
|
|
2327
2194
|
{
|
|
2328
2195
|
ref,
|
|
2329
2196
|
className: classes,
|
|
2330
2197
|
onClick: clickable ? handleClick : void 0,
|
|
2331
|
-
...rest
|
|
2332
|
-
|
|
2333
|
-
|
|
2198
|
+
...rest
|
|
2199
|
+
},
|
|
2200
|
+
content
|
|
2334
2201
|
);
|
|
2335
2202
|
}
|
|
2336
2203
|
);
|
|
2337
2204
|
AtomicTag.displayName = "AtomicTag";
|
|
2338
|
-
var linkVariants = cva(
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2205
|
+
var linkVariants = cva(
|
|
2206
|
+
"transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2207
|
+
{
|
|
2208
|
+
variants: {
|
|
2209
|
+
variant: {
|
|
2210
|
+
default: "text-foreground hover:text-foreground/80",
|
|
2211
|
+
primary: "text-primary hover:text-primary/80",
|
|
2212
|
+
secondary: "text-secondary-foreground hover:text-secondary-foreground/80",
|
|
2213
|
+
muted: "text-muted-foreground hover:text-foreground",
|
|
2214
|
+
destructive: "text-destructive hover:text-destructive/80",
|
|
2215
|
+
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
2216
|
+
underline: "text-primary underline underline-offset-4 hover:text-primary/80",
|
|
2217
|
+
button: "inline-flex items-center justify-center rounded-md text-sm font-medium h-10 px-4 py-2 bg-primary text-primary-foreground hover:bg-primary/90"
|
|
2218
|
+
},
|
|
2219
|
+
size: {
|
|
2220
|
+
default: "",
|
|
2221
|
+
sm: "text-sm",
|
|
2222
|
+
lg: "text-lg",
|
|
2223
|
+
xl: "text-xl"
|
|
2224
|
+
},
|
|
2225
|
+
weight: {
|
|
2226
|
+
normal: "font-normal",
|
|
2227
|
+
medium: "font-medium",
|
|
2228
|
+
semibold: "font-semibold",
|
|
2229
|
+
bold: "font-bold"
|
|
2230
|
+
}
|
|
2355
2231
|
},
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
bold: "font-bold"
|
|
2232
|
+
defaultVariants: {
|
|
2233
|
+
variant: "default",
|
|
2234
|
+
size: "default",
|
|
2235
|
+
weight: "normal"
|
|
2361
2236
|
}
|
|
2362
|
-
},
|
|
2363
|
-
defaultVariants: {
|
|
2364
|
-
variant: "default",
|
|
2365
|
-
size: "default",
|
|
2366
|
-
weight: "normal"
|
|
2367
2237
|
}
|
|
2368
|
-
|
|
2369
|
-
var AtomicLink = React5.forwardRef(
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
href,
|
|
2380
|
-
...props
|
|
2381
|
-
}, ref) => {
|
|
2382
|
-
const isExternalUrl = typeof href === "string" && (href.startsWith("http") || href.startsWith("//"));
|
|
2383
|
-
const shouldBeExternal = external || isExternalUrl;
|
|
2384
|
-
const linkProps = {
|
|
2385
|
-
className: cn(linkVariants({ variant, size, weight }), className),
|
|
2386
|
-
ref,
|
|
2387
|
-
...props
|
|
2388
|
-
};
|
|
2389
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2238
|
+
);
|
|
2239
|
+
var AtomicLink = React5.forwardRef(
|
|
2240
|
+
({
|
|
2241
|
+
className,
|
|
2242
|
+
variant,
|
|
2243
|
+
size,
|
|
2244
|
+
weight,
|
|
2245
|
+
external = false,
|
|
2246
|
+
showExternalIcon = false,
|
|
2247
|
+
prefetch = true,
|
|
2248
|
+
externalIcon,
|
|
2390
2249
|
children,
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
{
|
|
2426
|
-
href,
|
|
2427
|
-
prefetch,
|
|
2428
|
-
...linkProps,
|
|
2429
|
-
children: content
|
|
2250
|
+
href,
|
|
2251
|
+
...props
|
|
2252
|
+
}, ref) => {
|
|
2253
|
+
const isExternalUrl = typeof href === "string" && (href.startsWith("http") || href.startsWith("//"));
|
|
2254
|
+
const shouldBeExternal = external || isExternalUrl;
|
|
2255
|
+
const linkProps = {
|
|
2256
|
+
className: cn(linkVariants({ variant, size, weight }), className),
|
|
2257
|
+
ref,
|
|
2258
|
+
...props
|
|
2259
|
+
};
|
|
2260
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2261
|
+
children,
|
|
2262
|
+
shouldBeExternal && showExternalIcon && /* @__PURE__ */ jsx("span", { className: "ml-1 inline-block", children: externalIcon || /* @__PURE__ */ jsx(
|
|
2263
|
+
"svg",
|
|
2264
|
+
{
|
|
2265
|
+
className: "h-3 w-3",
|
|
2266
|
+
fill: "none",
|
|
2267
|
+
stroke: "currentColor",
|
|
2268
|
+
viewBox: "0 0 24 24",
|
|
2269
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2270
|
+
children: /* @__PURE__ */ jsx(
|
|
2271
|
+
"path",
|
|
2272
|
+
{
|
|
2273
|
+
strokeLinecap: "round",
|
|
2274
|
+
strokeLinejoin: "round",
|
|
2275
|
+
strokeWidth: 2,
|
|
2276
|
+
d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
|
|
2277
|
+
}
|
|
2278
|
+
)
|
|
2279
|
+
}
|
|
2280
|
+
) })
|
|
2281
|
+
] });
|
|
2282
|
+
if (shouldBeExternal) {
|
|
2283
|
+
return /* @__PURE__ */ jsx("a", { href, target: "_blank", rel: "noopener noreferrer", ...linkProps, children: content });
|
|
2430
2284
|
}
|
|
2431
|
-
|
|
2432
|
-
}
|
|
2285
|
+
return /* @__PURE__ */ jsx(Link, { href, prefetch, ...linkProps, children: content });
|
|
2286
|
+
}
|
|
2287
|
+
);
|
|
2433
2288
|
AtomicLink.displayName = "AtomicLink";
|
|
2434
2289
|
var getSpacingClass5 = (spacing2, prefix) => {
|
|
2435
2290
|
if (!spacing2) return "";
|
|
@@ -2481,10 +2336,10 @@ var AtomicDiv = React5.forwardRef(
|
|
|
2481
2336
|
...rest
|
|
2482
2337
|
}, ref) => {
|
|
2483
2338
|
const classes = cn(
|
|
2484
|
-
d
|
|
2485
|
-
align && `items-${align
|
|
2486
|
-
justify && `justify-${justify
|
|
2487
|
-
flexDir && `flex-${flexDir
|
|
2339
|
+
d,
|
|
2340
|
+
align && `items-${align}`,
|
|
2341
|
+
justify && `justify-${justify}`,
|
|
2342
|
+
flexDir && `flex-${flexDir}`,
|
|
2488
2343
|
flexWrap && `flex-${flexWrap}`,
|
|
2489
2344
|
flexGrow !== void 0 && `flex-grow-${flexGrow}`,
|
|
2490
2345
|
flexShrink !== void 0 && `flex-shrink-${flexShrink}`,
|
|
@@ -2502,9 +2357,9 @@ var AtomicDiv = React5.forwardRef(
|
|
|
2502
2357
|
border === true && "border",
|
|
2503
2358
|
typeof border === "string" && border,
|
|
2504
2359
|
borderColor && `border-${borderColor}`,
|
|
2505
|
-
rounded && `rounded
|
|
2506
|
-
shadow && `shadow
|
|
2507
|
-
position
|
|
2360
|
+
rounded && `rounded-${rounded}`,
|
|
2361
|
+
shadow && `shadow-${shadow}`,
|
|
2362
|
+
position,
|
|
2508
2363
|
top !== void 0 && `top-${top}`,
|
|
2509
2364
|
right !== void 0 && `right-${right}`,
|
|
2510
2365
|
bottom !== void 0 && `bottom-${bottom}`,
|
|
@@ -2524,7 +2379,13 @@ var AtomicDiv = React5.forwardRef(
|
|
|
2524
2379
|
}
|
|
2525
2380
|
);
|
|
2526
2381
|
AtomicDiv.displayName = "AtomicDiv";
|
|
2527
|
-
var AtomicThemeProviderContext = createContext(
|
|
2382
|
+
var AtomicThemeProviderContext = createContext(
|
|
2383
|
+
void 0
|
|
2384
|
+
);
|
|
2385
|
+
var getSystemTheme = () => {
|
|
2386
|
+
if (typeof window === "undefined") return "light";
|
|
2387
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
2388
|
+
};
|
|
2528
2389
|
var AtomicThemeProvider = ({
|
|
2529
2390
|
children,
|
|
2530
2391
|
defaultTheme = "system",
|
|
@@ -2545,10 +2406,6 @@ var AtomicThemeProvider = ({
|
|
|
2545
2406
|
return defaultTheme;
|
|
2546
2407
|
});
|
|
2547
2408
|
const [actualTheme, setActualTheme] = useState("light");
|
|
2548
|
-
const getSystemTheme = () => {
|
|
2549
|
-
if (typeof window === "undefined") return "light";
|
|
2550
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
2551
|
-
};
|
|
2552
2409
|
const setTheme = (newTheme) => {
|
|
2553
2410
|
try {
|
|
2554
2411
|
localStorage.setItem(storageKey, newTheme);
|
|
@@ -2608,7 +2465,7 @@ var useAtomicTheme = () => {
|
|
|
2608
2465
|
};
|
|
2609
2466
|
|
|
2610
2467
|
// src/index.ts
|
|
2611
|
-
var VERSION = "2.
|
|
2468
|
+
var VERSION = "2.1.0";
|
|
2612
2469
|
|
|
2613
2470
|
export { AnimationUtils, AtomicAlertType, AtomicAlignment, AtomicAnimationPresets, AtomicAnimationState, AtomicAnimations, AtomicAnimationsCss, AtomicAvatar, AtomicAvatarFallback, AtomicAvatarImage, AtomicBadge, AtomicBorders, AtomicBordersCss, AtomicBreakpoint, AtomicButton, AtomicButtonSpinner, AtomicButtonVariant, AtomicCard, AtomicCardContent, AtomicCardDescription, AtomicCardFooter, AtomicCardHeader, AtomicCardTitle, AtomicCardVariant, AtomicCheckbox, AtomicColorVariant, AtomicColorsCss, AtomicCountBadge, AtomicDesignTokensCss, AtomicDirection, AtomicDiv, AtomicEnumUtils, AtomicFormFieldState, AtomicIcon, AtomicImage, AtomicInlineSpinner, AtomicInput, AtomicInputVariant, AtomicLink, AtomicLoadingState, AtomicModalSize, AtomicOrientation, AtomicPageSpinner, AtomicPosition, AtomicShadows, AtomicShadowsCss, AtomicSize, AtomicSpacingCss, AtomicSpinner, AtomicStatus, AtomicStatusBadge, AtomicSwitch, AtomicTag, AtomicText, AtomicTextVariant, AtomicThemeMode, AtomicThemeProvider, AtomicTypographyCss, BorderUtils, ShadowUtils, VERSION, avatarImageVariants, avatarVariants, badgeVariants, buttonVariants, cardDescriptionVariants, cardHeaderVariants, cardTitleVariants, cardVariants, cn, inputVariants, linkVariants, spinnerVariants, textVariants, useAtomicTheme };
|
|
2614
2471
|
//# sourceMappingURL=index.mjs.map
|