@rovula/ui 0.0.42 → 0.0.44

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.
@@ -26,6 +26,8 @@ export type DropdownProps = {
26
26
  required?: boolean;
27
27
  className?: string;
28
28
  optionContainerClassName?: string;
29
+ optionItemClassName?: string;
30
+ optionNotFoundItemClassName?: string;
29
31
  options: Options[];
30
32
  value?: Options;
31
33
  onChangeText?: InputProps["onChange"];
@@ -51,6 +53,8 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
51
53
  required?: boolean | undefined;
52
54
  className?: string | undefined;
53
55
  optionContainerClassName?: string | undefined;
56
+ optionItemClassName?: string | undefined;
57
+ optionNotFoundItemClassName?: string | undefined;
54
58
  options: Options[];
55
59
  value?: Options | undefined;
56
60
  onChangeText?: InputProps["onChange"];
@@ -17,6 +17,8 @@ declare const meta: {
17
17
  required?: boolean | undefined;
18
18
  className?: string | undefined;
19
19
  optionContainerClassName?: string | undefined;
20
+ optionItemClassName?: string | undefined;
21
+ optionNotFoundItemClassName?: string | undefined;
20
22
  options: Options[];
21
23
  value?: Options | undefined;
22
24
  onChangeText?: React.ChangeEventHandler<HTMLInputElement> | undefined;
@@ -46,6 +48,8 @@ declare const meta: {
46
48
  required?: boolean | undefined;
47
49
  className?: string | undefined;
48
50
  optionContainerClassName?: string | undefined;
51
+ optionItemClassName?: string | undefined;
52
+ optionNotFoundItemClassName?: string | undefined;
49
53
  options: Options[];
50
54
  value?: Options | undefined;
51
55
  onChangeText?: React.ChangeEventHandler<HTMLInputElement> | undefined;
@@ -324,6 +324,8 @@ declare const meta: {
324
324
  onClick: (option: Options) => void;
325
325
  }) => React.ReactNode) | undefined;
326
326
  optionContainerClassName?: string | undefined;
327
+ optionItemClassName?: string | undefined;
328
+ optionNotFoundItemClassName?: string | undefined;
327
329
  ref?: React.LegacyRef<HTMLInputElement> | undefined;
328
330
  key?: React.Key | null | undefined;
329
331
  }>) => import("react/jsx-runtime").JSX.Element)[];
package/dist/index.d.ts CHANGED
@@ -151,6 +151,8 @@ type DropdownProps = {
151
151
  required?: boolean;
152
152
  className?: string;
153
153
  optionContainerClassName?: string;
154
+ optionItemClassName?: string;
155
+ optionNotFoundItemClassName?: string;
154
156
  options: Options$1[];
155
157
  value?: Options$1;
156
158
  onChangeText?: InputProps["onChange"];
@@ -176,6 +178,8 @@ declare const Dropdown: React__default.ForwardRefExoticComponent<{
176
178
  required?: boolean | undefined;
177
179
  className?: string | undefined;
178
180
  optionContainerClassName?: string | undefined;
181
+ optionItemClassName?: string | undefined;
182
+ optionNotFoundItemClassName?: string | undefined;
179
183
  options: Options$1[];
180
184
  value?: Options$1 | undefined;
181
185
  onChangeText?: InputProps["onChange"];
@@ -2009,6 +2009,22 @@ body {
2009
2009
  /* @apply bg-[var(--backgroud)] text-[var(--foreground)]; */
2010
2010
  }
2011
2011
 
2012
+ /* hide input number arrow */
2013
+
2014
+ /* Chrome, Safari, Edge, Opera */
2015
+
2016
+ input::-webkit-outer-spin-button,
2017
+ input::-webkit-inner-spin-button {
2018
+ -webkit-appearance: none;
2019
+ margin: 0;
2020
+ }
2021
+
2022
+ /* Firefox */
2023
+
2024
+ input[type=number] {
2025
+ -moz-appearance: textfield;
2026
+ }
2027
+
2012
2028
  *, ::before, ::after {
2013
2029
  --tw-border-spacing-x: 0;
2014
2030
  --tw-border-spacing-y: 0;
@@ -8557,4 +8573,4 @@ body {
8557
8573
 
8558
8574
  .\[\&_tr\]\:border-b tr {
8559
8575
  border-bottom-width: 1px;
8560
- }
8576
+ }
@@ -14,4 +14,17 @@
14
14
  /* @apply bg-background text-foreground; */
15
15
  /* @apply bg-[var(--backgroud)] text-[var(--foreground)]; */
16
16
  }
17
- }
17
+
18
+ /* hide input number arrow */
19
+ /* Chrome, Safari, Edge, Opera */
20
+ input::-webkit-outer-spin-button,
21
+ input::-webkit-inner-spin-button {
22
+ -webkit-appearance: none;
23
+ margin: 0;
24
+ }
25
+
26
+ /* Firefox */
27
+ input[type=number] {
28
+ -moz-appearance: textfield;
29
+ }
30
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,7 +32,7 @@ const DatePicker: FC<DatePickerProps> = ({
32
32
 
33
33
  return (
34
34
  <div>
35
- <Popover open={isOpen} onOpenChange={setIsOpen}>
35
+ <Popover modal open={isOpen} onOpenChange={setIsOpen}>
36
36
  <PopoverTrigger asChild>
37
37
  <div className="flex">
38
38
  <TextInput
@@ -147,9 +147,20 @@ export const CustomOption = {
147
147
  const props: typeof args = {
148
148
  ...args,
149
149
  };
150
+
151
+ const onChangeText = (e: any) => {
152
+ console.log("aaa ", e);
153
+ };
154
+
150
155
  return (
151
156
  <div className="flex flex-row gap-4 w-full">
152
- <DropdownWithRef id="1" size="lg" options={options} {...args} />
157
+ <Dropdown
158
+ id="1"
159
+ size="lg"
160
+ options={options}
161
+ {...args}
162
+ onChangeText={onChangeText}
163
+ />
153
164
  </div>
154
165
  );
155
166
  },
@@ -47,6 +47,8 @@ export type DropdownProps = {
47
47
  required?: boolean;
48
48
  className?: string;
49
49
  optionContainerClassName?: string;
50
+ optionItemClassName?: string;
51
+ optionNotFoundItemClassName?: string;
50
52
  options: Options[];
51
53
  value?: Options;
52
54
  onChangeText?: InputProps["onChange"];
@@ -79,13 +81,15 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
79
81
  onSelect,
80
82
  renderOptions: customRenderOptions,
81
83
  optionContainerClassName,
84
+ optionItemClassName,
85
+ optionNotFoundItemClassName,
82
86
  ...props
83
87
  },
84
88
  ref
85
89
  ) => {
86
90
  const _id = id || `${label}-select`;
87
91
 
88
- const [isFocused, setIsFocused] = useState(false);
92
+ const [isFocused, setIsFocused] = useState(true);
89
93
  const [selectedOption, setSelectedOption] = useState<
90
94
  Options | null | undefined
91
95
  >(null);
@@ -150,11 +154,14 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
150
154
  value: option.value,
151
155
  label: option.label,
152
156
  handleOnClick: () => handleOptionClick(option),
153
- className: `px-4 py-2 hover:bg-gray-100 cursor-pointer ${
154
- selectedOption?.value === option.value
155
- ? " bg-gray-200"
156
- : ""
157
- }`,
157
+ className: cn(
158
+ `px-4 py-2 hover:bg-primary-hover-bg cursor-pointer`,
159
+ optionItemClassName,
160
+ {
161
+ "bg-base-popup-highligh":
162
+ selectedOption?.value === option.value,
163
+ }
164
+ ),
158
165
  })}
159
166
  </Fragment>
160
167
  );
@@ -163,18 +170,26 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
163
170
  <li
164
171
  key={option.value}
165
172
  onMouseDown={() => handleOptionClick(option)}
166
- className={`px-4 py-2 hover:bg-primary-hover-bg cursor-pointer ${
167
- selectedOption?.value === option.value
168
- ? "bg-base-popup-highligh"
169
- : ""
170
- }`}
173
+ className={cn(
174
+ `px-4 py-2 hover:bg-primary-hover-bg cursor-pointer`,
175
+ optionItemClassName,
176
+ {
177
+ "bg-base-popup-highligh":
178
+ selectedOption?.value === option.value,
179
+ }
180
+ )}
171
181
  >
172
182
  {option.label}
173
183
  </li>
174
184
  );
175
185
  })}
176
186
  {optionsFiltered.length === 0 && (
177
- <li className="px-4 py-14 text-center text-input-text">
187
+ <li
188
+ className={cn(
189
+ "px-4 py-14 text-center text-input-text",
190
+ optionNotFoundItemClassName
191
+ )}
192
+ >
178
193
  Not found
179
194
  </li>
180
195
  )}
@@ -257,6 +272,7 @@ const Dropdown = forwardRef<HTMLInputElement, DropdownProps>(
257
272
  label={label}
258
273
  placeholder=" "
259
274
  type="text"
275
+ autoComplete="off"
260
276
  rounded={rounded}
261
277
  variant={variant}
262
278
  helperText={helperText}
@@ -93,7 +93,7 @@ const ToastDescription = React.forwardRef<
93
93
  >(({ className, ...props }, ref) => (
94
94
  <ToastPrimitives.Description
95
95
  ref={ref}
96
- className={cn("typography-subtitile5 text-text-grey-dark", className)}
96
+ className={cn("typography-subtitile5 text-input-default-tex", className)}
97
97
  {...props}
98
98
  />
99
99
  ));
@@ -5,7 +5,7 @@ import * as React from "react";
5
5
  import { ToastActionElement, ToastProps } from "./Toast";
6
6
 
7
7
  const TOAST_LIMIT = 1;
8
- const TOAST_REMOVE_DELAY = 6000;
8
+ const TOAST_REMOVE_DELAY = 3000;
9
9
 
10
10
  type ToasterToast = ToastProps & {
11
11
  id: string;
@@ -81,7 +81,7 @@ const addToRemoveQueue = (toastId: string) => {
81
81
  type: "REMOVE_TOAST",
82
82
  toastId: toastId,
83
83
  });
84
- }, TOAST_REMOVE_DELAY);
84
+ }, TOAST_REMOVE_DELAY); // TODO
85
85
 
86
86
  toastTimeouts.set(toastId, timeout);
87
87
  };
@@ -14,4 +14,17 @@
14
14
  /* @apply bg-background text-foreground; */
15
15
  /* @apply bg-[var(--backgroud)] text-[var(--foreground)]; */
16
16
  }
17
- }
17
+
18
+ /* hide input number arrow */
19
+ /* Chrome, Safari, Edge, Opera */
20
+ input::-webkit-outer-spin-button,
21
+ input::-webkit-inner-spin-button {
22
+ -webkit-appearance: none;
23
+ margin: 0;
24
+ }
25
+
26
+ /* Firefox */
27
+ input[type=number] {
28
+ -moz-appearance: textfield;
29
+ }
30
+ }