@cerberus-design/react 1.0.0-rc.5 → 1.0.0-rc.6
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/dist/panda.buildinfo.json +23 -0
- package/package.json +6 -4
- package/src/components/AnimatingUploadIcon.tsx +0 -83
- package/src/components/accordion/index.ts +0 -3
- package/src/components/accordion/item-group.tsx +0 -70
- package/src/components/accordion/item-indicator.tsx +0 -27
- package/src/components/accordion/parts.ts +0 -53
- package/src/components/accordion/primitives.tsx +0 -86
- package/src/components/admonition/admonition.tsx +0 -62
- package/src/components/admonition/index.ts +0 -3
- package/src/components/admonition/match-avatar.tsx +0 -52
- package/src/components/admonition/parts.ts +0 -53
- package/src/components/admonition/primitives.tsx +0 -77
- package/src/components/avatar/avatar.tsx +0 -51
- package/src/components/avatar/index.ts +0 -5
- package/src/components/avatar/parts.ts +0 -37
- package/src/components/avatar/primitives.tsx +0 -38
- package/src/components/button/button.tsx +0 -62
- package/src/components/button/index.ts +0 -3
- package/src/components/button/parts.ts +0 -32
- package/src/components/button/primitives.tsx +0 -41
- package/src/components/carousel/carousel.tsx +0 -55
- package/src/components/carousel/index.ts +0 -3
- package/src/components/carousel/parts.ts +0 -71
- package/src/components/carousel/primitives.ts +0 -58
- package/src/components/checkbox/checkbox-icon.tsx +0 -39
- package/src/components/checkbox/checkbox.tsx +0 -42
- package/src/components/checkbox/index.ts +0 -3
- package/src/components/checkbox/parts.ts +0 -59
- package/src/components/checkbox/primitives.tsx +0 -77
- package/src/components/circular-progress/circular-progress.tsx +0 -49
- package/src/components/circular-progress/index.ts +0 -2
- package/src/components/circular-progress/primitives.ts +0 -80
- package/src/components/clipboard/copy-indicator.tsx +0 -22
- package/src/components/clipboard/copy-text.tsx +0 -13
- package/src/components/clipboard/index.ts +0 -2
- package/src/components/clipboard/parts.ts +0 -74
- package/src/components/clipboard/primitives.ts +0 -56
- package/src/components/clipboard/trigger.tsx +0 -14
- package/src/components/collapsible/index.ts +0 -2
- package/src/components/collapsible/parts.ts +0 -53
- package/src/components/collapsible/primitives.tsx +0 -53
- package/src/components/combobox/combobox.tsx +0 -67
- package/src/components/combobox/index.ts +0 -6
- package/src/components/combobox/item-group.tsx +0 -19
- package/src/components/combobox/item.tsx +0 -30
- package/src/components/combobox/parts.ts +0 -101
- package/src/components/combobox/primitives.tsx +0 -146
- package/src/components/combobox/use-stateful-collection.ts +0 -65
- package/src/components/cta-dialog/context.tsx +0 -38
- package/src/components/cta-dialog/index.ts +0 -2
- package/src/components/cta-dialog/provider.tsx +0 -186
- package/src/components/cta-dialog/trigger-item.tsx +0 -54
- package/src/components/cta-dialog/utils.ts +0 -57
- package/src/components/date-picker/calendar.tsx +0 -47
- package/src/components/date-picker/content.tsx +0 -21
- package/src/components/date-picker/date-picker.tsx +0 -20
- package/src/components/date-picker/day-view.tsx +0 -82
- package/src/components/date-picker/index.ts +0 -16
- package/src/components/date-picker/input.tsx +0 -26
- package/src/components/date-picker/month-view.tsx +0 -49
- package/src/components/date-picker/parts.ts +0 -167
- package/src/components/date-picker/primitives.tsx +0 -235
- package/src/components/date-picker/range-input.tsx +0 -38
- package/src/components/date-picker/trigger.tsx +0 -28
- package/src/components/date-picker/view-control-group.tsx +0 -54
- package/src/components/date-picker/year-view.tsx +0 -47
- package/src/components/dialog/close-icon-trigger.tsx +0 -36
- package/src/components/dialog/dialog.tsx +0 -42
- package/src/components/dialog/index.ts +0 -8
- package/src/components/dialog/parts.ts +0 -71
- package/src/components/dialog/primitives.tsx +0 -83
- package/src/components/feature-flag/feature-flag.tsx +0 -21
- package/src/components/feature-flag/index.ts +0 -1
- package/src/components/field/error-text.tsx +0 -19
- package/src/components/field/field.tsx +0 -93
- package/src/components/field/helper-text.tsx +0 -20
- package/src/components/field/index.ts +0 -7
- package/src/components/field/input.tsx +0 -47
- package/src/components/field/parts.ts +0 -77
- package/src/components/field/primitives.tsx +0 -135
- package/src/components/field/start-indicator.tsx +0 -23
- package/src/components/field/status-indicator.tsx +0 -58
- package/src/components/fieldset/fieldset.tsx +0 -54
- package/src/components/fieldset/index.ts +0 -3
- package/src/components/fieldset/parts.ts +0 -47
- package/src/components/fieldset/primitives.tsx +0 -48
- package/src/components/file-upload/file-status.tsx +0 -271
- package/src/components/file-upload/file-uploader.tsx +0 -60
- package/src/components/file-upload/helpers.ts +0 -28
- package/src/components/file-upload/img-preview.tsx +0 -41
- package/src/components/file-upload/index.ts +0 -6
- package/src/components/file-upload/parts.tsx +0 -132
- package/src/components/file-upload/primitives.ts +0 -161
- package/src/components/file-upload/utils.ts +0 -20
- package/src/components/for/for.tsx +0 -38
- package/src/components/for/index.ts +0 -1
- package/src/components/group/index.ts +0 -1
- package/src/components/group/primitives.ts +0 -7
- package/src/components/icon-button/button.tsx +0 -41
- package/src/components/icon-button/index.tsx +0 -2
- package/src/components/icon-button/primitives.ts +0 -19
- package/src/components/menu/index.ts +0 -2
- package/src/components/menu/menu.tsx +0 -144
- package/src/components/menu/primitives.ts +0 -84
- package/src/components/notifications/center.tsx +0 -88
- package/src/components/notifications/close-trigger.tsx +0 -21
- package/src/components/notifications/index.ts +0 -5
- package/src/components/notifications/match-icon.tsx +0 -41
- package/src/components/notifications/parts.ts +0 -53
- package/src/components/notifications/primitives.tsx +0 -66
- package/src/components/notifications/toaster.ts +0 -13
- package/src/components/notifications/types.ts +0 -44
- package/src/components/number-input/decrement-trigger.tsx +0 -16
- package/src/components/number-input/increment-trigger.tsx +0 -16
- package/src/components/number-input/index.ts +0 -3
- package/src/components/number-input/input.tsx +0 -33
- package/src/components/number-input/parts.ts +0 -65
- package/src/components/number-input/primitives.tsx +0 -74
- package/src/components/pagination/compact.tsx +0 -25
- package/src/components/pagination/index.ts +0 -6
- package/src/components/pagination/item-list.tsx +0 -34
- package/src/components/pagination/item.tsx +0 -6
- package/src/components/pagination/pagination.tsx +0 -53
- package/src/components/pagination/parts.ts +0 -65
- package/src/components/pagination/primitives.ts +0 -41
- package/src/components/pagination/triggers.tsx +0 -55
- package/src/components/pin-input/index.ts +0 -3
- package/src/components/pin-input/input.tsx +0 -22
- package/src/components/pin-input/parts.ts +0 -53
- package/src/components/pin-input/primitives.tsx +0 -46
- package/src/components/portal/index.ts +0 -1
- package/src/components/portal/portal.tsx +0 -28
- package/src/components/progress/index.ts +0 -2
- package/src/components/progress/primitives.ts +0 -37
- package/src/components/progress/progress-bar.tsx +0 -80
- package/src/components/radio/index.ts +0 -3
- package/src/components/radio/parts.ts +0 -65
- package/src/components/radio/primitives.tsx +0 -92
- package/src/components/radio/radio.tsx +0 -35
- package/src/components/rating/index.ts +0 -8
- package/src/components/rating/parts.tsx +0 -65
- package/src/components/rating/primitives.tsx +0 -64
- package/src/components/rating/rating.tsx +0 -75
- package/src/components/select/index.ts +0 -5
- package/src/components/select/option-group.tsx +0 -32
- package/src/components/select/option.tsx +0 -42
- package/src/components/select/parts.ts +0 -113
- package/src/components/select/primitives.tsx +0 -147
- package/src/components/select/select.tsx +0 -110
- package/src/components/show/index.ts +0 -1
- package/src/components/show/show.tsx +0 -48
- package/src/components/spinner/index.ts +0 -1
- package/src/components/spinner/spinner.tsx +0 -81
- package/src/components/split-button/button.tsx +0 -63
- package/src/components/split-button/index.tsx +0 -1
- package/src/components/switch/index.ts +0 -3
- package/src/components/switch/parts.ts +0 -53
- package/src/components/switch/primitives.tsx +0 -51
- package/src/components/switch/switch-indicator.tsx +0 -9
- package/src/components/switch/switch.tsx +0 -27
- package/src/components/table/index.ts +0 -3
- package/src/components/table/parts.ts +0 -83
- package/src/components/table/primitives.tsx +0 -115
- package/src/components/table/table.tsx +0 -73
- package/src/components/tabs/index.ts +0 -3
- package/src/components/tabs/parts.ts +0 -53
- package/src/components/tabs/primitives.tsx +0 -47
- package/src/components/tabs/tabs.tsx +0 -48
- package/src/components/tag/closable.tsx +0 -47
- package/src/components/tag/index.ts +0 -2
- package/src/components/tag/primitives.ts +0 -19
- package/src/components/tag/tag.tsx +0 -39
- package/src/components/text/index.ts +0 -1
- package/src/components/text/text.tsx +0 -55
- package/src/components/theme/index.ts +0 -1
- package/src/components/theme/theme.tsx +0 -34
- package/src/components/toggle/index.ts +0 -2
- package/src/components/toggle/parts.ts +0 -32
- package/src/components/toggle/primitives.tsx +0 -27
- package/src/components/tooltip/index.ts +0 -3
- package/src/components/tooltip/parts.ts +0 -59
- package/src/components/tooltip/primitives.ts +0 -56
- package/src/components/tooltip/tooltip.tsx +0 -46
- package/src/config/defineIcons.ts +0 -24
- package/src/config/icons/checkbox.icons.tsx +0 -98
- package/src/config/icons/default.ts +0 -69
- package/src/config/icons/pinned.icons.tsx +0 -31
- package/src/config/icons/sort.icons.tsx +0 -19
- package/src/config/index.ts +0 -41
- package/src/config/types.ts +0 -53
- package/src/context/cerberus.tsx +0 -53
- package/src/context/confirm-modal.tsx +0 -276
- package/src/context/feature-flags.tsx +0 -63
- package/src/context/field.tsx +0 -70
- package/src/context/navMenu.tsx +0 -89
- package/src/context/prompt-modal.tsx +0 -315
- package/src/context/theme.tsx +0 -83
- package/src/hooks/useModal.ts +0 -63
- package/src/hooks/useRootColors.ts +0 -72
- package/src/hooks/useTheme.ts +0 -121
- package/src/index.client.ts +0 -30
- package/src/index.ts +0 -76
- package/src/system/factory.ts +0 -32
- package/src/system/index.ts +0 -47
- package/src/system/primitive-factory.tsx +0 -180
- package/src/system/types.ts +0 -88
- package/src/types.ts +0 -23
- package/src/utils/index.ts +0 -51
- package/src/utils/localStorage.ts +0 -28
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DatePickerParts } from './parts'
|
|
2
|
-
import type { DatePickerContentProps } from './primitives'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* This private module contains an abstraction of the DatePickerContent
|
|
6
|
-
* primitive.
|
|
7
|
-
* @module 'date-picker/content'
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An abstraction of the DatePicker content that wraps the DatePickerParts
|
|
12
|
-
* primitives.
|
|
13
|
-
* @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)
|
|
14
|
-
*/
|
|
15
|
-
export function DatePickerContent(props: DatePickerContentProps) {
|
|
16
|
-
return (
|
|
17
|
-
<DatePickerParts.Positioner>
|
|
18
|
-
<DatePickerParts.Content {...props} />
|
|
19
|
-
</DatePickerParts.Positioner>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { DatePickerParts } from './parts'
|
|
4
|
-
import type { DatePickerRootProps } from './primitives'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* DatePicker component is an abstraction of the DatePickerRoot primitive which
|
|
8
|
-
* is the context provider to the DatePicker.
|
|
9
|
-
* @description [Cerberus Docs](https://cerberus.digitalu.design/docs/components/date-picker)
|
|
10
|
-
*/
|
|
11
|
-
export function DatePicker(props: DatePickerRootProps) {
|
|
12
|
-
return (
|
|
13
|
-
<DatePickerParts.Root
|
|
14
|
-
positioning={{
|
|
15
|
-
placement: 'bottom-start',
|
|
16
|
-
}}
|
|
17
|
-
{...props}
|
|
18
|
-
/>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import type {
|
|
4
|
-
DatePicker,
|
|
5
|
-
UseDatePickerContext,
|
|
6
|
-
} from '@ark-ui/react/date-picker'
|
|
7
|
-
import { DatePickerParts } from './parts'
|
|
8
|
-
import type { DatePickerViewProps } from './primitives'
|
|
9
|
-
import { DatePickerViewControlGroup } from './view-control-group'
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* This private module contains an abstraction of the DayView component.
|
|
13
|
-
* @module 'date-picker/day-view'
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export type DateValue = DatePicker.DateValue
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* An abstraction of the DatePickerDayView that renders the day view of the
|
|
20
|
-
* DatePicker.
|
|
21
|
-
* @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)
|
|
22
|
-
*/
|
|
23
|
-
export function DatePickerDayView(props: Omit<DatePickerViewProps, 'view'>) {
|
|
24
|
-
function isToday(date: DateValue): boolean {
|
|
25
|
-
const today = new Date()
|
|
26
|
-
const formatted = today.toISOString().split('T')[0]
|
|
27
|
-
const arkDate = `${date.year}-${String(date.month).padStart(2, '0')}-${String(date.day).padStart(2, '0')}`
|
|
28
|
-
return formatted === arkDate
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function isPastDay(date: DateValue): boolean {
|
|
32
|
-
const today = new Date()
|
|
33
|
-
const arkDate = `${date.year}-${String(date.month).padStart(2, '0')}-${String(date.day).padStart(2, '0')}`
|
|
34
|
-
return new Date(arkDate) < today
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function getDayValue(date: DateValue): 'today' | 'past' | 'future' {
|
|
38
|
-
if (isToday(date)) return 'today'
|
|
39
|
-
if (isPastDay(date)) return 'past'
|
|
40
|
-
return 'future'
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return (
|
|
44
|
-
<DatePickerParts.View {...props} view="day">
|
|
45
|
-
<DatePickerParts.Context>
|
|
46
|
-
{(datePickerData: UseDatePickerContext) => (
|
|
47
|
-
<>
|
|
48
|
-
<DatePickerViewControlGroup />
|
|
49
|
-
|
|
50
|
-
<DatePickerParts.Table>
|
|
51
|
-
<DatePickerParts.TableHead>
|
|
52
|
-
<DatePickerParts.TableRow>
|
|
53
|
-
{datePickerData.weekDays.map((weekDay, id) => (
|
|
54
|
-
<DatePickerParts.TableHeader key={id}>
|
|
55
|
-
{weekDay.narrow}
|
|
56
|
-
</DatePickerParts.TableHeader>
|
|
57
|
-
))}
|
|
58
|
-
</DatePickerParts.TableRow>
|
|
59
|
-
</DatePickerParts.TableHead>
|
|
60
|
-
|
|
61
|
-
<DatePickerParts.TableBody>
|
|
62
|
-
{datePickerData.weeks.map((week, id) => (
|
|
63
|
-
<DatePickerParts.TableRow key={id}>
|
|
64
|
-
{week.map((day, id) => (
|
|
65
|
-
<DatePickerParts.TableCell key={id} value={day}>
|
|
66
|
-
<DatePickerParts.TableCellTrigger
|
|
67
|
-
data-date={getDayValue(day)}
|
|
68
|
-
>
|
|
69
|
-
{day.day}
|
|
70
|
-
</DatePickerParts.TableCellTrigger>
|
|
71
|
-
</DatePickerParts.TableCell>
|
|
72
|
-
))}
|
|
73
|
-
</DatePickerParts.TableRow>
|
|
74
|
-
))}
|
|
75
|
-
</DatePickerParts.TableBody>
|
|
76
|
-
</DatePickerParts.Table>
|
|
77
|
-
</>
|
|
78
|
-
)}
|
|
79
|
-
</DatePickerParts.Context>
|
|
80
|
-
</DatePickerParts.View>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export * from './parts'
|
|
2
|
-
export * from './primitives'
|
|
3
|
-
export * from './date-picker'
|
|
4
|
-
export * from './input'
|
|
5
|
-
export * from './range-input'
|
|
6
|
-
export * from './calendar'
|
|
7
|
-
|
|
8
|
-
// external dependencies
|
|
9
|
-
|
|
10
|
-
export { parseDate, type DateValue } from '@ark-ui/react/date-picker'
|
|
11
|
-
export {
|
|
12
|
-
CalendarDate,
|
|
13
|
-
today,
|
|
14
|
-
getLocalTimeZone,
|
|
15
|
-
DateFormatter,
|
|
16
|
-
} from '@internationalized/date'
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { DatePickerTrigger } from './trigger'
|
|
2
|
-
import { DatePickerParts } from './parts'
|
|
3
|
-
import type { DatePickerInputElProps } from './primitives'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This module contains an abstraction of the DatePickerInputEl primitive.
|
|
7
|
-
* @module 'date-picker/input'
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An abstraction of the DatePicker input that wraps the input and the
|
|
12
|
-
* triggers to open the DatePicker and clear the value.
|
|
13
|
-
* @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)
|
|
14
|
-
*/
|
|
15
|
-
export function DatePickerInput(props: DatePickerInputElProps) {
|
|
16
|
-
return (
|
|
17
|
-
<DatePickerParts.Control>
|
|
18
|
-
<DatePickerTrigger />
|
|
19
|
-
<DatePickerParts.Input
|
|
20
|
-
{...props}
|
|
21
|
-
maxLength={11}
|
|
22
|
-
placeholder={props.placeholder ?? 'MM/DD/YYYY'}
|
|
23
|
-
/>
|
|
24
|
-
</DatePickerParts.Control>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import type { UseDatePickerContext } from '@ark-ui/react/date-picker'
|
|
4
|
-
import { DatePickerParts } from './parts'
|
|
5
|
-
import { DatePickerViewControlGroup } from './view-control-group'
|
|
6
|
-
import type { DatePickerViewProps } from './primitives'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This private module contains an abstraction of the DatePickerMonthView
|
|
10
|
-
* component.
|
|
11
|
-
* @module 'date-picker/month-view'
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* An abstraction of the DatePickerMonthView that renders the month view of the
|
|
16
|
-
* DatePicker.
|
|
17
|
-
* @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)
|
|
18
|
-
*/
|
|
19
|
-
export function DatePickerMonthView(props: DatePickerViewProps) {
|
|
20
|
-
return (
|
|
21
|
-
<DatePickerParts.View {...props} view="month">
|
|
22
|
-
<DatePickerParts.Context>
|
|
23
|
-
{(datePicker: UseDatePickerContext) => (
|
|
24
|
-
<>
|
|
25
|
-
<DatePickerViewControlGroup />
|
|
26
|
-
|
|
27
|
-
<DatePickerParts.Table>
|
|
28
|
-
<DatePickerParts.TableBody>
|
|
29
|
-
{datePicker
|
|
30
|
-
.getMonthsGrid({ columns: 4, format: 'short' })
|
|
31
|
-
.map((months, id) => (
|
|
32
|
-
<DatePickerParts.TableRow key={id}>
|
|
33
|
-
{months.map((month, id) => (
|
|
34
|
-
<DatePickerParts.TableCell key={id} value={month.value}>
|
|
35
|
-
<DatePickerParts.TableCellTrigger>
|
|
36
|
-
{month.label}
|
|
37
|
-
</DatePickerParts.TableCellTrigger>
|
|
38
|
-
</DatePickerParts.TableCell>
|
|
39
|
-
))}
|
|
40
|
-
</DatePickerParts.TableRow>
|
|
41
|
-
))}
|
|
42
|
-
</DatePickerParts.TableBody>
|
|
43
|
-
</DatePickerParts.Table>
|
|
44
|
-
</>
|
|
45
|
-
)}
|
|
46
|
-
</DatePickerParts.Context>
|
|
47
|
-
</DatePickerParts.View>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
DatePickerClearTrigger,
|
|
4
|
-
DatePickerContent,
|
|
5
|
-
DatePickerContext,
|
|
6
|
-
DatePickerControl,
|
|
7
|
-
DatePickerInputEl,
|
|
8
|
-
DatePickerLabel,
|
|
9
|
-
DatePickerMonthSelect,
|
|
10
|
-
DatePickerNextTrigger,
|
|
11
|
-
DatePickerPositioner,
|
|
12
|
-
DatePickerPrevTrigger,
|
|
13
|
-
DatePickerRangeText,
|
|
14
|
-
DatePickerRoot,
|
|
15
|
-
DatePickerTable,
|
|
16
|
-
DatePickerTableBody,
|
|
17
|
-
DatePickerTableCell,
|
|
18
|
-
DatePickerTableCellTrigger,
|
|
19
|
-
DatePickerTableHead,
|
|
20
|
-
DatePickerTableHeader,
|
|
21
|
-
DatePickerTableRow,
|
|
22
|
-
DatePickerTrigger,
|
|
23
|
-
DatePickerView,
|
|
24
|
-
DatePickerViewControl,
|
|
25
|
-
DatePickerViewTrigger,
|
|
26
|
-
DatePickerYearSelect,
|
|
27
|
-
} from './primitives'
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* This module contains the parts of the DatePicker component.
|
|
31
|
-
* @module 'date-picker/parts'
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
interface DatePickerPartsValue {
|
|
35
|
-
/**
|
|
36
|
-
* The container of the date-picker.
|
|
37
|
-
*/
|
|
38
|
-
Root: ElementType
|
|
39
|
-
/**
|
|
40
|
-
* The label of the date-picker.
|
|
41
|
-
*/
|
|
42
|
-
Label: ElementType
|
|
43
|
-
/**
|
|
44
|
-
* The control of the date-picker.
|
|
45
|
-
*/
|
|
46
|
-
Control: ElementType
|
|
47
|
-
/**
|
|
48
|
-
* The input of the date-picker.
|
|
49
|
-
*/
|
|
50
|
-
Input: ElementType
|
|
51
|
-
/**
|
|
52
|
-
* The trigger that opens the date-picker.
|
|
53
|
-
*/
|
|
54
|
-
Trigger: ElementType
|
|
55
|
-
/**
|
|
56
|
-
* The trigger that clears the value of the date-picker.
|
|
57
|
-
*/
|
|
58
|
-
ClearTrigger: ElementType
|
|
59
|
-
/**
|
|
60
|
-
* The positioner of the content for the date-picker.
|
|
61
|
-
*/
|
|
62
|
-
Positioner: ElementType
|
|
63
|
-
/**
|
|
64
|
-
* The content of the date-picker.
|
|
65
|
-
*/
|
|
66
|
-
Content: ElementType
|
|
67
|
-
/**
|
|
68
|
-
* The year select input of the date-picker.
|
|
69
|
-
*/
|
|
70
|
-
YearSelect: ElementType
|
|
71
|
-
/**
|
|
72
|
-
* The month select input of the date-picker.
|
|
73
|
-
*/
|
|
74
|
-
MonthSelect: ElementType
|
|
75
|
-
/**
|
|
76
|
-
* The day view of the date-picker.
|
|
77
|
-
*/
|
|
78
|
-
View: ElementType
|
|
79
|
-
/**
|
|
80
|
-
* The day context of the date-picker.
|
|
81
|
-
*/
|
|
82
|
-
Context: ElementType
|
|
83
|
-
/**
|
|
84
|
-
* The container for the content triggers.
|
|
85
|
-
*/
|
|
86
|
-
ViewControl: ElementType
|
|
87
|
-
/**
|
|
88
|
-
* The trigger that moves to the previous month.
|
|
89
|
-
*/
|
|
90
|
-
PrevTrigger: ElementType
|
|
91
|
-
/**
|
|
92
|
-
* The trigger that moves to the next month.
|
|
93
|
-
*/
|
|
94
|
-
NextTrigger: ElementType
|
|
95
|
-
/**
|
|
96
|
-
* The trigger that moves to the next view.
|
|
97
|
-
*/
|
|
98
|
-
ViewTrigger: ElementType
|
|
99
|
-
/**
|
|
100
|
-
* The range text of the date-picker.
|
|
101
|
-
*/
|
|
102
|
-
RangeText: ElementType
|
|
103
|
-
/**
|
|
104
|
-
* The table of the date-picker.
|
|
105
|
-
*/
|
|
106
|
-
Table: ElementType
|
|
107
|
-
/**
|
|
108
|
-
* The table head of the date-picker.
|
|
109
|
-
*/
|
|
110
|
-
TableHead: ElementType
|
|
111
|
-
/**
|
|
112
|
-
* The table row of the date-picker.
|
|
113
|
-
*/
|
|
114
|
-
TableRow: ElementType
|
|
115
|
-
/**
|
|
116
|
-
* The header text for the table.
|
|
117
|
-
*/
|
|
118
|
-
TableHeader: ElementType
|
|
119
|
-
/**
|
|
120
|
-
* The body of the table.
|
|
121
|
-
*/
|
|
122
|
-
TableBody: ElementType
|
|
123
|
-
/**
|
|
124
|
-
* The table cell of the table.
|
|
125
|
-
*/
|
|
126
|
-
TableCell: ElementType
|
|
127
|
-
/**
|
|
128
|
-
* The trigger for the table cell.
|
|
129
|
-
*/
|
|
130
|
-
TableCellTrigger: ElementType
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* An Object containing the parts of the DatePicker component. For users that
|
|
135
|
-
* prefer Object component syntax.
|
|
136
|
-
*
|
|
137
|
-
* @remarks
|
|
138
|
-
*
|
|
139
|
-
* When using object component syntax, you import the DatePickerParts object and
|
|
140
|
-
* the entire family of components vs. only what you use.
|
|
141
|
-
*/
|
|
142
|
-
export const DatePickerParts: DatePickerPartsValue = {
|
|
143
|
-
Root: DatePickerRoot,
|
|
144
|
-
Label: DatePickerLabel,
|
|
145
|
-
Control: DatePickerControl,
|
|
146
|
-
Input: DatePickerInputEl,
|
|
147
|
-
Trigger: DatePickerTrigger,
|
|
148
|
-
ClearTrigger: DatePickerClearTrigger,
|
|
149
|
-
Positioner: DatePickerPositioner,
|
|
150
|
-
Content: DatePickerContent,
|
|
151
|
-
YearSelect: DatePickerYearSelect,
|
|
152
|
-
MonthSelect: DatePickerMonthSelect,
|
|
153
|
-
View: DatePickerView,
|
|
154
|
-
Context: DatePickerContext,
|
|
155
|
-
ViewControl: DatePickerViewControl,
|
|
156
|
-
PrevTrigger: DatePickerPrevTrigger,
|
|
157
|
-
NextTrigger: DatePickerNextTrigger,
|
|
158
|
-
ViewTrigger: DatePickerViewTrigger,
|
|
159
|
-
RangeText: DatePickerRangeText,
|
|
160
|
-
Table: DatePickerTable,
|
|
161
|
-
TableHead: DatePickerTableHead,
|
|
162
|
-
TableRow: DatePickerTableRow,
|
|
163
|
-
TableHeader: DatePickerTableHeader,
|
|
164
|
-
TableBody: DatePickerTableBody,
|
|
165
|
-
TableCell: DatePickerTableCell,
|
|
166
|
-
TableCellTrigger: DatePickerTableCellTrigger,
|
|
167
|
-
}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DatePicker,
|
|
3
|
-
type DatePickerContentProps as ArkDatePickerContentProps,
|
|
4
|
-
type DatePickerContextProps as ArkDatePickerContextProps,
|
|
5
|
-
type DatePickerControlProps as ArkDatePickerControlProps,
|
|
6
|
-
type DatePickerInputProps as ArkDatePickerInputProps,
|
|
7
|
-
type DatePickerLabelProps as ArkDatePickerLabelProps,
|
|
8
|
-
type DatePickerMonthSelectProps as ArkDatePickerMonthSelectProps,
|
|
9
|
-
type DatePickerNextTriggerProps as ArkDatePickerNextTriggerProps,
|
|
10
|
-
type DatePickerPositionerProps as ArkDatePickerPositionerProps,
|
|
11
|
-
type DatePickerPrevTriggerProps as ArkDatePickerPrevTriggerProps,
|
|
12
|
-
type DatePickerRangeTextProps as ArkDatePickerRangeTextProps,
|
|
13
|
-
type DatePickerRootProps as ArkDatePickerRootProps,
|
|
14
|
-
type DatePickerTableBodyProps as ArkDatePickerTableBodyProps,
|
|
15
|
-
type DatePickerTableCellProps as ArkDatePickerTableCellProps,
|
|
16
|
-
type DatePickerTableCellTriggerProps as ArkDatePickerTableCellTriggerProps,
|
|
17
|
-
type DatePickerTableHeaderProps as ArkDatePickerTableHeaderProps,
|
|
18
|
-
type DatePickerTableHeadProps as ArkDatePickerTableHeadProps,
|
|
19
|
-
type DatePickerTableProps as ArkDatePickerTableProps,
|
|
20
|
-
type DatePickerTableRowProps as ArkDatePickerTableRowProps,
|
|
21
|
-
type DatePickerTriggerProps as ArkDatePickerTriggerProps,
|
|
22
|
-
type DatePickerViewControlProps as ArkDatePickerViewControlProps,
|
|
23
|
-
type DatePickerViewProps as ArkDatePickerViewProps,
|
|
24
|
-
type DatePickerViewTriggerProps as ArkDatePickerViewTriggerProps,
|
|
25
|
-
type DatePickerYearSelectProps as ArkDatePickerYearSelectProps,
|
|
26
|
-
} from '@ark-ui/react/date-picker'
|
|
27
|
-
import { datePicker } from 'styled-system/recipes'
|
|
28
|
-
import {
|
|
29
|
-
createCerberusPrimitive,
|
|
30
|
-
type CerberusPrimitiveProps,
|
|
31
|
-
} from '../../system/index'
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* This module contains the DatePicker primitives.
|
|
35
|
-
* @module 'date-picker/primitives'
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
const { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(datePicker)
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The label component for the DatePicker.
|
|
42
|
-
*/
|
|
43
|
-
export type DatePickerLabelProps =
|
|
44
|
-
CerberusPrimitiveProps<ArkDatePickerLabelProps>
|
|
45
|
-
export const DatePickerLabel = withSlotRecipe(DatePicker.Label, 'label')
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The control component for the DatePicker which wraps the input and the
|
|
49
|
-
* triggers to open the DatePicker and clear the value.
|
|
50
|
-
*/
|
|
51
|
-
export type DatePickerControlProps =
|
|
52
|
-
CerberusPrimitiveProps<ArkDatePickerControlProps>
|
|
53
|
-
export const DatePickerControl = withSlotRecipe(DatePicker.Control, 'control')
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The input component for the DatePicker.
|
|
57
|
-
*/
|
|
58
|
-
export type DatePickerInputElProps =
|
|
59
|
-
CerberusPrimitiveProps<ArkDatePickerInputProps>
|
|
60
|
-
export const DatePickerInputEl = withSlotRecipe(DatePicker.Input, 'input')
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* The trigger component that opens the DatePicker.
|
|
64
|
-
*/
|
|
65
|
-
export type DatePickerTriggerProps =
|
|
66
|
-
CerberusPrimitiveProps<ArkDatePickerTriggerProps>
|
|
67
|
-
export const DatePickerTrigger = withSlotRecipe(DatePicker.Trigger, 'trigger')
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* The content component for the DatePicker.
|
|
71
|
-
*/
|
|
72
|
-
export type DatePickerContentProps =
|
|
73
|
-
CerberusPrimitiveProps<ArkDatePickerContentProps>
|
|
74
|
-
export const DatePickerContent = withSlotRecipe(DatePicker.Content, 'content')
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* The view control component for the DatePicker which wraps the triggers to
|
|
78
|
-
* switch between calendar views.
|
|
79
|
-
*/
|
|
80
|
-
export type DatePickerViewControlProps =
|
|
81
|
-
CerberusPrimitiveProps<ArkDatePickerViewControlProps>
|
|
82
|
-
export const DatePickerViewControl = withSlotRecipe(
|
|
83
|
-
DatePicker.Control,
|
|
84
|
-
'viewControl',
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* The range text component for the DatePicker.
|
|
89
|
-
*/
|
|
90
|
-
export type DatePickerRangeTextProps =
|
|
91
|
-
CerberusPrimitiveProps<ArkDatePickerRangeTextProps>
|
|
92
|
-
export const DatePickerRangeText = withSlotRecipe(
|
|
93
|
-
DatePicker.RangeText,
|
|
94
|
-
'rangeText',
|
|
95
|
-
)
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* The table component for the DatePicker.
|
|
99
|
-
*/
|
|
100
|
-
export type DatePickerTableProps =
|
|
101
|
-
CerberusPrimitiveProps<ArkDatePickerTableProps>
|
|
102
|
-
export const DatePickerTable = withSlotRecipe(DatePicker.Table, 'table')
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The header component for the DatePicker table.
|
|
106
|
-
*/
|
|
107
|
-
export type DatePickerTableHeaderProps =
|
|
108
|
-
CerberusPrimitiveProps<ArkDatePickerTableHeaderProps>
|
|
109
|
-
export const DatePickerTableHeader = withSlotRecipe(
|
|
110
|
-
DatePicker.TableHeader,
|
|
111
|
-
'tableHeader',
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* The table cell component for the DatePicker.
|
|
116
|
-
*/
|
|
117
|
-
export type DatePickerTableCellProps =
|
|
118
|
-
CerberusPrimitiveProps<ArkDatePickerTableCellProps>
|
|
119
|
-
export const DatePickerTableCell = withSlotRecipe(
|
|
120
|
-
DatePicker.TableCell,
|
|
121
|
-
'tableCell',
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The table cell trigger component for the DatePicker.
|
|
126
|
-
*/
|
|
127
|
-
export type DatePickerTableCellTriggerProps =
|
|
128
|
-
CerberusPrimitiveProps<ArkDatePickerTableCellTriggerProps>
|
|
129
|
-
export const DatePickerTableCellTrigger = withSlotRecipe(
|
|
130
|
-
DatePicker.TableCellTrigger,
|
|
131
|
-
'tableCellTrigger',
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* The root component of the DatePicker. This primitive has no Cerberus styles.
|
|
136
|
-
*/
|
|
137
|
-
export type DatePickerRootProps = CerberusPrimitiveProps<ArkDatePickerRootProps>
|
|
138
|
-
export const DatePickerRoot = withNoRecipe(DatePicker.Root)
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* The label component of the DatePicker. This primitive has no Cerberus styles.
|
|
142
|
-
*/
|
|
143
|
-
export type DatePickerClearTriggerProps =
|
|
144
|
-
CerberusPrimitiveProps<ArkDatePickerTriggerProps>
|
|
145
|
-
export const DatePickerClearTrigger = withNoRecipe(DatePicker.ClearTrigger)
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* The control component of the DatePicker. This primitive has no Cerberus
|
|
149
|
-
* styles.
|
|
150
|
-
*/
|
|
151
|
-
export type DatePickerPositionerProps =
|
|
152
|
-
CerberusPrimitiveProps<ArkDatePickerPositionerProps>
|
|
153
|
-
export const DatePickerPositioner = withSlotRecipe(
|
|
154
|
-
DatePicker.Positioner,
|
|
155
|
-
'positioner',
|
|
156
|
-
)
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* The year select input component of the DatePicker. This primitive has no
|
|
160
|
-
* Cerberus styles.
|
|
161
|
-
*/
|
|
162
|
-
export type DatePickerYearSelectProps =
|
|
163
|
-
CerberusPrimitiveProps<ArkDatePickerYearSelectProps>
|
|
164
|
-
export const DatePickerYearSelect = withNoRecipe(DatePicker.YearSelect)
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* The month select input component of the DatePicker. This primitive has no
|
|
168
|
-
* Cerberus styles.
|
|
169
|
-
*/
|
|
170
|
-
export type DatePickerMonthSelectProps =
|
|
171
|
-
CerberusPrimitiveProps<ArkDatePickerMonthSelectProps>
|
|
172
|
-
export const DatePickerMonthSelect = withNoRecipe(DatePicker.MonthSelect)
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* The day view component of the DatePicker. This primitive has no Cerberus
|
|
176
|
-
* styles.
|
|
177
|
-
*/
|
|
178
|
-
export type DatePickerViewProps = CerberusPrimitiveProps<ArkDatePickerViewProps>
|
|
179
|
-
export const DatePickerView = withNoRecipe(DatePicker.View)
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The day context component of the DatePicker. This primitive has no
|
|
183
|
-
* Cerberus styles.
|
|
184
|
-
*/
|
|
185
|
-
export type DatePickerContextProps =
|
|
186
|
-
CerberusPrimitiveProps<ArkDatePickerContextProps>
|
|
187
|
-
export const DatePickerContext = DatePicker.Context
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* The trigger component of the DatePicker. This primitive has no Cerberus
|
|
191
|
-
* styles.
|
|
192
|
-
*/
|
|
193
|
-
export type DatePickerPrevTriggerProps =
|
|
194
|
-
CerberusPrimitiveProps<ArkDatePickerPrevTriggerProps>
|
|
195
|
-
export const DatePickerPrevTrigger = withNoRecipe(DatePicker.PrevTrigger)
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* The trigger component of the DatePicker. This primitive has no Cerberus
|
|
199
|
-
* styles.
|
|
200
|
-
*/
|
|
201
|
-
export type DatePickerNextTriggerProps =
|
|
202
|
-
CerberusPrimitiveProps<ArkDatePickerNextTriggerProps>
|
|
203
|
-
export const DatePickerNextTrigger = withNoRecipe(DatePicker.NextTrigger)
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* The trigger component of the DatePicker. This primitive has no Cerberus
|
|
207
|
-
* styles.
|
|
208
|
-
*/
|
|
209
|
-
export type DatePickerViewTriggerProps =
|
|
210
|
-
CerberusPrimitiveProps<ArkDatePickerViewTriggerProps>
|
|
211
|
-
export const DatePickerViewTrigger = withNoRecipe(DatePicker.ViewTrigger)
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* The table head component of the DatePicker. This primitive has no Cerberus
|
|
215
|
-
* styles.
|
|
216
|
-
*/
|
|
217
|
-
export type DatePickerTableHeadProps =
|
|
218
|
-
CerberusPrimitiveProps<ArkDatePickerTableHeadProps>
|
|
219
|
-
export const DatePickerTableHead = withNoRecipe(DatePicker.TableHead)
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* The table row component of the DatePicker. This primitive has no Cerberus
|
|
223
|
-
* styles.
|
|
224
|
-
*/
|
|
225
|
-
export type DatePickerTableRowProps =
|
|
226
|
-
CerberusPrimitiveProps<ArkDatePickerTableRowProps>
|
|
227
|
-
export const DatePickerTableRow = withNoRecipe(DatePicker.TableRow)
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* The table body component of the DatePicker. This primitive has no Cerberus
|
|
231
|
-
* styles.
|
|
232
|
-
*/
|
|
233
|
-
export type DatePickerTableBodyProps =
|
|
234
|
-
CerberusPrimitiveProps<ArkDatePickerTableBodyProps>
|
|
235
|
-
export const DatePickerTableBody = withNoRecipe(DatePicker.TableBody)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { DatePickerParts } from './parts'
|
|
2
|
-
import type { DatePickerInputElProps } from './primitives'
|
|
3
|
-
import { DatePickerTrigger } from './trigger'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This private module contains the RangePickerInput component.
|
|
7
|
-
* @module RangePickerInput
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export type RangePickerInputProps = DatePickerInputElProps
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* An abstraction of the DatePicker input that wraps the input and the
|
|
14
|
-
* triggers to open the DatePicker and clear the value.
|
|
15
|
-
* @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)
|
|
16
|
-
*/
|
|
17
|
-
export function RangePickerInput(props: RangePickerInputProps) {
|
|
18
|
-
return (
|
|
19
|
-
<DatePickerParts.Control data-range>
|
|
20
|
-
<DatePickerTrigger />
|
|
21
|
-
<DatePickerParts.Input
|
|
22
|
-
{...props}
|
|
23
|
-
data-range-input
|
|
24
|
-
placeholder={props.placeholder ?? 'MM/DD/YYYY'}
|
|
25
|
-
maxLength={11}
|
|
26
|
-
index={0}
|
|
27
|
-
/>
|
|
28
|
-
<DatePickerParts.Input
|
|
29
|
-
{...props}
|
|
30
|
-
data-range-input
|
|
31
|
-
data-range-end-input
|
|
32
|
-
placeholder={props.placeholder ?? 'MM/DD/YYYY'}
|
|
33
|
-
maxLength={11}
|
|
34
|
-
index={1}
|
|
35
|
-
/>
|
|
36
|
-
</DatePickerParts.Control>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useCerberusContext } from '../../context/cerberus'
|
|
4
|
-
import { IconButton } from '../icon-button/index'
|
|
5
|
-
import { DatePickerParts } from './parts'
|
|
6
|
-
import type { DatePickerTriggerProps } from './primitives'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This private module contains the DatePicker trigger component.
|
|
10
|
-
* @module DatePickerTrigger
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* An abstraction of the DatePickerTrigger that toggles the calender open.
|
|
15
|
-
* @definition [datePicker docs](https://cerberus.digitalu.design/react/date-picker)
|
|
16
|
-
*/
|
|
17
|
-
export function DatePickerTrigger(props: DatePickerTriggerProps) {
|
|
18
|
-
const { icons } = useCerberusContext()
|
|
19
|
-
const { calendar: CalendarIcon } = icons
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<DatePickerParts.Trigger {...props} asChild>
|
|
23
|
-
<IconButton ariaLabel="Open calendar" size="sm" usage="ghost">
|
|
24
|
-
<CalendarIcon />
|
|
25
|
-
</IconButton>
|
|
26
|
-
</DatePickerParts.Trigger>
|
|
27
|
-
)
|
|
28
|
-
}
|