@stagewise/ui 0.1.0 → 0.3.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 (114) hide show
  1. package/README.md +9 -3
  2. package/package.json +9 -15
  3. package/src/components/ui/accordion.tsx +13 -15
  4. package/src/components/ui/alert-dialog.tsx +38 -38
  5. package/src/components/ui/alert.tsx +22 -22
  6. package/src/components/ui/aspect-ratio.tsx +6 -6
  7. package/src/components/ui/avatar.tsx +30 -30
  8. package/src/components/ui/badge.tsx +24 -22
  9. package/src/components/ui/breadcrumb.tsx +34 -37
  10. package/src/components/ui/bubble.tsx +48 -48
  11. package/src/components/ui/button-group.tsx +24 -24
  12. package/src/components/ui/button.tsx +24 -24
  13. package/src/components/ui/calendar.tsx +94 -81
  14. package/src/components/ui/card.tsx +30 -30
  15. package/src/components/ui/carousel.tsx +95 -92
  16. package/src/components/ui/chart.tsx +110 -110
  17. package/src/components/ui/checkbox.tsx +9 -10
  18. package/src/components/ui/collapsible.tsx +5 -5
  19. package/src/components/ui/combobox.tsx +51 -44
  20. package/src/components/ui/command.tsx +173 -190
  21. package/src/components/ui/context-menu.tsx +60 -50
  22. package/src/components/ui/dialog.tsx +33 -34
  23. package/src/components/ui/direction.tsx +1 -1
  24. package/src/components/ui/drawer.tsx +61 -61
  25. package/src/components/ui/dropdown-menu.tsx +54 -50
  26. package/src/components/ui/empty.tsx +30 -30
  27. package/src/components/ui/field.tsx +64 -64
  28. package/src/components/ui/hover-card.tsx +12 -12
  29. package/src/components/ui/input-group.tsx +54 -54
  30. package/src/components/ui/input-otp.tsx +24 -25
  31. package/src/components/ui/input.tsx +8 -8
  32. package/src/components/ui/item.tsx +64 -64
  33. package/src/components/ui/kbd.tsx +8 -8
  34. package/src/components/ui/klex-logo-combo.tsx +69 -0
  35. package/src/components/ui/klex-logo-text.tsx +70 -0
  36. package/src/components/ui/klex-logo.tsx +146 -0
  37. package/src/components/ui/label.tsx +8 -8
  38. package/src/components/ui/marker.tsx +25 -25
  39. package/src/components/ui/menubar.tsx +54 -50
  40. package/src/components/ui/message-scroller.tsx +130 -0
  41. package/src/components/ui/message.tsx +27 -27
  42. package/src/components/ui/native-select.tsx +22 -18
  43. package/src/components/ui/navigation-menu.tsx +37 -34
  44. package/src/components/ui/pagination.tsx +34 -31
  45. package/src/components/ui/popover.tsx +19 -19
  46. package/src/components/ui/progress.tsx +16 -16
  47. package/src/components/ui/questionnaire.tsx +72 -69
  48. package/src/components/ui/radio-group.tsx +9 -9
  49. package/src/components/ui/resizable.tsx +19 -12
  50. package/src/components/ui/scroll-area.tsx +10 -10
  51. package/src/components/ui/select.tsx +39 -34
  52. package/src/components/ui/separator.tsx +7 -7
  53. package/src/components/ui/sheet.tsx +31 -32
  54. package/src/components/ui/sidebar.tsx +244 -232
  55. package/src/components/ui/skeleton.tsx +5 -5
  56. package/src/components/ui/slider.tsx +11 -7
  57. package/src/components/ui/spinner.tsx +15 -6
  58. package/src/components/ui/stagewise-logo-combo.tsx +43 -0
  59. package/src/components/ui/stagewise-logo-text.tsx +30 -0
  60. package/src/components/ui/stagewise-logo.tsx +42 -0
  61. package/src/components/ui/switch.tsx +9 -9
  62. package/src/components/ui/table.tsx +31 -31
  63. package/src/components/ui/tabs.tsx +37 -26
  64. package/src/components/ui/textarea.tsx +7 -7
  65. package/src/components/ui/toast.tsx +70 -70
  66. package/src/components/ui/toggle-group.tsx +26 -26
  67. package/src/components/ui/toggle.tsx +15 -15
  68. package/src/components/ui/tooltip.tsx +13 -13
  69. package/src/hooks/use-mobile.ts +13 -11
  70. package/src/icons/custom/ui-outline-18/IconKlexOutline18.tsx +39 -0
  71. package/src/icons/custom/ui-outline-18/IconLaptop.tsx +35 -0
  72. package/src/icons/custom/ui-outline-18/IconSignOut.tsx +33 -0
  73. package/src/icons/custom/ui-outline-18/index.ts +4 -1
  74. package/src/icons/index.ts +43 -20
  75. package/src/icons/nucleo/social-media/IconMicrosoftEntraId.tsx +56 -0
  76. package/src/icons/nucleo/social-media/index.ts +1 -0
  77. package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +4 -3
  78. package/src/icons/nucleo/ui-outline-18/IconArrowTurnRightOutline18.tsx +32 -0
  79. package/src/icons/nucleo/ui-outline-18/IconArrowUpOutline18.tsx +35 -0
  80. package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +4 -3
  81. package/src/icons/nucleo/ui-outline-18/IconChevronMaximizeDiagonal2Outline18.tsx +33 -0
  82. package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +4 -3
  83. package/src/icons/nucleo/ui-outline-18/IconEmptyOutline18.tsx +41 -0
  84. package/src/icons/nucleo/ui-outline-18/IconEyeOffOutline18.tsx +18 -0
  85. package/src/icons/nucleo/ui-outline-18/IconLinkBrokenOutline18.tsx +66 -0
  86. package/src/icons/nucleo/ui-outline-18/IconLock18Outline.tsx +48 -0
  87. package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +4 -3
  88. package/src/icons/nucleo/ui-outline-18/IconMsgs2Outline18.tsx +32 -0
  89. package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +4 -3
  90. package/src/icons/nucleo/ui-outline-18/IconSidebarLeft2HideOutline18.tsx +63 -0
  91. package/src/icons/nucleo/ui-outline-18/IconSidebarRight2HideOutline18.tsx +63 -0
  92. package/src/icons/nucleo/ui-outline-18/index.ts +11 -1
  93. package/src/icons/provider/IconAnthropic.tsx +15 -0
  94. package/src/icons/provider/IconAttio.tsx +9 -0
  95. package/src/icons/provider/IconCodex.tsx +18 -0
  96. package/src/icons/provider/IconDiscord.tsx +17 -0
  97. package/src/icons/provider/IconGemini.tsx +152 -0
  98. package/src/icons/provider/IconLinear.tsx +9 -0
  99. package/src/icons/provider/IconOpenAI.tsx +15 -0
  100. package/src/icons/provider/IconOpenRouter.tsx +24 -0
  101. package/src/icons/provider/IconSlack.tsx +24 -0
  102. package/src/icons/provider/IconTelegram.tsx +29 -0
  103. package/src/icons/provider/IconWhatsapp.tsx +14 -0
  104. package/src/icons/provider/LICENSE +21 -0
  105. package/src/icons/provider/index.ts +11 -0
  106. package/src/index.ts +68 -61
  107. package/src/lib/utils.ts +3 -3
  108. package/src/styles/bridge.css +7 -3
  109. package/src/styles/derived-utilities.css +129 -50
  110. package/src/styles/index.css +17 -2
  111. package/src/styles/palette.css +266 -105
  112. package/src/styles/scroll-fade.css +116 -0
  113. package/src/styles/tailwind-tokens.css +3 -0
  114. package/src/styles/theme.css +57 -43
@@ -1,106 +1,109 @@
1
- import * as React from "react"
1
+ import * as React from 'react';
2
2
  import useEmblaCarousel, {
3
3
  type UseEmblaCarouselType,
4
- } from "embla-carousel-react"
4
+ } from 'embla-carousel-react';
5
5
 
6
- import { cn } from "../../lib/utils"
7
- import { Button } from "./button"
8
- import { IconChevronLeftOutline18, IconChevronRightOutline18 } from "../../icons"
6
+ import { cn } from '../../lib/utils';
7
+ import { Button } from './button';
8
+ import {
9
+ IconChevronLeftOutline18,
10
+ IconChevronRightOutline18,
11
+ } from '../../icons';
9
12
 
10
- type CarouselApi = UseEmblaCarouselType[1]
11
- type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
12
- type CarouselOptions = UseCarouselParameters[0]
13
- type CarouselPlugin = UseCarouselParameters[1]
13
+ type CarouselApi = UseEmblaCarouselType[1];
14
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
15
+ type CarouselOptions = UseCarouselParameters[0];
16
+ type CarouselPlugin = UseCarouselParameters[1];
14
17
 
15
18
  type CarouselProps = {
16
- opts?: CarouselOptions
17
- plugins?: CarouselPlugin
18
- orientation?: "horizontal" | "vertical"
19
- setApi?: (api: CarouselApi) => void
20
- }
19
+ opts?: CarouselOptions;
20
+ plugins?: CarouselPlugin;
21
+ orientation?: 'horizontal' | 'vertical';
22
+ setApi?: (api: CarouselApi) => void;
23
+ };
21
24
 
22
25
  type CarouselContextProps = {
23
- carouselRef: ReturnType<typeof useEmblaCarousel>[0]
24
- api: ReturnType<typeof useEmblaCarousel>[1]
25
- scrollPrev: () => void
26
- scrollNext: () => void
27
- canScrollPrev: boolean
28
- canScrollNext: boolean
29
- } & CarouselProps
26
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
27
+ api: ReturnType<typeof useEmblaCarousel>[1];
28
+ scrollPrev: () => void;
29
+ scrollNext: () => void;
30
+ canScrollPrev: boolean;
31
+ canScrollNext: boolean;
32
+ } & CarouselProps;
30
33
 
31
- const CarouselContext = React.createContext<CarouselContextProps | null>(null)
34
+ const CarouselContext = React.createContext<CarouselContextProps | null>(null);
32
35
 
33
36
  function useCarousel() {
34
- const context = React.useContext(CarouselContext)
37
+ const context = React.useContext(CarouselContext);
35
38
 
36
39
  if (!context) {
37
- throw new Error("useCarousel must be used within a <Carousel />")
40
+ throw new Error('useCarousel must be used within a <Carousel />');
38
41
  }
39
42
 
40
- return context
43
+ return context;
41
44
  }
42
45
 
43
46
  function Carousel({
44
- orientation = "horizontal",
47
+ orientation = 'horizontal',
45
48
  opts,
46
49
  setApi,
47
50
  plugins,
48
51
  className,
49
52
  children,
50
53
  ...props
51
- }: React.ComponentProps<"div"> & CarouselProps) {
54
+ }: React.ComponentProps<'div'> & CarouselProps) {
52
55
  const [carouselRef, api] = useEmblaCarousel(
53
56
  {
54
57
  ...opts,
55
- axis: orientation === "horizontal" ? "x" : "y",
58
+ axis: orientation === 'horizontal' ? 'x' : 'y',
56
59
  },
57
- plugins
58
- )
59
- const [canScrollPrev, setCanScrollPrev] = React.useState(false)
60
- const [canScrollNext, setCanScrollNext] = React.useState(false)
60
+ plugins,
61
+ );
62
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
63
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
61
64
 
62
65
  const onSelect = React.useCallback((api: CarouselApi) => {
63
- if (!api) return
64
- setCanScrollPrev(api.canScrollPrev())
65
- setCanScrollNext(api.canScrollNext())
66
- }, [])
66
+ if (!api) return;
67
+ setCanScrollPrev(api.canScrollPrev());
68
+ setCanScrollNext(api.canScrollNext());
69
+ }, []);
67
70
 
68
71
  const scrollPrev = React.useCallback(() => {
69
- api?.scrollPrev()
70
- }, [api])
72
+ api?.scrollPrev();
73
+ }, [api]);
71
74
 
72
75
  const scrollNext = React.useCallback(() => {
73
- api?.scrollNext()
74
- }, [api])
76
+ api?.scrollNext();
77
+ }, [api]);
75
78
 
76
79
  const handleKeyDown = React.useCallback(
77
80
  (event: React.KeyboardEvent<HTMLDivElement>) => {
78
- if (event.key === "ArrowLeft") {
79
- event.preventDefault()
80
- scrollPrev()
81
- } else if (event.key === "ArrowRight") {
82
- event.preventDefault()
83
- scrollNext()
81
+ if (event.key === 'ArrowLeft') {
82
+ event.preventDefault();
83
+ scrollPrev();
84
+ } else if (event.key === 'ArrowRight') {
85
+ event.preventDefault();
86
+ scrollNext();
84
87
  }
85
88
  },
86
- [scrollPrev, scrollNext]
87
- )
89
+ [scrollPrev, scrollNext],
90
+ );
88
91
 
89
92
  React.useEffect(() => {
90
- if (!api || !setApi) return
91
- setApi(api)
92
- }, [api, setApi])
93
+ if (!api || !setApi) return;
94
+ setApi(api);
95
+ }, [api, setApi]);
93
96
 
94
97
  React.useEffect(() => {
95
- if (!api) return
96
- onSelect(api)
97
- api.on("reInit", onSelect)
98
- api.on("select", onSelect)
98
+ if (!api) return;
99
+ onSelect(api);
100
+ api.on('reInit', onSelect);
101
+ api.on('select', onSelect);
99
102
 
100
103
  return () => {
101
- api?.off("select", onSelect)
102
- }
103
- }, [api, onSelect])
104
+ api?.off('select', onSelect);
105
+ };
106
+ }, [api, onSelect]);
104
107
 
105
108
  return (
106
109
  <CarouselContext.Provider
@@ -109,7 +112,7 @@ function Carousel({
109
112
  api: api,
110
113
  opts,
111
114
  orientation:
112
- orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
115
+ orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),
113
116
  scrollPrev,
114
117
  scrollNext,
115
118
  canScrollPrev,
@@ -118,7 +121,7 @@ function Carousel({
118
121
  >
119
122
  <div
120
123
  onKeyDownCapture={handleKeyDown}
121
- className={cn("relative", className)}
124
+ className={cn('relative', className)}
122
125
  role="region"
123
126
  aria-roledescription="carousel"
124
127
  data-slot="carousel"
@@ -127,11 +130,11 @@ function Carousel({
127
130
  {children}
128
131
  </div>
129
132
  </CarouselContext.Provider>
130
- )
133
+ );
131
134
  }
132
135
 
133
- function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
134
- const { carouselRef, orientation } = useCarousel()
136
+ function CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {
137
+ const { carouselRef, orientation } = useCarousel();
135
138
 
136
139
  return (
137
140
  <div
@@ -141,18 +144,18 @@ function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
141
144
  >
142
145
  <div
143
146
  className={cn(
144
- "flex",
145
- orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
146
- className
147
+ 'flex',
148
+ orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',
149
+ className,
147
150
  )}
148
151
  {...props}
149
152
  />
150
153
  </div>
151
- )
154
+ );
152
155
  }
153
156
 
154
- function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
155
- const { orientation } = useCarousel()
157
+ function CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {
158
+ const { orientation } = useCarousel();
156
159
 
157
160
  return (
158
161
  <div
@@ -160,22 +163,22 @@ function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
160
163
  aria-roledescription="slide"
161
164
  data-slot="carousel-item"
162
165
  className={cn(
163
- "min-w-0 shrink-0 grow-0 basis-full",
164
- orientation === "horizontal" ? "pl-4" : "pt-4",
165
- className
166
+ 'min-w-0 shrink-0 grow-0 basis-full',
167
+ orientation === 'horizontal' ? 'pl-4' : 'pt-4',
168
+ className,
166
169
  )}
167
170
  {...props}
168
171
  />
169
- )
172
+ );
170
173
  }
171
174
 
172
175
  function CarouselPrevious({
173
176
  className,
174
- variant = "outline",
175
- size = "icon-sm",
177
+ variant = 'outline',
178
+ size = 'icon-sm',
176
179
  ...props
177
180
  }: React.ComponentProps<typeof Button>) {
178
- const { orientation, scrollPrev, canScrollPrev } = useCarousel()
181
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
179
182
 
180
183
  return (
181
184
  <Button
@@ -183,11 +186,11 @@ function CarouselPrevious({
183
186
  variant={variant}
184
187
  size={size}
185
188
  className={cn(
186
- "absolute touch-manipulation rounded-full",
187
- orientation === "horizontal"
188
- ? "inset-y-0 -left-12 my-auto"
189
- : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
190
- className
189
+ 'absolute touch-manipulation rounded-full',
190
+ orientation === 'horizontal'
191
+ ? 'inset-y-0 -left-12 my-auto'
192
+ : '-top-12 left-1/2 -translate-x-1/2 rotate-90',
193
+ className,
191
194
  )}
192
195
  disabled={!canScrollPrev}
193
196
  onClick={scrollPrev}
@@ -196,16 +199,16 @@ function CarouselPrevious({
196
199
  <IconChevronLeftOutline18 />
197
200
  <span className="sr-only">Previous slide</span>
198
201
  </Button>
199
- )
202
+ );
200
203
  }
201
204
 
202
205
  function CarouselNext({
203
206
  className,
204
- variant = "outline",
205
- size = "icon-sm",
207
+ variant = 'outline',
208
+ size = 'icon-sm',
206
209
  ...props
207
210
  }: React.ComponentProps<typeof Button>) {
208
- const { orientation, scrollNext, canScrollNext } = useCarousel()
211
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
209
212
 
210
213
  return (
211
214
  <Button
@@ -213,11 +216,11 @@ function CarouselNext({
213
216
  variant={variant}
214
217
  size={size}
215
218
  className={cn(
216
- "absolute touch-manipulation rounded-full",
217
- orientation === "horizontal"
218
- ? "inset-y-0 -right-12 my-auto"
219
- : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
220
- className
219
+ 'absolute touch-manipulation rounded-full',
220
+ orientation === 'horizontal'
221
+ ? 'inset-y-0 -right-12 my-auto'
222
+ : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
223
+ className,
221
224
  )}
222
225
  disabled={!canScrollNext}
223
226
  onClick={scrollNext}
@@ -226,7 +229,7 @@ function CarouselNext({
226
229
  <IconChevronRightOutline18 />
227
230
  <span className="sr-only">Next slide</span>
228
231
  </Button>
229
- )
232
+ );
230
233
  }
231
234
 
232
235
  export {
@@ -237,4 +240,4 @@ export {
237
240
  CarouselPrevious,
238
241
  CarouselNext,
239
242
  useCarousel,
240
- }
243
+ };