doodleui-react 0.5.0 → 0.6.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/README.md +2 -2
- package/dist/index.cjs +1368 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +156 -2
- package/dist/index.d.ts +156 -2
- package/dist/index.js +1332 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
package/dist/index.js
CHANGED
|
@@ -29,6 +29,8 @@ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
|
29
29
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
30
30
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
31
31
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
32
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
33
|
+
import useEmblaCarousel from 'embla-carousel-react';
|
|
32
34
|
|
|
33
35
|
// src/types.ts
|
|
34
36
|
function toRoughOptions(props) {
|
|
@@ -7183,7 +7185,1336 @@ var DrawerHeader = SlidingPanelHeader;
|
|
|
7183
7185
|
var DrawerFooter = SlidingPanelFooter;
|
|
7184
7186
|
var DrawerTitle = SlidingPanelTitle;
|
|
7185
7187
|
var DrawerDescription = SlidingPanelDescription;
|
|
7188
|
+
function AspectRatio({
|
|
7189
|
+
ratio = 16 / 9,
|
|
7190
|
+
bordered = false,
|
|
7191
|
+
className,
|
|
7192
|
+
style,
|
|
7193
|
+
children,
|
|
7194
|
+
roughness,
|
|
7195
|
+
seed,
|
|
7196
|
+
sketchColor,
|
|
7197
|
+
bowing,
|
|
7198
|
+
fillStyle,
|
|
7199
|
+
strokeWidth,
|
|
7200
|
+
animate
|
|
7201
|
+
}) {
|
|
7202
|
+
const inner = /* @__PURE__ */ jsx(
|
|
7203
|
+
AspectRatioPrimitive.Root,
|
|
7204
|
+
{
|
|
7205
|
+
ratio,
|
|
7206
|
+
className: cn(className),
|
|
7207
|
+
style: {
|
|
7208
|
+
width: "100%",
|
|
7209
|
+
overflow: "hidden",
|
|
7210
|
+
...style
|
|
7211
|
+
},
|
|
7212
|
+
children: /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%" }, children })
|
|
7213
|
+
}
|
|
7214
|
+
);
|
|
7215
|
+
if (!bordered) {
|
|
7216
|
+
return inner;
|
|
7217
|
+
}
|
|
7218
|
+
return /* @__PURE__ */ jsx(
|
|
7219
|
+
SketchBox,
|
|
7220
|
+
{
|
|
7221
|
+
className: cn(className),
|
|
7222
|
+
style: { width: "100%", ...style },
|
|
7223
|
+
contentStyle: { padding: 0, width: "100%" },
|
|
7224
|
+
fill: SKETCH_COLORS.paper,
|
|
7225
|
+
fillStyle: fillStyle ?? "hachure",
|
|
7226
|
+
roughness,
|
|
7227
|
+
seed,
|
|
7228
|
+
sketchColor,
|
|
7229
|
+
bowing,
|
|
7230
|
+
strokeWidth,
|
|
7231
|
+
animate,
|
|
7232
|
+
children: /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, { ratio, style: { width: "100%" }, children: /* @__PURE__ */ jsx("div", { style: { width: "100%", height: "100%" }, children }) })
|
|
7233
|
+
}
|
|
7234
|
+
);
|
|
7235
|
+
}
|
|
7236
|
+
var CHEVRON_PATH6 = "M 4 6 L 10 12 L 16 6";
|
|
7237
|
+
var NativeSelect = forwardRef(
|
|
7238
|
+
function NativeSelect2({
|
|
7239
|
+
className,
|
|
7240
|
+
style,
|
|
7241
|
+
options,
|
|
7242
|
+
children,
|
|
7243
|
+
roughness,
|
|
7244
|
+
seed,
|
|
7245
|
+
sketchColor,
|
|
7246
|
+
bowing,
|
|
7247
|
+
fillStyle,
|
|
7248
|
+
strokeWidth,
|
|
7249
|
+
animate,
|
|
7250
|
+
disabled,
|
|
7251
|
+
...rest
|
|
7252
|
+
}, ref) {
|
|
7253
|
+
const fieldRef = useRef(null);
|
|
7254
|
+
const shouldAnimate = useAnimate(animate);
|
|
7255
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
7256
|
+
const ink = sketchColor ?? SKETCH_COLORS.ink;
|
|
7257
|
+
useDrawIn(fieldRef, DRAW_IN_DURATION_MS, shouldAnimate);
|
|
7258
|
+
return /* @__PURE__ */ jsx(
|
|
7259
|
+
"span",
|
|
7260
|
+
{
|
|
7261
|
+
className: cn(className),
|
|
7262
|
+
style: {
|
|
7263
|
+
position: "relative",
|
|
7264
|
+
display: "block",
|
|
7265
|
+
width: "100%",
|
|
7266
|
+
opacity: disabled ? 0.6 : 1,
|
|
7267
|
+
...style
|
|
7268
|
+
},
|
|
7269
|
+
children: /* @__PURE__ */ jsxs("span", { ref: fieldRef, style: { position: "relative", display: "block" }, children: [
|
|
7270
|
+
/* @__PURE__ */ jsx(
|
|
7271
|
+
RoughSvg,
|
|
7272
|
+
{
|
|
7273
|
+
shape: "rectangle",
|
|
7274
|
+
roughness,
|
|
7275
|
+
seed: resolvedSeed,
|
|
7276
|
+
sketchColor: ink,
|
|
7277
|
+
bowing,
|
|
7278
|
+
fillStyle,
|
|
7279
|
+
fill: SKETCH_COLORS.paper,
|
|
7280
|
+
strokeWidth
|
|
7281
|
+
}
|
|
7282
|
+
),
|
|
7283
|
+
/* @__PURE__ */ jsx(
|
|
7284
|
+
"select",
|
|
7285
|
+
{
|
|
7286
|
+
ref,
|
|
7287
|
+
disabled,
|
|
7288
|
+
style: {
|
|
7289
|
+
position: "relative",
|
|
7290
|
+
zIndex: 1,
|
|
7291
|
+
width: "100%",
|
|
7292
|
+
border: "none",
|
|
7293
|
+
background: "transparent",
|
|
7294
|
+
padding: "10px 36px 10px 12px",
|
|
7295
|
+
fontFamily: doodleUiFontFamily,
|
|
7296
|
+
fontSize: 14,
|
|
7297
|
+
fontWeight: doodleUiFontWeight(500),
|
|
7298
|
+
color: ink,
|
|
7299
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
7300
|
+
appearance: "none",
|
|
7301
|
+
WebkitAppearance: "none",
|
|
7302
|
+
MozAppearance: "none",
|
|
7303
|
+
outline: "none"
|
|
7304
|
+
},
|
|
7305
|
+
...rest,
|
|
7306
|
+
children: options ? options.map((opt) => /* @__PURE__ */ jsx(
|
|
7307
|
+
"option",
|
|
7308
|
+
{
|
|
7309
|
+
value: opt.value,
|
|
7310
|
+
disabled: opt.disabled,
|
|
7311
|
+
children: opt.label
|
|
7312
|
+
},
|
|
7313
|
+
opt.value
|
|
7314
|
+
)) : children
|
|
7315
|
+
}
|
|
7316
|
+
),
|
|
7317
|
+
/* @__PURE__ */ jsx(
|
|
7318
|
+
"span",
|
|
7319
|
+
{
|
|
7320
|
+
"aria-hidden": true,
|
|
7321
|
+
style: {
|
|
7322
|
+
position: "absolute",
|
|
7323
|
+
right: 10,
|
|
7324
|
+
top: "50%",
|
|
7325
|
+
transform: "translateY(-50%)",
|
|
7326
|
+
width: 20,
|
|
7327
|
+
height: 14,
|
|
7328
|
+
pointerEvents: "none",
|
|
7329
|
+
zIndex: 2
|
|
7330
|
+
},
|
|
7331
|
+
children: /* @__PURE__ */ jsx(
|
|
7332
|
+
RoughSvg,
|
|
7333
|
+
{
|
|
7334
|
+
shape: "path",
|
|
7335
|
+
path: CHEVRON_PATH6,
|
|
7336
|
+
roughness: (roughness ?? 1.5) * 0.85,
|
|
7337
|
+
seed: resolvedSeed,
|
|
7338
|
+
sketchColor: ink,
|
|
7339
|
+
bowing,
|
|
7340
|
+
strokeWidth: strokeWidth ?? 1.5
|
|
7341
|
+
}
|
|
7342
|
+
)
|
|
7343
|
+
}
|
|
7344
|
+
)
|
|
7345
|
+
] })
|
|
7346
|
+
}
|
|
7347
|
+
);
|
|
7348
|
+
}
|
|
7349
|
+
);
|
|
7350
|
+
var EmptyContext = createContext(null);
|
|
7351
|
+
function useEmptyInk() {
|
|
7352
|
+
const ctx = useContext(EmptyContext);
|
|
7353
|
+
return ctx?.ink ?? SKETCH_COLORS.ink;
|
|
7354
|
+
}
|
|
7355
|
+
var emptyContentStyle = {
|
|
7356
|
+
display: "flex",
|
|
7357
|
+
flexDirection: "column",
|
|
7358
|
+
alignItems: "center",
|
|
7359
|
+
justifyContent: "center",
|
|
7360
|
+
textAlign: "center",
|
|
7361
|
+
gap: 12,
|
|
7362
|
+
padding: "32px 24px",
|
|
7363
|
+
minHeight: 160,
|
|
7364
|
+
width: "100%"
|
|
7365
|
+
};
|
|
7366
|
+
var Empty = forwardRef(function Empty2({
|
|
7367
|
+
className,
|
|
7368
|
+
style,
|
|
7369
|
+
children,
|
|
7370
|
+
bordered = true,
|
|
7371
|
+
roughness,
|
|
7372
|
+
seed,
|
|
7373
|
+
sketchColor,
|
|
7374
|
+
bowing,
|
|
7375
|
+
fillStyle,
|
|
7376
|
+
strokeWidth,
|
|
7377
|
+
animate,
|
|
7378
|
+
...rest
|
|
7379
|
+
}, ref) {
|
|
7380
|
+
const ink = sketchColor ?? SKETCH_COLORS.ink;
|
|
7381
|
+
const inner = /* @__PURE__ */ jsx(EmptyContext.Provider, { value: { ink }, children: /* @__PURE__ */ jsx(
|
|
7382
|
+
"div",
|
|
7383
|
+
{
|
|
7384
|
+
ref: bordered ? void 0 : ref,
|
|
7385
|
+
className: cn(className),
|
|
7386
|
+
style: { ...emptyContentStyle, ...style },
|
|
7387
|
+
...bordered ? {} : rest,
|
|
7388
|
+
children
|
|
7389
|
+
}
|
|
7390
|
+
) });
|
|
7391
|
+
if (!bordered) {
|
|
7392
|
+
return inner;
|
|
7393
|
+
}
|
|
7394
|
+
return /* @__PURE__ */ jsx(
|
|
7395
|
+
SketchBox,
|
|
7396
|
+
{
|
|
7397
|
+
ref,
|
|
7398
|
+
className: cn(className),
|
|
7399
|
+
style: { width: "100%", ...style },
|
|
7400
|
+
contentStyle: emptyContentStyle,
|
|
7401
|
+
fill: SKETCH_COLORS.secondaryFill,
|
|
7402
|
+
fillStyle: fillStyle ?? "hachure",
|
|
7403
|
+
roughness,
|
|
7404
|
+
seed,
|
|
7405
|
+
sketchColor,
|
|
7406
|
+
bowing,
|
|
7407
|
+
strokeWidth,
|
|
7408
|
+
animate,
|
|
7409
|
+
...rest,
|
|
7410
|
+
children: /* @__PURE__ */ jsx(EmptyContext.Provider, { value: { ink }, children })
|
|
7411
|
+
}
|
|
7412
|
+
);
|
|
7413
|
+
});
|
|
7414
|
+
function EmptyMedia({
|
|
7415
|
+
className,
|
|
7416
|
+
style,
|
|
7417
|
+
children
|
|
7418
|
+
}) {
|
|
7419
|
+
return /* @__PURE__ */ jsx(
|
|
7420
|
+
"div",
|
|
7421
|
+
{
|
|
7422
|
+
className: cn(className),
|
|
7423
|
+
style: {
|
|
7424
|
+
display: "flex",
|
|
7425
|
+
alignItems: "center",
|
|
7426
|
+
justifyContent: "center",
|
|
7427
|
+
marginBottom: 4,
|
|
7428
|
+
...style
|
|
7429
|
+
},
|
|
7430
|
+
children
|
|
7431
|
+
}
|
|
7432
|
+
);
|
|
7433
|
+
}
|
|
7434
|
+
function EmptyTitle({
|
|
7435
|
+
className,
|
|
7436
|
+
style,
|
|
7437
|
+
children
|
|
7438
|
+
}) {
|
|
7439
|
+
const ink = useEmptyInk();
|
|
7440
|
+
return /* @__PURE__ */ jsx(
|
|
7441
|
+
"h3",
|
|
7442
|
+
{
|
|
7443
|
+
className: cn(className),
|
|
7444
|
+
style: {
|
|
7445
|
+
margin: 0,
|
|
7446
|
+
fontFamily: doodleUiFontFamily,
|
|
7447
|
+
fontSize: 18,
|
|
7448
|
+
fontWeight: doodleUiFontWeight(700),
|
|
7449
|
+
color: ink,
|
|
7450
|
+
...style
|
|
7451
|
+
},
|
|
7452
|
+
children
|
|
7453
|
+
}
|
|
7454
|
+
);
|
|
7455
|
+
}
|
|
7456
|
+
function EmptyDescription({
|
|
7457
|
+
className,
|
|
7458
|
+
style,
|
|
7459
|
+
children
|
|
7460
|
+
}) {
|
|
7461
|
+
const ink = useEmptyInk();
|
|
7462
|
+
return /* @__PURE__ */ jsx(
|
|
7463
|
+
"p",
|
|
7464
|
+
{
|
|
7465
|
+
className: cn(className),
|
|
7466
|
+
style: {
|
|
7467
|
+
margin: 0,
|
|
7468
|
+
maxWidth: 360,
|
|
7469
|
+
fontFamily: doodleUiFontFamily,
|
|
7470
|
+
fontSize: 14,
|
|
7471
|
+
lineHeight: 1.5,
|
|
7472
|
+
color: ink,
|
|
7473
|
+
opacity: 0.85,
|
|
7474
|
+
...style
|
|
7475
|
+
},
|
|
7476
|
+
children
|
|
7477
|
+
}
|
|
7478
|
+
);
|
|
7479
|
+
}
|
|
7480
|
+
function EmptyAction({
|
|
7481
|
+
className,
|
|
7482
|
+
style,
|
|
7483
|
+
children
|
|
7484
|
+
}) {
|
|
7485
|
+
return /* @__PURE__ */ jsx(
|
|
7486
|
+
"div",
|
|
7487
|
+
{
|
|
7488
|
+
className: cn(className),
|
|
7489
|
+
style: {
|
|
7490
|
+
display: "flex",
|
|
7491
|
+
flexWrap: "wrap",
|
|
7492
|
+
gap: 8,
|
|
7493
|
+
justifyContent: "center",
|
|
7494
|
+
marginTop: 8,
|
|
7495
|
+
...style
|
|
7496
|
+
},
|
|
7497
|
+
children
|
|
7498
|
+
}
|
|
7499
|
+
);
|
|
7500
|
+
}
|
|
7501
|
+
var FieldContext = createContext(null);
|
|
7502
|
+
function useField() {
|
|
7503
|
+
const ctx = useContext(FieldContext);
|
|
7504
|
+
if (!ctx) {
|
|
7505
|
+
throw new Error("Field parts must be used inside <Field>.");
|
|
7506
|
+
}
|
|
7507
|
+
return ctx;
|
|
7508
|
+
}
|
|
7509
|
+
function Field({
|
|
7510
|
+
className,
|
|
7511
|
+
style,
|
|
7512
|
+
children,
|
|
7513
|
+
invalid = false,
|
|
7514
|
+
error,
|
|
7515
|
+
...rest
|
|
7516
|
+
}) {
|
|
7517
|
+
const id = useId();
|
|
7518
|
+
const descriptionId = `${id}-description`;
|
|
7519
|
+
const errorId = `${id}-error`;
|
|
7520
|
+
const value = useMemo(
|
|
7521
|
+
() => ({
|
|
7522
|
+
id,
|
|
7523
|
+
descriptionId,
|
|
7524
|
+
errorId,
|
|
7525
|
+
invalid: invalid || Boolean(error),
|
|
7526
|
+
error
|
|
7527
|
+
}),
|
|
7528
|
+
[id, descriptionId, errorId, invalid, error]
|
|
7529
|
+
);
|
|
7530
|
+
return /* @__PURE__ */ jsx(FieldContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
7531
|
+
"div",
|
|
7532
|
+
{
|
|
7533
|
+
className: cn(className),
|
|
7534
|
+
style: {
|
|
7535
|
+
display: "flex",
|
|
7536
|
+
flexDirection: "column",
|
|
7537
|
+
gap: 6,
|
|
7538
|
+
width: "100%",
|
|
7539
|
+
...style
|
|
7540
|
+
},
|
|
7541
|
+
...rest,
|
|
7542
|
+
children
|
|
7543
|
+
}
|
|
7544
|
+
) });
|
|
7545
|
+
}
|
|
7546
|
+
function FieldLabel({ className, style, ...rest }) {
|
|
7547
|
+
const { id } = useField();
|
|
7548
|
+
return /* @__PURE__ */ jsx(Label2, { htmlFor: id, className, style, ...rest });
|
|
7549
|
+
}
|
|
7550
|
+
function FieldDescription({
|
|
7551
|
+
className,
|
|
7552
|
+
style,
|
|
7553
|
+
children,
|
|
7554
|
+
...rest
|
|
7555
|
+
}) {
|
|
7556
|
+
const { descriptionId } = useField();
|
|
7557
|
+
return /* @__PURE__ */ jsx(
|
|
7558
|
+
"p",
|
|
7559
|
+
{
|
|
7560
|
+
id: descriptionId,
|
|
7561
|
+
className: cn(className),
|
|
7562
|
+
style: {
|
|
7563
|
+
margin: 0,
|
|
7564
|
+
fontFamily: doodleUiFontFamily,
|
|
7565
|
+
fontSize: 12,
|
|
7566
|
+
lineHeight: 1.45,
|
|
7567
|
+
color: SKETCH_COLORS.ink,
|
|
7568
|
+
opacity: 0.75,
|
|
7569
|
+
...style
|
|
7570
|
+
},
|
|
7571
|
+
...rest,
|
|
7572
|
+
children
|
|
7573
|
+
}
|
|
7574
|
+
);
|
|
7575
|
+
}
|
|
7576
|
+
function FieldError({
|
|
7577
|
+
className,
|
|
7578
|
+
style,
|
|
7579
|
+
children,
|
|
7580
|
+
...rest
|
|
7581
|
+
}) {
|
|
7582
|
+
const { error, errorId } = useField();
|
|
7583
|
+
const message = children ?? error;
|
|
7584
|
+
if (!message) return null;
|
|
7585
|
+
return /* @__PURE__ */ jsx(
|
|
7586
|
+
"p",
|
|
7587
|
+
{
|
|
7588
|
+
id: errorId,
|
|
7589
|
+
role: "alert",
|
|
7590
|
+
className: cn(className),
|
|
7591
|
+
style: {
|
|
7592
|
+
margin: 0,
|
|
7593
|
+
fontFamily: doodleUiFontFamily,
|
|
7594
|
+
fontSize: 12,
|
|
7595
|
+
lineHeight: 1.45,
|
|
7596
|
+
color: SKETCH_COLORS.error,
|
|
7597
|
+
...style
|
|
7598
|
+
},
|
|
7599
|
+
...rest,
|
|
7600
|
+
children: message
|
|
7601
|
+
}
|
|
7602
|
+
);
|
|
7603
|
+
}
|
|
7604
|
+
function FieldControl({ children }) {
|
|
7605
|
+
const { id, descriptionId, errorId, invalid } = useField();
|
|
7606
|
+
const child = Children.only(children);
|
|
7607
|
+
if (!isValidElement(child)) {
|
|
7608
|
+
throw new Error("FieldControl expects a single React element child.");
|
|
7609
|
+
}
|
|
7610
|
+
const describedBy = [descriptionId, invalid ? errorId : null].filter(Boolean).join(" ");
|
|
7611
|
+
const props = child.props;
|
|
7612
|
+
return cloneElement(child, {
|
|
7613
|
+
id: props.id ?? id,
|
|
7614
|
+
"aria-describedby": props["aria-describedby"] ?? (describedBy.length > 0 ? describedBy : void 0),
|
|
7615
|
+
"aria-invalid": invalid ? true : props["aria-invalid"]
|
|
7616
|
+
});
|
|
7617
|
+
}
|
|
7618
|
+
var HEADING_SIZES = {
|
|
7619
|
+
1: 32,
|
|
7620
|
+
2: 26,
|
|
7621
|
+
3: 22,
|
|
7622
|
+
4: 18,
|
|
7623
|
+
5: 16,
|
|
7624
|
+
6: 14
|
|
7625
|
+
};
|
|
7626
|
+
var Heading = forwardRef(
|
|
7627
|
+
function Heading2({
|
|
7628
|
+
level = 2,
|
|
7629
|
+
accent = "none",
|
|
7630
|
+
className,
|
|
7631
|
+
style,
|
|
7632
|
+
children,
|
|
7633
|
+
roughness,
|
|
7634
|
+
seed,
|
|
7635
|
+
sketchColor,
|
|
7636
|
+
bowing,
|
|
7637
|
+
strokeWidth,
|
|
7638
|
+
animate,
|
|
7639
|
+
...rest
|
|
7640
|
+
}, ref) {
|
|
7641
|
+
const Tag = `h${level}`;
|
|
7642
|
+
const ink = sketchColor ?? SKETCH_COLORS.ink;
|
|
7643
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
7644
|
+
const shouldAnimate = useAnimate(animate);
|
|
7645
|
+
const accentRef = useRef(null);
|
|
7646
|
+
useDrawIn(accentRef, DRAW_IN_MARK_MS, shouldAnimate && accent !== "none");
|
|
7647
|
+
const fontSize = HEADING_SIZES[level];
|
|
7648
|
+
return /* @__PURE__ */ jsxs(
|
|
7649
|
+
Tag,
|
|
7650
|
+
{
|
|
7651
|
+
ref,
|
|
7652
|
+
className: cn(className),
|
|
7653
|
+
style: {
|
|
7654
|
+
position: "relative",
|
|
7655
|
+
margin: 0,
|
|
7656
|
+
fontFamily: doodleUiFontFamily,
|
|
7657
|
+
fontSize,
|
|
7658
|
+
fontWeight: doodleUiFontWeight(700),
|
|
7659
|
+
color: ink,
|
|
7660
|
+
lineHeight: 1.2,
|
|
7661
|
+
...style
|
|
7662
|
+
},
|
|
7663
|
+
...rest,
|
|
7664
|
+
children: [
|
|
7665
|
+
accent === "highlight" ? /* @__PURE__ */ jsxs("span", { style: { position: "relative", display: "inline" }, children: [
|
|
7666
|
+
/* @__PURE__ */ jsx(
|
|
7667
|
+
"span",
|
|
7668
|
+
{
|
|
7669
|
+
ref: accentRef,
|
|
7670
|
+
"aria-hidden": true,
|
|
7671
|
+
style: {
|
|
7672
|
+
position: "absolute",
|
|
7673
|
+
left: -4,
|
|
7674
|
+
right: -4,
|
|
7675
|
+
bottom: 2,
|
|
7676
|
+
height: "0.45em",
|
|
7677
|
+
zIndex: 0
|
|
7678
|
+
},
|
|
7679
|
+
children: /* @__PURE__ */ jsx(
|
|
7680
|
+
RoughSvg,
|
|
7681
|
+
{
|
|
7682
|
+
shape: "rectangle",
|
|
7683
|
+
roughness,
|
|
7684
|
+
seed: resolvedSeed,
|
|
7685
|
+
sketchColor: SKETCH_COLORS.accent,
|
|
7686
|
+
fill: SKETCH_COLORS.accentFill,
|
|
7687
|
+
fillStyle: "solid",
|
|
7688
|
+
bowing,
|
|
7689
|
+
strokeWidth: strokeWidth ?? 1.2
|
|
7690
|
+
}
|
|
7691
|
+
)
|
|
7692
|
+
}
|
|
7693
|
+
),
|
|
7694
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
|
|
7695
|
+
] }) : children,
|
|
7696
|
+
accent === "underline" ? /* @__PURE__ */ jsx(
|
|
7697
|
+
"span",
|
|
7698
|
+
{
|
|
7699
|
+
ref: accentRef,
|
|
7700
|
+
"aria-hidden": true,
|
|
7701
|
+
style: {
|
|
7702
|
+
display: "block",
|
|
7703
|
+
position: "relative",
|
|
7704
|
+
height: 6,
|
|
7705
|
+
marginTop: 4,
|
|
7706
|
+
maxWidth: "100%"
|
|
7707
|
+
},
|
|
7708
|
+
children: /* @__PURE__ */ jsx(
|
|
7709
|
+
RoughSvg,
|
|
7710
|
+
{
|
|
7711
|
+
shape: "path",
|
|
7712
|
+
path: "M 2 4 Q 40 1 80 5 T 160 3",
|
|
7713
|
+
roughness,
|
|
7714
|
+
seed: resolvedSeed,
|
|
7715
|
+
sketchColor: ink,
|
|
7716
|
+
bowing,
|
|
7717
|
+
strokeWidth: strokeWidth ?? 1.5
|
|
7718
|
+
}
|
|
7719
|
+
)
|
|
7720
|
+
}
|
|
7721
|
+
) : null
|
|
7722
|
+
]
|
|
7723
|
+
}
|
|
7724
|
+
);
|
|
7725
|
+
}
|
|
7726
|
+
);
|
|
7727
|
+
var Text = forwardRef(function Text2({ variant = "body", className, style, children, ...rest }, ref) {
|
|
7728
|
+
const sizes = { body: 14, lead: 17, muted: 13 };
|
|
7729
|
+
const opacity = variant === "muted" ? 0.75 : 1;
|
|
7730
|
+
return /* @__PURE__ */ jsx(
|
|
7731
|
+
"p",
|
|
7732
|
+
{
|
|
7733
|
+
ref,
|
|
7734
|
+
className: cn(className),
|
|
7735
|
+
style: {
|
|
7736
|
+
margin: 0,
|
|
7737
|
+
fontFamily: doodleUiFontFamily,
|
|
7738
|
+
fontSize: sizes[variant],
|
|
7739
|
+
fontWeight: doodleUiFontWeight(variant === "lead" ? 500 : 400),
|
|
7740
|
+
lineHeight: 1.55,
|
|
7741
|
+
color: SKETCH_COLORS.ink,
|
|
7742
|
+
opacity,
|
|
7743
|
+
...style
|
|
7744
|
+
},
|
|
7745
|
+
...rest,
|
|
7746
|
+
children
|
|
7747
|
+
}
|
|
7748
|
+
);
|
|
7749
|
+
});
|
|
7750
|
+
var Paragraph = Text;
|
|
7751
|
+
var Blockquote = forwardRef(
|
|
7752
|
+
function Blockquote2({
|
|
7753
|
+
className,
|
|
7754
|
+
style,
|
|
7755
|
+
children,
|
|
7756
|
+
roughness,
|
|
7757
|
+
seed,
|
|
7758
|
+
sketchColor,
|
|
7759
|
+
bowing,
|
|
7760
|
+
strokeWidth,
|
|
7761
|
+
animate,
|
|
7762
|
+
...rest
|
|
7763
|
+
}, ref) {
|
|
7764
|
+
const ink = sketchColor ?? SKETCH_COLORS.ink;
|
|
7765
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
7766
|
+
const shouldAnimate = useAnimate(animate);
|
|
7767
|
+
const ruleRef = useRef(null);
|
|
7768
|
+
useDrawIn(ruleRef, DRAW_IN_MARK_MS, shouldAnimate);
|
|
7769
|
+
return /* @__PURE__ */ jsxs(
|
|
7770
|
+
"blockquote",
|
|
7771
|
+
{
|
|
7772
|
+
ref,
|
|
7773
|
+
className: cn(className),
|
|
7774
|
+
style: {
|
|
7775
|
+
display: "flex",
|
|
7776
|
+
gap: 12,
|
|
7777
|
+
margin: 0,
|
|
7778
|
+
padding: "8px 0 8px 4px",
|
|
7779
|
+
fontFamily: doodleUiFontFamily,
|
|
7780
|
+
fontSize: 15,
|
|
7781
|
+
fontStyle: "italic",
|
|
7782
|
+
lineHeight: 1.5,
|
|
7783
|
+
color: ink,
|
|
7784
|
+
...style
|
|
7785
|
+
},
|
|
7786
|
+
...rest,
|
|
7787
|
+
children: [
|
|
7788
|
+
/* @__PURE__ */ jsx(
|
|
7789
|
+
"span",
|
|
7790
|
+
{
|
|
7791
|
+
ref: ruleRef,
|
|
7792
|
+
"aria-hidden": true,
|
|
7793
|
+
style: { position: "relative", width: 6, flexShrink: 0, minHeight: 40 },
|
|
7794
|
+
children: /* @__PURE__ */ jsx(
|
|
7795
|
+
RoughSvg,
|
|
7796
|
+
{
|
|
7797
|
+
shape: "line-vertical",
|
|
7798
|
+
roughness,
|
|
7799
|
+
seed: resolvedSeed,
|
|
7800
|
+
sketchColor: ink,
|
|
7801
|
+
bowing,
|
|
7802
|
+
strokeWidth: strokeWidth ?? 2
|
|
7803
|
+
}
|
|
7804
|
+
)
|
|
7805
|
+
}
|
|
7806
|
+
),
|
|
7807
|
+
/* @__PURE__ */ jsx("span", { children })
|
|
7808
|
+
]
|
|
7809
|
+
}
|
|
7810
|
+
);
|
|
7811
|
+
}
|
|
7812
|
+
);
|
|
7813
|
+
var InlineCode = forwardRef(
|
|
7814
|
+
function InlineCode2({
|
|
7815
|
+
className,
|
|
7816
|
+
style,
|
|
7817
|
+
children,
|
|
7818
|
+
roughness,
|
|
7819
|
+
seed,
|
|
7820
|
+
sketchColor,
|
|
7821
|
+
bowing,
|
|
7822
|
+
fillStyle,
|
|
7823
|
+
strokeWidth,
|
|
7824
|
+
animate,
|
|
7825
|
+
...rest
|
|
7826
|
+
}, ref) {
|
|
7827
|
+
const ink = sketchColor ?? SKETCH_COLORS.ink;
|
|
7828
|
+
return /* @__PURE__ */ jsx(
|
|
7829
|
+
SketchBox,
|
|
7830
|
+
{
|
|
7831
|
+
className: cn(className),
|
|
7832
|
+
style: { display: "inline-flex", verticalAlign: "baseline", ...style },
|
|
7833
|
+
contentStyle: {
|
|
7834
|
+
padding: "1px 6px",
|
|
7835
|
+
fontSize: "0.9em",
|
|
7836
|
+
fontFamily: "ui-monospace, monospace"
|
|
7837
|
+
},
|
|
7838
|
+
fill: SKETCH_COLORS.paper,
|
|
7839
|
+
fillStyle: fillStyle ?? "hachure",
|
|
7840
|
+
roughness,
|
|
7841
|
+
seed,
|
|
7842
|
+
sketchColor: ink,
|
|
7843
|
+
bowing,
|
|
7844
|
+
strokeWidth: strokeWidth ?? 1.2,
|
|
7845
|
+
animate,
|
|
7846
|
+
...rest,
|
|
7847
|
+
children: /* @__PURE__ */ jsx(
|
|
7848
|
+
"code",
|
|
7849
|
+
{
|
|
7850
|
+
ref,
|
|
7851
|
+
style: {
|
|
7852
|
+
border: "none",
|
|
7853
|
+
background: "transparent",
|
|
7854
|
+
padding: 0,
|
|
7855
|
+
font: "inherit",
|
|
7856
|
+
color: ink
|
|
7857
|
+
},
|
|
7858
|
+
children
|
|
7859
|
+
}
|
|
7860
|
+
)
|
|
7861
|
+
}
|
|
7862
|
+
);
|
|
7863
|
+
}
|
|
7864
|
+
);
|
|
7865
|
+
var Highlight = forwardRef(
|
|
7866
|
+
function Highlight2({
|
|
7867
|
+
className,
|
|
7868
|
+
style,
|
|
7869
|
+
children,
|
|
7870
|
+
roughness,
|
|
7871
|
+
seed,
|
|
7872
|
+
sketchColor,
|
|
7873
|
+
bowing,
|
|
7874
|
+
strokeWidth,
|
|
7875
|
+
animate,
|
|
7876
|
+
...rest
|
|
7877
|
+
}, ref) {
|
|
7878
|
+
const resolvedSeed = useResolvedSeed(seed);
|
|
7879
|
+
const shouldAnimate = useAnimate(animate);
|
|
7880
|
+
const markRef = useRef(null);
|
|
7881
|
+
useDrawIn(markRef, DRAW_IN_MARK_MS, shouldAnimate);
|
|
7882
|
+
return /* @__PURE__ */ jsxs(
|
|
7883
|
+
"span",
|
|
7884
|
+
{
|
|
7885
|
+
ref,
|
|
7886
|
+
className: cn(className),
|
|
7887
|
+
style: { position: "relative", display: "inline", ...style },
|
|
7888
|
+
...rest,
|
|
7889
|
+
children: [
|
|
7890
|
+
/* @__PURE__ */ jsx(
|
|
7891
|
+
"span",
|
|
7892
|
+
{
|
|
7893
|
+
ref: markRef,
|
|
7894
|
+
"aria-hidden": true,
|
|
7895
|
+
style: {
|
|
7896
|
+
position: "absolute",
|
|
7897
|
+
left: -2,
|
|
7898
|
+
right: -2,
|
|
7899
|
+
bottom: 0,
|
|
7900
|
+
top: "35%",
|
|
7901
|
+
zIndex: 0
|
|
7902
|
+
},
|
|
7903
|
+
children: /* @__PURE__ */ jsx(
|
|
7904
|
+
RoughSvg,
|
|
7905
|
+
{
|
|
7906
|
+
shape: "rectangle",
|
|
7907
|
+
roughness,
|
|
7908
|
+
seed: resolvedSeed,
|
|
7909
|
+
sketchColor: sketchColor ?? SKETCH_COLORS.accent,
|
|
7910
|
+
fill: SKETCH_COLORS.accentFill,
|
|
7911
|
+
fillStyle: "solid",
|
|
7912
|
+
bowing,
|
|
7913
|
+
strokeWidth: strokeWidth ?? 1
|
|
7914
|
+
}
|
|
7915
|
+
)
|
|
7916
|
+
}
|
|
7917
|
+
),
|
|
7918
|
+
/* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1 }, children })
|
|
7919
|
+
]
|
|
7920
|
+
}
|
|
7921
|
+
);
|
|
7922
|
+
}
|
|
7923
|
+
);
|
|
7924
|
+
var SIDEBAR_WIDTH = 240;
|
|
7925
|
+
var SIDEBAR_WIDTH_COLLAPSED = 56;
|
|
7926
|
+
var SidebarContext = createContext(null);
|
|
7927
|
+
function useSidebar() {
|
|
7928
|
+
const ctx = useContext(SidebarContext);
|
|
7929
|
+
if (!ctx) {
|
|
7930
|
+
throw new Error("Sidebar parts must be used inside <SidebarProvider>.");
|
|
7931
|
+
}
|
|
7932
|
+
return ctx;
|
|
7933
|
+
}
|
|
7934
|
+
function SidebarProvider({
|
|
7935
|
+
defaultOpen = true,
|
|
7936
|
+
open: openProp,
|
|
7937
|
+
onOpenChange,
|
|
7938
|
+
defaultCollapsed = false,
|
|
7939
|
+
children,
|
|
7940
|
+
roughness,
|
|
7941
|
+
seed,
|
|
7942
|
+
sketchColor,
|
|
7943
|
+
bowing,
|
|
7944
|
+
strokeWidth
|
|
7945
|
+
}) {
|
|
7946
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
7947
|
+
const [collapsed, setCollapsed] = useState(defaultCollapsed);
|
|
7948
|
+
const open = openProp ?? uncontrolledOpen;
|
|
7949
|
+
const setOpen = useCallback(
|
|
7950
|
+
(next) => {
|
|
7951
|
+
onOpenChange?.(next);
|
|
7952
|
+
if (openProp === void 0) {
|
|
7953
|
+
setUncontrolledOpen(next);
|
|
7954
|
+
}
|
|
7955
|
+
},
|
|
7956
|
+
[onOpenChange, openProp]
|
|
7957
|
+
);
|
|
7958
|
+
const toggleCollapsed = useCallback(() => {
|
|
7959
|
+
setCollapsed((c) => !c);
|
|
7960
|
+
}, []);
|
|
7961
|
+
const ink = sketchColor ?? SKETCH_COLORS.ink;
|
|
7962
|
+
const value = useMemo(
|
|
7963
|
+
() => ({
|
|
7964
|
+
open,
|
|
7965
|
+
setOpen,
|
|
7966
|
+
collapsed,
|
|
7967
|
+
toggleCollapsed,
|
|
7968
|
+
ink,
|
|
7969
|
+
sketch: { roughness, seed, sketchColor, bowing, strokeWidth }
|
|
7970
|
+
}),
|
|
7971
|
+
[
|
|
7972
|
+
open,
|
|
7973
|
+
setOpen,
|
|
7974
|
+
collapsed,
|
|
7975
|
+
toggleCollapsed,
|
|
7976
|
+
ink,
|
|
7977
|
+
roughness,
|
|
7978
|
+
seed,
|
|
7979
|
+
sketchColor,
|
|
7980
|
+
bowing,
|
|
7981
|
+
strokeWidth
|
|
7982
|
+
]
|
|
7983
|
+
);
|
|
7984
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value, children });
|
|
7985
|
+
}
|
|
7986
|
+
var Sidebar = forwardRef(function Sidebar2({ className, style, children, side = "left", ...rest }, ref) {
|
|
7987
|
+
const { open, collapsed, sketch } = useSidebar();
|
|
7988
|
+
const resolvedSeed = useResolvedSeed(sketch.seed);
|
|
7989
|
+
const width = collapsed ? SIDEBAR_WIDTH_COLLAPSED : SIDEBAR_WIDTH;
|
|
7990
|
+
if (!open) {
|
|
7991
|
+
return null;
|
|
7992
|
+
}
|
|
7993
|
+
return /* @__PURE__ */ jsxs(
|
|
7994
|
+
"aside",
|
|
7995
|
+
{
|
|
7996
|
+
ref,
|
|
7997
|
+
className: cn(className),
|
|
7998
|
+
style: {
|
|
7999
|
+
position: "relative",
|
|
8000
|
+
flexShrink: 0,
|
|
8001
|
+
width,
|
|
8002
|
+
minHeight: 200,
|
|
8003
|
+
transition: "width 200ms ease",
|
|
8004
|
+
display: "flex",
|
|
8005
|
+
flexDirection: "column",
|
|
8006
|
+
background: SKETCH_COLORS.paper,
|
|
8007
|
+
...style
|
|
8008
|
+
},
|
|
8009
|
+
"data-side": side,
|
|
8010
|
+
...rest,
|
|
8011
|
+
children: [
|
|
8012
|
+
children,
|
|
8013
|
+
/* @__PURE__ */ jsx(
|
|
8014
|
+
"span",
|
|
8015
|
+
{
|
|
8016
|
+
"aria-hidden": true,
|
|
8017
|
+
style: {
|
|
8018
|
+
position: "absolute",
|
|
8019
|
+
top: 0,
|
|
8020
|
+
bottom: 0,
|
|
8021
|
+
width: 4,
|
|
8022
|
+
...side === "left" ? { right: 0 } : { left: 0 },
|
|
8023
|
+
pointerEvents: "none"
|
|
8024
|
+
},
|
|
8025
|
+
children: /* @__PURE__ */ jsx(
|
|
8026
|
+
RoughSvg,
|
|
8027
|
+
{
|
|
8028
|
+
shape: "line-vertical",
|
|
8029
|
+
roughness: sketch.roughness,
|
|
8030
|
+
seed: resolvedSeed,
|
|
8031
|
+
sketchColor: sketch.sketchColor ?? SKETCH_COLORS.ink,
|
|
8032
|
+
bowing: sketch.bowing,
|
|
8033
|
+
strokeWidth: sketch.strokeWidth ?? 1.5
|
|
8034
|
+
}
|
|
8035
|
+
)
|
|
8036
|
+
}
|
|
8037
|
+
)
|
|
8038
|
+
]
|
|
8039
|
+
}
|
|
8040
|
+
);
|
|
8041
|
+
});
|
|
8042
|
+
function SidebarHeader({
|
|
8043
|
+
className,
|
|
8044
|
+
style,
|
|
8045
|
+
children,
|
|
8046
|
+
...rest
|
|
8047
|
+
}) {
|
|
8048
|
+
const { collapsed } = useSidebar();
|
|
8049
|
+
return /* @__PURE__ */ jsx(
|
|
8050
|
+
"div",
|
|
8051
|
+
{
|
|
8052
|
+
className: cn(className),
|
|
8053
|
+
style: {
|
|
8054
|
+
padding: collapsed ? "12px 8px" : "16px 14px",
|
|
8055
|
+
borderBottom: `1px solid ${SKETCH_COLORS.ink}22`,
|
|
8056
|
+
...style
|
|
8057
|
+
},
|
|
8058
|
+
...rest,
|
|
8059
|
+
children
|
|
8060
|
+
}
|
|
8061
|
+
);
|
|
8062
|
+
}
|
|
8063
|
+
function SidebarContent({
|
|
8064
|
+
className,
|
|
8065
|
+
style,
|
|
8066
|
+
children,
|
|
8067
|
+
...rest
|
|
8068
|
+
}) {
|
|
8069
|
+
return /* @__PURE__ */ jsx(
|
|
8070
|
+
"div",
|
|
8071
|
+
{
|
|
8072
|
+
className: cn(className),
|
|
8073
|
+
style: {
|
|
8074
|
+
flex: 1,
|
|
8075
|
+
overflow: "auto",
|
|
8076
|
+
padding: "8px 6px",
|
|
8077
|
+
...style
|
|
8078
|
+
},
|
|
8079
|
+
...rest,
|
|
8080
|
+
children
|
|
8081
|
+
}
|
|
8082
|
+
);
|
|
8083
|
+
}
|
|
8084
|
+
function SidebarFooter({
|
|
8085
|
+
className,
|
|
8086
|
+
style,
|
|
8087
|
+
children,
|
|
8088
|
+
...rest
|
|
8089
|
+
}) {
|
|
8090
|
+
return /* @__PURE__ */ jsx(
|
|
8091
|
+
"div",
|
|
8092
|
+
{
|
|
8093
|
+
className: cn(className),
|
|
8094
|
+
style: {
|
|
8095
|
+
padding: "12px 10px",
|
|
8096
|
+
borderTop: `1px solid ${SKETCH_COLORS.ink}22`,
|
|
8097
|
+
...style
|
|
8098
|
+
},
|
|
8099
|
+
...rest,
|
|
8100
|
+
children
|
|
8101
|
+
}
|
|
8102
|
+
);
|
|
8103
|
+
}
|
|
8104
|
+
function SidebarGroup({
|
|
8105
|
+
className,
|
|
8106
|
+
style,
|
|
8107
|
+
children,
|
|
8108
|
+
title,
|
|
8109
|
+
...rest
|
|
8110
|
+
}) {
|
|
8111
|
+
const { collapsed, ink } = useSidebar();
|
|
8112
|
+
return /* @__PURE__ */ jsxs(
|
|
8113
|
+
"div",
|
|
8114
|
+
{
|
|
8115
|
+
className: cn(className),
|
|
8116
|
+
style: { marginBottom: 12, ...style },
|
|
8117
|
+
...rest,
|
|
8118
|
+
children: [
|
|
8119
|
+
title && !collapsed ? /* @__PURE__ */ jsx(
|
|
8120
|
+
"div",
|
|
8121
|
+
{
|
|
8122
|
+
style: {
|
|
8123
|
+
padding: "4px 10px 8px",
|
|
8124
|
+
fontSize: 11,
|
|
8125
|
+
fontWeight: doodleUiFontWeight(600),
|
|
8126
|
+
fontFamily: doodleUiFontFamily,
|
|
8127
|
+
color: ink,
|
|
8128
|
+
opacity: 0.65,
|
|
8129
|
+
textTransform: "uppercase",
|
|
8130
|
+
letterSpacing: "0.06em"
|
|
8131
|
+
},
|
|
8132
|
+
children: title
|
|
8133
|
+
}
|
|
8134
|
+
) : null,
|
|
8135
|
+
children
|
|
8136
|
+
]
|
|
8137
|
+
}
|
|
8138
|
+
);
|
|
8139
|
+
}
|
|
8140
|
+
var SidebarItem = forwardRef(
|
|
8141
|
+
function SidebarItem2({ className, style, children, active, ...rest }, ref) {
|
|
8142
|
+
const { collapsed, ink, sketch } = useSidebar();
|
|
8143
|
+
return /* @__PURE__ */ jsx(
|
|
8144
|
+
Button,
|
|
8145
|
+
{
|
|
8146
|
+
ref,
|
|
8147
|
+
type: "button",
|
|
8148
|
+
variant: active ? "secondary" : "ghost",
|
|
8149
|
+
className: cn(className),
|
|
8150
|
+
style: {
|
|
8151
|
+
width: "100%",
|
|
8152
|
+
justifyContent: collapsed ? "center" : "flex-start",
|
|
8153
|
+
marginBottom: 4,
|
|
8154
|
+
...style
|
|
8155
|
+
},
|
|
8156
|
+
roughness: sketch.roughness,
|
|
8157
|
+
seed: sketch.seed,
|
|
8158
|
+
sketchColor: ink,
|
|
8159
|
+
bowing: sketch.bowing,
|
|
8160
|
+
strokeWidth: sketch.strokeWidth,
|
|
8161
|
+
...rest,
|
|
8162
|
+
children
|
|
8163
|
+
}
|
|
8164
|
+
);
|
|
8165
|
+
}
|
|
8166
|
+
);
|
|
8167
|
+
function SidebarTrigger({
|
|
8168
|
+
className,
|
|
8169
|
+
style,
|
|
8170
|
+
children,
|
|
8171
|
+
...rest
|
|
8172
|
+
}) {
|
|
8173
|
+
const { toggleCollapsed, sketch, ink } = useSidebar();
|
|
8174
|
+
return /* @__PURE__ */ jsx(
|
|
8175
|
+
Button,
|
|
8176
|
+
{
|
|
8177
|
+
type: "button",
|
|
8178
|
+
variant: "outline",
|
|
8179
|
+
size: "sm",
|
|
8180
|
+
className: cn(className),
|
|
8181
|
+
style,
|
|
8182
|
+
onClick: toggleCollapsed,
|
|
8183
|
+
roughness: sketch.roughness,
|
|
8184
|
+
seed: sketch.seed,
|
|
8185
|
+
sketchColor: ink,
|
|
8186
|
+
bowing: sketch.bowing,
|
|
8187
|
+
strokeWidth: sketch.strokeWidth,
|
|
8188
|
+
...rest,
|
|
8189
|
+
children: children ?? "Toggle"
|
|
8190
|
+
}
|
|
8191
|
+
);
|
|
8192
|
+
}
|
|
8193
|
+
function SidebarLayout({
|
|
8194
|
+
className,
|
|
8195
|
+
style,
|
|
8196
|
+
children,
|
|
8197
|
+
...rest
|
|
8198
|
+
}) {
|
|
8199
|
+
return /* @__PURE__ */ jsx(
|
|
8200
|
+
"div",
|
|
8201
|
+
{
|
|
8202
|
+
className: cn(className),
|
|
8203
|
+
style: {
|
|
8204
|
+
display: "flex",
|
|
8205
|
+
width: "100%",
|
|
8206
|
+
minHeight: 280,
|
|
8207
|
+
alignItems: "stretch",
|
|
8208
|
+
...style
|
|
8209
|
+
},
|
|
8210
|
+
...rest,
|
|
8211
|
+
children
|
|
8212
|
+
}
|
|
8213
|
+
);
|
|
8214
|
+
}
|
|
8215
|
+
function SidebarInset({
|
|
8216
|
+
className,
|
|
8217
|
+
style,
|
|
8218
|
+
children,
|
|
8219
|
+
...rest
|
|
8220
|
+
}) {
|
|
8221
|
+
return /* @__PURE__ */ jsx(
|
|
8222
|
+
"div",
|
|
8223
|
+
{
|
|
8224
|
+
className: cn(className),
|
|
8225
|
+
style: {
|
|
8226
|
+
flex: 1,
|
|
8227
|
+
padding: 16,
|
|
8228
|
+
minWidth: 0,
|
|
8229
|
+
...style
|
|
8230
|
+
},
|
|
8231
|
+
...rest,
|
|
8232
|
+
children
|
|
8233
|
+
}
|
|
8234
|
+
);
|
|
8235
|
+
}
|
|
8236
|
+
var CarouselContext = createContext(null);
|
|
8237
|
+
function useCarousel() {
|
|
8238
|
+
const ctx = useContext(CarouselContext);
|
|
8239
|
+
if (!ctx) {
|
|
8240
|
+
throw new Error("Carousel parts must be used inside <Carousel>.");
|
|
8241
|
+
}
|
|
8242
|
+
return ctx;
|
|
8243
|
+
}
|
|
8244
|
+
function Carousel({
|
|
8245
|
+
opts,
|
|
8246
|
+
plugins,
|
|
8247
|
+
orientation = "horizontal",
|
|
8248
|
+
bordered = false,
|
|
8249
|
+
className,
|
|
8250
|
+
style,
|
|
8251
|
+
children,
|
|
8252
|
+
setApi,
|
|
8253
|
+
roughness,
|
|
8254
|
+
seed,
|
|
8255
|
+
sketchColor,
|
|
8256
|
+
bowing,
|
|
8257
|
+
strokeWidth,
|
|
8258
|
+
fillStyle,
|
|
8259
|
+
animate
|
|
8260
|
+
}) {
|
|
8261
|
+
const [emblaRef, api] = useEmblaCarousel(
|
|
8262
|
+
{
|
|
8263
|
+
...opts,
|
|
8264
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
8265
|
+
},
|
|
8266
|
+
plugins
|
|
8267
|
+
);
|
|
8268
|
+
const [canScrollPrev, setCanScrollPrev] = useState(false);
|
|
8269
|
+
const [canScrollNext, setCanScrollNext] = useState(false);
|
|
8270
|
+
const scrollPrev = useCallback(() => api?.scrollPrev(), [api]);
|
|
8271
|
+
const scrollNext = useCallback(() => api?.scrollNext(), [api]);
|
|
8272
|
+
const onSelect = useCallback(() => {
|
|
8273
|
+
if (!api) return;
|
|
8274
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
8275
|
+
setCanScrollNext(api.canScrollNext());
|
|
8276
|
+
}, [api]);
|
|
8277
|
+
useEffect(() => {
|
|
8278
|
+
if (!api) return;
|
|
8279
|
+
setApi?.(api);
|
|
8280
|
+
onSelect();
|
|
8281
|
+
api.on("reInit", onSelect);
|
|
8282
|
+
api.on("select", onSelect);
|
|
8283
|
+
return () => {
|
|
8284
|
+
api.off("reInit", onSelect);
|
|
8285
|
+
api.off("select", onSelect);
|
|
8286
|
+
};
|
|
8287
|
+
}, [api, onSelect, setApi]);
|
|
8288
|
+
const handleKeyDown = useCallback(
|
|
8289
|
+
(event) => {
|
|
8290
|
+
if (orientation === "horizontal") {
|
|
8291
|
+
if (event.key === "ArrowLeft") {
|
|
8292
|
+
event.preventDefault();
|
|
8293
|
+
scrollPrev();
|
|
8294
|
+
} else if (event.key === "ArrowRight") {
|
|
8295
|
+
event.preventDefault();
|
|
8296
|
+
scrollNext();
|
|
8297
|
+
}
|
|
8298
|
+
} else if (event.key === "ArrowUp") {
|
|
8299
|
+
event.preventDefault();
|
|
8300
|
+
scrollPrev();
|
|
8301
|
+
} else if (event.key === "ArrowDown") {
|
|
8302
|
+
event.preventDefault();
|
|
8303
|
+
scrollNext();
|
|
8304
|
+
}
|
|
8305
|
+
},
|
|
8306
|
+
[orientation, scrollPrev, scrollNext]
|
|
8307
|
+
);
|
|
8308
|
+
const value = {
|
|
8309
|
+
emblaRef,
|
|
8310
|
+
api,
|
|
8311
|
+
scrollPrev,
|
|
8312
|
+
scrollNext,
|
|
8313
|
+
canScrollPrev,
|
|
8314
|
+
canScrollNext,
|
|
8315
|
+
orientation,
|
|
8316
|
+
sketch: {
|
|
8317
|
+
roughness,
|
|
8318
|
+
seed,
|
|
8319
|
+
sketchColor,
|
|
8320
|
+
bowing,
|
|
8321
|
+
strokeWidth,
|
|
8322
|
+
fillStyle,
|
|
8323
|
+
animate
|
|
8324
|
+
},
|
|
8325
|
+
bordered
|
|
8326
|
+
};
|
|
8327
|
+
return /* @__PURE__ */ jsx(CarouselContext.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
8328
|
+
"div",
|
|
8329
|
+
{
|
|
8330
|
+
className: cn(className),
|
|
8331
|
+
role: "region",
|
|
8332
|
+
"aria-roledescription": "carousel",
|
|
8333
|
+
tabIndex: 0,
|
|
8334
|
+
onKeyDown: handleKeyDown,
|
|
8335
|
+
style: {
|
|
8336
|
+
position: "relative",
|
|
8337
|
+
width: "100%",
|
|
8338
|
+
...style
|
|
8339
|
+
},
|
|
8340
|
+
children
|
|
8341
|
+
}
|
|
8342
|
+
) });
|
|
8343
|
+
}
|
|
8344
|
+
var CarouselContent = forwardRef(
|
|
8345
|
+
function CarouselContent2({ className, style, children, ...rest }, ref) {
|
|
8346
|
+
const { emblaRef, orientation, bordered, sketch } = useCarousel();
|
|
8347
|
+
const viewport = /* @__PURE__ */ jsx("div", { ref: emblaRef, style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
8348
|
+
"div",
|
|
8349
|
+
{
|
|
8350
|
+
ref,
|
|
8351
|
+
className: cn(className),
|
|
8352
|
+
style: {
|
|
8353
|
+
display: "flex",
|
|
8354
|
+
flexDirection: orientation === "vertical" ? "column" : "row",
|
|
8355
|
+
marginLeft: orientation === "horizontal" ? -16 : 0,
|
|
8356
|
+
marginTop: orientation === "vertical" ? -16 : 0,
|
|
8357
|
+
...style
|
|
8358
|
+
},
|
|
8359
|
+
...rest,
|
|
8360
|
+
children
|
|
8361
|
+
}
|
|
8362
|
+
) });
|
|
8363
|
+
if (!bordered) {
|
|
8364
|
+
return viewport;
|
|
8365
|
+
}
|
|
8366
|
+
return /* @__PURE__ */ jsx(
|
|
8367
|
+
SketchBox,
|
|
8368
|
+
{
|
|
8369
|
+
fill: SKETCH_COLORS.paper,
|
|
8370
|
+
fillStyle: sketch.fillStyle ?? "hachure",
|
|
8371
|
+
roughness: sketch.roughness,
|
|
8372
|
+
seed: sketch.seed,
|
|
8373
|
+
sketchColor: sketch.sketchColor,
|
|
8374
|
+
bowing: sketch.bowing,
|
|
8375
|
+
strokeWidth: sketch.strokeWidth,
|
|
8376
|
+
animate: sketch.animate,
|
|
8377
|
+
contentStyle: { padding: 8 },
|
|
8378
|
+
children: viewport
|
|
8379
|
+
}
|
|
8380
|
+
);
|
|
8381
|
+
}
|
|
8382
|
+
);
|
|
8383
|
+
var CarouselItem = forwardRef(
|
|
8384
|
+
function CarouselItem2({ className, style, children, ...rest }, ref) {
|
|
8385
|
+
const { orientation } = useCarousel();
|
|
8386
|
+
const gap = 16;
|
|
8387
|
+
return /* @__PURE__ */ jsx(
|
|
8388
|
+
"div",
|
|
8389
|
+
{
|
|
8390
|
+
ref,
|
|
8391
|
+
className: cn(className),
|
|
8392
|
+
role: "group",
|
|
8393
|
+
"aria-roledescription": "slide",
|
|
8394
|
+
style: {
|
|
8395
|
+
flex: "0 0 100%",
|
|
8396
|
+
minWidth: 0,
|
|
8397
|
+
paddingLeft: orientation === "horizontal" ? gap : 0,
|
|
8398
|
+
paddingTop: orientation === "vertical" ? gap : 0,
|
|
8399
|
+
...style
|
|
8400
|
+
},
|
|
8401
|
+
...rest,
|
|
8402
|
+
children
|
|
8403
|
+
}
|
|
8404
|
+
);
|
|
8405
|
+
}
|
|
8406
|
+
);
|
|
8407
|
+
var ARROW_PATH_PREV = "M 14 4 L 6 12 L 14 20";
|
|
8408
|
+
var ARROW_PATH_NEXT = "M 6 4 L 14 12 L 6 20";
|
|
8409
|
+
var ARROW_SIZE = 40;
|
|
8410
|
+
var CarouselArrow = forwardRef(function CarouselArrow2({ className, style, direction, ...rest }, ref) {
|
|
8411
|
+
const {
|
|
8412
|
+
scrollPrev,
|
|
8413
|
+
scrollNext,
|
|
8414
|
+
canScrollPrev,
|
|
8415
|
+
canScrollNext,
|
|
8416
|
+
sketch,
|
|
8417
|
+
orientation
|
|
8418
|
+
} = useCarousel();
|
|
8419
|
+
const resolvedSeed = useResolvedSeed(sketch.seed);
|
|
8420
|
+
const ink = sketch.sketchColor ?? SKETCH_COLORS.ink;
|
|
8421
|
+
const isPrev = direction === "prev";
|
|
8422
|
+
const disabled = isPrev ? !canScrollPrev : !canScrollNext;
|
|
8423
|
+
const shouldAnimate = useAnimate(sketch.animate);
|
|
8424
|
+
const rootRef = useRef(null);
|
|
8425
|
+
const sketchSeed = deriveSeed(resolvedSeed, direction);
|
|
8426
|
+
useDrawIn(rootRef, DRAW_IN_DURATION_MS, shouldAnimate, sketchSeed);
|
|
8427
|
+
const horizontal = orientation === "horizontal";
|
|
8428
|
+
return /* @__PURE__ */ jsxs(
|
|
8429
|
+
"button",
|
|
8430
|
+
{
|
|
8431
|
+
ref: (node) => {
|
|
8432
|
+
rootRef.current = node;
|
|
8433
|
+
assignRef(ref, node);
|
|
8434
|
+
},
|
|
8435
|
+
type: "button",
|
|
8436
|
+
disabled,
|
|
8437
|
+
className: cn(className),
|
|
8438
|
+
style: {
|
|
8439
|
+
position: "absolute",
|
|
8440
|
+
zIndex: 2,
|
|
8441
|
+
width: ARROW_SIZE,
|
|
8442
|
+
height: ARROW_SIZE,
|
|
8443
|
+
padding: 0,
|
|
8444
|
+
border: "none",
|
|
8445
|
+
background: "transparent",
|
|
8446
|
+
cursor: disabled ? "not-allowed" : "pointer",
|
|
8447
|
+
opacity: disabled ? 0.5 : 1,
|
|
8448
|
+
...horizontal ? {
|
|
8449
|
+
top: "50%",
|
|
8450
|
+
transform: "translateY(-50%)",
|
|
8451
|
+
left: isPrev ? -52 : void 0,
|
|
8452
|
+
right: isPrev ? void 0 : -52
|
|
8453
|
+
} : {
|
|
8454
|
+
left: "50%",
|
|
8455
|
+
transform: "translateX(-50%) rotate(90deg)",
|
|
8456
|
+
top: isPrev ? -52 : void 0,
|
|
8457
|
+
bottom: isPrev ? void 0 : -52
|
|
8458
|
+
},
|
|
8459
|
+
...style
|
|
8460
|
+
},
|
|
8461
|
+
onClick: isPrev ? scrollPrev : scrollNext,
|
|
8462
|
+
"aria-label": isPrev ? "Previous slide" : "Next slide",
|
|
8463
|
+
...rest,
|
|
8464
|
+
children: [
|
|
8465
|
+
/* @__PURE__ */ jsx(
|
|
8466
|
+
RoughSvg,
|
|
8467
|
+
{
|
|
8468
|
+
shape: "ellipse",
|
|
8469
|
+
roughness: sketch.roughness,
|
|
8470
|
+
seed: sketchSeed,
|
|
8471
|
+
sketchColor: ink,
|
|
8472
|
+
bowing: sketch.bowing,
|
|
8473
|
+
fill: SKETCH_COLORS.paper,
|
|
8474
|
+
fillStyle: "solid",
|
|
8475
|
+
strokeWidth: sketch.strokeWidth ?? 1.5,
|
|
8476
|
+
inset: 1.5
|
|
8477
|
+
}
|
|
8478
|
+
),
|
|
8479
|
+
/* @__PURE__ */ jsx(
|
|
8480
|
+
"span",
|
|
8481
|
+
{
|
|
8482
|
+
style: {
|
|
8483
|
+
position: "relative",
|
|
8484
|
+
zIndex: 1,
|
|
8485
|
+
width: 18,
|
|
8486
|
+
height: 22,
|
|
8487
|
+
display: "block",
|
|
8488
|
+
margin: "0 auto"
|
|
8489
|
+
},
|
|
8490
|
+
children: /* @__PURE__ */ jsx(
|
|
8491
|
+
RoughSvg,
|
|
8492
|
+
{
|
|
8493
|
+
shape: "path",
|
|
8494
|
+
path: isPrev ? ARROW_PATH_PREV : ARROW_PATH_NEXT,
|
|
8495
|
+
roughness: sketch.roughness,
|
|
8496
|
+
seed: deriveSeed(resolvedSeed, `${direction}-arrow`),
|
|
8497
|
+
sketchColor: ink,
|
|
8498
|
+
strokeWidth: sketch.strokeWidth ?? 1.6
|
|
8499
|
+
}
|
|
8500
|
+
)
|
|
8501
|
+
}
|
|
8502
|
+
)
|
|
8503
|
+
]
|
|
8504
|
+
}
|
|
8505
|
+
);
|
|
8506
|
+
});
|
|
8507
|
+
var CarouselPrevious = forwardRef(
|
|
8508
|
+
function CarouselPrevious2(props, ref) {
|
|
8509
|
+
return /* @__PURE__ */ jsx(CarouselArrow, { ref, direction: "prev", ...props });
|
|
8510
|
+
}
|
|
8511
|
+
);
|
|
8512
|
+
var CarouselNext = forwardRef(
|
|
8513
|
+
function CarouselNext2(props, ref) {
|
|
8514
|
+
return /* @__PURE__ */ jsx(CarouselArrow, { ref, direction: "next", ...props });
|
|
8515
|
+
}
|
|
8516
|
+
);
|
|
7186
8517
|
|
|
7187
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, Badge, Breadcrumb, BreadcrumbItem, Button, Card, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuTrigger, DEFAULT_BOWING, DEFAULT_INK, DEFAULT_ROUGHNESS, DEFAULT_STROKE_WIDTH, DRAW_IN_ALERT_MS, DRAW_IN_DURATION_MS, DRAW_IN_MARK_MS, DRAW_IN_TOOLTIP_MS, Dialog2 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DoodleUIProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuTrigger, HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, Label2 as Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, ModalClose, ModalDescription, ModalRoot, ModalTitle, ModalTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuItemLink, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, RoughSvg, SKETCH_COLORS, ScrollArea, ScrollAreaCorner, ScrollAreaViewport, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, SketchBox, SketchSeedProvider, Slider, Spinner, Stepper, Switch, TABLE_STAGGER_MS, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useDoodleUI, useDrawIn, useResolvedSeed, useSketchSeed };
|
|
8518
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AspectRatio, Avatar, Badge, Blockquote, Breadcrumb, BreadcrumbItem, Button, Card, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuTrigger, DEFAULT_BOWING, DEFAULT_INK, DEFAULT_ROUGHNESS, DEFAULT_STROKE_WIDTH, DRAW_IN_ALERT_MS, DRAW_IN_DURATION_MS, DRAW_IN_MARK_MS, DRAW_IN_TOOLTIP_MS, Dialog2 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DoodleUIProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHandle, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuTrigger, Empty, EmptyAction, EmptyDescription, EmptyMedia, EmptyTitle, Field, FieldControl, FieldDescription, FieldError, FieldLabel, Heading, Highlight, HoverCard, HoverCardArrow, HoverCardContent, HoverCardTrigger, InlineCode, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, Label2 as Label, Menubar, MenubarCheckboxItem, MenubarContent, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Modal, ModalClose, ModalDescription, ModalRoot, ModalTitle, ModalTrigger, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuItemLink, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Paragraph, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, Radio, RadioGroup, ResizableHandle, ResizablePanel, ResizablePanelGroup, RoughSvg, SKETCH_COLORS, ScrollArea, ScrollAreaCorner, ScrollAreaViewport, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarInset, SidebarItem, SidebarLayout, SidebarProvider, SidebarTrigger, Skeleton, SketchBox, SketchSeedProvider, Slider, Spinner, Stepper, Switch, TABLE_STAGGER_MS, Tab, TabList, TabPanel, Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Tabs, Text, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipProvider, deriveSeed, toRoughOptions, useAnimate, useCarousel, useDoodleUI, useDrawIn, useResolvedSeed, useSidebar, useSketchSeed };
|
|
7188
8519
|
//# sourceMappingURL=index.js.map
|
|
7189
8520
|
//# sourceMappingURL=index.js.map
|