@nswds/app 1.114.1 → 1.116.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/globals.css +430 -31
- package/dist/index.cjs +265 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -11
- package/dist/index.d.ts +76 -11
- package/dist/index.js +265 -79
- package/dist/index.js.map +1 -1
- package/dist/styles.css +427 -31
- package/dist/styles.css.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4177,7 +4177,7 @@ var Link = forwardRef(function Link2({ className, variant, ...props }, ref) {
|
|
|
4177
4177
|
var styles = {
|
|
4178
4178
|
base: [
|
|
4179
4179
|
// Base
|
|
4180
|
-
"relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-sm border text-base/7
|
|
4180
|
+
"relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-sm border text-base/7 font-bold transition-all",
|
|
4181
4181
|
// Focus
|
|
4182
4182
|
"focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-(--btn-bg)",
|
|
4183
4183
|
// Disabled
|
|
@@ -4424,28 +4424,17 @@ var styles = {
|
|
|
4424
4424
|
"dark:[--btn-hover-overlay:var(--color-accent-500)]/30 dark:data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10"
|
|
4425
4425
|
],
|
|
4426
4426
|
danger: [
|
|
4427
|
-
//
|
|
4428
|
-
"",
|
|
4429
|
-
|
|
4430
|
-
"",
|
|
4431
|
-
|
|
4432
|
-
"",
|
|
4433
|
-
// Dark mode states
|
|
4434
|
-
"",
|
|
4435
|
-
// Icon
|
|
4436
|
-
"",
|
|
4437
|
-
// Icon states
|
|
4438
|
-
"",
|
|
4439
|
-
// Icon dark mode
|
|
4440
|
-
"",
|
|
4441
|
-
// Icon dark mode states
|
|
4442
|
-
""
|
|
4427
|
+
// Backward-compatible alias for legacy consumers that still use `danger`.
|
|
4428
|
+
"[--btn-bg:var(--color-accent-600)] [--btn-border:var(--color-accent-600)]/90 [--btn-text:white]",
|
|
4429
|
+
"[--btn-hover-overlay:var(--color-accent-600)]/10 data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10",
|
|
4430
|
+
"dark:[--btn-bg:var(--color-accent-500)] dark:[--btn-border:var(--color-accent-500)]/90 dark:[--btn-text:white]",
|
|
4431
|
+
"dark:[--btn-hover-overlay:var(--color-accent-500)]/30 dark:data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10"
|
|
4443
4432
|
]
|
|
4444
4433
|
},
|
|
4445
4434
|
size: {
|
|
4446
|
-
default: "px-[calc(--spacing(
|
|
4447
|
-
sm: "px-[calc(--spacing(
|
|
4448
|
-
lg: "px-[calc(--spacing(
|
|
4435
|
+
default: "px-[calc(--spacing(6)-1px)] py-[calc(--spacing(4)-1px)] sm:px-[calc(--spacing(5.5)-1px)] sm:py-[calc(--spacing(3)-1px)]",
|
|
4436
|
+
sm: "px-[calc(--spacing(5)-1px)] py-[calc(--spacing(3)-1px)] sm:px-[calc(--spacing(4.5)-1px)] sm:py-[calc(--spacing(2)-1px)]",
|
|
4437
|
+
lg: "px-[calc(--spacing(7)-1px)] py-[calc(--spacing(5)-1px)] sm:px-[calc(--spacing(6.5)-1px)] sm:py-[calc(--spacing(4)-1px)]",
|
|
4449
4438
|
icon: "w-10 h-10 flex-none"
|
|
4450
4439
|
},
|
|
4451
4440
|
iconSize: {
|
|
@@ -18781,7 +18770,7 @@ function FormatToggle({ format, setFormat }) {
|
|
|
18781
18770
|
|
|
18782
18771
|
// package.json
|
|
18783
18772
|
var package_default = {
|
|
18784
|
-
version: "1.
|
|
18773
|
+
version: "1.115.0"};
|
|
18785
18774
|
var SluggerContext = React5__default.createContext(null);
|
|
18786
18775
|
function flattenText(nodes) {
|
|
18787
18776
|
if (nodes == null || typeof nodes === "boolean") return "";
|
|
@@ -19070,9 +19059,108 @@ var heroBannerVariants = cva("relative", {
|
|
|
19070
19059
|
variants: {
|
|
19071
19060
|
variant: {
|
|
19072
19061
|
"primary-800": "bg-primary-800 text-white",
|
|
19073
|
-
"
|
|
19062
|
+
"primary-600": "bg-primary-600 text-white",
|
|
19063
|
+
"primary-400": "bg-primary-400 text-primary-800",
|
|
19064
|
+
"primary-200": "bg-primary-200 text-primary-800",
|
|
19065
|
+
"grey-800": "bg-grey-800 text-white",
|
|
19066
|
+
"grey-600": "bg-grey-600 text-white",
|
|
19067
|
+
"grey-400": "bg-grey-400 text-grey-800",
|
|
19068
|
+
"grey-200": "bg-grey-200 text-grey-800",
|
|
19074
19069
|
"accent-800": "bg-accent-800 text-white",
|
|
19070
|
+
"accent-600": "bg-accent-600 text-white",
|
|
19071
|
+
"accent-400": "bg-accent-400 text-accent-800",
|
|
19072
|
+
"accent-200": "bg-accent-200 text-accent-800",
|
|
19073
|
+
white: "bg-white text-grey-800"
|
|
19074
|
+
}
|
|
19075
|
+
},
|
|
19076
|
+
defaultVariants: {
|
|
19077
|
+
variant: "primary-800"
|
|
19078
|
+
}
|
|
19079
|
+
});
|
|
19080
|
+
var heroBannerContentAlignments = {
|
|
19081
|
+
center: {
|
|
19082
|
+
content: "text-center",
|
|
19083
|
+
subtitle: "mx-auto",
|
|
19084
|
+
actions: "justify-center"
|
|
19085
|
+
},
|
|
19086
|
+
left: {
|
|
19087
|
+
content: "text-left",
|
|
19088
|
+
subtitle: "",
|
|
19089
|
+
actions: "justify-start"
|
|
19090
|
+
}
|
|
19091
|
+
};
|
|
19092
|
+
function HeroBannerSimple({
|
|
19093
|
+
variant,
|
|
19094
|
+
heading,
|
|
19095
|
+
subtitle,
|
|
19096
|
+
contentAlign = "center",
|
|
19097
|
+
primaryButton,
|
|
19098
|
+
secondaryButton
|
|
19099
|
+
}) {
|
|
19100
|
+
const alignment = heroBannerContentAlignments[contentAlign];
|
|
19101
|
+
return /* @__PURE__ */ jsx("div", { className: heroBannerVariants({ variant }), children: /* @__PURE__ */ jsx("div", { className: "px-6 py-24 sm:py-32 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: cn("mx-auto max-w-2xl", alignment.content), children: [
|
|
19102
|
+
heading && /* @__PURE__ */ jsx("h1", { className: "text-4xl font-semibold tracking-tight text-balance sm:text-6xl", children: heading }),
|
|
19103
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: cn("mt-6 max-w-xl text-lg leading-8 text-pretty", alignment.subtitle), children: subtitle }),
|
|
19104
|
+
(primaryButton || secondaryButton) && /* @__PURE__ */ jsxs(
|
|
19105
|
+
"div",
|
|
19106
|
+
{
|
|
19107
|
+
className: cn("mt-10 flex flex-wrap items-center gap-x-6 gap-y-4", alignment.actions),
|
|
19108
|
+
children: [
|
|
19109
|
+
primaryButton && (primaryButton.href ? /* @__PURE__ */ jsx(
|
|
19110
|
+
Button2,
|
|
19111
|
+
{
|
|
19112
|
+
href: primaryButton.href,
|
|
19113
|
+
variant: primaryButton.variant,
|
|
19114
|
+
color: primaryButton.color ?? void 0,
|
|
19115
|
+
children: primaryButton.text
|
|
19116
|
+
}
|
|
19117
|
+
) : /* @__PURE__ */ jsx(
|
|
19118
|
+
Button2,
|
|
19119
|
+
{
|
|
19120
|
+
onClick: primaryButton.onClick,
|
|
19121
|
+
variant: primaryButton.variant,
|
|
19122
|
+
color: primaryButton.color ?? void 0,
|
|
19123
|
+
children: primaryButton.text
|
|
19124
|
+
}
|
|
19125
|
+
)),
|
|
19126
|
+
secondaryButton && (secondaryButton.href ? /* @__PURE__ */ jsx(
|
|
19127
|
+
Button2,
|
|
19128
|
+
{
|
|
19129
|
+
href: secondaryButton.href,
|
|
19130
|
+
variant: secondaryButton.variant,
|
|
19131
|
+
color: secondaryButton.color ?? void 0,
|
|
19132
|
+
children: secondaryButton.text
|
|
19133
|
+
}
|
|
19134
|
+
) : /* @__PURE__ */ jsx(
|
|
19135
|
+
Button2,
|
|
19136
|
+
{
|
|
19137
|
+
onClick: secondaryButton.onClick,
|
|
19138
|
+
variant: secondaryButton.variant,
|
|
19139
|
+
color: secondaryButton.color ?? void 0,
|
|
19140
|
+
children: secondaryButton.text
|
|
19141
|
+
}
|
|
19142
|
+
))
|
|
19143
|
+
]
|
|
19144
|
+
}
|
|
19145
|
+
)
|
|
19146
|
+
] }) }) });
|
|
19147
|
+
}
|
|
19148
|
+
var heroBannerVariants2 = cva("relative", {
|
|
19149
|
+
variants: {
|
|
19150
|
+
variant: {
|
|
19151
|
+
"primary-800": "bg-primary-800 text-white",
|
|
19152
|
+
"primary-600": "bg-primary-600 text-white",
|
|
19153
|
+
"primary-400": "bg-primary-400 text-primary-800",
|
|
19075
19154
|
"primary-200": "bg-primary-200 text-primary-800",
|
|
19155
|
+
"grey-800": "bg-grey-800 text-white",
|
|
19156
|
+
"grey-600": "bg-grey-600 text-white",
|
|
19157
|
+
"grey-400": "bg-grey-400 text-grey-800",
|
|
19158
|
+
"grey-200": "bg-grey-200 text-grey-800",
|
|
19159
|
+
"grey-150": "bg-grey-200 text-grey-800",
|
|
19160
|
+
"accent-800": "bg-accent-800 text-white",
|
|
19161
|
+
"accent-600": "bg-accent-600 text-white",
|
|
19162
|
+
"accent-400": "bg-accent-400 text-accent-800",
|
|
19163
|
+
"accent-200": "bg-accent-200 text-accent-800",
|
|
19076
19164
|
white: "bg-white text-grey-800"
|
|
19077
19165
|
}
|
|
19078
19166
|
},
|
|
@@ -19080,6 +19168,34 @@ var heroBannerVariants = cva("relative", {
|
|
|
19080
19168
|
variant: "primary-800"
|
|
19081
19169
|
}
|
|
19082
19170
|
});
|
|
19171
|
+
var HERO_BANNER_SUPPORTING_IMAGE_DEFAULT_SPLIT = {
|
|
19172
|
+
left: 8,
|
|
19173
|
+
right: 4
|
|
19174
|
+
};
|
|
19175
|
+
var HERO_BANNER_SUPPORTING_IMAGE_COLUMN_SPANS = {
|
|
19176
|
+
1: "lg:col-span-1",
|
|
19177
|
+
2: "lg:col-span-2",
|
|
19178
|
+
3: "lg:col-span-3",
|
|
19179
|
+
4: "lg:col-span-4",
|
|
19180
|
+
5: "lg:col-span-5",
|
|
19181
|
+
6: "lg:col-span-6",
|
|
19182
|
+
7: "lg:col-span-7",
|
|
19183
|
+
8: "lg:col-span-8",
|
|
19184
|
+
9: "lg:col-span-9",
|
|
19185
|
+
10: "lg:col-span-10",
|
|
19186
|
+
11: "lg:col-span-11"
|
|
19187
|
+
};
|
|
19188
|
+
function resolveHeroBannerSupportingImageSplit(split) {
|
|
19189
|
+
if (!split) {
|
|
19190
|
+
return HERO_BANNER_SUPPORTING_IMAGE_DEFAULT_SPLIT;
|
|
19191
|
+
}
|
|
19192
|
+
const hasValidLeftSpan = split.left in HERO_BANNER_SUPPORTING_IMAGE_COLUMN_SPANS;
|
|
19193
|
+
const hasValidRightSpan = split.right in HERO_BANNER_SUPPORTING_IMAGE_COLUMN_SPANS;
|
|
19194
|
+
if (hasValidLeftSpan && hasValidRightSpan && split.left + split.right === 12) {
|
|
19195
|
+
return split;
|
|
19196
|
+
}
|
|
19197
|
+
return HERO_BANNER_SUPPORTING_IMAGE_DEFAULT_SPLIT;
|
|
19198
|
+
}
|
|
19083
19199
|
function HeroBannerSupportingImage({
|
|
19084
19200
|
variant,
|
|
19085
19201
|
imgAlt,
|
|
@@ -19087,63 +19203,96 @@ function HeroBannerSupportingImage({
|
|
|
19087
19203
|
imgBgcolor,
|
|
19088
19204
|
heading,
|
|
19089
19205
|
subtitle,
|
|
19206
|
+
split,
|
|
19090
19207
|
primaryButton,
|
|
19091
19208
|
secondaryButton
|
|
19092
19209
|
}) {
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19105
|
-
}
|
|
19106
|
-
) : /* @__PURE__ */ jsx(
|
|
19107
|
-
Button2,
|
|
19108
|
-
{
|
|
19109
|
-
onClick: primaryButton.onClick,
|
|
19110
|
-
variant: primaryButton.variant,
|
|
19111
|
-
color: primaryButton.color ?? void 0,
|
|
19112
|
-
children: primaryButton.text
|
|
19113
|
-
}
|
|
19114
|
-
)),
|
|
19115
|
-
secondaryButton && (secondaryButton.href ? /* @__PURE__ */ jsx(
|
|
19116
|
-
Button2,
|
|
19117
|
-
{
|
|
19118
|
-
href: secondaryButton.href,
|
|
19119
|
-
variant: secondaryButton.variant,
|
|
19120
|
-
color: secondaryButton.color ?? void 0,
|
|
19121
|
-
children: secondaryButton.text
|
|
19122
|
-
}
|
|
19123
|
-
) : /* @__PURE__ */ jsx(
|
|
19124
|
-
Button2,
|
|
19210
|
+
const resolvedSplit = resolveHeroBannerSupportingImageSplit(split);
|
|
19211
|
+
const textSpanClassName = HERO_BANNER_SUPPORTING_IMAGE_COLUMN_SPANS[resolvedSplit.left];
|
|
19212
|
+
const imageSpanClassName = HERO_BANNER_SUPPORTING_IMAGE_COLUMN_SPANS[resolvedSplit.right];
|
|
19213
|
+
const imageStart = `${resolvedSplit.left / 12 * 100}%`;
|
|
19214
|
+
const contentMaxWidth = `${Math.min(56, resolvedSplit.left / 8 * 42)}rem`;
|
|
19215
|
+
return /* @__PURE__ */ jsx("div", { className: heroBannerVariants2({ variant }), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-7xl lg:grid lg:grid-cols-12 lg:gap-x-8 lg:px-8", children: [
|
|
19216
|
+
/* @__PURE__ */ jsx(
|
|
19217
|
+
"div",
|
|
19218
|
+
{
|
|
19219
|
+
className: cn("px-6 pt-10 pb-24 sm:pb-32 lg:px-0 lg:pt-24 lg:pb-28", textSpanClassName),
|
|
19220
|
+
children: /* @__PURE__ */ jsxs(
|
|
19221
|
+
"div",
|
|
19125
19222
|
{
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19223
|
+
className: "mx-auto max-w-2xl lg:mx-0 lg:max-w-[var(--hero-copy-max-width)]",
|
|
19224
|
+
style: {
|
|
19225
|
+
"--hero-copy-max-width": contentMaxWidth
|
|
19226
|
+
},
|
|
19227
|
+
children: [
|
|
19228
|
+
heading && /* @__PURE__ */ jsx("h1", { className: "mt-24 text-4xl font-semibold tracking-tight text-balance sm:mt-10 sm:text-6xl", children: heading }),
|
|
19229
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "mt-6 text-lg leading-8 text-pretty", children: subtitle }),
|
|
19230
|
+
(primaryButton || secondaryButton) && /* @__PURE__ */ jsxs("div", { className: "mt-10 flex flex-wrap items-center gap-x-6 gap-y-4", children: [
|
|
19231
|
+
primaryButton && (primaryButton.href ? /* @__PURE__ */ jsx(
|
|
19232
|
+
Button2,
|
|
19233
|
+
{
|
|
19234
|
+
href: primaryButton.href,
|
|
19235
|
+
variant: primaryButton.variant,
|
|
19236
|
+
color: primaryButton.color ?? void 0,
|
|
19237
|
+
children: primaryButton.text
|
|
19238
|
+
}
|
|
19239
|
+
) : /* @__PURE__ */ jsx(
|
|
19240
|
+
Button2,
|
|
19241
|
+
{
|
|
19242
|
+
onClick: primaryButton.onClick,
|
|
19243
|
+
variant: primaryButton.variant,
|
|
19244
|
+
color: primaryButton.color ?? void 0,
|
|
19245
|
+
children: primaryButton.text
|
|
19246
|
+
}
|
|
19247
|
+
)),
|
|
19248
|
+
secondaryButton && (secondaryButton.href ? /* @__PURE__ */ jsx(
|
|
19249
|
+
Button2,
|
|
19250
|
+
{
|
|
19251
|
+
href: secondaryButton.href,
|
|
19252
|
+
variant: secondaryButton.variant,
|
|
19253
|
+
color: secondaryButton.color ?? void 0,
|
|
19254
|
+
children: secondaryButton.text
|
|
19255
|
+
}
|
|
19256
|
+
) : /* @__PURE__ */ jsx(
|
|
19257
|
+
Button2,
|
|
19258
|
+
{
|
|
19259
|
+
onClick: secondaryButton.onClick,
|
|
19260
|
+
variant: secondaryButton.variant,
|
|
19261
|
+
color: secondaryButton.color ?? void 0,
|
|
19262
|
+
children: secondaryButton.text
|
|
19263
|
+
}
|
|
19264
|
+
))
|
|
19265
|
+
] })
|
|
19266
|
+
]
|
|
19130
19267
|
}
|
|
19131
|
-
)
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
/* @__PURE__ */ jsx(
|
|
19135
|
-
|
|
19268
|
+
)
|
|
19269
|
+
}
|
|
19270
|
+
),
|
|
19271
|
+
/* @__PURE__ */ jsx(
|
|
19272
|
+
"div",
|
|
19136
19273
|
{
|
|
19137
|
-
alt: imgAlt,
|
|
19138
|
-
src: imgSrc || "/placeholder.svg",
|
|
19139
|
-
width: 800,
|
|
19140
|
-
height: 800,
|
|
19141
19274
|
className: cn(
|
|
19142
|
-
"
|
|
19143
|
-
|
|
19275
|
+
"relative lg:-mr-8 xl:absolute xl:inset-y-0 xl:right-0 xl:left-[var(--hero-image-start)] xl:mr-0",
|
|
19276
|
+
imageSpanClassName
|
|
19277
|
+
),
|
|
19278
|
+
style: {
|
|
19279
|
+
"--hero-image-start": imageStart
|
|
19280
|
+
},
|
|
19281
|
+
children: /* @__PURE__ */ jsx(
|
|
19282
|
+
Image2,
|
|
19283
|
+
{
|
|
19284
|
+
alt: imgAlt,
|
|
19285
|
+
src: imgSrc || "/placeholder.svg",
|
|
19286
|
+
width: 800,
|
|
19287
|
+
height: 800,
|
|
19288
|
+
className: cn(
|
|
19289
|
+
"aspect-[3/2] w-full object-cover lg:absolute lg:inset-0 lg:aspect-auto lg:h-full",
|
|
19290
|
+
imgBgcolor
|
|
19291
|
+
)
|
|
19292
|
+
}
|
|
19144
19293
|
)
|
|
19145
19294
|
}
|
|
19146
|
-
)
|
|
19295
|
+
)
|
|
19147
19296
|
] }) });
|
|
19148
19297
|
}
|
|
19149
19298
|
function HoverCard({ ...props }) {
|
|
@@ -33122,7 +33271,7 @@ var Tracker = React5__default.forwardRef(
|
|
|
33122
33271
|
}
|
|
33123
33272
|
);
|
|
33124
33273
|
Tracker.displayName = "Tracker";
|
|
33125
|
-
var
|
|
33274
|
+
var buttonVariants5 = cva(
|
|
33126
33275
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
33127
33276
|
{
|
|
33128
33277
|
variants: {
|
|
@@ -33159,7 +33308,7 @@ function Button7({
|
|
|
33159
33308
|
Comp,
|
|
33160
33309
|
{
|
|
33161
33310
|
"data-slot": "button",
|
|
33162
|
-
className: cn(
|
|
33311
|
+
className: cn(buttonVariants5({ variant, size, className })),
|
|
33163
33312
|
...props
|
|
33164
33313
|
}
|
|
33165
33314
|
);
|
|
@@ -35568,6 +35717,23 @@ function Input2({ className, type, ...props }) {
|
|
|
35568
35717
|
}
|
|
35569
35718
|
);
|
|
35570
35719
|
}
|
|
35720
|
+
var sanitizePreviewUrl = (value) => {
|
|
35721
|
+
if (!value) return void 0;
|
|
35722
|
+
const trimmed = value.trim();
|
|
35723
|
+
if (!trimmed) return void 0;
|
|
35724
|
+
const baseOrigin = typeof window !== "undefined" ? window.location.origin : "http://localhost";
|
|
35725
|
+
const hasExplicitScheme = /^[a-zA-Z][a-zA-Z\d+.-]*:/.test(trimmed);
|
|
35726
|
+
const isRelativeUrl = trimmed.startsWith("/") || trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("?") || trimmed.startsWith("#");
|
|
35727
|
+
const isBareHostname = !hasExplicitScheme && !isRelativeUrl && /^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)+([/:?#].*)?$/.test(trimmed);
|
|
35728
|
+
try {
|
|
35729
|
+
const parsed = hasExplicitScheme ? new URL(trimmed) : isBareHostname ? new URL(`https://${trimmed}`) : new URL(trimmed, baseOrigin);
|
|
35730
|
+
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
|
|
35731
|
+
return parsed.toString();
|
|
35732
|
+
}
|
|
35733
|
+
} catch {
|
|
35734
|
+
}
|
|
35735
|
+
return void 0;
|
|
35736
|
+
};
|
|
35571
35737
|
var WebPreviewContext = createContext(null);
|
|
35572
35738
|
var useWebPreview = () => {
|
|
35573
35739
|
const context = useContext(WebPreviewContext);
|
|
@@ -35583,11 +35749,21 @@ var WebPreview = ({
|
|
|
35583
35749
|
onUrlChange,
|
|
35584
35750
|
...props
|
|
35585
35751
|
}) => {
|
|
35586
|
-
const
|
|
35752
|
+
const initialUrl = sanitizePreviewUrl(defaultUrl) ?? "";
|
|
35753
|
+
const [url, setUrl] = useState(initialUrl);
|
|
35587
35754
|
const [consoleOpen, setConsoleOpen] = useState(false);
|
|
35588
35755
|
const handleUrlChange = (newUrl) => {
|
|
35589
|
-
|
|
35590
|
-
|
|
35756
|
+
if (!newUrl.trim()) {
|
|
35757
|
+
setUrl("");
|
|
35758
|
+
onUrlChange?.("");
|
|
35759
|
+
return;
|
|
35760
|
+
}
|
|
35761
|
+
const safeUrl = sanitizePreviewUrl(newUrl);
|
|
35762
|
+
if (safeUrl === void 0) {
|
|
35763
|
+
return;
|
|
35764
|
+
}
|
|
35765
|
+
setUrl(safeUrl);
|
|
35766
|
+
onUrlChange?.(safeUrl);
|
|
35591
35767
|
};
|
|
35592
35768
|
const contextValue = {
|
|
35593
35769
|
url,
|
|
@@ -35630,20 +35806,30 @@ var WebPreviewUrl = ({ value, onChange, onKeyDown, ...props }) => {
|
|
|
35630
35806
|
}
|
|
35631
35807
|
);
|
|
35632
35808
|
};
|
|
35633
|
-
var WebPreviewBody = ({
|
|
35809
|
+
var WebPreviewBody = ({
|
|
35810
|
+
className,
|
|
35811
|
+
loading,
|
|
35812
|
+
loadingFallback,
|
|
35813
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35814
|
+
sandbox: _sandbox,
|
|
35815
|
+
src,
|
|
35816
|
+
...props
|
|
35817
|
+
}) => {
|
|
35634
35818
|
const { url } = useWebPreview();
|
|
35819
|
+
const safeSrc = sanitizePreviewUrl(src ?? url);
|
|
35820
|
+
const resolvedLoadingFallback = loadingFallback ?? loading;
|
|
35635
35821
|
return /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
35636
35822
|
/* @__PURE__ */ jsx(
|
|
35637
35823
|
"iframe",
|
|
35638
35824
|
{
|
|
35639
35825
|
className: cn("size-full", className),
|
|
35640
35826
|
sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-presentation",
|
|
35641
|
-
src:
|
|
35827
|
+
src: safeSrc,
|
|
35642
35828
|
title: "Preview",
|
|
35643
35829
|
...props
|
|
35644
35830
|
}
|
|
35645
35831
|
),
|
|
35646
|
-
|
|
35832
|
+
resolvedLoadingFallback
|
|
35647
35833
|
] });
|
|
35648
35834
|
};
|
|
35649
35835
|
var useIsomorphicLayoutEffect2 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
@@ -35860,6 +36046,6 @@ var languages = [
|
|
|
35860
36046
|
"html"
|
|
35861
36047
|
];
|
|
35862
36048
|
|
|
35863
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Action2 as Action, Actions, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AreaChart, Artifact, ArtifactAction, ArtifactActions, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle, AspectRatio, AuthLayout, AvailableChartColors, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BarChart, BarList, BaseColorSwatches, Branch, BranchMessages, BranchNext, BranchPage, BranchPrevious, BranchSelector, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CategoryBar, ChainOfThought, ChainOfThoughtContent, ChainOfThoughtHeader, ChainOfThoughtImage, ChainOfThoughtSearchResult, ChainOfThoughtSearchResults, ChainOfThoughtStep, ChartContainer, ChartLegend3 as ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip3 as ChartTooltip, ChartTooltipContent, Checkbox, CheckboxSmall, Code, CodeBlock, CodeBlockCopyButton, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorPairingTool, ColorSwatches, ColourScale, ComboChart, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Context, ContextCacheUsage, ContextContent, ContextContentBody, ContextContentFooter, ContextContentHeader, ContextInputUsage, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextOutputUsage, ContextReasoningUsage, ContextTrigger, Conversation, ConversationContent, ConversationEmptyState, ConversationScrollButton, DataTable, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, Description4 as Description, DescriptionDetails, DescriptionList, DescriptionTerm, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ErrorMessage, ExpandableSearch, ExpandableSearchField, Field2 as Field, FieldGroup, FieldLabel, Fieldset2 as Fieldset, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, HeroBannerSupportingImage, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Image4 as Image, InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationCarousel, InlineCitationCarouselContent, InlineCitationCarouselHeader, InlineCitationCarouselIndex, InlineCitationCarouselItem, InlineCitationSource, InlineCitationText, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label5 as Label, Legend6 as Legend, LineChart, Link, _List as List, Listbox2 as Listbox, ListboxDescription, ListboxLabel, ListboxOption2 as ListboxOption, Loader, Loading, Logo, MainNavigation, Masthead, MegaMenu, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageContent, MobileHeader, MobileSearch, MultiLevelPushMenu, NSWCard, NSWCardArrow, NSWCardDescription, NSWCardIcon, NSWCardImg, NSWCardTitle, Navbar, NavbarDivider, NavbarItem, NavbarLabel, NavbarSection, NavbarSpacer, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuMainNavigation, NavigationMenuTrigger, NavigationMenuViewport, NotFound, OpenIn, OpenInChatGPT, OpenInClaude, OpenInContent, OpenInScira, OpenInT3, OpenInTrigger, OpenInv0, PageHeading, Pagination, PaginationGap, PaginationList, PaginationNext, PaginationPage, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, ProgressBar, ProgressCircle, PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputSubmit, PromptInputTextarea, PromptInputToolbar, PromptInputTools, Prose, RadioGroup2 as RadioGroup, RadioGroupItem, Reasoning, ReasoningContent, ReasoningTrigger, ResizableHandle, ResizablePanel, ResizablePanelGroup, Response, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLink, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNavigation, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteSearch, Skeleton, Slider, Social, Source, Sources, SourcesContent, SourcesTrigger, SparkAreaChart, SparkBarChart, SparkLineChart, Spinner, StepIndicator, StepNavigation, Strong, SubmitButton, Suggestion, Suggestions, Switch2 as Switch, SwitchField, SwitchGroup, TabNavigation, TabNavigationLink, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskContent, TaskItem, TaskItemFile, TaskTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, Tooltip5 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLevel, TouchTarget, Tracker, Tooltip3 as TremorTooltip, ViewToggle, WebPreview, WebPreviewBody, WebPreviewNavigation, WebPreviewUrl, Wrapper, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, chartColors, cn, colorDataArray, colorThemes, colors, constructCategoryColors, createColorArray, createColorData, createFormStore, darkenColor, diverging, domToSimple, focusInput, focusRing, generateColorThemes, generateDataVisColors, getColorClassName, getColorValue, getHeadings, getNodeText, getSurroundingColors, getYAxisDomain, hasErrorInput, hasOnlyOneValueForKey, humaniseVariant, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, progressBarVariants, renderColorOutput, renderColorOutputToDTFM, semantic, sequential, shades, themeIndices, themeTokens, toggleVariants, truncate, useActiveSectionObserver, useDisableToc, useFormField, useIsMobile, useOnWindowResize, usePageHeadings, usePromptInputAttachments, useSelectorHeight, useSidebar, useStickyOffset, useToc };
|
|
36049
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Action2 as Action, Actions, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AreaChart, Artifact, ArtifactAction, ArtifactActions, ArtifactContent, ArtifactDescription, ArtifactHeader, ArtifactTitle, AspectRatio, AuthLayout, AvailableChartColors, Avatar, AvatarFallback, AvatarImage, Badge, BadgeButton, BarChart, BarList, BaseColorSwatches, Branch, BranchMessages, BranchNext, BranchPage, BranchPrevious, BranchSelector, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Breadcrumbs, Button2 as Button, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CategoryBar, ChainOfThought, ChainOfThoughtContent, ChainOfThoughtHeader, ChainOfThoughtImage, ChainOfThoughtSearchResult, ChainOfThoughtSearchResults, ChainOfThoughtStep, ChartContainer, ChartLegend3 as ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip3 as ChartTooltip, ChartTooltipContent, Checkbox, CheckboxSmall, Code, CodeBlock, CodeBlockCopyButton, CodeDemo, CodeHighlight, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ColorCard, ColorPairingTool, ColorSwatches, ColourScale, ComboChart, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Context, ContextCacheUsage, ContextContent, ContextContentBody, ContextContentFooter, ContextContentHeader, ContextInputUsage, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextOutputUsage, ContextReasoningUsage, ContextTrigger, Conversation, ConversationContent, ConversationEmptyState, ConversationScrollButton, DataTable, DataTableColumnHeader, DataTableFacetedFilter, DataTablePagination, DataTableToolbar, DataTableViewOptions, Description4 as Description, DescriptionDetails, DescriptionList, DescriptionTerm, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFavicon, ErrorMessage, ExpandableSearch, ExpandableSearchField, Field2 as Field, FieldGroup, FieldLabel, Fieldset2 as Fieldset, Footer, FooterAcknowledgement, FooterLegalLinks, FooterSmallPrint, FooterSocialLink, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatToggle, GenerateInterpolatedColors, Header2 as Header, Heading, HeroBannerSimple, HeroBannerSupportingImage, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Image4 as Image, InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardTrigger, InlineCitationCarousel, InlineCitationCarouselContent, InlineCitationCarouselHeader, InlineCitationCarouselIndex, InlineCitationCarouselItem, InlineCitationSource, InlineCitationText, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Label5 as Label, Legend6 as Legend, LineChart, Link, _List as List, Listbox2 as Listbox, ListboxDescription, ListboxLabel, ListboxOption2 as ListboxOption, Loader, Loading, Logo, MainNavigation, Masthead, MegaMenu, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageContent, MobileHeader, MobileSearch, MultiLevelPushMenu, NSWCard, NSWCardArrow, NSWCardDescription, NSWCardIcon, NSWCardImg, NSWCardTitle, Navbar, NavbarDivider, NavbarItem, NavbarLabel, NavbarSection, NavbarSpacer, Navigation, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuMainNavigation, NavigationMenuTrigger, NavigationMenuViewport, NotFound, OpenIn, OpenInChatGPT, OpenInClaude, OpenInContent, OpenInScira, OpenInT3, OpenInTrigger, OpenInv0, PageHeading, Pagination, PaginationGap, PaginationList, PaginationNext, PaginationPage, PaginationPrevious, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PreWithCopy, PrevNextLinks, PrevNextLinksPageLink, Progress, ProgressBar, ProgressCircle, PromptInput, PromptInputActionAddAttachments, PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuItem, PromptInputActionMenuTrigger, PromptInputAttachment, PromptInputAttachments, PromptInputBody, PromptInputButton, PromptInputSubmit, PromptInputTextarea, PromptInputToolbar, PromptInputTools, Prose, RadioGroup2 as RadioGroup, RadioGroupItem, Reasoning, ReasoningContent, ReasoningTrigger, ResizableHandle, ResizablePanel, ResizablePanelGroup, Response, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator4 as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarLink, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarNavigation, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SiteSearch, Skeleton, Slider, Social, Source, Sources, SourcesContent, SourcesTrigger, SparkAreaChart, SparkBarChart, SparkLineChart, Spinner, StepIndicator, StepNavigation, Strong, SubmitButton, Suggestion, Suggestions, Switch2 as Switch, SwitchField, SwitchGroup, TabNavigation, TabNavigationLink, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskContent, TaskItem, TaskItemFile, TaskTrigger, Text, TextLink, Textarea, ThemeColorPalette, ThemeProvider, ThemeSelector, ThemeSwitcher, Toaster, TocContext, TocProvider, Toggle, ToggleGroup, ToggleGroupItem, Tool, ToolContent, ToolHeader, ToolInput, ToolOutput, Tooltip5 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopLevel, TouchTarget, Tracker, Tooltip3 as TremorTooltip, ViewToggle, WebPreview, WebPreviewBody, WebPreviewNavigation, WebPreviewUrl, Wrapper, aboriginal, addStartStopToColorArray, allPalettes, badgeVariants, brand, buttonVariants, camelCase, chartColors, cn, colorDataArray, colorThemes, colors, constructCategoryColors, createColorArray, createColorData, createFormStore, darkenColor, diverging, domToSimple, focusInput, focusRing, generateColorThemes, generateDataVisColors, getColorClassName, getColorValue, getHeadings, getNodeText, getSurroundingColors, getYAxisDomain, hasErrorInput, hasOnlyOneValueForKey, humaniseVariant, interpolateColors, isLightColor, kebabCase, languages, lightenColor, navigationMenuTriggerStyle, oklchConverter, progressBarVariants, renderColorOutput, renderColorOutputToDTFM, semantic, sequential, shades, themeIndices, themeTokens, toggleVariants, truncate, useActiveSectionObserver, useDisableToc, useFormField, useIsMobile, useOnWindowResize, usePageHeadings, usePromptInputAttachments, useSelectorHeight, useSidebar, useStickyOffset, useToc };
|
|
35864
36050
|
//# sourceMappingURL=index.js.map
|
|
35865
36051
|
//# sourceMappingURL=index.js.map
|