@ttoss/components 2.10.1 → 2.10.2

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 (42) hide show
  1. package/package.json +12 -12
  2. package/dist/Accordion/index.d.ts +0 -16
  3. package/dist/DatePicker/index.d.ts +0 -19
  4. package/dist/Drawer/index.d.ts +0 -12
  5. package/dist/FileUploader/index.d.ts +0 -55
  6. package/dist/InstallPwa/index.d.ts +0 -10
  7. package/dist/JsonEditor/index.d.ts +0 -2
  8. package/dist/JsonView/index.d.ts +0 -1
  9. package/dist/List/index.d.ts +0 -13
  10. package/dist/Markdown/index.d.ts +0 -11
  11. package/dist/Menu/index.d.ts +0 -11
  12. package/dist/Modal/index.d.ts +0 -10
  13. package/dist/NavList/index.d.ts +0 -55
  14. package/dist/NotificationCard/index.d.ts +0 -21
  15. package/dist/NotificationsMenu/index.d.ts +0 -21
  16. package/dist/Search/index.d.ts +0 -11
  17. package/dist/SpotlightCard/index.d.ts +0 -27
  18. package/dist/Table/index.d.ts +0 -16
  19. package/dist/Tabs/index.d.ts +0 -18
  20. package/dist/Toast/index.d.ts +0 -8
  21. package/dist/esm/Accordion/index.js +0 -49
  22. package/dist/esm/DatePicker/index.js +0 -2476
  23. package/dist/esm/Drawer/index.js +0 -59
  24. package/dist/esm/FileUploader/index.js +0 -401
  25. package/dist/esm/InstallPwa/index.js +0 -61
  26. package/dist/esm/JsonEditor/index.js +0 -6
  27. package/dist/esm/JsonView/index.js +0 -6
  28. package/dist/esm/List/index.js +0 -30
  29. package/dist/esm/Markdown/index.js +0 -23
  30. package/dist/esm/Menu/index.js +0 -131
  31. package/dist/esm/Modal/index.js +0 -65
  32. package/dist/esm/NavList/index.js +0 -246
  33. package/dist/esm/NotificationCard/index.js +0 -5
  34. package/dist/esm/NotificationsMenu/index.js +0 -205
  35. package/dist/esm/Search/index.js +0 -29
  36. package/dist/esm/SpotlightCard/index.js +0 -212
  37. package/dist/esm/Table/index.js +0 -63
  38. package/dist/esm/Tabs/index.js +0 -75
  39. package/dist/esm/Toast/index.js +0 -38
  40. package/dist/esm/chunk-2R7AUPJL.js +0 -2176
  41. package/dist/esm/chunk-4GBVRL7E.js +0 -156
  42. package/dist/esm/chunk-V4MHYKRI.js +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "2.10.1",
3
+ "version": "2.10.2",
4
4
  "description": "React components for ttoss ecosystem.",
5
5
  "license": "MIT",
6
6
  "author": "ttoss",
@@ -102,7 +102,7 @@
102
102
  "@types/react-modal": "^3.16.3",
103
103
  "json-edit-react": "^1.19.2",
104
104
  "react-accessible-accordion": "^5.0.0",
105
- "react-day-picker": "^9.11.2",
105
+ "react-day-picker": "^9.11.3",
106
106
  "react-grid-layout": "^1.5.2",
107
107
  "react-json-view-lite": "^2.3.0",
108
108
  "react-markdown": "^9.0.3",
@@ -115,25 +115,25 @@
115
115
  },
116
116
  "peerDependencies": {
117
117
  "react": ">=16.8.0",
118
- "@ttoss/react-i18n": "^2.0.24",
119
- "@ttoss/react-hooks": "^2.1.10",
120
- "@ttoss/ui": "^6.0.4"
118
+ "@ttoss/react-hooks": "^2.1.11",
119
+ "@ttoss/react-i18n": "^2.0.25",
120
+ "@ttoss/ui": "^6.1.0"
121
121
  },
122
122
  "devDependencies": {
123
123
  "@types/jest": "^30.0.0",
124
- "@types/react": "^19.2.6",
124
+ "@types/react": "^19.2.7",
125
125
  "@types/react-grid-layout": "^1.3.6",
126
126
  "jest": "^30.2.0",
127
- "react": "^19.2.0",
127
+ "react": "^19.2.1",
128
128
  "tsup": "^8.5.1",
129
129
  "tsx": "^4.19.2",
130
130
  "@ttoss/config": "^1.35.12",
131
131
  "@ttoss/i18n-cli": "^0.7.38",
132
- "@ttoss/react-hooks": "^2.1.10",
133
- "@ttoss/react-i18n": "^2.0.24",
134
- "@ttoss/react-icons": "^0.5.5",
135
- "@ttoss/test-utils": "^4.0.1",
136
- "@ttoss/ui": "^6.0.4"
132
+ "@ttoss/react-hooks": "^2.1.11",
133
+ "@ttoss/react-i18n": "^2.0.25",
134
+ "@ttoss/react-icons": "^0.5.6",
135
+ "@ttoss/test-utils": "^4.0.2",
136
+ "@ttoss/ui": "^6.1.0"
137
137
  },
138
138
  "keywords": [
139
139
  "React",
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BoxProps } from '@ttoss/ui';
3
- export { AccordionItem, AccordionItemButton, AccordionItemHeading, AccordionItemPanel } from 'react-accessible-accordion';
4
-
5
- type AccordionProps = BoxProps & {
6
- allowMultipleExpanded?: boolean;
7
- allowZeroExpanded?: boolean;
8
- preExpanded?: string[];
9
- /**
10
- * Callback which is invoked when items are expanded or collapsed. Gets passed uuids of the currently expanded AccordionItems.
11
- */
12
- onChange?: (args: string[]) => void;
13
- };
14
- declare const Accordion: ({ children, allowMultipleExpanded, allowZeroExpanded, preExpanded, onChange, ...boxProps }: AccordionProps) => react_jsx_runtime.JSX.Element;
15
-
16
- export { Accordion, type AccordionProps };
@@ -1,19 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface DateRange {
4
- from: Date | undefined;
5
- to: Date | undefined;
6
- }
7
- interface DateRangePreset {
8
- label: string;
9
- getValue: () => DateRange;
10
- }
11
- interface DatePickerProps {
12
- label?: string;
13
- value?: DateRange;
14
- presets?: DateRangePreset[];
15
- onChange?: (range: DateRange | undefined) => void;
16
- }
17
- declare const DatePicker: ({ label, value, presets, onChange, }: DatePickerProps) => react_jsx_runtime.JSX.Element;
18
-
19
- export { DatePicker, type DateRange };
@@ -1,12 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BoxProps } from '@ttoss/ui';
3
- import * as React from 'react';
4
- import DrawerUi from 'react-modern-drawer';
5
-
6
- type DrawerUiProps = React.ComponentProps<typeof DrawerUi>;
7
- type DrawerProps = DrawerUiProps & {
8
- sx?: BoxProps['sx'];
9
- };
10
- declare const Drawer: ({ children, sx, ...props }: DrawerProps) => react_jsx_runtime.JSX.Element;
11
-
12
- export { Drawer, type DrawerProps };
@@ -1,55 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- type UploadResult = {
5
- url: string;
6
- id: string | number;
7
- };
8
- type FileUploadState = {
9
- file: File;
10
- status: 'pending' | 'uploading' | 'completed' | 'error';
11
- progress?: number;
12
- result?: UploadResult;
13
- error?: Error;
14
- };
15
- type OnUpload = (file: File, onProgress?: (progress: number) => void) => Promise<UploadResult>;
16
- type OnUploadStart = (file: File) => void;
17
- type OnUploadProgress = (file: File, progress: number) => void;
18
- type OnUploadComplete = (file: File, result: UploadResult) => void;
19
- type OnUploadError = (file: File, error: Error) => void;
20
- type OnFilesChange = (files: FileUploadState[]) => void;
21
- type OnRemove = (file: UploadedFile, index: number) => void;
22
- type UploadedFile = {
23
- id: string | number;
24
- name: string;
25
- imageUrl?: string;
26
- url: string;
27
- };
28
- type FileUploaderProps = {
29
- onUpload: OnUpload;
30
- onUploadStart?: OnUploadStart;
31
- onUploadProgress?: OnUploadProgress;
32
- onUploadComplete?: OnUploadComplete;
33
- onUploadError?: OnUploadError;
34
- onFilesChange?: OnFilesChange;
35
- onRemove?: OnRemove;
36
- accept?: string;
37
- multiple?: boolean;
38
- maxSize?: number;
39
- maxFiles?: number;
40
- disabled?: boolean;
41
- autoUpload?: boolean;
42
- retryAttempts?: number;
43
- placeholder?: string;
44
- error?: string;
45
- children?: React.ReactNode;
46
- showFileList?: boolean;
47
- FileListComponent?: (props: {
48
- files: UploadedFile[];
49
- onRemove: (index: number) => void;
50
- }) => React.ReactNode;
51
- files?: UploadedFile[];
52
- };
53
- declare const FileUploader: ({ onUpload, onUploadStart, onUploadProgress, onUploadComplete, onUploadError, onFilesChange, onRemove, accept, multiple, maxSize, maxFiles, disabled, autoUpload, retryAttempts, placeholder, error, children, showFileList, FileListComponent, files: uploadedFiles, }: FileUploaderProps) => react_jsx_runtime.JSX.Element;
54
-
55
- export { type FileUploadState, FileUploader, type FileUploaderProps, type OnFilesChange, type OnRemove, type OnUpload, type OnUploadComplete, type OnUploadError, type OnUploadProgress, type OnUploadStart, type UploadResult, type UploadedFile };
@@ -1,10 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- type InstallPwaUiProps = {
5
- onInstall: React.MouseEventHandler<HTMLButtonElement>;
6
- };
7
- declare const InstallPwaUi: ({ onInstall }: InstallPwaUiProps) => react_jsx_runtime.JSX.Element;
8
- declare const InstallPwa: () => react_jsx_runtime.JSX.Element | null;
9
-
10
- export { InstallPwa, InstallPwaUi, type InstallPwaUiProps };
@@ -1,2 +0,0 @@
1
- export { JsonEditor } from 'json-edit-react';
2
- import 'react-json-view-lite';
@@ -1 +0,0 @@
1
- export { JsonView } from 'react-json-view-lite';
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
-
3
- interface ListProps extends React.HTMLProps<HTMLUListElement> {
4
- children: React.ReactNode;
5
- }
6
- declare const List: React.ForwardRefExoticComponent<Omit<ListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
7
-
8
- interface ListItemProps extends React.HTMLProps<HTMLLIElement> {
9
- children: React.ReactNode;
10
- }
11
- declare const ListItem: React.ForwardRefExoticComponent<Omit<ListItemProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
12
-
13
- export { List, ListItem, type ListItemProps, type ListProps };
@@ -1,11 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { FlexProps } from '@ttoss/ui';
3
- import { Options } from 'react-markdown';
4
-
5
- type MarkdownProps = Options & {
6
- children: string;
7
- sx?: FlexProps['sx'];
8
- };
9
- declare const Markdown: ({ children, sx, ...props }: MarkdownProps) => react_jsx_runtime.JSX.Element;
10
-
11
- export { Markdown, type MarkdownProps };
@@ -1,11 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- type MenuProps = {
5
- children: React.ReactNode;
6
- sx?: Record<string, unknown>;
7
- menuIcon?: string;
8
- };
9
- declare const Menu: ({ children, sx, menuIcon }: MenuProps) => react_jsx_runtime.JSX.Element;
10
-
11
- export { Menu, type MenuProps };
@@ -1,10 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import ReactModal from 'react-modal';
3
-
4
- type ModalProps = ReactModal.Props;
5
- declare const Modal: {
6
- (props: ModalProps): react_jsx_runtime.JSX.Element;
7
- setAppElement: typeof ReactModal.setAppElement;
8
- };
9
-
10
- export { Modal, type ModalProps };
@@ -1,55 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- type NavListItem = {
5
- id?: string;
6
- label: string;
7
- href: string;
8
- icon?: string;
9
- disabled?: boolean;
10
- active?: boolean;
11
- onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
12
- group?: string;
13
- divider?: boolean;
14
- };
15
- type NavListGroup = {
16
- id?: string;
17
- label?: string;
18
- items: NavListItem[];
19
- divider?: boolean;
20
- };
21
- type LinkComponentProps = {
22
- href: string;
23
- onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
24
- children: React.ReactNode;
25
- [key: string]: unknown;
26
- };
27
- type NavListProps = {
28
- items?: NavListItem[];
29
- groups?: NavListGroup[];
30
- variant?: 'sidebar' | 'menu' | 'dropdown';
31
- onItemClick?: (item: NavListItem) => void;
32
- sx?: Record<string, unknown>;
33
- iconSize?: number;
34
- /**
35
- * Custom Link component to use for rendering links.
36
- * Useful for integrating with Next.js Link, React Router Link, etc.
37
- *
38
- * @example
39
- * // Next.js
40
- * import NextLink from 'next/link';
41
- * <NavList LinkComponent={NextLink} ... />
42
- *
43
- * @example
44
- * // React Router
45
- * import { Link as RouterLink } from 'react-router-dom';
46
- * <NavList LinkComponent={RouterLink} ... />
47
- */
48
- LinkComponent?: React.ComponentType<LinkComponentProps>;
49
- };
50
- declare const NavList: {
51
- ({ items, groups, variant, onItemClick, sx, iconSize, LinkComponent, }: NavListProps): react_jsx_runtime.JSX.Element;
52
- displayName: string;
53
- };
54
-
55
- export { type LinkComponentProps, NavList, type NavListGroup, type NavListItem, type NavListProps };
@@ -1,21 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React from 'react';
3
-
4
- type NotificationType = 'success' | 'error' | 'warning' | 'info' | 'neutral';
5
- type NotificationAction = {
6
- action?: 'open_url';
7
- url?: string;
8
- label?: string;
9
- };
10
- type NotificationCardProps = {
11
- type: NotificationType;
12
- title?: string | React.ReactNode;
13
- message: string | React.ReactNode;
14
- actions?: NotificationAction[];
15
- caption?: string | React.ReactNode;
16
- tags?: string[] | React.ReactNode;
17
- onClose?: () => void;
18
- };
19
- declare const NotificationCard: (props: NotificationCardProps) => react_jsx_runtime.JSX.Element;
20
-
21
- export { type NotificationAction, NotificationCard, type NotificationCardProps };
@@ -1,21 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { NotificationCardProps } from '../NotificationCard/index.js';
3
- import 'react';
4
-
5
- type Notification = NotificationCardProps & {
6
- id: string;
7
- group?: string;
8
- };
9
- type Props = {
10
- notifications: Notification[];
11
- defaultOpen?: boolean;
12
- hasMore?: boolean;
13
- count: number;
14
- onLoadMore?: () => void;
15
- onOpenChange?: (isOpen: boolean) => void;
16
- onClose?: () => void;
17
- onClearAll?: () => void;
18
- };
19
- declare const NotificationsMenu: ({ notifications, defaultOpen, hasMore, onLoadMore, onOpenChange, count, onClose, onClearAll, }: Props) => react_jsx_runtime.JSX.Element;
20
-
21
- export { type Notification, NotificationsMenu };
@@ -1,11 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { InputProps } from '@ttoss/ui';
3
-
4
- type SearchProps = Omit<InputProps, 'onChange'> & {
5
- loading?: boolean;
6
- debounce?: number;
7
- onChange: (value?: InputProps['value']) => void;
8
- };
9
- declare const Search: ({ value, defaultValue, loading, onChange, ...props }: SearchProps) => react_jsx_runtime.JSX.Element;
10
-
11
- export { Search, type SearchProps };
@@ -1,27 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { IconType } from '@ttoss/react-icons';
3
- import { ButtonProps } from '@ttoss/ui';
4
- import * as React from 'react';
5
-
6
- type ButtonPropType = ButtonProps | React.ReactNode;
7
- type SpotlightCardProps = {
8
- icon: IconType;
9
- /**
10
- * Title of the card. Pass a ReactNode for styling.
11
- */
12
- title: string | React.ReactNode;
13
- /**
14
- * Badge text. Renders as a badge/tag next to the title.
15
- */
16
- badge?: string | React.ReactNode;
17
- description: string;
18
- firstButton?: ButtonPropType;
19
- secondButton?: ButtonPropType;
20
- variant?: 'accent' | 'primary';
21
- };
22
- declare const SpotlightCard: {
23
- ({ icon, title, badge, description, firstButton, secondButton, variant, }: SpotlightCardProps): react_jsx_runtime.JSX.Element;
24
- displayName: string;
25
- };
26
-
27
- export { SpotlightCard, type SpotlightCardProps };
@@ -1,16 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { BoxProps } from '@ttoss/ui';
3
- export { createCell, createColumnHelper, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
4
-
5
- declare const Table: {
6
- (props: BoxProps): react_jsx_runtime.JSX.Element;
7
- Head: (props: BoxProps) => react_jsx_runtime.JSX.Element;
8
- Body: (props: BoxProps) => react_jsx_runtime.JSX.Element;
9
- Row: (props: BoxProps) => react_jsx_runtime.JSX.Element;
10
- Cell: (props: BoxProps) => react_jsx_runtime.JSX.Element;
11
- Header: (props: BoxProps) => react_jsx_runtime.JSX.Element;
12
- Caption: (props: BoxProps) => react_jsx_runtime.JSX.Element;
13
- Footer: (props: BoxProps) => react_jsx_runtime.JSX.Element;
14
- };
15
-
16
- export { Table };
@@ -1,18 +0,0 @@
1
- import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { BoxProps } from '@ttoss/ui';
4
- import { TabsProps, TabListProps, TabProps, TabPanelProps } from 'react-tabs';
5
- export { TabListProps, TabPanelProps, TabProps, TabsProps } from 'react-tabs';
6
-
7
- declare const Tabs: {
8
- (props: BoxProps & TabsProps): react_jsx_runtime.JSX.Element;
9
- TabList: react.FunctionComponent<TabListProps>;
10
- /**
11
- * Tab default props
12
- * https://github.com/reactjs/react-tabs/blob/main/src/components/Tab.js
13
- */
14
- Tab: react.FunctionComponent<TabProps>;
15
- TabPanel: react.FunctionComponent<TabPanelProps>;
16
- };
17
-
18
- export { Tabs };
@@ -1,8 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ToastContainerProps, toast as toast$1 } from 'react-toastify';
3
- export { ToastContainerProps, ToastOptions } from 'react-toastify';
4
-
5
- declare const ToastContainer: (props: ToastContainerProps) => react_jsx_runtime.JSX.Element;
6
- declare const toast: typeof toast$1;
7
-
8
- export { ToastContainer, toast };
@@ -1,49 +0,0 @@
1
- /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
- import { __name } from "../chunk-V4MHYKRI.js";
3
-
4
- // src/components/Accordion/Accordion.tsx
5
- import * as React from "react";
6
- import { AccordionItem, AccordionItemButton, AccordionItemHeading, AccordionItemPanel, Accordion as ReactAccessibleAccordion } from "react-accessible-accordion";
7
- import { Box, useTheme } from "@ttoss/ui";
8
- import { css as createClassName } from "@emotion/css";
9
- import { css as transformStyleObject } from "@theme-ui/css";
10
- var Accordion = /* @__PURE__ */__name(({
11
- children,
12
- allowMultipleExpanded,
13
- allowZeroExpanded,
14
- preExpanded,
15
- onChange,
16
- ...boxProps
17
- }) => {
18
- const {
19
- theme
20
- } = useTheme();
21
- const className = React.useMemo(() => {
22
- const styles = transformStyleObject({
23
- ".accordion__item": {
24
- marginBottom: 3
25
- },
26
- ".accordion__heading": {
27
- padding: "md",
28
- border: "1px solid",
29
- borderColor: "black"
30
- },
31
- ".accordion__button": {},
32
- ".accordion__panel": {
33
- padding: 2
34
- }
35
- })(theme);
36
- return createClassName(styles);
37
- }, [theme]);
38
- return /* @__PURE__ */React.createElement(Box, {
39
- variant: "accordion",
40
- className,
41
- ...boxProps
42
- }, /* @__PURE__ */React.createElement(ReactAccessibleAccordion, {
43
- allowMultipleExpanded,
44
- allowZeroExpanded,
45
- preExpanded,
46
- onChange
47
- }, children));
48
- }, "Accordion");
49
- export { Accordion, AccordionItem, AccordionItemButton, AccordionItemHeading, AccordionItemPanel };