@arkyn/components 3.0.1-beta.22 → 3.0.1-beta.24
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 +265 -0
- package/dist/bundle.js +1485 -859
- package/dist/bundle.umd.cjs +1 -1
- package/dist/components/audioUpload/hasFileContent/index.d.ts +13 -0
- package/dist/components/audioUpload/hasFileContent/index.d.ts.map +1 -0
- package/dist/components/audioUpload/hasFileContent/index.js +26 -0
- package/dist/components/audioUpload/index.d.ts +82 -0
- package/dist/components/audioUpload/index.d.ts.map +1 -0
- package/dist/components/audioUpload/index.js +120 -0
- package/dist/components/audioUpload/noFileContent/index.d.ts +12 -0
- package/dist/components/audioUpload/noFileContent/index.d.ts.map +1 -0
- package/dist/components/audioUpload/noFileContent/index.js +29 -0
- package/dist/components/clientOnly.d.ts +86 -0
- package/dist/components/clientOnly.d.ts.map +1 -0
- package/dist/components/clientOnly.js +86 -0
- package/dist/components/fileUpload/hasFileContent/index.d.ts +13 -0
- package/dist/components/fileUpload/hasFileContent/index.d.ts.map +1 -0
- package/dist/components/fileUpload/hasFileContent/index.js +34 -0
- package/dist/components/fileUpload/index.d.ts +94 -0
- package/dist/components/fileUpload/index.d.ts.map +1 -0
- package/dist/components/fileUpload/index.js +127 -0
- package/dist/components/fileUpload/noFileContent/index.d.ts +12 -0
- package/dist/components/fileUpload/noFileContent/index.d.ts.map +1 -0
- package/dist/components/fileUpload/noFileContent/index.js +29 -0
- package/dist/components/imageUpload/hasFileContent/index.d.ts +13 -0
- package/dist/components/imageUpload/hasFileContent/index.d.ts.map +1 -0
- package/dist/components/imageUpload/hasFileContent/index.js +24 -0
- package/dist/components/imageUpload/index.d.ts +114 -0
- package/dist/components/imageUpload/index.d.ts.map +1 -0
- package/dist/components/imageUpload/index.js +148 -0
- package/dist/components/imageUpload/noFileContent/index.d.ts +12 -0
- package/dist/components/imageUpload/noFileContent/index.d.ts.map +1 -0
- package/dist/components/imageUpload/noFileContent/index.js +29 -0
- package/dist/components/tab/tabContainer/index.d.ts +1 -1
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
- package/dist/components/table/tableBody/index.d.ts +67 -0
- package/dist/components/table/tableBody/index.d.ts.map +1 -0
- package/dist/components/table/tableBody/index.js +69 -0
- package/dist/components/table/tableCaption/index.d.ts +62 -0
- package/dist/components/table/tableCaption/index.d.ts.map +1 -0
- package/dist/components/table/tableCaption/index.js +64 -0
- package/dist/components/table/tableContainer/index.d.ts +64 -0
- package/dist/components/table/tableContainer/index.d.ts.map +1 -0
- package/dist/components/table/tableContainer/index.js +66 -0
- package/dist/components/table/tableFooter/index.d.ts +45 -0
- package/dist/components/table/tableFooter/index.d.ts.map +1 -0
- package/dist/components/table/tableFooter/index.js +47 -0
- package/dist/components/table/tableHeader/index.d.ts +44 -0
- package/dist/components/table/tableHeader/index.d.ts.map +1 -0
- package/dist/components/table/tableHeader/index.js +46 -0
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/hooks/useDrawer.d.ts +86 -0
- package/dist/hooks/useDrawer.d.ts.map +1 -0
- package/dist/hooks/useDrawer.js +20 -0
- package/dist/hooks/useHydrated.d.ts +76 -0
- package/dist/hooks/useHydrated.d.ts.map +1 -0
- package/dist/hooks/useHydrated.js +81 -0
- package/dist/hooks/useModal.d.ts +81 -0
- package/dist/hooks/useModal.d.ts.map +1 -0
- package/dist/hooks/useModal.js +20 -0
- package/dist/hooks/useToast.d.ts +70 -0
- package/dist/hooks/useToast.d.ts.map +1 -0
- package/dist/hooks/useToast.js +72 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/providers/drawerProvider.d.ts +106 -0
- package/dist/providers/drawerProvider.d.ts.map +1 -0
- package/dist/providers/drawerProvider.js +120 -0
- package/dist/providers/modalProvider.d.ts +103 -0
- package/dist/providers/modalProvider.d.ts.map +1 -0
- package/dist/providers/modalProvider.js +119 -0
- package/dist/providers/toastProvider.d.ts +48 -0
- package/dist/providers/toastProvider.d.ts.map +1 -0
- package/dist/providers/toastProvider.js +73 -0
- package/dist/style.css +1 -1
- package/package.json +21 -3
@@ -0,0 +1,64 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import "./styles.css";
|
3
|
+
/**
|
4
|
+
* TableCaption component - used to provide a title or description for a table with proper styling
|
5
|
+
*
|
6
|
+
* @param props - TableCaption component properties
|
7
|
+
*
|
8
|
+
* **...All valid HTML properties for caption element**
|
9
|
+
*
|
10
|
+
* @returns TableCaption JSX element
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```tsx
|
14
|
+
* // Basic table caption
|
15
|
+
* <TableContainer>
|
16
|
+
* <TableCaption>
|
17
|
+
* User Management
|
18
|
+
* </TableCaption>
|
19
|
+
* <TableHeader>
|
20
|
+
* <th>Name</th>
|
21
|
+
* <th>Email</th>
|
22
|
+
* </TableHeader>
|
23
|
+
* <TableBody>
|
24
|
+
* // table rows...
|
25
|
+
* </TableBody>
|
26
|
+
* </TableContainer>
|
27
|
+
*
|
28
|
+
* // Table caption with custom styling
|
29
|
+
* <TableContainer>
|
30
|
+
* <TableCaption className="highlighted-caption">
|
31
|
+
* Sales Report - Q4 2024
|
32
|
+
* </TableCaption>
|
33
|
+
* <TableHeader>
|
34
|
+
* <th>Product</th>
|
35
|
+
* <th>Revenue</th>
|
36
|
+
* </TableHeader>
|
37
|
+
* <TableBody>
|
38
|
+
* // table rows...
|
39
|
+
* </TableBody>
|
40
|
+
* </TableContainer>
|
41
|
+
*
|
42
|
+
* // Caption with rich content
|
43
|
+
* <TableContainer>
|
44
|
+
* <TableCaption>
|
45
|
+
* <h3>Employee Directory</h3>
|
46
|
+
* <p>Updated: {new Date().toLocaleDateString()}</p>
|
47
|
+
* </TableCaption>
|
48
|
+
* <TableHeader>
|
49
|
+
* <th>Employee ID</th>
|
50
|
+
* <th>Name</th>
|
51
|
+
* <th>Department</th>
|
52
|
+
* </TableHeader>
|
53
|
+
* <TableBody>
|
54
|
+
* // table rows...
|
55
|
+
* </TableBody>
|
56
|
+
* </TableContainer>
|
57
|
+
* ```
|
58
|
+
*/
|
59
|
+
function TableCaption(props) {
|
60
|
+
const { className: baseClassName, children, ...rest } = props;
|
61
|
+
const className = `arkynTableCaption ${baseClassName}`;
|
62
|
+
return (_jsx("caption", { className: className.trim(), ...rest, children: _jsx("div", { className: "arkynTableCaptionContent", children: children }) }));
|
63
|
+
}
|
64
|
+
export { TableCaption };
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { TableHTMLAttributes } from "react";
|
2
|
+
import "./styles.css";
|
3
|
+
type TableContainerProps = TableHTMLAttributes<HTMLTableElement>;
|
4
|
+
/**
|
5
|
+
* TableContainer component - wraps table content in a styled container with responsive behavior
|
6
|
+
*
|
7
|
+
* @param props - TableContainer component properties
|
8
|
+
*
|
9
|
+
* **...All valid HTML properties for table element**
|
10
|
+
*
|
11
|
+
* @returns TableContainer JSX element
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* ```tsx
|
15
|
+
* // Basic table container
|
16
|
+
* <TableContainer>
|
17
|
+
* <TableHeader>
|
18
|
+
* <th>Name</th>
|
19
|
+
* <th>Email</th>
|
20
|
+
* </TableHeader>
|
21
|
+
* <TableBody>
|
22
|
+
* <tr>
|
23
|
+
* <td>John Doe</td>
|
24
|
+
* <td>john@example.com</td>
|
25
|
+
* </tr>
|
26
|
+
* </TableBody>
|
27
|
+
* </TableContainer>
|
28
|
+
*
|
29
|
+
* // Table container with custom styling
|
30
|
+
* <TableContainer className="custom-table">
|
31
|
+
* <TableCaption>
|
32
|
+
* User Management Table
|
33
|
+
* </TableCaption>
|
34
|
+
* <TableHeader>
|
35
|
+
* <th>ID</th>
|
36
|
+
* <th>User</th>
|
37
|
+
* <th>Status</th>
|
38
|
+
* </TableHeader>
|
39
|
+
* <TableBody emptyMessage="No users found">
|
40
|
+
* // table rows...
|
41
|
+
* </TableBody>
|
42
|
+
* <TableFooter>
|
43
|
+
* <Pagination />
|
44
|
+
* </TableFooter>
|
45
|
+
* </TableContainer>
|
46
|
+
*
|
47
|
+
* // Responsive table with overflow handling
|
48
|
+
* <TableContainer style={{ maxWidth: '100%', overflowX: 'auto' }}>
|
49
|
+
* <TableHeader>
|
50
|
+
* <th>Product</th>
|
51
|
+
* <th>Description</th>
|
52
|
+
* <th>Price</th>
|
53
|
+
* <th>Stock</th>
|
54
|
+
* <th>Actions</th>
|
55
|
+
* </TableHeader>
|
56
|
+
* <TableBody>
|
57
|
+
* // table rows...
|
58
|
+
* </TableBody>
|
59
|
+
* </TableContainer>
|
60
|
+
* ```
|
61
|
+
*/
|
62
|
+
declare function TableContainer(props: TableContainerProps): import("react/jsx-runtime").JSX.Element;
|
63
|
+
export { TableContainer };
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/tableContainer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,cAAc,CAAC;AAEtB,KAAK,mBAAmB,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CASjD;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import "./styles.css";
|
3
|
+
/**
|
4
|
+
* TableContainer component - wraps table content in a styled container with responsive behavior
|
5
|
+
*
|
6
|
+
* @param props - TableContainer component properties
|
7
|
+
*
|
8
|
+
* **...All valid HTML properties for table element**
|
9
|
+
*
|
10
|
+
* @returns TableContainer JSX element
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```tsx
|
14
|
+
* // Basic table container
|
15
|
+
* <TableContainer>
|
16
|
+
* <TableHeader>
|
17
|
+
* <th>Name</th>
|
18
|
+
* <th>Email</th>
|
19
|
+
* </TableHeader>
|
20
|
+
* <TableBody>
|
21
|
+
* <tr>
|
22
|
+
* <td>John Doe</td>
|
23
|
+
* <td>john@example.com</td>
|
24
|
+
* </tr>
|
25
|
+
* </TableBody>
|
26
|
+
* </TableContainer>
|
27
|
+
*
|
28
|
+
* // Table container with custom styling
|
29
|
+
* <TableContainer className="custom-table">
|
30
|
+
* <TableCaption>
|
31
|
+
* User Management Table
|
32
|
+
* </TableCaption>
|
33
|
+
* <TableHeader>
|
34
|
+
* <th>ID</th>
|
35
|
+
* <th>User</th>
|
36
|
+
* <th>Status</th>
|
37
|
+
* </TableHeader>
|
38
|
+
* <TableBody emptyMessage="No users found">
|
39
|
+
* // table rows...
|
40
|
+
* </TableBody>
|
41
|
+
* <TableFooter>
|
42
|
+
* <Pagination />
|
43
|
+
* </TableFooter>
|
44
|
+
* </TableContainer>
|
45
|
+
*
|
46
|
+
* // Responsive table with overflow handling
|
47
|
+
* <TableContainer style={{ maxWidth: '100%', overflowX: 'auto' }}>
|
48
|
+
* <TableHeader>
|
49
|
+
* <th>Product</th>
|
50
|
+
* <th>Description</th>
|
51
|
+
* <th>Price</th>
|
52
|
+
* <th>Stock</th>
|
53
|
+
* <th>Actions</th>
|
54
|
+
* </TableHeader>
|
55
|
+
* <TableBody>
|
56
|
+
* // table rows...
|
57
|
+
* </TableBody>
|
58
|
+
* </TableContainer>
|
59
|
+
* ```
|
60
|
+
*/
|
61
|
+
function TableContainer(props) {
|
62
|
+
const { children, className: baseClassName, ...rest } = props;
|
63
|
+
const className = `arkynTableContainer ${baseClassName}`;
|
64
|
+
return (_jsx("div", { className: className.trim(), ...rest, children: _jsx("table", { children: children }) }));
|
65
|
+
}
|
66
|
+
export { TableContainer };
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { HTMLAttributes } from "react";
|
2
|
+
import "./styles.css";
|
3
|
+
type TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;
|
4
|
+
/**
|
5
|
+
* TableFooter component - used to render the footer section of a table with content container
|
6
|
+
*
|
7
|
+
* @param props - TableFooter component properties
|
8
|
+
*
|
9
|
+
* **...All valid HTML properties for tfoot element**
|
10
|
+
*
|
11
|
+
* @returns TableFooter JSX element
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* ```tsx
|
15
|
+
* // Basic table footer with pagination
|
16
|
+
* <TableFooter>
|
17
|
+
* <div>Showing 1-10 of 100 results</div>
|
18
|
+
* <Pagination />
|
19
|
+
* </TableFooter>
|
20
|
+
*
|
21
|
+
* // Table footer with custom styling
|
22
|
+
* <TableFooter className="custom-footer">
|
23
|
+
* <Button>Load More</Button>
|
24
|
+
* </TableFooter>
|
25
|
+
*
|
26
|
+
* // Complete table usage
|
27
|
+
* <TableContainer>
|
28
|
+
* <TableHeader>
|
29
|
+
* <th>Name</th>
|
30
|
+
* <th>Email</th>
|
31
|
+
* </TableHeader>
|
32
|
+
* <TableBody>
|
33
|
+
* // table rows...
|
34
|
+
* </TableBody>
|
35
|
+
* <TableFooter>
|
36
|
+
* <div className="pagination-info">
|
37
|
+
* Total: 250 items
|
38
|
+
* </div>
|
39
|
+
* </TableFooter>
|
40
|
+
* </TableContainer>
|
41
|
+
* ```
|
42
|
+
*/
|
43
|
+
declare function TableFooter(props: TableFooterProps): import("react/jsx-runtime").JSX.Element;
|
44
|
+
export { TableFooter };
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/tableFooter/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAc3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import "./styles.css";
|
3
|
+
/**
|
4
|
+
* TableFooter component - used to render the footer section of a table with content container
|
5
|
+
*
|
6
|
+
* @param props - TableFooter component properties
|
7
|
+
*
|
8
|
+
* **...All valid HTML properties for tfoot element**
|
9
|
+
*
|
10
|
+
* @returns TableFooter JSX element
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```tsx
|
14
|
+
* // Basic table footer with pagination
|
15
|
+
* <TableFooter>
|
16
|
+
* <div>Showing 1-10 of 100 results</div>
|
17
|
+
* <Pagination />
|
18
|
+
* </TableFooter>
|
19
|
+
*
|
20
|
+
* // Table footer with custom styling
|
21
|
+
* <TableFooter className="custom-footer">
|
22
|
+
* <Button>Load More</Button>
|
23
|
+
* </TableFooter>
|
24
|
+
*
|
25
|
+
* // Complete table usage
|
26
|
+
* <TableContainer>
|
27
|
+
* <TableHeader>
|
28
|
+
* <th>Name</th>
|
29
|
+
* <th>Email</th>
|
30
|
+
* </TableHeader>
|
31
|
+
* <TableBody>
|
32
|
+
* // table rows...
|
33
|
+
* </TableBody>
|
34
|
+
* <TableFooter>
|
35
|
+
* <div className="pagination-info">
|
36
|
+
* Total: 250 items
|
37
|
+
* </div>
|
38
|
+
* </TableFooter>
|
39
|
+
* </TableContainer>
|
40
|
+
* ```
|
41
|
+
*/
|
42
|
+
function TableFooter(props) {
|
43
|
+
const { className: baseClassName, children, ...rest } = props;
|
44
|
+
const className = `arkynTableFooter ${baseClassName}`;
|
45
|
+
return (_jsxs("tfoot", { className: className.trim(), ...rest, children: [_jsx("tr", { className: "spacingRow" }), _jsx("tr", { children: _jsx("th", { colSpan: 100, children: _jsx("div", { className: "arkynTableFooterContent", children: children }) }) })] }));
|
46
|
+
}
|
47
|
+
export { TableFooter };
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import { HTMLAttributes } from "react";
|
2
|
+
import "./styles.css";
|
3
|
+
type TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;
|
4
|
+
/**
|
5
|
+
* TableHeader component - used to render the header section of a table with automatic spacing
|
6
|
+
*
|
7
|
+
* @param props - TableHeader component properties
|
8
|
+
*
|
9
|
+
* **...All valid HTML properties for thead element**
|
10
|
+
*
|
11
|
+
* @returns TableHeader JSX element
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* ```tsx
|
15
|
+
* // Basic table header
|
16
|
+
* <TableHeader>
|
17
|
+
* <th>Name</th>
|
18
|
+
* <th>Email</th>
|
19
|
+
* <th>Actions</th>
|
20
|
+
* </TableHeader>
|
21
|
+
*
|
22
|
+
* // Table header with custom styling
|
23
|
+
* <TableHeader className="custom-header">
|
24
|
+
* <th>Product</th>
|
25
|
+
* <th>Price</th>
|
26
|
+
* <th>Stock</th>
|
27
|
+
* </TableHeader>
|
28
|
+
*
|
29
|
+
* // Complete table usage
|
30
|
+
* <TableContainer>
|
31
|
+
* <TableHeader>
|
32
|
+
* <th>ID</th>
|
33
|
+
* <th>User</th>
|
34
|
+
* <th>Status</th>
|
35
|
+
* </TableHeader>
|
36
|
+
* <TableBody>
|
37
|
+
* // table rows...
|
38
|
+
* </TableBody>
|
39
|
+
* </TableContainer>
|
40
|
+
* ```
|
41
|
+
*/
|
42
|
+
declare function TableHeader(props: TableHeaderProps): import("react/jsx-runtime").JSX.Element;
|
43
|
+
export { TableHeader };
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/table/tableHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,KAAK,gBAAgB,GAAG,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAU3C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import "./styles.css";
|
3
|
+
/**
|
4
|
+
* TableHeader component - used to render the header section of a table with automatic spacing
|
5
|
+
*
|
6
|
+
* @param props - TableHeader component properties
|
7
|
+
*
|
8
|
+
* **...All valid HTML properties for thead element**
|
9
|
+
*
|
10
|
+
* @returns TableHeader JSX element
|
11
|
+
*
|
12
|
+
* @example
|
13
|
+
* ```tsx
|
14
|
+
* // Basic table header
|
15
|
+
* <TableHeader>
|
16
|
+
* <th>Name</th>
|
17
|
+
* <th>Email</th>
|
18
|
+
* <th>Actions</th>
|
19
|
+
* </TableHeader>
|
20
|
+
*
|
21
|
+
* // Table header with custom styling
|
22
|
+
* <TableHeader className="custom-header">
|
23
|
+
* <th>Product</th>
|
24
|
+
* <th>Price</th>
|
25
|
+
* <th>Stock</th>
|
26
|
+
* </TableHeader>
|
27
|
+
*
|
28
|
+
* // Complete table usage
|
29
|
+
* <TableContainer>
|
30
|
+
* <TableHeader>
|
31
|
+
* <th>ID</th>
|
32
|
+
* <th>User</th>
|
33
|
+
* <th>Status</th>
|
34
|
+
* </TableHeader>
|
35
|
+
* <TableBody>
|
36
|
+
* // table rows...
|
37
|
+
* </TableBody>
|
38
|
+
* </TableContainer>
|
39
|
+
* ```
|
40
|
+
*/
|
41
|
+
function TableHeader(props) {
|
42
|
+
const { className: baseClassName, children, ...rest } = props;
|
43
|
+
const className = `arkynTableHeader ${baseClassName}`;
|
44
|
+
return (_jsxs("thead", { className: className.trim(), ...rest, children: [_jsx("tr", { children: children }), _jsx("tr", { className: "spacingRow" })] }));
|
45
|
+
}
|
46
|
+
export { TableHeader };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,EAKV,MAAM,OAAO,CAAC;AACf,OAAO,cAAc,CAAC;AAEtB,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,EAKV,MAAM,OAAO,CAAC;AACf,OAAO,cAAc,CAAC;AAEtB,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAqFnC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -130,6 +130,6 @@ function Tooltip(props) {
|
|
130
130
|
};
|
131
131
|
}, [orientation, tooltipId]);
|
132
132
|
const className = `arkynTooltip ${size} ${adjustedOrientation} ${baseClassName}`;
|
133
|
-
return (_jsxs("div", { className: className.trim(), ...rest, ref: tooltipRef, children: [children, _jsx("div", { className: "arkynTooltipText", id: tooltipId,
|
133
|
+
return (_jsxs("div", { className: className.trim(), ...rest, ref: tooltipRef, children: [children, _jsx("div", { className: "arkynTooltipText", id: tooltipId, dangerouslySetInnerHTML: { __html: text } })] }));
|
134
134
|
}
|
135
135
|
export { Tooltip };
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import { DrawerContextProps } from "../providers/drawerProvider";
|
2
|
+
type OpenDrawerProps<T = any> = (data?: T) => void;
|
3
|
+
/**
|
4
|
+
* useDrawer hook - provides access to drawer context for managing drawer state and data
|
5
|
+
*
|
6
|
+
* @param key - Optional drawer identifier key. When provided, returns functions for a specific drawer
|
7
|
+
*
|
8
|
+
* @returns When called without key: Complete drawer context with all drawer management functions
|
9
|
+
* @returns When called with key: Object containing drawer-specific functions:
|
10
|
+
* - `drawerIsOpen`: Boolean indicating if the specific drawer is open
|
11
|
+
* - `drawerData`: Data associated with the specific drawer
|
12
|
+
* - `openDrawer`: Function to open the specific drawer with optional data
|
13
|
+
* - `closeDrawer`: Function to close the specific drawer
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* ```tsx
|
17
|
+
* // Basic usage - access to full drawer context
|
18
|
+
* function DrawerManager() {
|
19
|
+
* const drawerContext = useDrawer();
|
20
|
+
*
|
21
|
+
* return (
|
22
|
+
* <div>
|
23
|
+
* <button onClick={() => drawerContext.openDrawer('navigation', { section: 'main' })}>
|
24
|
+
* Open Navigation
|
25
|
+
* </button>
|
26
|
+
* <button onClick={() => drawerContext.openDrawer('filters', { category: 'electronics' })}>
|
27
|
+
* Open Filters
|
28
|
+
* </button>
|
29
|
+
* </div>
|
30
|
+
* );
|
31
|
+
* }
|
32
|
+
*
|
33
|
+
* // Usage with specific drawer key
|
34
|
+
* function NavigationDrawer() {
|
35
|
+
* const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer('navigation');
|
36
|
+
*
|
37
|
+
* return (
|
38
|
+
* <Drawer isOpen={drawerIsOpen} onClose={closeDrawer} position="left">
|
39
|
+
* <h2>Navigation</h2>
|
40
|
+
* <p>Current section: {drawerData?.section}</p>
|
41
|
+
* <button onClick={closeDrawer}>Close</button>
|
42
|
+
* </Drawer>
|
43
|
+
* );
|
44
|
+
* }
|
45
|
+
*
|
46
|
+
* // Usage with typed data
|
47
|
+
* interface FilterData {
|
48
|
+
* category: string;
|
49
|
+
* priceRange: [number, number];
|
50
|
+
* brands: string[];
|
51
|
+
* }
|
52
|
+
*
|
53
|
+
* function FilterDrawer() {
|
54
|
+
* const { drawerIsOpen, drawerData, closeDrawer } = useDrawer<FilterData>('filters');
|
55
|
+
*
|
56
|
+
* return (
|
57
|
+
* <Drawer isOpen={drawerIsOpen} onClose={closeDrawer} position="right">
|
58
|
+
* <h2>Filters</h2>
|
59
|
+
* <p>Category: {drawerData?.category}</p>
|
60
|
+
* <p>Price: ${drawerData?.priceRange?.[0]} - ${drawerData?.priceRange?.[1]}</p>
|
61
|
+
* <p>Brands: {drawerData?.brands?.join(', ')}</p>
|
62
|
+
* </Drawer>
|
63
|
+
* );
|
64
|
+
* }
|
65
|
+
*
|
66
|
+
* // Usage with DrawerProvider
|
67
|
+
* function App() {
|
68
|
+
* return (
|
69
|
+
* <DrawerProvider>
|
70
|
+
* <NavigationDrawer />
|
71
|
+
* <FilterDrawer />
|
72
|
+
* <DrawerManager />
|
73
|
+
* </DrawerProvider>
|
74
|
+
* );
|
75
|
+
* }
|
76
|
+
* ```
|
77
|
+
*/
|
78
|
+
declare function useDrawer<T = any>(): DrawerContextProps<T>;
|
79
|
+
declare function useDrawer<T = any>(key: string): {
|
80
|
+
drawerIsOpen: boolean;
|
81
|
+
drawerData: T;
|
82
|
+
openDrawer: OpenDrawerProps<T>;
|
83
|
+
closeDrawer: () => void;
|
84
|
+
};
|
85
|
+
export { useDrawer };
|
86
|
+
//# sourceMappingURL=useDrawer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useDrawer.d.ts","sourceRoot":"","sources":["../../src/hooks/useDrawer.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEhF,KAAK,eAAe,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,iBAAS,SAAS,CAAC,CAAC,GAAG,GAAG,KAAK,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACrD,iBAAS,SAAS,CAAC,CAAC,GAAG,GAAG,EACxB,GAAG,EAAE,MAAM,GACV;IACD,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,CAAC,CAAC;IACd,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AA6BF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { useContext } from "react";
|
2
|
+
import { drawerContext } from "../providers/drawerProvider";
|
3
|
+
function useDrawer(key) {
|
4
|
+
const contextData = useContext(drawerContext);
|
5
|
+
if (Object.entries(contextData).length === 0) {
|
6
|
+
throw new Error("useDrawer must be used within a Provider");
|
7
|
+
}
|
8
|
+
if (key) {
|
9
|
+
const { drawerData: contextDrawerData, drawerIsOpen: contextDrawerIsOpen, openDrawer: contextOpenDrawer, closeDrawer: contextCloseDrawer, } = contextData;
|
10
|
+
const drawerIsOpen = contextDrawerIsOpen(key);
|
11
|
+
const drawerData = contextDrawerData(key);
|
12
|
+
const openDrawer = (data) => contextOpenDrawer(key, data);
|
13
|
+
const closeDrawer = () => contextCloseDrawer(key);
|
14
|
+
return { drawerIsOpen, drawerData, openDrawer, closeDrawer };
|
15
|
+
}
|
16
|
+
else {
|
17
|
+
return contextData;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
export { useDrawer };
|
@@ -0,0 +1,76 @@
|
|
1
|
+
/**
|
2
|
+
* useHydrated hook - detects if the component is hydrated on the client side
|
3
|
+
*
|
4
|
+
* This hook is useful for preventing hydration mismatches when rendering different content
|
5
|
+
* on server and client sides. It returns false during SSR and true after hydration.
|
6
|
+
*
|
7
|
+
* @returns Boolean indicating if the component is hydrated
|
8
|
+
* - `true`: Component is hydrated on the client side
|
9
|
+
* - `false`: Component is being rendered on the server side or before hydration
|
10
|
+
*
|
11
|
+
* @example
|
12
|
+
* ```tsx
|
13
|
+
* // Basic usage to prevent hydration mismatches
|
14
|
+
* function ClientOnlyComponent() {
|
15
|
+
* const isHydrated = useHydrated();
|
16
|
+
*
|
17
|
+
* if (!isHydrated) {
|
18
|
+
* return <div>Loading...</div>;
|
19
|
+
* }
|
20
|
+
*
|
21
|
+
* return (
|
22
|
+
* <div>
|
23
|
+
* <p>This content is only rendered on the client</p>
|
24
|
+
* <p>Current time: {new Date().toLocaleString()}</p>
|
25
|
+
* </div>
|
26
|
+
* );
|
27
|
+
* }
|
28
|
+
*
|
29
|
+
* // Conditional rendering based on hydration state
|
30
|
+
* function ResponsiveComponent() {
|
31
|
+
* const isHydrated = useHydrated();
|
32
|
+
*
|
33
|
+
* return (
|
34
|
+
* <div>
|
35
|
+
* <h1>My App</h1>
|
36
|
+
* {isHydrated ? (
|
37
|
+
* <InteractiveWidget />
|
38
|
+
* ) : (
|
39
|
+
* <StaticPlaceholder />
|
40
|
+
* )}
|
41
|
+
* </div>
|
42
|
+
* );
|
43
|
+
* }
|
44
|
+
*
|
45
|
+
* // Using with client-only features
|
46
|
+
* function LocationComponent() {
|
47
|
+
* const isHydrated = useHydrated();
|
48
|
+
* const [location, setLocation] = useState(null);
|
49
|
+
*
|
50
|
+
* useEffect(() => {
|
51
|
+
* if (isHydrated && navigator.geolocation) {
|
52
|
+
* navigator.geolocation.getCurrentPosition((pos) => {
|
53
|
+
* setLocation(pos.coords);
|
54
|
+
* });
|
55
|
+
* }
|
56
|
+
* }, [isHydrated]);
|
57
|
+
*
|
58
|
+
* if (!isHydrated) {
|
59
|
+
* return <div>Preparing location services...</div>;
|
60
|
+
* }
|
61
|
+
*
|
62
|
+
* return (
|
63
|
+
* <div>
|
64
|
+
* {location ? (
|
65
|
+
* <p>Your location: {location.latitude}, {location.longitude}</p>
|
66
|
+
* ) : (
|
67
|
+
* <p>Getting your location...</p>
|
68
|
+
* )}
|
69
|
+
* </div>
|
70
|
+
* );
|
71
|
+
* }
|
72
|
+
* ```
|
73
|
+
*/
|
74
|
+
declare function useHydrated(): boolean;
|
75
|
+
export { useHydrated };
|
76
|
+
//# sourceMappingURL=useHydrated.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useHydrated.d.ts","sourceRoot":"","sources":["../../src/hooks/useHydrated.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAEH,iBAAS,WAAW,YAMnB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
2
|
+
function subscribe() {
|
3
|
+
return () => { };
|
4
|
+
}
|
5
|
+
/**
|
6
|
+
* useHydrated hook - detects if the component is hydrated on the client side
|
7
|
+
*
|
8
|
+
* This hook is useful for preventing hydration mismatches when rendering different content
|
9
|
+
* on server and client sides. It returns false during SSR and true after hydration.
|
10
|
+
*
|
11
|
+
* @returns Boolean indicating if the component is hydrated
|
12
|
+
* - `true`: Component is hydrated on the client side
|
13
|
+
* - `false`: Component is being rendered on the server side or before hydration
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* ```tsx
|
17
|
+
* // Basic usage to prevent hydration mismatches
|
18
|
+
* function ClientOnlyComponent() {
|
19
|
+
* const isHydrated = useHydrated();
|
20
|
+
*
|
21
|
+
* if (!isHydrated) {
|
22
|
+
* return <div>Loading...</div>;
|
23
|
+
* }
|
24
|
+
*
|
25
|
+
* return (
|
26
|
+
* <div>
|
27
|
+
* <p>This content is only rendered on the client</p>
|
28
|
+
* <p>Current time: {new Date().toLocaleString()}</p>
|
29
|
+
* </div>
|
30
|
+
* );
|
31
|
+
* }
|
32
|
+
*
|
33
|
+
* // Conditional rendering based on hydration state
|
34
|
+
* function ResponsiveComponent() {
|
35
|
+
* const isHydrated = useHydrated();
|
36
|
+
*
|
37
|
+
* return (
|
38
|
+
* <div>
|
39
|
+
* <h1>My App</h1>
|
40
|
+
* {isHydrated ? (
|
41
|
+
* <InteractiveWidget />
|
42
|
+
* ) : (
|
43
|
+
* <StaticPlaceholder />
|
44
|
+
* )}
|
45
|
+
* </div>
|
46
|
+
* );
|
47
|
+
* }
|
48
|
+
*
|
49
|
+
* // Using with client-only features
|
50
|
+
* function LocationComponent() {
|
51
|
+
* const isHydrated = useHydrated();
|
52
|
+
* const [location, setLocation] = useState(null);
|
53
|
+
*
|
54
|
+
* useEffect(() => {
|
55
|
+
* if (isHydrated && navigator.geolocation) {
|
56
|
+
* navigator.geolocation.getCurrentPosition((pos) => {
|
57
|
+
* setLocation(pos.coords);
|
58
|
+
* });
|
59
|
+
* }
|
60
|
+
* }, [isHydrated]);
|
61
|
+
*
|
62
|
+
* if (!isHydrated) {
|
63
|
+
* return <div>Preparing location services...</div>;
|
64
|
+
* }
|
65
|
+
*
|
66
|
+
* return (
|
67
|
+
* <div>
|
68
|
+
* {location ? (
|
69
|
+
* <p>Your location: {location.latitude}, {location.longitude}</p>
|
70
|
+
* ) : (
|
71
|
+
* <p>Getting your location...</p>
|
72
|
+
* )}
|
73
|
+
* </div>
|
74
|
+
* );
|
75
|
+
* }
|
76
|
+
* ```
|
77
|
+
*/
|
78
|
+
function useHydrated() {
|
79
|
+
return useSyncExternalStore(subscribe, () => true, () => false);
|
80
|
+
}
|
81
|
+
export { useHydrated };
|