@adea-ai/ui 0.72.0 → 0.72.2

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 (30) hide show
  1. package/dist/components/ui/checkbox/checkbox.d.ts +2 -0
  2. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  3. package/dist/components/ui/checkbox/checkbox.js +52 -13
  4. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  5. package/dist/components/ui/combobox/combobox.d.ts.map +1 -1
  6. package/dist/components/ui/combobox/combobox.js +10 -6
  7. package/dist/components/ui/combobox/combobox.js.map +1 -1
  8. package/dist/components/ui/radio-group/radio-group.d.ts +2 -1
  9. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  10. package/dist/components/ui/radio-group/radio-group.js +46 -13
  11. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  12. package/dist/components/ui/slider/slider.d.ts +5 -1
  13. package/dist/components/ui/slider/slider.d.ts.map +1 -1
  14. package/dist/components/ui/slider/slider.js +36 -20
  15. package/dist/components/ui/slider/slider.js.map +1 -1
  16. package/dist/components/ui/switch/switch.d.ts +2 -0
  17. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  18. package/dist/components/ui/switch/switch.js +51 -12
  19. package/dist/components/ui/switch/switch.js.map +1 -1
  20. package/dist/r/src/components/ui/checkbox/checkbox.tsx +34 -9
  21. package/dist/r/src/components/ui/combobox/combobox.tsx +1 -0
  22. package/dist/r/src/components/ui/radio-group/radio-group.tsx +22 -5
  23. package/dist/r/src/components/ui/slider/slider.tsx +43 -15
  24. package/dist/r/src/components/ui/switch/switch.tsx +34 -9
  25. package/package.json +1 -1
  26. package/src/components/ui/checkbox/checkbox.tsx +34 -9
  27. package/src/components/ui/combobox/combobox.tsx +1 -0
  28. package/src/components/ui/radio-group/radio-group.tsx +22 -5
  29. package/src/components/ui/slider/slider.tsx +43 -15
  30. package/src/components/ui/switch/switch.tsx +34 -9
@@ -21,6 +21,8 @@ export type SwitchProps = Omit<ComponentProps<typeof KobalteSwitch>, 'children'>
21
21
  thumbClass?: string
22
22
  labelClass?: string
23
23
  descriptionClass?: string
24
+ label?: JSX.Element
25
+ description?: JSX.Element
24
26
  /**
25
27
  * Replaces the control and label. Omit it to get the default control beside
26
28
  * `label` and `description`; supply it to compose the parts yourself.
@@ -36,16 +38,30 @@ export function Switch(props: SwitchProps) {
36
38
  'labelClass',
37
39
  'descriptionClass',
38
40
  'children',
41
+ 'label',
42
+ 'description',
39
43
  'aria-label',
40
44
  'aria-labelledby',
45
+ 'aria-describedby',
46
+ 'aria-invalid',
47
+ 'aria-busy',
48
+ 'title',
41
49
  ])
42
50
 
43
51
  return (
44
- <KobalteSwitch class={cn('group/switch flex items-center gap-2.5', local.class)} {...rest}>
52
+ <KobalteSwitch
53
+ title={local.title}
54
+ class={cn('group/switch flex items-center gap-2.5', local.class)}
55
+ {...rest}
56
+ >
45
57
  {/* The name belongs on the input; see Checkbox for why. */}
46
58
  <KobalteSwitch.Input
47
59
  aria-label={local['aria-label']}
48
60
  aria-labelledby={local['aria-labelledby']}
61
+ aria-describedby={local['aria-describedby']}
62
+ aria-invalid={local['aria-invalid']}
63
+ aria-busy={local['aria-busy']}
64
+ title={local.title}
49
65
  />
50
66
  <KobalteSwitch.Control
51
67
  class={cn(
@@ -67,14 +83,23 @@ export function Switch(props: SwitchProps) {
67
83
  )}
68
84
  />
69
85
  </KobalteSwitch.Control>
70
- {local.children ?? (
71
- <div class="grid gap-0.5">
72
- <KobalteSwitch.Label class={cn('text-sm leading-none font-medium', local.labelClass)} />
73
- <KobalteSwitch.Description
74
- class={cn('text-muted-foreground text-sm', local.descriptionClass)}
75
- />
76
- </div>
77
- )}
86
+ {local.children ??
87
+ (local.label || local.description ? (
88
+ <div class="grid gap-0.5">
89
+ {local.label ? (
90
+ <KobalteSwitch.Label class={cn('text-sm leading-none font-medium', local.labelClass)}>
91
+ {local.label}
92
+ </KobalteSwitch.Label>
93
+ ) : null}
94
+ {local.description ? (
95
+ <KobalteSwitch.Description
96
+ class={cn('text-muted-foreground text-sm', local.descriptionClass)}
97
+ >
98
+ {local.description}
99
+ </KobalteSwitch.Description>
100
+ ) : null}
101
+ </div>
102
+ ) : null)}
78
103
  </KobalteSwitch>
79
104
  )
80
105
  }