funuicss 3.5.1 → 3.5.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.
- package/css/fun.css +477 -6
- package/index.d.ts +1 -0
- package/index.js +4 -2
- package/package.json +1 -1
- package/ui/input/SearchableInput.d.ts +38 -0
- package/ui/input/SearchableInput.js +258 -0
- package/ui/select/Select.d.ts +1 -0
- package/ui/select/Select.js +2 -2
- package/ui/table/Table.js +1 -1
package/css/fun.css
CHANGED
|
@@ -3519,8 +3519,14 @@ background-color: rgba(var(--borderRgb), 0.3);
|
|
|
3519
3519
|
|
|
3520
3520
|
}
|
|
3521
3521
|
|
|
3522
|
-
|
|
3523
|
-
|
|
3522
|
+
.custom-select {
|
|
3523
|
+
position: relative;
|
|
3524
|
+
width: 100%;
|
|
3525
|
+
border-radius: var(--InputButtonBorderRadius);
|
|
3526
|
+
/* FIX: Create a new stacking context and ensure proper layering */
|
|
3527
|
+
z-index: 999;
|
|
3528
|
+
isolation: isolate;
|
|
3529
|
+
}
|
|
3524
3530
|
|
|
3525
3531
|
.custom-select.fullWidth {max-width: none;}
|
|
3526
3532
|
|
|
@@ -3630,16 +3636,17 @@ border-top: none;
|
|
|
3630
3636
|
border-radius: 0 0 0.5rem 0.5rem;
|
|
3631
3637
|
max-height: 250px;
|
|
3632
3638
|
overflow: hidden;
|
|
3633
|
-
opacity: 0;
|
|
3639
|
+
/* opacity: 0; */
|
|
3634
3640
|
visibility: hidden;
|
|
3635
3641
|
transform: translateY(-10px);
|
|
3636
3642
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
|
3637
3643
|
box-shadow: var(--card);
|
|
3638
|
-
z-index
|
|
3644
|
+
/* FIX: Increased z-index and ensure it's above the parent's stacking context */
|
|
3645
|
+
z-index: 1001 !important;
|
|
3639
3646
|
}
|
|
3640
3647
|
|
|
3641
3648
|
.select-dropdown.open {
|
|
3642
|
-
opacity: 1;
|
|
3649
|
+
/* opacity: 1; */
|
|
3643
3650
|
visibility: visible;
|
|
3644
3651
|
transform: translateY(0);
|
|
3645
3652
|
|
|
@@ -3774,6 +3781,467 @@ padding-right: 2.5rem;
|
|
|
3774
3781
|
|
|
3775
3782
|
}
|
|
3776
3783
|
|
|
3784
|
+
|
|
3785
|
+
/* SearchableInput.css - Matching your theme format */
|
|
3786
|
+
|
|
3787
|
+
/* Reset and base styles */
|
|
3788
|
+
* {
|
|
3789
|
+
box-sizing: border-box;
|
|
3790
|
+
}
|
|
3791
|
+
|
|
3792
|
+
/* Main wrapper */
|
|
3793
|
+
.searchable-input-wrapper {
|
|
3794
|
+
position: relative;
|
|
3795
|
+
display: inline-block;
|
|
3796
|
+
font-family: inherit;
|
|
3797
|
+
}
|
|
3798
|
+
|
|
3799
|
+
.searchable-input-wrapper.full-width {
|
|
3800
|
+
display: block;
|
|
3801
|
+
width: 100%;
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
/* Label styles */
|
|
3805
|
+
.searchable-input__label {
|
|
3806
|
+
display: block;
|
|
3807
|
+
margin-bottom: 0.5rem;
|
|
3808
|
+
font-size: 0.875rem;
|
|
3809
|
+
font-weight: 500;
|
|
3810
|
+
color: var(--text-color);
|
|
3811
|
+
line-height: 1.4;
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
/* Container for input and dropdown */
|
|
3815
|
+
.searchable-input__container {
|
|
3816
|
+
position: relative;
|
|
3817
|
+
display: block;
|
|
3818
|
+
}
|
|
3819
|
+
|
|
3820
|
+
/* Input wrapper with icons */
|
|
3821
|
+
.searchable-input__input-wrapper {
|
|
3822
|
+
position: relative;
|
|
3823
|
+
display: flex;
|
|
3824
|
+
align-items: center;
|
|
3825
|
+
}
|
|
3826
|
+
|
|
3827
|
+
/* Base input styles */
|
|
3828
|
+
.searchable-input {
|
|
3829
|
+
width: 100%;
|
|
3830
|
+
height: var(--inputHeight);
|
|
3831
|
+
padding: 0.6rem 0.8rem;
|
|
3832
|
+
font-size: inherit;
|
|
3833
|
+
line-height: 1.5;
|
|
3834
|
+
color: var(--text-color);
|
|
3835
|
+
background-color: var(--background-color);
|
|
3836
|
+
border: none;
|
|
3837
|
+
border-bottom: var(--inputBorder) solid var(--border-color);
|
|
3838
|
+
border-radius: 0;
|
|
3839
|
+
outline: none;
|
|
3840
|
+
transition: 0.1s linear;
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
.searchable-input:focus {
|
|
3844
|
+
border-bottom: var(--inputBorder) solid var(--primary);
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
.searchable-input::placeholder {
|
|
3848
|
+
color: var(--text-muted);
|
|
3849
|
+
}
|
|
3850
|
+
|
|
3851
|
+
/* Full width modifier */
|
|
3852
|
+
.searchable-input.full-width {
|
|
3853
|
+
width: 100%;
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3856
|
+
/* Status modifiers */
|
|
3857
|
+
.searchable-input.success-input {
|
|
3858
|
+
border-bottom: var(--inputBorder) solid var(--success) !important;
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
.searchable-input.warning-input {
|
|
3862
|
+
border-bottom: var(--inputBorder) solid var(--warning) !important;
|
|
3863
|
+
}
|
|
3864
|
+
|
|
3865
|
+
.searchable-input.danger-input {
|
|
3866
|
+
border-bottom: var(--inputBorder) solid var(--danger) !important;
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
.searchable-input.success-input:focus,
|
|
3870
|
+
.searchable-input.warning-input:focus,
|
|
3871
|
+
.searchable-input.danger-input:focus {
|
|
3872
|
+
outline: none !important;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3875
|
+
/* Bordered input styles */
|
|
3876
|
+
.searchable-input.borderedInput {
|
|
3877
|
+
border: var(--border);
|
|
3878
|
+
border-radius: var(--InputButtonBorderRadius);
|
|
3879
|
+
transition: 0.1s linear;
|
|
3880
|
+
padding: 0.6rem 0.5rem;
|
|
3881
|
+
}
|
|
3882
|
+
|
|
3883
|
+
.searchable-input.borderedInput:focus {
|
|
3884
|
+
outline: var(--input_outline_size) solid var(--primary);
|
|
3885
|
+
box-shadow: 0 0 0 3px rgba(var(--borderRgb), 0.1);
|
|
3886
|
+
}
|
|
3887
|
+
|
|
3888
|
+
.searchable-input.success-input.borderedInput {
|
|
3889
|
+
border: var(--inputBorder) solid var(--success) !important;
|
|
3890
|
+
outline: var(--input_outline_size) solid var(--success);
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
.searchable-input.warning-input.borderedInput {
|
|
3894
|
+
border: var(--inputBorder) solid var(--warning) !important;
|
|
3895
|
+
outline: var(--input_outline_size) solid var(--warning);
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3898
|
+
.searchable-input.danger-input.borderedInput {
|
|
3899
|
+
border: var(--inputBorder) solid var(--danger) !important;
|
|
3900
|
+
outline: var(--input_outline_size) solid var(--danger);
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
/* Borderless input styles */
|
|
3904
|
+
.searchable-input.borderless {
|
|
3905
|
+
border: none !important;
|
|
3906
|
+
outline: none !important;
|
|
3907
|
+
background-color: var(--light);
|
|
3908
|
+
}
|
|
3909
|
+
|
|
3910
|
+
.searchable-input.borderless:focus {
|
|
3911
|
+
border: none !important;
|
|
3912
|
+
outline: none !important;
|
|
3913
|
+
background-color: rgba(var(--borderRgb), 0.3);
|
|
3914
|
+
}
|
|
3915
|
+
|
|
3916
|
+
/* Flat modifier */
|
|
3917
|
+
.searchable-input.flat {
|
|
3918
|
+
border-radius: 0;
|
|
3919
|
+
}
|
|
3920
|
+
|
|
3921
|
+
/* No outline */
|
|
3922
|
+
.searchable-input.no-outline {
|
|
3923
|
+
outline: none;
|
|
3924
|
+
}
|
|
3925
|
+
|
|
3926
|
+
/* Rounded modifiers */
|
|
3927
|
+
.searchable-input.round,
|
|
3928
|
+
.searchable-input.rounded {
|
|
3929
|
+
border-radius: 100rem !important;
|
|
3930
|
+
padding: var(--inputRoundedPadding);
|
|
3931
|
+
}
|
|
3932
|
+
|
|
3933
|
+
.searchable-input.left-rounded {
|
|
3934
|
+
border-top-left-radius: 100rem !important;
|
|
3935
|
+
border-bottom-left-radius: 100rem !important;
|
|
3936
|
+
padding-left: var(--inputRoundedPadding);
|
|
3937
|
+
}
|
|
3938
|
+
|
|
3939
|
+
.searchable-input.right-rounded {
|
|
3940
|
+
border-top-right-radius: 100rem !important;
|
|
3941
|
+
border-bottom-right-radius: 100rem !important;
|
|
3942
|
+
padding-right: var(--inputRoundedPadding);
|
|
3943
|
+
}
|
|
3944
|
+
|
|
3945
|
+
/* Icon spacing modifiers */
|
|
3946
|
+
.searchable-input.with-left-icon {
|
|
3947
|
+
padding-left: 2.5rem;
|
|
3948
|
+
}
|
|
3949
|
+
|
|
3950
|
+
.searchable-input.with-clear {
|
|
3951
|
+
padding-right: 4.5rem;
|
|
3952
|
+
}
|
|
3953
|
+
|
|
3954
|
+
/* Disabled state */
|
|
3955
|
+
.searchable-input:disabled {
|
|
3956
|
+
background-color: var(--disabled-bg, var(--light));
|
|
3957
|
+
color: var(--text-muted);
|
|
3958
|
+
cursor: not-allowed;
|
|
3959
|
+
opacity: 0.6;
|
|
3960
|
+
}
|
|
3961
|
+
|
|
3962
|
+
/* Left icon */
|
|
3963
|
+
.searchable-input__icon {
|
|
3964
|
+
position: absolute;
|
|
3965
|
+
display: flex;
|
|
3966
|
+
align-items: center;
|
|
3967
|
+
justify-content: center;
|
|
3968
|
+
pointer-events: none;
|
|
3969
|
+
color: var(--text-muted);
|
|
3970
|
+
z-index: 1;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
.searchable-input__icon--left {
|
|
3974
|
+
left: 0.75rem;
|
|
3975
|
+
top: 50%;
|
|
3976
|
+
transform: translateY(-50%);
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
/* Right actions container */
|
|
3980
|
+
.searchable-input__actions {
|
|
3981
|
+
position: absolute;
|
|
3982
|
+
right: 0.75rem;
|
|
3983
|
+
top: 50%;
|
|
3984
|
+
transform: translateY(-50%);
|
|
3985
|
+
display: flex;
|
|
3986
|
+
align-items: center;
|
|
3987
|
+
gap: 0.25rem;
|
|
3988
|
+
z-index: 1;
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
/* Clear button */
|
|
3992
|
+
.searchable-input__clear-btn {
|
|
3993
|
+
display: flex;
|
|
3994
|
+
align-items: center;
|
|
3995
|
+
justify-content: center;
|
|
3996
|
+
width: 1.25rem;
|
|
3997
|
+
height: 1.25rem;
|
|
3998
|
+
background: none;
|
|
3999
|
+
border: none;
|
|
4000
|
+
border-radius: 0.25rem;
|
|
4001
|
+
color: var(--text-muted);
|
|
4002
|
+
cursor: pointer;
|
|
4003
|
+
transition: 0.1s linear;
|
|
4004
|
+
}
|
|
4005
|
+
|
|
4006
|
+
.searchable-input__clear-btn:hover {
|
|
4007
|
+
color: var(--text-color);
|
|
4008
|
+
background-color: rgba(var(--borderRgb), 0.1);
|
|
4009
|
+
}
|
|
4010
|
+
|
|
4011
|
+
.searchable-input__clear-btn:focus {
|
|
4012
|
+
outline: var(--input_outline_size) solid var(--primary);
|
|
4013
|
+
}
|
|
4014
|
+
|
|
4015
|
+
/* Caret container */
|
|
4016
|
+
.searchable-input__caret {
|
|
4017
|
+
display: flex;
|
|
4018
|
+
align-items: center;
|
|
4019
|
+
justify-content: center;
|
|
4020
|
+
color: var(--text-muted);
|
|
4021
|
+
}
|
|
4022
|
+
|
|
4023
|
+
/* Caret icon */
|
|
4024
|
+
.searchable-input__caret-icon {
|
|
4025
|
+
transition: transform 0.2s ease;
|
|
4026
|
+
}
|
|
4027
|
+
|
|
4028
|
+
.searchable-input__caret-icon--open {
|
|
4029
|
+
transform: rotate(180deg);
|
|
4030
|
+
}
|
|
4031
|
+
|
|
4032
|
+
/* Loading spinner */
|
|
4033
|
+
.searchable-input__spinner {
|
|
4034
|
+
width: 1rem;
|
|
4035
|
+
height: 1rem;
|
|
4036
|
+
border: 2px solid rgba(var(--borderRgb), 0.3);
|
|
4037
|
+
border-top: 2px solid var(--primary);
|
|
4038
|
+
border-radius: 50%;
|
|
4039
|
+
animation: spin 1s linear infinite;
|
|
4040
|
+
}
|
|
4041
|
+
|
|
4042
|
+
@keyframes spin {
|
|
4043
|
+
0% { transform: rotate(0deg); }
|
|
4044
|
+
100% { transform: rotate(360deg); }
|
|
4045
|
+
}
|
|
4046
|
+
|
|
4047
|
+
/* Dropdown */
|
|
4048
|
+
.searchable-input__dropdown {
|
|
4049
|
+
position: absolute;
|
|
4050
|
+
left: 0;
|
|
4051
|
+
right: 0;
|
|
4052
|
+
z-index: 1000;
|
|
4053
|
+
background-color: var(--raiseThemes);
|
|
4054
|
+
backdrop-filter: var(--raiseBackdrop);
|
|
4055
|
+
border: var(--border);
|
|
4056
|
+
border-radius: var(--InputButtonBorderRadius);
|
|
4057
|
+
box-shadow: var(--shadow);
|
|
4058
|
+
overflow: hidden;
|
|
4059
|
+
animation: dropdown-appear 0.15s ease-out;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
.searchable-input__dropdown--up {
|
|
4063
|
+
bottom: 100%;
|
|
4064
|
+
margin-bottom: 0.25rem;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
.searchable-input__dropdown--down {
|
|
4068
|
+
top: 100%;
|
|
4069
|
+
margin-top: 0.25rem;
|
|
4070
|
+
}
|
|
4071
|
+
|
|
4072
|
+
@keyframes dropdown-appear {
|
|
4073
|
+
0% {
|
|
4074
|
+
opacity: 0;
|
|
4075
|
+
transform: translateY(-0.25rem);
|
|
4076
|
+
}
|
|
4077
|
+
100% {
|
|
4078
|
+
opacity: 1;
|
|
4079
|
+
transform: translateY(0);
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
|
|
4083
|
+
/* Dropdown content */
|
|
4084
|
+
.searchable-input__dropdown-content {
|
|
4085
|
+
padding: 0.25rem 0;
|
|
4086
|
+
overflow-y: auto;
|
|
4087
|
+
max-height: 12.5rem;
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
.searchable-input__dropdown-content::-webkit-scrollbar {
|
|
4091
|
+
width: 0.375rem;
|
|
4092
|
+
}
|
|
4093
|
+
|
|
4094
|
+
.searchable-input__dropdown-content::-webkit-scrollbar-track {
|
|
4095
|
+
background: rgba(var(--borderRgb), 0.1);
|
|
4096
|
+
}
|
|
4097
|
+
|
|
4098
|
+
.searchable-input__dropdown-content::-webkit-scrollbar-thumb {
|
|
4099
|
+
background: rgba(var(--borderRgb), 0.3);
|
|
4100
|
+
border-radius: 0.1875rem;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
.searchable-input__dropdown-content::-webkit-scrollbar-thumb:hover {
|
|
4104
|
+
background: rgba(var(--borderRgb), 0.5);
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
/* Option item */
|
|
4108
|
+
.searchable-input__option {
|
|
4109
|
+
padding: 0.75rem 1rem;
|
|
4110
|
+
cursor: pointer;
|
|
4111
|
+
transition: 0.1s linear;
|
|
4112
|
+
border-bottom: 1px solid rgba(var(--borderRgb), 0.1);
|
|
4113
|
+
color: var(--text-color);
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
.searchable-input__option:last-child {
|
|
4117
|
+
border-bottom: none;
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
.searchable-input__option:hover {
|
|
4121
|
+
background-color: rgba(var(--borderRgb), 0.1);
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4124
|
+
.searchable-input__option--highlighted {
|
|
4125
|
+
background-color: rgba(var(--primaryRgb), 0.1);
|
|
4126
|
+
}
|
|
4127
|
+
|
|
4128
|
+
.searchable-input__option--selected {
|
|
4129
|
+
background-color: rgba(var(--primaryRgb), 0.2);
|
|
4130
|
+
color: var(--primary);
|
|
4131
|
+
font-weight: 500;
|
|
4132
|
+
}
|
|
4133
|
+
|
|
4134
|
+
/* Option text */
|
|
4135
|
+
.searchable-input__option-text {
|
|
4136
|
+
font-size: 0.875rem;
|
|
4137
|
+
line-height: 1.4;
|
|
4138
|
+
color: inherit;
|
|
4139
|
+
margin-bottom: 0.125rem;
|
|
4140
|
+
}
|
|
4141
|
+
|
|
4142
|
+
/* Option value (when different from text) */
|
|
4143
|
+
.searchable-input__option-value {
|
|
4144
|
+
font-size: 0.75rem;
|
|
4145
|
+
line-height: 1.3;
|
|
4146
|
+
color: var(--text-muted);
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
.searchable-input__option--selected .searchable-input__option-value {
|
|
4150
|
+
color: var(--primary);
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
/* Highlight matching text */
|
|
4154
|
+
.searchable-input__highlight {
|
|
4155
|
+
background-color: var(--warning);
|
|
4156
|
+
color: var(--text-color);
|
|
4157
|
+
font-weight: 600;
|
|
4158
|
+
padding: 0.0625rem 0.125rem;
|
|
4159
|
+
border-radius: 0.125rem;
|
|
4160
|
+
}
|
|
4161
|
+
|
|
4162
|
+
/* No data message */
|
|
4163
|
+
.searchable-input__no-data {
|
|
4164
|
+
padding: 1rem;
|
|
4165
|
+
text-align: center;
|
|
4166
|
+
color: var(--text-muted);
|
|
4167
|
+
font-size: 0.875rem;
|
|
4168
|
+
font-style: italic;
|
|
4169
|
+
}
|
|
4170
|
+
|
|
4171
|
+
/* Extra content */
|
|
4172
|
+
.searchable-input__extra {
|
|
4173
|
+
margin-top: 0.375rem;
|
|
4174
|
+
font-size: 0.75rem;
|
|
4175
|
+
line-height: 1.4;
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4178
|
+
|
|
4179
|
+
/* Responsive design */
|
|
4180
|
+
@media (max-width: 640px) {
|
|
4181
|
+
.searchable-input-wrapper {
|
|
4182
|
+
width: 100%;
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4185
|
+
.searchable-input {
|
|
4186
|
+
min-height: var(--inputHeight);
|
|
4187
|
+
font-size: 1rem; /* Prevents zoom on iOS */
|
|
4188
|
+
}
|
|
4189
|
+
|
|
4190
|
+
.searchable-input__dropdown {
|
|
4191
|
+
left: -0.25rem;
|
|
4192
|
+
right: -0.25rem;
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
|
|
4196
|
+
/* Focus-visible for better accessibility */
|
|
4197
|
+
.searchable-input:focus-visible {
|
|
4198
|
+
outline: var(--input_outline_size) solid var(--primary);
|
|
4199
|
+
outline-offset: 0.125rem;
|
|
4200
|
+
}
|
|
4201
|
+
|
|
4202
|
+
.searchable-input__clear-btn:focus-visible {
|
|
4203
|
+
outline: var(--input_outline_size) solid var(--primary);
|
|
4204
|
+
outline-offset: 0.0625rem;
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4207
|
+
/* High contrast mode support */
|
|
4208
|
+
@media (prefers-contrast: high) {
|
|
4209
|
+
.searchable-input {
|
|
4210
|
+
border-width: 0.1875rem;
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4213
|
+
.searchable-input__option--highlighted {
|
|
4214
|
+
background-color: var(--text-color);
|
|
4215
|
+
color: var(--background-color);
|
|
4216
|
+
}
|
|
4217
|
+
|
|
4218
|
+
.searchable-input__highlight {
|
|
4219
|
+
background-color: var(--warning);
|
|
4220
|
+
color: var(--text-color);
|
|
4221
|
+
border: 1px solid var(--text-color);
|
|
4222
|
+
}
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4225
|
+
/* Reduced motion */
|
|
4226
|
+
@media (prefers-reduced-motion: reduce) {
|
|
4227
|
+
.searchable-input,
|
|
4228
|
+
.searchable-input__caret-icon,
|
|
4229
|
+
.searchable-input__clear-btn,
|
|
4230
|
+
.searchable-input__option {
|
|
4231
|
+
transition: none;
|
|
4232
|
+
}
|
|
4233
|
+
|
|
4234
|
+
.searchable-input__dropdown {
|
|
4235
|
+
animation: none;
|
|
4236
|
+
}
|
|
4237
|
+
|
|
4238
|
+
.searchable-input__spinner {
|
|
4239
|
+
animation: none;
|
|
4240
|
+
}
|
|
4241
|
+
}
|
|
4242
|
+
|
|
4243
|
+
|
|
4244
|
+
|
|
3777
4245
|
@media screen and (max-width: 800px){
|
|
3778
4246
|
.input , input, textarea , .bubble-editor , .bubble-editor-container{
|
|
3779
4247
|
font-size: 16px !important;
|
|
@@ -8763,4 +9231,7 @@ background-color: rgba(0, 0, 0, 0.2);
|
|
|
8763
9231
|
}
|
|
8764
9232
|
.ql-container.ql-snow {
|
|
8765
9233
|
border: 1px solid #ccc;
|
|
8766
|
-
}
|
|
9234
|
+
}
|
|
9235
|
+
|
|
9236
|
+
|
|
9237
|
+
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { default as Container } from "./ui/container/Container";
|
|
|
7
7
|
export { default as Grid } from "./ui/grid/Grid";
|
|
8
8
|
export { default as Col } from "./ui/grid/Col";
|
|
9
9
|
export { default as Input } from "./ui/input/Input";
|
|
10
|
+
export { default as SearchableInput } from "./ui/input/SearchableInput";
|
|
10
11
|
export { default as Loader } from "./ui/loader/Loader";
|
|
11
12
|
export { default as Modal } from "./ui/modal/Modal";
|
|
12
13
|
export { default as Table } from "./ui/table/Table";
|
package/index.js
CHANGED
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.GoogleAnalytics = exports.FunGet = exports.Cookie = exports.Select = exports.ScrollToTop = exports.FlexItem = exports.Slider = exports.Vista = exports.Calendar = void 0;
|
|
6
|
+
exports.View = exports.ScrollInView = exports.Accordion = exports.Flex = exports.RichText = exports.Carousel = exports.Video = exports.SideBar = exports.ChartPie = exports.Lines = exports.Bars = exports.FullCenteredPage = exports.CircleGroup = exports.Circle = exports.Hr = exports.Section = exports.RowFlex = exports.Tip = exports.AppBar = exports.ToolTip = exports.Notification = exports.FunLoader = exports.ProgressBar = exports.DropMenu = exports.DropItem = exports.Dropdown = exports.DropDown = exports.DropUp = exports.UnAuthorized = exports.NotFound = exports.StepLine = exports.StepHeader = exports.Step = exports.StepContainer = exports.Div = exports.Text = exports.List = exports.Table = exports.Modal = exports.Loader = exports.SearchableInput = exports.Input = exports.Col = exports.Grid = exports.Container = exports.BreadCrumb = exports.Card = exports.Button = exports.ThemeProvider = exports.Alert = void 0;
|
|
7
|
+
exports.GoogleAnalytics = exports.FunGet = exports.Cookie = exports.Select = exports.ScrollToTop = exports.FlexItem = exports.Slider = exports.Vista = exports.Calendar = exports.DatePicker = void 0;
|
|
8
8
|
var Alert_1 = require("./ui/alert/Alert");
|
|
9
9
|
Object.defineProperty(exports, "Alert", { enumerable: true, get: function () { return __importDefault(Alert_1).default; } });
|
|
10
10
|
var theme_1 = require("./ui/theme/theme");
|
|
@@ -23,6 +23,8 @@ var Col_1 = require("./ui/grid/Col");
|
|
|
23
23
|
Object.defineProperty(exports, "Col", { enumerable: true, get: function () { return __importDefault(Col_1).default; } });
|
|
24
24
|
var Input_1 = require("./ui/input/Input");
|
|
25
25
|
Object.defineProperty(exports, "Input", { enumerable: true, get: function () { return __importDefault(Input_1).default; } });
|
|
26
|
+
var SearchableInput_1 = require("./ui/input/SearchableInput");
|
|
27
|
+
Object.defineProperty(exports, "SearchableInput", { enumerable: true, get: function () { return __importDefault(SearchableInput_1).default; } });
|
|
26
28
|
var Loader_1 = require("./ui/loader/Loader");
|
|
27
29
|
Object.defineProperty(exports, "Loader", { enumerable: true, get: function () { return __importDefault(Loader_1).default; } });
|
|
28
30
|
var Modal_1 = require("./ui/modal/Modal");
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.5.
|
|
2
|
+
"version": "3.5.3",
|
|
3
3
|
"name": "funuicss",
|
|
4
4
|
"description": "React and Next.js component UI Library for creating Easy and good looking websites with fewer lines of code. Elevate your web development experience with our cutting-edge React/Next.js component UI Library. Craft stunning websites effortlessly, boasting both seamless functionality and aesthetic appeal—all achieved with minimal lines of code. Unleash the power of simplicity and style in your projects!",
|
|
5
5
|
"main": "index.js",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SearchableOption {
|
|
3
|
+
value: string | number;
|
|
4
|
+
text: string;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
interface SearchableInputProps {
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
status?: 'error' | 'success' | 'warning' | 'default';
|
|
11
|
+
funcss?: string;
|
|
12
|
+
bg?: string;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
flat?: boolean;
|
|
15
|
+
rounded?: boolean;
|
|
16
|
+
leftRounded?: boolean;
|
|
17
|
+
rightRounded?: boolean;
|
|
18
|
+
label?: string;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
extra?: React.ReactNode;
|
|
22
|
+
value?: string;
|
|
23
|
+
data?: SearchableOption[];
|
|
24
|
+
onSelect?: (option: SearchableOption) => void;
|
|
25
|
+
onChange?: (value: string) => void;
|
|
26
|
+
onInputChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
27
|
+
dropDirection?: 'up' | 'down';
|
|
28
|
+
maxHeight?: string;
|
|
29
|
+
minChars?: number;
|
|
30
|
+
clearable?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
noDataText?: string;
|
|
34
|
+
autoComplete?: boolean;
|
|
35
|
+
highlightMatch?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare const SearchableInput: React.FC<SearchableInputProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'>>;
|
|
38
|
+
export default SearchableInput;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __assign = (this && this.__assign) || function () {
|
|
4
|
+
__assign = Object.assign || function(t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
+
t[p] = s[p];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
return __assign.apply(this, arguments);
|
|
13
|
+
};
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
48
|
+
var t = {};
|
|
49
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
50
|
+
t[p] = s[p];
|
|
51
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
52
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
53
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
54
|
+
t[p[i]] = s[p[i]];
|
|
55
|
+
}
|
|
56
|
+
return t;
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
var react_1 = __importStar(require("react"));
|
|
60
|
+
var pi_1 = require("react-icons/pi");
|
|
61
|
+
// Mock function - replace with your actual function
|
|
62
|
+
var generateInputClasses = function (options) {
|
|
63
|
+
var baseClasses = 'input-base border border-gray-300 px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500';
|
|
64
|
+
var statusClasses = {
|
|
65
|
+
error: 'border-red-500 focus:ring-red-500',
|
|
66
|
+
success: 'border-green-500 focus:ring-green-500',
|
|
67
|
+
warning: 'border-yellow-500 focus:ring-yellow-500',
|
|
68
|
+
default: 'border-gray-300 focus:ring-blue-500'
|
|
69
|
+
};
|
|
70
|
+
var classes = baseClasses;
|
|
71
|
+
if (options.status) {
|
|
72
|
+
classes += ' ' + statusClasses[options.status];
|
|
73
|
+
}
|
|
74
|
+
if (options.rounded)
|
|
75
|
+
classes += ' rounded-lg';
|
|
76
|
+
if (options.leftRounded)
|
|
77
|
+
classes += ' rounded-l-lg';
|
|
78
|
+
if (options.rightRounded)
|
|
79
|
+
classes += ' rounded-r-lg';
|
|
80
|
+
if (options.flat)
|
|
81
|
+
classes += ' shadow-none';
|
|
82
|
+
if (options.fullWidth)
|
|
83
|
+
classes += ' w-full';
|
|
84
|
+
if (options.additionalClasses)
|
|
85
|
+
classes += ' ' + options.additionalClasses;
|
|
86
|
+
return classes;
|
|
87
|
+
};
|
|
88
|
+
var SearchableInput = function (_a) {
|
|
89
|
+
var _b = _a.id, id = _b === void 0 ? 'searchableInput' : _b, name = _a.name, _c = _a.status, status = _c === void 0 ? 'default' : _c, funcss = _a.funcss, bg = _a.bg, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, _e = _a.flat, flat = _e === void 0 ? false : _e, _f = _a.rounded, rounded = _f === void 0 ? false : _f, _g = _a.leftRounded, leftRounded = _g === void 0 ? false : _g, _h = _a.rightRounded, rightRounded = _h === void 0 ? false : _h, label = _a.label, _j = _a.placeholder, placeholder = _j === void 0 ? 'Search...' : _j, icon = _a.icon, extra = _a.extra, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.data, data = _l === void 0 ? [] : _l, onSelect = _a.onSelect, onChange = _a.onChange, onInputChange = _a.onInputChange, _m = _a.dropDirection, dropDirection = _m === void 0 ? 'up' : _m, _o = _a.maxHeight, maxHeight = _o === void 0 ? '200px' : _o, _p = _a.minChars, minChars = _p === void 0 ? 1 : _p, _q = _a.clearable, clearable = _q === void 0 ? true : _q, _r = _a.disabled, disabled = _r === void 0 ? false : _r, _s = _a.loading, loading = _s === void 0 ? false : _s, _t = _a.noDataText, noDataText = _t === void 0 ? 'No results found' : _t, _u = _a.autoComplete, autoComplete = _u === void 0 ? true : _u, _v = _a.highlightMatch, highlightMatch = _v === void 0 ? true : _v, rest = __rest(_a, ["id", "name", "status", "funcss", "bg", "fullWidth", "flat", "rounded", "leftRounded", "rightRounded", "label", "placeholder", "icon", "extra", "value", "data", "onSelect", "onChange", "onInputChange", "dropDirection", "maxHeight", "minChars", "clearable", "disabled", "loading", "noDataText", "autoComplete", "highlightMatch"]);
|
|
90
|
+
var _w = (0, react_1.useState)(value), inputValue = _w[0], setInputValue = _w[1];
|
|
91
|
+
var _x = (0, react_1.useState)(false), isOpen = _x[0], setIsOpen = _x[1];
|
|
92
|
+
var _y = (0, react_1.useState)(-1), highlightedIndex = _y[0], setHighlightedIndex = _y[1];
|
|
93
|
+
var _z = (0, react_1.useState)(null), selectedOption = _z[0], setSelectedOption = _z[1];
|
|
94
|
+
var inputRef = (0, react_1.useRef)(null);
|
|
95
|
+
var dropdownRef = (0, react_1.useRef)(null);
|
|
96
|
+
var optionRefs = (0, react_1.useRef)([]);
|
|
97
|
+
// Filter and sort options based on input
|
|
98
|
+
var filteredOptions = (0, react_1.useMemo)(function () {
|
|
99
|
+
if (!inputValue || inputValue.length < minChars)
|
|
100
|
+
return [];
|
|
101
|
+
var filtered = data.filter(function (option) {
|
|
102
|
+
return option.text.toLowerCase().includes(inputValue.toLowerCase()) ||
|
|
103
|
+
option.value.toString().toLowerCase().includes(inputValue.toLowerCase());
|
|
104
|
+
});
|
|
105
|
+
// Sort by relevance (exact matches first, then starts with, then contains)
|
|
106
|
+
return filtered.sort(function (a, b) {
|
|
107
|
+
var aText = a.text.toLowerCase();
|
|
108
|
+
var bText = b.text.toLowerCase();
|
|
109
|
+
var query = inputValue.toLowerCase();
|
|
110
|
+
if (aText === query)
|
|
111
|
+
return -1;
|
|
112
|
+
if (bText === query)
|
|
113
|
+
return 1;
|
|
114
|
+
if (aText.startsWith(query) && !bText.startsWith(query))
|
|
115
|
+
return -1;
|
|
116
|
+
if (bText.startsWith(query) && !aText.startsWith(query))
|
|
117
|
+
return 1;
|
|
118
|
+
return 0;
|
|
119
|
+
});
|
|
120
|
+
}, [inputValue, data, minChars]);
|
|
121
|
+
// Auto-complete logic
|
|
122
|
+
(0, react_1.useEffect)(function () {
|
|
123
|
+
if (autoComplete && filteredOptions.length > 0 && inputValue) {
|
|
124
|
+
var exactMatch = filteredOptions.find(function (option) {
|
|
125
|
+
return option.text.toLowerCase() === inputValue.toLowerCase();
|
|
126
|
+
});
|
|
127
|
+
if (exactMatch) {
|
|
128
|
+
setSelectedOption(exactMatch);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}, [filteredOptions, inputValue, autoComplete]);
|
|
132
|
+
// Handle input change
|
|
133
|
+
var handleInputChange = function (e) {
|
|
134
|
+
var newValue = e.target.value;
|
|
135
|
+
setInputValue(newValue);
|
|
136
|
+
setIsOpen(newValue.length >= minChars);
|
|
137
|
+
setHighlightedIndex(-1);
|
|
138
|
+
setSelectedOption(null);
|
|
139
|
+
if (onChange)
|
|
140
|
+
onChange(newValue);
|
|
141
|
+
if (onInputChange)
|
|
142
|
+
onInputChange(e);
|
|
143
|
+
};
|
|
144
|
+
// Handle option selection
|
|
145
|
+
var handleOptionSelect = function (option) {
|
|
146
|
+
setInputValue(option.text);
|
|
147
|
+
setSelectedOption(option);
|
|
148
|
+
setIsOpen(false);
|
|
149
|
+
setHighlightedIndex(-1);
|
|
150
|
+
if (onSelect)
|
|
151
|
+
onSelect(option);
|
|
152
|
+
if (onChange)
|
|
153
|
+
onChange(option.text);
|
|
154
|
+
};
|
|
155
|
+
// Handle keyboard navigation
|
|
156
|
+
var handleKeyDown = function (e) {
|
|
157
|
+
if (!isOpen || filteredOptions.length === 0)
|
|
158
|
+
return;
|
|
159
|
+
switch (e.key) {
|
|
160
|
+
case 'ArrowDown':
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
setHighlightedIndex(function (prev) {
|
|
163
|
+
return prev < filteredOptions.length - 1 ? prev + 1 : 0;
|
|
164
|
+
});
|
|
165
|
+
break;
|
|
166
|
+
case 'ArrowUp':
|
|
167
|
+
e.preventDefault();
|
|
168
|
+
setHighlightedIndex(function (prev) {
|
|
169
|
+
return prev > 0 ? prev - 1 : filteredOptions.length - 1;
|
|
170
|
+
});
|
|
171
|
+
break;
|
|
172
|
+
case 'Enter':
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
if (highlightedIndex >= 0) {
|
|
175
|
+
handleOptionSelect(filteredOptions[highlightedIndex]);
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
case 'Escape':
|
|
179
|
+
setIsOpen(false);
|
|
180
|
+
setHighlightedIndex(-1);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
// Scroll highlighted option into view
|
|
185
|
+
(0, react_1.useEffect)(function () {
|
|
186
|
+
var _a;
|
|
187
|
+
if (highlightedIndex >= 0 && optionRefs.current[highlightedIndex]) {
|
|
188
|
+
(_a = optionRefs.current[highlightedIndex]) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
189
|
+
behavior: 'smooth',
|
|
190
|
+
block: 'nearest'
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}, [highlightedIndex]);
|
|
194
|
+
// Close dropdown when clicking outside
|
|
195
|
+
(0, react_1.useEffect)(function () {
|
|
196
|
+
var handleClickOutside = function (event) {
|
|
197
|
+
if (dropdownRef.current && !dropdownRef.current.contains(event.target) &&
|
|
198
|
+
inputRef.current && !inputRef.current.contains(event.target)) {
|
|
199
|
+
setIsOpen(false);
|
|
200
|
+
setHighlightedIndex(-1);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
204
|
+
return function () { return document.removeEventListener('mousedown', handleClickOutside); };
|
|
205
|
+
}, []);
|
|
206
|
+
// Clear input
|
|
207
|
+
var handleClear = function () {
|
|
208
|
+
var _a;
|
|
209
|
+
setInputValue('');
|
|
210
|
+
setSelectedOption(null);
|
|
211
|
+
setIsOpen(false);
|
|
212
|
+
if (onChange)
|
|
213
|
+
onChange('');
|
|
214
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
215
|
+
};
|
|
216
|
+
// Highlight matching text
|
|
217
|
+
var highlightText = function (text, highlight) {
|
|
218
|
+
if (!highlightMatch || !highlight)
|
|
219
|
+
return text;
|
|
220
|
+
var parts = text.split(new RegExp("(".concat(highlight, ")"), 'gi'));
|
|
221
|
+
return parts.map(function (part, index) {
|
|
222
|
+
return part.toLowerCase() === highlight.toLowerCase() ? (react_1.default.createElement("span", { key: index, className: "bg-yellow-200 font-medium" }, part)) : part;
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
var className = generateInputClasses({
|
|
226
|
+
status: status,
|
|
227
|
+
rounded: rounded,
|
|
228
|
+
bg: bg,
|
|
229
|
+
funcss: funcss,
|
|
230
|
+
flat: flat,
|
|
231
|
+
leftRounded: leftRounded,
|
|
232
|
+
rightRounded: rightRounded,
|
|
233
|
+
bordered: true,
|
|
234
|
+
borderless: false,
|
|
235
|
+
fullWidth: fullWidth,
|
|
236
|
+
additionalClasses: 'searchableInput'
|
|
237
|
+
});
|
|
238
|
+
var containerStyle = fullWidth ? { width: '100%' } : undefined;
|
|
239
|
+
var dropdownClasses = "absolute z-50 bg-white border border-gray-300 rounded-md shadow-lg ".concat(dropDirection === 'up' ? 'bottom-full mb-1' : 'top-full mt-1', " left-0 right-0");
|
|
240
|
+
return (react_1.default.createElement("div", { className: "searchableInput-wrapper relative", style: containerStyle },
|
|
241
|
+
label && (react_1.default.createElement("label", { htmlFor: id, className: "block text-sm font-medium text-gray-700 mb-1" }, label)),
|
|
242
|
+
react_1.default.createElement("div", { className: "relative" },
|
|
243
|
+
react_1.default.createElement("div", { className: "relative flex items-center" },
|
|
244
|
+
icon && (react_1.default.createElement("div", { className: "absolute left-3 pointer-events-none text-gray-400" }, icon)),
|
|
245
|
+
react_1.default.createElement("input", __assign({ ref: inputRef, id: id, name: name, type: "text", className: "".concat(className, " ").concat(icon ? 'pl-10' : '', " ").concat(clearable && inputValue ? 'pr-16' : 'pr-10'), placeholder: placeholder, value: inputValue, onChange: handleInputChange, onKeyDown: handleKeyDown, onFocus: function () { return inputValue.length >= minChars && setIsOpen(true); }, disabled: disabled }, rest)),
|
|
246
|
+
react_1.default.createElement("div", { className: "absolute right-3 flex items-center space-x-1" },
|
|
247
|
+
clearable && inputValue && !disabled && (react_1.default.createElement("button", { type: "button", onClick: handleClear, className: "text-gray-400 hover:text-gray-600 p-1", tabIndex: -1 },
|
|
248
|
+
react_1.default.createElement(pi_1.PiX, { size: 16 }))),
|
|
249
|
+
react_1.default.createElement("div", { className: "text-gray-400" }, loading ? (react_1.default.createElement("div", { className: "animate-spin w-4 h-4 border-2 border-gray-300 border-t-gray-600 rounded-full" })) : (react_1.default.createElement(pi_1.PiCaretDown, { size: 16, className: "transition-transform ".concat(isOpen ? 'rotate-180' : '') }))))),
|
|
250
|
+
isOpen && !disabled && (react_1.default.createElement("div", { ref: dropdownRef, className: dropdownClasses, style: { maxHeight: maxHeight } },
|
|
251
|
+
react_1.default.createElement("div", { className: "py-1 overflow-y-auto", style: { maxHeight: maxHeight } }, filteredOptions.length > 0 ? (filteredOptions.map(function (option, index) { return (react_1.default.createElement("div", { key: "".concat(option.value, "-").concat(index), ref: function (el) {
|
|
252
|
+
optionRefs.current[index] = el;
|
|
253
|
+
}, className: "px-3 py-2 cursor-pointer hover:bg-blue-50 ".concat(index === highlightedIndex ? 'bg-blue-100' : '', " ").concat((selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.value) === option.value ? 'bg-blue-50' : ''), onClick: function () { return handleOptionSelect(option); } },
|
|
254
|
+
react_1.default.createElement("div", { className: "text-sm text-gray-900" }, highlightText(option.text, inputValue)),
|
|
255
|
+
option.value !== option.text && (react_1.default.createElement("div", { className: "text-xs text-gray-500" }, option.value)))); })) : (react_1.default.createElement("div", { className: "px-3 py-2 text-sm text-gray-500" }, noDataText)))))),
|
|
256
|
+
extra && react_1.default.createElement("div", { className: "searchableInput-extra mt-1" }, extra)));
|
|
257
|
+
};
|
|
258
|
+
exports.default = SearchableInput;
|
package/ui/select/Select.d.ts
CHANGED
package/ui/select/Select.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
var react_1 = __importStar(require("react"));
|
|
37
37
|
var Select = function (_a) {
|
|
38
|
-
var id = _a.id, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, _b = _a.
|
|
38
|
+
var id = _a.id, name = _a.name, value = _a.value, defaultValue = _a.defaultValue, _b = _a.label, label = _b === void 0 ? 'Select an option' : _b, _c = _a.options, options = _c === void 0 ? [] : _c, onChange = _a.onChange, onBlur = _a.onBlur, _d = _a.searchable, searchable = _d === void 0 ? true : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.bordered, bordered = _f === void 0 ? false : _f, _g = _a.borderless, borderless = _g === void 0 ? false : _g, _h = _a.rounded, rounded = _h === void 0 ? false : _h, _j = _a.flat, flat = _j === void 0 ? false : _j, _k = _a.fullWidth, fullWidth = _k === void 0 ? false : _k, _l = _a.status, status = _l === void 0 ? '' : _l, _m = _a.className, className = _m === void 0 ? '' : _m, _o = _a.funcss, funcss = _o === void 0 ? '' : _o, _p = _a.style, style = _p === void 0 ? {} : _p, _q = _a.searchAutoFocus, searchAutoFocus = _q === void 0 ? false : _q;
|
|
39
39
|
var _r = (0, react_1.useState)(false), isOpen = _r[0], setIsOpen = _r[1];
|
|
40
40
|
var _s = (0, react_1.useState)(null), selectedOption = _s[0], setSelectedOption = _s[1];
|
|
41
41
|
var _t = (0, react_1.useState)(''), searchQuery = _t[0], setSearchQuery = _t[1];
|
|
@@ -179,7 +179,7 @@ var Select = function (_a) {
|
|
|
179
179
|
};
|
|
180
180
|
return (react_1.default.createElement("div", { ref: containerRef, className: "".concat(funcss, " ").concat(rounded && 'round-edge', " ").concat(getContainerClasses()), style: style },
|
|
181
181
|
react_1.default.createElement("div", { ref: triggerRef, className: "".concat(funcss, " ").concat(rounded && 'round-edge', " ").concat(getTriggerClasses()), onClick: openDropdown, onKeyDown: handleKeyDown, tabIndex: disabled ? -1 : 0, role: "button", "aria-expanded": isOpen, "aria-haspopup": "listbox" },
|
|
182
|
-
react_1.default.createElement("span", { className: "select-value ".concat(!selectedOption ? 'select-placeholder' : '') }, selectedOption ? selectedOption.text :
|
|
182
|
+
react_1.default.createElement("span", { className: "select-value ".concat(!selectedOption ? 'select-placeholder' : '') }, selectedOption ? selectedOption.text : label),
|
|
183
183
|
react_1.default.createElement("div", { className: "select-arrow ".concat(isOpen ? 'open' : '') },
|
|
184
184
|
react_1.default.createElement("svg", { width: "16", height: "16", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
|
|
185
185
|
react_1.default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M19 9l-7 7-7-7" })))),
|
package/ui/table/Table.js
CHANGED
|
@@ -111,7 +111,7 @@ function Table(_a) {
|
|
|
111
111
|
var _o = (0, react_1.useState)(""), searchQuery = _o[0], setsearchQuery = _o[1];
|
|
112
112
|
React.useEffect(function () {
|
|
113
113
|
if (clearSearch) {
|
|
114
|
-
setsearchQuery(
|
|
114
|
+
setsearchQuery("");
|
|
115
115
|
}
|
|
116
116
|
}, [clearSearch]);
|
|
117
117
|
// Enhanced filter logic:
|