@douglasneuroinformatics/libui 2.0.0-beta.8 → 2.0.0
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/README.md +14 -0
- package/dist/components/index.d.ts +56 -10
- package/dist/components/index.js +431 -234
- package/dist/components/index.js.map +1 -1
- package/dist/i18n.d.ts +335 -4
- package/dist/i18n.js +21 -5
- package/dist/i18n.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,6 +40,20 @@ designed as a generic implementation.
|
|
|
40
40
|
pnpm install @douglasneuroinformatics/libui
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
**tailwind.config.cjs**
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
const baseConfig = require('@douglasneuroinformatics/libui/tailwind.config.cjs');
|
|
49
|
+
|
|
50
|
+
/** @type {import('tailwindcss').Config} */
|
|
51
|
+
module.exports {
|
|
52
|
+
content: [...baseConfig.content, './src/**/*.{js,ts,jsx,tsx}'],
|
|
53
|
+
presets: [baseConfig]
|
|
54
|
+
};
|
|
55
|
+
```
|
|
56
|
+
|
|
43
57
|
## Contributing
|
|
44
58
|
|
|
45
59
|
We welcome contributions! If you're interested in improving the library or adding new features, please refer to our contribution guide.
|
|
@@ -869,8 +869,10 @@ type LanguageToggleProps = {
|
|
|
869
869
|
options: {
|
|
870
870
|
[key: string]: string;
|
|
871
871
|
};
|
|
872
|
+
triggerClassName?: string;
|
|
873
|
+
variant?: ButtonProps['variant'];
|
|
872
874
|
};
|
|
873
|
-
declare const LanguageToggle: ({ align, options }
|
|
875
|
+
declare const LanguageToggle: ({ align, options, triggerClassName, variant }: LanguageToggleProps) => react_jsx_runtime.JSX.Element;
|
|
874
876
|
|
|
875
877
|
type LegacyDropdownOptions = {
|
|
876
878
|
[key: string]: string;
|
|
@@ -946,6 +948,43 @@ type LegacyStepperProps = {
|
|
|
946
948
|
/** @deprecated */
|
|
947
949
|
declare const LegacyStepper: ({ className, steps }: LegacyStepperProps) => react_jsx_runtime.JSX.Element;
|
|
948
950
|
|
|
951
|
+
/** @deprecated */
|
|
952
|
+
type LegacyColumnDropdownOptions<T extends LegacyTableEntry> = {
|
|
953
|
+
icon?: react__default.ComponentType<Omit<react__default.SVGProps<SVGSVGElement>, 'ref'>>;
|
|
954
|
+
label: string;
|
|
955
|
+
onSelection: (column: LegacyTableColumn<T>) => void;
|
|
956
|
+
}[];
|
|
957
|
+
|
|
958
|
+
/** @deprecated */
|
|
959
|
+
type LegacyTableEntry = {
|
|
960
|
+
[key: string]: unknown;
|
|
961
|
+
};
|
|
962
|
+
/** @deprecated */
|
|
963
|
+
type LegacyFieldFactory<T extends LegacyTableEntry = LegacyTableEntry> = (entry: T) => string;
|
|
964
|
+
/** @deprecated */
|
|
965
|
+
type LegacyTableColumn<T extends LegacyTableEntry> = {
|
|
966
|
+
/** How to determine the values for column */
|
|
967
|
+
field: LegacyFieldFactory<T> | keyof T;
|
|
968
|
+
/** Override the default formatter for this field */
|
|
969
|
+
formatter?: (value: any) => string;
|
|
970
|
+
/** The label to be displayed on the header */
|
|
971
|
+
label: string;
|
|
972
|
+
};
|
|
973
|
+
/** @deprecated */
|
|
974
|
+
type LegacyTableProps<T extends LegacyTableEntry> = {
|
|
975
|
+
className?: string;
|
|
976
|
+
columnDropdownOptions?: LegacyColumnDropdownOptions<T>;
|
|
977
|
+
columns: LegacyTableColumn<T>[];
|
|
978
|
+
data: T[];
|
|
979
|
+
minRows?: number;
|
|
980
|
+
onEntryClick?: (entry: T) => void;
|
|
981
|
+
};
|
|
982
|
+
/** @deprecated */
|
|
983
|
+
declare const LegacyTable: <T extends LegacyTableEntry>({ className, columnDropdownOptions, columns, data, minRows, onEntryClick }: LegacyTableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
984
|
+
|
|
985
|
+
/** @deprecated */
|
|
986
|
+
declare const LegacyClientTable: <T extends LegacyTableEntry>({ data, ...props }: LegacyTableProps<T>) => react_jsx_runtime.JSX.Element;
|
|
987
|
+
|
|
949
988
|
/** An array of arbitrary objects with data to graph */
|
|
950
989
|
type LineGraphData = readonly {
|
|
951
990
|
[key: string]: any;
|
|
@@ -1893,17 +1932,26 @@ declare const Resizable: ResizableType;
|
|
|
1893
1932
|
|
|
1894
1933
|
declare const ScrollArea: react__default.ForwardRefExoticComponent<Omit<_radix_ui_react_scroll_area.ScrollAreaProps & react__default.RefAttributes<HTMLDivElement>, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
|
|
1895
1934
|
|
|
1896
|
-
type
|
|
1935
|
+
type BaseSearchBarProps = {
|
|
1897
1936
|
/** Additional CSS classes to add to the wrapper form component, potentially overriding default styling */
|
|
1898
1937
|
className?: string;
|
|
1899
|
-
/**
|
|
1900
|
-
|
|
1938
|
+
/** An optional callback invoked when the user clicks the search bar */
|
|
1939
|
+
onClick?: () => void;
|
|
1901
1940
|
/** Custom placeholder to use instead of the default */
|
|
1902
1941
|
placeholder?: string;
|
|
1942
|
+
};
|
|
1943
|
+
type ControlledSearchBarProps = BaseSearchBarProps & {
|
|
1944
|
+
/** Event handler called when the value changes */
|
|
1945
|
+
onValueChange: (value: string) => void;
|
|
1903
1946
|
/** The controlled value of the search bar, which should be used in conjunction with onValueChange */
|
|
1904
1947
|
value: string;
|
|
1905
1948
|
};
|
|
1906
|
-
|
|
1949
|
+
type UncontrolledSearchBarProps = BaseSearchBarProps & {
|
|
1950
|
+
onValueChange?: never;
|
|
1951
|
+
value?: never;
|
|
1952
|
+
};
|
|
1953
|
+
type SearchBarProps = ControlledSearchBarProps | UncontrolledSearchBarProps;
|
|
1954
|
+
declare const SearchBar: ({ className, onClick, onValueChange, placeholder, value }: SearchBarProps) => react_jsx_runtime.JSX.Element;
|
|
1907
1955
|
|
|
1908
1956
|
declare const Select: react.FC<SelectPrimitive.SelectProps> & {
|
|
1909
1957
|
Content: react.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
@@ -1960,10 +2008,8 @@ declare const Tabs: react.ForwardRefExoticComponent<TabsPrimitive.TabsProps & re
|
|
|
1960
2008
|
type TextAreaProps = react__default.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
1961
2009
|
declare const TextArea: react__default.ForwardRefExoticComponent<TextAreaProps & react__default.RefAttributes<HTMLTextAreaElement>>;
|
|
1962
2010
|
|
|
1963
|
-
type ThemeToggleProps =
|
|
1964
|
-
|
|
1965
|
-
};
|
|
1966
|
-
declare const ThemeToggle: () => react_jsx_runtime.JSX.Element;
|
|
2011
|
+
type ThemeToggleProps = Omit<ButtonProps, 'children' | 'size'>;
|
|
2012
|
+
declare const ThemeToggle: ({ onClick, variant, ...props }: ThemeToggleProps) => react_jsx_runtime.JSX.Element;
|
|
1967
2013
|
|
|
1968
2014
|
type TooltipTriggerProps = Omit<ButtonProps, 'asChild'>;
|
|
1969
2015
|
|
|
@@ -1994,4 +2040,4 @@ declare const Tooltip: (({ children, delayDuration, skipDelayDuration }: Tooltip
|
|
|
1994
2040
|
Trigger: react.ForwardRefExoticComponent<TooltipTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1995
2041
|
};
|
|
1996
2042
|
|
|
1997
|
-
export { Accordion, AlertDialog, ArrowToggle, type ArrowToggleProps, Avatar, BUTTON_ICON_SIZE, Badge, type BadgeProps, Breadcrumb, Button, type ButtonProps, Card, Checkbox, Collapsible, Command, ContextMenu, DatePicker, type DatePickerProps, Dialog, Drawer, DropdownButton, DropdownMenu, ErrorBoundary, ErrorFallback, type ErrorFallbackProps, Form, type FormProps, Heading, type HeadingProps, HoverCard, Input, type InputProps, Label, LanguageToggle, type LanguageToggleProps, LegacyDropdown, type LegacyDropdownProps, LegacyModal, type LegacyModalProps, LegacySelectDropdown, type LegacySelectDropdownProps, type LegacySelectOption, LegacySlider, type LegacySliderProps, LegacyStepper, type LegacyStepperProps, LineGraph, type LineGraphData, type LineGraphLine, MenuBar, NotificationHub, type NotificationHubProps, Pagination, Popover, Progress, RadioGroup, type RadioGroupProps, Resizable, ScrollArea, SearchBar, type SearchBarProps, Select, Separator, Sheet, Slider, Spinner, SpinnerIcon, type Step, Switch, Table, Tabs, TextArea, type TextAreaProps, ThemeToggle, type ThemeToggleProps, Tooltip, badgeVariants, buttonVariants, labelVariants };
|
|
2043
|
+
export { Accordion, AlertDialog, ArrowToggle, type ArrowToggleProps, Avatar, BUTTON_ICON_SIZE, Badge, type BadgeProps, type BaseSearchBarProps, Breadcrumb, Button, type ButtonProps, Card, Checkbox, Collapsible, Command, ContextMenu, DatePicker, type DatePickerProps, Dialog, Drawer, DropdownButton, DropdownMenu, ErrorBoundary, ErrorFallback, type ErrorFallbackProps, Form, type FormProps, Heading, type HeadingProps, HoverCard, Input, type InputProps, Label, LanguageToggle, type LanguageToggleProps, LegacyClientTable, LegacyDropdown, type LegacyDropdownProps, type LegacyFieldFactory, LegacyModal, type LegacyModalProps, LegacySelectDropdown, type LegacySelectDropdownProps, type LegacySelectOption, LegacySlider, type LegacySliderProps, LegacyStepper, type LegacyStepperProps, LegacyTable, type LegacyTableColumn, type LegacyTableEntry, type LegacyTableProps, LineGraph, type LineGraphData, type LineGraphLine, MenuBar, NotificationHub, type NotificationHubProps, Pagination, Popover, Progress, RadioGroup, type RadioGroupProps, Resizable, ScrollArea, SearchBar, type SearchBarProps, Select, Separator, Sheet, Slider, Spinner, SpinnerIcon, type Step, Switch, Table, Tabs, TextArea, type TextAreaProps, ThemeToggle, type ThemeToggleProps, Tooltip, badgeVariants, buttonVariants, labelVariants };
|