@cerberus-design/react 0.15.0-next-5d7dc1e → 0.15.0-next-544221f

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 (53) hide show
  1. package/build/legacy/_tsup-dts-rollup.d.cts +131 -28
  2. package/build/legacy/components/radio/index.cjs +143 -0
  3. package/build/legacy/components/radio/index.cjs.map +1 -0
  4. package/build/legacy/components/radio/parts.cjs +113 -0
  5. package/build/legacy/components/radio/parts.cjs.map +1 -0
  6. package/build/legacy/components/radio/primitives.cjs +115 -0
  7. package/build/legacy/components/radio/primitives.cjs.map +1 -0
  8. package/build/legacy/components/radio/radio.cjs +82 -0
  9. package/build/legacy/components/radio/radio.cjs.map +1 -0
  10. package/build/legacy/index.cjs +250 -173
  11. package/build/legacy/index.cjs.map +1 -1
  12. package/build/modern/_tsup-dts-rollup.d.ts +131 -28
  13. package/build/modern/chunk-5RTNSVYU.js +88 -0
  14. package/build/modern/chunk-5RTNSVYU.js.map +1 -0
  15. package/build/modern/chunk-FUL2VRDU.js +25 -0
  16. package/build/modern/chunk-FUL2VRDU.js.map +1 -0
  17. package/build/modern/chunk-OGYMMATX.js +1 -0
  18. package/build/modern/{chunk-FK52US7K.js → chunk-RHCTPSKT.js} +7 -7
  19. package/build/modern/chunk-STLN7BMJ.js +22 -0
  20. package/build/modern/chunk-STLN7BMJ.js.map +1 -0
  21. package/build/modern/{chunk-CF3EHG42.js → chunk-ZFFW5ELD.js} +4 -4
  22. package/build/modern/components/AccordionItemGroup.js +1 -1
  23. package/build/modern/components/DatePicker.client.js +3 -3
  24. package/build/modern/components/FileStatus.js +2 -2
  25. package/build/modern/components/radio/index.js +30 -0
  26. package/build/modern/components/radio/index.js.map +1 -0
  27. package/build/modern/components/radio/parts.js +8 -0
  28. package/build/modern/components/radio/parts.js.map +1 -0
  29. package/build/modern/components/radio/primitives.js +21 -0
  30. package/build/modern/components/radio/primitives.js.map +1 -0
  31. package/build/modern/components/radio/radio.js +8 -0
  32. package/build/modern/components/radio/radio.js.map +1 -0
  33. package/build/modern/context/confirm-modal.js +1 -1
  34. package/build/modern/context/cta-modal.js +2 -2
  35. package/build/modern/context/notification-center.js +1 -1
  36. package/build/modern/context/prompt-modal.js +1 -1
  37. package/build/modern/index.js +83 -60
  38. package/build/modern/index.js.map +1 -1
  39. package/package.json +2 -2
  40. package/src/components/radio/index.ts +3 -0
  41. package/src/components/radio/parts.ts +65 -0
  42. package/src/components/radio/primitives.tsx +123 -0
  43. package/src/components/radio/radio.tsx +35 -0
  44. package/src/index.ts +1 -1
  45. package/build/legacy/components/Radio.cjs +0 -64
  46. package/build/legacy/components/Radio.cjs.map +0 -1
  47. package/build/modern/chunk-6WOJAMZV.js +0 -40
  48. package/build/modern/chunk-6WOJAMZV.js.map +0 -1
  49. package/build/modern/components/Radio.js +0 -7
  50. package/src/components/Radio.tsx +0 -68
  51. /package/build/modern/{components/Radio.js.map → chunk-OGYMMATX.js.map} +0 -0
  52. /package/build/modern/{chunk-FK52US7K.js.map → chunk-RHCTPSKT.js.map} +0 -0
  53. /package/build/modern/{chunk-CF3EHG42.js.map → chunk-ZFFW5ELD.js.map} +0 -0
@@ -1,68 +0,0 @@
1
- import { Field } from '@ark-ui/react/field'
2
- import { cx } from '@cerberus/styled-system/css'
3
- import { hstack } from '@cerberus/styled-system/patterns'
4
- import { radio } from '@cerberus/styled-system/recipes'
5
- import type { RecipeVariantProps } from '@cerberus/styled-system/types'
6
- import type { InputHTMLAttributes, PropsWithChildren } from 'react'
7
-
8
- /**
9
- * This module contains the Radio component.
10
- * @module
11
- */
12
-
13
- export type RadioRecipe = RecipeVariantProps<typeof radio>
14
- export interface RadioBaseProps
15
- extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
16
- /**
17
- * A unique identifier for the radio button. Required for accessibility.
18
- */
19
- id: string
20
- }
21
- export type RadioProps = RadioBaseProps & RadioRecipe
22
-
23
- /**
24
- * The Radio component is used to allow users to select a single option from a list of options.
25
- * @see https://cerberus.digitalu.design/react/radio
26
- * @memberof module:Field
27
- * @example
28
- * ```tsx
29
- * <Field>
30
- * <fieldset name="fruit">
31
- * <Radio id="radio-1" name="fruit" value="1">
32
- * Option 1
33
- * </Radio>
34
- * <Radio id="radio-2" name="fruit" value="2">
35
- * Option 2
36
- * </Radio>
37
- * <Radio id="radio-3" name="fruit" value="3">
38
- * Option 3
39
- * </Radio>
40
- * </fieldset>
41
- * </Field>
42
- * ```
43
- */
44
- export function Radio(props: PropsWithChildren<RadioProps>) {
45
- const { children, size, ...nativeProps } = props
46
- const styles = radio({ size })
47
-
48
- return (
49
- <div
50
- className={cx(
51
- 'group',
52
- hstack({
53
- gap: 'sm',
54
- }),
55
- styles.root,
56
- )}
57
- tabIndex={0}
58
- >
59
- <Field.Input
60
- {...nativeProps}
61
- className={cx(nativeProps.className, styles.input)}
62
- tabIndex={-1}
63
- type="radio"
64
- />
65
- {children}
66
- </div>
67
- )
68
- }