@oxcide-ui/schema 0.0.3

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.
@@ -0,0 +1,67 @@
1
+ import { z } from 'zod'
2
+
3
+ export const radioButtonPropsSchema = z.object({
4
+ /** V-model selected value */
5
+ modelValue: z.any().optional(),
6
+ /** Value representing this specific radio button */
7
+ value: z.any().optional(),
8
+ /** Disabled state */
9
+ disabled: z.boolean().default(false),
10
+ /** Invalid / Error state */
11
+ invalid: z.boolean().default(false),
12
+ /** Readonly state */
13
+ readonly: z.boolean().default(false),
14
+ /** Size */
15
+ size: z.enum(['sm', 'md', 'lg']).default('md'),
16
+ /** Severity */
17
+ severity: z
18
+ .enum(['primary', 'secondary', 'success', 'info', 'warning', 'danger', 'help', 'contrast'])
19
+ .default('primary'),
20
+ /** Variant */
21
+ variant: z.enum(['filled', 'outlined']).default('filled'),
22
+ /** Label for accessibility and grouping */
23
+ label: z.string().optional(),
24
+ /** Position of the label */
25
+ labelPosition: z.enum(['left', 'right']).default('right'),
26
+ /** Group name for radios */
27
+ name: z.string().optional(),
28
+ /** Native id attribute */
29
+ id: z.string().optional()
30
+ })
31
+
32
+ /* @oxcide-sync:source
33
+ export type RadioButtonProps = z.input<typeof radioButtonPropsSchema>
34
+ export type RadioButtonResolvedProps = z.infer<typeof radioButtonPropsSchema>
35
+ @oxcide-sync:end */
36
+ export interface RadioButtonProps {
37
+ modelValue?: any
38
+ value?: any
39
+ disabled?: boolean | undefined
40
+ invalid?: boolean | undefined
41
+ readonly?: boolean | undefined
42
+ size?: 'sm' | 'md' | 'lg' | undefined
43
+ severity?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'help' | 'contrast' | undefined
44
+ variant?: 'filled' | 'outlined' | undefined
45
+ label?: string | undefined
46
+ labelPosition?: 'left' | 'right' | undefined
47
+ name?: string | undefined
48
+ id?: string | undefined
49
+ }
50
+ export type RadioButtonResolvedProps = {
51
+ disabled: boolean
52
+ invalid: boolean
53
+ readonly: boolean
54
+ size: 'sm' | 'md' | 'lg'
55
+ severity: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'danger' | 'help' | 'contrast'
56
+ variant: 'filled' | 'outlined'
57
+ labelPosition: 'left' | 'right'
58
+ modelValue?: any
59
+ value?: any
60
+ label?: string | undefined
61
+ name?: string | undefined
62
+ id?: string | undefined
63
+ }
64
+
65
+ export function getRadioButtonDefaults(props: RadioButtonProps = {}): RadioButtonResolvedProps {
66
+ return radioButtonPropsSchema.parse(props)
67
+ }
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod'
2
+
3
+ export const stackPropsSchema = z.object({
4
+ as: z.string().default('div'),
5
+ direction: z.enum(['row', 'column', 'row-reverse', 'column-reverse']).default('column'),
6
+ gap: z.enum(['none', 'xs', 'sm', 'md', 'lg', 'xl', '2xl']).default('md'),
7
+ align: z.enum(['start', 'center', 'end', 'stretch', 'baseline']).default('stretch'),
8
+ justify: z.enum(['start', 'center', 'end', 'between', 'around', 'evenly']).default('start'),
9
+ wrap: z.enum(['nowrap', 'wrap', 'wrap-reverse']).default('nowrap'),
10
+ fluid: z.boolean().default(false)
11
+ })
12
+
13
+ export function getStackDefaults(props: StackProps = {}): StackResolvedProps {
14
+ return stackPropsSchema.parse(props)
15
+ }
16
+
17
+ /* @oxcide-sync:source
18
+ export type StackProps = z.input<typeof stackPropsSchema>
19
+ export type StackResolvedProps = z.infer<typeof stackPropsSchema>
20
+ @oxcide-sync:end */
21
+ export interface StackProps {
22
+ as?: string | undefined
23
+ direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse' | undefined
24
+ gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | undefined
25
+ align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline' | undefined
26
+ justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly' | undefined
27
+ wrap?: 'nowrap' | 'wrap' | 'wrap-reverse' | undefined
28
+ fluid?: boolean | undefined
29
+ }
30
+ export type StackResolvedProps = {
31
+ as: string
32
+ direction: 'row' | 'column' | 'row-reverse' | 'column-reverse'
33
+ gap: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
34
+ align: 'start' | 'center' | 'end' | 'stretch' | 'baseline'
35
+ justify: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
36
+ wrap: 'nowrap' | 'wrap' | 'wrap-reverse'
37
+ fluid: boolean
38
+ }