@dust-tt/sparkle 0.2.255 → 0.2.257-rc-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.
Files changed (56) hide show
  1. package/dist/cjs/index.js +92 -19
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/components/Separator.d.ts +5 -0
  4. package/dist/esm/components/Separator.d.ts.map +1 -0
  5. package/dist/esm/components/Separator.js +11 -0
  6. package/dist/esm/components/Separator.js.map +1 -0
  7. package/dist/esm/components/Tree.js +1 -1
  8. package/dist/esm/components/Tree.js.map +1 -1
  9. package/dist/esm/components/index.d.ts +1 -0
  10. package/dist/esm/components/index.d.ts.map +1 -1
  11. package/dist/esm/components/index.js +1 -0
  12. package/dist/esm/components/index.js.map +1 -1
  13. package/dist/esm/icons/solid/Dot.d.ts +5 -0
  14. package/dist/esm/icons/solid/Dot.d.ts.map +1 -0
  15. package/dist/esm/icons/solid/Dot.js +6 -0
  16. package/dist/esm/icons/solid/Dot.js.map +1 -0
  17. package/dist/esm/icons/solid/MagnifyingGlass.d.ts.map +1 -1
  18. package/dist/esm/icons/solid/MagnifyingGlass.js +2 -1
  19. package/dist/esm/icons/solid/MagnifyingGlass.js.map +1 -1
  20. package/dist/esm/icons/solid/index.d.ts +1 -0
  21. package/dist/esm/icons/solid/index.d.ts.map +1 -1
  22. package/dist/esm/icons/solid/index.js +1 -0
  23. package/dist/esm/icons/solid/index.js.map +1 -1
  24. package/dist/esm/icons/src/solid/dot.svg +3 -0
  25. package/dist/esm/icons/src/solid/magnifying-glass.svg +2 -1
  26. package/dist/esm/icons/src/stroke/dot.svg +3 -0
  27. package/dist/esm/icons/stroke/Dot.d.ts +5 -0
  28. package/dist/esm/icons/stroke/Dot.d.ts.map +1 -0
  29. package/dist/esm/icons/stroke/Dot.js +6 -0
  30. package/dist/esm/icons/stroke/Dot.js.map +1 -0
  31. package/dist/esm/icons/stroke/index.d.ts +1 -0
  32. package/dist/esm/icons/stroke/index.d.ts.map +1 -1
  33. package/dist/esm/icons/stroke/index.js +1 -0
  34. package/dist/esm/icons/stroke/index.js.map +1 -1
  35. package/dist/esm/stories/Separator.stories.d.ts +8 -0
  36. package/dist/esm/stories/Separator.stories.d.ts.map +1 -0
  37. package/dist/esm/stories/Separator.stories.js +19 -0
  38. package/dist/esm/stories/Separator.stories.js.map +1 -0
  39. package/dist/esm/stories/Tree.stories.d.ts.map +1 -1
  40. package/dist/esm/stories/Tree.stories.js +4 -3
  41. package/dist/esm/stories/Tree.stories.js.map +1 -1
  42. package/dist/sparkle.css +132 -0
  43. package/package.json +3 -1
  44. package/src/components/Separator.tsx +30 -0
  45. package/src/components/Tree.tsx +5 -1
  46. package/src/components/index.ts +1 -0
  47. package/src/icons/solid/Dot.tsx +15 -0
  48. package/src/icons/solid/MagnifyingGlass.tsx +7 -1
  49. package/src/icons/solid/index.ts +1 -0
  50. package/src/icons/src/solid/dot.svg +3 -0
  51. package/src/icons/src/solid/magnifying-glass.svg +2 -1
  52. package/src/icons/src/stroke/dot.svg +3 -0
  53. package/src/icons/stroke/Dot.tsx +20 -0
  54. package/src/icons/stroke/index.ts +1 -0
  55. package/src/stories/Separator.stories.tsx +30 -0
  56. package/src/stories/Tree.stories.tsx +12 -2
package/dist/sparkle.css CHANGED
@@ -864,6 +864,11 @@ select {
864
864
  margin-bottom: 0.5rem;
865
865
  }
866
866
 
867
+ .s-my-4 {
868
+ margin-top: 1rem;
869
+ margin-bottom: 1rem;
870
+ }
871
+
867
872
  .s-my-6 {
868
873
  margin-top: 1.5rem;
869
874
  margin-bottom: 1.5rem;
@@ -1058,6 +1063,10 @@ select {
1058
1063
  height: 100vh;
1059
1064
  }
1060
1065
 
1066
+ .s-h-\[1px\] {
1067
+ height: 1px;
1068
+ }
1069
+
1061
1070
  .s-h-\[26px\] {
1062
1071
  height: 26px;
1063
1072
  }
@@ -1178,6 +1187,10 @@ select {
1178
1187
  width: 2rem;
1179
1188
  }
1180
1189
 
1190
+ .s-w-\[1px\] {
1191
+ width: 1px;
1192
+ }
1193
+
1181
1194
  .s-w-\[320px\] {
1182
1195
  width: 320px;
1183
1196
  }
@@ -1607,6 +1620,18 @@ select {
1607
1620
  margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
1608
1621
  }
1609
1622
 
1623
+ .s-space-x-4 > :not([hidden]) ~ :not([hidden]) {
1624
+ --tw-space-x-reverse: 0;
1625
+ margin-right: calc(1rem * var(--tw-space-x-reverse));
1626
+ margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
1627
+ }
1628
+
1629
+ .s-space-y-1 > :not([hidden]) ~ :not([hidden]) {
1630
+ --tw-space-y-reverse: 0;
1631
+ margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
1632
+ margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
1633
+ }
1634
+
1610
1635
  .s-space-y-4 > :not([hidden]) ~ :not([hidden]) {
1611
1636
  --tw-space-y-reverse: 0;
1612
1637
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
@@ -2548,6 +2573,11 @@ select {
2548
2573
  background-color: rgb(159 18 57 / var(--tw-bg-opacity));
2549
2574
  }
2550
2575
 
2576
+ .s-bg-separator {
2577
+ --tw-bg-opacity: 1;
2578
+ background-color: rgb(226 232 240 / var(--tw-bg-opacity));
2579
+ }
2580
+
2551
2581
  .s-bg-sky-100 {
2552
2582
  --tw-bg-opacity: 1;
2553
2583
  background-color: rgb(224 242 254 / var(--tw-bg-opacity));
@@ -3318,6 +3348,10 @@ select {
3318
3348
  font-style: italic;
3319
3349
  }
3320
3350
 
3351
+ .s-leading-none {
3352
+ line-height: 1;
3353
+ }
3354
+
3321
3355
  .s-text-action-300 {
3322
3356
  --tw-text-opacity: 1;
3323
3357
  color: rgb(147 197 253 / var(--tw-text-opacity));
@@ -4081,6 +4115,70 @@ select {
4081
4115
  display: none;
4082
4116
  }
4083
4117
 
4118
+ @keyframes enter {
4119
+ from {
4120
+ opacity: var(--tw-enter-opacity, 1);
4121
+ transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));
4122
+ }
4123
+ }
4124
+
4125
+ @keyframes exit {
4126
+ to {
4127
+ opacity: var(--tw-exit-opacity, 1);
4128
+ transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));
4129
+ }
4130
+ }
4131
+
4132
+ .s-animate-in {
4133
+ animation-name: enter;
4134
+ animation-duration: 150ms;
4135
+ --tw-enter-opacity: initial;
4136
+ --tw-enter-scale: initial;
4137
+ --tw-enter-rotate: initial;
4138
+ --tw-enter-translate-x: initial;
4139
+ --tw-enter-translate-y: initial;
4140
+ }
4141
+
4142
+ .s-fade-in-0 {
4143
+ --tw-enter-opacity: 0;
4144
+ }
4145
+
4146
+ .s-zoom-in-95 {
4147
+ --tw-enter-scale: .95;
4148
+ }
4149
+
4150
+ .s-duration-100 {
4151
+ animation-duration: 100ms;
4152
+ }
4153
+
4154
+ .s-duration-150 {
4155
+ animation-duration: 150ms;
4156
+ }
4157
+
4158
+ .s-duration-200 {
4159
+ animation-duration: 200ms;
4160
+ }
4161
+
4162
+ .s-duration-300 {
4163
+ animation-duration: 300ms;
4164
+ }
4165
+
4166
+ .s-duration-75 {
4167
+ animation-duration: 75ms;
4168
+ }
4169
+
4170
+ .s-ease-in {
4171
+ animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
4172
+ }
4173
+
4174
+ .s-ease-in-out {
4175
+ animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
4176
+ }
4177
+
4178
+ .s-ease-out {
4179
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
4180
+ }
4181
+
4084
4182
  @keyframes bgblink {
4085
4183
  0%,
4086
4184
  100% {
@@ -4503,6 +4601,40 @@ select {
4503
4601
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
4504
4602
  }
4505
4603
 
4604
+ .data-\[state\=closed\]\:s-animate-out[data-state=closed] {
4605
+ animation-name: exit;
4606
+ animation-duration: 150ms;
4607
+ --tw-exit-opacity: initial;
4608
+ --tw-exit-scale: initial;
4609
+ --tw-exit-rotate: initial;
4610
+ --tw-exit-translate-x: initial;
4611
+ --tw-exit-translate-y: initial;
4612
+ }
4613
+
4614
+ .data-\[state\=closed\]\:s-fade-out-0[data-state=closed] {
4615
+ --tw-exit-opacity: 0;
4616
+ }
4617
+
4618
+ .data-\[state\=closed\]\:s-zoom-out-95[data-state=closed] {
4619
+ --tw-exit-scale: .95;
4620
+ }
4621
+
4622
+ .data-\[side\=bottom\]\:s-slide-in-from-top-2[data-side=bottom] {
4623
+ --tw-enter-translate-y: -0.5rem;
4624
+ }
4625
+
4626
+ .data-\[side\=left\]\:s-slide-in-from-right-2[data-side=left] {
4627
+ --tw-enter-translate-x: 0.5rem;
4628
+ }
4629
+
4630
+ .data-\[side\=right\]\:s-slide-in-from-left-2[data-side=right] {
4631
+ --tw-enter-translate-x: -0.5rem;
4632
+ }
4633
+
4634
+ .data-\[side\=top\]\:s-slide-in-from-bottom-2[data-side=top] {
4635
+ --tw-enter-translate-y: 0.5rem;
4636
+ }
4637
+
4506
4638
  :is(.s-dark .dark\:s-border-action-200-dark) {
4507
4639
  --tw-border-opacity: 1;
4508
4640
  border-color: rgb(30 64 175 / var(--tw-border-opacity));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dust-tt/sparkle",
3
- "version": "0.2.255",
3
+ "version": "0.2.257-rc-1",
4
4
  "scripts": {
5
5
  "build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs",
6
6
  "tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css",
@@ -64,6 +64,7 @@
64
64
  "sass-loader": "^13.3.2",
65
65
  "storybook": "^7.4.6",
66
66
  "tailwindcss": "^3.2.4",
67
+ "tailwindcss-animate": "^1.0.7",
67
68
  "tsc-alias": "^1.8.10",
68
69
  "typescript": "^5.4.5",
69
70
  "typescript-transform-paths": "^3.4.7",
@@ -87,6 +88,7 @@
87
88
  "@emoji-mart/data": "^1.1.2",
88
89
  "@emoji-mart/react": "^1.1.1",
89
90
  "@headlessui/react": "^1.7.19",
91
+ "@radix-ui/react-separator": "^1.1.0",
90
92
  "@radix-ui/react-slot": "^1.1.0",
91
93
  "@radix-ui/react-tooltip": "^1.1.3",
92
94
  "@tanstack/react-table": "^8.13.0",
@@ -0,0 +1,30 @@
1
+ import * as SeparatorPrimitive from "@radix-ui/react-separator"
2
+ import * as React from "react"
3
+
4
+ import { classNames } from "@sparkle/lib/utils";
5
+
6
+
7
+ const Separator = React.forwardRef<
8
+ React.ElementRef<typeof SeparatorPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
10
+ >(
11
+ (
12
+ { className, orientation = "horizontal", decorative = true, ...props },
13
+ ref
14
+ ) => (
15
+ <SeparatorPrimitive.Root
16
+ ref={ref}
17
+ decorative={decorative}
18
+ orientation={orientation}
19
+ className={classNames(
20
+ "s-bg-separator s-shrink-0",
21
+ orientation === "horizontal" ? "s-h-[1px] s-w-full" : "s-h-full s-w-[1px]",
22
+ className ?? ""
23
+ )}
24
+ {...props}
25
+ />
26
+ )
27
+ )
28
+ Separator.displayName = SeparatorPrimitive.Root.displayName
29
+
30
+ export { Separator }
@@ -222,5 +222,9 @@ interface TreeEmptyProps {
222
222
  }
223
223
 
224
224
  Tree.Empty = function ({ label }: TreeEmptyProps) {
225
- return <div className="s-pl-4 s-text-sm s-text-element-600">{label}</div>;
225
+ return (
226
+ <div className="s-py-1 s-pl-6 s-text-sm s-font-medium s-text-element-700">
227
+ {label}
228
+ </div>
229
+ );
226
230
  };
@@ -39,6 +39,7 @@ export { Popup } from "./Popup";
39
39
  export { PriceTable } from "./PriceTable";
40
40
  export { RadioButton } from "./RadioButton";
41
41
  export { Searchbar } from "./Searchbar";
42
+ export { Separator } from "./Separator";
42
43
  export { SliderToggle } from "./SliderToggle";
43
44
  export { default as Spinner } from "./Spinner";
44
45
  export { Tab } from "./Tab";
@@ -0,0 +1,15 @@
1
+ import type { SVGProps } from "react";
2
+ import * as React from "react";
3
+ const SvgDot = (props: SVGProps<SVGSVGElement>) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ width="1em"
7
+ height="1em"
8
+ fill="none"
9
+ viewBox="0 0 24 24"
10
+ {...props}
11
+ >
12
+ <path fill="currentColor" d="M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" />
13
+ </svg>
14
+ );
15
+ export default SvgDot;
@@ -11,7 +11,13 @@ const SvgMagnifyingGlass = (props: SVGProps<SVGSVGElement>) => (
11
11
  >
12
12
  <path
13
13
  fill="currentColor"
14
- d="M11 2c4.968 0 9 4.032 9 9s-4.032 9-9 9-9-4.032-9-9 4.032-9 9-9Zm8.485 16.071 2.829 2.828-1.415 1.415-2.828-2.829 1.414-1.414Z"
14
+ fillRule="evenodd"
15
+ d="M17.364 17.364A9 9 0 1 1 4.636 4.636a9 9 0 0 1 12.728 12.728Zm-2.121-2.121a6 6 0 1 1-8.486-8.485 6 6 0 0 1 8.486 8.485Z"
16
+ clipRule="evenodd"
17
+ />
18
+ <path
19
+ fill="currentColor"
20
+ d="m22.374 20.253-3.535-3.535-2.121 2.12 3.535 3.536 2.121-2.121Z"
15
21
  />
16
22
  </svg>
17
23
  );
@@ -48,6 +48,7 @@ export { default as DocumentDuplicateIcon } from "./DocumentDuplicate";
48
48
  export { default as DocumentPileIcon } from "./DocumentPile";
49
49
  export { default as DocumentPlusIcon } from "./DocumentPlus";
50
50
  export { default as DocumentTextIcon } from "./DocumentText";
51
+ export { default as DotIcon } from "./Dot";
51
52
  export { default as DustIcon } from "./Dust";
52
53
  export { default as EmotionLaughIcon } from "./EmotionLaugh";
53
54
  export { default as EqualizerIcon } from "./Equalizer";
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79086 8 8 9.79086 8 12C8 14.2091 9.79086 16 12 16Z" fill="#020617"/>
3
+ </svg>
@@ -1,3 +1,4 @@
1
1
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M11 2C15.968 2 20 6.032 20 11C20 15.968 15.968 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2ZM19.4853 18.0711L22.3137 20.8995L20.8995 22.3137L18.0711 19.4853L19.4853 18.0711Z" fill="#020617"/>
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M17.364 17.364C13.8492 20.8787 8.15075 20.8787 4.63604 17.364C1.12133 13.8492 1.12132 8.15076 4.63604 4.63604C8.15076 1.12132 13.8492 1.12133 17.364 4.63604C20.8787 8.15075 20.8787 13.8492 17.364 17.364ZM15.2426 15.2426C12.8995 17.5858 9.10051 17.5858 6.75736 15.2426C4.4142 12.8995 4.41421 9.1005 6.75736 6.75736C9.1005 4.41421 12.8995 4.4142 15.2426 6.75736C17.5858 9.10051 17.5858 12.8995 15.2426 15.2426Z" fill="#020617"/>
3
+ <path d="M22.3744 20.253L18.8388 16.7175L16.7175 18.8388L20.253 22.3744L22.3744 20.253Z" fill="#020617"/>
3
4
  </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M12 14C13.1046 14 14 13.1046 14 12C14 10.8954 13.1046 10 12 10C10.8954 10 10 10.8954 10 12C10 13.1046 10.8954 14 12 14ZM16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z" fill="#020617"/>
3
+ </svg>
@@ -0,0 +1,20 @@
1
+ import type { SVGProps } from "react";
2
+ import * as React from "react";
3
+ const SvgDot = (props: SVGProps<SVGSVGElement>) => (
4
+ <svg
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ width="1em"
7
+ height="1em"
8
+ fill="none"
9
+ viewBox="0 0 24 24"
10
+ {...props}
11
+ >
12
+ <path
13
+ fill="currentColor"
14
+ fillRule="evenodd"
15
+ d="M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm4-2a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"
16
+ clipRule="evenodd"
17
+ />
18
+ </svg>
19
+ );
20
+ export default SvgDot;
@@ -48,6 +48,7 @@ export { default as DocumentDuplicateStrokeIcon } from "./DocumentDuplicate";
48
48
  export { default as DocumentPileStrokeIcon } from "./DocumentPile";
49
49
  export { default as DocumentPlusStrokeIcon } from "./DocumentPlus";
50
50
  export { default as DocumentTextStrokeIcon } from "./DocumentText";
51
+ export { default as DotStrokeIcon } from "./Dot";
51
52
  export { default as DustStrokeIcon } from "./Dust";
52
53
  export { default as EmotionLaughStrokeIcon } from "./EmotionLaugh";
53
54
  export { default as EqualizerStrokeIcon } from "./Equalizer";
@@ -0,0 +1,30 @@
1
+ import type { Meta } from "@storybook/react";
2
+ import * as React from "react";
3
+
4
+ import { Separator } from "@sparkle/index_with_tw_base";
5
+
6
+ const meta = {
7
+ title: "Primitives/Separator",
8
+ component: Separator,
9
+ } satisfies Meta<typeof Separator>;
10
+
11
+ export default meta;
12
+
13
+ export const SeparatorExample = () => (
14
+ <div>
15
+ <div className="s-space-y-1">
16
+ <h4 className="s-text-sm s-font-medium s-leading-none">Dust Separator</h4>
17
+ <p className="s-text-sm s-text-muted-foreground">
18
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry.
19
+ </p>
20
+ </div>
21
+ <Separator className="s-my-4" />
22
+ <div className="s-flex s-h-5 s-items-center s-space-x-4 s-text-sm">
23
+ <div>Dust</div>
24
+ <Separator orientation="vertical" />
25
+ <div>Separator</div>
26
+ <Separator orientation="vertical" />
27
+ <div>Menu</div>
28
+ </div>
29
+ </div>
30
+ );
@@ -1,7 +1,6 @@
1
1
  import type { Meta } from "@storybook/react";
2
2
  import React from "react";
3
3
 
4
- import { DustIcon } from "@sparkle/icons/solid";
5
4
  import {
6
5
  DriveLogo,
7
6
  IntercomLogo,
@@ -15,6 +14,7 @@ import {
15
14
  CloudArrowDownIcon,
16
15
  Cog6ToothIcon,
17
16
  DocumentIcon,
17
+ DustIcon,
18
18
  EyeIcon,
19
19
  FolderIcon,
20
20
  IconButton,
@@ -89,7 +89,17 @@ export const TreeExample = () => {
89
89
  visual={FolderIcon}
90
90
  collapsed={false}
91
91
  >
92
- <Tree.Empty label="No documents" />
92
+ <Tree.Item
93
+ label="Item 3"
94
+ type="leaf"
95
+ visual={DocumentIcon}
96
+ />
97
+ <Tree.Item
98
+ label="Item 3"
99
+ type="leaf"
100
+ visual={DocumentIcon}
101
+ />
102
+ <Tree.Empty label="(+ 4 items)" />
93
103
  </Tree.Item>
94
104
  </Tree>
95
105
  </Tree.Item>