@spark-ui/components 11.1.0 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DialogTrigger-woU7vsJi.d.ts +142 -0
- package/dist/Input-N8AWWSmt.d.ts +41 -0
- package/dist/InputTrailingIcon-ZZx8PoJy.d.ts +20 -0
- package/dist/LabelRequiredIndicator-DRnCzHMU.d.ts +19 -0
- package/dist/accordion/index.d.ts +73 -0
- package/dist/accordion/index.js +325 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert-dialog/index.d.ts +119 -0
- package/dist/alert-dialog/index.js +1554 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/avatar/index.d.ts +66 -0
- package/dist/avatar/index.js +1303 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/badge/index.d.ts +47 -0
- package/dist/badge/index.js +122 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +64 -0
- package/dist/breadcrumb/index.js +327 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/button/index.d.ts +41 -0
- package/dist/button/index.js +935 -0
- package/dist/button/index.js.map +1 -0
- package/dist/card/index.d.ts +61 -0
- package/dist/card/index.js +502 -0
- package/dist/card/index.js.map +1 -0
- package/dist/carousel/index.d.ts +261 -0
- package/dist/carousel/index.js +1801 -0
- package/dist/carousel/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +120 -0
- package/dist/checkbox/index.js +511 -0
- package/dist/checkbox/index.js.map +1 -0
- package/dist/chip/index.d.ts +97 -0
- package/dist/chip/index.js +908 -0
- package/dist/chip/index.js.map +1 -0
- package/dist/collapsible/index.d.ts +43 -0
- package/dist/collapsible/index.js +109 -0
- package/dist/collapsible/index.js.map +1 -0
- package/dist/combobox/index.d.ts +287 -0
- package/dist/combobox/index.js +2588 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/dialog/index.d.ts +33 -0
- package/dist/dialog/index.js +1389 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/divider/index.d.ts +61 -0
- package/dist/divider/index.js +224 -0
- package/dist/divider/index.js.map +1 -0
- package/dist/drawer/index.d.ts +152 -0
- package/dist/drawer/index.js +1400 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/dropdown/index.d.ts +233 -0
- package/dist/dropdown/index.js +2051 -0
- package/dist/dropdown/index.js.map +1 -0
- package/dist/form-field/index.d.ts +186 -0
- package/dist/form-field/index.js +553 -0
- package/dist/form-field/index.js.map +1 -0
- package/dist/icon/index.d.ts +28 -0
- package/dist/icon/index.js +127 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon-button/index.d.ts +16 -0
- package/dist/icon-button/index.js +980 -0
- package/dist/icon-button/index.js.map +1 -0
- package/dist/input/index.d.ts +78 -0
- package/dist/input/index.js +724 -0
- package/dist/input/index.js.map +1 -0
- package/dist/kbd/index.d.ts +9 -0
- package/dist/kbd/index.js +47 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/label/index.d.ts +11 -0
- package/dist/label/index.js +78 -0
- package/dist/label/index.js.map +1 -0
- package/dist/link-box/index.d.ts +34 -0
- package/dist/link-box/index.js +92 -0
- package/dist/link-box/index.js.map +1 -0
- package/dist/pagination/index.d.ts +143 -0
- package/dist/pagination/index.js +1353 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/popover/index.d.ts +93 -0
- package/dist/popover/index.js +1339 -0
- package/dist/popover/index.js.map +1 -0
- package/dist/portal/index.d.ts +13 -0
- package/dist/portal/index.js +37 -0
- package/dist/portal/index.js.map +1 -0
- package/dist/progress/index.d.ts +48 -0
- package/dist/progress/index.js +223 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress-tracker/index.d.ts +80 -0
- package/dist/progress-tracker/index.js +571 -0
- package/dist/progress-tracker/index.js.map +1 -0
- package/dist/radio-group/index.d.ts +100 -0
- package/dist/radio-group/index.js +318 -0
- package/dist/radio-group/index.js.map +1 -0
- package/dist/rating/index.d.ts +78 -0
- package/dist/rating/index.js +363 -0
- package/dist/rating/index.js.map +1 -0
- package/dist/scrolling-list/index.d.ts +118 -0
- package/dist/scrolling-list/index.js +1426 -0
- package/dist/scrolling-list/index.js.map +1 -0
- package/dist/segmented-gauge/index.d.ts +100 -0
- package/dist/segmented-gauge/index.js +277 -0
- package/dist/segmented-gauge/index.js.map +1 -0
- package/dist/select/index.d.ts +167 -0
- package/dist/select/index.js +581 -0
- package/dist/select/index.js.map +1 -0
- package/dist/skeleton/index.d.ts +67 -0
- package/dist/skeleton/index.js +206 -0
- package/dist/skeleton/index.js.map +1 -0
- package/dist/slider/index.d.ts +97 -0
- package/dist/slider/index.js +220 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/slot/index.d.ts +16 -0
- package/dist/slot/index.js +51 -0
- package/dist/slot/index.js.map +1 -0
- package/dist/snackbar/index.d.ts +158 -0
- package/dist/snackbar/index.js +1756 -0
- package/dist/snackbar/index.js.map +1 -0
- package/dist/spinner/index.d.ts +21 -0
- package/dist/spinner/index.js +139 -0
- package/dist/spinner/index.js.map +1 -0
- package/dist/stepper/index.d.ts +81 -0
- package/dist/stepper/index.js +1847 -0
- package/dist/stepper/index.js.map +1 -0
- package/dist/switch/index.d.ts +64 -0
- package/dist/switch/index.js +327 -0
- package/dist/switch/index.js.map +1 -0
- package/dist/tabs/index.d.ts +103 -0
- package/dist/tabs/index.js +1376 -0
- package/dist/tabs/index.js.map +1 -0
- package/dist/tag/index.d.ts +29 -0
- package/dist/tag/index.js +283 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/text-link/index.d.ts +20 -0
- package/dist/text-link/index.js +100 -0
- package/dist/text-link/index.js.map +1 -0
- package/dist/textarea/index.d.ts +57 -0
- package/dist/textarea/index.js +797 -0
- package/dist/textarea/index.js.map +1 -0
- package/dist/toast/index.d.ts +56 -0
- package/dist/toast/index.js +1412 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/visually-hidden/index.d.ts +16 -0
- package/dist/visually-hidden/index.js +67 -0
- package/dist/visually-hidden/index.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren, ComponentPropsWithRef } from 'react';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const skeletonStyles: (props?: ({
|
|
7
|
+
isAnimated?: boolean | null | undefined;
|
|
8
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
|
+
type SkeletonStyleProps = ExcludeNull<VariantProps<typeof skeletonStyles>>;
|
|
10
|
+
|
|
11
|
+
interface SkeletonProps extends ComponentPropsWithRef<'div'>, SkeletonStyleProps {
|
|
12
|
+
/**
|
|
13
|
+
* Displays an animated light effect.
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
isAnimated?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Adds an accessible fallback label.
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const Skeleton$1: {
|
|
23
|
+
({ isAnimated, label, className, children, ref: forwardedRef, ...rest }: PropsWithChildren<SkeletonProps>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
declare const skeletonItemStyles: (props?: ({
|
|
28
|
+
shape?: "circle" | "line" | "rectangle" | null | undefined;
|
|
29
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
30
|
+
type SkeletonItemStyleProps = ExcludeNull<VariantProps<typeof skeletonItemStyles>>;
|
|
31
|
+
|
|
32
|
+
interface SkeletonItemProps extends ComponentPropsWithRef<'div'>, SkeletonItemStyleProps {
|
|
33
|
+
}
|
|
34
|
+
type SkeletonRectangleProps = Omit<SkeletonItemProps, 'shape'> & {
|
|
35
|
+
width?: string | number;
|
|
36
|
+
height?: string | number;
|
|
37
|
+
};
|
|
38
|
+
type SkeletonCircleProps = Omit<SkeletonItemProps, 'shape'> & {
|
|
39
|
+
size: string | number;
|
|
40
|
+
};
|
|
41
|
+
type SkeletonLineProps = Omit<SkeletonItemProps, 'shape'> & {
|
|
42
|
+
lines?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the gaps between group items.
|
|
45
|
+
*/
|
|
46
|
+
gap?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
47
|
+
};
|
|
48
|
+
declare const SkeletonRectangle: {
|
|
49
|
+
({ width, height, ...rest }: SkeletonRectangleProps): react_jsx_runtime.JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
declare const SkeletonCircle: {
|
|
53
|
+
({ size, ...rest }: SkeletonCircleProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
displayName: string;
|
|
55
|
+
};
|
|
56
|
+
declare const SkeletonLine: {
|
|
57
|
+
({ lines, gap: gapProp, className, ...rest }: SkeletonLineProps): react_jsx_runtime.JSX.Element;
|
|
58
|
+
displayName: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
declare const Skeleton: typeof Skeleton$1 & {
|
|
62
|
+
Circle: typeof SkeletonCircle;
|
|
63
|
+
Line: typeof SkeletonLine;
|
|
64
|
+
Rectangle: typeof SkeletonRectangle;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { Skeleton, type SkeletonProps };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/skeleton/index.ts
|
|
21
|
+
var skeleton_exports = {};
|
|
22
|
+
__export(skeleton_exports, {
|
|
23
|
+
Skeleton: () => Skeleton2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(skeleton_exports);
|
|
26
|
+
|
|
27
|
+
// src/slot/Slot.tsx
|
|
28
|
+
var import_radix_ui = require("radix-ui");
|
|
29
|
+
var import_react = require("react");
|
|
30
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
var Slottable = import_radix_ui.Slot.Slottable;
|
|
32
|
+
var Slot = ({ ref, ...props }) => {
|
|
33
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Slot.Root, { ref, ...props });
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// src/visually-hidden/VisuallyHidden.tsx
|
|
37
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
38
|
+
var VisuallyHidden = ({ asChild = false, ref, ...props }) => {
|
|
39
|
+
const Component = asChild ? Slot : "span";
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
41
|
+
Component,
|
|
42
|
+
{
|
|
43
|
+
...props,
|
|
44
|
+
ref,
|
|
45
|
+
style: {
|
|
46
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
47
|
+
position: "absolute",
|
|
48
|
+
border: 0,
|
|
49
|
+
width: 1,
|
|
50
|
+
height: 1,
|
|
51
|
+
padding: 0,
|
|
52
|
+
margin: -1,
|
|
53
|
+
overflow: "hidden",
|
|
54
|
+
clip: "rect(0, 0, 0, 0)",
|
|
55
|
+
whiteSpace: "nowrap",
|
|
56
|
+
wordWrap: "normal",
|
|
57
|
+
...props.style
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
VisuallyHidden.displayName = "VisuallyHidden";
|
|
63
|
+
|
|
64
|
+
// src/skeleton/Skeleton.styles.ts
|
|
65
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
66
|
+
var skeletonStyles = (0, import_class_variance_authority.cva)([], {
|
|
67
|
+
variants: {
|
|
68
|
+
isAnimated: {
|
|
69
|
+
true: [
|
|
70
|
+
"[mask-image:linear-gradient(90deg,#000_40%,rgba(0,0,0,.3)_60%,#000_100%)]",
|
|
71
|
+
"[mask-size:200%_100%]",
|
|
72
|
+
"animate-standalone-shimmer motion-reduce:animate-none!"
|
|
73
|
+
],
|
|
74
|
+
false: []
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {
|
|
78
|
+
isAnimated: true
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// src/skeleton/Skeleton.tsx
|
|
83
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
84
|
+
var Skeleton = ({
|
|
85
|
+
isAnimated = true,
|
|
86
|
+
label,
|
|
87
|
+
className,
|
|
88
|
+
children,
|
|
89
|
+
ref: forwardedRef,
|
|
90
|
+
...rest
|
|
91
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
92
|
+
"div",
|
|
93
|
+
{
|
|
94
|
+
ref: forwardedRef,
|
|
95
|
+
"data-spark-component": "skeleton",
|
|
96
|
+
role: "presentation",
|
|
97
|
+
className: skeletonStyles({ isAnimated, className }),
|
|
98
|
+
...rest,
|
|
99
|
+
children: [
|
|
100
|
+
children,
|
|
101
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VisuallyHidden, { children: label })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
Skeleton.displayName = "Skeleton";
|
|
106
|
+
|
|
107
|
+
// src/skeleton/SkeletonItem.styles.ts
|
|
108
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
109
|
+
var skeletonItemStyles = (0, import_class_variance_authority2.cva)(["bg-neutral/dim-4", "min-h-lg min-w-lg"], {
|
|
110
|
+
variants: {
|
|
111
|
+
shape: {
|
|
112
|
+
line: ["w-full [&:last-child:not(:first-child)]:w-5/6", "rounded-lg"],
|
|
113
|
+
rectangle: ["rounded-sm"],
|
|
114
|
+
circle: ["flex-none", "rounded-full"]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
defaultVariants: {
|
|
118
|
+
shape: "rectangle"
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var skeletonLineStyles = (0, import_class_variance_authority2.cva)(["flex flex-col", "w-full"], {
|
|
122
|
+
variants: {
|
|
123
|
+
gap: {
|
|
124
|
+
sm: "gap-sm",
|
|
125
|
+
md: "gap-md",
|
|
126
|
+
lg: "gap-lg",
|
|
127
|
+
xl: "gap-xl",
|
|
128
|
+
"2xl": "gap-2xl",
|
|
129
|
+
"3xl": "gap-3xl"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
defaultVariants: {
|
|
133
|
+
gap: "md"
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
// src/skeleton/SkeletonItem.tsx
|
|
138
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
139
|
+
var getSizeValue = (size) => {
|
|
140
|
+
if (typeof size === "number") return `${size}px`;
|
|
141
|
+
return size;
|
|
142
|
+
};
|
|
143
|
+
var SkeletonItem = ({ shape, className, ref: forwardedRef, ...rest }) => {
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
145
|
+
"div",
|
|
146
|
+
{
|
|
147
|
+
ref: forwardedRef,
|
|
148
|
+
"aria-hidden": "true",
|
|
149
|
+
className: skeletonItemStyles({ shape, className }),
|
|
150
|
+
...rest
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
var SkeletonRectangle = ({ width = "100%", height, ...rest }) => {
|
|
155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
156
|
+
SkeletonItem,
|
|
157
|
+
{
|
|
158
|
+
style: {
|
|
159
|
+
"--skeleton-rect-width": getSizeValue(width),
|
|
160
|
+
"--skeleton-rect-height": getSizeValue(height)
|
|
161
|
+
},
|
|
162
|
+
className: "h-(--skeleton-rect-height) w-(--skeleton-rect-width)",
|
|
163
|
+
...rest,
|
|
164
|
+
shape: "rectangle",
|
|
165
|
+
"data-shape": "rectangle"
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
var SkeletonCircle = ({ size, ...rest }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
170
|
+
SkeletonItem,
|
|
171
|
+
{
|
|
172
|
+
style: { "--skeleton-circle-size": getSizeValue(size) },
|
|
173
|
+
className: "size-(--skeleton-circle-size)",
|
|
174
|
+
...rest,
|
|
175
|
+
shape: "circle",
|
|
176
|
+
"data-shape": "circle"
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
var SkeletonLine = ({
|
|
180
|
+
lines = 1,
|
|
181
|
+
gap: gapProp,
|
|
182
|
+
className,
|
|
183
|
+
...rest
|
|
184
|
+
}) => {
|
|
185
|
+
const gap = gapProp || "md";
|
|
186
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: skeletonLineStyles({ gap, className }), "aria-hidden": "true", children: [...new Array(lines)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SkeletonItem, { ...rest, shape: "line", "data-shape": "line" }, `line_${index}`)) });
|
|
187
|
+
};
|
|
188
|
+
SkeletonRectangle.displayName = "Skeleton.Rectangle";
|
|
189
|
+
SkeletonCircle.displayName = "Skeleton.Circle";
|
|
190
|
+
SkeletonLine.displayName = "Skeleton.Line";
|
|
191
|
+
|
|
192
|
+
// src/skeleton/index.ts
|
|
193
|
+
var Skeleton2 = Object.assign(Skeleton, {
|
|
194
|
+
Circle: SkeletonCircle,
|
|
195
|
+
Line: SkeletonLine,
|
|
196
|
+
Rectangle: SkeletonRectangle
|
|
197
|
+
});
|
|
198
|
+
Skeleton2.displayName = "Skeleton";
|
|
199
|
+
SkeletonLine.displayName = "Skeleton.Line";
|
|
200
|
+
SkeletonCircle.displayName = "Skeleton.Circle";
|
|
201
|
+
SkeletonRectangle.displayName = "Skeleton.Rectangle";
|
|
202
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
203
|
+
0 && (module.exports = {
|
|
204
|
+
Skeleton
|
|
205
|
+
});
|
|
206
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/skeleton/index.ts","../../src/slot/Slot.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/skeleton/Skeleton.styles.ts","../../src/skeleton/Skeleton.tsx","../../src/skeleton/SkeletonItem.styles.ts","../../src/skeleton/SkeletonItem.tsx"],"sourcesContent":["import { Skeleton as Root } from './Skeleton'\nimport {\n SkeletonCircle as Circle,\n SkeletonLine as Line,\n SkeletonRectangle as Rectangle,\n} from './SkeletonItem'\n\nexport const Skeleton: typeof Root & {\n Circle: typeof Circle\n Line: typeof Line\n Rectangle: typeof Rectangle\n} = Object.assign(Root, {\n Circle,\n Line,\n Rectangle,\n})\n\nSkeleton.displayName = 'Skeleton'\nLine.displayName = 'Skeleton.Line'\nCircle.displayName = 'Skeleton.Circle'\nRectangle.displayName = 'Skeleton.Rectangle'\n\nexport type { SkeletonProps } from './Skeleton'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const skeletonStyles = cva([], {\n variants: {\n isAnimated: {\n true: [\n '[mask-image:linear-gradient(90deg,#000_40%,rgba(0,0,0,.3)_60%,#000_100%)]',\n '[mask-size:200%_100%]',\n 'animate-standalone-shimmer motion-reduce:animate-none!',\n ],\n false: [],\n },\n },\n defaultVariants: {\n isAnimated: true,\n },\n})\n\nexport type SkeletonStyleProps = ExcludeNull<VariantProps<typeof skeletonStyles>>\n","import { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { type SkeletonStyleProps, skeletonStyles } from './Skeleton.styles'\n\nexport interface SkeletonProps extends ComponentPropsWithRef<'div'>, SkeletonStyleProps {\n /**\n * Displays an animated light effect.\n * @default true\n */\n isAnimated?: boolean\n /**\n * Adds an accessible fallback label.\n */\n label?: string\n}\n\nexport const Skeleton = ({\n isAnimated = true,\n label,\n className,\n children,\n ref: forwardedRef,\n ...rest\n}: PropsWithChildren<SkeletonProps>) => (\n <div\n ref={forwardedRef}\n data-spark-component=\"skeleton\"\n role=\"presentation\"\n className={skeletonStyles({ isAnimated, className })}\n {...rest}\n >\n {children}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </div>\n)\n\nSkeleton.displayName = 'Skeleton'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const skeletonItemStyles = cva(['bg-neutral/dim-4', 'min-h-lg min-w-lg'], {\n variants: {\n shape: {\n line: ['w-full [&:last-child:not(:first-child)]:w-5/6', 'rounded-lg'],\n rectangle: ['rounded-sm'],\n circle: ['flex-none', 'rounded-full'],\n },\n },\n defaultVariants: {\n shape: 'rectangle',\n },\n})\n\nexport const skeletonLineStyles = cva(['flex flex-col', 'w-full'], {\n variants: {\n gap: {\n sm: 'gap-sm',\n md: 'gap-md',\n lg: 'gap-lg',\n xl: 'gap-xl',\n '2xl': 'gap-2xl',\n '3xl': 'gap-3xl',\n },\n },\n defaultVariants: {\n gap: 'md',\n },\n})\n\nexport type SkeletonItemStyleProps = ExcludeNull<VariantProps<typeof skeletonItemStyles>>\n","import { ComponentPropsWithRef, CSSProperties } from 'react'\n\nimport {\n type SkeletonItemStyleProps,\n skeletonItemStyles,\n skeletonLineStyles,\n} from './SkeletonItem.styles'\n\ninterface SkeletonItemProps extends ComponentPropsWithRef<'div'>, SkeletonItemStyleProps {}\n\nexport type SkeletonRectangleProps = Omit<SkeletonItemProps, 'shape'> & {\n width?: string | number\n height?: string | number\n}\nexport type SkeletonCircleProps = Omit<SkeletonItemProps, 'shape'> & { size: string | number }\nexport type SkeletonLineProps = Omit<SkeletonItemProps, 'shape'> & {\n lines?: number\n /**\n * Sets the gaps between group items.\n */\n gap?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl'\n}\n\nconst getSizeValue = (size?: number | string): string | undefined => {\n if (typeof size === 'number') return `${size}px`\n\n return size\n}\n\nconst SkeletonItem = ({ shape, className, ref: forwardedRef, ...rest }: SkeletonItemProps) => {\n return (\n <div\n ref={forwardedRef}\n aria-hidden=\"true\"\n className={skeletonItemStyles({ shape, className })}\n {...rest}\n />\n )\n}\n\nexport const SkeletonRectangle = ({ width = '100%', height, ...rest }: SkeletonRectangleProps) => {\n return (\n <SkeletonItem\n style={\n {\n '--skeleton-rect-width': getSizeValue(width),\n '--skeleton-rect-height': getSizeValue(height),\n } as CSSProperties\n }\n className=\"h-(--skeleton-rect-height) w-(--skeleton-rect-width)\"\n {...rest}\n shape=\"rectangle\"\n data-shape=\"rectangle\"\n />\n )\n}\n\nexport const SkeletonCircle = ({ size, ...rest }: SkeletonCircleProps) => (\n <SkeletonItem\n style={{ '--skeleton-circle-size': getSizeValue(size) } as CSSProperties}\n className=\"size-(--skeleton-circle-size)\"\n {...rest}\n shape=\"circle\"\n data-shape=\"circle\"\n />\n)\n\nexport const SkeletonLine = ({\n lines = 1,\n gap: gapProp,\n className,\n ...rest\n}: SkeletonLineProps) => {\n const gap = gapProp || 'md'\n\n return (\n <div className={skeletonLineStyles({ gap, className })} aria-hidden=\"true\">\n {[...new Array(lines)].map((_, index) => (\n <SkeletonItem key={`line_${index}`} {...rest} shape=\"line\" data-shape=\"line\" />\n ))}\n </div>\n )\n}\n\nSkeletonRectangle.displayName = 'Skeleton.Rectangle'\nSkeletonCircle.displayName = 'Skeleton.Circle'\nSkeletonLine.displayName = 'Skeleton.Line'\n"],"mappings":"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","names":["Skeleton","RadixSlot","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","Skeleton"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Slider as Slider$2 } from 'radix-ui';
|
|
3
|
+
import { PropsWithChildren, Ref } from 'react';
|
|
4
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare const rangeVariants: (props?: ({
|
|
8
|
+
intent?: "main" | "alert" | "support" | "accent" | "basic" | "info" | "neutral" | "success" | "error" | null | undefined;
|
|
9
|
+
shape?: "rounded" | "square" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
type SliderRangeVariantsProps = VariantProps<typeof rangeVariants>;
|
|
12
|
+
|
|
13
|
+
interface SliderProps extends Omit<Slider$2.SliderProps, 'dir' | 'orientation' | 'inverted' | 'minStepsBetweenThumbs'>, PropsWithChildren<SliderRangeVariantsProps> {
|
|
14
|
+
/**
|
|
15
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The value of the slider when initially rendered. Use when you do not need to control the state of the slider.
|
|
21
|
+
*/
|
|
22
|
+
defaultValue?: number[];
|
|
23
|
+
/**
|
|
24
|
+
* The controlled value of the slider. Must be used in conjunction with `onValueChange`.
|
|
25
|
+
*/
|
|
26
|
+
value?: number[];
|
|
27
|
+
/**
|
|
28
|
+
* Event handler called when the value changes.
|
|
29
|
+
*/
|
|
30
|
+
onValueChange?: (value: number[]) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Event handler called when the value changes at the end of an interaction. Useful when you only need to capture a final value e.g. to update a backend service.
|
|
33
|
+
*/
|
|
34
|
+
onValueCommit?: (value: number[]) => void;
|
|
35
|
+
/**
|
|
36
|
+
* The name of the slider. Submitted with its owning form as part of a name/value pair.
|
|
37
|
+
*/
|
|
38
|
+
name?: string;
|
|
39
|
+
/**
|
|
40
|
+
* When `true`, prevents the user from interacting with the slider.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The minimum value for the range.
|
|
46
|
+
* @default 0
|
|
47
|
+
*/
|
|
48
|
+
min?: number;
|
|
49
|
+
/**
|
|
50
|
+
* The maximum value for the range.
|
|
51
|
+
* @default 100
|
|
52
|
+
*/
|
|
53
|
+
max?: number;
|
|
54
|
+
/**
|
|
55
|
+
* The stepping interval.
|
|
56
|
+
* @default 1
|
|
57
|
+
*/
|
|
58
|
+
step?: number;
|
|
59
|
+
ref?: Ref<HTMLDivElement>;
|
|
60
|
+
}
|
|
61
|
+
declare const Slider$1: {
|
|
62
|
+
({ asChild, intent, shape, children, className, ref, ...rest }: SliderProps): react_jsx_runtime.JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
interface SliderThumbProps extends Slider$2.SliderThumbProps {
|
|
67
|
+
/**
|
|
68
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
asChild?: boolean;
|
|
72
|
+
ref?: Ref<HTMLSpanElement>;
|
|
73
|
+
}
|
|
74
|
+
declare const SliderThumb: {
|
|
75
|
+
({ asChild, className, onPointerDown, onKeyDown, onBlur, ref: forwardedRef, ...rest }: SliderThumbProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
displayName: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
interface SliderTrackProps extends Slider$2.SliderTrackProps, Slider$2.SliderRangeProps {
|
|
80
|
+
/**
|
|
81
|
+
* Change the default rendered element for the one passed as a child, merging their props and behavior.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
ref?: Ref<HTMLDivElement>;
|
|
86
|
+
}
|
|
87
|
+
declare const SliderTrack: {
|
|
88
|
+
({ asChild, className, ref, ...rest }: SliderTrackProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
displayName: string;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
declare const Slider: typeof Slider$1 & {
|
|
93
|
+
Thumb: typeof SliderThumb;
|
|
94
|
+
Track: typeof SliderTrack;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { Slider, type SliderProps, type SliderThumbProps, type SliderTrackProps };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/slider/index.ts
|
|
21
|
+
var slider_exports = {};
|
|
22
|
+
__export(slider_exports, {
|
|
23
|
+
Slider: () => Slider2
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(slider_exports);
|
|
26
|
+
|
|
27
|
+
// src/slider/Slider.tsx
|
|
28
|
+
var import_radix_ui = require("radix-ui");
|
|
29
|
+
|
|
30
|
+
// src/slider/Slider.styles.ts
|
|
31
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
32
|
+
var rootStyles = (0, import_class_variance_authority.cva)([
|
|
33
|
+
"flex relative h-sz-24 items-center",
|
|
34
|
+
"touch-none select-none",
|
|
35
|
+
"data-disabled:cursor-not-allowed data-disabled:opacity-dim-3"
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
// src/slider/SliderContext.tsx
|
|
39
|
+
var import_react = require("react");
|
|
40
|
+
var SliderContext = (0, import_react.createContext)({});
|
|
41
|
+
var useSliderContext = () => (0, import_react.useContext)(SliderContext);
|
|
42
|
+
|
|
43
|
+
// src/slider/Slider.tsx
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var Slider = ({
|
|
46
|
+
asChild = false,
|
|
47
|
+
intent = "basic",
|
|
48
|
+
shape = "square",
|
|
49
|
+
children,
|
|
50
|
+
className,
|
|
51
|
+
ref,
|
|
52
|
+
...rest
|
|
53
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SliderContext.Provider, { value: { intent, shape }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_radix_ui.Slider.Root,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
"data-spark-component": "slider",
|
|
58
|
+
asChild,
|
|
59
|
+
className: rootStyles({ className }),
|
|
60
|
+
dir: "ltr",
|
|
61
|
+
orientation: "horizontal",
|
|
62
|
+
inverted: false,
|
|
63
|
+
minStepsBetweenThumbs: 0,
|
|
64
|
+
...rest,
|
|
65
|
+
children
|
|
66
|
+
}
|
|
67
|
+
) });
|
|
68
|
+
Slider.displayName = "Slider";
|
|
69
|
+
|
|
70
|
+
// src/slider/SliderThumb.tsx
|
|
71
|
+
var import_radix_ui2 = require("radix-ui");
|
|
72
|
+
var import_react2 = require("react");
|
|
73
|
+
|
|
74
|
+
// src/slider/SliderThumb.styles.ts
|
|
75
|
+
var import_class_variance_authority2 = require("class-variance-authority");
|
|
76
|
+
var thumbVariants = (0, import_class_variance_authority2.cva)(
|
|
77
|
+
[
|
|
78
|
+
"block h-sz-24 w-sz-24 rounded-full cursor-pointer",
|
|
79
|
+
"outline-hidden",
|
|
80
|
+
"focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-focus",
|
|
81
|
+
"data-[interaction=pointerdown]:focus-visible:ring-0!",
|
|
82
|
+
"data-disabled:hover:ring-0 data-disabled:hover:after:w-0 data-disabled:hover:after:h-0 data-disabled:cursor-not-allowed",
|
|
83
|
+
"after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:z-hide",
|
|
84
|
+
"after:w-0 after:h-0 after:rounded-full after:border-solid after:border-sm after:transition-all duration-300",
|
|
85
|
+
"hover:after:w-sz-32 hover:after:h-sz-32"
|
|
86
|
+
],
|
|
87
|
+
{
|
|
88
|
+
variants: {
|
|
89
|
+
intent: {
|
|
90
|
+
main: ["bg-main", "after:bg-main-container after:border-main"],
|
|
91
|
+
support: ["bg-support", "after:bg-support-container after:border-support"],
|
|
92
|
+
accent: ["bg-accent", "after:bg-accent-container after:border-accent"],
|
|
93
|
+
basic: ["bg-basic", "after:bg-basic-container after:border-basic"],
|
|
94
|
+
info: ["bg-info", "after:bg-info-container after:border-info"],
|
|
95
|
+
neutral: ["bg-neutral", "after:bg-neutral-container after:border-neutral"],
|
|
96
|
+
success: ["bg-success", "after:bg-success-container after:border-success"],
|
|
97
|
+
alert: ["bg-alert", "after:bg-alert-container after:border-alert"],
|
|
98
|
+
error: ["bg-error", "after:bg-error-container after:border-error"]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
defaultVariants: {
|
|
102
|
+
intent: "basic"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// src/slider/SliderThumb.tsx
|
|
108
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
109
|
+
var SliderThumb = ({
|
|
110
|
+
asChild = false,
|
|
111
|
+
className,
|
|
112
|
+
onPointerDown,
|
|
113
|
+
onKeyDown,
|
|
114
|
+
onBlur,
|
|
115
|
+
ref: forwardedRef,
|
|
116
|
+
...rest
|
|
117
|
+
}) => {
|
|
118
|
+
const { intent } = useSliderContext();
|
|
119
|
+
const innerRef = (0, import_react2.useRef)(null);
|
|
120
|
+
const ref = forwardedRef || innerRef;
|
|
121
|
+
const setInteractionType = (e) => {
|
|
122
|
+
if (typeof ref === "function" || !ref.current) return;
|
|
123
|
+
ref.current.dataset.interaction = e.type;
|
|
124
|
+
};
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
126
|
+
import_radix_ui2.Slider.Thumb,
|
|
127
|
+
{
|
|
128
|
+
"data-spark-component": "slider-thumb",
|
|
129
|
+
ref,
|
|
130
|
+
asChild,
|
|
131
|
+
onPointerDown: (e) => {
|
|
132
|
+
setInteractionType(e);
|
|
133
|
+
onPointerDown?.(e);
|
|
134
|
+
},
|
|
135
|
+
onKeyDown: (e) => {
|
|
136
|
+
setInteractionType(e);
|
|
137
|
+
onKeyDown?.(e);
|
|
138
|
+
},
|
|
139
|
+
onBlur: (e) => {
|
|
140
|
+
setInteractionType(e);
|
|
141
|
+
onBlur?.(e);
|
|
142
|
+
},
|
|
143
|
+
className: thumbVariants({ intent, className }),
|
|
144
|
+
...rest
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
SliderThumb.displayName = "Slider.Thumb";
|
|
149
|
+
|
|
150
|
+
// src/slider/SliderTrack.tsx
|
|
151
|
+
var import_radix_ui3 = require("radix-ui");
|
|
152
|
+
|
|
153
|
+
// src/slider/SliderTrack.styles.ts
|
|
154
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
155
|
+
var trackVariants = (0, import_class_variance_authority3.cva)(["relative grow h-sz-4 bg-on-background/dim-4"], {
|
|
156
|
+
variants: {
|
|
157
|
+
shape: {
|
|
158
|
+
rounded: "rounded-sm",
|
|
159
|
+
square: "rounded-0"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
defaultVariants: {
|
|
163
|
+
shape: "square"
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
var rangeVariants = (0, import_class_variance_authority3.cva)(["absolute h-full"], {
|
|
167
|
+
variants: {
|
|
168
|
+
intent: {
|
|
169
|
+
main: ["bg-main"],
|
|
170
|
+
support: ["bg-support"],
|
|
171
|
+
accent: ["bg-accent"],
|
|
172
|
+
basic: ["bg-basic"],
|
|
173
|
+
info: ["bg-info"],
|
|
174
|
+
neutral: ["bg-neutral"],
|
|
175
|
+
success: ["bg-success"],
|
|
176
|
+
alert: ["bg-alert"],
|
|
177
|
+
error: ["bg-error"]
|
|
178
|
+
},
|
|
179
|
+
shape: {
|
|
180
|
+
rounded: "rounded-sm",
|
|
181
|
+
square: "rounded-0"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
defaultVariants: {
|
|
185
|
+
intent: "basic",
|
|
186
|
+
shape: "square"
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// src/slider/SliderTrack.tsx
|
|
191
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
192
|
+
var SliderTrack = ({ asChild = false, className, ref, ...rest }) => {
|
|
193
|
+
const { intent, shape } = useSliderContext();
|
|
194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
195
|
+
import_radix_ui3.Slider.Track,
|
|
196
|
+
{
|
|
197
|
+
"data-spark-component": "slider-track",
|
|
198
|
+
ref,
|
|
199
|
+
asChild,
|
|
200
|
+
className: trackVariants({ shape }),
|
|
201
|
+
...rest,
|
|
202
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_radix_ui3.Slider.Range, { className: rangeVariants({ intent, shape, className }) })
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
SliderTrack.displayName = "Slider.Track";
|
|
207
|
+
|
|
208
|
+
// src/slider/index.ts
|
|
209
|
+
var Slider2 = Object.assign(Slider, {
|
|
210
|
+
Thumb: SliderThumb,
|
|
211
|
+
Track: SliderTrack
|
|
212
|
+
});
|
|
213
|
+
Slider2.displayName = "Slider";
|
|
214
|
+
SliderThumb.displayName = "Slider.Thumb";
|
|
215
|
+
SliderTrack.displayName = "Slider.Track";
|
|
216
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
217
|
+
0 && (module.exports = {
|
|
218
|
+
Slider
|
|
219
|
+
});
|
|
220
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/slider/index.ts","../../src/slider/Slider.tsx","../../src/slider/Slider.styles.ts","../../src/slider/SliderContext.tsx","../../src/slider/SliderThumb.tsx","../../src/slider/SliderThumb.styles.ts","../../src/slider/SliderTrack.tsx","../../src/slider/SliderTrack.styles.ts"],"sourcesContent":["import { Slider as Root, type SliderProps } from './Slider'\nimport { SliderThumb as Thumb, type SliderThumbProps } from './SliderThumb'\nimport { SliderTrack as Track, type SliderTrackProps } from './SliderTrack'\n\nexport const Slider: typeof Root & {\n Thumb: typeof Thumb\n Track: typeof Track\n} = Object.assign(Root, {\n Thumb,\n Track,\n})\n\nSlider.displayName = 'Slider'\nThumb.displayName = 'Slider.Thumb'\nTrack.displayName = 'Slider.Track'\n\nexport type { SliderProps, SliderThumbProps, SliderTrackProps }\n","import { Slider as RadixSlider } from 'radix-ui'\nimport { type PropsWithChildren, Ref } from 'react'\n\nimport { rootStyles } from './Slider.styles'\nimport { SliderContext } from './SliderContext'\nimport type { SliderRangeVariantsProps } from './SliderTrack.styles'\n\nexport interface SliderProps\n extends Omit<\n RadixSlider.SliderProps,\n 'dir' | 'orientation' | 'inverted' | 'minStepsBetweenThumbs'\n >,\n PropsWithChildren<SliderRangeVariantsProps> {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean\n /**\n * The value of the slider when initially rendered. Use when you do not need to control the state of the slider.\n */\n defaultValue?: number[]\n /**\n * The controlled value of the slider. Must be used in conjunction with `onValueChange`.\n */\n value?: number[]\n /**\n * Event handler called when the value changes.\n */\n onValueChange?: (value: number[]) => void\n /**\n * Event handler called when the value changes at the end of an interaction. Useful when you only need to capture a final value e.g. to update a backend service.\n */\n onValueCommit?: (value: number[]) => void\n /**\n * The name of the slider. Submitted with its owning form as part of a name/value pair.\n */\n name?: string\n /**\n * When `true`, prevents the user from interacting with the slider.\n * @default false\n */\n disabled?: boolean\n /**\n * The minimum value for the range.\n * @default 0\n */\n min?: number\n /**\n * The maximum value for the range.\n * @default 100\n */\n max?: number\n /**\n * The stepping interval.\n * @default 1\n */\n step?: number\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Slider = ({\n asChild = false,\n intent = 'basic',\n shape = 'square',\n children,\n className,\n ref,\n ...rest\n}: SliderProps) => (\n <SliderContext.Provider value={{ intent, shape }}>\n <RadixSlider.Root\n ref={ref}\n data-spark-component=\"slider\"\n asChild={asChild}\n className={rootStyles({ className })}\n dir=\"ltr\"\n orientation=\"horizontal\"\n inverted={false}\n minStepsBetweenThumbs={0}\n {...rest}\n >\n {children}\n </RadixSlider.Root>\n </SliderContext.Provider>\n)\n\nSlider.displayName = 'Slider'\n","import { cva } from 'class-variance-authority'\n\nexport const rootStyles = cva([\n 'flex relative h-sz-24 items-center',\n 'touch-none select-none',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-dim-3',\n])\n","import { createContext, useContext } from 'react'\n\nimport type { SliderProps } from './Slider'\n\nexport type SliderContextInterface = Pick<SliderProps, 'intent' | 'shape'>\n\nexport const SliderContext = createContext<SliderContextInterface>({} as SliderContextInterface)\n\nexport const useSliderContext = () => useContext(SliderContext)\n","import { Slider as RadixSlider } from 'radix-ui'\nimport { type FocusEvent, type KeyboardEvent, type PointerEvent, Ref, useRef } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { thumbVariants } from './SliderThumb.styles'\n\nexport interface SliderThumbProps extends RadixSlider.SliderThumbProps {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLSpanElement>\n}\n\nexport const SliderThumb = ({\n asChild = false,\n className,\n onPointerDown,\n onKeyDown,\n onBlur,\n ref: forwardedRef,\n ...rest\n}: SliderThumbProps) => {\n const { intent } = useSliderContext()\n\n const innerRef = useRef(null)\n const ref = forwardedRef || innerRef\n\n const setInteractionType = (e: KeyboardEvent | FocusEvent | PointerEvent) => {\n /**\n * Radix Slider implementation uses `.focus()` and thus prevent us to handle\n * distinctively focus/focus-visible styles. So we use a `data-interaction` attribute to stay\n * aware of the type of event, and adapt styles if needed.\n */\n if (typeof ref === 'function' || !ref.current) return\n ref.current.dataset.interaction = e.type\n }\n\n return (\n <RadixSlider.Thumb\n data-spark-component=\"slider-thumb\"\n ref={ref}\n asChild={asChild}\n onPointerDown={(e: PointerEvent<HTMLSpanElement>) => {\n setInteractionType(e)\n onPointerDown?.(e)\n }}\n onKeyDown={(e: KeyboardEvent<HTMLSpanElement>) => {\n setInteractionType(e)\n onKeyDown?.(e)\n }}\n onBlur={(e: FocusEvent<HTMLSpanElement>) => {\n setInteractionType(e)\n onBlur?.(e)\n }}\n className={thumbVariants({ intent, className })}\n {...rest}\n />\n )\n}\n\nSliderThumb.displayName = 'Slider.Thumb'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const thumbVariants = cva(\n [\n 'block h-sz-24 w-sz-24 rounded-full cursor-pointer',\n 'outline-hidden',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-focus',\n 'data-[interaction=pointerdown]:focus-visible:ring-0!',\n 'data-disabled:hover:ring-0 data-disabled:hover:after:w-0 data-disabled:hover:after:h-0 data-disabled:cursor-not-allowed',\n 'after:absolute after:left-1/2 after:top-1/2 after:-translate-x-1/2 after:-translate-y-1/2 after:z-hide',\n 'after:w-0 after:h-0 after:rounded-full after:border-solid after:border-sm after:transition-all duration-300',\n 'hover:after:w-sz-32 hover:after:h-sz-32',\n ],\n {\n variants: {\n intent: {\n main: ['bg-main', 'after:bg-main-container after:border-main'],\n support: ['bg-support', 'after:bg-support-container after:border-support'],\n accent: ['bg-accent', 'after:bg-accent-container after:border-accent'],\n basic: ['bg-basic', 'after:bg-basic-container after:border-basic'],\n info: ['bg-info', 'after:bg-info-container after:border-info'],\n neutral: ['bg-neutral', 'after:bg-neutral-container after:border-neutral'],\n success: ['bg-success', 'after:bg-success-container after:border-success'],\n alert: ['bg-alert', 'after:bg-alert-container after:border-alert'],\n error: ['bg-error', 'after:bg-error-container after:border-error'],\n },\n },\n defaultVariants: {\n intent: 'basic',\n },\n }\n)\n\nexport type SliderThumbVariantsProps = VariantProps<typeof thumbVariants>\n","import { Slider as RadixSlider } from 'radix-ui'\nimport { Ref } from 'react'\n\nimport { useSliderContext } from './SliderContext'\nimport { rangeVariants, trackVariants } from './SliderTrack.styles'\n\nexport interface SliderTrackProps\n extends RadixSlider.SliderTrackProps,\n RadixSlider.SliderRangeProps {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default false\n */\n asChild?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const SliderTrack = ({ asChild = false, className, ref, ...rest }: SliderTrackProps) => {\n const { intent, shape } = useSliderContext()\n\n return (\n <RadixSlider.Track\n data-spark-component=\"slider-track\"\n ref={ref}\n asChild={asChild}\n className={trackVariants({ shape })}\n {...rest}\n >\n <RadixSlider.Range className={rangeVariants({ intent, shape, className })} />\n </RadixSlider.Track>\n )\n}\n\nSliderTrack.displayName = 'Slider.Track'\n","import { cva, VariantProps } from 'class-variance-authority'\n\nexport const trackVariants = cva(['relative grow h-sz-4 bg-on-background/dim-4'], {\n variants: {\n shape: {\n rounded: 'rounded-sm',\n square: 'rounded-0',\n },\n },\n defaultVariants: {\n shape: 'square',\n },\n})\n\nexport const rangeVariants = cva(['absolute h-full'], {\n variants: {\n intent: {\n main: ['bg-main'],\n support: ['bg-support'],\n accent: ['bg-accent'],\n basic: ['bg-basic'],\n info: ['bg-info'],\n neutral: ['bg-neutral'],\n success: ['bg-success'],\n alert: ['bg-alert'],\n error: ['bg-error'],\n },\n shape: {\n rounded: 'rounded-sm',\n square: 'rounded-0',\n },\n },\n defaultVariants: {\n intent: 'basic',\n shape: 'square',\n },\n})\n\nexport type SliderRangeVariantsProps = VariantProps<typeof rangeVariants>\n"],"mappings":"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","names":["Slider","RadixSlider","import_radix_ui","import_react","import_class_variance_authority","import_jsx_runtime","RadixSlider","import_radix_ui","import_class_variance_authority","import_jsx_runtime","RadixSlider","Slider"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { Slot as Slot$1 } from 'radix-ui';
|
|
3
|
+
import { PropsWithChildren, HTMLAttributes, Ref, ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
declare const Slottable: typeof Slot$1.Slottable;
|
|
6
|
+
type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {
|
|
7
|
+
ref?: Ref<HTMLElement>;
|
|
8
|
+
};
|
|
9
|
+
declare const Slot: ({ ref, ...props }: SlotProps) => react_jsx_runtime.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* When using Radix `Slot` component, it will consider its first child to merge its props with.
|
|
12
|
+
* In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.
|
|
13
|
+
*/
|
|
14
|
+
declare const wrapPolymorphicSlot: (asChild: boolean | undefined, children: ReactNode, callback: (children: ReactNode) => ReactNode) => ReactNode;
|
|
15
|
+
|
|
16
|
+
export { Slot, type SlotProps, Slottable, wrapPolymorphicSlot };
|