@xjur-ui/react 2.0.0 → 2.1.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 +278 -119
- package/CHANGELOG.md +70 -0
- package/dist/chunk-2CM3SFOY.js +2 -0
- package/dist/chunk-2CM3SFOY.js.map +1 -0
- package/dist/chunk-2CTBH6VI.js +2 -0
- package/dist/chunk-2CTBH6VI.js.map +1 -0
- package/dist/chunk-4BGTC333.js +2 -0
- package/dist/chunk-4BGTC333.js.map +1 -0
- package/dist/chunk-5WLIDYZH.js +2 -0
- package/dist/chunk-5WLIDYZH.js.map +1 -0
- package/dist/chunk-6AD6O6II.js +2 -0
- package/dist/chunk-6AD6O6II.js.map +1 -0
- package/dist/chunk-AA6V5YEC.js +2 -0
- package/dist/chunk-AA6V5YEC.js.map +1 -0
- package/dist/chunk-BK6FP63A.js +2 -0
- package/dist/chunk-BK6FP63A.js.map +1 -0
- package/dist/chunk-BZDGWC5O.js +2 -0
- package/dist/chunk-BZDGWC5O.js.map +1 -0
- package/dist/chunk-CI3ZXWEX.js +2 -0
- package/dist/chunk-CI3ZXWEX.js.map +1 -0
- package/dist/chunk-DFXHNK5D.js +2 -0
- package/dist/chunk-DFXHNK5D.js.map +1 -0
- package/dist/chunk-EXC2XOL6.js +2 -0
- package/dist/chunk-EXC2XOL6.js.map +1 -0
- package/dist/chunk-F4DYKYWJ.js +2 -0
- package/dist/chunk-F4DYKYWJ.js.map +1 -0
- package/dist/chunk-F5ZLEQGN.js +2 -0
- package/dist/chunk-F5ZLEQGN.js.map +1 -0
- package/dist/chunk-IKL6PSXU.js +2 -0
- package/dist/chunk-IKL6PSXU.js.map +1 -0
- package/dist/chunk-IRHU7PDO.js +2 -0
- package/dist/chunk-IRHU7PDO.js.map +1 -0
- package/dist/chunk-J4X5RQTR.js +2 -0
- package/dist/chunk-J4X5RQTR.js.map +1 -0
- package/dist/chunk-L4ET6GIZ.js +2 -0
- package/dist/chunk-L4ET6GIZ.js.map +1 -0
- package/dist/chunk-MZSV4LNY.js +2 -0
- package/dist/chunk-MZSV4LNY.js.map +1 -0
- package/dist/chunk-OS53BV63.js +3 -0
- package/dist/chunk-OS53BV63.js.map +1 -0
- package/dist/{chunk-FASEHVMD.js → chunk-PKCW37CJ.js} +2 -2
- package/dist/chunk-PKCW37CJ.js.map +1 -0
- package/dist/chunk-SLAAEXWI.js +2 -0
- package/dist/chunk-SLAAEXWI.js.map +1 -0
- package/dist/chunk-SXGSWVMZ.js +2 -0
- package/dist/chunk-SXGSWVMZ.js.map +1 -0
- package/dist/chunk-TSVURBUY.js +2 -0
- package/dist/chunk-TSVURBUY.js.map +1 -0
- package/dist/chunk-UXIVZWLB.js +2 -0
- package/dist/chunk-UXIVZWLB.js.map +1 -0
- package/dist/chunk-WEBAXQID.js +2 -0
- package/dist/chunk-WEBAXQID.js.map +1 -0
- package/dist/chunk-WV7QV2PU.js +2 -0
- package/dist/chunk-WV7QV2PU.js.map +1 -0
- package/dist/{components/switch.js → chunk-Z47R2CIM.js} +2 -2
- package/dist/chunk-Z47R2CIM.js.map +1 -0
- package/dist/chunk-ZVVPUP7V.js +2 -0
- package/dist/chunk-ZVVPUP7V.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.js +2 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/chip.d.ts +2 -1
- package/dist/components/chip.js +1 -1
- package/dist/components/dialog.d.ts +51 -0
- package/dist/components/dialog.js +2 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drag-and-drop/drag-handle.d.ts +15 -0
- package/dist/components/drag-and-drop/drag-handle.js +2 -0
- package/dist/components/drag-and-drop/drag-handle.js.map +1 -0
- package/dist/components/drag-and-drop/drag-list-item.d.ts +14 -0
- package/dist/components/drag-and-drop/drag-list-item.js +2 -0
- package/dist/components/drag-and-drop/drag-list-item.js.map +1 -0
- package/dist/components/drag-and-drop/drag-list.d.ts +14 -0
- package/dist/components/drag-and-drop/drag-list.js +2 -0
- package/dist/components/drag-and-drop/drag-list.js.map +1 -0
- package/dist/components/drag-and-drop/drag-root.d.ts +6 -0
- package/dist/components/drag-and-drop/drag-root.js +2 -0
- package/dist/components/drag-and-drop/drag-root.js.map +1 -0
- package/dist/components/drag-and-drop/index.d.ts +10 -0
- package/dist/components/drag-and-drop/index.js +2 -0
- package/dist/components/drag-and-drop/index.js.map +1 -0
- package/dist/components/drag-and-drop/types/drag-item.d.ts +9 -0
- package/dist/components/drag-and-drop/types/drag-item.js +2 -0
- package/dist/components/drag-and-drop/types/drag-item.js.map +1 -0
- package/dist/components/form/button.js +2 -0
- package/dist/components/form/calendar.js +2 -0
- package/dist/components/form/calendar.js.map +1 -0
- package/dist/components/form/checkbox.js +2 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/context/field.context.d.ts +15 -0
- package/dist/components/form/context/field.context.js +2 -0
- package/dist/components/form/context/field.context.js.map +1 -0
- package/dist/components/form/date-picker.d.ts +84 -0
- package/dist/components/form/date-picker.js +2 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/floating-label.d.ts +6 -0
- package/dist/components/form/floating-label.js +2 -0
- package/dist/components/form/floating-label.js.map +1 -0
- package/dist/components/form/input.d.ts +95 -0
- package/dist/components/form/input.js +2 -0
- package/dist/components/form/input.js.map +1 -0
- package/dist/components/form/otp-input.js.map +1 -0
- package/dist/components/form/radio.js +2 -0
- package/dist/components/form/radio.js.map +1 -0
- package/dist/components/form/rich-editor.js +2 -0
- package/dist/components/form/rich-editor.js.map +1 -0
- package/dist/components/form/search-input.js +2 -0
- package/dist/components/form/search-input.js.map +1 -0
- package/dist/components/form/select.d.ts +94 -0
- package/dist/components/form/select.js +2 -0
- package/dist/components/form/select.js.map +1 -0
- package/dist/components/form/switch.js +2 -0
- package/dist/components/form/switch.js.map +1 -0
- package/dist/components/full-calendar/calendar-add-event.d.ts +9 -0
- package/dist/components/full-calendar/calendar-add-event.js +2 -0
- package/dist/components/full-calendar/calendar-add-event.js.map +1 -0
- package/dist/components/full-calendar/calendar-body.d.ts +6 -0
- package/dist/components/full-calendar/calendar-body.js +2 -0
- package/dist/components/full-calendar/calendar-body.js.map +1 -0
- package/dist/components/full-calendar/calendar-cell.d.ts +11 -0
- package/dist/components/full-calendar/calendar-cell.js +2 -0
- package/dist/components/full-calendar/calendar-cell.js.map +1 -0
- package/dist/components/full-calendar/calendar-day-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-day-view.js +2 -0
- package/dist/components/full-calendar/calendar-day-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-event.d.ts +18 -0
- package/dist/components/full-calendar/calendar-event.js +2 -0
- package/dist/components/full-calendar/calendar-event.js.map +1 -0
- package/dist/components/full-calendar/calendar-header.d.ts +6 -0
- package/dist/components/full-calendar/calendar-header.js +2 -0
- package/dist/components/full-calendar/calendar-header.js.map +1 -0
- package/dist/components/full-calendar/calendar-month-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-month-view.js +2 -0
- package/dist/components/full-calendar/calendar-month-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.d.ts +9 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.js +2 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.js.map +1 -0
- package/dist/components/full-calendar/calendar-navigator.d.ts +5 -0
- package/dist/components/full-calendar/calendar-navigator.js +2 -0
- package/dist/components/full-calendar/calendar-navigator.js.map +1 -0
- package/dist/components/full-calendar/calendar-root.d.ts +30 -0
- package/dist/components/full-calendar/calendar-root.js +2 -0
- package/dist/components/full-calendar/calendar-root.js.map +1 -0
- package/dist/components/full-calendar/calendar-today-button.d.ts +9 -0
- package/dist/components/full-calendar/calendar-today-button.js +2 -0
- package/dist/components/full-calendar/calendar-today-button.js.map +1 -0
- package/dist/components/full-calendar/calendar-toggle-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-toggle-view.js +2 -0
- package/dist/components/full-calendar/calendar-toggle-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-view-renderer.d.ts +5 -0
- package/dist/components/full-calendar/calendar-view-renderer.js +2 -0
- package/dist/components/full-calendar/calendar-view-renderer.js.map +1 -0
- package/dist/components/full-calendar/calendar-week-day.d.ts +10 -0
- package/dist/components/full-calendar/calendar-week-day.js +2 -0
- package/dist/components/full-calendar/calendar-week-day.js.map +1 -0
- package/dist/components/full-calendar/calendar-week-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-week-view.js +2 -0
- package/dist/components/full-calendar/calendar-week-view.js.map +1 -0
- package/dist/components/full-calendar/helpers/calendar.d.ts +25 -0
- package/dist/components/full-calendar/helpers/calendar.js +2 -0
- package/dist/components/full-calendar/helpers/calendar.js.map +1 -0
- package/dist/components/full-calendar/index.d.ts +18 -0
- package/dist/components/full-calendar/index.js +2 -0
- package/dist/components/full-calendar/index.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-cell.d.ts +6 -0
- package/dist/components/full-calendar/types/calendar-cell.js +2 -0
- package/dist/components/full-calendar/types/calendar-cell.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-event.d.ts +8 -0
- package/dist/components/full-calendar/types/calendar-event.js +2 -0
- package/dist/components/full-calendar/types/calendar-event.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-view.d.ts +3 -0
- package/dist/components/full-calendar/types/calendar-view.js +2 -0
- package/dist/components/full-calendar/types/calendar-view.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-week-hour.d.ts +6 -0
- package/dist/components/full-calendar/types/calendar-week-hour.js +2 -0
- package/dist/components/full-calendar/types/calendar-week-hour.js.map +1 -0
- package/dist/components/horizontal-scroll.d.ts +11 -0
- package/dist/components/horizontal-scroll.js +2 -0
- package/dist/components/horizontal-scroll.js.map +1 -0
- package/dist/components/icon.d.ts +3 -4
- package/dist/components/icon.js +1 -1
- package/dist/components/selection-bar.d.ts +57 -0
- package/dist/components/selection-bar.js +2 -0
- package/dist/components/selection-bar.js.map +1 -0
- package/dist/components/sheet.d.ts +8 -8
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tag.d.ts +2 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/upload.d.ts +74 -0
- package/dist/components/upload.js +2 -0
- package/dist/components/upload.js.map +1 -0
- package/dist/icons-CmDuL0gZ.d.ts +4 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +22 -13
- package/src/components/breadcrumb.tsx +119 -0
- package/src/components/dialog.tsx +242 -0
- package/src/components/drag-and-drop/drag-handle.tsx +46 -0
- package/src/components/drag-and-drop/drag-list-item.tsx +91 -0
- package/src/components/drag-and-drop/drag-list.tsx +47 -0
- package/src/components/drag-and-drop/drag-root.tsx +30 -0
- package/src/components/drag-and-drop/index.ts +39 -0
- package/src/components/drag-and-drop/types/drag-item.ts +7 -0
- package/src/components/{calendar.tsx → form/calendar.tsx} +2 -2
- package/src/components/{checkbox.tsx → form/checkbox.tsx} +2 -2
- package/src/components/form/context/field.context.ts +27 -0
- package/src/components/form/date-picker.tsx +199 -0
- package/src/components/form/floating-label.tsx +60 -0
- package/src/components/form/input.tsx +235 -0
- package/src/components/{radio.tsx → form/radio.tsx} +1 -1
- package/src/components/{rich-editor.tsx → form/rich-editor.tsx} +6 -6
- package/src/components/{search-input.tsx → form/search-input.tsx} +2 -2
- package/src/components/form/select.tsx +274 -0
- package/src/components/full-calendar/calendar-add-event.tsx +15 -0
- package/src/components/full-calendar/calendar-body.tsx +12 -0
- package/src/components/full-calendar/calendar-cell.tsx +120 -0
- package/src/components/full-calendar/calendar-day-view.tsx +76 -0
- package/src/components/full-calendar/calendar-event.tsx +178 -0
- package/src/components/full-calendar/calendar-header.tsx +14 -0
- package/src/components/full-calendar/calendar-month-view.tsx +69 -0
- package/src/components/full-calendar/calendar-more-events-dropdown.tsx +39 -0
- package/src/components/full-calendar/calendar-navigator.tsx +86 -0
- package/src/components/full-calendar/calendar-root.tsx +165 -0
- package/src/components/full-calendar/calendar-today-button.tsx +21 -0
- package/src/components/full-calendar/calendar-toggle-view.tsx +61 -0
- package/src/components/full-calendar/calendar-view-renderer.tsx +19 -0
- package/src/components/full-calendar/calendar-week-day.tsx +49 -0
- package/src/components/full-calendar/calendar-week-view.tsx +88 -0
- package/src/components/full-calendar/helpers/calendar.ts +158 -0
- package/src/components/full-calendar/index.ts +16 -0
- package/src/components/full-calendar/types/calendar-cell.ts +4 -0
- package/src/components/full-calendar/types/calendar-event.ts +7 -0
- package/src/components/full-calendar/types/calendar-view.ts +1 -0
- package/src/components/full-calendar/types/calendar-week-hour.ts +4 -0
- package/src/components/horizontal-scroll.tsx +159 -0
- package/src/components/selection-bar.tsx +273 -0
- package/src/components/sheet.tsx +2 -2
- package/src/components/upload.tsx +647 -0
- package/src/resources/icons.ts +4 -1
- package/dist/chunk-FASEHVMD.js.map +0 -1
- package/dist/chunk-NPTLORW5.js +0 -2
- package/dist/chunk-NPTLORW5.js.map +0 -1
- package/dist/chunk-SHHXKVVR.js +0 -2
- package/dist/chunk-SHHXKVVR.js.map +0 -1
- package/dist/components/button.js +0 -2
- package/dist/components/calendar.js +0 -2
- package/dist/components/calendar.js.map +0 -1
- package/dist/components/checkbox.js +0 -2
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/date-picker.d.ts +0 -25
- package/dist/components/date-picker.js +0 -2
- package/dist/components/date-picker.js.map +0 -1
- package/dist/components/input.d.ts +0 -37
- package/dist/components/input.js +0 -2
- package/dist/components/input.js.map +0 -1
- package/dist/components/otp-input.js.map +0 -1
- package/dist/components/radio.js +0 -2
- package/dist/components/radio.js.map +0 -1
- package/dist/components/rich-editor.js +0 -2
- package/dist/components/rich-editor.js.map +0 -1
- package/dist/components/search-input.js +0 -2
- package/dist/components/search-input.js.map +0 -1
- package/dist/components/select.d.ts +0 -36
- package/dist/components/select.js +0 -2
- package/dist/components/select.js.map +0 -1
- package/dist/components/switch.js.map +0 -1
- package/src/components/date-picker.tsx +0 -263
- package/src/components/input.tsx +0 -320
- package/src/components/select.tsx +0 -318
- /package/dist/components/{button.d.ts → form/button.d.ts} +0 -0
- /package/dist/components/{button.js.map → form/button.js.map} +0 -0
- /package/dist/components/{calendar.d.ts → form/calendar.d.ts} +0 -0
- /package/dist/components/{checkbox.d.ts → form/checkbox.d.ts} +0 -0
- /package/dist/components/{otp-input.d.ts → form/otp-input.d.ts} +0 -0
- /package/dist/components/{otp-input.js → form/otp-input.js} +0 -0
- /package/dist/components/{radio.d.ts → form/radio.d.ts} +0 -0
- /package/dist/components/{rich-editor.d.ts → form/rich-editor.d.ts} +0 -0
- /package/dist/components/{search-input.d.ts → form/search-input.d.ts} +0 -0
- /package/dist/components/{switch.d.ts → form/switch.d.ts} +0 -0
- /package/src/components/{button.tsx → form/button.tsx} +0 -0
- /package/src/components/{otp-input.tsx → form/otp-input.tsx} +0 -0
- /package/src/components/{switch.tsx → form/switch.tsx} +0 -0
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext, type ComponentProps } from 'react'
|
|
2
|
-
import * as RadixPopover from '@radix-ui/react-popover'
|
|
3
|
-
import { tv, twMerge } from '@xjur-ui/util'
|
|
4
|
-
import {
|
|
5
|
-
ListContent,
|
|
6
|
-
ListItem,
|
|
7
|
-
ListRoot,
|
|
8
|
-
ListHeader,
|
|
9
|
-
ListHeaderTitle
|
|
10
|
-
} from './list'
|
|
11
|
-
import {
|
|
12
|
-
SearchInputContent,
|
|
13
|
-
SearchInputText,
|
|
14
|
-
SearchInputRoot,
|
|
15
|
-
SearchInputSlot
|
|
16
|
-
} from './search-input'
|
|
17
|
-
import { Icon } from './icon'
|
|
18
|
-
import { Typography, type TypographyProps } from './typography'
|
|
19
|
-
|
|
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
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export function SelectTrigger({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}: ComponentProps<typeof RadixPopover.Trigger>) {
|
|
54
|
-
const { disabled, hasError } = useSelect()
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<RadixPopover.Trigger
|
|
58
|
-
className={twMerge(
|
|
59
|
-
className,
|
|
60
|
-
'group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center',
|
|
61
|
-
'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border',
|
|
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'
|
|
67
|
-
)}
|
|
68
|
-
{...props}
|
|
69
|
-
data-has-error={hasError}
|
|
70
|
-
disabled={disabled}
|
|
71
|
-
/>
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function SelectContent({
|
|
76
|
-
className,
|
|
77
|
-
children,
|
|
78
|
-
sideOffset = 4,
|
|
79
|
-
side = 'bottom',
|
|
80
|
-
align = 'start',
|
|
81
|
-
...props
|
|
82
|
-
}: ComponentProps<typeof RadixPopover.Content>) {
|
|
83
|
-
return (
|
|
84
|
-
<RadixPopover.Portal>
|
|
85
|
-
<RadixPopover.Content
|
|
86
|
-
align={align}
|
|
87
|
-
className={twMerge(
|
|
88
|
-
className,
|
|
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)]'
|
|
90
|
-
)}
|
|
91
|
-
side={side}
|
|
92
|
-
sideOffset={sideOffset}
|
|
93
|
-
{...props}
|
|
94
|
-
>
|
|
95
|
-
<ListRoot>{children}</ListRoot>
|
|
96
|
-
</RadixPopover.Content>
|
|
97
|
-
</RadixPopover.Portal>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export function SelectValue({
|
|
102
|
-
className,
|
|
103
|
-
displayValue = '',
|
|
104
|
-
...props
|
|
105
|
-
}: ComponentProps<'input'> & { displayValue?: string }) {
|
|
106
|
-
return (
|
|
107
|
-
<>
|
|
108
|
-
{!!displayValue && (
|
|
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
|
-
>
|
|
117
|
-
{displayValue}
|
|
118
|
-
</Typography>
|
|
119
|
-
)}
|
|
120
|
-
|
|
121
|
-
<input
|
|
122
|
-
{...props}
|
|
123
|
-
aria-readonly={true}
|
|
124
|
-
className={twMerge(className, 'pointer-events-none')}
|
|
125
|
-
hidden={true}
|
|
126
|
-
placeholder={props.placeholder ?? ' '}
|
|
127
|
-
readOnly={true}
|
|
128
|
-
/>
|
|
129
|
-
</>
|
|
130
|
-
)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export function SelectMultiValue({
|
|
134
|
-
className,
|
|
135
|
-
values,
|
|
136
|
-
children,
|
|
137
|
-
...props
|
|
138
|
-
}: ComponentProps<'div'> & { values: string[] }) {
|
|
139
|
-
return (
|
|
140
|
-
<div
|
|
141
|
-
className={twMerge(
|
|
142
|
-
className,
|
|
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'
|
|
148
|
-
)}
|
|
149
|
-
{...props}
|
|
150
|
-
>
|
|
151
|
-
{children}
|
|
152
|
-
|
|
153
|
-
<input
|
|
154
|
-
aria-readonly={true}
|
|
155
|
-
className={twMerge(className, 'pointer-events-none')}
|
|
156
|
-
hidden={true}
|
|
157
|
-
placeholder={' '}
|
|
158
|
-
readOnly={true}
|
|
159
|
-
value={values.join(',')}
|
|
160
|
-
/>
|
|
161
|
-
</div>
|
|
162
|
-
)
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export function SelectLabel({
|
|
166
|
-
className,
|
|
167
|
-
htmlFor,
|
|
168
|
-
children,
|
|
169
|
-
...props
|
|
170
|
-
}: TypographyProps & { htmlFor?: string }) {
|
|
171
|
-
const { hasError } = useSelect()
|
|
172
|
-
|
|
173
|
-
return (
|
|
174
|
-
<Typography
|
|
175
|
-
asChild={true}
|
|
176
|
-
className={twMerge(
|
|
177
|
-
'inline-block max-w-full truncate text-left font-normal',
|
|
178
|
-
'left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2',
|
|
179
|
-
'ease transition-all duration-250',
|
|
180
|
-
// Content Open
|
|
181
|
-
'group-data-[state=open]:!text-primary-idle group-data-[state=open]:data-[has-error=true]:!text-danger-label-active',
|
|
182
|
-
'group-data-[state=open]:-top-[3px]',
|
|
183
|
-
'group-data-[state=open]:text-size-label-sm-1x',
|
|
184
|
-
'group-data-[state=open]:font-medium',
|
|
185
|
-
// Filled
|
|
186
|
-
'group-has-[input:not(:placeholder-shown)]:!text-primary-idle group-has-[input:not(:placeholder-shown)]:data-[has-error=true]:!text-danger-label-active',
|
|
187
|
-
'group-has-[input:not(:placeholder-shown)]:-top-[3px]',
|
|
188
|
-
'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',
|
|
189
|
-
'group-has-[input:not(:placeholder-shown)]:font-medium',
|
|
190
|
-
// If has left slot
|
|
191
|
-
'group-has-[div[data-slot=select-left-slot]]:left-large-4x',
|
|
192
|
-
'group-has-[div[data-slot=select-left-slot]]:group-data-[state=open]:left-small',
|
|
193
|
-
'group-has-[div[data-slot=select-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',
|
|
194
|
-
// If has right slot
|
|
195
|
-
'group-has-[div[data-slot=select-right-slot]]:right-large-4x',
|
|
196
|
-
'group-has-[div[data-slot=select-right-slot]]:group-data-[state=open]:right-small',
|
|
197
|
-
'group-has-[div[data-slot=select-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',
|
|
198
|
-
// Animate
|
|
199
|
-
'group-data-[state=open]:animate-in',
|
|
200
|
-
'group-data-[state=closed]:animate-out',
|
|
201
|
-
'group-has-[input:not(:placeholder-shown)]:animate-out',
|
|
202
|
-
'group-disabled:hidden',
|
|
203
|
-
className
|
|
204
|
-
)}
|
|
205
|
-
data-has-error={hasError}
|
|
206
|
-
{...props}
|
|
207
|
-
>
|
|
208
|
-
<label htmlFor={htmlFor}>
|
|
209
|
-
<span className="bg-layer-2-idle rounded-small-1x max-w-full">
|
|
210
|
-
{children}
|
|
211
|
-
</span>
|
|
212
|
-
</label>
|
|
213
|
-
</Typography>
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export function SelectOptions(props: ComponentProps<typeof ListContent>) {
|
|
218
|
-
return <ListContent {...props} />
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
export function SelectOption({
|
|
222
|
-
className,
|
|
223
|
-
...props
|
|
224
|
-
}: ComponentProps<typeof ListItem>) {
|
|
225
|
-
return (
|
|
226
|
-
<ListItem className={twMerge(className, 'cursor-pointer')} {...props} />
|
|
227
|
-
)
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export function SelectOptionText(props: ComponentProps<typeof Typography>) {
|
|
231
|
-
return <Typography {...props} />
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
export function SelectHeader(props: ComponentProps<typeof ListHeader>) {
|
|
235
|
-
return <ListHeader {...props} />
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export function SelectHeaderTitle(
|
|
239
|
-
props: ComponentProps<typeof ListHeaderTitle>
|
|
240
|
-
) {
|
|
241
|
-
return <ListHeaderTitle {...props} />
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export function SelectLeftSlot({ className, ...props }: ComponentProps<'div'>) {
|
|
245
|
-
return (
|
|
246
|
-
<div
|
|
247
|
-
{...props}
|
|
248
|
-
className={twMerge(
|
|
249
|
-
className,
|
|
250
|
-
'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'
|
|
251
|
-
)}
|
|
252
|
-
data-slot="select-left-slot"
|
|
253
|
-
/>
|
|
254
|
-
)
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export function SelectRightSlot({
|
|
258
|
-
className,
|
|
259
|
-
...props
|
|
260
|
-
}: ComponentProps<'div'>) {
|
|
261
|
-
return (
|
|
262
|
-
<div
|
|
263
|
-
{...props}
|
|
264
|
-
className={twMerge(
|
|
265
|
-
className,
|
|
266
|
-
'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center',
|
|
267
|
-
'group-disabled:hidden'
|
|
268
|
-
)}
|
|
269
|
-
data-slot="select-right-slot"
|
|
270
|
-
/>
|
|
271
|
-
)
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export function SelectSearch(props: ComponentProps<typeof SearchInputText>) {
|
|
275
|
-
return (
|
|
276
|
-
<SearchInputRoot variant="line">
|
|
277
|
-
<SearchInputContent>
|
|
278
|
-
<SearchInputSlot>
|
|
279
|
-
<Icon className="text-icon-neutral-3" name="search" />
|
|
280
|
-
</SearchInputSlot>
|
|
281
|
-
<SearchInputText {...props} />
|
|
282
|
-
</SearchInputContent>
|
|
283
|
-
</SearchInputRoot>
|
|
284
|
-
)
|
|
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
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|