@dust-tt/sparkle 0.2.160 → 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.
@@ -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;
@@ -55,6 +56,15 @@ interface NavigationListItemProps {
55
56
  hasAction?: boolean | "hover";
56
57
  action?: ComponentType;
57
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;
67
+ }
58
68
  interface DropdownListItemProps {
59
69
  style?: "default" | "warning";
60
70
  onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
@@ -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/cjs/index.js CHANGED
@@ -74493,7 +74493,7 @@ var tabClasses = {
74493
74493
  },
74494
74494
  },
74495
74495
  };
74496
- var iconClasses$4 = {
74496
+ var iconClasses$5 = {
74497
74497
  default: {
74498
74498
  base: "s-text-element-600",
74499
74499
  hover: "group-hover:s-text-action-400",
@@ -74538,8 +74538,8 @@ function Tab(_a) {
74538
74538
  ? tabClasses.selected
74539
74539
  : tabClasses.default;
74540
74540
  var iconStateClasses = tab.current
74541
- ? iconClasses$4.selected
74542
- : iconClasses$4.default;
74541
+ ? iconClasses$5.selected
74542
+ : iconClasses$5.default;
74543
74543
  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"
74544
74544
  ? tab.icon
74545
74545
  ? tab.hideLabel
@@ -74586,16 +74586,25 @@ function Tab(_a) {
74586
74586
  var labelStyleClasses = {
74587
74587
  item: "s-font-normal",
74588
74588
  action: "s-font-semibold",
74589
+ link: "s-font-semibold",
74589
74590
  warning: "s-font-semibold",
74590
74591
  };
74591
74592
  var labelColorClasses = {
74592
74593
  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",
74593
74594
  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",
74595
+ 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",
74594
74596
  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",
74595
74597
  };
74596
74598
  var spacingClasses = {
74597
74599
  sm: "s-py-2 s-gap-x-2",
74598
74600
  md: "s-py-2.5 s-gap-x-3",
74601
+ lg: "s-py-3 s-gap-x-3",
74602
+ };
74603
+ var iconClasses$4 = {
74604
+ 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",
74605
+ 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",
74606
+ 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",
74607
+ 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",
74599
74608
  };
74600
74609
  function Item(_a) {
74601
74610
  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;
@@ -74610,9 +74619,7 @@ function Item(_a) {
74610
74619
  ? "s-text-element-500 dark:s-text-element-500-dark"
74611
74620
  : selected
74612
74621
  ? "s-text-action-400 dark:s-text-action-600-dark"
74613
- : style === "action" || style === "item"
74614
- ? "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"
74615
- : "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") }));
74622
+ : iconClasses$4[style]) }));
74616
74623
  }
74617
74624
  return (React.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 || "#" },
74618
74625
  visualElement,
@@ -74645,6 +74652,12 @@ Item.Avatar = function (_a) {
74645
74652
  Item.Navigation = function (props) {
74646
74653
  return React.createElement(Item, __assign({}, props, { style: "action", spacing: "md" }));
74647
74654
  };
74655
+ Item.Link = function (_a) {
74656
+ var props = __rest(_a, []);
74657
+ return (React.createElement(Item, __assign({}, props, {
74658
+ // Pass down additional props as needed
74659
+ style: "link", hasAction: false, spacing: "lg" })));
74660
+ };
74648
74661
  Item.Dropdown = function (_a) {
74649
74662
  var style = _a.style, props = __rest(_a, ["style"]);
74650
74663
  return (React.createElement(Item, __assign({}, props, {
@@ -75651,7 +75664,7 @@ function Page(_a) {
75651
75664
  var mainVariantClasses = variant === "normal" ? "s-h-full s-py-16" : "s-h-full s-py-4 s-px-2";
75652
75665
  var divVariantClassNames = variant === "normal" ? "s-gap-6 s-px-6" : "s-gap-4";
75653
75666
  return (React.createElement("main", { className: mainVariantClasses },
75654
- React.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-800", divVariantClassNames) }, children)));
75667
+ React.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)));
75655
75668
  }
75656
75669
  Page.Header = function (_a) {
75657
75670
  var title = _a.title, description = _a.description, icon = _a.icon;
@@ -75684,7 +75697,7 @@ Page.P = function (_a) {
75684
75697
  var children = _a.children, variant = _a.variant, _b = _a.size, size = _b === void 0 ? "sm" : _b;
75685
75698
  return (React.createElement("p", { className: classNames(PsizeClasses[size], variant === "secondary"
75686
75699
  ? "s-text-element-700 dark:s-text-element-600-dark"
75687
- : "s-text-element-800 dark:s-text-element-800-dark") }, children));
75700
+ : "s-text-element-900 dark:s-text-element-900-dark") }, children));
75688
75701
  };
75689
75702
  Page.H = function (_a) {
75690
75703
  var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "h3" : _b;
@@ -75695,7 +75708,7 @@ Page.H = function (_a) {
75695
75708
  h3: "s-text-2xl s-font-bold",
75696
75709
  h4: "s-text-xl s-font-semibold",
75697
75710
  h5: "s-text-lg s-font-semibold",
75698
- h6: "s-text-base s-font-bold",
75711
+ h6: "s-text-base s-font-semibold",
75699
75712
  };
75700
75713
  return (React.createElement(Component, { className: classNames("s-text-element-900 dark:s-text-element-900-dark", hSizes[variant]) }, children));
75701
75714
  };