@tryghost/shade 0.1.0-alpha.27 → 0.1.0-alpha.28
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/es/components/patterns/settings-modal.js +1 -1
- package/es/components/ui/button.js +16 -3
- package/es/components/ui/button.js.map +1 -1
- package/es/components/ui/dialog.js +1 -1
- package/es/components/ui/dialog.js.map +1 -1
- package/es/components/ui/sidebar.js +1 -1
- package/es/components.js +2 -2
- package/es/index.js +2 -2
- package/package.json +1 -1
- package/types/components/ui/button.d.ts +5 -0
- package/types/components/ui/button.d.ts.map +1 -1
|
@@ -3,11 +3,11 @@ import { cn } from "../../lib/ds-utils.js";
|
|
|
3
3
|
import { Box } from "../primitives/box.js";
|
|
4
4
|
import { Inline } from "../primitives/inline.js";
|
|
5
5
|
import { Text } from "../primitives/text.js";
|
|
6
|
+
import { LoadingIndicator } from "../ui/loading-indicator.js";
|
|
6
7
|
import { Button } from "../ui/button.js";
|
|
7
8
|
import { DirtyConfirmDialog } from "./dirty-confirm-dialog.js";
|
|
8
9
|
import { useDirtyConfirmation } from "./use-dirty-confirmation.js";
|
|
9
10
|
import { settingsModalVariants } from "./settings-modal-variants.js";
|
|
10
|
-
import { LoadingIndicator } from "../ui/loading-indicator.js";
|
|
11
11
|
import { StickyFooter } from "../ui/sticky-footer.js";
|
|
12
12
|
import { X } from "lucide-react";
|
|
13
13
|
import { forwardRef, useEffect, useState } from "react";
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { cn } from "../../lib/ds-utils.js";
|
|
2
2
|
import { useShade } from "../../providers/shade-context.js";
|
|
3
3
|
import { buttonVariants } from "./button-variants.js";
|
|
4
|
+
import { LoadingIndicator } from "./loading-indicator.js";
|
|
4
5
|
import { ChevronDown } from "lucide-react";
|
|
5
6
|
import * as React$1 from "react";
|
|
6
7
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { Slot } from "@radix-ui/react-slot";
|
|
8
9
|
//#region src/components/ui/button.tsx
|
|
9
|
-
var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = false, children, ...props }, ref) => {
|
|
10
|
+
var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = false, loading = false, disabled, children, ...props }, ref) => {
|
|
10
11
|
const { controlShape } = useShade();
|
|
11
12
|
const Comp = asChild ? Slot : "button";
|
|
13
|
+
const isLoading = loading && !asChild;
|
|
12
14
|
const resolvedShape = variant === "link" ? "rounded" : shape ?? controlShape;
|
|
13
15
|
const content = variant === "dropdown" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [children, /* @__PURE__ */ jsx(ChevronDown, {
|
|
14
16
|
className: "-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50",
|
|
@@ -16,15 +18,26 @@ var Button = React$1.forwardRef(({ className, variant, size, shape, asChild = fa
|
|
|
16
18
|
})] }) : children;
|
|
17
19
|
return /* @__PURE__ */ jsx(Comp, {
|
|
18
20
|
ref,
|
|
19
|
-
|
|
21
|
+
"aria-busy": isLoading || void 0,
|
|
22
|
+
className: cn(isLoading && "relative", buttonVariants({
|
|
20
23
|
variant,
|
|
21
24
|
size,
|
|
22
25
|
shape: resolvedShape,
|
|
23
26
|
className
|
|
24
27
|
})),
|
|
28
|
+
disabled: isLoading || disabled,
|
|
25
29
|
...props,
|
|
26
30
|
"data-control-shape": resolvedShape,
|
|
27
|
-
children:
|
|
31
|
+
children: isLoading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
32
|
+
className: "inline-flex items-center justify-center gap-1.5 opacity-0",
|
|
33
|
+
children: content
|
|
34
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "absolute inset-0 flex items-center justify-center",
|
|
36
|
+
children: /* @__PURE__ */ jsx(LoadingIndicator, {
|
|
37
|
+
color: "current",
|
|
38
|
+
size: "sm"
|
|
39
|
+
})
|
|
40
|
+
})] }) : content
|
|
28
41
|
});
|
|
29
42
|
});
|
|
30
43
|
Button.displayName = "Button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { type VariantProps } from 'class-variance-authority';\nimport { ChevronDown } from 'lucide-react';\n\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { LoadingIndicator } from '@/components/ui/loading-indicator';\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Disables the button and shows a spinner over its label. The label stays in\n * the layout, so the button keeps its width. Ignored with `asChild`.\n */\n loading?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const { controlShape } = useShade();\n const Comp = asChild ? Slot : 'button';\n const isLoading = loading && !asChild;\n const resolvedShape = variant === 'link' ? 'rounded' : (shape ?? controlShape);\n const content =\n variant === 'dropdown' ? (\n <>\n {children}\n <ChevronDown\n className=\"-mr-0.5! -ml-1! size-4 stroke-[2px]! opacity-50\"\n strokeWidth={2}\n />\n </>\n ) : (\n children\n );\n\n return (\n <Comp\n ref={ref}\n aria-busy={isLoading || undefined}\n className={cn(\n isLoading && 'relative',\n buttonVariants({ variant, size, shape: resolvedShape, className }),\n )}\n disabled={isLoading || disabled}\n {...props}\n data-control-shape={resolvedShape}\n >\n {isLoading ? (\n <>\n <span className=\"inline-flex items-center justify-center gap-1.5 opacity-0\">\n {content}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center\">\n <LoadingIndicator color=\"current\" size=\"sm\" />\n </span>\n </>\n ) : (\n content\n )}\n </Comp>\n );\n },\n);\nButton.displayName = 'Button';\n\nexport { Button };\n"],"mappings":";;;;;;;;;AAoBA,IAAM,SAAS,QAAM,YAEjB,EACE,WACA,SACA,MACA,OACA,UAAU,OACV,UAAU,OACV,UACA,UACA,GAAG,SAEL,QACG;CACH,MAAM,EAAE,iBAAiB,SAAS;CAClC,MAAM,OAAO,UAAU,OAAO;CAC9B,MAAM,YAAY,WAAW,CAAC;CAC9B,MAAM,gBAAgB,YAAY,SAAS,YAAa,SAAS;CACjE,MAAM,UACJ,YAAY,aACV,qBAAA,YAAA,EAAA,UAAA,CACG,UACD,oBAAC,aAAD;EACE,WAAU;EACV,aAAa;CACd,CAAA,CACD,EAAA,CAAA,IAEF;CAGJ,OACE,oBAAC,MAAD;EACO;EACL,aAAW,aAAa,KAAA;EACxB,WAAW,GACT,aAAa,YACb,eAAe;GAAE;GAAS;GAAM,OAAO;GAAe;EAAU,CAAC,CACnE;EACA,UAAU,aAAa;EACvB,GAAI;EACJ,sBAAoB;YAEnB,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,WAAU;aACb;EACG,CAAA,GACN,oBAAC,QAAD;GAAM,WAAU;aACd,oBAAC,kBAAD;IAAkB,OAAM;IAAU,MAAK;GAAM,CAAA;EACzC,CAAA,CACN,EAAA,CAAA,IAEF;CAEE,CAAA;AAEV,CACF;AACA,OAAO,cAAc"}
|
|
@@ -51,7 +51,7 @@ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
|
51
51
|
});
|
|
52
52
|
DialogHeader.displayName = "DialogHeader";
|
|
53
53
|
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
54
|
-
className: cn("flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2
|
|
54
|
+
className: cn("flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2", className),
|
|
55
55
|
...props
|
|
56
56
|
});
|
|
57
57
|
DialogFooter.displayName = "DialogFooter";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\n// Radix keeps whether a dialog is modal to itself, and the overlay scroll layout needs to know.\nconst DialogModalContext = React.createContext(true);\n\nconst Dialog = ({ modal = true, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => (\n <DialogModalContext.Provider value={modal}>\n <DialogPrimitive.Root modal={modal} {...props} />\n </DialogModalContext.Provider>\n);\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n data-slot=\"dialog-overlay\"\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n// The panel itself, shared by both ways a dialog can sit on the page.\nconst dialogPanelClassName =\n 'z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg outline-hidden duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95';\n\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n> {\n /**\n * How a dialog taller than the window scrolls. `fixed` (the default) pins the dialog near\n * the top of the window, so it needs its own height limit and inner scroll. `overlay` makes\n * the backdrop the scroll container instead: the whole dialog scrolls as one piece, the way\n * a page does.\n */\n scroll?: 'fixed' | 'overlay';\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, scroll = 'fixed', ...props }, ref) => {\n const modal = React.useContext(DialogModalContext);\n\n const panel = (\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n scroll === 'overlay'\n ? 'pointer-events-auto relative rounded-lg'\n : 'fixed top-[8vmin] left-[50%] translate-x-[-50%] sm:rounded-lg',\n dialogPanelClassName,\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n\n // The space around the dialog is padding on this wrapper, not on the scroll container:\n // browsers leave a scroll container's own bottom padding out of what it scrolls, which\n // would leave the dialog flush with the bottom of the window.\n const scrollingPanel = (\n <div className=\"flex min-h-full items-start justify-center px-4 py-[8vmin]\">{panel}</div>\n );\n\n return (\n <DialogPortal>\n <ShadeScope>\n {scroll === 'overlay' ? (\n modal ? (\n // The dialog sits inside the backdrop here, so the backdrop animates as long as the\n // dialog does; otherwise closing unmounts the dialog part-way through its animation.\n <DialogOverlay className=\"overflow-y-auto duration-200\">{scrollingPanel}</DialogOverlay>\n ) : (\n // Radix renders no backdrop for a non-modal dialog, and the page behind stays\n // usable, so this scroll container lets presses beside the dialog through.\n <div\n className=\"pointer-events-none fixed inset-0 z-50 overflow-y-auto\"\n data-slot=\"dialog-scroller\"\n >\n {scrollingPanel}\n </div>\n )\n ) : (\n <>\n <DialogOverlay />\n {panel}\n </>\n )}\n </ShadeScope>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\n// Radix keeps whether a dialog is modal to itself, and the overlay scroll layout needs to know.\nconst DialogModalContext = React.createContext(true);\n\nconst Dialog = ({ modal = true, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => (\n <DialogModalContext.Provider value={modal}>\n <DialogPrimitive.Root modal={modal} {...props} />\n </DialogModalContext.Provider>\n);\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n data-slot=\"dialog-overlay\"\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n// The panel itself, shared by both ways a dialog can sit on the page.\nconst dialogPanelClassName =\n 'z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg outline-hidden duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95';\n\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n> {\n /**\n * How a dialog taller than the window scrolls. `fixed` (the default) pins the dialog near\n * the top of the window, so it needs its own height limit and inner scroll. `overlay` makes\n * the backdrop the scroll container instead: the whole dialog scrolls as one piece, the way\n * a page does.\n */\n scroll?: 'fixed' | 'overlay';\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, scroll = 'fixed', ...props }, ref) => {\n const modal = React.useContext(DialogModalContext);\n\n const panel = (\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n scroll === 'overlay'\n ? 'pointer-events-auto relative rounded-lg'\n : 'fixed top-[8vmin] left-[50%] translate-x-[-50%] sm:rounded-lg',\n dialogPanelClassName,\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n\n // The space around the dialog is padding on this wrapper, not on the scroll container:\n // browsers leave a scroll container's own bottom padding out of what it scrolls, which\n // would leave the dialog flush with the bottom of the window.\n const scrollingPanel = (\n <div className=\"flex min-h-full items-start justify-center px-4 py-[8vmin]\">{panel}</div>\n );\n\n return (\n <DialogPortal>\n <ShadeScope>\n {scroll === 'overlay' ? (\n modal ? (\n // The dialog sits inside the backdrop here, so the backdrop animates as long as the\n // dialog does; otherwise closing unmounts the dialog part-way through its animation.\n <DialogOverlay className=\"overflow-y-auto duration-200\">{scrollingPanel}</DialogOverlay>\n ) : (\n // Radix renders no backdrop for a non-modal dialog, and the page behind stays\n // usable, so this scroll container lets presses beside the dialog through.\n <div\n className=\"pointer-events-none fixed inset-0 z-50 overflow-y-auto\"\n data-slot=\"dialog-scroller\"\n >\n {scrollingPanel}\n </div>\n )\n ) : (\n <>\n <DialogOverlay />\n {panel}\n </>\n )}\n </ShadeScope>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-xl leading-none font-semibold tracking-tight in-data-[admin7-design=true]:font-title',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;AAOA,IAAM,qBAAqB,QAAM,cAAc,IAAI;AAEnD,IAAM,UAAU,EAAE,QAAQ,MAAM,GAAG,YACjC,oBAAC,mBAAmB,UAApB;CAA6B,OAAO;WAClC,oBAAC,gBAAgB,MAAjB;EAA6B;EAAO,GAAI;CAAQ,CAAA;AACrB,CAAA;AAG/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,yLACA,SACF;CACA,aAAU;CACV,GAAI;AACL,CAAA,CACF;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAGpD,IAAM,uBACJ;AAcF,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,UAAU,SAAS,SAAS,GAAG,SAAS,QAAQ;CAC9D,MAAM,QAAQ,QAAM,WAAW,kBAAkB;CAEjD,MAAM,QACJ,oBAAC,gBAAgB,SAAjB;EACO;EACL,WAAW,GACT,WAAW,YACP,4CACA,iEACJ,sBACA,SACF;EACA,GAAI;EAEH;CACsB,CAAA;CAM3B,MAAM,iBACJ,oBAAC,OAAD;EAAK,WAAU;YAA8D;CAAW,CAAA;CAG1F,OACE,oBAAC,cAAD,EAAA,UACE,oBAAC,YAAD,EAAA,UACG,WAAW,YACV,QAGE,oBAAC,eAAD;EAAe,WAAU;YAAgC;CAA8B,CAAA,IAIvF,oBAAC,OAAD;EACE,WAAU;EACV,aAAU;YAET;CACE,CAAA,IAGP,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GACf,KACD,EAAA,CAAA,EAEM,CAAA,EACA,CAAA;AAElB,CAAC;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,aAAa,cAAc;AAE3B,IAAM,gBAAgB,EAAE,WAAW,GAAG,YACpC,oBAAC,OAAD;CACE,WAAW,GACT,0EACA,SACF;CACA,GAAI;AACL,CAAA;AAEH,aAAa,cAAc;AAE3B,IAAM,cAAc,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,OAAjB;CACO;CACL,WAAW,GACT,6FACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,YAAY,cAAc,gBAAgB,MAAM;AAEhD,IAAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,aAAjB;CACO;CACL,WAAW,GAAG,yBAAyB,SAAS;CAChD,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useIsMobile } from "../../hooks/use-mobile.js";
|
|
2
2
|
import { cn } from "../../lib/ds-utils.js";
|
|
3
3
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
|
|
4
|
+
import { Skeleton } from "./skeleton.js";
|
|
4
5
|
import { Button } from "./button.js";
|
|
5
6
|
import { Input } from "./input.js";
|
|
6
|
-
import { Skeleton } from "./skeleton.js";
|
|
7
7
|
import { Separator } from "./separator.js";
|
|
8
8
|
import { Sheet, SheetContent } from "./sheet.js";
|
|
9
9
|
import { SidebarContext, useSidebar } from "./sidebar-context.js";
|
package/es/components.js
CHANGED
|
@@ -3,6 +3,8 @@ import { Toaster } from "./components/ui/sonner.js";
|
|
|
3
3
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/ui/tooltip.js";
|
|
4
4
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
5
5
|
import { buttonVariants } from "./components/ui/button-variants.js";
|
|
6
|
+
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
7
|
+
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
6
8
|
import { Button } from "./components/ui/button.js";
|
|
7
9
|
import { selectTriggerVariants } from "./components/ui/select-variants.js";
|
|
8
10
|
import { inputSurface, inputSurfaceClasses } from "./components/ui/input-surface.js";
|
|
@@ -21,8 +23,6 @@ import { dropzoneVariants } from "./components/ui/dropzone-variants.js";
|
|
|
21
23
|
import { Dropzone } from "./components/ui/dropzone.js";
|
|
22
24
|
import { imageOverlayButton, imageOverlayButtonClasses } from "./components/ui/image-overlay-button.js";
|
|
23
25
|
import { Input } from "./components/ui/input.js";
|
|
24
|
-
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
25
|
-
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
26
26
|
import { StickyFooter } from "./components/ui/sticky-footer.js";
|
|
27
27
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/ui/accordion.js";
|
|
28
28
|
import { ActionList, ActionListItem, ActionListItemActions, ActionListItemContent } from "./components/ui/action-list.js";
|
package/es/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import { H1, H2, H3, H4, HTable } from "./components/layout/heading.js";
|
|
|
13
13
|
import "./primitives.js";
|
|
14
14
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./components/ui/dropdown-menu.js";
|
|
15
15
|
import { buttonVariants } from "./components/ui/button-variants.js";
|
|
16
|
+
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
17
|
+
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
16
18
|
import { Button } from "./components/ui/button.js";
|
|
17
19
|
import { selectTriggerVariants } from "./components/ui/select-variants.js";
|
|
18
20
|
import { inputSurface, inputSurfaceClasses } from "./components/ui/input-surface.js";
|
|
@@ -48,8 +50,6 @@ import { Input } from "./components/ui/input.js";
|
|
|
48
50
|
import ColorPicker, { ColorPickerTrigger, ColorSwatch, ColorSwatchRow } from "./components/patterns/color-picker.js";
|
|
49
51
|
import ShareModal from "./components/patterns/share-modal.js";
|
|
50
52
|
import { settingsModalVariants } from "./components/patterns/settings-modal-variants.js";
|
|
51
|
-
import { Skeleton, SkeletonTable } from "./components/ui/skeleton.js";
|
|
52
|
-
import { BarChartLoadingIndicator, LoadingIndicator } from "./components/ui/loading-indicator.js";
|
|
53
53
|
import { StickyFooter } from "./components/ui/sticky-footer.js";
|
|
54
54
|
import { SettingsModal } from "./components/patterns/settings-modal.js";
|
|
55
55
|
import "./patterns.js";
|
package/package.json
CHANGED
|
@@ -3,6 +3,11 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import { buttonVariants } from '../../components/ui/button-variants';
|
|
4
4
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
5
5
|
asChild?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Disables the button and shows a spinner over its label. The label stays in
|
|
8
|
+
* the layout, so the button keeps its width. Ignored with `asChild`.
|
|
9
|
+
*/
|
|
10
|
+
loading?: boolean;
|
|
6
11
|
}
|
|
7
12
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
13
|
export { Button };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAKjE,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;IAC1F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,uFA2DX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|