@overmap-ai/blocks 1.0.35-alpha.0 → 1.0.35-slider.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/Slider/Slider.d.ts +6 -0
- package/dist/Slider/cva.d.ts +19 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/typings.d.ts +11 -0
- package/dist/blocks.js +210 -15
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +212 -17
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as RadixSlider from "@radix-ui/react-slider";
|
|
3
|
+
import type { SliderVariantProps } from "./typings";
|
|
4
|
+
export interface SliderRootProps extends RadixSlider.SliderProps, SliderVariantProps {
|
|
5
|
+
}
|
|
6
|
+
export declare const Slider: import("react").NamedExoticComponent<SliderRootProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const sliderRootCva: (props?: ({
|
|
2
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
3
|
+
variant?: "soft" | "surface" | null | undefined;
|
|
4
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export declare const sliderTrackCva: (props?: ({
|
|
7
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
8
|
+
variant?: "soft" | "surface" | null | undefined;
|
|
9
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
export declare const sliderRangeCva: (props?: ({
|
|
12
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
13
|
+
variant?: "soft" | "surface" | null | undefined;
|
|
14
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
export declare const sliderThumbCva: (props?: ({
|
|
17
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
18
|
+
variant?: "soft" | "surface" | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentRadius } from "../Provider";
|
|
2
|
+
import type { AccentColorProps } from "../typings";
|
|
3
|
+
export type SliderSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
4
|
+
export type SliderOrientation = "horizontal" | "vertical";
|
|
5
|
+
export type SliderVariant = "surface" | "soft";
|
|
6
|
+
export interface SliderVariantProps extends AccentColorProps {
|
|
7
|
+
size?: SliderSize;
|
|
8
|
+
orientation?: SliderOrientation;
|
|
9
|
+
radius?: ComponentRadius;
|
|
10
|
+
variant?: SliderVariant;
|
|
11
|
+
}
|
package/dist/blocks.js
CHANGED
|
@@ -25,6 +25,7 @@ import * as RadixPopover from "@radix-ui/react-popover";
|
|
|
25
25
|
import * as RadixRadioGroup from "@radix-ui/react-radio-group";
|
|
26
26
|
import * as RadixToggleGroup from "@radix-ui/react-toggle-group";
|
|
27
27
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
28
|
+
import * as RadixSlider from "@radix-ui/react-slider";
|
|
28
29
|
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
29
30
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
30
31
|
import { ToastProvider as ToastProvider$1, ToastViewport } from "@radix-ui/react-toast";
|
|
@@ -1191,11 +1192,11 @@ const commandMenuItemCva = cva(
|
|
|
1191
1192
|
{
|
|
1192
1193
|
variants: {
|
|
1193
1194
|
size: {
|
|
1194
|
-
xs: ["
|
|
1195
|
-
sm: ["
|
|
1196
|
-
md: ["
|
|
1197
|
-
lg: ["
|
|
1198
|
-
xl: ["
|
|
1195
|
+
xs: ["py-2.5", "gap-3.5", "px-5.25", "after:inset-x-1.75"],
|
|
1196
|
+
sm: ["py-2.5", "gap-4", "px-6", "after:inset-x-2"],
|
|
1197
|
+
md: ["py-3", "gap-4.5", "px-6.75", "after:inset-x-2.25"],
|
|
1198
|
+
lg: ["py-3", "gap-5", "px-7.5", "after:inset-x-2.5"],
|
|
1199
|
+
xl: ["py-3.25", "gap-5.5", "px-8.25", "after:inset-x-2.75"]
|
|
1199
1200
|
},
|
|
1200
1201
|
variant: {
|
|
1201
1202
|
solid: [
|
|
@@ -1248,31 +1249,31 @@ const commandMenuGroupCva = cva(
|
|
|
1248
1249
|
size: {
|
|
1249
1250
|
xs: [
|
|
1250
1251
|
"[&_[cmdk-group-heading]]:px-2.5",
|
|
1251
|
-
"[&_[cmdk-group-heading]]:
|
|
1252
|
+
"[&_[cmdk-group-heading]]:py-1",
|
|
1252
1253
|
"[&_[cmdk-group-heading]]:text-xs",
|
|
1253
1254
|
"[&_[cmdk-group-heading]]:gap-2.5"
|
|
1254
1255
|
],
|
|
1255
1256
|
sm: [
|
|
1256
1257
|
"[&_[cmdk-group-heading]]:px-2.75",
|
|
1257
|
-
"[&_[cmdk-group-heading]]:
|
|
1258
|
+
"[&_[cmdk-group-heading]]:py-1",
|
|
1258
1259
|
"[&_[cmdk-group-heading]]:text-sm",
|
|
1259
1260
|
"[&_[cmdk-group-heading]]:gap-2.75"
|
|
1260
1261
|
],
|
|
1261
1262
|
md: [
|
|
1262
1263
|
"[&_[cmdk-group-heading]]:px-3",
|
|
1263
|
-
"[&_[cmdk-group-heading]]:
|
|
1264
|
+
"[&_[cmdk-group-heading]]:py-1.25",
|
|
1264
1265
|
"[&_[cmdk-group-heading]]:text-sm",
|
|
1265
1266
|
"[&_[cmdk-group-heading]]:gap-3"
|
|
1266
1267
|
],
|
|
1267
1268
|
lg: [
|
|
1268
1269
|
"[&_[cmdk-group-heading]]:px-3.25",
|
|
1269
|
-
"[&_[cmdk-group-heading]]:
|
|
1270
|
+
"[&_[cmdk-group-heading]]:py-1.25",
|
|
1270
1271
|
"[&_[cmdk-group-heading]]:text-base",
|
|
1271
1272
|
"[&_[cmdk-group-heading]]:gap-3.25"
|
|
1272
1273
|
],
|
|
1273
1274
|
xl: [
|
|
1274
1275
|
"[&_[cmdk-group-heading]]:px-3.5",
|
|
1275
|
-
"[&_[cmdk-group-heading]]:
|
|
1276
|
+
"[&_[cmdk-group-heading]]:py-1.25",
|
|
1276
1277
|
"[&_[cmdk-group-heading]]:text-base",
|
|
1277
1278
|
"[&_[cmdk-group-heading]]:gap-3.5"
|
|
1278
1279
|
]
|
|
@@ -2704,11 +2705,11 @@ const menuItem = cva(
|
|
|
2704
2705
|
{
|
|
2705
2706
|
variants: {
|
|
2706
2707
|
size: {
|
|
2707
|
-
xs: ["
|
|
2708
|
-
sm: ["
|
|
2709
|
-
md: ["
|
|
2710
|
-
lg: ["
|
|
2711
|
-
xl: ["
|
|
2708
|
+
xs: ["py-0.5", "gap-1.5", "px-1.5"],
|
|
2709
|
+
sm: ["py-0.5", "gap-2.25", "px-2.25"],
|
|
2710
|
+
md: ["py-0.5", "gap-3", "px-3"],
|
|
2711
|
+
lg: ["py-0.5", "gap-3.75", "px-3.75"],
|
|
2712
|
+
xl: ["py-0.5", "gap-4.5", "px-4.5"]
|
|
2712
2713
|
},
|
|
2713
2714
|
variant: {
|
|
2714
2715
|
solid: [
|
|
@@ -4377,6 +4378,199 @@ const Separator = forwardRef((props, ref) => {
|
|
|
4377
4378
|
);
|
|
4378
4379
|
});
|
|
4379
4380
|
Separator.displayName = "Separator";
|
|
4381
|
+
const sliderRootCva = cva(["relative", "select-none", "touch-none", "flex", "items-center"], {
|
|
4382
|
+
variants: {
|
|
4383
|
+
size: {
|
|
4384
|
+
xs: [],
|
|
4385
|
+
sm: [],
|
|
4386
|
+
md: [],
|
|
4387
|
+
lg: [],
|
|
4388
|
+
xl: []
|
|
4389
|
+
},
|
|
4390
|
+
variant: {
|
|
4391
|
+
surface: [],
|
|
4392
|
+
soft: []
|
|
4393
|
+
},
|
|
4394
|
+
orientation: {
|
|
4395
|
+
horizontal: ["flex-row"],
|
|
4396
|
+
vertical: ["flex-col"]
|
|
4397
|
+
}
|
|
4398
|
+
},
|
|
4399
|
+
compoundVariants: [
|
|
4400
|
+
// horizontal
|
|
4401
|
+
{
|
|
4402
|
+
orientation: "horizontal",
|
|
4403
|
+
size: "xs",
|
|
4404
|
+
className: ["h-1.5"]
|
|
4405
|
+
},
|
|
4406
|
+
{
|
|
4407
|
+
orientation: "horizontal",
|
|
4408
|
+
size: "sm",
|
|
4409
|
+
className: ["h-2"]
|
|
4410
|
+
},
|
|
4411
|
+
{
|
|
4412
|
+
orientation: "horizontal",
|
|
4413
|
+
size: "md",
|
|
4414
|
+
className: ["h-2.5"]
|
|
4415
|
+
},
|
|
4416
|
+
{
|
|
4417
|
+
orientation: "horizontal",
|
|
4418
|
+
size: "lg",
|
|
4419
|
+
className: ["h-3"]
|
|
4420
|
+
},
|
|
4421
|
+
{
|
|
4422
|
+
orientation: "horizontal",
|
|
4423
|
+
size: "xl",
|
|
4424
|
+
className: ["h-3.5"]
|
|
4425
|
+
},
|
|
4426
|
+
// vertical
|
|
4427
|
+
{
|
|
4428
|
+
orientation: "vertical",
|
|
4429
|
+
size: "xs",
|
|
4430
|
+
className: ["w-1.5"]
|
|
4431
|
+
},
|
|
4432
|
+
{
|
|
4433
|
+
orientation: "vertical",
|
|
4434
|
+
size: "sm",
|
|
4435
|
+
className: ["w-2"]
|
|
4436
|
+
},
|
|
4437
|
+
{
|
|
4438
|
+
orientation: "vertical",
|
|
4439
|
+
size: "md",
|
|
4440
|
+
className: ["w-2.5"]
|
|
4441
|
+
},
|
|
4442
|
+
{
|
|
4443
|
+
orientation: "vertical",
|
|
4444
|
+
size: "lg",
|
|
4445
|
+
className: ["w-3"]
|
|
4446
|
+
},
|
|
4447
|
+
{
|
|
4448
|
+
orientation: "vertical",
|
|
4449
|
+
size: "xl",
|
|
4450
|
+
className: ["w-3.5"]
|
|
4451
|
+
}
|
|
4452
|
+
]
|
|
4453
|
+
});
|
|
4454
|
+
const sliderTrackCva = cva(
|
|
4455
|
+
[
|
|
4456
|
+
"overflow-hidden",
|
|
4457
|
+
"relative",
|
|
4458
|
+
"grow",
|
|
4459
|
+
"rounded-[inherit]",
|
|
4460
|
+
"select-none",
|
|
4461
|
+
"data-disabled:opacity-50",
|
|
4462
|
+
"disabled:pointer-events-none"
|
|
4463
|
+
],
|
|
4464
|
+
{
|
|
4465
|
+
variants: {
|
|
4466
|
+
size: {
|
|
4467
|
+
xs: [],
|
|
4468
|
+
sm: [],
|
|
4469
|
+
md: [],
|
|
4470
|
+
lg: [],
|
|
4471
|
+
xl: []
|
|
4472
|
+
},
|
|
4473
|
+
variant: {
|
|
4474
|
+
surface: ["bg-(--base-a3)", "inset-ring", "inset-ring-(--base-a5)"],
|
|
4475
|
+
soft: ["bg-(--base-a4)"]
|
|
4476
|
+
},
|
|
4477
|
+
orientation: {
|
|
4478
|
+
horizontal: ["h-full"],
|
|
4479
|
+
vertical: ["w-full"]
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
}
|
|
4483
|
+
);
|
|
4484
|
+
const sliderRangeCva = cva(
|
|
4485
|
+
["absolute", "rounded-[inherit]", "data-disabled:opacity-50", "disabled:pointer-events-none"],
|
|
4486
|
+
{
|
|
4487
|
+
variants: {
|
|
4488
|
+
size: {
|
|
4489
|
+
xs: [],
|
|
4490
|
+
sm: [],
|
|
4491
|
+
md: [],
|
|
4492
|
+
lg: [],
|
|
4493
|
+
xl: []
|
|
4494
|
+
},
|
|
4495
|
+
variant: {
|
|
4496
|
+
surface: ["inset-ring", "inset-ring-(--base-a5)", "bg-(--accent-track)"],
|
|
4497
|
+
soft: ["bg-(--accent-8)"]
|
|
4498
|
+
},
|
|
4499
|
+
orientation: {
|
|
4500
|
+
horizontal: ["h-full"],
|
|
4501
|
+
vertical: ["w-full"]
|
|
4502
|
+
}
|
|
4503
|
+
}
|
|
4504
|
+
}
|
|
4505
|
+
);
|
|
4506
|
+
const sliderThumbCva = cva(
|
|
4507
|
+
[
|
|
4508
|
+
"block",
|
|
4509
|
+
"shrink-0",
|
|
4510
|
+
"bg-(--accent-contrast)",
|
|
4511
|
+
"inset-ring",
|
|
4512
|
+
"inset-ring-(--base-a6)",
|
|
4513
|
+
"disabled:pointer-events-none",
|
|
4514
|
+
"dark:data-disabled:brightness-50",
|
|
4515
|
+
"focus:outline-none",
|
|
4516
|
+
"focus-visible:outline-2",
|
|
4517
|
+
"focus-visible:outline-offset-1",
|
|
4518
|
+
"focus-visible:outline-(--accent-8)"
|
|
4519
|
+
],
|
|
4520
|
+
{
|
|
4521
|
+
variants: {
|
|
4522
|
+
size: {
|
|
4523
|
+
xs: ["size-4"],
|
|
4524
|
+
sm: ["size-5"],
|
|
4525
|
+
md: ["size-6"],
|
|
4526
|
+
lg: ["size-7"],
|
|
4527
|
+
xl: ["size-8"]
|
|
4528
|
+
},
|
|
4529
|
+
variant: {
|
|
4530
|
+
surface: [],
|
|
4531
|
+
soft: []
|
|
4532
|
+
}
|
|
4533
|
+
}
|
|
4534
|
+
}
|
|
4535
|
+
);
|
|
4536
|
+
const Slider = memo((props) => {
|
|
4537
|
+
const providerContext = useProvider();
|
|
4538
|
+
const {
|
|
4539
|
+
className,
|
|
4540
|
+
size: size2 = "md",
|
|
4541
|
+
orientation = "horizontal",
|
|
4542
|
+
accentColor = providerContext.accentColor,
|
|
4543
|
+
radius = providerContext.radius,
|
|
4544
|
+
variant = "surface",
|
|
4545
|
+
tabIndex,
|
|
4546
|
+
...rest
|
|
4547
|
+
} = props;
|
|
4548
|
+
return /* @__PURE__ */ jsxs(
|
|
4549
|
+
RadixSlider.Root,
|
|
4550
|
+
{
|
|
4551
|
+
className: cx(
|
|
4552
|
+
className,
|
|
4553
|
+
sliderRootCva({ size: size2, variant, orientation }),
|
|
4554
|
+
radiusCva({ radius, maxLarge: false })
|
|
4555
|
+
),
|
|
4556
|
+
orientation,
|
|
4557
|
+
"data-accent-color": accentColor,
|
|
4558
|
+
...rest,
|
|
4559
|
+
children: [
|
|
4560
|
+
/* @__PURE__ */ jsx(RadixSlider.Track, { className: sliderTrackCva({ size: size2, variant, orientation }), children: /* @__PURE__ */ jsx(RadixSlider.Range, { className: sliderRangeCva({ size: size2, variant, orientation }) }) }),
|
|
4561
|
+
(props.value ?? rest.defaultValue ?? []).map((value, index) => /* @__PURE__ */ jsx(
|
|
4562
|
+
RadixSlider.Thumb,
|
|
4563
|
+
{
|
|
4564
|
+
className: cx(sliderThumbCva({ size: size2, variant }), radiusCva({ radius, maxLarge: false })),
|
|
4565
|
+
...tabIndex !== void 0 ? { tabIndex } : void 0
|
|
4566
|
+
},
|
|
4567
|
+
`${index}-${value}`
|
|
4568
|
+
))
|
|
4569
|
+
]
|
|
4570
|
+
}
|
|
4571
|
+
);
|
|
4572
|
+
});
|
|
4573
|
+
Slider.displayName = "Slider";
|
|
4380
4574
|
const Spinner = memo(() => {
|
|
4381
4575
|
return /* @__PURE__ */ jsx("div", { className: "size-5 animate-spin rounded-full border-2 border-(--base-a12) border-b-transparent" });
|
|
4382
4576
|
});
|
|
@@ -5303,6 +5497,7 @@ export {
|
|
|
5303
5497
|
SelectedIndicatorContext,
|
|
5304
5498
|
Separator,
|
|
5305
5499
|
SlideOut,
|
|
5500
|
+
Slider,
|
|
5306
5501
|
Spinner,
|
|
5307
5502
|
Switch,
|
|
5308
5503
|
SwitchRoot,
|