@cerberus-design/react 1.0.0-rc.5 → 1.0.0-rc.7

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.
Files changed (210) hide show
  1. package/dist/panda.buildinfo.json +349 -0
  2. package/package.json +8 -5
  3. package/src/components/AnimatingUploadIcon.tsx +0 -83
  4. package/src/components/accordion/index.ts +0 -3
  5. package/src/components/accordion/item-group.tsx +0 -70
  6. package/src/components/accordion/item-indicator.tsx +0 -27
  7. package/src/components/accordion/parts.ts +0 -53
  8. package/src/components/accordion/primitives.tsx +0 -86
  9. package/src/components/admonition/admonition.tsx +0 -62
  10. package/src/components/admonition/index.ts +0 -3
  11. package/src/components/admonition/match-avatar.tsx +0 -52
  12. package/src/components/admonition/parts.ts +0 -53
  13. package/src/components/admonition/primitives.tsx +0 -77
  14. package/src/components/avatar/avatar.tsx +0 -51
  15. package/src/components/avatar/index.ts +0 -5
  16. package/src/components/avatar/parts.ts +0 -37
  17. package/src/components/avatar/primitives.tsx +0 -38
  18. package/src/components/button/button.tsx +0 -62
  19. package/src/components/button/index.ts +0 -3
  20. package/src/components/button/parts.ts +0 -32
  21. package/src/components/button/primitives.tsx +0 -41
  22. package/src/components/carousel/carousel.tsx +0 -55
  23. package/src/components/carousel/index.ts +0 -3
  24. package/src/components/carousel/parts.ts +0 -71
  25. package/src/components/carousel/primitives.ts +0 -58
  26. package/src/components/checkbox/checkbox-icon.tsx +0 -39
  27. package/src/components/checkbox/checkbox.tsx +0 -42
  28. package/src/components/checkbox/index.ts +0 -3
  29. package/src/components/checkbox/parts.ts +0 -59
  30. package/src/components/checkbox/primitives.tsx +0 -77
  31. package/src/components/circular-progress/circular-progress.tsx +0 -49
  32. package/src/components/circular-progress/index.ts +0 -2
  33. package/src/components/circular-progress/primitives.ts +0 -80
  34. package/src/components/clipboard/copy-indicator.tsx +0 -22
  35. package/src/components/clipboard/copy-text.tsx +0 -13
  36. package/src/components/clipboard/index.ts +0 -2
  37. package/src/components/clipboard/parts.ts +0 -74
  38. package/src/components/clipboard/primitives.ts +0 -56
  39. package/src/components/clipboard/trigger.tsx +0 -14
  40. package/src/components/collapsible/index.ts +0 -2
  41. package/src/components/collapsible/parts.ts +0 -53
  42. package/src/components/collapsible/primitives.tsx +0 -53
  43. package/src/components/combobox/combobox.tsx +0 -67
  44. package/src/components/combobox/index.ts +0 -6
  45. package/src/components/combobox/item-group.tsx +0 -19
  46. package/src/components/combobox/item.tsx +0 -30
  47. package/src/components/combobox/parts.ts +0 -101
  48. package/src/components/combobox/primitives.tsx +0 -146
  49. package/src/components/combobox/use-stateful-collection.ts +0 -65
  50. package/src/components/cta-dialog/context.tsx +0 -38
  51. package/src/components/cta-dialog/index.ts +0 -2
  52. package/src/components/cta-dialog/provider.tsx +0 -186
  53. package/src/components/cta-dialog/trigger-item.tsx +0 -54
  54. package/src/components/cta-dialog/utils.ts +0 -57
  55. package/src/components/date-picker/calendar.tsx +0 -47
  56. package/src/components/date-picker/content.tsx +0 -21
  57. package/src/components/date-picker/date-picker.tsx +0 -20
  58. package/src/components/date-picker/day-view.tsx +0 -82
  59. package/src/components/date-picker/index.ts +0 -16
  60. package/src/components/date-picker/input.tsx +0 -26
  61. package/src/components/date-picker/month-view.tsx +0 -49
  62. package/src/components/date-picker/parts.ts +0 -167
  63. package/src/components/date-picker/primitives.tsx +0 -235
  64. package/src/components/date-picker/range-input.tsx +0 -38
  65. package/src/components/date-picker/trigger.tsx +0 -28
  66. package/src/components/date-picker/view-control-group.tsx +0 -54
  67. package/src/components/date-picker/year-view.tsx +0 -47
  68. package/src/components/dialog/close-icon-trigger.tsx +0 -36
  69. package/src/components/dialog/dialog.tsx +0 -42
  70. package/src/components/dialog/index.ts +0 -8
  71. package/src/components/dialog/parts.ts +0 -71
  72. package/src/components/dialog/primitives.tsx +0 -83
  73. package/src/components/feature-flag/feature-flag.tsx +0 -21
  74. package/src/components/feature-flag/index.ts +0 -1
  75. package/src/components/field/error-text.tsx +0 -19
  76. package/src/components/field/field.tsx +0 -93
  77. package/src/components/field/helper-text.tsx +0 -20
  78. package/src/components/field/index.ts +0 -7
  79. package/src/components/field/input.tsx +0 -47
  80. package/src/components/field/parts.ts +0 -77
  81. package/src/components/field/primitives.tsx +0 -135
  82. package/src/components/field/start-indicator.tsx +0 -23
  83. package/src/components/field/status-indicator.tsx +0 -58
  84. package/src/components/fieldset/fieldset.tsx +0 -54
  85. package/src/components/fieldset/index.ts +0 -3
  86. package/src/components/fieldset/parts.ts +0 -47
  87. package/src/components/fieldset/primitives.tsx +0 -48
  88. package/src/components/file-upload/file-status.tsx +0 -271
  89. package/src/components/file-upload/file-uploader.tsx +0 -60
  90. package/src/components/file-upload/helpers.ts +0 -28
  91. package/src/components/file-upload/img-preview.tsx +0 -41
  92. package/src/components/file-upload/index.ts +0 -6
  93. package/src/components/file-upload/parts.tsx +0 -132
  94. package/src/components/file-upload/primitives.ts +0 -161
  95. package/src/components/file-upload/utils.ts +0 -20
  96. package/src/components/for/for.tsx +0 -38
  97. package/src/components/for/index.ts +0 -1
  98. package/src/components/group/index.ts +0 -1
  99. package/src/components/group/primitives.ts +0 -7
  100. package/src/components/icon-button/button.tsx +0 -41
  101. package/src/components/icon-button/index.tsx +0 -2
  102. package/src/components/icon-button/primitives.ts +0 -19
  103. package/src/components/menu/index.ts +0 -2
  104. package/src/components/menu/menu.tsx +0 -144
  105. package/src/components/menu/primitives.ts +0 -84
  106. package/src/components/notifications/center.tsx +0 -88
  107. package/src/components/notifications/close-trigger.tsx +0 -21
  108. package/src/components/notifications/index.ts +0 -5
  109. package/src/components/notifications/match-icon.tsx +0 -41
  110. package/src/components/notifications/parts.ts +0 -53
  111. package/src/components/notifications/primitives.tsx +0 -66
  112. package/src/components/notifications/toaster.ts +0 -13
  113. package/src/components/notifications/types.ts +0 -44
  114. package/src/components/number-input/decrement-trigger.tsx +0 -16
  115. package/src/components/number-input/increment-trigger.tsx +0 -16
  116. package/src/components/number-input/index.ts +0 -3
  117. package/src/components/number-input/input.tsx +0 -33
  118. package/src/components/number-input/parts.ts +0 -65
  119. package/src/components/number-input/primitives.tsx +0 -74
  120. package/src/components/pagination/compact.tsx +0 -25
  121. package/src/components/pagination/index.ts +0 -6
  122. package/src/components/pagination/item-list.tsx +0 -34
  123. package/src/components/pagination/item.tsx +0 -6
  124. package/src/components/pagination/pagination.tsx +0 -53
  125. package/src/components/pagination/parts.ts +0 -65
  126. package/src/components/pagination/primitives.ts +0 -41
  127. package/src/components/pagination/triggers.tsx +0 -55
  128. package/src/components/pin-input/index.ts +0 -3
  129. package/src/components/pin-input/input.tsx +0 -22
  130. package/src/components/pin-input/parts.ts +0 -53
  131. package/src/components/pin-input/primitives.tsx +0 -46
  132. package/src/components/portal/index.ts +0 -1
  133. package/src/components/portal/portal.tsx +0 -28
  134. package/src/components/progress/index.ts +0 -2
  135. package/src/components/progress/primitives.ts +0 -37
  136. package/src/components/progress/progress-bar.tsx +0 -80
  137. package/src/components/radio/index.ts +0 -3
  138. package/src/components/radio/parts.ts +0 -65
  139. package/src/components/radio/primitives.tsx +0 -92
  140. package/src/components/radio/radio.tsx +0 -35
  141. package/src/components/rating/index.ts +0 -8
  142. package/src/components/rating/parts.tsx +0 -65
  143. package/src/components/rating/primitives.tsx +0 -64
  144. package/src/components/rating/rating.tsx +0 -75
  145. package/src/components/select/index.ts +0 -5
  146. package/src/components/select/option-group.tsx +0 -32
  147. package/src/components/select/option.tsx +0 -42
  148. package/src/components/select/parts.ts +0 -113
  149. package/src/components/select/primitives.tsx +0 -147
  150. package/src/components/select/select.tsx +0 -110
  151. package/src/components/show/index.ts +0 -1
  152. package/src/components/show/show.tsx +0 -48
  153. package/src/components/spinner/index.ts +0 -1
  154. package/src/components/spinner/spinner.tsx +0 -81
  155. package/src/components/split-button/button.tsx +0 -63
  156. package/src/components/split-button/index.tsx +0 -1
  157. package/src/components/switch/index.ts +0 -3
  158. package/src/components/switch/parts.ts +0 -53
  159. package/src/components/switch/primitives.tsx +0 -51
  160. package/src/components/switch/switch-indicator.tsx +0 -9
  161. package/src/components/switch/switch.tsx +0 -27
  162. package/src/components/table/index.ts +0 -3
  163. package/src/components/table/parts.ts +0 -83
  164. package/src/components/table/primitives.tsx +0 -115
  165. package/src/components/table/table.tsx +0 -73
  166. package/src/components/tabs/index.ts +0 -3
  167. package/src/components/tabs/parts.ts +0 -53
  168. package/src/components/tabs/primitives.tsx +0 -47
  169. package/src/components/tabs/tabs.tsx +0 -48
  170. package/src/components/tag/closable.tsx +0 -47
  171. package/src/components/tag/index.ts +0 -2
  172. package/src/components/tag/primitives.ts +0 -19
  173. package/src/components/tag/tag.tsx +0 -39
  174. package/src/components/text/index.ts +0 -1
  175. package/src/components/text/text.tsx +0 -55
  176. package/src/components/theme/index.ts +0 -1
  177. package/src/components/theme/theme.tsx +0 -34
  178. package/src/components/toggle/index.ts +0 -2
  179. package/src/components/toggle/parts.ts +0 -32
  180. package/src/components/toggle/primitives.tsx +0 -27
  181. package/src/components/tooltip/index.ts +0 -3
  182. package/src/components/tooltip/parts.ts +0 -59
  183. package/src/components/tooltip/primitives.ts +0 -56
  184. package/src/components/tooltip/tooltip.tsx +0 -46
  185. package/src/config/defineIcons.ts +0 -24
  186. package/src/config/icons/checkbox.icons.tsx +0 -98
  187. package/src/config/icons/default.ts +0 -69
  188. package/src/config/icons/pinned.icons.tsx +0 -31
  189. package/src/config/icons/sort.icons.tsx +0 -19
  190. package/src/config/index.ts +0 -41
  191. package/src/config/types.ts +0 -53
  192. package/src/context/cerberus.tsx +0 -53
  193. package/src/context/confirm-modal.tsx +0 -276
  194. package/src/context/feature-flags.tsx +0 -63
  195. package/src/context/field.tsx +0 -70
  196. package/src/context/navMenu.tsx +0 -89
  197. package/src/context/prompt-modal.tsx +0 -315
  198. package/src/context/theme.tsx +0 -83
  199. package/src/hooks/useModal.ts +0 -63
  200. package/src/hooks/useRootColors.ts +0 -72
  201. package/src/hooks/useTheme.ts +0 -121
  202. package/src/index.client.ts +0 -30
  203. package/src/index.ts +0 -76
  204. package/src/system/factory.ts +0 -32
  205. package/src/system/index.ts +0 -47
  206. package/src/system/primitive-factory.tsx +0 -180
  207. package/src/system/types.ts +0 -88
  208. package/src/types.ts +0 -23
  209. package/src/utils/index.ts +0 -51
  210. package/src/utils/localStorage.ts +0 -28
@@ -1,71 +0,0 @@
1
- import type { ElementType } from 'react'
2
- import {
3
- CarouselRoot,
4
- CarouselControl,
5
- CarouselPrevTrigger,
6
- CarouselNextTrigger,
7
- CarouselIndicatorGroup,
8
- CarouselIndicator,
9
- CarouselItemGroup,
10
- CarouselItem,
11
- } from './primitives'
12
-
13
- /**
14
- * This module contains the parts of the Carousel component.
15
- * @module 'carousel/parts'
16
- */
17
-
18
- interface CarouselPartsValue {
19
- /**
20
- * The context provider of the carousel.
21
- */
22
- Root: ElementType
23
- /**
24
- * The control of the carousel.
25
- */
26
- Control: ElementType
27
- /**
28
- * The previous trigger of the carousel.
29
- */
30
- PrevTrigger: ElementType
31
- /**
32
- * The next trigger of the carousel.
33
- */
34
- NextTrigger: ElementType
35
- /**
36
- * The indicator group of the carousel.
37
- */
38
- IndicatorGroup: ElementType
39
- /**
40
- * The indicator of the carousel.
41
- */
42
- Indicator: ElementType
43
- /**
44
- * The item group of the carousel.
45
- */
46
- ItemGroup: ElementType
47
- /**
48
- * The item of the carousel.
49
- */
50
- Item: ElementType
51
- }
52
-
53
- /**
54
- * An Object containing the parts of the Button component. For users that
55
- * prefer Object component syntax.
56
- *
57
- * @remarks
58
- *
59
- * When using object component syntax, you import the CarouselParts object and
60
- * the entire family of components vs. only what you use.
61
- */
62
- export const CarouselParts: CarouselPartsValue = {
63
- Root: CarouselRoot,
64
- Control: CarouselControl,
65
- PrevTrigger: CarouselPrevTrigger,
66
- NextTrigger: CarouselNextTrigger,
67
- IndicatorGroup: CarouselIndicatorGroup,
68
- Indicator: CarouselIndicator,
69
- ItemGroup: CarouselItemGroup,
70
- Item: CarouselItem,
71
- }
@@ -1,58 +0,0 @@
1
- import {
2
- Carousel,
3
- type CarouselRootProps as ArkRootProps,
4
- type CarouselControlProps as ArkControlProps,
5
- type CarouselPrevTriggerProps as ArkPrevTriggerProps,
6
- type CarouselNextTriggerProps as ArkNextTriggerProps,
7
- type CarouselIndicatorGroupProps as ArkIndicatorGroupProps,
8
- type CarouselIndicatorProps as ArkIndicatorProps,
9
- type CarouselItemGroupProps as ArkItemGroupProps,
10
- type CarouselItemProps as ArkItemProps,
11
- } from '@ark-ui/react/carousel'
12
- import { carousel, type CarouselVariantProps } from 'styled-system/recipes'
13
- import { createCerberusPrimitive } from '../../system/index'
14
-
15
- /**
16
- * This module contains the carousel primitives.
17
- * @module carousel/primitives
18
- */
19
-
20
- const { withSlotRecipe } = createCerberusPrimitive(carousel)
21
-
22
- // Primitives
23
-
24
- export type CarouselRootProps = CarouselVariantProps & ArkRootProps
25
- export const CarouselRoot = withSlotRecipe(Carousel.Root, 'root')
26
-
27
- export type CarouselControlProps = CarouselVariantProps & ArkControlProps
28
- export const CarouselControl = withSlotRecipe(Carousel.Control, 'control')
29
-
30
- export type CarouselPrevTriggerProps = CarouselVariantProps &
31
- ArkPrevTriggerProps
32
- export const CarouselPrevTrigger = withSlotRecipe(
33
- Carousel.PrevTrigger,
34
- 'prevTrigger',
35
- )
36
-
37
- export type CarouselNextTriggerProps = CarouselVariantProps &
38
- ArkNextTriggerProps
39
- export const CarouselNextTrigger = withSlotRecipe(
40
- Carousel.NextTrigger,
41
- 'nextTrigger',
42
- )
43
-
44
- export type CarouselIndicatorGroupProps = CarouselVariantProps &
45
- ArkIndicatorGroupProps
46
- export const CarouselIndicatorGroup = withSlotRecipe(
47
- Carousel.IndicatorGroup,
48
- 'indicatorGroup',
49
- )
50
-
51
- export type CarouselIndicatorProps = CarouselVariantProps & ArkIndicatorProps
52
- export const CarouselIndicator = withSlotRecipe(Carousel.Indicator, 'indicator')
53
-
54
- export type CarouselItemGroupProps = CarouselVariantProps & ArkItemGroupProps
55
- export const CarouselItemGroup = withSlotRecipe(Carousel.ItemGroup, 'itemGroup')
56
-
57
- export type CarouselItemProps = CarouselVariantProps & ArkItemProps
58
- export const CarouselItem = withSlotRecipe(Carousel.Item, 'item')
@@ -1,39 +0,0 @@
1
- 'use client'
2
-
3
- import { useCerberusContext } from '../../context/cerberus'
4
- import { Show } from '../show/index'
5
- import { CheckboxParts } from './parts'
6
-
7
- /**
8
- * This module contains the Checkbox Icon component.
9
- * @module
10
- */
11
-
12
- interface CheckboxIconProps {
13
- indeterminate?: boolean
14
- }
15
-
16
- /**
17
- * Checkbox component
18
- * @definition [ARIA Target Size](https://www.w3.org/WAI/WCAG21/Understanding/target-size.html#:~:text=Understanding%20SC%202.5.,%3ATarget%20Size%20(Level%20AAA)&text=The%20size%20of%20the%20target,Equivalent)
19
- * @definition [ARIA Forms](https://www.a11yproject.com/checklist/#forms)
20
- * @see https://cerberus.digitalu.design/react/checkbox
21
- * @example
22
- * ```tsx
23
- * <Field>
24
- * <Checkbox id="legal" checked={checked.legal} onChange={handleChange} />
25
- * </Field>
26
- * ```
27
- */
28
- export function CheckboxIcon(props: CheckboxIconProps) {
29
- const { icons } = useCerberusContext()
30
- const { checkbox: CheckIcon, indeterminate: IndeterminateIcon } = icons
31
-
32
- return (
33
- <CheckboxParts.Indicator indeterminate={props.indeterminate}>
34
- <Show when={props.indeterminate} fallback={<CheckIcon />}>
35
- <IndeterminateIcon />
36
- </Show>
37
- </CheckboxParts.Indicator>
38
- )
39
- }
@@ -1,42 +0,0 @@
1
- import type { CheckboxRootProps } from '@ark-ui/react'
2
- import { type CheckboxVariantProps } from 'styled-system/recipes'
3
- import { Show } from '../show/index'
4
- import { Text } from '../text/index'
5
- import { CheckboxParts } from './parts'
6
- import { CheckboxIcon } from './checkbox-icon'
7
-
8
- /**
9
- * This module contains the Checkbox component.
10
- * @module
11
- */
12
-
13
- export type CheckboxProps = CheckboxVariantProps & CheckboxRootProps
14
-
15
- /**
16
- * Checkbox component is an abstraction of the primitives that displays a
17
- * controlled checkbox with a label.
18
- * @description [Cerberus Docs](https://cerberus.digitalu.design/react/checkbox)
19
- * @description [Ark Docs](https://ark-ui.com/docs/components/checkbox)
20
- */
21
- export function Checkbox(props: CheckboxProps) {
22
- const { size, children, ...rootProps } = props
23
-
24
- return (
25
- <CheckboxParts.Root {...rootProps}>
26
- <CheckboxParts.Control size={size}>
27
- <CheckboxIcon indeterminate={rootProps.checked === 'indeterminate'} />
28
- </CheckboxParts.Control>
29
-
30
- <CheckboxParts.Label size={size}>
31
- {children}
32
- <Show when={props.required}>
33
- <Text as="span" data-part="required-indicator">
34
- (required)
35
- </Text>
36
- </Show>
37
- </CheckboxParts.Label>
38
-
39
- <CheckboxParts.HiddenInput />
40
- </CheckboxParts.Root>
41
- )
42
- }
@@ -1,3 +0,0 @@
1
- export * from './checkbox'
2
- export * from './parts'
3
- export * from './primitives'
@@ -1,59 +0,0 @@
1
- import type { ElementType } from 'react'
2
- import {
3
- CheckboxRoot,
4
- CheckboxLabel,
5
- CheckboxControl,
6
- CheckboxIndicator,
7
- CheckboxHiddenInput,
8
- CheckboxGroup,
9
- } from './primitives'
10
-
11
- /**
12
- * This module contains the parts of the Field component.
13
- * @module 'field/parts'
14
- */
15
-
16
- interface CheckboxPartsValue {
17
- /**
18
- * The container of the field.
19
- */
20
- Root: ElementType
21
- /**
22
- * The label of the field.
23
- */
24
- Label: ElementType
25
- /**
26
- * The control of the field.
27
- */
28
- Control: ElementType
29
- /**
30
- * The indicator of the field.
31
- */
32
- Indicator: ElementType
33
- /**
34
- * The hidden input of the field.
35
- */
36
- HiddenInput: ElementType
37
- /**
38
- * The checkbox group component.
39
- */
40
- Group: ElementType
41
- }
42
-
43
- /**
44
- * An Object containing the parts of the Checkbox component. For users that
45
- * prefer Object component syntax.
46
- *
47
- * @remarks
48
- *
49
- * When using object component syntax, you import the CheckboxParts object and
50
- * the entire family of components vs. only what you use.
51
- */
52
- export const CheckboxParts: CheckboxPartsValue = {
53
- Root: CheckboxRoot,
54
- Label: CheckboxLabel,
55
- Control: CheckboxControl,
56
- Indicator: CheckboxIndicator,
57
- HiddenInput: CheckboxHiddenInput,
58
- Group: CheckboxGroup,
59
- }
@@ -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,2 +0,0 @@
1
- export * from './primitives'
2
- export * from './circular-progress'
@@ -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,2 +0,0 @@
1
- export * from './primitives'
2
- export * from './parts'
@@ -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,2 +0,0 @@
1
- export * from './parts'
2
- export * from './primitives'