@particle-academy/react-fancy 3.5.0 → 4.0.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/README.md +4 -3
- package/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +127 -112
- package/dist/index.d.ts +127 -112
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/docs/Action.md +15 -3
- package/docs/Button.md +91 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { marked } from 'marked';
|
|
9
9
|
|
|
10
|
-
// src/components/
|
|
10
|
+
// src/components/Button/Button.tsx
|
|
11
11
|
function cn(...inputs) {
|
|
12
12
|
return twMerge(clsx(inputs));
|
|
13
13
|
}
|
|
@@ -2323,7 +2323,7 @@ function parseSortOrder(sort) {
|
|
|
2323
2323
|
}
|
|
2324
2324
|
return valid;
|
|
2325
2325
|
}
|
|
2326
|
-
var
|
|
2326
|
+
var Button = forwardRef(
|
|
2327
2327
|
({
|
|
2328
2328
|
children,
|
|
2329
2329
|
className,
|
|
@@ -2486,12 +2486,13 @@ var Action = forwardRef(
|
|
|
2486
2486
|
trailingElements
|
|
2487
2487
|
] });
|
|
2488
2488
|
const safeHref = sanitizeHref(href);
|
|
2489
|
-
const buttonEl = safeHref && !disabled ? /* @__PURE__ */ jsx("a", { href: safeHref, className: classes, "data-react-fancy-action": "", children: content }) : /* @__PURE__ */ jsx(
|
|
2489
|
+
const buttonEl = safeHref && !disabled ? /* @__PURE__ */ jsx("a", { href: safeHref, className: classes, "data-react-fancy-button": "", "data-react-fancy-action": "", children: content }) : /* @__PURE__ */ jsx(
|
|
2490
2490
|
"button",
|
|
2491
2491
|
{
|
|
2492
2492
|
ref,
|
|
2493
2493
|
className: classes,
|
|
2494
2494
|
disabled: disabled || loading,
|
|
2495
|
+
"data-react-fancy-button": "",
|
|
2495
2496
|
"data-react-fancy-action": "",
|
|
2496
2497
|
...props,
|
|
2497
2498
|
children: content
|
|
@@ -2555,7 +2556,8 @@ var Action = forwardRef(
|
|
|
2555
2556
|
return buttonEl;
|
|
2556
2557
|
}
|
|
2557
2558
|
);
|
|
2558
|
-
|
|
2559
|
+
Button.displayName = "Button";
|
|
2560
|
+
var Action = Button;
|
|
2559
2561
|
function useControllableState(controlledValue, defaultValue, onChange) {
|
|
2560
2562
|
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
2561
2563
|
const isControlled = controlledValue !== void 0;
|
|
@@ -12239,7 +12241,7 @@ function ReasonTag({
|
|
|
12239
12241
|
/* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-wider text-zinc-400", children: "sources" }),
|
|
12240
12242
|
/* @__PURE__ */ jsx("ul", { className: "mt-0.5 space-y-0.5 text-[12px]", children: sources.map((s, i) => /* @__PURE__ */ jsx("li", { children: s.href ? /* @__PURE__ */ jsx("a", { className: "text-violet-600 hover:underline", href: s.href, children: s.label }) : /* @__PURE__ */ jsx("span", { className: "text-zinc-600 dark:text-zinc-300", children: s.label }) }, i)) })
|
|
12241
12243
|
] }),
|
|
12242
|
-
onFollowUp && /* @__PURE__ */ jsx("div", { className: "flex justify-end pt-1", children: /* @__PURE__ */ jsx(
|
|
12244
|
+
onFollowUp && /* @__PURE__ */ jsx("div", { className: "flex justify-end pt-1", children: /* @__PURE__ */ jsx(Button, { size: "sm", variant: "ghost", onClick: onFollowUp, children: "ask follow-up" }) })
|
|
12243
12245
|
] }) })
|
|
12244
12246
|
] });
|
|
12245
12247
|
}
|
|
@@ -12679,7 +12681,7 @@ function PromptInput({
|
|
|
12679
12681
|
] }),
|
|
12680
12682
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-t border-zinc-200 bg-zinc-50/60 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900/40", children: [
|
|
12681
12683
|
/* @__PURE__ */ jsx(Tooltip, { content: "Drop files here, or click", children: /* @__PURE__ */ jsx(
|
|
12682
|
-
|
|
12684
|
+
Button,
|
|
12683
12685
|
{
|
|
12684
12686
|
variant: "ghost",
|
|
12685
12687
|
size: "sm",
|
|
@@ -12712,7 +12714,7 @@ function PromptInput({
|
|
|
12712
12714
|
" ",
|
|
12713
12715
|
"to send"
|
|
12714
12716
|
] }),
|
|
12715
|
-
/* @__PURE__ */ jsx(
|
|
12717
|
+
/* @__PURE__ */ jsx(Button, { color: "violet", size: "sm", onClick: submit, children: "send \u2192" })
|
|
12716
12718
|
] })
|
|
12717
12719
|
] })
|
|
12718
12720
|
]
|
|
@@ -13330,7 +13332,7 @@ function Wand({
|
|
|
13330
13332
|
] })
|
|
13331
13333
|
] }),
|
|
13332
13334
|
actions.map((a) => /* @__PURE__ */ jsxs(
|
|
13333
|
-
|
|
13335
|
+
Button,
|
|
13334
13336
|
{
|
|
13335
13337
|
size: "sm",
|
|
13336
13338
|
variant: "ghost",
|
|
@@ -13406,6 +13408,6 @@ function caretRect(ta, start, end) {
|
|
|
13406
13408
|
return { x, y };
|
|
13407
13409
|
}
|
|
13408
13410
|
|
|
13409
|
-
export { Accordion, AccordionPanel, AccordionPanelContent, AccordionPanelSection, AccordionPanelTrigger, Action, Autocomplete, Avatar, Badge, Brand, Breadcrumbs, Calendar, Callout, Card, Carousel, Chart, ChatDrawer, Checkbox, CheckboxGroup, ColorPicker, Command, Composer, ContentRenderer, ContextMenu, DatePicker, Dropdown, EMOJI_CATEGORY_ORDER, EMOJI_DATA, EMOJI_ENTRIES, Editor, Emoji, EmojiSelect, FauxClient, Field, FileUpload, Heading, Icon, Input, InputTag, Kanban, MagicWand, Menu2 as Menu, MobileMenu, Modal, MoodMeter, MultiSwitch, Navbar, OtpInput, Pagination, Pillbox, Popover, Portal, Profile, Progress, PromptInput, RadioGroup, ReasonTag, SKIN_TONES, Select, Separator, Sidebar, Skeleton, Slider, StickyNote, Switch, Table, Tabs, Text, Textarea, TimeGrid, TimePicker, Timeline, Toast, Tooltip, TreeNav, applyTone, cn, configureIcons, contentEditableAdapter, controlledAdapter, find, hasSkinTones, inputAdapter, registerExtension, registerExtensions, registerIconSet, registerIcons, resolve, sanitizeHref, sanitizeHtml, search, skinTones, textareaAdapter, useAccordion, useAccordionPanel, useAccordionSection, useAnimation, useCarousel, useCommand, useContextMenu, useControllableState, useDropdown, useEditor, useEscapeKey, useFileUpload, useFloatingPosition, useFocusTrap, useId12 as useId, useKanban, useMenu, useMobileMenu, useModal, useNavbar, useNodeRegistry, useOutsideClick, usePanZoom, usePopover, useSidebar, useTabs, useToast, useTreeNav };
|
|
13411
|
+
export { Accordion, AccordionPanel, AccordionPanelContent, AccordionPanelSection, AccordionPanelTrigger, Action, Autocomplete, Avatar, Badge, Brand, Breadcrumbs, Button, Calendar, Callout, Card, Carousel, Chart, ChatDrawer, Checkbox, CheckboxGroup, ColorPicker, Command, Composer, ContentRenderer, ContextMenu, DatePicker, Dropdown, EMOJI_CATEGORY_ORDER, EMOJI_DATA, EMOJI_ENTRIES, Editor, Emoji, EmojiSelect, FauxClient, Field, FileUpload, Heading, Icon, Input, InputTag, Kanban, MagicWand, Menu2 as Menu, MobileMenu, Modal, MoodMeter, MultiSwitch, Navbar, OtpInput, Pagination, Pillbox, Popover, Portal, Profile, Progress, PromptInput, RadioGroup, ReasonTag, SKIN_TONES, Select, Separator, Sidebar, Skeleton, Slider, StickyNote, Switch, Table, Tabs, Text, Textarea, TimeGrid, TimePicker, Timeline, Toast, Tooltip, TreeNav, applyTone, cn, configureIcons, contentEditableAdapter, controlledAdapter, find, hasSkinTones, inputAdapter, registerExtension, registerExtensions, registerIconSet, registerIcons, resolve, sanitizeHref, sanitizeHtml, search, skinTones, textareaAdapter, useAccordion, useAccordionPanel, useAccordionSection, useAnimation, useCarousel, useCommand, useContextMenu, useControllableState, useDropdown, useEditor, useEscapeKey, useFileUpload, useFloatingPosition, useFocusTrap, useId12 as useId, useKanban, useMenu, useMobileMenu, useModal, useNavbar, useNodeRegistry, useOutsideClick, usePanZoom, usePopover, useSidebar, useTabs, useToast, useTreeNav };
|
|
13410
13412
|
//# sourceMappingURL=index.js.map
|
|
13411
13413
|
//# sourceMappingURL=index.js.map
|