@firecms/ui 3.0.0-canary.132 → 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/ExpandablePanel.d.ts +2 -1
- package/dist/components/Sheet.d.ts +1 -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 +124 -13
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +126 -15
- package/dist/index.umd.js.map +1 -1
- package/dist/styles.d.ts +3 -3
- package/package.json +5 -2
- package/src/components/DialogTitle.tsx +34 -0
- package/src/components/ExpandablePanel.tsx +9 -6
- package/src/components/Sheet.tsx +5 -2
- 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
package/dist/index.umd.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(function(global, factory) {
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react"), require("@radix-ui/react-collapsible"), require("clsx"), require("tailwind-merge"), require("date-fns/locale"), require("react-datepicker"), require("@radix-ui/react-checkbox"), require("material-icons/iconfont/filled.css"), require("@radix-ui/react-dialog"), require("react-dropzone"), require("@radix-ui/react-label"), require("react-fast-compare"), require("markdown-it"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-menubar"), require("@radix-ui/react-popover"), require("cmdk"), require("@radix-ui/react-separator"), require("@radix-ui/react-radio-group"), require("@radix-ui/react-select"), require("react-
|
3
|
-
})(this, function(exports2, jsxRuntime, React, Collapsible, clsx, tailwindMerge, locales, RDP, CheckboxPrimitive, filled_css, DialogPrimitive, reactDropzone, LabelPrimitive, equal, MarkdownIt, DropdownMenu, MenubarPrimitive, PopoverPrimitive, cmdk, SeparatorPrimitive, RadioGroupPrimitive, SelectPrimitive,
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react"), require("@radix-ui/react-collapsible"), require("clsx"), require("tailwind-merge"), require("date-fns/locale"), require("react-datepicker"), require("@radix-ui/react-checkbox"), require("material-icons/iconfont/filled.css"), require("@radix-ui/react-dialog"), require("@radix-ui/react-visually-hidden"), require("react-dropzone"), require("@radix-ui/react-label"), require("react-fast-compare"), require("markdown-it"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-menubar"), require("@radix-ui/react-popover"), require("cmdk"), require("@radix-ui/react-separator"), require("@radix-ui/react-radio-group"), require("@radix-ui/react-select"), require("@radix-ui/react-slider"), require("@radix-ui/react-tooltip"), require("react-dom"), require("@radix-ui/react-tabs")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react", "@radix-ui/react-collapsible", "clsx", "tailwind-merge", "date-fns/locale", "react-datepicker", "@radix-ui/react-checkbox", "material-icons/iconfont/filled.css", "@radix-ui/react-dialog", "@radix-ui/react-visually-hidden", "react-dropzone", "@radix-ui/react-label", "react-fast-compare", "markdown-it", "@radix-ui/react-dropdown-menu", "@radix-ui/react-menubar", "@radix-ui/react-popover", "cmdk", "@radix-ui/react-separator", "@radix-ui/react-radio-group", "@radix-ui/react-select", "@radix-ui/react-slider", "@radix-ui/react-tooltip", "react-dom", "@radix-ui/react-tabs"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global["FireCMS UI"] = {}, global.jsxRuntime, global.React, global.Collapsible, global.clsx, global.tailwindMerge, global.locales, global.RDP, global.CheckboxPrimitive, null, global.DialogPrimitive, global.VisuallyHidden, global.reactDropzone, global.LabelPrimitive, global.equal, global.MarkdownIt, global.DropdownMenu, global.MenubarPrimitive, global.PopoverPrimitive, global.cmdk, global.SeparatorPrimitive, global.RadioGroupPrimitive, global.SelectPrimitive, global.SliderPrimitive, global.TooltipPrimitive, global.ReactDOM, global.TabsPrimitive));
|
3
|
+
})(this, function(exports2, jsxRuntime, React, Collapsible, clsx, tailwindMerge, locales, RDP, CheckboxPrimitive, filled_css, DialogPrimitive, VisuallyHidden, reactDropzone, LabelPrimitive, equal, MarkdownIt, DropdownMenu, MenubarPrimitive, PopoverPrimitive, cmdk, SeparatorPrimitive, RadioGroupPrimitive, SelectPrimitive, SliderPrimitive, TooltipPrimitive, ReactDOM, TabsPrimitive) {
|
4
4
|
"use strict";
|
5
5
|
function _interopNamespaceDefault(e) {
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
@@ -24,6 +24,7 @@
|
|
24
24
|
const RDP__namespace = /* @__PURE__ */ _interopNamespaceDefault(RDP);
|
25
25
|
const CheckboxPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(CheckboxPrimitive);
|
26
26
|
const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
|
27
|
+
const VisuallyHidden__namespace = /* @__PURE__ */ _interopNamespaceDefault(VisuallyHidden);
|
27
28
|
const LabelPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(LabelPrimitive);
|
28
29
|
const DropdownMenu__namespace = /* @__PURE__ */ _interopNamespaceDefault(DropdownMenu);
|
29
30
|
const MenubarPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(MenubarPrimitive);
|
@@ -31,8 +32,9 @@
|
|
31
32
|
const SeparatorPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SeparatorPrimitive);
|
32
33
|
const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
|
33
34
|
const SelectPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SelectPrimitive);
|
34
|
-
const
|
35
|
+
const SliderPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(SliderPrimitive);
|
35
36
|
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
37
|
+
const ReactDOM__namespace = /* @__PURE__ */ _interopNamespaceDefault(ReactDOM);
|
36
38
|
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
37
39
|
const focusedDisabled = "focus-visible:ring-0 focus-visible:ring-offset-0";
|
38
40
|
const focusedInvisibleMixin = "focus:bg-opacity-70 focus:bg-slate-100 focus:dark:bg-gray-800 focus:dark:bg-opacity-60";
|
@@ -41,9 +43,9 @@
|
|
41
43
|
const fieldBackgroundInvisibleMixin = "bg-opacity-0 bg-slate-100 dark:bg-gray-800 dark:bg-opacity-0";
|
42
44
|
const fieldBackgroundDisabledMixin = "dark:bg-gray-800 bg-opacity-50 dark:bg-opacity-90";
|
43
45
|
const fieldBackgroundHoverMixin = "hover:bg-opacity-70 dark:hover:bg-gray-700 dark:hover:bg-opacity-40";
|
44
|
-
const defaultBorderMixin = "border-gray-
|
45
|
-
const paperMixin = "bg-white rounded-md dark:bg-gray-950 border
|
46
|
-
const cardMixin = "bg-white border border-gray-
|
46
|
+
const defaultBorderMixin = "border-gray-200 border-opacity-40 dark:border-gray-700 dark:border-opacity-50";
|
47
|
+
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";
|
48
|
+
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";
|
47
49
|
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";
|
48
50
|
const cardSelectedMixin = "bg-primary-bg dark:bg-primary-bg bg-opacity-30 dark:bg-opacity-10 ring-1 ring-primary ring-opacity-75";
|
49
51
|
function cls(...classes) {
|
@@ -13757,7 +13759,7 @@
|
|
13757
13759
|
}
|
13758
13760
|
);
|
13759
13761
|
});
|
13760
|
-
const
|
13762
|
+
const typographyVariants = {
|
13761
13763
|
h1: "h1",
|
13762
13764
|
h2: "h2",
|
13763
13765
|
h3: "h3",
|
@@ -13823,12 +13825,12 @@
|
|
13823
13825
|
noWrap = false,
|
13824
13826
|
paragraph = false,
|
13825
13827
|
variant = "body1",
|
13826
|
-
variantMapping =
|
13828
|
+
variantMapping = typographyVariants,
|
13827
13829
|
style,
|
13828
13830
|
onClick,
|
13829
13831
|
...other
|
13830
13832
|
}) {
|
13831
|
-
const Component = component || (paragraph ? "p" : variantMapping[variant] ||
|
13833
|
+
const Component = component || (paragraph ? "p" : variantMapping[variant] || typographyVariants[variant]) || "span";
|
13832
13834
|
const classes = cls(
|
13833
13835
|
variantToClasses[variant],
|
13834
13836
|
color ? colorToClasses[color] : "",
|
@@ -14944,6 +14946,27 @@
|
|
14944
14946
|
}
|
14945
14947
|
);
|
14946
14948
|
}
|
14949
|
+
function DialogTitle({
|
14950
|
+
children,
|
14951
|
+
hidden,
|
14952
|
+
className,
|
14953
|
+
variant = "h4",
|
14954
|
+
...props
|
14955
|
+
}) {
|
14956
|
+
const title = /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
14957
|
+
Typography,
|
14958
|
+
{
|
14959
|
+
variant,
|
14960
|
+
className,
|
14961
|
+
...props,
|
14962
|
+
children
|
14963
|
+
}
|
14964
|
+
) });
|
14965
|
+
if (hidden) {
|
14966
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VisuallyHidden__namespace.Root, { children: title });
|
14967
|
+
}
|
14968
|
+
return title;
|
14969
|
+
}
|
14947
14970
|
function ExpandablePanel({
|
14948
14971
|
title,
|
14949
14972
|
children,
|
@@ -14953,7 +14976,8 @@
|
|
14953
14976
|
initiallyExpanded = true,
|
14954
14977
|
titleClassName,
|
14955
14978
|
asField,
|
14956
|
-
className
|
14979
|
+
className,
|
14980
|
+
innerClassName
|
14957
14981
|
}) {
|
14958
14982
|
useInjectStyles("ExpandablePanel", `
|
14959
14983
|
.CollapsibleContent {
|
@@ -15004,7 +15028,8 @@
|
|
15004
15028
|
className: cls(
|
15005
15029
|
!invisible && defaultBorderMixin + " border",
|
15006
15030
|
"rounded-md",
|
15007
|
-
"w-full"
|
15031
|
+
"w-full",
|
15032
|
+
className
|
15008
15033
|
),
|
15009
15034
|
open,
|
15010
15035
|
onOpenChange: (updatedOpen) => {
|
@@ -15016,8 +15041,8 @@
|
|
15016
15041
|
Collapsible__namespace.Trigger,
|
15017
15042
|
{
|
15018
15043
|
className: cls(
|
15019
|
-
"rounded flex items-center justify-between w-full min-h-[52px]",
|
15020
|
-
"hover:bg-slate-
|
15044
|
+
"rounded-t flex items-center justify-between w-full min-h-[52px]",
|
15045
|
+
"hover:bg-slate-200 hover:bg-opacity-20 dark:hover:bg-gray-800 dark:hover:bg-opacity-20",
|
15021
15046
|
invisible ? "border-b px-2" : "p-4",
|
15022
15047
|
invisible && defaultBorderMixin,
|
15023
15048
|
asField && fieldBackgroundMixin,
|
@@ -15036,7 +15061,7 @@
|
|
15036
15061
|
style: {
|
15037
15062
|
overflow: allowOverflow ? "visible" : "hidden"
|
15038
15063
|
},
|
15039
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className, children })
|
15064
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: innerClassName, children })
|
15040
15065
|
}
|
15041
15066
|
)
|
15042
15067
|
]
|
@@ -16196,10 +16221,93 @@
|
|
16196
16221
|
children
|
16197
16222
|
] });
|
16198
16223
|
}
|
16224
|
+
function SliderThumb(props) {
|
16225
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(TooltipPrimitive__namespace.Root, { open: props.hovered, children: [
|
16226
|
+
/* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
16227
|
+
SliderPrimitive__namespace.Thumb,
|
16228
|
+
{
|
16229
|
+
className: cls(
|
16230
|
+
{
|
16231
|
+
"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,
|
16232
|
+
"border-slate-300 bg-slate-300 dark:border-gray-700 dark:bg-gray-700": props.props.disabled
|
16233
|
+
},
|
16234
|
+
props.classes,
|
16235
|
+
"focus:ring-8 focus:ring-primary focus:ring-opacity-75",
|
16236
|
+
"hover:ring-8 hover:ring-primary hover:ring-opacity-75",
|
16237
|
+
"block rounded-full transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"
|
16238
|
+
)
|
16239
|
+
}
|
16240
|
+
) }),
|
16241
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
16242
|
+
TooltipPrimitive__namespace.Content,
|
16243
|
+
{
|
16244
|
+
side: "top",
|
16245
|
+
sideOffset: 5,
|
16246
|
+
className: cls(
|
16247
|
+
"TooltipContent",
|
16248
|
+
"max-w-lg leading-relaxed",
|
16249
|
+
"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"
|
16250
|
+
),
|
16251
|
+
children: props.props.value?.[props.index]
|
16252
|
+
}
|
16253
|
+
)
|
16254
|
+
] });
|
16255
|
+
}
|
16256
|
+
const Slider = React__namespace.forwardRef(({
|
16257
|
+
className,
|
16258
|
+
size = "regular",
|
16259
|
+
...props
|
16260
|
+
}, ref) => {
|
16261
|
+
const [hovered, setHovered] = React__namespace.useState(false);
|
16262
|
+
const thumbSizeClasses = size === "small" ? "h-4 w-4" : "h-6 w-6";
|
16263
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Provider, { delayDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
16264
|
+
SliderPrimitive__namespace.Root,
|
16265
|
+
{
|
16266
|
+
ref,
|
16267
|
+
onMouseEnter: () => setHovered(true),
|
16268
|
+
onMouseLeave: () => setHovered(false),
|
16269
|
+
className: cls(
|
16270
|
+
"relative flex w-full touch-none select-none items-center",
|
16271
|
+
className
|
16272
|
+
),
|
16273
|
+
...props,
|
16274
|
+
children: [
|
16275
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
16276
|
+
SliderPrimitive__namespace.Track,
|
16277
|
+
{
|
16278
|
+
style: { height: size === "small" ? 4 : 8 },
|
16279
|
+
className: "relative w-full grow overflow-hidden rounded-full bg-slate-300 bg-opacity-40 dark:bg-gray-700 dark:bg-opacity-40",
|
16280
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
16281
|
+
SliderPrimitive__namespace.Range,
|
16282
|
+
{
|
16283
|
+
className: cls("absolute h-full", {
|
16284
|
+
"bg-primary": !props.disabled,
|
16285
|
+
"bg-slate-300 dark:bg-gray-700": props.disabled
|
16286
|
+
})
|
16287
|
+
}
|
16288
|
+
)
|
16289
|
+
}
|
16290
|
+
),
|
16291
|
+
(props.value ?? [0]).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
16292
|
+
SliderThumb,
|
16293
|
+
{
|
16294
|
+
index,
|
16295
|
+
props,
|
16296
|
+
hovered,
|
16297
|
+
classes: thumbSizeClasses
|
16298
|
+
},
|
16299
|
+
index
|
16300
|
+
))
|
16301
|
+
]
|
16302
|
+
}
|
16303
|
+
) });
|
16304
|
+
});
|
16305
|
+
Slider.displayName = "Slider";
|
16199
16306
|
const Sheet = ({
|
16200
16307
|
children,
|
16201
16308
|
side = "right",
|
16202
16309
|
title,
|
16310
|
+
modal = true,
|
16203
16311
|
open,
|
16204
16312
|
onOpenChange,
|
16205
16313
|
transparent,
|
@@ -16230,10 +16338,11 @@
|
|
16230
16338
|
DialogPrimitive__namespace.Root,
|
16231
16339
|
{
|
16232
16340
|
open: displayed || open,
|
16341
|
+
modal,
|
16233
16342
|
onOpenChange,
|
16234
16343
|
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Portal, { children: [
|
16235
16344
|
/* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { autoFocus: true, tabIndex: 0, children: title ?? "Sheet" }),
|
16236
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
16345
|
+
modal && /* @__PURE__ */ jsxRuntime.jsx(
|
16237
16346
|
DialogPrimitive__namespace.Overlay,
|
16238
16347
|
{
|
16239
16348
|
className: cls(
|
@@ -17932,6 +18041,7 @@
|
|
17932
18041
|
exports2.Dialog = Dialog;
|
17933
18042
|
exports2.DialogActions = DialogActions;
|
17934
18043
|
exports2.DialogContent = DialogContent;
|
18044
|
+
exports2.DialogTitle = DialogTitle;
|
17935
18045
|
exports2.DialogsIcon = DialogsIcon;
|
17936
18046
|
exports2.DialpadIcon = DialpadIcon;
|
17937
18047
|
exports2.DiamondIcon = DiamondIcon;
|
@@ -19896,6 +20006,7 @@
|
|
19896
20006
|
exports2.SleepIcon = SleepIcon;
|
19897
20007
|
exports2.SleepScoreIcon = SleepScoreIcon;
|
19898
20008
|
exports2.SlideLibraryIcon = SlideLibraryIcon;
|
20009
|
+
exports2.Slider = Slider;
|
19899
20010
|
exports2.SlidersIcon = SlidersIcon;
|
19900
20011
|
exports2.SlideshowIcon = SlideshowIcon;
|
19901
20012
|
exports2.SlowMotionVideoIcon = SlowMotionVideoIcon;
|