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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/panda.buildinfo.json +23 -0
  2. package/package.json +6 -4
  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,28 +0,0 @@
1
- import { FileUploadFileError } from '@ark-ui/react/file-upload'
2
-
3
- type FileErrorTypes = {
4
- tooMany?: string
5
- invalidType?: string
6
- tooLarge?: string
7
- tooSmall?: string
8
- invalid?: string
9
- exists?: string
10
- }
11
-
12
- /**
13
- * Helper function to create error messages for file upload errors. Returns a
14
- * record of FileUploadFileError codes and their corresponding error messages.
15
- * @returns Record<FileUploadFileError, string>
16
- */
17
- export function createErrorMessages(
18
- options: FileErrorTypes,
19
- ): Record<FileUploadFileError, string> {
20
- return {
21
- TOO_MANY_FILES: options.tooMany || '📊 Too many files selected',
22
- FILE_INVALID_TYPE: options.invalidType || '🚫 Invalid file type',
23
- FILE_TOO_LARGE: options.tooLarge || '📏 File too large',
24
- FILE_TOO_SMALL: options.tooSmall || '📐 File too small',
25
- FILE_INVALID: options.invalid || '⚠️ Invalid file',
26
- FILE_EXISTS: options.exists || '🔄 File already exists',
27
- }
28
- }
@@ -1,41 +0,0 @@
1
- 'use client'
2
-
3
- import { UseFileUploadContext } from '@ark-ui/react/file-upload'
4
- import { useCerberusContext } from '../../context/cerberus'
5
- import { IconButton } from '../icon-button/index'
6
- import { FileUploadParts } from './parts'
7
- import { FileUploadContextProps } from './primitives'
8
-
9
- export function ImgPreview(props: Omit<FileUploadContextProps, 'children'>) {
10
- const { icons } = useCerberusContext()
11
- const { close: Icon } = icons
12
-
13
- return (
14
- <FileUploadParts.ItemGroup>
15
- <FileUploadParts.Context {...props}>
16
- {(ctx: UseFileUploadContext) =>
17
- ctx.acceptedFiles.map((file) => (
18
- <FileUploadParts.Item
19
- key={file.name}
20
- file={file}
21
- className="file-item"
22
- >
23
- <FileUploadParts.ItemPreview type="image/*">
24
- <FileUploadParts.ItemPreviewImage />
25
- </FileUploadParts.ItemPreview>
26
-
27
- <FileUploadParts.ItemName />
28
- <FileUploadParts.ItemSizeText />
29
-
30
- <FileUploadParts.ItemDeleteTrigger asChild>
31
- <IconButton clipboard size="sm" usage="ghost">
32
- <Icon />
33
- </IconButton>
34
- </FileUploadParts.ItemDeleteTrigger>
35
- </FileUploadParts.Item>
36
- ))
37
- }
38
- </FileUploadParts.Context>
39
- </FileUploadParts.ItemGroup>
40
- )
41
- }
@@ -1,6 +0,0 @@
1
- export * from './primitives'
2
- export * from './parts'
3
- export * from './file-status'
4
- export * from './file-uploader'
5
- export * from './img-preview'
6
- export * from './helpers'
@@ -1,132 +0,0 @@
1
- import type { ElementType } from 'react'
2
- import {
3
- FileUploadContext,
4
- FileUploadRoot,
5
- FileUploadDropzone,
6
- FileUploadLabel,
7
- FileUploadTrigger,
8
- FileUploadClearTrigger,
9
- FileUploadItemGroup,
10
- FileUploadItem,
11
- FileUploadItemPreview,
12
- FileUploadItemPreviewImage,
13
- FileUploadItemName,
14
- FileUploadItemSizeText,
15
- FileUploadItemDeleteTrigger,
16
- FileUploadContent,
17
- FileUploadIcon,
18
- FileUploadHiddenInput,
19
- FileUploadHeading,
20
- FileUploadDescription,
21
- } from './primitives'
22
-
23
- /**
24
- * This module contains the parts of the FileUploadParts component.
25
- * @module 'fileUpload/parts'
26
- */
27
-
28
- interface FileUploadPartsValue {
29
- /**
30
- * The container of the uploader.
31
- */
32
- Root: ElementType
33
- /**
34
- * The label of the uploader.
35
- */
36
- Label: ElementType
37
- /**
38
- * The dropzone of the uploader.
39
- */
40
- Dropzone: ElementType
41
- /**
42
- * The trigger of the uploader.
43
- */
44
- Trigger: ElementType
45
- /**
46
- * The clear trigger of the uploader.
47
- */
48
- ClearTrigger: ElementType
49
- /**
50
- * The item group of the uploader.
51
- */
52
- ItemGroup: ElementType
53
- /**
54
- * The item of the uploader.
55
- */
56
- Item: ElementType
57
- /**
58
- * The item preview of the uploader.
59
- */
60
- ItemPreview: ElementType
61
- /**
62
- * The item preview image of the uploader.
63
- */
64
- ItemPreviewImage: ElementType
65
- /**
66
- * The item name of the uploader.
67
- */
68
- ItemName: ElementType
69
- /**
70
- * The item size text of the uploader.
71
- */
72
- ItemSizeText: ElementType
73
- /**
74
- * The item delete trigger of the uploader.
75
- */
76
- ItemDeleteTrigger: ElementType
77
- /**
78
- * The hidden input of the uploader.
79
- */
80
- HiddenInput: ElementType
81
- /**
82
- * The context of the uploader.
83
- */
84
- Context: ElementType
85
- /**
86
- * The content container of the dropzone.
87
- */
88
- Content: ElementType
89
- /**
90
- * The icon of the uploader.
91
- */
92
- Icon: ElementType
93
- /**
94
- * The heading of the uploader.
95
- */
96
- Heading: ElementType
97
- /**
98
- * The description of the uploader.
99
- */
100
- Description: ElementType
101
- }
102
-
103
- /**
104
- * An Object containing the parts of the FileUploader component. For users that
105
- * prefer Object component syntax.
106
- *
107
- * @remarks
108
- *
109
- * When using object component syntax, you import the uploaderParts object and
110
- * the entire family of components vs. only what you use.
111
- */
112
- export const FileUploadParts: FileUploadPartsValue = {
113
- Context: FileUploadContext,
114
- Root: FileUploadRoot,
115
- Label: FileUploadLabel,
116
- Dropzone: FileUploadDropzone,
117
- Trigger: FileUploadTrigger,
118
- ClearTrigger: FileUploadClearTrigger,
119
- ItemGroup: FileUploadItemGroup,
120
- Item: FileUploadItem,
121
- ItemPreview: FileUploadItemPreview,
122
- ItemPreviewImage: FileUploadItemPreviewImage,
123
- ItemName: FileUploadItemName,
124
- ItemSizeText: FileUploadItemSizeText,
125
- ItemDeleteTrigger: FileUploadItemDeleteTrigger,
126
- HiddenInput: FileUploadHiddenInput,
127
- // custom cerby primitives
128
- Content: FileUploadContent,
129
- Icon: FileUploadIcon,
130
- Heading: FileUploadHeading,
131
- Description: FileUploadDescription,
132
- }
@@ -1,161 +0,0 @@
1
- import {
2
- FileUpload,
3
- type FileUploadContextProps as ArkFileUploadContextProps,
4
- type FileUploadRootProps as ArkFileUploadRootProps,
5
- type FileUploadLabelProps as ArkFileUploadLabelProps,
6
- type FileUploadDropzoneProps as ArkFileUploadDropzoneProps,
7
- type FileUploadTriggerProps as ArkFileUploadTriggerProps,
8
- type FileUploadClearTriggerProps as ArkFileUploadClearTriggerProps,
9
- type FileUploadItemGroupProps as ArkFileUploadItemGroupProps,
10
- type FileUploadItemProps as ArkFileUploadItemProps,
11
- type FileUploadItemPreviewProps as ArkFileUploadItemPreviewProps,
12
- type FileUploadItemPreviewImageProps as ArkFileUploadItemPreviewImageProps,
13
- type FileUploadItemNameProps as ArkFileUploadItemNameProps,
14
- type FileUploadItemSizeTextProps as ArkFileUploadItemSizeTextProps,
15
- type FileUploadItemDeleteTriggerProps as ArkFileUploadItemDeleteTriggerProps,
16
- type FileUploadHiddenInputProps as ArkFileUploadHiddenInputProps,
17
- } from '@ark-ui/react/file-upload'
18
- import {
19
- fileUploader,
20
- type FileUploaderVariantProps,
21
- } from 'styled-system/recipes'
22
- import {
23
- createCerberusPrimitive,
24
- type CerberusPrimitiveProps,
25
- } from '../../system/index'
26
-
27
- const { withSlotRecipe, withNoRecipe } = createCerberusPrimitive(fileUploader)
28
-
29
- // Root
30
-
31
- export type FileUploadRootProps = CerberusPrimitiveProps<
32
- ArkFileUploadRootProps & FileUploaderVariantProps
33
- >
34
- export const FileUploadRoot = withSlotRecipe(FileUpload.Root, 'root')
35
-
36
- // Dropzone
37
-
38
- export type FileUploadDropzoneProps =
39
- CerberusPrimitiveProps<ArkFileUploadDropzoneProps>
40
- export const FileUploadDropzone = withSlotRecipe(
41
- FileUpload.Dropzone,
42
- 'dropzone',
43
- )
44
-
45
- // Label
46
-
47
- export type FileUploadLabelProps =
48
- CerberusPrimitiveProps<ArkFileUploadLabelProps>
49
- export const FileUploadLabel = withSlotRecipe(FileUpload.Label, 'label')
50
-
51
- // Trigger
52
-
53
- export type FileUploadTriggerProps =
54
- CerberusPrimitiveProps<ArkFileUploadTriggerProps>
55
- export const FileUploadTrigger = withSlotRecipe(FileUpload.Trigger, 'trigger')
56
-
57
- // ClearTrigger
58
-
59
- export type FileUploadClearTriggerProps =
60
- CerberusPrimitiveProps<ArkFileUploadClearTriggerProps>
61
- export const FileUploadClearTrigger = withSlotRecipe(
62
- FileUpload.ClearTrigger,
63
- 'clearTrigger',
64
- )
65
-
66
- // ItemGroup
67
-
68
- export type FileUploadItemGroupProps =
69
- CerberusPrimitiveProps<ArkFileUploadItemGroupProps>
70
- export const FileUploadItemGroup = withSlotRecipe(
71
- FileUpload.ItemGroup,
72
- 'itemGroup',
73
- )
74
-
75
- // Item
76
-
77
- export type FileUploadItemProps = CerberusPrimitiveProps<ArkFileUploadItemProps>
78
- export const FileUploadItem = withSlotRecipe(FileUpload.Item, 'item')
79
-
80
- // ItemPreview
81
-
82
- export type FileUploadItemPreviewProps =
83
- CerberusPrimitiveProps<ArkFileUploadItemPreviewProps>
84
- export const FileUploadItemPreview = withSlotRecipe(
85
- FileUpload.ItemPreview,
86
- 'itemPreview',
87
- )
88
-
89
- // ItemPreviewImage
90
-
91
- export type FileUploadItemPreviewImageProps =
92
- CerberusPrimitiveProps<ArkFileUploadItemPreviewImageProps>
93
- export const FileUploadItemPreviewImage = withSlotRecipe(
94
- FileUpload.ItemPreviewImage,
95
- 'itemPreviewImage',
96
- )
97
-
98
- // ItemName
99
-
100
- export type FileUploadItemNameProps =
101
- CerberusPrimitiveProps<ArkFileUploadItemNameProps>
102
- export const FileUploadItemName = withSlotRecipe(
103
- FileUpload.ItemName,
104
- 'itemName',
105
- )
106
-
107
- // ItemSizeText
108
-
109
- export type FileUploadItemSizeTextProps =
110
- CerberusPrimitiveProps<ArkFileUploadItemSizeTextProps>
111
- export const FileUploadItemSizeText = withSlotRecipe(
112
- FileUpload.ItemSizeText,
113
- 'itemSizeText',
114
- )
115
-
116
- // ItemDeleteTrigger
117
-
118
- export type FileUploadItemDeleteTriggerProps =
119
- CerberusPrimitiveProps<ArkFileUploadItemDeleteTriggerProps>
120
- export const FileUploadItemDeleteTrigger = withSlotRecipe(
121
- FileUpload.ItemDeleteTrigger,
122
- 'itemDeleteTrigger',
123
- )
124
-
125
- // HiddenInput
126
-
127
- export type FileUploadHiddenInputProps =
128
- CerberusPrimitiveProps<ArkFileUploadHiddenInputProps>
129
- export const FileUploadHiddenInput = withNoRecipe(FileUpload.HiddenInput)
130
-
131
- // Context
132
-
133
- export type FileUploadContextProps =
134
- CerberusPrimitiveProps<ArkFileUploadContextProps>
135
- export const FileUploadContext = withNoRecipe(FileUpload.Context)
136
-
137
- // Content
138
-
139
- export type FileUploadContentProps = CerberusPrimitiveProps<HTMLDivElement>
140
- export const FileUploadContent = withSlotRecipe('div', 'label')
141
-
142
- // Icon
143
-
144
- export type FileUploadIconProps = CerberusPrimitiveProps<HTMLDivElement>
145
- export const FileUploadIcon = withSlotRecipe('div', 'icon')
146
-
147
- // Heading
148
-
149
- export type FileUploadHeadingProps =
150
- CerberusPrimitiveProps<HTMLParagraphElement>
151
- export const FileUploadHeading = withSlotRecipe('p', 'heading')
152
-
153
- // Description
154
-
155
- export type FileUploadDescriptionProps =
156
- CerberusPrimitiveProps<HTMLParagraphElement>
157
- export const FileUploadDescription = withSlotRecipe('p', 'description')
158
-
159
- // Types
160
-
161
- export type { UseFileUploadContext } from '@ark-ui/react'
@@ -1,20 +0,0 @@
1
- import { FileUploadRootProps } from '@ark-ui/react'
2
-
3
- /**
4
- * Format a given file type string into a human-readable format.
5
- * @param accept FileUploadRootProps['accept']
6
- * @returns string (e.g., ".png, .jpg, .svg")
7
- */
8
- export function formatFileTypes(accept: FileUploadRootProps['accept']): string {
9
- if (Array.isArray(accept)) return accept.join(', ')
10
- if (typeof accept === 'object') return Object.keys(accept).join(', ')
11
-
12
- if (typeof accept === 'string') {
13
- if (accept.includes('/*')) {
14
- return `any ${accept.split('/')[0]}`
15
- }
16
- return accept.split(',').join(', ')
17
- }
18
-
19
- return 'any'
20
- }
@@ -1,38 +0,0 @@
1
- import type { ReactNode, JSX } from 'react'
2
-
3
- export interface ForProps<T extends readonly unknown[], U extends JSX.Element> {
4
- /**
5
- * The array to iterate over.
6
- */
7
- each: T | undefined | null | false
8
- /**
9
- * The fallback to render when the array is empty.
10
- */
11
- fallback?: JSX.Element
12
- /**
13
- * The children to render for each item in the array.
14
- */
15
- children: (item: T[number], index: number) => U
16
- }
17
-
18
- /**
19
- * The For component is used to iterate over an array and render a list of
20
- * components or display a fallback when the array is empty.
21
- * Inspired by the `<For>` component from SolidJS.
22
- *
23
- * @example
24
- * ```tsx
25
- * <For each={['a', 'b', 'c']}>
26
- * {(item, index) => <div key={index}>{item}</div>}
27
- * </For>
28
- * ```
29
- */
30
- export function For<T extends readonly unknown[], U extends JSX.Element>(
31
- props: ForProps<T, U>,
32
- ) {
33
- if (!props.each || !props.each.length) {
34
- return props.fallback || null
35
- }
36
-
37
- return <>{props.each?.map(props.children) as ReactNode}</>
38
- }
@@ -1 +0,0 @@
1
- export * from './for'
@@ -1 +0,0 @@
1
- export * from './primitives'
@@ -1,7 +0,0 @@
1
- import { group, type GroupVariantProps } from 'styled-system/recipes'
2
- import { type CerberusProps, createCerberusPrimitive } from '../../system/index'
3
-
4
- const { withRecipe } = createCerberusPrimitive(group)
5
-
6
- export type GroupProps = CerberusProps<'div'> & GroupVariantProps
7
- export const Group = withRecipe('div')
@@ -1,41 +0,0 @@
1
- import { IconButtonRoot, type IconButtonRootProps } from './primitives'
2
-
3
- /**
4
- * This module contains the Icon Button component.
5
- * @module
6
- */
7
-
8
- type NonClipboardIconButtonProps = {
9
- /**
10
- * The aria-label attribute for the icon button.
11
- */
12
- ariaLabel: string
13
- clipboard?: never
14
- }
15
-
16
- type ClipboardIconButtonProps = {
17
- ariaLabel?: never
18
- /**
19
- * If true, the icon button is used as a clipboard trigger.
20
- * In this case, the aria-label defaults to "Copy to clipboard".
21
- */
22
- clipboard: true
23
- }
24
-
25
- export type IconButtonProps = IconButtonRootProps &
26
- (NonClipboardIconButtonProps | ClipboardIconButtonProps)
27
- /**
28
- * A component that allows the user to perform actions using an icon
29
- * @see https://cerberus.digitalu.design/react/icon-button
30
- */
31
- export function IconButton(props: IconButtonProps) {
32
- const { ariaLabel, clipboard, ...rootProps } = props
33
- return (
34
- <IconButtonRoot
35
- {...rootProps}
36
- {...(!clipboard && { 'aria-label': ariaLabel })}
37
- data-scope="icon-button"
38
- data-part="root"
39
- />
40
- )
41
- }
@@ -1,2 +0,0 @@
1
- export * from './button'
2
- export * from './primitives'
@@ -1,19 +0,0 @@
1
- import { ark } from '@ark-ui/react/factory'
2
- import { HTMLAttributes } from 'react'
3
- import { iconButton, type IconButtonVariantProps } from 'styled-system/recipes'
4
- import {
5
- CerberusPrimitiveProps,
6
- createCerberusPrimitive,
7
- } from '../../system/index'
8
-
9
- /**
10
- * This module contains the IconButton component primitives.
11
- * @module @cerberus-design/react/components/icon-button/primitives
12
- */
13
-
14
- const { withRecipe } = createCerberusPrimitive(iconButton)
15
-
16
- export type IconButtonRootProps = CerberusPrimitiveProps<
17
- HTMLAttributes<HTMLButtonElement> & IconButtonVariantProps
18
- >
19
- export const IconButtonRoot = withRecipe(ark.button)
@@ -1,2 +0,0 @@
1
- export * from './primitives'
2
- export * from './menu'
@@ -1,144 +0,0 @@
1
- import {
2
- MenuContentEl,
3
- MenuItemEl,
4
- MenuItemGroupEl,
5
- MenuItemGroupLabelEl,
6
- MenuPositioner,
7
- MenuRoot,
8
- MenuSeparatorEl,
9
- MenuTriggerEl,
10
- type MenuContentProps,
11
- type MenuTriggerProps,
12
- } from './primitives'
13
-
14
- /**
15
- * This module contains the Menu named abstractions component.
16
- * @module @cerberus-design/react/components/menu
17
- */
18
-
19
- /**
20
- * The root Menu component which controls the menu.
21
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
22
- *
23
- * @example
24
- * ```tsx
25
- * <Menu>
26
- * <MenuTrigger>Trigger</MenuTrigger>
27
- * </Menu>
28
- */
29
- export const Menu = MenuRoot
30
-
31
- /**
32
- * The MenuTrigger component opens/closes the Menu.
33
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
34
- * @example
35
- * ```tsx
36
- * <Menu>
37
- * <MenuTrigger>
38
- * <Button>Trigger</Button>
39
- * </MenuTrigger>
40
- * </Menu>
41
- */
42
- export function MenuTrigger(props: MenuTriggerProps) {
43
- return <MenuTriggerEl {...props} asChild />
44
- }
45
-
46
- /**
47
- * The MenuContent component is the container for the menu items.
48
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
49
- * @example
50
- * ```tsx
51
- * <Menu>
52
- * <MenuTrigger>
53
- * <Button>Trigger</Button>
54
- * </MenuTrigger>
55
- * <MenuContent>
56
- * <MenuItem value="item_1">Item 1</MenuItem>
57
- * <MenuItem value="item_2">Item 2</MenuItem>
58
- * </MenuContent>
59
- * </Menu>
60
- */
61
- export function MenuContent(props: MenuContentProps) {
62
- return (
63
- <MenuPositioner>
64
- <MenuContentEl {...props} />
65
- </MenuPositioner>
66
- )
67
- }
68
-
69
- /**
70
- * The MenuItem component is a single item in the menu.
71
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
72
- * @example
73
- * ```tsx
74
- * <Menu>
75
- * <MenuTrigger>
76
- * <Button>Trigger</Button>
77
- * </MenuTrigger>
78
- * <MenuContent>
79
- * <MenuItem value="item_1">Item 1</MenuItem>
80
- * <MenuItem value="item_2">Item 2</MenuItem>
81
- * </MenuContent>
82
- * </Menu>
83
- */
84
- export const MenuItem = MenuItemEl
85
-
86
- /**
87
- * The MenuItemGroup component is a group of menu items.
88
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
89
- * @example
90
- * ```tsx
91
- * <Menu>
92
- * <MenuTrigger>
93
- * <Button>Trigger</Button>
94
- * </MenuTrigger>
95
- * <MenuContent>
96
- * <MenuItemGroup>
97
- * <MenuItem value="item_1">Item 1</MenuItem>
98
- * <MenuItem value="item_2">Item 2</MenuItem>
99
- * </MenuItemGroup>
100
- * </MenuContent>
101
- * </Menu>
102
- */
103
- export const MenuItemGroup = MenuItemGroupEl
104
-
105
- /**
106
- * The MenuItemGroupLabel component is the label for a group of menu items.
107
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
108
- * @example
109
- * ```tsx
110
- * <Menu>
111
- * <MenuTrigger>
112
- * <Button>Trigger</Button>
113
- * </MenuTrigger>
114
- * <MenuContent>
115
- * <MenuItemGroup>
116
- * <MenuItemGroupLabel>Group Label</MenuItemGroupLabel>
117
- * <MenuItem value="item_1">Item 1</MenuItem>
118
- * <MenuItem value="item_2">Item 2</MenuItem>
119
- * </MenuItemGroup>
120
- * </MenuContent>
121
- * </Menu>
122
- */
123
- export const MenuGroupLabel = MenuItemGroupLabelEl
124
-
125
- /**
126
- * The MenuSeparator component is a visual divider between menu items.
127
- * @definition [Cerberus docs](https://cerberus.digitalu.design/react/menu/dev)
128
- * @example
129
- * ```tsx
130
- * <Menu>
131
- * <MenuTrigger>
132
- * <Button>Trigger</Button>
133
- * </MenuTrigger>
134
- * <MenuContent>
135
- * <MenuItemGroup>
136
- * <MenuGroupLabel>Group Label</MenuGroupLabel>
137
- * <MenuSeparator />
138
- * <MenuItem value="item_1">Item 1</MenuItem>
139
- * <MenuItem value="item_2">Item 2</MenuItem>
140
- * </MenuItemGroup>
141
- * </MenuContent>
142
- * </Menu>
143
- */
144
- export const MenuSeparator = MenuSeparatorEl