@spear-ai/spectral 0.1.1 → 1.0.0

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 (51) hide show
  1. package/README.md +7 -83
  2. package/dist/{components/Button/Button.d.ts → Button.d.ts} +10 -6
  3. package/dist/Button.js +98 -0
  4. package/dist/Card.css +4 -0
  5. package/dist/Card.d.ts +13 -0
  6. package/dist/Card.js +31 -0
  7. package/dist/Drawer.d.ts +14 -0
  8. package/dist/Drawer.js +42 -0
  9. package/dist/{components/Skeleton/Skeleton.d.ts → Skeleton.d.ts} +4 -1
  10. package/dist/Skeleton.js +14 -0
  11. package/dist/{components/Slider/Slider.d.ts → Slider.d.ts} +7 -4
  12. package/dist/Slider.js +79 -0
  13. package/dist/chunk-ZLENOYB4.js +12 -0
  14. package/dist/index.css +189 -0
  15. package/dist/index.d.ts +75 -22
  16. package/dist/index.js +276 -0
  17. package/package.json +66 -43
  18. package/src/styles/horizon.css +35 -0
  19. package/src/styles/main.css +34 -0
  20. package/dist/App.d.ts +0 -1
  21. package/dist/components/Accordion/Accordion.d.ts +0 -35
  22. package/dist/components/Card/Card.d.ts +0 -9
  23. package/dist/components/Checkbox/Checkbox.d.ts +0 -10
  24. package/dist/components/Input/Input.d.ts +0 -21
  25. package/dist/components/Input/InputUtils.d.ts +0 -10
  26. package/dist/components/InputOtp/InputOtp.d.ts +0 -29
  27. package/dist/components/Label/Label.d.ts +0 -3
  28. package/dist/components/RadioGroup/Label.d.ts +0 -4
  29. package/dist/components/RadioGroup/RadioGroup.d.ts +0 -38
  30. package/dist/components/Select/Select.d.ts +0 -24
  31. package/dist/components/Select/SelectList.d.ts +0 -17
  32. package/dist/components/Sidebar/Sidebar.d.ts +0 -1
  33. package/dist/components/Sidebar/SidebarBase.d.ts +0 -65
  34. package/dist/components/Switch/Switch.d.ts +0 -16
  35. package/dist/components/Textarea/Textarea.d.ts +0 -16
  36. package/dist/components/Textarea/TextareaUtils.d.ts +0 -44
  37. package/dist/favicon-invert.svg +0 -5
  38. package/dist/favicon.svg +0 -5
  39. package/dist/hooks/useAccordionAutoScroll.d.ts +0 -8
  40. package/dist/hooks/useOutsideClick.d.ts +0 -7
  41. package/dist/hooks/useTheme.d.ts +0 -7
  42. package/dist/logo/wordmark-dark-side-by-side.svg +0 -6
  43. package/dist/logo/wordmark-light-side-by-side.svg +0 -6
  44. package/dist/main.d.ts +0 -0
  45. package/dist/primitives/button.d.ts +0 -10
  46. package/dist/primitives/input.d.ts +0 -3
  47. package/dist/primitives/tooltip.d.ts +0 -7
  48. package/dist/spectral.cjs.js +0 -60
  49. package/dist/spectral.css +0 -1
  50. package/dist/spectral.es.js +0 -5531
  51. package/dist/utils/twUtils.d.ts +0 -2
package/dist/index.css ADDED
@@ -0,0 +1,189 @@
1
+ @import "tailwindcss";
2
+
3
+ /* src/components/Card/main.css */
4
+ .card-loading-overlay {
5
+ backdrop-filter: blur(2px);
6
+ }
7
+
8
+ /* node_modules/.pnpm/tw-animate-css@1.3.8/node_modules/tw-animate-css/dist/tw-animate.css */
9
+ @property --tw-animation-delay { syntax:"*";inherits:false;initial-value:0s }
10
+ @property --tw-animation-direction { syntax:"*";inherits:false;initial-value:normal }
11
+ @property --tw-animation-duration { syntax:"*";inherits:false }
12
+ @property --tw-animation-fill-mode { syntax:"*";inherits:false;initial-value:none }
13
+ @property --tw-animation-iteration-count { syntax:"*";inherits:false;initial-value:1 }
14
+ @property --tw-enter-blur { syntax:"*";inherits:false;initial-value:0 }
15
+ @property --tw-enter-opacity { syntax:"*";inherits:false;initial-value:1 }
16
+ @property --tw-enter-rotate { syntax:"*";inherits:false;initial-value:0 }
17
+ @property --tw-enter-scale { syntax:"*";inherits:false;initial-value:1 }
18
+ @property --tw-enter-translate-x { syntax:"*";inherits:false;initial-value:0 }
19
+ @property --tw-enter-translate-y { syntax:"*";inherits:false;initial-value:0 }
20
+ @property --tw-exit-blur { syntax:"*";inherits:false;initial-value:0 }
21
+ @property --tw-exit-opacity { syntax:"*";inherits:false;initial-value:1 }
22
+ @property --tw-exit-rotate { syntax:"*";inherits:false;initial-value:0 }
23
+ @property --tw-exit-scale { syntax:"*";inherits:false;initial-value:1 }
24
+ @property --tw-exit-translate-x { syntax:"*";inherits:false;initial-value:0 }
25
+ @property --tw-exit-translate-y { syntax:"*";inherits:false;initial-value:0 }
26
+ @theme inline { --animation-delay-0: 0s; --animation-delay-75: 75ms; --animation-delay-100: .1s; --animation-delay-150: .15s; --animation-delay-200: .2s; --animation-delay-300: .3s; --animation-delay-500: .5s; --animation-delay-700: .7s; --animation-delay-1000: 1s; --animation-repeat-0: 0; --animation-repeat-1: 1; --animation-repeat-infinite: infinite; --animation-direction-normal: normal; --animation-direction-reverse: reverse; --animation-direction-alternate: alternate; --animation-direction-alternate-reverse: alternate-reverse; --animation-fill-mode-none: none; --animation-fill-mode-forwards: forwards; --animation-fill-mode-backwards: backwards; --animation-fill-mode-both: both; --percentage-0: 0; --percentage-5: .05; --percentage-10: .1; --percentage-15: .15; --percentage-20: .2; --percentage-25: .25; --percentage-30: .3; --percentage-35: .35; --percentage-40: .4; --percentage-45: .45; --percentage-50: .5; --percentage-55: .55; --percentage-60: .6; --percentage-65: .65; --percentage-70: .7; --percentage-75: .75; --percentage-80: .8; --percentage-85: .85; --percentage-90: .9; --percentage-95: .95; --percentage-100: 1; --percentage-translate-full: 1; --animate-in: enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-out: exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); @keyframes enter { from { opacity: var(--tw-enter-opacity,1); 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)); filter: blur(var(--tw-enter-blur,0)); }}@keyframes exit { to { opacity: var(--tw-exit-opacity,1); 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)); filter: blur(var(--tw-exit-blur,0)); }}--animate-accordion-down: accordion-down var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-accordion-up: accordion-up var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-collapsible-down: collapsible-down var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); --animate-collapsible-up: collapsible-up var(--tw-animation-duration,var(--tw-duration,.2s))var(--tw-ease,ease-out)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none); @keyframes accordion-down { from { height: 0; }to { height: var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,var(--ngp-accordion-content-height,auto))))); }}@keyframes accordion-up { from { height: var(--radix-accordion-content-height,var(--bits-accordion-content-height,var(--reka-accordion-content-height,var(--kb-accordion-content-height,var(--ngp-accordion-content-height,auto))))); }to { height: 0; }}@keyframes collapsible-down { from { height: 0; }to { height: var(--radix-collapsible-content-height,var(--bits-collapsible-content-height,var(--reka-collapsible-content-height,var(--kb-collapsible-content-height,auto)))); }}@keyframes collapsible-up { from { height: var(--radix-collapsible-content-height,var(--bits-collapsible-content-height,var(--reka-collapsible-content-height,var(--kb-collapsible-content-height,auto)))); }to { height: 0; }}--animate-caret-blink: caret-blink 1.25s ease-out infinite; @keyframes caret-blink { 0%,70%,100% { opacity: 1; }20%,50% { opacity: 0; }} }
27
+ @utility animation-duration-* { --tw-animation-duration: calc(--value(number)*1ms); --tw-animation-duration: --value(--animation-duration-*,[duration],"initial",[*]); animation-duration: calc(--value(number)*1ms); animation-duration: --value(--animation-duration-*,[duration],"initial",[*]); }
28
+ @utility delay-* { animation-delay: calc(--value(number)*1ms); animation-delay: --value(--animation-delay-*, [duration], "initial", [*]); --tw-animation-delay: calc(--value(number)*1ms); --tw-animation-delay: --value(--animation-delay-*, [duration], "initial", [*]); }
29
+ @utility repeat-* { animation-iteration-count: --value(--animation-repeat-*, number, "initial", [*]); --tw-animation-iteration-count: --value(--animation-repeat-*, number, "initial", [*]); }
30
+ @utility direction-* { animation-direction: --value(--animation-direction-*, "initial", [*]); --tw-animation-direction: --value(--animation-direction-*, "initial", [*]); }
31
+ @utility fill-mode-* { animation-fill-mode: --value(--animation-fill-mode-*, "initial", [*]); --tw-animation-fill-mode: --value(--animation-fill-mode-*, "initial", [*]); }
32
+ @utility running { animation-play-state: running; }
33
+ @utility paused { animation-play-state: paused; }
34
+ @utility play-state-* { animation-play-state: --value("initial", [*]); }
35
+ @utility blur-in { --tw-enter-blur: 20px; }
36
+ @utility blur-in-* { --tw-enter-blur: calc(--value(number)*1px); --tw-enter-blur: --value(--blur-*,[*]); }
37
+ @utility blur-out { --tw-exit-blur: 20px; }
38
+ @utility blur-out-* { --tw-exit-blur: calc(--value(number)*1px); --tw-exit-blur: --value(--blur-*,[*]); }
39
+ @utility fade-in { --tw-enter-opacity: 0; }
40
+ @utility fade-in-* { --tw-enter-opacity: calc(--value(number)/100); --tw-enter-opacity: --value(--percentage-*,[*]); }
41
+ @utility fade-out { --tw-exit-opacity: 0; }
42
+ @utility fade-out-* { --tw-exit-opacity: calc(--value(number)/100); --tw-exit-opacity: --value(--percentage-*,[*]); }
43
+ @utility zoom-in { --tw-enter-scale: 0; }
44
+ @utility zoom-in-* { --tw-enter-scale: calc(--value(number)*1%); --tw-enter-scale: calc(--value(ratio)); --tw-enter-scale: --value(--percentage-*,[*]); }
45
+ @utility -zoom-in-* { --tw-enter-scale: calc(--value(number)*-1%); --tw-enter-scale: calc(--value(ratio)*-1); --tw-enter-scale: --value(--percentage-*,[*]); }
46
+ @utility zoom-out { --tw-exit-scale: 0; }
47
+ @utility zoom-out-* { --tw-exit-scale: calc(--value(number)*1%); --tw-exit-scale: calc(--value(ratio)); --tw-exit-scale: --value(--percentage-*,[*]); }
48
+ @utility -zoom-out-* { --tw-exit-scale: calc(--value(number)*-1%); --tw-exit-scale: calc(--value(ratio)*-1); --tw-exit-scale: --value(--percentage-*,[*]); }
49
+ @utility spin-in { --tw-enter-rotate: 30deg; }
50
+ @utility spin-in-* { --tw-enter-rotate: calc(--value(number)*1deg); --tw-enter-rotate: calc(--value(ratio)*360deg); --tw-enter-rotate: --value(--rotate-*,[*]); }
51
+ @utility -spin-in { --tw-enter-rotate: -30deg; }
52
+ @utility -spin-in-* { --tw-enter-rotate: calc(--value(number)*-1deg); --tw-enter-rotate: calc(--value(ratio)*-360deg); --tw-enter-rotate: --value(--rotate-*,[*]); }
53
+ @utility spin-out { --tw-exit-rotate: 30deg; }
54
+ @utility spin-out-* { --tw-exit-rotate: calc(--value(number)*1deg); --tw-exit-rotate: calc(--value(ratio)*360deg); --tw-exit-rotate: --value(--rotate-*,[*]); }
55
+ @utility -spin-out { --tw-exit-rotate: -30deg; }
56
+ @utility -spin-out-* { --tw-exit-rotate: calc(--value(number)*-1deg); --tw-exit-rotate: calc(--value(ratio)*-360deg); --tw-exit-rotate: --value(--rotate-*,[*]); }
57
+ @utility slide-in-from-top { --tw-enter-translate-y: -100%; }
58
+ @utility slide-in-from-top-* { --tw-enter-translate-y: --spacing(--value(integer)*-1); --tw-enter-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-y: calc(--value(ratio)*-100%); --tw-enter-translate-y: calc(--value(--translate-*,[percentage],[length])*-1); }
59
+ @utility slide-in-from-bottom { --tw-enter-translate-y: 100%; }
60
+ @utility slide-in-from-bottom-* { --tw-enter-translate-y: --spacing(--value(integer)); --tw-enter-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-y: calc(--value(ratio)*100%); --tw-enter-translate-y: --value(--translate-*,[percentage],[length]); }
61
+ @utility slide-in-from-left { --tw-enter-translate-x: -100%; }
62
+ @utility slide-in-from-left-* { --tw-enter-translate-x: --spacing(--value(integer)*-1); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-x: calc(--value(ratio)*-100%); --tw-enter-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }
63
+ @utility slide-in-from-right { --tw-enter-translate-x: 100%; }
64
+ @utility slide-in-from-right-* { --tw-enter-translate-x: --spacing(--value(integer)); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-x: calc(--value(ratio)*100%); --tw-enter-translate-x: --value(--translate-*,[percentage],[length]); }
65
+ @utility slide-in-from-start { &:dir(ltr){ --tw-enter-translate-x: -100%; }&:dir(rtl){ --tw-enter-translate-x: 100%; } }
66
+ @utility slide-in-from-start-* { &:where(:dir(ltr), [dir="ltr"], [dir="ltr"]*){ --tw-enter-translate-x: --spacing(--value(integer)*-1); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-x: calc(--value(ratio)*-100%); --tw-enter-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }&:where(:dir(rtl), [dir="rtl"], [dir="rtl"]*){ --tw-enter-translate-x: --spacing(--value(integer)); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-x: calc(--value(ratio)*100%); --tw-enter-translate-x: --value(--translate-*,[percentage],[length]); } }
67
+ @utility slide-in-from-end { &:dir(ltr){ --tw-enter-translate-x: 100%; }&:dir(rtl){ --tw-enter-translate-x: -100%; } }
68
+ @utility slide-in-from-end-* { &:where(:dir(ltr), [dir="ltr"], [dir="ltr"]*){ --tw-enter-translate-x: --spacing(--value(integer)); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-enter-translate-x: calc(--value(ratio)*100%); --tw-enter-translate-x: --value(--translate-*,[percentage],[length]); }&:where(:dir(rtl), [dir="rtl"], [dir="rtl"]*){ --tw-enter-translate-x: --spacing(--value(integer)*-1); --tw-enter-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-enter-translate-x: calc(--value(ratio)*-100%); --tw-enter-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); } }
69
+ @utility slide-out-to-top { --tw-exit-translate-y: -100%; }
70
+ @utility slide-out-to-top-* { --tw-exit-translate-y: --spacing(--value(integer)*-1); --tw-exit-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-y: calc(--value(ratio)*-100%); --tw-exit-translate-y: calc(--value(--translate-*,[percentage],[length])*-1); }
71
+ @utility slide-out-to-bottom { --tw-exit-translate-y: 100%; }
72
+ @utility slide-out-to-bottom-* { --tw-exit-translate-y: --spacing(--value(integer)); --tw-exit-translate-y: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-y: calc(--value(ratio)*100%); --tw-exit-translate-y: --value(--translate-*,[percentage],[length]); }
73
+ @utility slide-out-to-left { --tw-exit-translate-x: -100%; }
74
+ @utility slide-out-to-left-* { --tw-exit-translate-x: --spacing(--value(integer)*-1); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-x: calc(--value(ratio)*-100%); --tw-exit-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }
75
+ @utility slide-out-to-right { --tw-exit-translate-x: 100%; }
76
+ @utility slide-out-to-right-* { --tw-exit-translate-x: --spacing(--value(integer)); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-x: calc(--value(ratio)*100%); --tw-exit-translate-x: --value(--translate-*,[percentage],[length]); }
77
+ @utility slide-out-to-start { &:dir(ltr){ --tw-exit-translate-x: -100%; }&:dir(rtl){ --tw-exit-translate-x: 100%; } }
78
+ @utility slide-out-to-start-* { &:where(:dir(ltr), [dir="ltr"], [dir="ltr"]*){ --tw-exit-translate-x: --spacing(--value(integer)*-1); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-x: calc(--value(ratio)*-100%); --tw-exit-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); }&:where(:dir(rtl), [dir="rtl"], [dir="rtl"]*){ --tw-exit-translate-x: --spacing(--value(integer)); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-x: calc(--value(ratio)*100%); --tw-exit-translate-x: --value(--translate-*,[percentage],[length]); } }
79
+ @utility slide-out-to-end { &:dir(ltr){ --tw-exit-translate-x: 100%; }&:dir(rtl){ --tw-exit-translate-x: -100%; } }
80
+ @utility slide-out-to-end-* { &:where(:dir(ltr), [dir="ltr"], [dir="ltr"]*){ --tw-exit-translate-x: --spacing(--value(integer)); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*100%); --tw-exit-translate-x: calc(--value(ratio)*100%); --tw-exit-translate-x: --value(--translate-*,[percentage],[length]); }&:where(:dir(rtl), [dir="rtl"], [dir="rtl"]*){ --tw-exit-translate-x: --spacing(--value(integer)*-1); --tw-exit-translate-x: calc(--value(--percentage-*,--percentage-translate-*)*-100%); --tw-exit-translate-x: calc(--value(ratio)*-100%); --tw-exit-translate-x: calc(--value(--translate-*,[percentage],[length])*-1); } }
81
+
82
+ /* src/styles/partials/_horizon-colors.css */
83
+ @theme { --color-background: var(--color-neutral-950); --color-ring-offset: var(--color-neutral-950); --color-text-primary: var(--color-neutral-50); --color-text-secondary: var(--color-neutral-300); --color-button-danger: var(--color-danger); --color-button-danger--hover: color-mix(in oklab, var(--color-danger) 80%, transparent); --color-button-primary-bg: var(--color-neutral-50); --color-button-primary-bg--disabled: var(--color-neutral-500); --color-button-primary-border: var(--color-neutral-900); --color-button-primary-border--disabled: var(--color-neutral-500); --color-button-primary-text: var(--color-neutral-900); --color-button-primary-text--disabled: var(--color-neutral-200); --color-button-secondary-bg: var(--color-level-two); --color-button-secondary-bg--disabled: var(--color-neutral-500); --color-button-secondary-text: var(--color-neutral-50); --color-button-secondary-text--disabled: var(--color-neutral-200); --color-button-secondary-border: var(--color-neutral-900); --color-button-secondary-border--disabled: var(--color-neutral-500); --color-button-outline-bg: var(--color-transparent); --color-button-outline-text: var(--color-neutral-50); --color-button-outline-text--disabled: var(--color-neutral-400); --color-button-outline-border: var(--color-neutral-50); --color-button-outline-border--disabled: var(--color-neutral-400); --color-card-bg: var(--color-neutral-900-40a); --color-card-bg: color-mix(in oklab, var(--color-neutral-900) 40%, transparent); --color-card-text: var(--color-neutral-50); --color-drawer-bg: var(--color-level-one); --color-slider-track: var(--color-neutral-700); --color-slider-range: var(--color-neutral-50); --color-slider-thumb-border: var(--color-neutral-50); --color-slider-thumb-bg: var(--color-neutral-50); --color-slider-thumb-ring: var(--color-neutral-50); }
84
+ :root[data-theme=light] {
85
+ --color-background: var(--color-neutral-50);
86
+ --color-ring-offset: var(--color-neutral-50);
87
+ --color-button-secondary-text: var(--color-neutral-900);
88
+ --color-button-secondary-text--hover: var(--color-neutral-900);
89
+ --color-button-secondary-text--active: var(--color-neutral-900);
90
+ --color-button-secondary-text--disabled: var(--color-neutral-400);
91
+ --color-button-secondary-border: 1px solid var(--color-neutral-900);
92
+ --color-button-secondary-border--hover: 1px solid var(--color-neutral-200);
93
+ --color-button-secondary-border--active: 1px solid var(--color-neutral-200);
94
+ --color-button-secondary-border--disabled: 1px solid var(--color-neutral-400);
95
+ }
96
+
97
+ /* src/styles/partials/_horizon-base-colors.css */
98
+ :root {
99
+ --color-black: oklch(0 0 0);
100
+ --color-white: oklch(1 0 0);
101
+ --color-transparent: oklch(0 0 0 / 0%);
102
+ --color-accent: oklch(92.53% 0.1976 123.38);
103
+ --color-danger: oklch(62.39% 0.2536 28.3);
104
+ --color-success: oklch(75.9% 0.2424 144.72);
105
+ --color-warning: oklch(74.58% 0.1806 56.91);
106
+ --color-neutral-50: oklch(98.51% 0 0);
107
+ --color-neutral-100: oklch(92.19% 0 0);
108
+ --color-neutral-200: oklch(86.99% 0 0);
109
+ --color-neutral-300: oklch(71.55% 0 0);
110
+ --color-neutral-400: oklch(55.55% 0 0);
111
+ --color-neutral-500: oklch(43.86% 0 0);
112
+ --color-neutral-600: oklch(37.15% 0 0);
113
+ --color-neutral-700: oklch(32.11% 0 0);
114
+ --color-neutral-800: oklch(26.86% 0 0);
115
+ --color-neutral-900: oklch(25.2% 0 0);
116
+ --color-neutral-950: oklch(23.95% 0.0059 271.17);
117
+ --color-level-zero: hsl(232, 11%, 14%);
118
+ --color-level-one: hsl(223, 9%, 16%);
119
+ --color-level-two: hsl(213, 9%, 19%);
120
+ --color-level-three: hsl(213, 8%, 21%);
121
+ --color-level-four: hsl(213, 7%, 24%);
122
+ --color-primary-50: oklch(97.05% 0.0142 254.6);
123
+ --color-primary-100: oklch(93.19% 0.0316 255.59);
124
+ --color-primary-200: oklch(88.41% 0.0581 252.44);
125
+ --color-primary-300: oklch(80.75% 0.0958 253.19);
126
+ --color-primary-400: oklch(71.27% 0.1469 255.61);
127
+ --color-primary-500: oklch(62.31% 0.1862 260.06);
128
+ --color-primary-600: oklch(54.34% 0.2151 263.01);
129
+ --color-primary-700: oklch(49.14% 0.2189 264.03);
130
+ --color-primary-800: oklch(42.75% 0.1828 265.08);
131
+ --color-primary-900: oklch(37.78% 0.1366 265.11);
132
+ --color-primary-950: oklch(28.37% 0.0887 268.75);
133
+ }
134
+
135
+ /* src/styles/partials/_horizon-theme.css */
136
+ @theme { --font-body: "Work Sans", sans-serif; --font-serif: "Bitter", serif; --font-mono: "Source Code Pro", monospace; --animate-fade-in-scale: fade-in-scale 0.3s ease-out; --animate-slide-from-bottom: slide-from-bottom; --animate-slide-to-bottom: slide-to-bottom; @keyframes fade-in-scale { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } } @keyframes slide-from-bottom { from { transform: translate3d(0, 100%, 0); } to { transform: translate3d(0, 0, 0); } } @keyframes slide-to-bottom { to { transform: translate3d(0, 100%, 0); } } }
137
+ @layer base {
138
+ :root {
139
+ --sidebar: hsl(240, 7%, 97%);
140
+ --sidebar-foreground: hsl(240, 17%, 18%);
141
+ --sidebar-primary: hsl(240, 17%, 18%);
142
+ --sidebar-primary-foreground: oklch(0.985 0 0);
143
+ --sidebar-accent: oklch(0.97 0 0);
144
+ --sidebar-accent-foreground: oklch(0.205 0 0);
145
+ --sidebar-border: hsl(240, 7%, 97%);
146
+ --sidebar-ring: oklch(0.708 0 0);
147
+ --ring: oklch(0.708 0 0);
148
+ }
149
+ .dark {
150
+ --sidebar: hsl(240, 17%, 18%);
151
+ --sidebar-foreground: hsl(240, 7%, 97%);
152
+ --sidebar-primary: hsl(240, 7%, 97%);
153
+ --sidebar-primary-foreground: oklch(0.985 0 0);
154
+ --sidebar-accent: oklch(0.269 0 0);
155
+ --sidebar-accent-foreground: oklch(0.985 0 0);
156
+ --sidebar-border: hsl(240, 17%, 18%);
157
+ --sidebar-ring: oklch(0.439 0 0);
158
+ --color-ring-offset: var(--color-neutral-950);
159
+ --ring-offset-width: 2px;
160
+ }
161
+ }
162
+
163
+ /* src/styles/main.css */
164
+ @keyframes slide-up {
165
+ 0% {
166
+ transform: translateY(50%);
167
+ opacity: 0;
168
+ }
169
+ 100% {
170
+ transform: translateY(0);
171
+ opacity: 1;
172
+ }
173
+ }
174
+ @keyframes slide-down {
175
+ 0% {
176
+ transform: translateY(0);
177
+ opacity: 1;
178
+ }
179
+ 100% {
180
+ transform: translateY(50%);
181
+ opacity: 0;
182
+ }
183
+ }
184
+ .slide-up {
185
+ animation: slide-up 0.3s ease-in-out;
186
+ }
187
+ .slide-down {
188
+ animation: slide-down 0.3s ease-in-out;
189
+ }
package/dist/index.d.ts CHANGED
@@ -1,22 +1,75 @@
1
- export { Button } from './components/Button/Button';
2
- export type { ButtonProps } from './components/Button/Button';
3
- export { Card } from './components/Card/Card';
4
- export type { CardProps } from './components/Card/Card';
5
- export { Checkbox } from './components/Checkbox/Checkbox';
6
- export type { CheckboxProps } from './components/Checkbox/Checkbox';
7
- export { Input } from './components/Input/Input';
8
- export type { InputProps } from './components/Input/Input';
9
- export { Label } from './components/Label/Label';
10
- export { RadioGroup } from './components/RadioGroup/RadioGroup';
11
- export type { RadioGroupProps } from './components/RadioGroup/RadioGroup';
12
- export { Select } from './components/Select/Select';
13
- export type { SelectProps } from './components/Select/Select';
14
- export { Sidebar } from './components/Sidebar/Sidebar';
15
- export { Skeleton } from './components/Skeleton/Skeleton';
16
- export { Slider } from './components/Slider/Slider';
17
- export type { SliderProps } from './components/Slider/Slider';
18
- export { Switch } from './components/Switch/Switch';
19
- export { Textarea } from './components/Textarea/Textarea';
20
- export type { TextareaProps } from './components/Textarea/Textarea';
21
- export { useTheme } from './hooks/useTheme';
22
- export { cn } from './utils/twUtils';
1
+ import * as react from 'react';
2
+ import { ButtonHTMLAttributes, ReactNode, MouseEvent, HTMLAttributes, ComponentProps } from 'react';
3
+ import * as class_variance_authority_types from 'class-variance-authority/types';
4
+ import { VariantProps } from 'class-variance-authority';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+ import * as SliderPrimitive from '@radix-ui/react-slider';
7
+ import { ClassValue } from 'clsx';
8
+
9
+ declare const buttonVariants: (props?: ({
10
+ variant?: "primary" | "secondary" | "outline" | null | undefined;
11
+ state?: "default" | "error" | "loading" | null | undefined;
12
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
13
+ interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'>, VariantProps<typeof buttonVariants> {
14
+ errorMessage?: string | ReactNode;
15
+ endIcon?: ReactNode;
16
+ label: string;
17
+ disabled?: boolean;
18
+ startIcon?: ReactNode;
19
+ type?: 'button' | 'submit' | 'reset';
20
+ state?: 'loading' | 'error' | 'default';
21
+ dataTestId?: string;
22
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
23
+ isFullWidth?: boolean;
24
+ }
25
+ declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
26
+
27
+ interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> {
28
+ title?: string;
29
+ icon?: ReactNode;
30
+ width?: 'full' | 'fit';
31
+ isLoading?: boolean;
32
+ children?: ReactNode;
33
+ }
34
+ declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLDivElement>>;
35
+
36
+ type DrawerProps = {
37
+ title?: string;
38
+ trigger: ReactNode;
39
+ description?: string;
40
+ children?: ReactNode;
41
+ direction?: 'left' | 'right' | 'top' | 'bottom';
42
+ size?: string;
43
+ };
44
+ declare const Drawer: ({ trigger, title, description, children, direction, size }: DrawerProps) => react_jsx_runtime.JSX.Element;
45
+
46
+ declare function Skeleton({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
47
+
48
+ type SliderProps = ComponentProps<typeof SliderPrimitive.Root> & {
49
+ className?: string;
50
+ defaultValue?: number[];
51
+ value?: number[];
52
+ min?: number;
53
+ max?: number;
54
+ step?: number;
55
+ minStepsBetweenThumbs?: number;
56
+ onValueChange?: (value: number[]) => void;
57
+ orientation?: 'horizontal' | 'vertical';
58
+ onValueCommit?: (value: number[]) => void;
59
+ disabled?: boolean;
60
+ name?: string;
61
+ };
62
+ declare function Slider({ className, defaultValue, value, min, max, step, minStepsBetweenThumbs, onValueChange, orientation, onValueCommit, disabled, name, ...props }: SliderProps): react_jsx_runtime.JSX.Element;
63
+
64
+ type Theme = 'light' | 'dark';
65
+ interface UseThemeReturn {
66
+ theme: Theme;
67
+ setTheme: (theme: Theme) => void;
68
+ toggleTheme: () => void;
69
+ }
70
+ declare const useTheme: (defaultTheme?: Theme) => UseThemeReturn;
71
+
72
+ declare function cn(...inputs: ClassValue[]): string;
73
+ declare function pxToRem(px: number): string;
74
+
75
+ export { Button, type ButtonProps, Card, type CardProps, Drawer, type DrawerProps, Skeleton, Slider, type SliderProps, cn, pxToRem, useTheme };
package/dist/index.js ADDED
@@ -0,0 +1,276 @@
1
+ "use client"
2
+
3
+ // src/utils/twUtils.ts
4
+ import { clsx } from "clsx";
5
+ import { twMerge } from "tailwind-merge";
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+ function pxToRem(px) {
10
+ return `${px / 16}rem`;
11
+ }
12
+
13
+ // src/components/Button/Button.tsx
14
+ import { cva } from "class-variance-authority";
15
+ import { Loader2 } from "lucide-react";
16
+ import { forwardRef } from "react";
17
+ import { jsx, jsxs } from "react/jsx-runtime";
18
+ var buttonVariants = cva(
19
+ `
20
+ flex relative items-center justify-center gap-2 whitespace-nowrap transition-colors cursor-pointer py-2 px-6 rounded-lg border font-semibold
21
+ focus:outline-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus:ring-2 focus:ring-ring focus:ring-offset-2
22
+ focus-visible:ring-offset-2 disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0
23
+ `,
24
+ {
25
+ variants: {
26
+ variant: {
27
+ primary: "bg-button-primary-bg text-button-primary-text border-button-primary-border disabled:bg-button-primary-bg--disabled disabled:text-button-primary-text--disabled disabled:border-button-primary-border--disabled",
28
+ secondary: "bg-button-secondary-bg border-button-secondary-border text-button-secondary-text disabled:bg-button-secondary-bg--disabled disabled:text-button-secondary-text--disabled disabled:border-button-secondary-border--disabled",
29
+ outline: "bg-button-outline-bg border-button-outline-border text-button-outline-text disabled:text-button-outline-text--disabled disabled:border-button-outline-border--disabled"
30
+ },
31
+ state: {
32
+ default: "",
33
+ error: "bg-button-danger text-button-primary-text transition pointer-events-none",
34
+ loading: "cursor-wait pointer-events-none"
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ variant: "primary",
39
+ state: "default"
40
+ }
41
+ }
42
+ );
43
+ var Button = forwardRef(
44
+ ({
45
+ className,
46
+ variant,
47
+ label,
48
+ endIcon,
49
+ state,
50
+ errorMessage,
51
+ startIcon,
52
+ disabled,
53
+ type = "button",
54
+ dataTestId = `button-${variant}`,
55
+ isFullWidth,
56
+ ...props
57
+ }, ref) => {
58
+ const stateStyles = {
59
+ error: {
60
+ primary: "bg-button-danger border-button-danger text-button-primary-text pointer-events-none",
61
+ secondary: "bg-button-danger border-button-danger text-button-secondary-text pointer-events-none",
62
+ outline: "bg-transparent border-button-danger text-button-danger pointer-events-none"
63
+ },
64
+ loading: {
65
+ primary: "bg-button-primary-bg--disabled border-button-primary-border--disabled text-button-primary-text--disabled pointer-events-none",
66
+ secondary: "bg-button-secondary-bg--disabled border-button-secondary-border--disabled text-button-secondary-text--disabled pointer-events-none",
67
+ outline: "bg-button-outline-bg--disabled border-button-outline-border--disabled text-button-outline-text--disabled pointer-events-none"
68
+ }
69
+ };
70
+ const widthClass = isFullWidth ? "w-full" : "w-auto";
71
+ const classes = cn(
72
+ buttonVariants({ variant, state }),
73
+ state === "error" && stateStyles.error[variant || "primary"],
74
+ state === "loading" && stateStyles.loading[variant || "primary"],
75
+ widthClass,
76
+ className
77
+ );
78
+ return /* @__PURE__ */ jsxs("div", { className: cn("flex justify-items-center", widthClass), children: [
79
+ /* @__PURE__ */ jsxs(
80
+ "button",
81
+ {
82
+ className: classes,
83
+ ref,
84
+ type,
85
+ "aria-disabled": disabled,
86
+ disabled,
87
+ "data-testid": dataTestId,
88
+ ...props,
89
+ "data-state": state,
90
+ children: [
91
+ startIcon && /* @__PURE__ */ jsx("span", { className: "flex pr-2", "aria-hidden": true, children: startIcon }),
92
+ label,
93
+ state === "loading" && /* @__PURE__ */ jsx(Loader2, { className: "ml-2 animate-spin", size: 16 }),
94
+ endIcon && state !== "loading" && /* @__PURE__ */ jsx("span", { className: "flex pl-2", "aria-hidden": true, children: endIcon })
95
+ ]
96
+ }
97
+ ),
98
+ state === "error" && errorMessage && /* @__PURE__ */ jsx("p", { className: "text-danger text-xs", role: "alert", "aria-live": "polite", children: errorMessage })
99
+ ] });
100
+ }
101
+ );
102
+ Button.displayName = "Button";
103
+
104
+ // src/components/Card/Card.tsx
105
+ import { Loader2 as Loader22 } from "lucide-react";
106
+ import { forwardRef as forwardRef2 } from "react";
107
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
108
+ var Card = forwardRef2(
109
+ ({ className, title, icon, width = "full", isLoading = false, children, ...props }, ref) => {
110
+ const hasHeader = title || icon;
111
+ const cardClasses = cn(
112
+ "relative bg-card-bg rounded-2xl p-4 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
113
+ width === "full" ? "w-full" : "w-fit",
114
+ className
115
+ );
116
+ return /* @__PURE__ */ jsxs2("div", { ref, className: cardClasses, ...props, children: [
117
+ isLoading && /* @__PURE__ */ jsx2("div", { className: "bg-card-bg/50 absolute inset-0 z-10 flex items-center justify-center", children: /* @__PURE__ */ jsx2(Loader22, { className: "text-muted-foreground animate-spin", size: 24 }) }),
118
+ hasHeader && /* @__PURE__ */ jsxs2("div", { className: cn("flex items-center pb-4", title ? "justify-between" : "justify-end"), children: [
119
+ title && /* @__PURE__ */ jsx2("h3", { className: "text-card-text truncate text-base font-semibold", children: title }),
120
+ icon && /* @__PURE__ */ jsx2("div", { className: "flex-shrink-0", "aria-hidden": "true", children: icon })
121
+ ] }),
122
+ /* @__PURE__ */ jsx2("div", { className: cn("min-h-40 p-4", hasHeader && "pt-0"), children })
123
+ ] });
124
+ }
125
+ );
126
+ Card.displayName = "Card";
127
+
128
+ // src/components/Drawer/Drawer.tsx
129
+ import { Drawer as DrawerBase } from "vaul";
130
+ import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
131
+ var Drawer = ({ trigger, title, description, children, direction = "right", size = "320px" }) => {
132
+ const baseStyles = "fixed";
133
+ const directionStyles = {
134
+ left: {
135
+ className: `${baseStyles} top-0 bottom-0 left-0 shadow-[20px_0_20px_rgba(0,0,0,0.4)]`,
136
+ style: { width: size }
137
+ },
138
+ right: {
139
+ className: `${baseStyles} top-0 bottom-0 right-0 shadow-[-20px_0_20px_rgba(0,0,0,0.4)]`,
140
+ style: { width: size }
141
+ },
142
+ top: {
143
+ className: `${baseStyles} top-0 left-0 right-0 shadow-[0_20px_20px_rgba(0,0,0,0.4)]`,
144
+ style: { height: size }
145
+ },
146
+ bottom: {
147
+ className: `${baseStyles} bottom-0 left-0 right-0 shadow-[0_-20px_20px_rgba(0,0,0,0.4)]`,
148
+ style: { height: size }
149
+ }
150
+ };
151
+ const { className, style } = directionStyles[direction];
152
+ return /* @__PURE__ */ jsxs3(DrawerBase.Root, { direction, children: [
153
+ /* @__PURE__ */ jsx3(DrawerBase.Trigger, { asChild: true, children: trigger }),
154
+ /* @__PURE__ */ jsxs3(DrawerBase.Portal, { children: [
155
+ /* @__PURE__ */ jsx3(DrawerBase.Overlay, { className: "fixed inset-0 bg-transparent" }),
156
+ /* @__PURE__ */ jsxs3(DrawerBase.Content, { className: `bg-drawer-bg z-10 flex flex-col p-4 outline-none ${className}`, style, children: [
157
+ /* @__PURE__ */ jsx3(DrawerBase.Close, {}),
158
+ /* @__PURE__ */ jsx3(DrawerBase.Title, { className: "text-text-primary mb-2 text-lg font-semibold", children: title }),
159
+ /* @__PURE__ */ jsx3(DrawerBase.Description, { className: "!text-text-secondary mb-2 !text-xs uppercase", children: description }),
160
+ /* @__PURE__ */ jsx3("div", { className: "pt-2", children })
161
+ ] })
162
+ ] })
163
+ ] });
164
+ };
165
+
166
+ // src/components/Skeleton/Skeleton.tsx
167
+ import "react";
168
+ import { jsx as jsx4 } from "react/jsx-runtime";
169
+ function Skeleton({ className, ...props }) {
170
+ return /* @__PURE__ */ jsx4("div", { "data-slot": "skeleton", className: cn("bg-accent animate-pulse rounded-md", className), ...props });
171
+ }
172
+
173
+ // src/components/Slider/Slider.tsx
174
+ import * as SliderPrimitive from "@radix-ui/react-slider";
175
+ import "react";
176
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
177
+ function Slider({
178
+ className,
179
+ defaultValue,
180
+ value,
181
+ min = 0,
182
+ max = 100,
183
+ step = 1,
184
+ minStepsBetweenThumbs = 1,
185
+ onValueChange,
186
+ orientation = "horizontal",
187
+ onValueCommit,
188
+ disabled,
189
+ name,
190
+ ...props
191
+ }) {
192
+ const _values = value || defaultValue || [min];
193
+ return /* @__PURE__ */ jsxs4(
194
+ SliderPrimitive.Root,
195
+ {
196
+ "data-slot": "slider",
197
+ defaultValue,
198
+ value,
199
+ min,
200
+ max,
201
+ step,
202
+ minStepsBetweenThumbs,
203
+ onValueChange,
204
+ orientation,
205
+ onValueCommit,
206
+ disabled,
207
+ name,
208
+ className: cn(
209
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
210
+ className
211
+ ),
212
+ ...props,
213
+ children: [
214
+ /* @__PURE__ */ jsx5(
215
+ SliderPrimitive.Track,
216
+ {
217
+ "data-slot": "slider-track",
218
+ className: cn(
219
+ "bg-slider-track relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
220
+ ),
221
+ children: /* @__PURE__ */ jsx5(
222
+ SliderPrimitive.Range,
223
+ {
224
+ "data-slot": "slider-range",
225
+ className: cn(
226
+ "bg-slider-range absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
227
+ )
228
+ }
229
+ )
230
+ }
231
+ ),
232
+ Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx5(
233
+ SliderPrimitive.Thumb,
234
+ {
235
+ "data-slot": "slider-thumb",
236
+ className: "border-slider-thumb-border bg-slider-thumb-bg ring-slider-thumb-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
237
+ },
238
+ index
239
+ ))
240
+ ]
241
+ }
242
+ );
243
+ }
244
+
245
+ // src/hooks/useTheme.ts
246
+ import { useEffect, useState } from "react";
247
+ var useTheme = (defaultTheme = "dark") => {
248
+ const [theme, setThemeState] = useState(() => {
249
+ if (typeof window === "undefined") return defaultTheme;
250
+ const stored = localStorage.getItem("theme");
251
+ if (stored === "light" || stored === "dark") return stored;
252
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
253
+ });
254
+ const setTheme = (newTheme) => {
255
+ setThemeState(newTheme);
256
+ };
257
+ const toggleTheme = () => {
258
+ setTheme(theme === "dark" ? "light" : "dark");
259
+ };
260
+ useEffect(() => {
261
+ const root = document.documentElement;
262
+ root.setAttribute("data-theme", theme);
263
+ localStorage.setItem("theme", theme);
264
+ }, [theme]);
265
+ return { theme, setTheme, toggleTheme };
266
+ };
267
+ export {
268
+ Button,
269
+ Card,
270
+ Drawer,
271
+ Skeleton,
272
+ Slider,
273
+ cn,
274
+ pxToRem,
275
+ useTheme
276
+ };