@cerberus-design/react 1.0.0-rc.4 → 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 +9 -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,34 +0,0 @@
|
|
|
1
|
-
import { Group } from '../group/index'
|
|
2
|
-
import { PaginationItem } from './item'
|
|
3
|
-
import { PaginationProps } from './pagination'
|
|
4
|
-
import { PaginationParts } from './parts'
|
|
5
|
-
import { PaginationContextDetails } from './primitives'
|
|
6
|
-
import { NextTrigger, PrevTrigger } from './triggers'
|
|
7
|
-
|
|
8
|
-
interface ItemListProps extends PaginationContextDetails {
|
|
9
|
-
layout?: PaginationProps['layout']
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function ItemList(props: ItemListProps) {
|
|
13
|
-
const { layout, ...pagination } = props
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<Group layout={layout}>
|
|
17
|
-
<PrevTrigger layout={layout} />
|
|
18
|
-
|
|
19
|
-
{pagination.pages.map((page, index) =>
|
|
20
|
-
page.type === 'page' ? (
|
|
21
|
-
<PaginationParts.Item key={index} {...page} asChild>
|
|
22
|
-
<PaginationItem>{page.value}</PaginationItem>
|
|
23
|
-
</PaginationParts.Item>
|
|
24
|
-
) : (
|
|
25
|
-
<PaginationParts.Ellipsis key={index} index={index} asChild>
|
|
26
|
-
<PaginationItem>…</PaginationItem>
|
|
27
|
-
</PaginationParts.Ellipsis>
|
|
28
|
-
),
|
|
29
|
-
)}
|
|
30
|
-
|
|
31
|
-
<NextTrigger layout={layout} />
|
|
32
|
-
</Group>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import type { WithCss } from 'styled-system/types'
|
|
4
|
-
import { type GroupProps } from '../group/index'
|
|
5
|
-
import { Show } from '../show/index'
|
|
6
|
-
import { CompactText } from './compact'
|
|
7
|
-
import { ItemList } from './item-list'
|
|
8
|
-
import { PaginationParts } from './parts'
|
|
9
|
-
import {
|
|
10
|
-
PaginationRootProps,
|
|
11
|
-
type PaginationContextDetails,
|
|
12
|
-
} from './primitives'
|
|
13
|
-
|
|
14
|
-
export interface PaginationProps extends PaginationRootProps, WithCss {
|
|
15
|
-
/**
|
|
16
|
-
* Display a compact layout of only text information and triggers.
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
compact?: boolean
|
|
20
|
-
/**
|
|
21
|
-
* Display the layout of the button group.
|
|
22
|
-
* @default 'default'
|
|
23
|
-
*/
|
|
24
|
-
layout?: GroupProps['layout']
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A pagination component that displays a list of buttons to navigate between pages.
|
|
29
|
-
* @see [Cerby Docs](https://cerberus.digitalu.design/docs/components/pagination)
|
|
30
|
-
* @definition [Ark Docs](https://ark-ui.com/docs/components/pagination#api-reference)
|
|
31
|
-
*/
|
|
32
|
-
export function Pagination(props: PaginationProps) {
|
|
33
|
-
const { compact, layout, ...rootProps } = props
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<PaginationParts.Root {...rootProps}>
|
|
37
|
-
<PaginationParts.Context>
|
|
38
|
-
{(pagination: PaginationContextDetails) => (
|
|
39
|
-
<>
|
|
40
|
-
{props.children}
|
|
41
|
-
|
|
42
|
-
<Show
|
|
43
|
-
when={compact}
|
|
44
|
-
fallback={<ItemList layout={layout} {...pagination} />}
|
|
45
|
-
>
|
|
46
|
-
<CompactText layout={layout} {...pagination} />
|
|
47
|
-
</Show>
|
|
48
|
-
</>
|
|
49
|
-
)}
|
|
50
|
-
</PaginationParts.Context>
|
|
51
|
-
</PaginationParts.Root>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
PaginationRoot,
|
|
4
|
-
PaginationPrevTrigger,
|
|
5
|
-
PaginationNextTrigger,
|
|
6
|
-
PaginationContext,
|
|
7
|
-
PaginationItem,
|
|
8
|
-
PaginationEllipsis,
|
|
9
|
-
PaginationRootProvider,
|
|
10
|
-
} from './primitives'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This module contains the parts of the Pagination component.
|
|
14
|
-
* @module 'pagination/parts'
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
interface PaginationPartsValue {
|
|
18
|
-
/**
|
|
19
|
-
* The context provider of the pagination family.
|
|
20
|
-
*/
|
|
21
|
-
Root: ElementType
|
|
22
|
-
/**
|
|
23
|
-
* The trigger button for going backwards.
|
|
24
|
-
*/
|
|
25
|
-
PrevTrigger: ElementType
|
|
26
|
-
/**
|
|
27
|
-
* The trigger button for going forwards.
|
|
28
|
-
*/
|
|
29
|
-
NextTrigger: ElementType
|
|
30
|
-
/**
|
|
31
|
-
* The context provider of the pagination family.
|
|
32
|
-
*/
|
|
33
|
-
Context: ElementType
|
|
34
|
-
/**
|
|
35
|
-
* The item component of the pagination family.
|
|
36
|
-
*/
|
|
37
|
-
Item: ElementType
|
|
38
|
-
/**
|
|
39
|
-
* The ellipsis component of the pagination family.
|
|
40
|
-
*/
|
|
41
|
-
Ellipsis: ElementType
|
|
42
|
-
/**
|
|
43
|
-
* The context provider of the pagination family.
|
|
44
|
-
*/
|
|
45
|
-
RootProvider: ElementType
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* An Object containing the parts of the Pagination component. For users that
|
|
50
|
-
* prefer Object component syntax.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
*
|
|
54
|
-
* When using object component syntax, you import the PaginationParts object and
|
|
55
|
-
* the entire family of components vs. only what you use.
|
|
56
|
-
*/
|
|
57
|
-
export const PaginationParts: PaginationPartsValue = {
|
|
58
|
-
Root: PaginationRoot,
|
|
59
|
-
PrevTrigger: PaginationPrevTrigger,
|
|
60
|
-
NextTrigger: PaginationNextTrigger,
|
|
61
|
-
Context: PaginationContext,
|
|
62
|
-
Item: PaginationItem,
|
|
63
|
-
Ellipsis: PaginationEllipsis,
|
|
64
|
-
RootProvider: PaginationRootProvider,
|
|
65
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Pagination,
|
|
3
|
-
type PaginationContextProps as ArkPaginationContextProps,
|
|
4
|
-
type PaginationEllipsisProps as ArkPaginationEllipsisProps,
|
|
5
|
-
type PaginationItemProps as ArkPaginationItemProps,
|
|
6
|
-
type PaginationNextTriggerProps as ArkPaginationNextTriggerProps,
|
|
7
|
-
type PaginationPrevTriggerProps as ArkPaginationPrevTriggerProps,
|
|
8
|
-
type PaginationRootProps as ArkPaginationRootProps,
|
|
9
|
-
type PaginationRootProviderProps as ArkPaginationRootProviderProps,
|
|
10
|
-
type UsePaginationReturn as ArkUsePaginationReturn,
|
|
11
|
-
type PaginationPageUrlDetails,
|
|
12
|
-
type PaginationPageSizeChangeDetails,
|
|
13
|
-
} from '@ark-ui/react/pagination'
|
|
14
|
-
import { createCerberusPrimitive } from '../../system/index'
|
|
15
|
-
|
|
16
|
-
const { withNoRecipe } = createCerberusPrimitive()
|
|
17
|
-
|
|
18
|
-
export type PaginationRootProps = ArkPaginationRootProps
|
|
19
|
-
export const PaginationRoot = withNoRecipe(Pagination.Root)
|
|
20
|
-
|
|
21
|
-
export type PaginationPrevTriggerProps = ArkPaginationPrevTriggerProps
|
|
22
|
-
export const PaginationPrevTrigger = withNoRecipe(Pagination.PrevTrigger)
|
|
23
|
-
|
|
24
|
-
export type PaginationNextTriggerProps = ArkPaginationNextTriggerProps
|
|
25
|
-
export const PaginationNextTrigger = withNoRecipe(Pagination.NextTrigger)
|
|
26
|
-
|
|
27
|
-
export type PaginationContextProps = ArkPaginationContextProps
|
|
28
|
-
export const PaginationContext = withNoRecipe(Pagination.Context)
|
|
29
|
-
|
|
30
|
-
export type PaginationItemProps = ArkPaginationItemProps
|
|
31
|
-
export const PaginationItem = withNoRecipe(Pagination.Item)
|
|
32
|
-
|
|
33
|
-
export type PaginationEllipsisProps = ArkPaginationEllipsisProps
|
|
34
|
-
export const PaginationEllipsis = withNoRecipe(Pagination.Ellipsis)
|
|
35
|
-
|
|
36
|
-
export type PaginationRootProviderProps = ArkPaginationRootProviderProps
|
|
37
|
-
export const PaginationRootProvider = withNoRecipe(Pagination.RootProvider)
|
|
38
|
-
|
|
39
|
-
export type PaginationContextDetails = ArkUsePaginationReturn
|
|
40
|
-
export type PageDetails = PaginationPageUrlDetails
|
|
41
|
-
export type PageSizeChangeDetails = PaginationPageSizeChangeDetails
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useCerberusContext } from '../../context/cerberus'
|
|
4
|
-
import { PropsWithChildren } from 'react'
|
|
5
|
-
import { IconButton, type IconButtonProps } from '../icon-button/index'
|
|
6
|
-
import { PaginationParts } from './parts'
|
|
7
|
-
import { GroupProps } from '../group'
|
|
8
|
-
|
|
9
|
-
export function PrevTrigger(props: TriggerProps) {
|
|
10
|
-
const { icons } = useCerberusContext()
|
|
11
|
-
const { calendarPrev: Icon } = icons
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<PaginationParts.PrevTrigger asChild>
|
|
15
|
-
<PaginationTrigger {...props}>
|
|
16
|
-
<Icon />
|
|
17
|
-
</PaginationTrigger>
|
|
18
|
-
</PaginationParts.PrevTrigger>
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function NextTrigger(props: TriggerProps) {
|
|
23
|
-
const { icons } = useCerberusContext()
|
|
24
|
-
const { calendarNext: Icon } = icons
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<PaginationParts.NextTrigger asChild>
|
|
28
|
-
<PaginationTrigger {...props}>
|
|
29
|
-
<Icon />
|
|
30
|
-
</PaginationTrigger>
|
|
31
|
-
</PaginationParts.NextTrigger>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface TriggerBaseProps {
|
|
36
|
-
layout?: GroupProps['layout']
|
|
37
|
-
}
|
|
38
|
-
export type TriggerProps = TriggerBaseProps & Omit<IconButtonProps, 'clipboard'>
|
|
39
|
-
|
|
40
|
-
function PaginationTrigger(props: PropsWithChildren<TriggerProps>) {
|
|
41
|
-
const { layout, ...btnProps } = props
|
|
42
|
-
|
|
43
|
-
if (layout === 'attached') {
|
|
44
|
-
return (
|
|
45
|
-
<IconButton
|
|
46
|
-
shape="square"
|
|
47
|
-
usage="outlined-subtle"
|
|
48
|
-
clipboard
|
|
49
|
-
{...btnProps}
|
|
50
|
-
/>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return <IconButton shape="square" clipboard {...btnProps} />
|
|
55
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PinInputParts } from './parts'
|
|
2
|
-
import type { PinInputRootProps } from './primitives'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* PinInput component for entering a numeric PIN code.
|
|
6
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/docs/components/pin-input)
|
|
7
|
-
*/
|
|
8
|
-
export function PinInput(props: PinInputRootProps) {
|
|
9
|
-
const { size, ...rootProps } = props
|
|
10
|
-
const count = rootProps.count ?? 3
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<PinInputParts.Root placeholder="" size={size} {...rootProps}>
|
|
14
|
-
<PinInputParts.Control>
|
|
15
|
-
{Array.from({ length: count }, (_, index) => (
|
|
16
|
-
<PinInputParts.Input key={index} index={index} size={size} />
|
|
17
|
-
))}
|
|
18
|
-
</PinInputParts.Control>
|
|
19
|
-
<PinInputParts.HiddenInput />
|
|
20
|
-
</PinInputParts.Root>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
PinInputRoot,
|
|
4
|
-
PinInputInput,
|
|
5
|
-
PinInputControl,
|
|
6
|
-
PinInputHiddenInput,
|
|
7
|
-
PinInputLabel,
|
|
8
|
-
} from './primitives'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This module contains the parts of the PinInput component.
|
|
12
|
-
* @module 'pin-input/parts'
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
interface PinInputPartsValue {
|
|
16
|
-
/**
|
|
17
|
-
* The context provider of the pin-input.
|
|
18
|
-
*/
|
|
19
|
-
Root: ElementType
|
|
20
|
-
/**
|
|
21
|
-
* The label element of the pin-input.
|
|
22
|
-
*/
|
|
23
|
-
Label: ElementType
|
|
24
|
-
/**
|
|
25
|
-
* The control element of the pin-input.
|
|
26
|
-
*/
|
|
27
|
-
Control: ElementType
|
|
28
|
-
/**
|
|
29
|
-
* The input element of the pin-input.
|
|
30
|
-
*/
|
|
31
|
-
Input: ElementType
|
|
32
|
-
/**
|
|
33
|
-
* The hidden input element of the pin-input.
|
|
34
|
-
*/
|
|
35
|
-
HiddenInput: ElementType
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* An Object containing the parts of the PinInput component. For users that
|
|
40
|
-
* prefer Object component syntax.
|
|
41
|
-
*
|
|
42
|
-
* @remarks
|
|
43
|
-
*
|
|
44
|
-
* When using object component syntax, you import the PinInputParts object and
|
|
45
|
-
* the entire family of components vs. only what you use.
|
|
46
|
-
*/
|
|
47
|
-
export const PinInputParts: PinInputPartsValue = {
|
|
48
|
-
Root: PinInputRoot,
|
|
49
|
-
Label: PinInputLabel,
|
|
50
|
-
Control: PinInputControl,
|
|
51
|
-
Input: PinInputInput,
|
|
52
|
-
HiddenInput: PinInputHiddenInput,
|
|
53
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { pinInput, type PinInputVariantProps } from 'styled-system/recipes'
|
|
2
|
-
import {
|
|
3
|
-
PinInput as ArkPinInput,
|
|
4
|
-
type PinInputRootProps as ArkPinInputRootProps,
|
|
5
|
-
type PinInputLabelProps as ArkPinInputLabelProps,
|
|
6
|
-
type PinInputInputProps as ArkPinInputInputProps,
|
|
7
|
-
type PinInputControlProps as ArkPinInputControlProps,
|
|
8
|
-
type PinInputHiddenInputProps as ArkPinInputHiddenInputProps,
|
|
9
|
-
} from '@ark-ui/react/pin-input'
|
|
10
|
-
import {
|
|
11
|
-
createCerberusPrimitive,
|
|
12
|
-
type CerberusPrimitiveProps,
|
|
13
|
-
} from '../../system/index'
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* This module contains all the primitives of the PinInput component.
|
|
17
|
-
* @module 'pin-input'
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
const { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(pinInput)
|
|
21
|
-
|
|
22
|
-
// Root
|
|
23
|
-
export type PinInputRootProps = CerberusPrimitiveProps<
|
|
24
|
-
ArkPinInputRootProps & PinInputVariantProps
|
|
25
|
-
>
|
|
26
|
-
export const PinInputRoot = withSlotRecipe(ArkPinInput.Root, 'root')
|
|
27
|
-
|
|
28
|
-
// Label
|
|
29
|
-
export type PinInputLabelProps = CerberusPrimitiveProps<ArkPinInputLabelProps>
|
|
30
|
-
export const PinInputLabel = withSlotRecipe(ArkPinInput.Label, 'label')
|
|
31
|
-
|
|
32
|
-
// Control
|
|
33
|
-
export type PinInputControlProps =
|
|
34
|
-
CerberusPrimitiveProps<ArkPinInputControlProps>
|
|
35
|
-
export const PinInputControl = withSlotRecipe(ArkPinInput.Control, 'control')
|
|
36
|
-
|
|
37
|
-
// Input
|
|
38
|
-
export type PinInputInputProps = CerberusPrimitiveProps<
|
|
39
|
-
ArkPinInputInputProps & PinInputVariantProps
|
|
40
|
-
>
|
|
41
|
-
export const PinInputInput = withSlotRecipe(ArkPinInput.Input, 'input')
|
|
42
|
-
|
|
43
|
-
// HiddenInput
|
|
44
|
-
export type PinInputHiddenInputProps =
|
|
45
|
-
CerberusPrimitiveProps<ArkPinInputHiddenInputProps>
|
|
46
|
-
export const PinInputHiddenInput = withNoRecipe(ArkPinInput.HiddenInput)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './portal'
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Portal as ArkPortal, type PortalProps } from '@ark-ui/react'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This module is the Portal component.
|
|
5
|
-
* @module
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export type { PortalProps }
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The Portal component is used to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
|
|
12
|
-
* @see https://cerberus.digitalu.design/react/portal
|
|
13
|
-
* @definition [React Portal Docs](https://react.dev/reference/react-dom/createPortal)
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* 'use client'
|
|
17
|
-
*
|
|
18
|
-
* import { Portal } from '@cerberus/react'
|
|
19
|
-
*
|
|
20
|
-
* function SomeFeatureWithinSSRPage() {
|
|
21
|
-
* return (
|
|
22
|
-
* <Portal>
|
|
23
|
-
* <div>Portal Content outside of the React VDom tree</div>
|
|
24
|
-
* </Portal>
|
|
25
|
-
* )
|
|
26
|
-
* }
|
|
27
|
-
*/
|
|
28
|
-
export const Portal = ArkPortal
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type HTMLArkProps } from '@ark-ui/react/factory'
|
|
2
|
-
import {
|
|
3
|
-
progressBar,
|
|
4
|
-
type ProgressBarVariantProps,
|
|
5
|
-
} from 'styled-system/recipes'
|
|
6
|
-
import {
|
|
7
|
-
cerberus,
|
|
8
|
-
createCerberusPrimitive,
|
|
9
|
-
type CerberusPrimitiveProps,
|
|
10
|
-
} from '../../system/index'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This module contains the ProgressBar component primitives.
|
|
14
|
-
* @module @cerberus-design/react/components/progress-bar/primitives
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const { withSlotRecipe } = createCerberusPrimitive(progressBar)
|
|
18
|
-
|
|
19
|
-
// Root
|
|
20
|
-
|
|
21
|
-
export type ProgressBarRootProps = CerberusPrimitiveProps<
|
|
22
|
-
HTMLArkProps<'div'> & ProgressBarVariantProps
|
|
23
|
-
>
|
|
24
|
-
export const ProgressBarRoot = withSlotRecipe(cerberus.div, 'root', {
|
|
25
|
-
defaultProps: {
|
|
26
|
-
'aria-valuemin': '0',
|
|
27
|
-
'aria-valuemax': '100',
|
|
28
|
-
role: 'progressbar',
|
|
29
|
-
},
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
// Bar
|
|
33
|
-
|
|
34
|
-
export type ProgressBarBarProps = CerberusPrimitiveProps<
|
|
35
|
-
HTMLArkProps<'div'> & ProgressBarVariantProps
|
|
36
|
-
>
|
|
37
|
-
export const ProgressBarBar = withSlotRecipe(cerberus.div, 'bar')
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ProgressBarBar,
|
|
3
|
-
ProgressBarRoot,
|
|
4
|
-
type ProgressBarRootProps,
|
|
5
|
-
} from './primitives'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This module contains the ProgressBar component.
|
|
9
|
-
* @module
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export type NonIndeterminateProgressBarProps = {
|
|
13
|
-
/**
|
|
14
|
-
* A unique identifier for the progress bar. Required for accessibility.
|
|
15
|
-
*/
|
|
16
|
-
id: string
|
|
17
|
-
/**
|
|
18
|
-
* A description label for the progress bar. Required for accessibility.
|
|
19
|
-
*/
|
|
20
|
-
label: string
|
|
21
|
-
/**
|
|
22
|
-
* The state of the progress bar.
|
|
23
|
-
*/
|
|
24
|
-
indeterminate?: never
|
|
25
|
-
/**
|
|
26
|
-
* The current value of the progress bar.
|
|
27
|
-
*/
|
|
28
|
-
now: number
|
|
29
|
-
}
|
|
30
|
-
export type IndeterminateProgressBarProps = {
|
|
31
|
-
/**
|
|
32
|
-
* A unique identifier for the progress bar. Required for accessibility.
|
|
33
|
-
*/
|
|
34
|
-
id: string
|
|
35
|
-
/**
|
|
36
|
-
* A description label for the progress bar. Required for accessibility.
|
|
37
|
-
*/
|
|
38
|
-
label: string
|
|
39
|
-
/**
|
|
40
|
-
* The state of the progress bar.
|
|
41
|
-
*/
|
|
42
|
-
indeterminate?: true
|
|
43
|
-
/**
|
|
44
|
-
* The current value of the progress bar.
|
|
45
|
-
*/
|
|
46
|
-
now?: never
|
|
47
|
-
}
|
|
48
|
-
export type ProgressBarProps = ProgressBarRootProps &
|
|
49
|
-
(NonIndeterminateProgressBarProps | IndeterminateProgressBarProps)
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* The ProgressBar component is used to display the progress of a task.
|
|
53
|
-
* @see https://cerberus.digitalu.design/react/progress-indicators
|
|
54
|
-
* @example
|
|
55
|
-
* ```tsx
|
|
56
|
-
* <ProgressBar value={75} />
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export function ProgressBar(props: ProgressBarProps) {
|
|
60
|
-
const { indeterminate, now, label, ...nativeProps } = props
|
|
61
|
-
|
|
62
|
-
const nowClamped = Math.min(100, Math.max(0, now || 0))
|
|
63
|
-
const width = {
|
|
64
|
-
width: indeterminate ? '50%' : `${nowClamped}%`,
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<ProgressBarRoot
|
|
69
|
-
{...nativeProps}
|
|
70
|
-
aria-label={label}
|
|
71
|
-
aria-valuenow={indeterminate ? 0 : nowClamped}
|
|
72
|
-
>
|
|
73
|
-
<ProgressBarBar
|
|
74
|
-
{...(indeterminate && { 'data-state': 'indeterminate' })}
|
|
75
|
-
data-complete={nowClamped === 100}
|
|
76
|
-
style={width}
|
|
77
|
-
/>
|
|
78
|
-
</ProgressBarRoot>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
RadioGroupRoot,
|
|
4
|
-
RadioGroupLabel,
|
|
5
|
-
RadioGroupIndicator,
|
|
6
|
-
RadioGroupItem,
|
|
7
|
-
RadioGroupItemText,
|
|
8
|
-
RadioGroupItemControl,
|
|
9
|
-
RadioGroupItemHiddenInput,
|
|
10
|
-
} from './primitives'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* This module contains the parts of the Radio parts.
|
|
14
|
-
* @module 'radio/parts'
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
interface RadioPartsValue {
|
|
18
|
-
/**
|
|
19
|
-
* The container of the field.
|
|
20
|
-
*/
|
|
21
|
-
Root: ElementType
|
|
22
|
-
/**
|
|
23
|
-
* The label of the field.
|
|
24
|
-
*/
|
|
25
|
-
Label: ElementType
|
|
26
|
-
/**
|
|
27
|
-
* The indicator that appears when a radio is checked.
|
|
28
|
-
*/
|
|
29
|
-
Indicator: ElementType
|
|
30
|
-
/**
|
|
31
|
-
* An individual radio item of the field.
|
|
32
|
-
*/
|
|
33
|
-
Item: ElementType
|
|
34
|
-
/**
|
|
35
|
-
* The text that labels a single radio of the field.
|
|
36
|
-
*/
|
|
37
|
-
ItemText: ElementType
|
|
38
|
-
/**
|
|
39
|
-
* The visual radio control of the field.
|
|
40
|
-
*/
|
|
41
|
-
ItemControl: ElementType
|
|
42
|
-
/**
|
|
43
|
-
* The native input for a radio item in the field.
|
|
44
|
-
*/
|
|
45
|
-
ItemHiddenInput: ElementType
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* An Object containing the parts of the Radio component. For users that
|
|
50
|
-
* prefer Object component syntax.
|
|
51
|
-
*
|
|
52
|
-
* @remarks
|
|
53
|
-
*
|
|
54
|
-
* When using object component syntax, you import the RadioParts object and
|
|
55
|
-
* the entire family of components vs. only what you use.
|
|
56
|
-
*/
|
|
57
|
-
export const RadioParts: RadioPartsValue = {
|
|
58
|
-
Root: RadioGroupRoot,
|
|
59
|
-
Label: RadioGroupLabel,
|
|
60
|
-
Indicator: RadioGroupIndicator,
|
|
61
|
-
Item: RadioGroupItem,
|
|
62
|
-
ItemText: RadioGroupItemText,
|
|
63
|
-
ItemControl: RadioGroupItemControl,
|
|
64
|
-
ItemHiddenInput: RadioGroupItemHiddenInput,
|
|
65
|
-
}
|