@hanzo/ui 4.2.3 → 4.2.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -97,6 +97,7 @@ const Combobox = <T, P extends ComboboxTriggerProps<T>>({
97
97
  popoverClx='',
98
98
  listItemClx='',
99
99
  listItemSelectedClx='',
100
+ listItemDisabledClx='',
100
101
  noCheckmark=false,
101
102
  listItemImageClx='',
102
103
  searchPlaceholder='Search...',
@@ -117,6 +118,7 @@ const Combobox = <T, P extends ComboboxTriggerProps<T>>({
117
118
  popoverClx?: string
118
119
  listItemClx?: string
119
120
  listItemSelectedClx?: string
121
+ listItemDisabledClx?: string
120
122
  listItemImageClx?: string
121
123
  listItemImageSize?: number
122
124
  noCheckmark?: boolean
@@ -192,11 +194,13 @@ const Combobox = <T, P extends ComboboxTriggerProps<T>>({
192
194
  key={adaptor.getValue(el)}
193
195
  value={adaptor.getValue(el)}
194
196
  onSelect={handleSelect}
197
+ disabled={adaptor.isDisabled ? adaptor.isDisabled(el) : false}
195
198
  className={cn(
196
199
  'flex',
197
200
  noCheckmark ? 'justify-start' : 'justify-between',
198
201
  listItemClx,
199
- (isCurrent(el) ? listItemSelectedClx : '')
202
+ (isCurrent(el) ? listItemSelectedClx : ''),
203
+ ((adaptor.isDisabled && adaptor.isDisabled(el)) ? listItemDisabledClx : '')
200
204
  )}
201
205
  >
202
206
  <div className='flex justify-start items-center gap-2'>
@@ -118,8 +118,8 @@ const CommandItem = React.forwardRef<
118
118
  ref={ref}
119
119
  className={cn(
120
120
  'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none',
121
- 'aria-selected:bg-level-3 aria-selected:text-accent',
122
- 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
121
+ 'data-selected:bg-level-3 aria-selected:text-accent',
122
+ 'data-[disabled]:pointer-events-none data-[disabled]:opacity-35',
123
123
  className
124
124
  )}
125
125
  {...props}
@@ -4,6 +4,7 @@ interface ListAdaptor<T> {
4
4
  valueEquals: (el: T, v: string) => boolean
5
5
  getLabel?: (el: T) => string
6
6
  getImageUrl?: (el: T) => string | null
7
+ isDisabled?: (el: T) => boolean
7
8
  }
8
9
 
9
10
  export {
@@ -15,7 +15,7 @@ const Switch = React.forwardRef<
15
15
  'border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none ' +
16
16
  'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ' +
17
17
  'focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 ' +
18
- 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-level-2',
18
+ 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-level-3',
19
19
  className
20
20
  )}
21
21
  {...props}
@@ -648,12 +648,17 @@ export default {
648
648
  20: '0.2',
649
649
  25: '0.25',
650
650
  30: '0.3',
651
+ 35: '0.35',
651
652
  40: '0.4',
653
+ 45: '0.45',
652
654
  50: '0.5',
655
+ 55: '0.55',
653
656
  60: '0.6',
657
+ 65: '0.65',
654
658
  70: '0.7',
655
659
  75: '0.75',
656
660
  80: '0.8',
661
+ 85: '0.85',
657
662
  90: '0.9',
658
663
  95: '0.95',
659
664
  100: '1',