@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,77 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Checkbox,
|
|
3
|
-
type CheckboxControlProps as ArkCheckboxControlProps,
|
|
4
|
-
type CheckboxGroupProps as ArkCheckboxGroupProps,
|
|
5
|
-
type CheckboxIndicatorProps as ArkCheckboxIndicatorProps,
|
|
6
|
-
type CheckboxLabelProps as ArkCheckboxLabelProps,
|
|
7
|
-
type CheckboxRootProps as ArkCheckboxRootProps,
|
|
8
|
-
type CheckboxHiddenInputProps as ArkCheckboxHiddenInputProps,
|
|
9
|
-
} from '@ark-ui/react'
|
|
10
|
-
import { checkbox, type CheckboxVariantProps } from 'styled-system/recipes'
|
|
11
|
-
import {
|
|
12
|
-
createCerberusPrimitive,
|
|
13
|
-
type CerberusPrimitiveProps,
|
|
14
|
-
} from '../../system/index'
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This module contains the Checkbox primitives.
|
|
18
|
-
* @module 'react/checkbox'
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(checkbox)
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Checkbox Root component used to provide the context to all other checkbox
|
|
25
|
-
* primitives.
|
|
26
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
27
|
-
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
28
|
-
*/
|
|
29
|
-
export const CheckboxRoot = withSlotRecipe(Checkbox.Root, 'root')
|
|
30
|
-
export type CheckboxRootProps = CerberusPrimitiveProps<ArkCheckboxRootProps>
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Checkbox Label component used to display the label of the checkbox.
|
|
34
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
35
|
-
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
36
|
-
*/
|
|
37
|
-
export const CheckboxLabel = withSlotRecipe(Checkbox.Label, 'label')
|
|
38
|
-
export type CheckboxLabelProps = CerberusPrimitiveProps<
|
|
39
|
-
ArkCheckboxLabelProps & CheckboxVariantProps
|
|
40
|
-
>
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Checkbox Control component used to display the control of the checkbox.
|
|
44
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
45
|
-
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
46
|
-
*/
|
|
47
|
-
export const CheckboxControl = withSlotRecipe(Checkbox.Control, 'control')
|
|
48
|
-
export type CheckboxControlProps = CerberusPrimitiveProps<
|
|
49
|
-
ArkCheckboxControlProps & CheckboxVariantProps
|
|
50
|
-
>
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Checkbox Indicator component used to display the indicator of the checkbox.
|
|
54
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
55
|
-
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
56
|
-
*/
|
|
57
|
-
export const CheckboxIndicator = withSlotRecipe(Checkbox.Indicator, 'indicator')
|
|
58
|
-
export type CheckboxIndicatorProps =
|
|
59
|
-
CerberusPrimitiveProps<ArkCheckboxIndicatorProps>
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Checkbox HiddenInput component used to provide the native checkbox input.
|
|
63
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
64
|
-
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
65
|
-
*/
|
|
66
|
-
export const CheckboxHiddenInput = withNoRecipe(Checkbox.HiddenInput)
|
|
67
|
-
export type CheckboxHiddenInputProps =
|
|
68
|
-
CerberusPrimitiveProps<ArkCheckboxHiddenInputProps>
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Checkbox Group is used to group checkboxes together in a consistently styled
|
|
72
|
-
* way.
|
|
73
|
-
* @definition [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
|
|
74
|
-
* @definition [Primitive Docs](https://ark-ui.com/react/docs/components/checkbox)
|
|
75
|
-
*/
|
|
76
|
-
export const CheckboxGroup = withSlotRecipe(Checkbox.Group, 'group')
|
|
77
|
-
export type CheckboxGroupProps = CerberusPrimitiveProps<ArkCheckboxGroupProps>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
CircularProgressCircle,
|
|
4
|
-
CircularProgressCircleRange,
|
|
5
|
-
CircularProgressCircleTrack,
|
|
6
|
-
CircularProgressInfoGroup,
|
|
7
|
-
CircularProgressLabel,
|
|
8
|
-
CircularProgressRoot,
|
|
9
|
-
CircularProgressValueText,
|
|
10
|
-
type CircularProgressRootProps,
|
|
11
|
-
} from './primitives'
|
|
12
|
-
import { Show } from '../show/show'
|
|
13
|
-
|
|
14
|
-
export interface CircularProgressProps extends CircularProgressRootProps {
|
|
15
|
-
/**
|
|
16
|
-
* The background style of the CircularProgress
|
|
17
|
-
*/
|
|
18
|
-
bgStyle?: 'filled' | 'transparent'
|
|
19
|
-
/**
|
|
20
|
-
* The label for the circular progress.
|
|
21
|
-
* @default 'Done'
|
|
22
|
-
*/
|
|
23
|
-
label?: ReactNode
|
|
24
|
-
/**
|
|
25
|
-
* Whether to hide the value text inside the circular progress.
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
hideValueText?: boolean
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function CircularProgress(props: CircularProgressProps) {
|
|
32
|
-
const { label, hideValueText, ...rootProps } = props
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<CircularProgressRoot {...rootProps}>
|
|
36
|
-
<CircularProgressCircle>
|
|
37
|
-
<CircularProgressCircleTrack />
|
|
38
|
-
<CircularProgressCircleRange />
|
|
39
|
-
</CircularProgressCircle>
|
|
40
|
-
|
|
41
|
-
<CircularProgressInfoGroup>
|
|
42
|
-
<Show when={!hideValueText}>
|
|
43
|
-
<CircularProgressValueText />
|
|
44
|
-
</Show>
|
|
45
|
-
<CircularProgressLabel>{label ?? 'Done'}</CircularProgressLabel>
|
|
46
|
-
</CircularProgressInfoGroup>
|
|
47
|
-
</CircularProgressRoot>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Progress,
|
|
3
|
-
type ProgressRootProps,
|
|
4
|
-
type ProgressLabelProps,
|
|
5
|
-
type ProgressValueTextProps,
|
|
6
|
-
type ProgressCircleProps,
|
|
7
|
-
type ProgressCircleTrackProps,
|
|
8
|
-
type ProgressCircleRangeProps,
|
|
9
|
-
} from '@ark-ui/react/progress'
|
|
10
|
-
import { type HTMLArkProps } from '@ark-ui/react/factory'
|
|
11
|
-
import {
|
|
12
|
-
circularProgress,
|
|
13
|
-
type CircularProgressVariantProps,
|
|
14
|
-
} from 'styled-system/recipes'
|
|
15
|
-
import {
|
|
16
|
-
cerberus,
|
|
17
|
-
createCerberusPrimitive,
|
|
18
|
-
type CerberusPrimitiveProps,
|
|
19
|
-
} from '../../system/index'
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* This module contains the CircularProgress component primitives.
|
|
23
|
-
* @module @cerberus-design/react/components/circular-progress/primitives
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const { withSlotRecipe } = createCerberusPrimitive(circularProgress)
|
|
27
|
-
|
|
28
|
-
// Root
|
|
29
|
-
|
|
30
|
-
export type CircularProgressRootProps = CerberusPrimitiveProps<
|
|
31
|
-
ProgressRootProps & CircularProgressVariantProps
|
|
32
|
-
>
|
|
33
|
-
export const CircularProgressRoot = withSlotRecipe(Progress.Root, 'root')
|
|
34
|
-
|
|
35
|
-
// Label
|
|
36
|
-
|
|
37
|
-
export type CircularProgressLabelProps =
|
|
38
|
-
CerberusPrimitiveProps<ProgressLabelProps>
|
|
39
|
-
export const CircularProgressLabel = withSlotRecipe(Progress.Label, 'label')
|
|
40
|
-
|
|
41
|
-
// ValueText
|
|
42
|
-
|
|
43
|
-
export type CircularProgressValueTextProps =
|
|
44
|
-
CerberusPrimitiveProps<ProgressValueTextProps>
|
|
45
|
-
export const CircularProgressValueText = withSlotRecipe(
|
|
46
|
-
Progress.ValueText,
|
|
47
|
-
'valueText',
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
// Circle
|
|
51
|
-
|
|
52
|
-
export type CircularProgressCircleProps =
|
|
53
|
-
CerberusPrimitiveProps<ProgressCircleProps>
|
|
54
|
-
export const CircularProgressCircle = withSlotRecipe(Progress.Circle, 'circle')
|
|
55
|
-
|
|
56
|
-
// CircleTrack
|
|
57
|
-
|
|
58
|
-
export type CircularProgressCircleTrackProps =
|
|
59
|
-
CerberusPrimitiveProps<ProgressCircleTrackProps>
|
|
60
|
-
export const CircularProgressCircleTrack = withSlotRecipe(
|
|
61
|
-
Progress.CircleTrack,
|
|
62
|
-
'circleTrack',
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
// CircleRange
|
|
66
|
-
|
|
67
|
-
export type CircularProgressCircleRangeProps =
|
|
68
|
-
CerberusPrimitiveProps<ProgressCircleRangeProps>
|
|
69
|
-
export const CircularProgressCircleRange = withSlotRecipe(
|
|
70
|
-
Progress.CircleRange,
|
|
71
|
-
'circleRange',
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
// InfoGroup
|
|
75
|
-
|
|
76
|
-
export type CircularProgressInfoGroupProps = HTMLArkProps<'div'>
|
|
77
|
-
export const CircularProgressInfoGroup = withSlotRecipe(
|
|
78
|
-
cerberus.div,
|
|
79
|
-
'infoGroup',
|
|
80
|
-
)
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AnimatedCheckmarkIcon,
|
|
3
|
-
CopyIcon,
|
|
4
|
-
} from '../../config/icons/checkbox.icons'
|
|
5
|
-
import { ClipboardIndicator, type ClipboardIndicatorProps } from './primitives'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A simple abstraction around the `Clipboard.Indicator` component that provides
|
|
9
|
-
* default "Copy" and "Copied" icons.
|
|
10
|
-
*/
|
|
11
|
-
export function CopyIndicator(props: ClipboardIndicatorProps) {
|
|
12
|
-
return (
|
|
13
|
-
<ClipboardIndicator
|
|
14
|
-
copied={<AnimatedCheckmarkIcon />}
|
|
15
|
-
h="1em"
|
|
16
|
-
w="1em"
|
|
17
|
-
{...props}
|
|
18
|
-
>
|
|
19
|
-
<CopyIcon />
|
|
20
|
-
</ClipboardIndicator>
|
|
21
|
-
)
|
|
22
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ClipboardIndicator, type ClipboardIndicatorProps } from './primitives'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A simple abstraction around the `Clipboard.Indicator` component that provides
|
|
5
|
-
* default "Copy" and "Copied" text.
|
|
6
|
-
*/
|
|
7
|
-
export function CopyText(props: ClipboardIndicatorProps) {
|
|
8
|
-
return (
|
|
9
|
-
<ClipboardIndicator copied="Copied" {...props}>
|
|
10
|
-
Copy
|
|
11
|
-
</ClipboardIndicator>
|
|
12
|
-
)
|
|
13
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
ClipboardRoot,
|
|
4
|
-
ClipboardLabel,
|
|
5
|
-
ClipboardControl,
|
|
6
|
-
ClipboardContext,
|
|
7
|
-
ClipboardInput,
|
|
8
|
-
} from './primitives'
|
|
9
|
-
import { CopyText } from './copy-text'
|
|
10
|
-
import { CopyIndicator } from './copy-indicator'
|
|
11
|
-
import { TriggerWithTooltip } from './trigger'
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* This module contains the parts of the Clipboard component.
|
|
15
|
-
* @module 'clipboard/parts'
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
interface ClipboardPartsValue {
|
|
19
|
-
/**
|
|
20
|
-
* The root context provider of the clipboard.
|
|
21
|
-
*/
|
|
22
|
-
Root: ElementType
|
|
23
|
-
/**
|
|
24
|
-
* The label of the clipboard.
|
|
25
|
-
*/
|
|
26
|
-
Label: ElementType
|
|
27
|
-
/**
|
|
28
|
-
* The control of the clipboard.
|
|
29
|
-
*/
|
|
30
|
-
Control: ElementType
|
|
31
|
-
/**
|
|
32
|
-
* The input of the clipboard.
|
|
33
|
-
*/
|
|
34
|
-
Input: ElementType
|
|
35
|
-
/**
|
|
36
|
-
* The raw context of the clipboard. Useful for obtaining the context state
|
|
37
|
-
* within the hierarchy of the clipboard component.
|
|
38
|
-
*/
|
|
39
|
-
Context: ElementType
|
|
40
|
-
/**
|
|
41
|
-
* The trigger of the clipboard.
|
|
42
|
-
*/
|
|
43
|
-
Trigger: ElementType
|
|
44
|
-
/**
|
|
45
|
-
* A simple abstraction around the `Clipboard.Indicator` component that
|
|
46
|
-
* provides default "Copy" and "Copied" icons.
|
|
47
|
-
*/
|
|
48
|
-
Indicator: ElementType
|
|
49
|
-
/**
|
|
50
|
-
* A simple abstraction around the `Clipboard.Indicator` component that
|
|
51
|
-
* provides default "Copy" and "Copied" text.
|
|
52
|
-
*/
|
|
53
|
-
CopyText: ElementType
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* An Object containing the parts of the Clipboard component. For users that
|
|
58
|
-
* prefer Object component syntax.
|
|
59
|
-
*
|
|
60
|
-
* @remarks
|
|
61
|
-
*
|
|
62
|
-
* When using object component syntax, you import the Clipboard parts object and
|
|
63
|
-
* the entire family of components versus only what you use.
|
|
64
|
-
*/
|
|
65
|
-
export const Clipboard: ClipboardPartsValue = {
|
|
66
|
-
Root: ClipboardRoot,
|
|
67
|
-
Label: ClipboardLabel,
|
|
68
|
-
Control: ClipboardControl,
|
|
69
|
-
Context: ClipboardContext,
|
|
70
|
-
Input: ClipboardInput,
|
|
71
|
-
Trigger: TriggerWithTooltip,
|
|
72
|
-
Indicator: CopyIndicator,
|
|
73
|
-
CopyText: CopyText,
|
|
74
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Clipboard,
|
|
3
|
-
type ClipboardContextProps as ArkContextProps,
|
|
4
|
-
type ClipboardRootProps as ArkRootProps,
|
|
5
|
-
type ClipboardLabelProps as ArkLabelProps,
|
|
6
|
-
type ClipboardControlProps as ArkControlProps,
|
|
7
|
-
type ClipboardInputProps as ArkInputProps,
|
|
8
|
-
type ClipboardTriggerProps as ArkTriggerProps,
|
|
9
|
-
type ClipboardIndicatorProps as ArkIndicatorProps,
|
|
10
|
-
} from '@ark-ui/react/clipboard'
|
|
11
|
-
import {
|
|
12
|
-
createCerberusPrimitive,
|
|
13
|
-
type CerberusPrimitiveProps,
|
|
14
|
-
} from '../../system/index'
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* This module contains the Clipboard component primitives.
|
|
18
|
-
* @module @cerberus-design/react/components/clipboard/primitives
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const { withNoRecipe } = createCerberusPrimitive()
|
|
22
|
-
|
|
23
|
-
// Context
|
|
24
|
-
|
|
25
|
-
export type ClipboardContextProps = ArkContextProps
|
|
26
|
-
export const ClipboardContext = Clipboard.Context
|
|
27
|
-
|
|
28
|
-
// Root
|
|
29
|
-
|
|
30
|
-
export type ClipboardRootProps = CerberusPrimitiveProps<ArkRootProps>
|
|
31
|
-
export const ClipboardRoot = withNoRecipe(Clipboard.Root)
|
|
32
|
-
|
|
33
|
-
// Label
|
|
34
|
-
|
|
35
|
-
export type ClipboardLabelProps = CerberusPrimitiveProps<ArkLabelProps>
|
|
36
|
-
export const ClipboardLabel = withNoRecipe(Clipboard.Label)
|
|
37
|
-
|
|
38
|
-
// Control
|
|
39
|
-
|
|
40
|
-
export type ClipboardControlProps = CerberusPrimitiveProps<ArkControlProps>
|
|
41
|
-
export const ClipboardControl = withNoRecipe(Clipboard.Control)
|
|
42
|
-
|
|
43
|
-
// Input
|
|
44
|
-
|
|
45
|
-
export type ClipboardInputProps = CerberusPrimitiveProps<ArkInputProps>
|
|
46
|
-
export const ClipboardInput = withNoRecipe(Clipboard.Input)
|
|
47
|
-
|
|
48
|
-
// Trigger
|
|
49
|
-
|
|
50
|
-
export type ClipboardTriggerProps = CerberusPrimitiveProps<ArkTriggerProps>
|
|
51
|
-
export const ClipboardTrigger = withNoRecipe(Clipboard.Trigger)
|
|
52
|
-
|
|
53
|
-
// Indicator
|
|
54
|
-
|
|
55
|
-
export type ClipboardIndicatorProps = CerberusPrimitiveProps<ArkIndicatorProps>
|
|
56
|
-
export const ClipboardIndicator = withNoRecipe(Clipboard.Indicator)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Tooltip } from '../tooltip/index'
|
|
2
|
-
import { ClipboardTrigger, type ClipboardTriggerProps } from './primitives'
|
|
3
|
-
import { CopyText } from './copy-text'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A Clipboard trigger wrapped with a Tooltip that displays the copy status.
|
|
7
|
-
*/
|
|
8
|
-
export function TriggerWithTooltip(props: ClipboardTriggerProps) {
|
|
9
|
-
return (
|
|
10
|
-
<Tooltip closeOnClick={false} content={<CopyText />} asChild>
|
|
11
|
-
<ClipboardTrigger {...props} />
|
|
12
|
-
</Tooltip>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { ElementType } from 'react'
|
|
2
|
-
import {
|
|
3
|
-
CollapsibleRootProvider,
|
|
4
|
-
CollapsibleRoot,
|
|
5
|
-
CollapsibleTrigger,
|
|
6
|
-
CollapsibleIndicator,
|
|
7
|
-
CollapsibleContent,
|
|
8
|
-
} from './primitives'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* This module contains the parts of the Collapsible component.
|
|
12
|
-
* @module 'collapsible/parts'
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
interface CollapsiblePartsValue {
|
|
16
|
-
/**
|
|
17
|
-
* The low-level context provider for advanced scenarios
|
|
18
|
-
*/
|
|
19
|
-
RootProvider: ElementType
|
|
20
|
-
/**
|
|
21
|
-
* The context provider of the collapsible.
|
|
22
|
-
*/
|
|
23
|
-
Root: ElementType
|
|
24
|
-
/**
|
|
25
|
-
* The button that toggles the collapsible.
|
|
26
|
-
*/
|
|
27
|
-
Trigger: ElementType
|
|
28
|
-
/**
|
|
29
|
-
* The indicator that shows the state of the collapsible.
|
|
30
|
-
*/
|
|
31
|
-
Indicator: ElementType
|
|
32
|
-
/**
|
|
33
|
-
* The content of the collapsible.
|
|
34
|
-
*/
|
|
35
|
-
Content: ElementType
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* An Object containing the parts of the Collapsible component. For users that
|
|
40
|
-
* prefer Object component syntax.
|
|
41
|
-
*
|
|
42
|
-
* @remarks
|
|
43
|
-
*
|
|
44
|
-
* When using object component syntax, you import the CollapsibleParts object and
|
|
45
|
-
* the entire family of components vs. only what you use.
|
|
46
|
-
*/
|
|
47
|
-
export const Collapsible: CollapsiblePartsValue = {
|
|
48
|
-
RootProvider: CollapsibleRootProvider,
|
|
49
|
-
Root: CollapsibleRoot,
|
|
50
|
-
Trigger: CollapsibleTrigger,
|
|
51
|
-
Indicator: CollapsibleIndicator,
|
|
52
|
-
Content: CollapsibleContent,
|
|
53
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Collapsible,
|
|
3
|
-
type CollapsibleRootProviderProps as ArkCollapsibleProviderProps,
|
|
4
|
-
type CollapsibleRootProps as ArkCollapsibleRootProps,
|
|
5
|
-
type CollapsibleTriggerProps as ArkCollapsibleTriggerProps,
|
|
6
|
-
type CollapsibleIndicatorProps as ArkCollapsibleIndicatorProps,
|
|
7
|
-
type CollapsibleContentProps as ArkCollapsibleContentProps,
|
|
8
|
-
} from '@ark-ui/react/collapsible'
|
|
9
|
-
import {
|
|
10
|
-
collapsible,
|
|
11
|
-
type CollapsibleVariantProps,
|
|
12
|
-
} from 'styled-system/recipes'
|
|
13
|
-
import {
|
|
14
|
-
createCerberusPrimitive,
|
|
15
|
-
type CerberusPrimitiveProps,
|
|
16
|
-
} from '../../system/index'
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* This module contains all the primitives of the Collapsible component.
|
|
20
|
-
* @module 'collapsible'
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(collapsible)
|
|
24
|
-
|
|
25
|
-
// Provider
|
|
26
|
-
|
|
27
|
-
export type CollapsibleProviderProps = ArkCollapsibleProviderProps
|
|
28
|
-
export const CollapsibleRootProvider = withNoRecipe(Collapsible.RootProvider)
|
|
29
|
-
|
|
30
|
-
// Root
|
|
31
|
-
|
|
32
|
-
export type CollapsibleRootProps =
|
|
33
|
-
CerberusPrimitiveProps<ArkCollapsibleRootProps>
|
|
34
|
-
export const CollapsibleRoot = withNoRecipe(Collapsible.Root)
|
|
35
|
-
|
|
36
|
-
// Trigger
|
|
37
|
-
|
|
38
|
-
export type CollapsibleTriggerProps =
|
|
39
|
-
CerberusPrimitiveProps<ArkCollapsibleTriggerProps>
|
|
40
|
-
export const CollapsibleTrigger = withNoRecipe(Collapsible.Trigger)
|
|
41
|
-
|
|
42
|
-
// Indicator
|
|
43
|
-
|
|
44
|
-
export type CollapsibleIndicatorProps =
|
|
45
|
-
CerberusPrimitiveProps<ArkCollapsibleIndicatorProps>
|
|
46
|
-
export const CollapsibleIndicator = withNoRecipe(Collapsible.Indicator)
|
|
47
|
-
|
|
48
|
-
// Content
|
|
49
|
-
|
|
50
|
-
export type CollapsibleContentProps = CerberusPrimitiveProps<
|
|
51
|
-
ArkCollapsibleContentProps & CollapsibleVariantProps
|
|
52
|
-
>
|
|
53
|
-
export const CollapsibleContent = withSlotRecipe(Collapsible.Content, 'content')
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import type { ComboboxRootProps } from '@ark-ui/react/combobox'
|
|
4
|
-
import type { ComboboxVariantProps } from 'styled-system/recipes'
|
|
5
|
-
import { useCerberusContext } from '../../context/cerberus'
|
|
6
|
-
import { splitProps } from '../../utils/index'
|
|
7
|
-
import type { SelectCollectionItem } from '../select/select'
|
|
8
|
-
import { type FieldInputElProps } from '../field/index'
|
|
9
|
-
import { Show } from '../show/index'
|
|
10
|
-
import { ComboboxParts } from './parts'
|
|
11
|
-
import { ComboboxStartIcon } from './primitives'
|
|
12
|
-
|
|
13
|
-
export interface ComboboxProps
|
|
14
|
-
extends ComboboxRootProps<SelectCollectionItem>, ComboboxVariantProps {
|
|
15
|
-
/**
|
|
16
|
-
* The label that appears above the combobox input.
|
|
17
|
-
*/
|
|
18
|
-
label?: string
|
|
19
|
-
/**
|
|
20
|
-
* The icon that appears at the start of the combobox input.
|
|
21
|
-
*/
|
|
22
|
-
startIcon?: FieldInputElProps['startIcon']
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function Combobox(props: ComboboxProps) {
|
|
26
|
-
const [{ startIcon, label, ...elProps }, rootProps] = splitProps(props, [
|
|
27
|
-
'label',
|
|
28
|
-
'children',
|
|
29
|
-
'startIcon',
|
|
30
|
-
])
|
|
31
|
-
|
|
32
|
-
const { icons } = useCerberusContext()
|
|
33
|
-
const { selectArrow: SelectArrow, close: CloseIcon } = icons
|
|
34
|
-
|
|
35
|
-
const hasStartIcon = Boolean(startIcon)
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<ComboboxParts.Root {...rootProps}>
|
|
39
|
-
<Show when={label}>
|
|
40
|
-
<ComboboxParts.Label>{label}</ComboboxParts.Label>
|
|
41
|
-
</Show>
|
|
42
|
-
|
|
43
|
-
<ComboboxParts.Control>
|
|
44
|
-
<Show when={hasStartIcon}>
|
|
45
|
-
<ComboboxStartIcon>{startIcon}</ComboboxStartIcon>
|
|
46
|
-
</Show>
|
|
47
|
-
|
|
48
|
-
<ComboboxParts.Input
|
|
49
|
-
{...(hasStartIcon && { 'data-has': 'start-indicator' })}
|
|
50
|
-
/>
|
|
51
|
-
|
|
52
|
-
<ComboboxParts.ClearTrigger>
|
|
53
|
-
<CloseIcon />
|
|
54
|
-
</ComboboxParts.ClearTrigger>
|
|
55
|
-
<ComboboxParts.Trigger>
|
|
56
|
-
<SelectArrow />
|
|
57
|
-
</ComboboxParts.Trigger>
|
|
58
|
-
</ComboboxParts.Control>
|
|
59
|
-
|
|
60
|
-
<ComboboxParts.Positioner>
|
|
61
|
-
<ComboboxParts.Content size={rootProps.size}>
|
|
62
|
-
{elProps.children}
|
|
63
|
-
</ComboboxParts.Content>
|
|
64
|
-
</ComboboxParts.Positioner>
|
|
65
|
-
</ComboboxParts.Root>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ComboboxItemGroupProps } from '@ark-ui/react/combobox'
|
|
2
|
-
import { ComboboxParts } from './parts'
|
|
3
|
-
|
|
4
|
-
export interface ComboItemGroupProps extends ComboboxItemGroupProps {
|
|
5
|
-
/**
|
|
6
|
-
* The label that appears for the combobox item group.
|
|
7
|
-
*/
|
|
8
|
-
label?: string
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function ComboItemGroup(props: ComboItemGroupProps) {
|
|
12
|
-
const { label, children, ...groupProps } = props
|
|
13
|
-
return (
|
|
14
|
-
<ComboboxParts.ItemGroup {...groupProps}>
|
|
15
|
-
<ComboboxParts.ItemGroupLabel>{label}</ComboboxParts.ItemGroupLabel>
|
|
16
|
-
{children}
|
|
17
|
-
</ComboboxParts.ItemGroup>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import type { ComboboxItemProps } from '@ark-ui/react'
|
|
4
|
-
import { useCerberusContext } from '../../context/cerberus'
|
|
5
|
-
import { ComboboxParts } from './parts'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This module contains the ComboboxItemWithIndicator component.
|
|
9
|
-
* @module 'combobox/item'
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* An abstraction of the ComboboxItem component that includes an indicator.
|
|
14
|
-
* @description [Combobox Docs](https://cerberus.digitalu.design/react/combobox)
|
|
15
|
-
* @description [Ark Docs](https://ark-ui.com/react/docs/components/combobox)
|
|
16
|
-
*/
|
|
17
|
-
export function ComboItemWithIndicator(props: ComboboxItemProps) {
|
|
18
|
-
const { icons } = useCerberusContext()
|
|
19
|
-
const { selectChecked: CheckedIcon } = icons
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<ComboboxParts.Item {...props}>
|
|
23
|
-
<ComboboxParts.ItemIndicator>
|
|
24
|
-
<CheckedIcon />
|
|
25
|
-
</ComboboxParts.ItemIndicator>
|
|
26
|
-
|
|
27
|
-
{props.children}
|
|
28
|
-
</ComboboxParts.Item>
|
|
29
|
-
)
|
|
30
|
-
}
|