nitro-web 0.2.20 → 0.2.21
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.
|
@@ -225,9 +225,7 @@ function SelectBase<IsMulti extends boolean = false>({
|
|
|
225
225
|
// Input container
|
|
226
226
|
control: (p) => getSelectClassName({ name: 'control', hasError: !!error, ...p, classNames: classNames }),
|
|
227
227
|
// Clearable: zero right padding (X is padded itself). Dont twMerge: valueContainer keeps optional px-input-x.
|
|
228
|
-
valueContainer: () => getSelectClassName({ name: 'valueContainer', classNames: classNames })
|
|
229
|
-
+ ((props.isClearable ?? props.isMulti) ? ' pr-0.5' : ''), // we rely on the clearable x icon padding
|
|
230
|
-
// Input container objects
|
|
228
|
+
valueContainer: () => getSelectClassName({ name: 'valueContainer', classNames: classNames }),
|
|
231
229
|
input: () => getSelectClassName({ name: 'input', hasError: !!error, classNames: classNames }),
|
|
232
230
|
multiValue: () => getSelectClassName({ name: 'multiValue', classNames: classNames }),
|
|
233
231
|
multiValueLabel: () => '',
|
|
@@ -526,9 +524,9 @@ const selectClassNames = {
|
|
|
526
524
|
disabled: 'text-input-disabled',
|
|
527
525
|
},
|
|
528
526
|
// Icon indicators
|
|
529
|
-
clearIndicator: 'text-gray-500 p-1 rounded-md hover:bg-red-50 hover:text-danger-foreground',
|
|
527
|
+
clearIndicator: 'text-gray-500 p-1 rounded-md hover:bg-red-50 hover:text-danger-foreground ml-[-0.8em]',
|
|
530
528
|
dropdownIndicator: 'p-1 hover:bg-gray-100 text-gray-500 rounded-md hover:text-black',
|
|
531
|
-
indicatorsContainer: 'p-1 pl-0 pr-2 gap-1',
|
|
529
|
+
indicatorsContainer: 'p-1 pl-0 pr-2 gap-1 relative', // relative so the hitbox goes over the control
|
|
532
530
|
indicatorSeparator: 'py-0.5 before:content-[""] before:block before:bg-gray-100 before:w-px before:h-full',
|
|
533
531
|
// Dropdown menu
|
|
534
532
|
menu: 'mt-1.5 border border-dropdown-ul-border bg-white rounded-md text-input-base overflow-hidden shadow-dropdown-ul',
|
|
@@ -568,7 +566,9 @@ type ClassNames = {
|
|
|
568
566
|
flag?: string
|
|
569
567
|
}
|
|
570
568
|
|
|
571
|
-
export function getSelectClassName({
|
|
569
|
+
export function getSelectClassName({
|
|
570
|
+
name, isFocused, isSelected, isDisabled, hasError, usePrefixes, classNames,
|
|
571
|
+
}: GetSelectClassName) {
|
|
572
572
|
// Returns a class list that conditionally includes hover/focus modifier classes, or uses CSS modifiers, e.g. hover:, focus:
|
|
573
573
|
// @ts-expect-error
|
|
574
574
|
const obj = classNames?.[name] || selectClassNames[name]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|