@firecms/ui 3.0.0-canary.133 → 3.0.0-canary.134
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/components/DialogTitle.d.ts +9 -0
- package/dist/components/Slider.d.ts +21 -0
- package/dist/components/Typography.d.ts +5 -4
- package/dist/components/index.d.ts +2 -0
- package/dist/index.es.js +116 -8
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +118 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +3 -3
- package/package.json +4 -2
- package/src/components/DialogTitle.tsx +34 -0
- package/src/components/ExpandablePanel.tsx +1 -1
- package/src/components/Sheet.tsx +1 -0
- package/src/components/Slider.tsx +109 -0
- package/src/components/Typography.tsx +8 -7
- package/src/components/index.tsx +2 -0
- package/src/styles.ts +3 -3
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { TypographyProps, TypographyVariant } from "./Typography";
|
3
|
+
export type DialogContentProps = TypographyProps & {
|
4
|
+
children: React.ReactNode;
|
5
|
+
hidden?: boolean;
|
6
|
+
className?: string;
|
7
|
+
variant?: TypographyVariant;
|
8
|
+
};
|
9
|
+
export declare function DialogTitle({ children, hidden, className, variant, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
export interface SliderProps {
|
3
|
+
className?: string;
|
4
|
+
name?: string;
|
5
|
+
disabled?: boolean;
|
6
|
+
orientation?: React.AriaAttributes["aria-orientation"];
|
7
|
+
dir?: "ltr" | "rtl";
|
8
|
+
min?: number;
|
9
|
+
max?: number;
|
10
|
+
step?: number;
|
11
|
+
minStepsBetweenThumbs?: number;
|
12
|
+
value?: number[];
|
13
|
+
defaultValue?: number[];
|
14
|
+
onValueChange?: (value: number[]) => void;
|
15
|
+
onValueCommit?: (value: number[]) => void;
|
16
|
+
inverted?: boolean;
|
17
|
+
form?: string;
|
18
|
+
size?: "small" | "regular";
|
19
|
+
}
|
20
|
+
declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLSpanElement>>;
|
21
|
+
export { Slider };
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { ReactEventHandler } from "react";
|
2
|
-
export type
|
2
|
+
export type TypographyVariant = keyof typeof typographyVariants;
|
3
|
+
export type TypographyProps<C extends React.ElementType = "span"> = {
|
3
4
|
align?: "center" | "inherit" | "justify" | "left" | "right";
|
4
5
|
children?: React.ReactNode;
|
5
6
|
className?: string;
|
@@ -7,7 +8,7 @@ export type TextProps<C extends React.ElementType> = {
|
|
7
8
|
gutterBottom?: boolean;
|
8
9
|
noWrap?: boolean;
|
9
10
|
paragraph?: boolean;
|
10
|
-
variant?:
|
11
|
+
variant?: TypographyVariant;
|
11
12
|
variantMapping?: {
|
12
13
|
[key: string]: string;
|
13
14
|
};
|
@@ -15,7 +16,7 @@ export type TextProps<C extends React.ElementType> = {
|
|
15
16
|
onClick?: ReactEventHandler<HTMLElement>;
|
16
17
|
style?: React.CSSProperties;
|
17
18
|
} & React.ComponentPropsWithoutRef<C>;
|
18
|
-
declare const
|
19
|
+
declare const typographyVariants: {
|
19
20
|
h1: string;
|
20
21
|
h2: string;
|
21
22
|
h3: string;
|
@@ -31,5 +32,5 @@ declare const defaultVariantMapping: {
|
|
31
32
|
caption: string;
|
32
33
|
button: string;
|
33
34
|
};
|
34
|
-
export declare function Typography<C extends React.ElementType>({ align, color, children, className, component, gutterBottom, noWrap, paragraph, variant, variantMapping, style, onClick, ...other }:
|
35
|
+
export declare function Typography<C extends React.ElementType = "span">({ align, color, children, className, component, gutterBottom, noWrap, paragraph, variant, variantMapping, style, onClick, ...other }: TypographyProps<C>): import("react/jsx-runtime").JSX.Element;
|
35
36
|
export {};
|
@@ -15,6 +15,7 @@ export * from "./DateTimeField";
|
|
15
15
|
export * from "./Dialog";
|
16
16
|
export * from "./DialogActions";
|
17
17
|
export * from "./DialogContent";
|
18
|
+
export * from "./DialogTitle";
|
18
19
|
export * from "./ExpandablePanel";
|
19
20
|
export * from "./FileUpload";
|
20
21
|
export * from "./IconButton";
|
@@ -31,6 +32,7 @@ export * from "./RadioGroup";
|
|
31
32
|
export * from "./SearchBar";
|
32
33
|
export * from "./Select";
|
33
34
|
export * from "./Separator";
|
35
|
+
export * from "./Slider";
|
34
36
|
export * from "./Sheet";
|
35
37
|
export * from "./TextareaAutosize";
|
36
38
|
export * from "./TextField";
|
package/dist/index.es.js
CHANGED
@@ -10,6 +10,7 @@ import { registerLocale, setDefaultLocale } from "react-datepicker";
|
|
10
10
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
11
11
|
import "material-icons/iconfont/filled.css";
|
12
12
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
13
|
+
import * as VisuallyHidden from "@radix-ui/react-visually-hidden";
|
13
14
|
import { useDropzone } from "react-dropzone";
|
14
15
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
15
16
|
import equal from "react-fast-compare";
|
@@ -21,8 +22,9 @@ import { Command } from "cmdk";
|
|
21
22
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
22
23
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
23
24
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
24
|
-
import * as
|
25
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
25
26
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
27
|
+
import * as ReactDOM from "react-dom";
|
26
28
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
27
29
|
const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
28
30
|
const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-slate-100 focus:dark:bg-gray-800 focus:dark:bg-opacity-60";
|
@@ -31,9 +33,9 @@ const fieldBackgroundMixin = "bg-opacity-50 bg-slate-200 dark:bg-gray-800 dark:b
|
|
31
33
|
const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-slate-100 dark:bg-gray-800 dark:bg-opacity-0";
|
32
34
|
const fieldBackgroundDisabledMixin = "dark:bg-gray-800 bg-opacity-50 dark:bg-opacity-90";
|
33
35
|
const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-gray-700 dark:hover:bg-opacity-40";
|
34
|
-
const defaultBorderMixin = "border-gray-
|
35
|
-
const paperMixin = "bg-white rounded-md dark:bg-gray-950 border
|
36
|
-
const cardMixin = "bg-white border border-gray-
|
36
|
+
const defaultBorderMixin = "border-gray-200 border-opacity-40 dark:border-gray-700 dark:border-opacity-50";
|
37
|
+
const paperMixin = "bg-white rounded-md dark:bg-gray-950 border border-gray-200 border-opacity-40 dark:border-gray-700 dark:border-opacity-50";
|
38
|
+
const cardMixin = "bg-white border border-gray-200 border-opacity-40 dark:border-transparent rounded-md dark:bg-gray-950 dark:border-gray-700 dark:border-opacity-50 m-1 -p-1";
|
37
39
|
const cardClickableMixin = "hover:bg-primary-bg dark:hover:bg-primary-bg hover:bg-opacity-20 dark:hover:bg-opacity-20 hover:ring-2 hover:ring-primary cursor-pointer";
|
38
40
|
const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30 dark:bg-opacity-10 ring-1 ring-primary ring-opacity-75";
|
39
41
|
function cls(...classes) {
|
@@ -13747,7 +13749,7 @@ const InputLabel = React.forwardRef(function InputLabel2(inProps, ref) {
|
|
13747
13749
|
}
|
13748
13750
|
);
|
13749
13751
|
});
|
13750
|
-
const
|
13752
|
+
const typographyVariants = {
|
13751
13753
|
h1: "h1",
|
13752
13754
|
h2: "h2",
|
13753
13755
|
h3: "h3",
|
@@ -13813,12 +13815,12 @@ function Typography({
|
|
13813
13815
|
noWrap = false,
|
13814
13816
|
paragraph = false,
|
13815
13817
|
variant = "body1",
|
13816
|
-
variantMapping =
|
13818
|
+
variantMapping = typographyVariants,
|
13817
13819
|
style,
|
13818
13820
|
onClick,
|
13819
13821
|
...other
|
13820
13822
|
}) {
|
13821
|
-
const Component = component || (paragraph ? "p" : variantMapping[variant] ||
|
13823
|
+
const Component = component || (paragraph ? "p" : variantMapping[variant] || typographyVariants[variant]) || "span";
|
13822
13824
|
const classes = cls(
|
13823
13825
|
variantToClasses[variant],
|
13824
13826
|
color ? colorToClasses[color] : "",
|
@@ -14934,6 +14936,27 @@ function DialogContent({
|
|
14934
14936
|
}
|
14935
14937
|
);
|
14936
14938
|
}
|
14939
|
+
function DialogTitle({
|
14940
|
+
children,
|
14941
|
+
hidden,
|
14942
|
+
className,
|
14943
|
+
variant = "h4",
|
14944
|
+
...props
|
14945
|
+
}) {
|
14946
|
+
const title = /* @__PURE__ */ jsx(DialogPrimitive.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
14947
|
+
Typography,
|
14948
|
+
{
|
14949
|
+
variant,
|
14950
|
+
className,
|
14951
|
+
...props,
|
14952
|
+
children
|
14953
|
+
}
|
14954
|
+
) });
|
14955
|
+
if (hidden) {
|
14956
|
+
return /* @__PURE__ */ jsx(VisuallyHidden.Root, { children: title });
|
14957
|
+
}
|
14958
|
+
return title;
|
14959
|
+
}
|
14937
14960
|
function ExpandablePanel({
|
14938
14961
|
title,
|
14939
14962
|
children,
|
@@ -15008,7 +15031,7 @@ function ExpandablePanel({
|
|
15008
15031
|
Collapsible.Trigger,
|
15009
15032
|
{
|
15010
15033
|
className: cls(
|
15011
|
-
"rounded flex items-center justify-between w-full min-h-[52px]",
|
15034
|
+
"rounded-t flex items-center justify-between w-full min-h-[52px]",
|
15012
15035
|
"hover:bg-slate-200 hover:bg-opacity-20 dark:hover:bg-gray-800 dark:hover:bg-opacity-20",
|
15013
15036
|
invisible ? "border-b px-2" : "p-4",
|
15014
15037
|
invisible && defaultBorderMixin,
|
@@ -16188,6 +16211,88 @@ function SelectGroup({
|
|
16188
16211
|
children
|
16189
16212
|
] });
|
16190
16213
|
}
|
16214
|
+
function SliderThumb(props) {
|
16215
|
+
return /* @__PURE__ */ jsxs(TooltipPrimitive.Root, { open: props.hovered, children: [
|
16216
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
16217
|
+
SliderPrimitive.Thumb,
|
16218
|
+
{
|
16219
|
+
className: cls(
|
16220
|
+
{
|
16221
|
+
"border-primary bg-primary hover:bg-primary-dark focus-visible:ring-4 focus-visible:ring-primary outline-none focus-visible:ring-opacity-50": !props.props.disabled,
|
16222
|
+
"border-slate-300 bg-slate-300 dark:border-gray-700 dark:bg-gray-700": props.props.disabled
|
16223
|
+
},
|
16224
|
+
props.classes,
|
16225
|
+
"focus:ring-8 focus:ring-primary focus:ring-opacity-75",
|
16226
|
+
"hover:ring-8 hover:ring-primary hover:ring-opacity-75",
|
16227
|
+
"block rounded-full transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
16228
|
+
)
|
16229
|
+
}
|
16230
|
+
) }),
|
16231
|
+
/* @__PURE__ */ jsx(
|
16232
|
+
TooltipPrimitive.Content,
|
16233
|
+
{
|
16234
|
+
side: "top",
|
16235
|
+
sideOffset: 5,
|
16236
|
+
className: cls(
|
16237
|
+
"TooltipContent",
|
16238
|
+
"max-w-lg leading-relaxed",
|
16239
|
+
"z-50 rounded px-3 py-2 text-xs leading-none bg-slate-700 dark:bg-slate-800 bg-opacity-90 font-medium text-slate-50 shadow-2xl select-none duration-400 ease-in transform opacity-100"
|
16240
|
+
),
|
16241
|
+
children: props.props.value?.[props.index]
|
16242
|
+
}
|
16243
|
+
)
|
16244
|
+
] });
|
16245
|
+
}
|
16246
|
+
const Slider = React.forwardRef(({
|
16247
|
+
className,
|
16248
|
+
size = "regular",
|
16249
|
+
...props
|
16250
|
+
}, ref) => {
|
16251
|
+
const [hovered, setHovered] = React.useState(false);
|
16252
|
+
const thumbSizeClasses = size === "small" ? "h-4 w-4" : "h-6 w-6";
|
16253
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxs(
|
16254
|
+
SliderPrimitive.Root,
|
16255
|
+
{
|
16256
|
+
ref,
|
16257
|
+
onMouseEnter: () => setHovered(true),
|
16258
|
+
onMouseLeave: () => setHovered(false),
|
16259
|
+
className: cls(
|
16260
|
+
"relative flex w-full touch-none select-none items-center",
|
16261
|
+
className
|
16262
|
+
),
|
16263
|
+
...props,
|
16264
|
+
children: [
|
16265
|
+
/* @__PURE__ */ jsx(
|
16266
|
+
SliderPrimitive.Track,
|
16267
|
+
{
|
16268
|
+
style: { height: size === "small" ? 4 : 8 },
|
16269
|
+
className: "relative w-full grow overflow-hidden rounded-full bg-slate-300 bg-opacity-40 dark:bg-gray-700 dark:bg-opacity-40",
|
16270
|
+
children: /* @__PURE__ */ jsx(
|
16271
|
+
SliderPrimitive.Range,
|
16272
|
+
{
|
16273
|
+
className: cls("absolute h-full", {
|
16274
|
+
"bg-primary": !props.disabled,
|
16275
|
+
"bg-slate-300 dark:bg-gray-700": props.disabled
|
16276
|
+
})
|
16277
|
+
}
|
16278
|
+
)
|
16279
|
+
}
|
16280
|
+
),
|
16281
|
+
(props.value ?? [0]).map((_, index) => /* @__PURE__ */ jsx(
|
16282
|
+
SliderThumb,
|
16283
|
+
{
|
16284
|
+
index,
|
16285
|
+
props,
|
16286
|
+
hovered,
|
16287
|
+
classes: thumbSizeClasses
|
16288
|
+
},
|
16289
|
+
index
|
16290
|
+
))
|
16291
|
+
]
|
16292
|
+
}
|
16293
|
+
) });
|
16294
|
+
});
|
16295
|
+
Slider.displayName = "Slider";
|
16191
16296
|
const Sheet = ({
|
16192
16297
|
children,
|
16193
16298
|
side = "right",
|
@@ -16223,6 +16328,7 @@ const Sheet = ({
|
|
16223
16328
|
DialogPrimitive.Root,
|
16224
16329
|
{
|
16225
16330
|
open: displayed || open,
|
16331
|
+
modal,
|
16226
16332
|
onOpenChange,
|
16227
16333
|
children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
|
16228
16334
|
/* @__PURE__ */ jsx(DialogPrimitive.Title, { autoFocus: true, tabIndex: 0, children: title ?? "Sheet" }),
|
@@ -17926,6 +18032,7 @@ export {
|
|
17926
18032
|
Dialog,
|
17927
18033
|
DialogActions,
|
17928
18034
|
DialogContent,
|
18035
|
+
DialogTitle,
|
17929
18036
|
DialogsIcon,
|
17930
18037
|
DialpadIcon,
|
17931
18038
|
DiamondIcon,
|
@@ -19890,6 +19997,7 @@ export {
|
|
19890
19997
|
SleepIcon,
|
19891
19998
|
SleepScoreIcon,
|
19892
19999
|
SlideLibraryIcon,
|
20000
|
+
Slider,
|
19893
20001
|
SlidersIcon,
|
19894
20002
|
SlideshowIcon,
|
19895
20003
|
SlowMotionVideoIcon,
|