@xjur-ui/react 1.0.4 → 2.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.
- package/.turbo/turbo-build.log +98 -42
- package/CHANGELOG.md +51 -0
- package/README.md +146 -0
- package/dist/chunk-CBFC4QME.js +2 -0
- package/dist/chunk-CBFC4QME.js.map +1 -0
- package/dist/chunk-EIG6CBTQ.js +2 -0
- package/dist/chunk-EIG6CBTQ.js.map +1 -0
- package/dist/chunk-FASEHVMD.js +2 -0
- package/dist/chunk-FASEHVMD.js.map +1 -0
- package/dist/chunk-KIFR5VIE.js +2 -0
- package/dist/chunk-KIFR5VIE.js.map +1 -0
- package/dist/chunk-KS6WGBHQ.js +2 -0
- package/dist/chunk-KS6WGBHQ.js.map +1 -0
- package/dist/chunk-NELCN6E2.js +2 -0
- package/dist/chunk-NELCN6E2.js.map +1 -0
- package/dist/chunk-NPTLORW5.js +2 -0
- package/dist/chunk-NPTLORW5.js.map +1 -0
- package/dist/chunk-RWMV7APX.js +2 -0
- package/dist/chunk-RWMV7APX.js.map +1 -0
- package/dist/chunk-SHHXKVVR.js +2 -0
- package/dist/chunk-SHHXKVVR.js.map +1 -0
- package/dist/chunk-TB6KI6CL.js +2 -0
- package/dist/chunk-TB6KI6CL.js.map +1 -0
- package/dist/components/avatar-group.js +2 -179
- package/dist/components/avatar-group.js.map +1 -0
- package/dist/components/avatar.js +2 -59
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +2 -111
- package/dist/components/badge.js.map +1 -0
- package/dist/components/button.js +2 -98
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.js +2 -751
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/checkbox.js +2 -153
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/chip.d.ts +3 -1
- package/dist/components/chip.js +2 -256
- package/dist/components/chip.js.map +1 -0
- package/dist/components/collapsible.js +2 -41
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/date-picker.d.ts +8 -3
- package/dist/components/date-picker.js +2 -232
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/divider.js +2 -29
- package/dist/components/divider.js.map +1 -0
- package/dist/components/dropdown-menu.js +2 -295
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/icon.js +2 -177
- package/dist/components/icon.js.map +1 -0
- package/dist/components/input.d.ts +9 -4
- package/dist/components/input.js +2 -315
- package/dist/components/input.js.map +1 -0
- package/dist/components/list.js +2 -179
- package/dist/components/list.js.map +1 -0
- package/dist/components/logo.js +2 -324
- package/dist/components/logo.js.map +1 -0
- package/dist/components/otp-input.js +2 -47
- package/dist/components/otp-input.js.map +1 -0
- package/dist/components/radio.js +2 -156
- package/dist/components/radio.js.map +1 -0
- package/dist/components/rich-editor.d.ts +2 -1
- package/dist/components/rich-editor.js +2 -723
- package/dist/components/rich-editor.js.map +1 -0
- package/dist/components/search-input.js +2 -274
- package/dist/components/search-input.js.map +1 -0
- package/dist/components/select.d.ts +6 -3
- package/dist/components/select.js +2 -550
- package/dist/components/select.js.map +1 -0
- package/dist/components/sheet.js +2 -251
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.js +2 -16
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/status.d.ts +14 -0
- package/dist/components/status.js +2 -0
- package/dist/components/status.js.map +1 -0
- package/dist/components/switch.js +2 -36
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +2 -196
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +9 -6
- package/dist/components/tabs.js +2 -54
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tag.d.ts +3 -1
- package/dist/components/tag.js +2 -189
- package/dist/components/tag.js.map +1 -0
- package/dist/components/tooltip.js +2 -58
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typography.js +2 -78
- package/dist/components/typography.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.css +2 -2318
- package/dist/index.css.map +1 -0
- package/dist/logo-PQRZORCS.js +3 -0
- package/dist/logo-PQRZORCS.js.map +1 -0
- package/package.json +42 -7
- package/src/components/calendar.tsx +7 -6
- package/src/components/chip.tsx +11 -3
- package/src/components/date-picker.tsx +125 -22
- package/src/components/icon.tsx +1 -1
- package/src/components/input.tsx +124 -60
- package/src/components/logo.tsx +25 -20
- package/src/components/rich-editor.tsx +4 -3
- package/src/components/select.tsx +104 -26
- package/src/components/status.tsx +43 -0
- package/src/components/tabs.tsx +56 -37
- package/src/components/tag.tsx +11 -3
- package/src/index.css +2 -2
- package/src/resources/logo/index.tsx +33 -0
- package/tsup.config.ts +23 -5
- package/dist/index.js +0 -0
- package/src/index.ts +0 -1
- package/src/resources/logo/index.ts +0 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { createContext, useContext, type ComponentProps } from 'react'
|
|
2
2
|
import * as RadixPopover from '@radix-ui/react-popover'
|
|
3
|
-
import {
|
|
3
|
+
import { tv, twMerge } from '@xjur-ui/util'
|
|
4
4
|
import {
|
|
5
5
|
ListContent,
|
|
6
6
|
ListItem,
|
|
@@ -17,25 +17,57 @@ import {
|
|
|
17
17
|
import { Icon } from './icon'
|
|
18
18
|
import { Typography, type TypographyProps } from './typography'
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const SelectContext = createContext({
|
|
21
|
+
disabled: false,
|
|
22
|
+
hasError: false
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
function useSelect() {
|
|
26
|
+
const context = useContext(SelectContext)
|
|
27
|
+
|
|
28
|
+
if (!context) {
|
|
29
|
+
throw new Error('useSelect must be used within a SelectRoot')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return context
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function SelectRoot({
|
|
36
|
+
disabled = false,
|
|
37
|
+
hasError = false,
|
|
38
|
+
...props
|
|
39
|
+
}: ComponentProps<typeof RadixPopover.Root> & {
|
|
40
|
+
disabled?: boolean
|
|
41
|
+
hasError?: boolean
|
|
42
|
+
}) {
|
|
43
|
+
return (
|
|
44
|
+
<SelectContext.Provider value={{ disabled, hasError }}>
|
|
45
|
+
<RadixPopover.Root {...props} />
|
|
46
|
+
</SelectContext.Provider>
|
|
47
|
+
)
|
|
22
48
|
}
|
|
23
49
|
|
|
24
50
|
export function SelectTrigger({
|
|
25
51
|
className,
|
|
26
52
|
...props
|
|
27
53
|
}: ComponentProps<typeof RadixPopover.Trigger>) {
|
|
54
|
+
const { disabled, hasError } = useSelect()
|
|
55
|
+
|
|
28
56
|
return (
|
|
29
57
|
<RadixPopover.Trigger
|
|
30
|
-
className={
|
|
58
|
+
className={twMerge(
|
|
31
59
|
className,
|
|
32
60
|
'group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center',
|
|
33
61
|
'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border',
|
|
34
|
-
'data-[state=open]:border-primary-idle',
|
|
35
|
-
'has-[input:not(:placeholder-shown)]:text-primary-idle',
|
|
36
|
-
'has-[input:not(:placeholder-shown)]:border-primary-idle'
|
|
62
|
+
'data-[state=open]:border-primary-idle data-[state=open]:data-[has-error=true]:border-danger-label-active',
|
|
63
|
+
'has-[input:not(:placeholder-shown)]:text-primary-idle has-[input:not(:placeholder-shown)]:data-[has-error=true]:text-danger-label-active',
|
|
64
|
+
'has-[input:not(:placeholder-shown)]:border-primary-idle has-[input:not(:placeholder-shown)]:data-[has-error=true]:border-danger-label-active',
|
|
65
|
+
'disabled:bg-layer-2-idle disabled:cursor-text disabled:border-none disabled:select-text',
|
|
66
|
+
'data-[has-error=true]:border-danger-idle data-[has-error=true]:hover:border-danger-idle'
|
|
37
67
|
)}
|
|
38
68
|
{...props}
|
|
69
|
+
data-has-error={hasError}
|
|
70
|
+
disabled={disabled}
|
|
39
71
|
/>
|
|
40
72
|
)
|
|
41
73
|
}
|
|
@@ -52,7 +84,7 @@ export function SelectContent({
|
|
|
52
84
|
<RadixPopover.Portal>
|
|
53
85
|
<RadixPopover.Content
|
|
54
86
|
align={align}
|
|
55
|
-
className={
|
|
87
|
+
className={twMerge(
|
|
56
88
|
className,
|
|
57
89
|
'group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'
|
|
58
90
|
)}
|
|
@@ -74,7 +106,14 @@ export function SelectValue({
|
|
|
74
106
|
return (
|
|
75
107
|
<>
|
|
76
108
|
{!!displayValue && (
|
|
77
|
-
<Typography
|
|
109
|
+
<Typography
|
|
110
|
+
className={twMerge(
|
|
111
|
+
className,
|
|
112
|
+
'text-neutral-dark',
|
|
113
|
+
// if has left slot, add the left slot padding
|
|
114
|
+
'group-has-[div[data-slot=select-left-slot]]:pl-large-1x'
|
|
115
|
+
)}
|
|
116
|
+
>
|
|
78
117
|
{displayValue}
|
|
79
118
|
</Typography>
|
|
80
119
|
)}
|
|
@@ -82,7 +121,7 @@ export function SelectValue({
|
|
|
82
121
|
<input
|
|
83
122
|
{...props}
|
|
84
123
|
aria-readonly={true}
|
|
85
|
-
className={
|
|
124
|
+
className={twMerge(className, 'pointer-events-none')}
|
|
86
125
|
hidden={true}
|
|
87
126
|
placeholder={props.placeholder ?? ' '}
|
|
88
127
|
readOnly={true}
|
|
@@ -99,9 +138,13 @@ export function SelectMultiValue({
|
|
|
99
138
|
}: ComponentProps<'div'> & { values: string[] }) {
|
|
100
139
|
return (
|
|
101
140
|
<div
|
|
102
|
-
className={
|
|
141
|
+
className={twMerge(
|
|
103
142
|
className,
|
|
104
|
-
'gap-small-1x scrollbar-hide
|
|
143
|
+
'gap-small-1x scrollbar-hide overflow-x-small flex',
|
|
144
|
+
// if has left slot, add the left slot padding
|
|
145
|
+
'group-has-[div[data-slot=select-left-slot]]:pl-large-1x',
|
|
146
|
+
// if the trigger is disabled, remove the left slot padding
|
|
147
|
+
'group-disabled:!pl-0'
|
|
105
148
|
)}
|
|
106
149
|
{...props}
|
|
107
150
|
>
|
|
@@ -109,7 +152,7 @@ export function SelectMultiValue({
|
|
|
109
152
|
|
|
110
153
|
<input
|
|
111
154
|
aria-readonly={true}
|
|
112
|
-
className={
|
|
155
|
+
className={twMerge(className, 'pointer-events-none')}
|
|
113
156
|
hidden={true}
|
|
114
157
|
placeholder={' '}
|
|
115
158
|
readOnly={true}
|
|
@@ -125,20 +168,22 @@ export function SelectLabel({
|
|
|
125
168
|
children,
|
|
126
169
|
...props
|
|
127
170
|
}: TypographyProps & { htmlFor?: string }) {
|
|
171
|
+
const { hasError } = useSelect()
|
|
172
|
+
|
|
128
173
|
return (
|
|
129
174
|
<Typography
|
|
130
175
|
asChild={true}
|
|
131
|
-
className={
|
|
176
|
+
className={twMerge(
|
|
132
177
|
'inline-block max-w-full truncate text-left font-normal',
|
|
133
178
|
'left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2',
|
|
134
179
|
'ease transition-all duration-250',
|
|
135
180
|
// Content Open
|
|
136
|
-
'group-data-[state=open]
|
|
181
|
+
'group-data-[state=open]:!text-primary-idle group-data-[state=open]:data-[has-error=true]:!text-danger-label-active',
|
|
137
182
|
'group-data-[state=open]:-top-[3px]',
|
|
138
183
|
'group-data-[state=open]:text-size-label-sm-1x',
|
|
139
184
|
'group-data-[state=open]:font-medium',
|
|
140
185
|
// Filled
|
|
141
|
-
'group-has-[input:not(:placeholder-shown)]
|
|
186
|
+
'group-has-[input:not(:placeholder-shown)]:!text-primary-idle group-has-[input:not(:placeholder-shown)]:data-[has-error=true]:!text-danger-label-active',
|
|
142
187
|
'group-has-[input:not(:placeholder-shown)]:-top-[3px]',
|
|
143
188
|
'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',
|
|
144
189
|
'group-has-[input:not(:placeholder-shown)]:font-medium',
|
|
@@ -154,9 +199,10 @@ export function SelectLabel({
|
|
|
154
199
|
'group-data-[state=open]:animate-in',
|
|
155
200
|
'group-data-[state=closed]:animate-out',
|
|
156
201
|
'group-has-[input:not(:placeholder-shown)]:animate-out',
|
|
202
|
+
'group-disabled:hidden',
|
|
157
203
|
className
|
|
158
204
|
)}
|
|
159
|
-
|
|
205
|
+
data-has-error={hasError}
|
|
160
206
|
{...props}
|
|
161
207
|
>
|
|
162
208
|
<label htmlFor={htmlFor}>
|
|
@@ -176,7 +222,9 @@ export function SelectOption({
|
|
|
176
222
|
className,
|
|
177
223
|
...props
|
|
178
224
|
}: ComponentProps<typeof ListItem>) {
|
|
179
|
-
return
|
|
225
|
+
return (
|
|
226
|
+
<ListItem className={twMerge(className, 'cursor-pointer')} {...props} />
|
|
227
|
+
)
|
|
180
228
|
}
|
|
181
229
|
|
|
182
230
|
export function SelectOptionText(props: ComponentProps<typeof Typography>) {
|
|
@@ -193,15 +241,11 @@ export function SelectHeaderTitle(
|
|
|
193
241
|
return <ListHeaderTitle {...props} />
|
|
194
242
|
}
|
|
195
243
|
|
|
196
|
-
export function SelectDropdown(props: ComponentProps<'div'>) {
|
|
197
|
-
return <div {...props} />
|
|
198
|
-
}
|
|
199
|
-
|
|
200
244
|
export function SelectLeftSlot({ className, ...props }: ComponentProps<'div'>) {
|
|
201
245
|
return (
|
|
202
246
|
<div
|
|
203
247
|
{...props}
|
|
204
|
-
className={
|
|
248
|
+
className={twMerge(
|
|
205
249
|
className,
|
|
206
250
|
'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
|
|
207
251
|
)}
|
|
@@ -217,9 +261,10 @@ export function SelectRightSlot({
|
|
|
217
261
|
return (
|
|
218
262
|
<div
|
|
219
263
|
{...props}
|
|
220
|
-
className={
|
|
264
|
+
className={twMerge(
|
|
221
265
|
className,
|
|
222
|
-
'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
|
|
266
|
+
'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center',
|
|
267
|
+
'group-disabled:hidden'
|
|
223
268
|
)}
|
|
224
269
|
data-slot="select-right-slot"
|
|
225
270
|
/>
|
|
@@ -238,3 +283,36 @@ export function SelectSearch(props: ComponentProps<typeof SearchInputText>) {
|
|
|
238
283
|
</SearchInputRoot>
|
|
239
284
|
)
|
|
240
285
|
}
|
|
286
|
+
|
|
287
|
+
export function SelectCaption({
|
|
288
|
+
className,
|
|
289
|
+
variant = 'body',
|
|
290
|
+
size = 'sm',
|
|
291
|
+
weight = 'normal',
|
|
292
|
+
...props
|
|
293
|
+
}: ComponentProps<typeof Typography>) {
|
|
294
|
+
const { hasError } = useSelect()
|
|
295
|
+
|
|
296
|
+
const caption = tv({
|
|
297
|
+
base: 'text-size-body-sm mt-small-1x font-normal',
|
|
298
|
+
variants: {
|
|
299
|
+
state: {
|
|
300
|
+
error: 'text-danger-label-active',
|
|
301
|
+
idle: 'text-neutral-dark'
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
})
|
|
305
|
+
|
|
306
|
+
return (
|
|
307
|
+
<Typography
|
|
308
|
+
className={caption({
|
|
309
|
+
state: hasError ? 'error' : 'idle',
|
|
310
|
+
className
|
|
311
|
+
})}
|
|
312
|
+
size={size}
|
|
313
|
+
variant={variant}
|
|
314
|
+
weight={weight}
|
|
315
|
+
{...props}
|
|
316
|
+
/>
|
|
317
|
+
)
|
|
318
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react'
|
|
2
|
+
import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
|
|
3
|
+
import { Typography } from './typography'
|
|
4
|
+
|
|
5
|
+
export const statusVariants = cva(
|
|
6
|
+
[
|
|
7
|
+
'inline-flex items-center justify-center px-small py-small-1x rounded-small-1x text-label-sm font-medium text-neutral-label h-large-2x'
|
|
8
|
+
],
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
success: 'bg-success-idle',
|
|
13
|
+
warning: 'bg-warning-idle',
|
|
14
|
+
danger: 'bg-danger-idle',
|
|
15
|
+
neutral: 'bg-alt-3'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: 'neutral'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export interface StatusProps
|
|
25
|
+
extends ComponentProps<'div'>,
|
|
26
|
+
ClassVariantProps<typeof statusVariants> {
|
|
27
|
+
text?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function Status({
|
|
31
|
+
text = 'Status',
|
|
32
|
+
variant = 'neutral',
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}: StatusProps) {
|
|
36
|
+
return (
|
|
37
|
+
<div className={cx(statusVariants({ variant }), className)} {...props}>
|
|
38
|
+
<Typography size="sm" variant="label" weight="medium">
|
|
39
|
+
{text}
|
|
40
|
+
</Typography>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
package/src/components/tabs.tsx
CHANGED
|
@@ -1,53 +1,72 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
1
2
|
import * as TabsPrimitive from '@radix-ui/react-tabs'
|
|
2
|
-
import {
|
|
3
|
+
import { tv } from '@xjur-ui/util'
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const tabsStyles = tv({
|
|
6
|
+
slots: {
|
|
7
|
+
list: 'flex items-center gap-0',
|
|
8
|
+
trigger:
|
|
9
|
+
'inline-flex items-center justify-center gap-small px-small py-small_1x-alt h-large-4x ' +
|
|
10
|
+
'font-medium cursor-pointer transition-colors !text-size-label-md ' +
|
|
11
|
+
'disabled:opacity-38 disabled:pointer-events-none',
|
|
12
|
+
content: ''
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
variant: {
|
|
16
|
+
line: {
|
|
17
|
+
trigger:
|
|
18
|
+
'rounded-small-1x text-neutral-dark border-b-[3px] border-b-transparent ' +
|
|
19
|
+
'hover:bg-layer-2-hover ' +
|
|
20
|
+
'data-[state=active]:text-primary-active ' +
|
|
21
|
+
'data-[state=active]:border-b-primary-active ' +
|
|
22
|
+
'data-[state=active]:rounded-none data-[state=active]:bg-transparent'
|
|
23
|
+
},
|
|
24
|
+
button: {
|
|
25
|
+
trigger:
|
|
26
|
+
'rounded-tl-small-1x rounded-tr-small-1x rounded-bl-none rounded-br-none px-large ' +
|
|
27
|
+
'bg-primary-idle text-neutral-label ' +
|
|
28
|
+
'hover:bg-primary-hover ' +
|
|
29
|
+
'data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-active'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: 'button'
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
export function TabsRoot(
|
|
39
|
+
props: React.ComponentProps<typeof TabsPrimitive.Tabs>
|
|
40
|
+
) {
|
|
7
41
|
return <TabsPrimitive.Tabs {...props} />
|
|
8
42
|
}
|
|
9
43
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
}:
|
|
13
|
-
|
|
44
|
+
export type TabsListProps = React.ComponentProps<typeof TabsPrimitive.TabsList>
|
|
45
|
+
|
|
46
|
+
export function TabsList({ className, ...props }: TabsListProps) {
|
|
47
|
+
const { list } = tabsStyles({})
|
|
48
|
+
return <TabsPrimitive.TabsList className={list({ className })} {...props} />
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TabsTriggerProps
|
|
52
|
+
extends React.ComponentProps<typeof TabsPrimitive.TabsTrigger> {
|
|
53
|
+
variant?: 'line' | 'button'
|
|
14
54
|
}
|
|
15
55
|
|
|
16
56
|
export function TabsTrigger({
|
|
17
57
|
variant,
|
|
18
58
|
className,
|
|
19
59
|
...props
|
|
20
|
-
}:
|
|
21
|
-
|
|
22
|
-
}) {
|
|
23
|
-
const variants = cva(
|
|
24
|
-
[
|
|
25
|
-
'rounded-small-1x h-large-4x cursor-pointer text-size-label-md text-neutral-dark'
|
|
26
|
-
],
|
|
27
|
-
{
|
|
28
|
-
variants: {
|
|
29
|
-
variant: {
|
|
30
|
-
line: 'py-small_1x-alt px-small data-[state=active]:border-b-[3px] data-[state=active]:border-b-primary-active data-[state=active]:rounded-none hover:bg-layer-2-hover',
|
|
31
|
-
button:
|
|
32
|
-
'rounded-br-none rounded-bl-none py-small_1x-alt px-large bg-primary-idle text-neutral-label hover:bg-primary-hover data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-label-active'
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: {
|
|
36
|
-
variant: 'button'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
|
|
60
|
+
}: TabsTriggerProps) {
|
|
61
|
+
const { trigger } = tabsStyles({ variant })
|
|
41
62
|
return (
|
|
42
|
-
<TabsPrimitive.TabsTrigger
|
|
43
|
-
className={cx(className, variants({ variant }))}
|
|
44
|
-
{...props}
|
|
45
|
-
/>
|
|
63
|
+
<TabsPrimitive.TabsTrigger className={trigger({ className })} {...props} />
|
|
46
64
|
)
|
|
47
65
|
}
|
|
48
66
|
|
|
49
|
-
export function TabsContent(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
export function TabsContent(
|
|
68
|
+
props: React.ComponentProps<typeof TabsPrimitive.TabsContent>
|
|
69
|
+
) {
|
|
70
|
+
const { content } = tabsStyles()
|
|
71
|
+
return <TabsPrimitive.TabsContent className={content()} {...props} />
|
|
53
72
|
}
|
package/src/components/tag.tsx
CHANGED
|
@@ -27,9 +27,17 @@ const tagVariants = cva(
|
|
|
27
27
|
export function TagRoot({
|
|
28
28
|
className,
|
|
29
29
|
variant = 'primary',
|
|
30
|
+
disabled = false,
|
|
30
31
|
...props
|
|
31
|
-
}: ComponentProps<'div'> &
|
|
32
|
-
|
|
32
|
+
}: ComponentProps<'div'> &
|
|
33
|
+
ClassVariantProps<typeof tagVariants> & { disabled?: boolean }) {
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
className={cx(tagVariants({ variant }), className)}
|
|
37
|
+
data-disabled={disabled}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
export function TagText({
|
|
@@ -77,7 +85,7 @@ export function TagClose({
|
|
|
77
85
|
className={cx(
|
|
78
86
|
className,
|
|
79
87
|
'cursor-pointer bg-inherit',
|
|
80
|
-
'invisible items-center justify-center group-hover/tag:visible',
|
|
88
|
+
'invisible items-center justify-center group-hover/tag:data-[disabled=false]:visible',
|
|
81
89
|
'absolute top-0 right-0',
|
|
82
90
|
'h-large-2x w-large-2x rounded-circle',
|
|
83
91
|
'transition-[visibility] duration-200'
|
package/src/index.css
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Horizontal } from './horizontal'
|
|
2
|
+
import { Vertical } from './vertical'
|
|
3
|
+
import { Icon } from './icon'
|
|
4
|
+
|
|
5
|
+
interface LogoWrapperProps {
|
|
6
|
+
mode: 'horizontal' | 'vertical' | 'icon'
|
|
7
|
+
variant: 'colorful' | 'orange' | 'purple' | 'white' | 'gray'
|
|
8
|
+
color?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function LogoWrapper({
|
|
12
|
+
mode,
|
|
13
|
+
variant,
|
|
14
|
+
color
|
|
15
|
+
}: LogoWrapperProps) {
|
|
16
|
+
switch (mode) {
|
|
17
|
+
case 'icon':
|
|
18
|
+
if (variant === 'colorful' || !color) {
|
|
19
|
+
return <Icon.Colorful />
|
|
20
|
+
}
|
|
21
|
+
return <Icon.Solid color={color} />
|
|
22
|
+
case 'vertical':
|
|
23
|
+
if (variant === 'colorful' || !color) {
|
|
24
|
+
return <Vertical.Colorful />
|
|
25
|
+
}
|
|
26
|
+
return <Vertical.Solid color={color} />
|
|
27
|
+
case 'horizontal':
|
|
28
|
+
if (variant === 'colorful' || !color) {
|
|
29
|
+
return <Horizontal.Colorful />
|
|
30
|
+
}
|
|
31
|
+
return <Horizontal.Solid color={color} />
|
|
32
|
+
}
|
|
33
|
+
}
|
package/tsup.config.ts
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { defineConfig } from 'tsup'
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
entry: [
|
|
5
|
+
'src/index.ts',
|
|
6
|
+
'src/components/**/*.ts',
|
|
7
|
+
'src/components/**/*.tsx',
|
|
8
|
+
'src/hooks/index.ts',
|
|
9
|
+
'src/index.css'
|
|
10
|
+
],
|
|
6
11
|
format: ['esm'],
|
|
7
12
|
outDir: 'dist',
|
|
8
|
-
external: [
|
|
13
|
+
external: [
|
|
14
|
+
'react',
|
|
15
|
+
'react-dom',
|
|
16
|
+
'react/jsx-runtime',
|
|
17
|
+
'@radix-ui/**',
|
|
18
|
+
'@tiptap/**',
|
|
19
|
+
'react-day-picker',
|
|
20
|
+
'@react-input/**'
|
|
21
|
+
],
|
|
9
22
|
dts: true,
|
|
10
|
-
splitting:
|
|
11
|
-
|
|
23
|
+
splitting: true,
|
|
24
|
+
treeshake: true,
|
|
25
|
+
minify: true,
|
|
26
|
+
sourcemap: true,
|
|
27
|
+
clean: true,
|
|
28
|
+
target: 'esnext',
|
|
29
|
+
platform: 'browser'
|
|
12
30
|
})
|
package/dist/index.js
DELETED
|
File without changes
|
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import './index.css'
|