@dust-tt/sparkle 0.2.159 → 0.2.162
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/cjs/components/Item.d.ts +14 -2
- package/dist/cjs/components/Spinner.d.ts +1 -1
- package/dist/cjs/index.js +22 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Item.d.ts +14 -2
- package/dist/esm/components/Spinner.d.ts +1 -1
- package/dist/esm/index.js +22 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { ComponentType, MouseEvent, ReactNode } from "react";
|
|
2
2
|
type ItemProps = {
|
|
3
3
|
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
4
|
-
style: "action" | "warning" | "item";
|
|
5
|
-
spacing?: "sm" | "md";
|
|
4
|
+
style: "action" | "warning" | "item" | "link";
|
|
5
|
+
spacing?: "sm" | "md" | "lg";
|
|
6
6
|
selectable?: boolean;
|
|
7
7
|
selected?: boolean;
|
|
8
8
|
disabled?: boolean;
|
|
@@ -20,6 +20,7 @@ export declare namespace Item {
|
|
|
20
20
|
var Entry: (props: EntryItemProps) => React.JSX.Element;
|
|
21
21
|
var Avatar: ({ description, hasAction, ...otherProps }: AvatarItemProps) => React.JSX.Element;
|
|
22
22
|
var Navigation: (props: NavigationListItemProps) => React.JSX.Element;
|
|
23
|
+
var Link: ({ ...props }: LinkItemProps) => React.JSX.Element;
|
|
23
24
|
var Dropdown: ({ style, ...props }: DropdownListItemProps) => React.JSX.Element;
|
|
24
25
|
var SectionHeader: ({ label, variant, className, }: ItemSectionHeaderProps) => React.JSX.Element;
|
|
25
26
|
var List: ({ children, className }: ListItemProps) => React.JSX.Element;
|
|
@@ -52,6 +53,17 @@ interface NavigationListItemProps {
|
|
|
52
53
|
icon?: ComponentType;
|
|
53
54
|
className?: string;
|
|
54
55
|
href?: string;
|
|
56
|
+
hasAction?: boolean | "hover";
|
|
57
|
+
action?: ComponentType;
|
|
58
|
+
}
|
|
59
|
+
interface LinkItemProps {
|
|
60
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
61
|
+
label: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
visual?: string | React.ReactNode;
|
|
64
|
+
icon?: ComponentType;
|
|
65
|
+
className?: string;
|
|
66
|
+
href?: string;
|
|
55
67
|
}
|
|
56
68
|
interface DropdownListItemProps {
|
|
57
69
|
style?: "default" | "warning";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface SpinnerProps {
|
|
3
3
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
4
|
-
variant?: "color" | "light" | "dark" | "pink900";
|
|
4
|
+
variant?: "color" | "light" | "dark" | "pink900" | "purple900";
|
|
5
5
|
}
|
|
6
6
|
declare const Spinner: React.FC<SpinnerProps>;
|
|
7
7
|
export default Spinner;
|
package/dist/esm/index.js
CHANGED
|
@@ -74473,7 +74473,7 @@ var tabClasses = {
|
|
|
74473
74473
|
},
|
|
74474
74474
|
},
|
|
74475
74475
|
};
|
|
74476
|
-
var iconClasses$
|
|
74476
|
+
var iconClasses$5 = {
|
|
74477
74477
|
default: {
|
|
74478
74478
|
base: "s-text-element-600",
|
|
74479
74479
|
hover: "group-hover:s-text-action-400",
|
|
@@ -74518,8 +74518,8 @@ function Tab(_a) {
|
|
|
74518
74518
|
? tabClasses.selected
|
|
74519
74519
|
: tabClasses.default;
|
|
74520
74520
|
var iconStateClasses = tab.current
|
|
74521
|
-
? iconClasses$
|
|
74522
|
-
: iconClasses$
|
|
74521
|
+
? iconClasses$5.selected
|
|
74522
|
+
: iconClasses$5.default;
|
|
74523
74523
|
var finalTabClasses = classNames("s-group s-justify-center s-flex s-text-sm s-font-semibold s-py-2.5 s-transition-all ease-out s-duration-400 s-whitespace-nowrap s-select-none", variant === "default"
|
|
74524
74524
|
? tab.icon
|
|
74525
74525
|
? tab.hideLabel
|
|
@@ -74566,16 +74566,25 @@ function Tab(_a) {
|
|
|
74566
74566
|
var labelStyleClasses = {
|
|
74567
74567
|
item: "s-font-normal",
|
|
74568
74568
|
action: "s-font-semibold",
|
|
74569
|
+
link: "s-font-semibold",
|
|
74569
74570
|
warning: "s-font-semibold",
|
|
74570
74571
|
};
|
|
74571
74572
|
var labelColorClasses = {
|
|
74572
74573
|
item: "s-text-element-600 dark:s-text-element-500-dark group-hover:s-text-action-500 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
74573
74574
|
action: "s-text-element-800 dark:s-text-element-800-dark group-hover:s-text-action-500 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
74575
|
+
link: "s-text-element-800 dark:s-text-element-800-dark group-hover:s-text-action-500 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
74574
74576
|
warning: "s-text-warning-500 dark:s-text-warning-400-dark group-hover:s-text-warning-400 group-active:s-text-warning-700 dark:group-hover:s-text-warning-600-dark dark:group-active:s-text-warning-400-dark",
|
|
74575
74577
|
};
|
|
74576
74578
|
var spacingClasses = {
|
|
74577
74579
|
sm: "s-py-2 s-gap-x-2",
|
|
74578
74580
|
md: "s-py-2.5 s-gap-x-3",
|
|
74581
|
+
lg: "s-py-3 s-gap-x-3",
|
|
74582
|
+
};
|
|
74583
|
+
var iconClasses$4 = {
|
|
74584
|
+
item: "s-text-element-600 group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
74585
|
+
action: "s-text-element-600 group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
74586
|
+
link: "s-text-brand group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark",
|
|
74587
|
+
warning: "s-text-warning-400 group-hover:s-text-warning-300 group-active:s-text-warning-700 dark:group-hover:s-text-warning-600-dark dark:group-active:s-text-warning-400-dark",
|
|
74579
74588
|
};
|
|
74580
74589
|
function Item(_a) {
|
|
74581
74590
|
var label = _a.label, description = _a.description, visual = _a.visual, icon = _a.icon, _b = _a.style, style = _b === void 0 ? "action" : _b, _c = _a.spacing, spacing = _c === void 0 ? "sm" : _c, _d = _a.action, action = _d === void 0 ? SvgChevronRight$1 : _d, _e = _a.hasAction, hasAction = _e === void 0 ? true : _e, onClick = _a.onClick, _f = _a.selected, selected = _f === void 0 ? false : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.className, className = _h === void 0 ? "" : _h, href = _a.href;
|
|
@@ -74590,9 +74599,7 @@ function Item(_a) {
|
|
|
74590
74599
|
? "s-text-element-500 dark:s-text-element-500-dark"
|
|
74591
74600
|
: selected
|
|
74592
74601
|
? "s-text-action-400 dark:s-text-action-600-dark"
|
|
74593
|
-
: style
|
|
74594
|
-
? "s-text-element-600 group-hover:s-text-action-400 group-active:s-text-action-700 dark:group-hover:s-text-action-600-dark dark:group-active:s-text-action-400-dark"
|
|
74595
|
-
: "s-text-warning-400 group-hover:s-text-warning-300 group-active:s-text-warning-700 dark:group-hover:s-text-warning-600-dark dark:group-active:s-text-warning-400-dark") }));
|
|
74602
|
+
: iconClasses$4[style]) }));
|
|
74596
74603
|
}
|
|
74597
74604
|
return (React__default.createElement(Link, { className: classNames("s-duration-400 s-group s-box-border s-flex s-select-none s-text-sm s-transition-colors s-ease-out", spacingClasses[spacing], disabled ? "" : "s-cursor-pointer", className), onClick: selected || disabled ? undefined : onClick, "aria-label": label, href: href || "#" },
|
|
74598
74605
|
visualElement,
|
|
@@ -74625,6 +74632,12 @@ Item.Avatar = function (_a) {
|
|
|
74625
74632
|
Item.Navigation = function (props) {
|
|
74626
74633
|
return React__default.createElement(Item, __assign({}, props, { style: "action", spacing: "md" }));
|
|
74627
74634
|
};
|
|
74635
|
+
Item.Link = function (_a) {
|
|
74636
|
+
var props = __rest(_a, []);
|
|
74637
|
+
return (React__default.createElement(Item, __assign({}, props, {
|
|
74638
|
+
// Pass down additional props as needed
|
|
74639
|
+
style: "link", hasAction: false, spacing: "lg" })));
|
|
74640
|
+
};
|
|
74628
74641
|
Item.Dropdown = function (_a) {
|
|
74629
74642
|
var style = _a.style, props = __rest(_a, ["style"]);
|
|
74630
74643
|
return (React__default.createElement(Item, __assign({}, props, {
|
|
@@ -75631,7 +75644,7 @@ function Page(_a) {
|
|
|
75631
75644
|
var mainVariantClasses = variant === "normal" ? "s-h-full s-py-16" : "s-h-full s-py-4 s-px-2";
|
|
75632
75645
|
var divVariantClassNames = variant === "normal" ? "s-gap-6 s-px-6" : "s-gap-4";
|
|
75633
75646
|
return (React__default.createElement("main", { className: mainVariantClasses },
|
|
75634
|
-
React__default.createElement("div", { className: classNames("s-mx-auto s-flex s-h-full s-max-w-4xl s-flex-col s-text-sm s-font-normal s-text-element-
|
|
75647
|
+
React__default.createElement("div", { className: classNames("s-mx-auto s-flex s-h-full s-max-w-4xl s-flex-col s-text-sm s-font-normal s-text-element-900", divVariantClassNames) }, children)));
|
|
75635
75648
|
}
|
|
75636
75649
|
Page.Header = function (_a) {
|
|
75637
75650
|
var title = _a.title, description = _a.description, icon = _a.icon;
|
|
@@ -75664,7 +75677,7 @@ Page.P = function (_a) {
|
|
|
75664
75677
|
var children = _a.children, variant = _a.variant, _b = _a.size, size = _b === void 0 ? "sm" : _b;
|
|
75665
75678
|
return (React__default.createElement("p", { className: classNames(PsizeClasses[size], variant === "secondary"
|
|
75666
75679
|
? "s-text-element-700 dark:s-text-element-600-dark"
|
|
75667
|
-
: "s-text-element-
|
|
75680
|
+
: "s-text-element-900 dark:s-text-element-900-dark") }, children));
|
|
75668
75681
|
};
|
|
75669
75682
|
Page.H = function (_a) {
|
|
75670
75683
|
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "h3" : _b;
|
|
@@ -75675,7 +75688,7 @@ Page.H = function (_a) {
|
|
|
75675
75688
|
h3: "s-text-2xl s-font-bold",
|
|
75676
75689
|
h4: "s-text-xl s-font-semibold",
|
|
75677
75690
|
h5: "s-text-lg s-font-semibold",
|
|
75678
|
-
h6: "s-text-base s-font-
|
|
75691
|
+
h6: "s-text-base s-font-semibold",
|
|
75679
75692
|
};
|
|
75680
75693
|
return (React__default.createElement(Component, { className: classNames("s-text-element-900 dark:s-text-element-900-dark", hSizes[variant]) }, children));
|
|
75681
75694
|
};
|