@rovula/ui 0.0.76 → 0.0.77

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 (41) hide show
  1. package/dist/cjs/bundle.css +12 -0
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +7 -0
  5. package/dist/cjs/types/components/InputFilter/InputFilter.stories.d.ts +7 -0
  6. package/dist/cjs/types/components/NumberInput/NumberInput.d.ts +39 -0
  7. package/dist/cjs/types/components/NumberInput/NumberInput.stories.d.ts +18 -0
  8. package/dist/cjs/types/components/NumberInput/index.d.ts +2 -0
  9. package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
  10. package/dist/cjs/types/components/Search/Search.stories.d.ts +7 -0
  11. package/dist/cjs/types/components/Slider/Slider.stories.d.ts +1 -1
  12. package/dist/cjs/types/components/TextInput/TextInput.d.ts +14 -0
  13. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +14 -0
  14. package/dist/cjs/types/index.d.ts +2 -0
  15. package/dist/components/NumberInput/NumberInput.js +254 -0
  16. package/dist/components/NumberInput/NumberInput.stories.js +212 -0
  17. package/dist/components/NumberInput/index.js +1 -0
  18. package/dist/components/TextInput/TextInput.js +13 -11
  19. package/dist/esm/bundle.css +12 -0
  20. package/dist/esm/bundle.js +3 -3
  21. package/dist/esm/bundle.js.map +1 -1
  22. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +7 -0
  23. package/dist/esm/types/components/InputFilter/InputFilter.stories.d.ts +7 -0
  24. package/dist/esm/types/components/NumberInput/NumberInput.d.ts +39 -0
  25. package/dist/esm/types/components/NumberInput/NumberInput.stories.d.ts +18 -0
  26. package/dist/esm/types/components/NumberInput/index.d.ts +2 -0
  27. package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +1 -1
  28. package/dist/esm/types/components/Search/Search.stories.d.ts +7 -0
  29. package/dist/esm/types/components/Slider/Slider.stories.d.ts +1 -1
  30. package/dist/esm/types/components/TextInput/TextInput.d.ts +14 -0
  31. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +14 -0
  32. package/dist/esm/types/index.d.ts +2 -0
  33. package/dist/index.d.ts +52 -1
  34. package/dist/index.js +1 -0
  35. package/dist/src/theme/global.css +16 -0
  36. package/package.json +1 -1
  37. package/src/components/NumberInput/NumberInput.stories.tsx +350 -0
  38. package/src/components/NumberInput/NumberInput.tsx +428 -0
  39. package/src/components/NumberInput/index.ts +2 -0
  40. package/src/components/TextInput/TextInput.tsx +54 -12
  41. package/src/index.ts +2 -0
@@ -362,6 +362,13 @@ declare const meta: {
362
362
  iconMode?: "flat" | "solid" | undefined;
363
363
  keepCloseIconOnValue?: boolean | undefined;
364
364
  labelClassName?: string | undefined;
365
+ classes?: {
366
+ iconWrapper?: string;
367
+ iconSearchWrapper?: string;
368
+ icon?: string;
369
+ startIconWrapper?: string;
370
+ endIconWrapper?: string;
371
+ } | undefined;
365
372
  onClickStartIcon?: (() => void) | undefined;
366
373
  onClickEndIcon?: (() => void) | undefined;
367
374
  renderStartIcon?: (() => React.ReactNode) | undefined;
@@ -352,6 +352,13 @@ declare const meta: {
352
352
  iconMode?: "flat" | "solid" | undefined;
353
353
  keepCloseIconOnValue?: boolean | undefined;
354
354
  labelClassName?: string | undefined;
355
+ classes?: {
356
+ iconWrapper?: string;
357
+ iconSearchWrapper?: string;
358
+ icon?: string;
359
+ startIconWrapper?: string;
360
+ endIconWrapper?: string;
361
+ } | undefined;
355
362
  onClickStartIcon?: (() => void) | undefined;
356
363
  onClickEndIcon?: (() => void) | undefined;
357
364
  renderStartIcon?: (() => React.ReactNode) | undefined;
@@ -0,0 +1,39 @@
1
+ import React from "react";
2
+ import { InputProps as TextInputProps } from "../TextInput/TextInput";
3
+ export type NumberInputProps = Omit<TextInputProps, "type" | "value" | "defaultValue" | "onChange"> & {
4
+ value?: number | string;
5
+ defaultValue?: number | string;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ precision?: number;
10
+ hideControls?: boolean;
11
+ allowDecimal?: boolean;
12
+ allowNegative?: boolean;
13
+ formatDisplay?: boolean;
14
+ thousandSeparator?: string;
15
+ decimalSeparator?: string;
16
+ prefix?: string;
17
+ suffix?: string;
18
+ onChange?: (value: number | undefined) => void;
19
+ onValueChange?: (value: string) => void;
20
+ };
21
+ export declare const NumberInput: React.ForwardRefExoticComponent<Omit<TextInputProps, "type" | "onChange" | "value" | "defaultValue"> & {
22
+ value?: number | string;
23
+ defaultValue?: number | string;
24
+ min?: number;
25
+ max?: number;
26
+ step?: number;
27
+ precision?: number;
28
+ hideControls?: boolean;
29
+ allowDecimal?: boolean;
30
+ allowNegative?: boolean;
31
+ formatDisplay?: boolean;
32
+ thousandSeparator?: string;
33
+ decimalSeparator?: string;
34
+ prefix?: string;
35
+ suffix?: string;
36
+ onChange?: (value: number | undefined) => void;
37
+ onValueChange?: (value: string) => void;
38
+ } & React.RefAttributes<HTMLInputElement>>;
39
+ export default NumberInput;
@@ -0,0 +1,18 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { NumberInput } from "@/index";
3
+ declare const meta: Meta<typeof NumberInput>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof NumberInput>;
6
+ export declare const Default: Story;
7
+ export declare const WithMinMax: Story;
8
+ export declare const WithStep: Story;
9
+ export declare const IntegerOnly: Story;
10
+ export declare const ControllWithOutLine: Story;
11
+ export declare const WithoutControls: Story;
12
+ export declare const ErrorState: Story;
13
+ export declare const HelperText: Story;
14
+ export declare const Disabled: Story;
15
+ export declare const FormattedNumber: Story;
16
+ export declare const CurrencyFormat: Story;
17
+ export declare const CurrencyThailand: Story;
18
+ export declare const CustomSeparators: Story;
@@ -0,0 +1,2 @@
1
+ export { NumberInput, default } from "./NumberInput";
2
+ export type { NumberInputProps } from "./NumberInput";
@@ -279,9 +279,9 @@ declare const meta: {
279
279
  inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
280
280
  is?: string | undefined | undefined;
281
281
  required?: boolean | undefined;
282
+ onValueChange?: ((value: string) => void) | undefined;
282
283
  loop?: boolean | undefined;
283
284
  asChild?: boolean | undefined;
284
- onValueChange?: ((value: string) => void) | undefined;
285
285
  ref?: React.LegacyRef<HTMLDivElement> | undefined;
286
286
  }>) => import("react/jsx-runtime").JSX.Element)[];
287
287
  };
@@ -314,6 +314,13 @@ declare const meta: {
314
314
  helperText?: string | undefined;
315
315
  errorMessage?: string | undefined;
316
316
  labelClassName?: string | undefined;
317
+ classes?: {
318
+ iconWrapper?: string;
319
+ iconSearchWrapper?: string;
320
+ icon?: string;
321
+ startIconWrapper?: string;
322
+ endIconWrapper?: string;
323
+ } | undefined;
317
324
  onClickStartIcon?: (() => void) | undefined;
318
325
  onClickEndIcon?: (() => void) | undefined;
319
326
  renderStartIcon?: (() => React.ReactNode) | undefined;
@@ -289,10 +289,10 @@ declare const meta: {
289
289
  unselectable?: "on" | "off" | undefined | undefined;
290
290
  inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
291
291
  is?: string | undefined | undefined;
292
+ onValueChange?: ((value: number[]) => void) | undefined;
292
293
  asChild?: boolean | undefined;
293
294
  inverted?: boolean | undefined;
294
295
  minStepsBetweenThumbs?: number | undefined;
295
- onValueChange?: ((value: number[]) => void) | undefined;
296
296
  onValueCommit?: ((value: number[]) => void) | undefined;
297
297
  ref?: React.LegacyRef<HTMLSpanElement> | undefined;
298
298
  }>) => import("react/jsx-runtime").JSX.Element)[];
@@ -21,6 +21,13 @@ export type InputProps = {
21
21
  endIcon?: ReactNode;
22
22
  className?: string;
23
23
  labelClassName?: string;
24
+ classes?: {
25
+ iconWrapper?: string;
26
+ iconSearchWrapper?: string;
27
+ icon?: string;
28
+ startIconWrapper?: string;
29
+ endIconWrapper?: string;
30
+ };
24
31
  onClickStartIcon?: () => void;
25
32
  onClickEndIcon?: () => void;
26
33
  renderStartIcon?: () => ReactNode;
@@ -48,6 +55,13 @@ export declare const TextInput: React.ForwardRefExoticComponent<{
48
55
  endIcon?: ReactNode;
49
56
  className?: string;
50
57
  labelClassName?: string;
58
+ classes?: {
59
+ iconWrapper?: string;
60
+ iconSearchWrapper?: string;
61
+ icon?: string;
62
+ startIconWrapper?: string;
63
+ endIconWrapper?: string;
64
+ };
51
65
  onClickStartIcon?: () => void;
52
66
  onClickEndIcon?: () => void;
53
67
  renderStartIcon?: () => ReactNode;
@@ -23,6 +23,13 @@ declare const meta: {
23
23
  endIcon?: React.ReactNode;
24
24
  className?: string;
25
25
  labelClassName?: string;
26
+ classes?: {
27
+ iconWrapper?: string;
28
+ iconSearchWrapper?: string;
29
+ icon?: string;
30
+ startIconWrapper?: string;
31
+ endIconWrapper?: string;
32
+ };
26
33
  onClickStartIcon?: () => void;
27
34
  onClickEndIcon?: () => void;
28
35
  renderStartIcon?: () => React.ReactNode;
@@ -54,6 +61,13 @@ declare const meta: {
54
61
  endIcon?: React.ReactNode;
55
62
  className?: string | undefined;
56
63
  labelClassName?: string | undefined;
64
+ classes?: {
65
+ iconWrapper?: string;
66
+ iconSearchWrapper?: string;
67
+ icon?: string;
68
+ startIconWrapper?: string;
69
+ endIconWrapper?: string;
70
+ } | undefined;
57
71
  onClickStartIcon?: (() => void) | undefined;
58
72
  onClickEndIcon?: (() => void) | undefined;
59
73
  renderStartIcon?: (() => React.ReactNode) | undefined;
@@ -2,6 +2,7 @@ import "./theme/global.css";
2
2
  import "./icons/iconConfig";
3
3
  export { default as Button } from "./components/Button/Button";
4
4
  export { default as TextInput } from "./components/TextInput/TextInput";
5
+ export { NumberInput } from "./components/NumberInput/NumberInput";
5
6
  export { default as TextArea } from "./components/TextArea/TextArea";
6
7
  export { default as Text } from "./components/Text/Text";
7
8
  export { default as Tabs } from "./components/Tabs/Tabs";
@@ -38,6 +39,7 @@ export * from "./components/FocusedScrollView/FocusedScrollView";
38
39
  export * from "./components/RadioGroup/RadioGroup";
39
40
  export type { ButtonProps } from "./components/Button/Button";
40
41
  export type { InputProps } from "./components/TextInput/TextInput";
42
+ export type { NumberInputProps } from "./components/NumberInput/NumberInput";
41
43
  export type { TextAreaProps } from "./components/TextArea/TextArea";
42
44
  export type { DropdownProps, Options } from "./components/Dropdown/Dropdown";
43
45
  export type { NavbarProps } from "./components/Navbar/Navbar";
package/dist/index.d.ts CHANGED
@@ -66,6 +66,13 @@ type InputProps = {
66
66
  endIcon?: ReactNode;
67
67
  className?: string;
68
68
  labelClassName?: string;
69
+ classes?: {
70
+ iconWrapper?: string;
71
+ iconSearchWrapper?: string;
72
+ icon?: string;
73
+ startIconWrapper?: string;
74
+ endIconWrapper?: string;
75
+ };
69
76
  onClickStartIcon?: () => void;
70
77
  onClickEndIcon?: () => void;
71
78
  renderStartIcon?: () => ReactNode;
@@ -93,12 +100,56 @@ declare const TextInput: React__default.ForwardRefExoticComponent<{
93
100
  endIcon?: ReactNode;
94
101
  className?: string;
95
102
  labelClassName?: string;
103
+ classes?: {
104
+ iconWrapper?: string;
105
+ iconSearchWrapper?: string;
106
+ icon?: string;
107
+ startIconWrapper?: string;
108
+ endIconWrapper?: string;
109
+ };
96
110
  onClickStartIcon?: () => void;
97
111
  onClickEndIcon?: () => void;
98
112
  renderStartIcon?: () => ReactNode;
99
113
  renderEndIcon?: () => ReactNode;
100
114
  } & Omit<React__default.InputHTMLAttributes<HTMLInputElement>, "size"> & React__default.RefAttributes<HTMLInputElement>>;
101
115
 
116
+ type NumberInputProps = Omit<InputProps, "type" | "value" | "defaultValue" | "onChange"> & {
117
+ value?: number | string;
118
+ defaultValue?: number | string;
119
+ min?: number;
120
+ max?: number;
121
+ step?: number;
122
+ precision?: number;
123
+ hideControls?: boolean;
124
+ allowDecimal?: boolean;
125
+ allowNegative?: boolean;
126
+ formatDisplay?: boolean;
127
+ thousandSeparator?: string;
128
+ decimalSeparator?: string;
129
+ prefix?: string;
130
+ suffix?: string;
131
+ onChange?: (value: number | undefined) => void;
132
+ onValueChange?: (value: string) => void;
133
+ };
134
+ declare const NumberInput: React__default.ForwardRefExoticComponent<Omit<InputProps, "type" | "onChange" | "value" | "defaultValue"> & {
135
+ value?: number | string;
136
+ defaultValue?: number | string;
137
+ min?: number;
138
+ max?: number;
139
+ step?: number;
140
+ precision?: number;
141
+ hideControls?: boolean;
142
+ allowDecimal?: boolean;
143
+ allowNegative?: boolean;
144
+ formatDisplay?: boolean;
145
+ thousandSeparator?: string;
146
+ decimalSeparator?: string;
147
+ prefix?: string;
148
+ suffix?: string;
149
+ onChange?: (value: number | undefined) => void;
150
+ onValueChange?: (value: string) => void;
151
+ } & React__default.RefAttributes<HTMLInputElement>>;
152
+
102
153
  type TextAreaProps = {
103
154
  id?: string;
104
155
  label?: string;
@@ -809,4 +860,4 @@ declare function usePrevious<T>(value: T): T | undefined;
809
860
 
810
861
  declare function cn(...inputs: ClassValue[]): string;
811
862
 
812
- export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, type CustomSliderProps, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, FocusedScrollView, Icon, Input, InputFilter, type InputFilterProps, type InputProps, Label, Loading, Navbar, type NavbarProps, type Options$1 as Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, RadioGroup, RadioGroupItem, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextArea, type TextAreaProps, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, Tree, type TreeData, TreeItem, type TreeItemProps, type TreeProps, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, usePrevious, useToast };
863
+ export { ActionButton, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Button, type ButtonProps, Calendar, Checkbox, Collapsible, type CustomSliderProps, DataTable, type DataTableProps, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dropdown, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, type DropdownProps, FocusedScrollView, Icon, Input, InputFilter, type InputFilterProps, type InputProps, Label, Loading, Navbar, type NavbarProps, NumberInput, type NumberInputProps, type Options$1 as Options, Popover, PopoverContent, PopoverTrigger, ProgressBar, RadioGroup, RadioGroupItem, Search, type SearchProps, Slider, type SliderProps, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, Text, TextArea, type TextAreaProps, TextInput, Toast$1 as Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipSimple, TooltipTrigger, Tree, type TreeData, TreeItem, type TreeItemProps, type TreeProps, cn, getEndDateOfDay, getStartDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, reducer, resloveTimestamp, toast, usePrevious, useToast };
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import "./theme/global.css";
4
4
  import "./icons/iconConfig";
5
5
  export { default as Button } from "./components/Button/Button";
6
6
  export { default as TextInput } from "./components/TextInput/TextInput";
7
+ export { NumberInput } from "./components/NumberInput/NumberInput";
7
8
  export { default as TextArea } from "./components/TextArea/TextArea";
8
9
  export { default as Text } from "./components/Text/Text";
9
10
  export { default as Tabs } from "./components/Tabs/Tabs";
@@ -2312,6 +2312,14 @@ input[type=number] {
2312
2312
  top: 0px;
2313
2313
  }
2314
2314
 
2315
+ .top-0\.5 {
2316
+ top: 0.125rem;
2317
+ }
2318
+
2319
+ .top-1 {
2320
+ top: 0.25rem;
2321
+ }
2322
+
2315
2323
  .top-4 {
2316
2324
  top: 1rem;
2317
2325
  }
@@ -6671,6 +6679,10 @@ input[type=number] {
6671
6679
  background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
6672
6680
  }
6673
6681
 
6682
+ .hover\:bg-input-active-stroke\/10:hover {
6683
+ background-color: color-mix(in srgb, var(--input-color-active-stroke) calc(100% * 0.1), transparent);
6684
+ }
6685
+
6674
6686
  .hover\:bg-input-disable-bg:hover {
6675
6687
  --tw-bg-opacity: 1;
6676
6688
  background-color: color-mix(in srgb, var(--input-color-disable-bg) calc(100% * var(--tw-bg-opacity, 1)), transparent);
@@ -8041,6 +8053,10 @@ input[type=number] {
8041
8053
  color: color-mix(in srgb, var(--state-color-disable-outline) calc(100% * var(--tw-text-opacity, 1)), transparent);
8042
8054
  }
8043
8055
 
8056
+ .disabled\:opacity-30:disabled {
8057
+ opacity: 0.3;
8058
+ }
8059
+
8044
8060
  .disabled\:opacity-50:disabled {
8045
8061
  opacity: 0.5;
8046
8062
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rovula/ui",
3
- "version": "0.0.76",
3
+ "version": "0.0.77",
4
4
  "main": "dist/cjs/bundle.js",
5
5
  "module": "dist/esm/bundle.js",
6
6
  "types": "dist/index.d.ts",