@skalfa/skalfa-component 1.0.0 → 1.0.3

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 (188) hide show
  1. package/dist/accordion/Accordion.component.d.ts +1 -1
  2. package/dist/breadcrumb/Breadcrumb.component.d.ts +1 -1
  3. package/dist/button/Button.component.d.ts +1 -1
  4. package/dist/card/AlertCard.component.d.ts +1 -1
  5. package/dist/card/Card.component.d.ts +1 -1
  6. package/dist/card/DashboardCard.component.d.ts +1 -1
  7. package/dist/card/GalleryCard.component.d.ts +1 -1
  8. package/dist/card/ProductCard.component.d.ts +1 -1
  9. package/dist/card/ProfileCard.component.d.ts +1 -1
  10. package/dist/carousel/Carousel.component.d.ts +1 -1
  11. package/dist/chip/Chip.component.d.ts +1 -1
  12. package/dist/index.js +175 -56
  13. package/dist/input/Checkbox.component.d.ts +1 -1
  14. package/dist/input/Input.component.d.ts +1 -1
  15. package/dist/input/InputCheckbox.component.d.ts +1 -1
  16. package/dist/input/InputCheckbox.component.js +2 -2
  17. package/dist/input/InputCurrency.component.d.ts +1 -1
  18. package/dist/input/InputDate.component.d.ts +1 -1
  19. package/dist/input/InputDate.component.js +9 -7
  20. package/dist/input/InputDatetime.component.d.ts +1 -1
  21. package/dist/input/InputDatetime.component.js +13 -8
  22. package/dist/input/InputDocument.component.d.ts +1 -1
  23. package/dist/input/InputDocument.component.js +6 -4
  24. package/dist/input/InputImage.component.js +5 -3
  25. package/dist/input/InputMap.component.d.ts +1 -1
  26. package/dist/input/InputMap.component.js +5 -3
  27. package/dist/input/InputNumber.component.d.ts +1 -1
  28. package/dist/input/InputPassword.component.d.ts +1 -1
  29. package/dist/input/InputRadio.component.d.ts +1 -1
  30. package/dist/input/InputRadio.component.js +2 -2
  31. package/dist/input/InputTime.component.d.ts +1 -1
  32. package/dist/input/InputTime.component.js +5 -3
  33. package/dist/input/InputValues.component.d.ts +1 -1
  34. package/dist/input/Radio.component.d.ts +1 -1
  35. package/dist/input/Select.component.d.ts +1 -1
  36. package/dist/modal/FloatingPage.component.d.ts +1 -1
  37. package/dist/modal/FloatingPage.component.js +2 -2
  38. package/dist/modal/Modal.component.d.ts +1 -1
  39. package/dist/modal/Modal.component.js +2 -2
  40. package/dist/modal/ModalConfirm.component.d.ts +2 -2
  41. package/dist/modal/ModalConfirm.component.js +5 -3
  42. package/dist/modal/Toast.component.d.ts +1 -1
  43. package/dist/modal/Toast.component.js +2 -2
  44. package/dist/nav/Bottombar.component.d.ts +1 -1
  45. package/dist/nav/Footer.component.d.ts +1 -1
  46. package/dist/nav/Headbar.component.d.ts +4 -11
  47. package/dist/nav/Headbar.component.js +3 -22
  48. package/dist/nav/Navbar.component.d.ts +1 -1
  49. package/dist/nav/Navbar.component.js +2 -2
  50. package/dist/nav/Sidebar.component.d.ts +2 -2
  51. package/dist/nav/Tabbar.component.d.ts +1 -1
  52. package/dist/nav/Wizard.component.d.ts +1 -1
  53. package/dist/supervision/FormSupervision.component.d.ts +14 -2
  54. package/dist/supervision/FormSupervision.component.js +32 -17
  55. package/dist/supervision/TableSupervision.component.d.ts +7 -2
  56. package/dist/supervision/TableSupervision.component.js +25 -19
  57. package/dist/table/ControlBar.component.d.ts +2 -2
  58. package/dist/table/ControlBar.component.js +20 -14
  59. package/dist/table/FilterComponent.d.ts +2 -2
  60. package/dist/table/FilterComponent.js +24 -17
  61. package/dist/table/Pagination.component.d.ts +1 -1
  62. package/dist/table/Pagination.component.js +4 -3
  63. package/dist/table/Table.component.d.ts +4 -2
  64. package/dist/table/Table.component.js +11 -7
  65. package/dist/typography/TypographyArticle.component.d.ts +1 -1
  66. package/dist/typography/TypographyColumn.component.d.ts +1 -1
  67. package/dist/typography/TypographyContent.component.d.ts +1 -1
  68. package/dist/typography/TypographyTips.component.d.ts +1 -1
  69. package/dist/wrap/Image.component.d.ts +1 -1
  70. package/dist/wrap/ScrollContainer.component.d.ts +1 -1
  71. package/dist/wrap/ShortcutProvider.d.ts +1 -1
  72. package/dist/wrap/ShortcutProvider.js +2 -2
  73. package/dist/wrap/Swipe.component.d.ts +1 -1
  74. package/package.json +4 -3
  75. package/dist/src/accordion/Accordion.component.d.ts +0 -13
  76. package/dist/src/accordion/Accordion.component.js +0 -25
  77. package/dist/src/breadcrumb/Breadcrumb.component.d.ts +0 -14
  78. package/dist/src/breadcrumb/Breadcrumb.component.js +0 -21
  79. package/dist/src/button/Button.component.d.ts +0 -21
  80. package/dist/src/button/Button.component.js +0 -19
  81. package/dist/src/card/AlertCard.component.d.ts +0 -11
  82. package/dist/src/card/AlertCard.component.js +0 -9
  83. package/dist/src/card/Card.component.d.ts +0 -5
  84. package/dist/src/card/Card.component.js +0 -9
  85. package/dist/src/card/DashboardCard.component.d.ts +0 -9
  86. package/dist/src/card/DashboardCard.component.js +0 -13
  87. package/dist/src/card/GalleryCard.component.d.ts +0 -7
  88. package/dist/src/card/GalleryCard.component.js +0 -13
  89. package/dist/src/card/ProductCard.component.d.ts +0 -9
  90. package/dist/src/card/ProductCard.component.js +0 -13
  91. package/dist/src/card/ProfileCard.component.d.ts +0 -10
  92. package/dist/src/card/ProfileCard.component.js +0 -13
  93. package/dist/src/carousel/Carousel.component.d.ts +0 -13
  94. package/dist/src/carousel/Carousel.component.js +0 -37
  95. package/dist/src/chip/Chip.component.d.ts +0 -6
  96. package/dist/src/chip/Chip.component.js +0 -12
  97. package/dist/src/index.d.ts +0 -13
  98. package/dist/src/index.js +0 -29
  99. package/dist/src/input/Checkbox.component.d.ts +0 -13
  100. package/dist/src/input/Checkbox.component.js +0 -23
  101. package/dist/src/input/Input.component.d.ts +0 -23
  102. package/dist/src/input/Input.component.js +0 -134
  103. package/dist/src/input/InputCheckbox.component.d.ts +0 -27
  104. package/dist/src/input/InputCheckbox.component.js +0 -53
  105. package/dist/src/input/InputCurrency.component.d.ts +0 -21
  106. package/dist/src/input/InputCurrency.component.js +0 -30
  107. package/dist/src/input/InputDate.component.d.ts +0 -24
  108. package/dist/src/input/InputDate.component.js +0 -107
  109. package/dist/src/input/InputDatetime.component.d.ts +0 -17
  110. package/dist/src/input/InputDatetime.component.js +0 -75
  111. package/dist/src/input/InputDocument.component.d.ts +0 -22
  112. package/dist/src/input/InputDocument.component.js +0 -88
  113. package/dist/src/input/InputImage.component.d.ts +0 -23
  114. package/dist/src/input/InputImage.component.js +0 -260
  115. package/dist/src/input/InputMap.component.d.ts +0 -25
  116. package/dist/src/input/InputMap.component.js +0 -101
  117. package/dist/src/input/InputNumber.component.d.ts +0 -19
  118. package/dist/src/input/InputNumber.component.js +0 -40
  119. package/dist/src/input/InputOtp.component.d.ts +0 -14
  120. package/dist/src/input/InputOtp.component.js +0 -65
  121. package/dist/src/input/InputPassword.component.d.ts +0 -17
  122. package/dist/src/input/InputPassword.component.js +0 -59
  123. package/dist/src/input/InputRadio.component.d.ts +0 -27
  124. package/dist/src/input/InputRadio.component.js +0 -56
  125. package/dist/src/input/InputTime.component.d.ts +0 -23
  126. package/dist/src/input/InputTime.component.js +0 -73
  127. package/dist/src/input/InputValues.component.d.ts +0 -9
  128. package/dist/src/input/InputValues.component.js +0 -19
  129. package/dist/src/input/Radio.component.d.ts +0 -12
  130. package/dist/src/input/Radio.component.js +0 -22
  131. package/dist/src/input/Select.component.d.ts +0 -47
  132. package/dist/src/input/Select.component.js +0 -275
  133. package/dist/src/modal/BottomSheet.component.d.ts +0 -12
  134. package/dist/src/modal/BottomSheet.component.js +0 -161
  135. package/dist/src/modal/FloatingPage.component.d.ts +0 -12
  136. package/dist/src/modal/FloatingPage.component.js +0 -27
  137. package/dist/src/modal/Modal.component.d.ts +0 -12
  138. package/dist/src/modal/Modal.component.js +0 -27
  139. package/dist/src/modal/ModalConfirm.component.d.ts +0 -26
  140. package/dist/src/modal/ModalConfirm.component.js +0 -68
  141. package/dist/src/modal/Toast.component.d.ts +0 -11
  142. package/dist/src/modal/Toast.component.js +0 -58
  143. package/dist/src/nav/Bottombar.component.d.ts +0 -12
  144. package/dist/src/nav/Bottombar.component.js +0 -32
  145. package/dist/src/nav/Footer.component.d.ts +0 -37
  146. package/dist/src/nav/Footer.component.js +0 -49
  147. package/dist/src/nav/Headbar.component.d.ts +0 -14
  148. package/dist/src/nav/Headbar.component.js +0 -32
  149. package/dist/src/nav/Navbar.component.d.ts +0 -22
  150. package/dist/src/nav/Navbar.component.js +0 -26
  151. package/dist/src/nav/Sidebar.component.d.ts +0 -33
  152. package/dist/src/nav/Sidebar.component.js +0 -87
  153. package/dist/src/nav/Tabbar.component.d.ts +0 -13
  154. package/dist/src/nav/Tabbar.component.js +0 -17
  155. package/dist/src/nav/Wizard.component.d.ts +0 -9
  156. package/dist/src/nav/Wizard.component.js +0 -24
  157. package/dist/src/supervision/FormSupervision.component.d.ts +0 -93
  158. package/dist/src/supervision/FormSupervision.component.js +0 -168
  159. package/dist/src/supervision/TableSupervision.component.d.ts +0 -78
  160. package/dist/src/supervision/TableSupervision.component.js +0 -273
  161. package/dist/src/table/ControlBar.component.d.ts +0 -34
  162. package/dist/src/table/ControlBar.component.js +0 -205
  163. package/dist/src/table/FilterComponent.d.ts +0 -45
  164. package/dist/src/table/FilterComponent.js +0 -132
  165. package/dist/src/table/Pagination.component.d.ts +0 -8
  166. package/dist/src/table/Pagination.component.js +0 -32
  167. package/dist/src/table/Table.component.d.ts +0 -61
  168. package/dist/src/table/Table.component.js +0 -101
  169. package/dist/src/typography/TypographyArticle.component.d.ts +0 -8
  170. package/dist/src/typography/TypographyArticle.component.js +0 -7
  171. package/dist/src/typography/TypographyColumn.component.d.ts +0 -6
  172. package/dist/src/typography/TypographyColumn.component.js +0 -7
  173. package/dist/src/typography/TypographyContent.component.d.ts +0 -6
  174. package/dist/src/typography/TypographyContent.component.js +0 -7
  175. package/dist/src/typography/TypographyTips.component.d.ts +0 -6
  176. package/dist/src/typography/TypographyTips.component.js +0 -7
  177. package/dist/src/wrap/Draggable.component.d.ts +0 -34
  178. package/dist/src/wrap/Draggable.component.js +0 -214
  179. package/dist/src/wrap/Image.component.d.ts +0 -2
  180. package/dist/src/wrap/Image.component.js +0 -13
  181. package/dist/src/wrap/OutsideClick.component.d.ts +0 -6
  182. package/dist/src/wrap/OutsideClick.component.js +0 -34
  183. package/dist/src/wrap/ScrollContainer.component.d.ts +0 -10
  184. package/dist/src/wrap/ScrollContainer.component.js +0 -54
  185. package/dist/src/wrap/ShortcutProvider.d.ts +0 -1
  186. package/dist/src/wrap/ShortcutProvider.js +0 -42
  187. package/dist/src/wrap/Swipe.component.d.ts +0 -14
  188. package/dist/src/wrap/Swipe.component.js +0 -61
@@ -7,7 +7,8 @@ const react_1 = require("react");
7
7
  const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
8
8
  const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
9
9
  const _utils_1 = require("@utils");
10
- const _components_1 = require("@components");
10
+ const Button_component_1 = require("../button/Button.component");
11
+ const InputRadio_component_1 = require("../input/InputRadio.component");
11
12
  function PaginationComponent({ paginate = 10, page = 1, totalRow = 0, onChange, className = "", }) {
12
13
  const [pages, setPages] = (0, react_1.useState)([]);
13
14
  const lastPage = Math.ceil(totalRow / paginate);
@@ -25,8 +26,8 @@ function PaginationComponent({ paginate = 10, page = 1, totalRow = 0, onChange,
25
26
  }, [totalRow, page, paginate]);
26
27
  if (!totalRow)
27
28
  return null;
28
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("pagination-container", (0, _utils_1.pcn)(className, "base")), children: [(0, jsx_runtime_1.jsxs)("div", { className: "pagination-desktop-wrapper", children: [(0, jsx_runtime_1.jsx)(_components_1.InputRadioComponent, { name: "paginate", options: [10, 20, 50].map((val) => ({
29
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("pagination-container", (0, _utils_1.pcn)(className, "base")), children: [(0, jsx_runtime_1.jsxs)("div", { className: "pagination-desktop-wrapper", children: [(0, jsx_runtime_1.jsx)(InputRadio_component_1.InputRadioComponent, { name: "paginate", options: [10, 20, 50].map((val) => ({
29
30
  value: val,
30
31
  label: String(val),
31
- })), value: paginate, onChange: (e) => onChange?.(totalRow, Number(e), 1), className: "pagination-paginate-select" }), totalRow > paginate && ((0, jsx_runtime_1.jsxs)("div", { className: "pagination-desktop-pages", children: [page > 1 && ((0, jsx_runtime_1.jsx)("button", { className: "pagination-overflow", onClick: () => onChange?.(totalRow, paginate, page - 1), children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronLeft }) })), page > 2 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("pagination-item", (0, _utils_1.pcn)(className, "item")), onClick: () => onChange?.(totalRow, paginate, 1), children: "1" }), page > 3 && (0, jsx_runtime_1.jsx)("span", { className: "pagination-overflow", children: "..." })] })), pages.map((p) => ((0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("pagination-item", (0, _utils_1.pcn)(className, "item"), p === page && (0, _utils_1.cn)("pagination-item-active", (0, _utils_1.pcn)(className, "active"))), onClick: () => onChange?.(totalRow, paginate, p), children: p }, p))), page < lastPage - 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [page < lastPage - 2 && ((0, jsx_runtime_1.jsx)("span", { className: "pagination-overflow", children: "..." })), (0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("pagination-item", (0, _utils_1.pcn)(className, "item")), onClick: () => onChange?.(totalRow, paginate, lastPage), children: lastPage })] })), page < lastPage && ((0, jsx_runtime_1.jsx)("button", { className: "pagination-overflow", onClick: () => onChange?.(totalRow, paginate, page + 1), children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronRight }) }))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "pagination-desktop-info", children: [Math.min(totalRow, paginate * (page - 1) + 1), " - ", Math.min(totalRow, paginate * page), " / ", totalRow] }), (0, jsx_runtime_1.jsxs)("div", { className: "pagination-mobile-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { className: "pagination-mobile-info", children: [Math.min(totalRow, paginate * (page - 1) + 1), " - ", Math.min(totalRow, paginate * page), " / ", totalRow] }), totalRow > paginate && ((0, jsx_runtime_1.jsxs)("div", { className: "pagination-mobile-controls", children: [page > 1 && ((0, jsx_runtime_1.jsx)(_components_1.ButtonComponent, { icon: free_solid_svg_icons_1.faChevronLeft, onClick: () => onChange?.(totalRow, paginate, page - 1), size: "sm" })), page < lastPage && ((0, jsx_runtime_1.jsx)(_components_1.ButtonComponent, { icon: free_solid_svg_icons_1.faChevronRight, onClick: () => onChange?.(totalRow, paginate, page + 1), size: "sm" }))] }))] })] }));
32
+ })), value: paginate, onChange: (e) => onChange?.(totalRow, Number(e), 1), className: "pagination-paginate-select" }), totalRow > paginate && ((0, jsx_runtime_1.jsxs)("div", { className: "pagination-desktop-pages", children: [page > 1 && ((0, jsx_runtime_1.jsx)("button", { className: "pagination-overflow", onClick: () => onChange?.(totalRow, paginate, page - 1), children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronLeft }) })), page > 2 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("pagination-item", (0, _utils_1.pcn)(className, "item")), onClick: () => onChange?.(totalRow, paginate, 1), children: "1" }), page > 3 && (0, jsx_runtime_1.jsx)("span", { className: "pagination-overflow", children: "..." })] })), pages.map((p) => ((0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("pagination-item", (0, _utils_1.pcn)(className, "item"), p === page && (0, _utils_1.cn)("pagination-item-active", (0, _utils_1.pcn)(className, "active"))), onClick: () => onChange?.(totalRow, paginate, p), children: p }, p))), page < lastPage - 1 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [page < lastPage - 2 && ((0, jsx_runtime_1.jsx)("span", { className: "pagination-overflow", children: "..." })), (0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("pagination-item", (0, _utils_1.pcn)(className, "item")), onClick: () => onChange?.(totalRow, paginate, lastPage), children: lastPage })] })), page < lastPage && ((0, jsx_runtime_1.jsx)("button", { className: "pagination-overflow", onClick: () => onChange?.(totalRow, paginate, page + 1), children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronRight }) }))] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "pagination-desktop-info", children: [Math.min(totalRow, paginate * (page - 1) + 1), " - ", Math.min(totalRow, paginate * page), " / ", totalRow] }), (0, jsx_runtime_1.jsxs)("div", { className: "pagination-mobile-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { className: "pagination-mobile-info", children: [Math.min(totalRow, paginate * (page - 1) + 1), " - ", Math.min(totalRow, paginate * page), " / ", totalRow] }), totalRow > paginate && ((0, jsx_runtime_1.jsxs)("div", { className: "pagination-mobile-controls", children: [page > 1 && ((0, jsx_runtime_1.jsx)(Button_component_1.ButtonComponent, { icon: free_solid_svg_icons_1.faChevronLeft, onClick: () => onChange?.(totalRow, paginate, page - 1), size: "sm" })), page < lastPage && ((0, jsx_runtime_1.jsx)(Button_component_1.ButtonComponent, { icon: free_solid_svg_icons_1.faChevronRight, onClick: () => onChange?.(totalRow, paginate, page + 1), size: "sm" }))] }))] })] }));
32
33
  }
@@ -1,6 +1,8 @@
1
1
  import { ReactNode } from "react";
2
2
  import { ApiFilterType } from "@utils";
3
- import { ControlBarOptionType, PaginationProps, SwipeActionType } from "@components";
3
+ import { ControlBarOptionType } from "./ControlBar.component";
4
+ import { PaginationProps } from "./Pagination.component";
5
+ import { SwipeActionType } from "../wrap/Swipe.component";
4
6
  export interface TableColumnType {
5
7
  selector: string;
6
8
  label: string | ReactNode;
@@ -58,4 +60,4 @@ export interface TableProps {
58
60
  /** Use custom class with: "controller-bar::", "head-column::", "column::", "floating-action::", "row::". */
59
61
  className?: string;
60
62
  }
61
- export declare function TableComponent({ id, controlBar, columns, data, pagination, loading, sortBy, onChangeSortBy, search, onChangeSearch, searchableColumn, onChangeSearchableColumn, filter, onChangeFilter, checks, onChangeChecks, actionBulking, focus, onRowClick, onRefresh, block, noIndex, responsiveControl, className, }: TableProps): import("react").JSX.Element;
63
+ export declare function TableComponent({ id, controlBar, columns, data, pagination, loading, sortBy, onChangeSortBy, search, onChangeSearch, searchableColumn, onChangeSearchableColumn, filter, onChangeFilter, checks, onChangeChecks, actionBulking, focus, onRowClick, onRefresh, block, noIndex, responsiveControl, className, }: TableProps): import("@types/react").JSX.Element;
@@ -7,7 +7,11 @@ const react_1 = require("react");
7
7
  const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
8
8
  const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
9
9
  const _utils_1 = require("@utils");
10
- const _components_1 = require("@components");
10
+ const ControlBar_component_1 = require("./ControlBar.component");
11
+ const Pagination_component_1 = require("./Pagination.component");
12
+ const ScrollContainer_component_1 = require("../wrap/ScrollContainer.component");
13
+ const Checkbox_component_1 = require("../input/Checkbox.component");
14
+ const Swipe_component_1 = require("../wrap/Swipe.component");
11
15
  function TableComponent({ id, controlBar, columns, data, pagination, loading, sortBy, onChangeSortBy, search, onChangeSearch, searchableColumn, onChangeSearchableColumn, filter, onChangeFilter, checks, onChangeChecks, actionBulking, focus, onRowClick, onRefresh, block, noIndex, responsiveControl, className = "", }) {
12
16
  const [displayColumns, setDisplayColumns] = (0, react_1.useState)([]);
13
17
  const [showFloatingAction, setShowFloatingAction] = (0, react_1.useState)(false);
@@ -75,7 +79,7 @@ function TableComponent({ id, controlBar, columns, data, pagination, loading, so
75
79
  else {
76
80
  const { onAction: onLeftAction, ...restLeftAction } = responsiveControl?.mobile?.leftActionControl || {};
77
81
  const { onAction: onRightAction, ...restRightAction } = responsiveControl?.mobile?.rightActionControl || {};
78
- return ((0, jsx_runtime_1.jsx)(_components_1.SwipeComponent, { className: "rounded-lg", leftActionControl: !!responsiveControl?.mobile?.leftActionControl ? {
82
+ return ((0, jsx_runtime_1.jsx)(Swipe_component_1.SwipeComponent, { className: "rounded-lg", leftActionControl: !!responsiveControl?.mobile?.leftActionControl ? {
79
83
  ...restLeftAction,
80
84
  ...(onLeftAction ? { onAction: () => onLeftAction?.(item, itemKey) } : {})
81
85
  } : undefined, rightActionControl: !!responsiveControl?.mobile?.rightActionControl ? {
@@ -84,18 +88,18 @@ function TableComponent({ id, controlBar, columns, data, pagination, loading, so
84
88
  } : undefined, children: (0, jsx_runtime_1.jsx)("div", { onClick: () => onRowClick?.(item, itemKey), children: responsiveControl?.mobile?.item ? responsiveControl?.mobile?.item(item, itemKey) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: "font-semibold", children: Object.values(itemMapping)[0] }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm", children: Object.values(itemMapping)[1] })] })) }) }));
85
89
  }
86
90
  }
87
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("relative", (0, _utils_1.pcn)(className, "base")), children: [controlBar != false && ((0, jsx_runtime_1.jsx)(_components_1.ControlBarComponent, { id: id, options: !controlBar ? ["SEARCH", "SELECTABLE", "REFRESH"] : controlBar, searchableOptions: columns?.filter((c) => c.searchable), onSearchable: (e) => onChangeSearchableColumn?.(String(e)), searchable: searchableColumn || [], onSearch: (e) => setKeyword(e), search: keyword, selectableOptions: columns, onSelectable: (e) => setDisplayColumns(e), selectable: displayColumns, sortableOptions: columns?.filter((c) => c.sortable), sort: sortBy, onSort: (sort) => onChangeSortBy?.(sort), onRefresh: () => onRefresh?.(), filterableColumns: columns?.filter((c) => !!c?.filterable)?.map((c) => ({
91
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("relative", (0, _utils_1.pcn)(className, "base")), children: [controlBar != false && ((0, jsx_runtime_1.jsx)(ControlBar_component_1.ControlBarComponent, { id: id, options: !controlBar ? ["SEARCH", "SELECTABLE", "REFRESH"] : controlBar, searchableOptions: columns?.filter((c) => c.searchable), onSearchable: (e) => onChangeSearchableColumn?.(String(e)), searchable: searchableColumn || [], onSearch: (e) => setKeyword(e), search: keyword, selectableOptions: columns, onSelectable: (e) => setDisplayColumns(e), selectable: displayColumns, sortableOptions: columns?.filter((c) => c.sortable), sort: sortBy, onSort: (sort) => onChangeSortBy?.(sort), onRefresh: () => onRefresh?.(), filterableColumns: columns?.filter((c) => !!c?.filterable)?.map((c) => ({
88
92
  label: c.label,
89
93
  selector: c.selector,
90
94
  type: typeof c?.filterable == "object" ? c?.filterable?.type : "text",
91
95
  options: typeof c?.filterable == "object" && c?.filterable?.type == "select" ? c?.filterable?.options : undefined
92
- })), onFilter: (filters) => onChangeFilter?.(filters), filter: filter, className: (0, _utils_1.pcn)(className, "controller-bar") || "" })), (0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)(_components_1.ScrollContainerComponent, { scrollFloating: !isSm && block, className: "w-full", onScroll: (e) => {
96
+ })), onFilter: (filters) => onChangeFilter?.(filters), filter: filter, className: (0, _utils_1.pcn)(className, "controller-bar") || "" })), (0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)(ScrollContainer_component_1.ScrollContainerComponent, { scrollFloating: !isSm && block, className: "w-full", onScroll: (e) => {
93
97
  actionColumnRef.current?.clientWidth && e.scrollLeft &&
94
98
  setShowFloatingAction(e.scrollLeft + e.clientWidth <= e.scrollWidth - actionColumnRef.current?.clientWidth);
95
- }, footer: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: block && pagination && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "py-6" }), (0, jsx_runtime_1.jsx)("div", { className: "my-2 absolute bottom-0 w-full", children: (0, jsx_runtime_1.jsx)(_components_1.PaginationComponent, { ...pagination }) })] })) }), children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "w-max min-w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "table-loading-container", children: (0, jsx_runtime_1.jsx)("h1", { className: "table-loading-text", children: "Memuat data..." }) }) })) : !data || !data.length ? ((0, jsx_runtime_1.jsx)("div", { className: "table-empty-container", children: (0, jsx_runtime_1.jsx)("h1", { className: "table-empty-text", children: "Belum Ada Data" }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !isSm || !responsiveControl?.mobile ? ((0, jsx_runtime_1.jsxs)("div", { className: "w-max min-w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("table-head-row", (0, _utils_1.pcn)(className, "row")), children: [!!actionBulking && ((0, jsx_runtime_1.jsx)("div", { className: "table-head-column w-max", children: (0, jsx_runtime_1.jsx)(_components_1.CheckboxComponent, { name: "selected_table", className: "w-5 h-5", checked: data.length > 0 && checks?.length === data.length, onChange: () => data.length > 0 && checks?.length === data.length ? onChangeChecks?.([]) : onChangeChecks?.(data.map((d) => d.id)) }) })), !noIndex && (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-head-column w-8", (0, _utils_1.pcn)(className, "head-column")), children: "#" }), renderHead()] }), (0, jsx_runtime_1.jsx)("div", { className: "table-body", children: data.map((item, key) => {
96
- return ((0, jsx_runtime_1.jsxs)("div", { style: { animationDelay: `${(key + 1) * 0.05}s` }, className: (0, _utils_1.cn)("table-body-row", key % 2 ? "bg-light-primary/10" : "bg-white", focus == key && "bg-light-primary/30", (0, _utils_1.pcn)(className, "row")), children: [!!actionBulking && ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-body-column w-max", (0, _utils_1.pcn)(className, "column")), children: (0, jsx_runtime_1.jsx)(_components_1.CheckboxComponent, { name: "selected_table", className: "w-5 h-5", checked: checks?.includes(item?.id), onChange: () => checks?.includes(item?.id) ? onChangeChecks?.(checks.filter((i) => i !== item?.id)) : onChangeChecks?.([...(checks || []), item?.id]) }) })), !noIndex && (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-body-column w-8", (0, _utils_1.pcn)(className, "column")), children: numberOfRow(key) }), renderItem(item, key), (0, jsx_runtime_1.jsx)("div", { ref: actionColumnRef, className: "table-action-column", children: item["action"] }), item["action"] && showFloatingAction && ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("table-floating-action", (0, _utils_1.pcn)(className, "floating-action")), onClick: () => floatingActionActive !== false &&
99
+ }, footer: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: block && pagination && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "py-6" }), (0, jsx_runtime_1.jsx)("div", { className: "my-2 absolute bottom-0 w-full", children: (0, jsx_runtime_1.jsx)(Pagination_component_1.PaginationComponent, { ...pagination }) })] })) }), children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "w-max min-w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "table-loading-container", children: (0, jsx_runtime_1.jsx)("h1", { className: "table-loading-text", children: "Memuat data..." }) }) })) : !data || !data.length ? ((0, jsx_runtime_1.jsx)("div", { className: "table-empty-container", children: (0, jsx_runtime_1.jsx)("h1", { className: "table-empty-text", children: "Belum Ada Data" }) })) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !isSm || !responsiveControl?.mobile ? ((0, jsx_runtime_1.jsxs)("div", { className: "w-max min-w-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("table-head-row", (0, _utils_1.pcn)(className, "row")), children: [!!actionBulking && ((0, jsx_runtime_1.jsx)("div", { className: "table-head-column w-max", children: (0, jsx_runtime_1.jsx)(Checkbox_component_1.CheckboxComponent, { name: "selected_table", className: "w-5 h-5", checked: data.length > 0 && checks?.length === data.length, onChange: () => data.length > 0 && checks?.length === data.length ? onChangeChecks?.([]) : onChangeChecks?.(data.map((d) => d.id)) }) })), !noIndex && (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-head-column w-8", (0, _utils_1.pcn)(className, "head-column")), children: "#" }), renderHead()] }), (0, jsx_runtime_1.jsx)("div", { className: "table-body", children: data.map((item, key) => {
100
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { animationDelay: `${(key + 1) * 0.05}s` }, className: (0, _utils_1.cn)("table-body-row", key % 2 ? "bg-light-primary/10" : "bg-white", focus == key && "bg-light-primary/30", (0, _utils_1.pcn)(className, "row")), children: [!!actionBulking && ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-body-column w-max", (0, _utils_1.pcn)(className, "column")), children: (0, jsx_runtime_1.jsx)(Checkbox_component_1.CheckboxComponent, { name: "selected_table", className: "w-5 h-5", checked: checks?.includes(item?.id), onChange: () => checks?.includes(item?.id) ? onChangeChecks?.(checks.filter((i) => i !== item?.id)) : onChangeChecks?.([...(checks || []), item?.id]) }) })), !noIndex && (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-body-column w-8", (0, _utils_1.pcn)(className, "column")), children: numberOfRow(key) }), renderItem(item, key), (0, jsx_runtime_1.jsx)("div", { ref: actionColumnRef, className: "table-action-column", children: item["action"] }), item["action"] && showFloatingAction && ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("table-floating-action", (0, _utils_1.pcn)(className, "floating-action")), onClick: () => floatingActionActive !== false &&
97
101
  floatingActionActive == key ? setFloatingActionActive(false) : setFloatingActionActive(key), children: [(0, jsx_runtime_1.jsx)("div", { className: "table-floating-action-icon-wrapper", children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: floatingActionActive === false || floatingActionActive != key ? free_solid_svg_icons_1.faChevronLeft : free_solid_svg_icons_1.faChevronRight }) }), (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("table-floating-action-content", floatingActionActive === key && "table-floating-action-content-active"), children: item["action"] })] }))] }, key));
98
102
  }) })] })) : ((0, jsx_runtime_1.jsx)("div", { className: "table-mobile-list", children: data.map((item, key) => {
99
103
  return ((0, jsx_runtime_1.jsx)("div", { style: { animationDelay: `${(key + 1) * 0.05}s` }, children: renderItem(item, key) }, key));
100
- }) })) })) }) }), !!actionBulking && !!checks?.length && ((0, jsx_runtime_1.jsxs)("div", { className: "table-bulk-actions-bar", children: [(0, jsx_runtime_1.jsxs)("div", { className: "table-bulk-actions-title", children: [checks?.length, " Data Terpilih"] }), (0, jsx_runtime_1.jsx)("div", { className: "table-bulk-actions-buttons", children: actionBulking?.(checks) })] })), !block && pagination && ((0, jsx_runtime_1.jsx)("div", { className: "table-pagination-desktop", children: (0, jsx_runtime_1.jsx)(_components_1.PaginationComponent, { ...pagination }) })), pagination && ((0, jsx_runtime_1.jsx)("div", { className: "table-pagination-mobile", children: (0, jsx_runtime_1.jsx)(_components_1.PaginationComponent, { ...pagination }) }))] }));
104
+ }) })) })) }) }), !!actionBulking && !!checks?.length && ((0, jsx_runtime_1.jsxs)("div", { className: "table-bulk-actions-bar", children: [(0, jsx_runtime_1.jsxs)("div", { className: "table-bulk-actions-title", children: [checks?.length, " Data Terpilih"] }), (0, jsx_runtime_1.jsx)("div", { className: "table-bulk-actions-buttons", children: actionBulking?.(checks) })] })), !block && pagination && ((0, jsx_runtime_1.jsx)("div", { className: "table-pagination-desktop", children: (0, jsx_runtime_1.jsx)(Pagination_component_1.PaginationComponent, { ...pagination }) })), pagination && ((0, jsx_runtime_1.jsx)("div", { className: "table-pagination-mobile", children: (0, jsx_runtime_1.jsx)(Pagination_component_1.PaginationComponent, { ...pagination }) }))] }));
101
105
  }
@@ -5,4 +5,4 @@ export interface TypographyArticleProps {
5
5
  header?: string | ReactNode;
6
6
  footer?: string | ReactNode;
7
7
  }
8
- export declare function TypographyArticleComponent({ title, content, header, footer, }: TypographyArticleProps): import("react").JSX.Element;
8
+ export declare function TypographyArticleComponent({ title, content, header, footer, }: TypographyArticleProps): import("@types/react").JSX.Element;
@@ -3,4 +3,4 @@ export interface TypographyColumnProps {
3
3
  title: string | ReactNode;
4
4
  content: string | ReactNode;
5
5
  }
6
- export declare function TypographyColumnComponent({ title, content, }: TypographyColumnProps): import("react").JSX.Element;
6
+ export declare function TypographyColumnComponent({ title, content, }: TypographyColumnProps): import("@types/react").JSX.Element;
@@ -3,4 +3,4 @@ export interface TypographyContentProps {
3
3
  title: string | ReactNode;
4
4
  content: string | ReactNode;
5
5
  }
6
- export declare function TypographyContentComponent({ title, content, }: TypographyContentProps): import("react").JSX.Element;
6
+ export declare function TypographyContentComponent({ title, content, }: TypographyContentProps): import("@types/react").JSX.Element;
@@ -3,4 +3,4 @@ export interface TypographyTipsProps {
3
3
  title: string | ReactNode;
4
4
  content: string | ReactNode;
5
5
  }
6
- export declare function TypographyTipsComponent({ title, content, }: TypographyTipsProps): import("react").JSX.Element;
6
+ export declare function TypographyTipsComponent({ title, content, }: TypographyTipsProps): import("@types/react").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { ImageProps } from "next/image";
2
- export declare function ImageComponent(props: ImageProps): import("react").JSX.Element;
2
+ export declare function ImageComponent(props: ImageProps): import("@types/react").JSX.Element;
@@ -7,4 +7,4 @@ export interface ScrollContainerProps {
7
7
  /** Use custom class with: "container::", "floating-scroll::"". */
8
8
  className?: string;
9
9
  }
10
- export declare function ScrollContainerComponent({ children, footer, className, scrollFloating, onScroll, }: ScrollContainerProps): import("react").JSX.Element;
10
+ export declare function ScrollContainerComponent({ children, footer, className, scrollFloating, onScroll, }: ScrollContainerProps): import("@types/react").JSX.Element;
@@ -1 +1 @@
1
- export declare function ShortcutProvider(): import("react").JSX.Element;
1
+ export declare function ShortcutProvider(): import("@types/react").JSX.Element;
@@ -6,7 +6,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const react_1 = require("react");
7
7
  const _utils_1 = require("@utils");
8
8
  const _contexts_1 = require("@contexts");
9
- const _components_1 = require("@components");
9
+ const Modal_component_1 = require("../modal/Modal.component");
10
10
  function ShortcutProvider() {
11
11
  const { setToggle, toggle } = (0, _contexts_1.useToggleContext)();
12
12
  const shortcuts = _utils_1.shortcut.list();
@@ -38,5 +38,5 @@ function ShortcutProvider() {
38
38
  })
39
39
  .join(" + ");
40
40
  }
41
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(_components_1.ModalComponent, { show: !!toggle["MODAL_SHORTCUT_HELP"], onClose: () => setToggle("MODAL_SHORTCUT_HELP"), title: "Shortcut", children: (0, jsx_runtime_1.jsx)("div", { className: "shortcut-help-grid", children: shortcuts.map(({ key, description }) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "shortcut-key-badge", children: formatShortcutKey(key) }), (0, jsx_runtime_1.jsxs)("span", { children: [": ", description] })] }, key))) }) }) }));
41
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Modal_component_1.ModalComponent, { show: !!toggle["MODAL_SHORTCUT_HELP"], onClose: () => setToggle("MODAL_SHORTCUT_HELP"), title: "Shortcut", children: (0, jsx_runtime_1.jsx)("div", { className: "shortcut-help-grid", children: shortcuts.map(({ key, description }) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("kbd", { className: "shortcut-key-badge", children: formatShortcutKey(key) }), (0, jsx_runtime_1.jsxs)("span", { children: [": ", description] })] }, key))) }) }) }));
42
42
  }
@@ -11,4 +11,4 @@ export type SwipeProps = {
11
11
  children?: ReactNode;
12
12
  className?: string;
13
13
  };
14
- export declare function SwipeComponent({ leftActionControl, rightActionControl, children, className, }: SwipeProps): import("react").JSX.Element;
14
+ export declare function SwipeComponent({ leftActionControl, rightActionControl, children, className, }: SwipeProps): import("@types/react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skalfa/skalfa-component",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Core reusable UI components for Skalfa applications.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,8 @@
8
8
  "dist"
9
9
  ],
10
10
  "scripts": {
11
- "build": "tsc -p tsconfig.json"
11
+ "build": "tsc -p tsconfig.json",
12
+ "postbuild": "bun fix-exports.js"
12
13
  },
13
14
  "keywords": [
14
15
  "skalfa",
@@ -19,7 +20,7 @@
19
20
  "license": "MIT",
20
21
  "peerDependencies": {
21
22
  "@fortawesome/react-fontawesome": "^0.2.2",
22
- "@skalfa/skalfa-app-core": "^1.0.0",
23
+ "@skalfa/skalfa-app-core": "^1.0.11",
23
24
  "next": "^15.0.0 || ^16.0.0",
24
25
  "react": "^19.0.0",
25
26
  "react-dom": "^19.0.0"
@@ -1,13 +0,0 @@
1
- import { ReactNode } from "react";
2
- export interface AccordionProps {
3
- setActive?: number | null;
4
- items: {
5
- head: ReactNode;
6
- content: ReactNode;
7
- }[];
8
- horizontal?: boolean;
9
- className?: string;
10
- }
11
- export declare function AccordionComponent({ items, setActive, horizontal,
12
- /** Use custom class with: "container::", "head::", "active::". */
13
- className, }: AccordionProps): import("react").JSX.Element;
@@ -1,25 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AccordionComponent = AccordionComponent;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
8
- const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
9
- const _utils_1 = require("@utils");
10
- ;
11
- function AccordionComponent({ items, setActive = null, horizontal = false,
12
- /** Use custom class with: "container::", "head::", "active::". */
13
- className = "", }) {
14
- const [isActive, setIsActive] = (0, react_1.useState)(setActive);
15
- (0, react_1.useEffect)(() => {
16
- setIsActive(setActive);
17
- }, [setActive]);
18
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("accordion", horizontal ? "accordion-horizontal" : "accordion-vertical", (0, _utils_1.pcn)(className, "container")), children: items.map(({ head, content }, key) => ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("accordion-item", horizontal ? "accordion-item-horizontal" : "accordion-item-vertical"), children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("accordion-head", horizontal ? "accordion-head-horizontal" : "accordion-head-vertical", (0, _utils_1.pcn)(className, "head")), onClick: () => setIsActive(isActive === key ? null : key), children: [(0, jsx_runtime_1.jsx)("div", { children: head }), (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("w-min transition-transform", isActive !== key && "rotate-180"), children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: horizontal ? free_solid_svg_icons_1.faChevronLeft : free_solid_svg_icons_1.faChevronDown }) })] }), (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("accordion-content", horizontal
19
- ? isActive === key
20
- ? "accordion-content-horizontal-active"
21
- : "accordion-content-horizontal-inactive"
22
- : isActive === key
23
- ? "accordion-content-vertical-active"
24
- : "accordion-content-vertical-inactive", (0, _utils_1.pcn)(className, "base"), isActive === key && (0, _utils_1.pcn)(className, "active")), children: content })] }, key))) }));
25
- }
@@ -1,14 +0,0 @@
1
- import { ReactNode } from "react";
2
- export interface BreadcrumbItemProps {
3
- path: string;
4
- label: string;
5
- className?: string;
6
- }
7
- export interface BreadcrumbProps {
8
- items: BreadcrumbItemProps[];
9
- square?: boolean;
10
- separatorContent?: string | ReactNode;
11
- /** Use custom class with: "container::", "active::". */
12
- className?: string;
13
- }
14
- export declare function BreadcrumbComponent({ items, className, square, separatorContent, }: BreadcrumbProps): import("react").JSX.Element;
@@ -1,21 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.BreadcrumbComponent = BreadcrumbComponent;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const react_1 = require("react");
10
- const link_1 = __importDefault(require("next/link"));
11
- const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
12
- const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
13
- const _utils_1 = require("@utils");
14
- ;
15
- ;
16
- function BreadcrumbComponent({ items, className = "", square = false, separatorContent, }) {
17
- return ((0, jsx_runtime_1.jsx)("nav", { className: (0, _utils_1.cn)("breadcrumb", (0, _utils_1.pcn)(className, "container")), children: (0, jsx_runtime_1.jsx)("ol", { className: "breadcrumb-list", children: items.map((item, index) => {
18
- const isActive = index === items.length - 1;
19
- return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsx)(link_1.default, { href: item.path, className: (0, _utils_1.cn)("breadcrumb-link", square && "breadcrumb-link-square", isActive && !square && "breadcrumb-link-active", isActive && square && "breadcrumb-link-square-active", (0, _utils_1.pcn)(className, "base"), isActive && (0, _utils_1.pcn)(className, "active")), children: item.label }) }), !isActive && ((0, jsx_runtime_1.jsx)("li", { className: "breadcrumb-separator", children: separatorContent || ((0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronRight })) }))] }, item.path));
20
- }) }) }));
21
- }
@@ -1,21 +0,0 @@
1
- import { ReactNode } from "react";
2
- export interface ButtonProps {
3
- type?: "submit" | "button";
4
- label?: string | ReactNode;
5
- variant?: "solid" | "outline" | "light" | "simple";
6
- paint?: "primary" | "secondary" | "success" | "danger" | "warning";
7
- rounded?: boolean | string;
8
- block?: boolean;
9
- disabled?: boolean;
10
- size?: "xs" | "sm" | "md" | "lg";
11
- onClick?: any;
12
- href?: string;
13
- icon?: any;
14
- loading?: boolean;
15
- hover?: boolean;
16
- tips?: string;
17
- title?: string;
18
- /** Use custom class with: "icon::", "loading::". */
19
- className?: string;
20
- }
21
- export declare function ButtonComponent({ type, label, variant, paint, rounded, block, disabled, size, onClick, href, icon, loading, tips, title, className, }: ButtonProps): import("react").JSX.Element;
@@ -1,19 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ButtonComponent = ButtonComponent;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const link_1 = __importDefault(require("next/link"));
10
- const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
11
- const _utils_1 = require("@utils");
12
- ;
13
- function ButtonComponent({ type = "button", label, variant = "solid", paint = "primary", rounded, block, disabled, size = "md", onClick, href, icon, loading, tips, title, className = "", }) {
14
- const isIconButton = icon && !label;
15
- return ((0, jsx_runtime_1.jsxs)(ButtonComponentWrapper, { type: type, className: (0, _utils_1.cn)("button", `button-${variant}-${paint}`, isIconButton ? `icon-button-${size}` : `button-${size}`, rounded && "rounded-full", !isIconButton && block && "w-full justify-center", (0, _utils_1.pcn)(className, "base")), disabled: disabled || loading, onClick: onClick, href: href, title: tips || title, children: [loading ? ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("button-loading", (0, _utils_1.pcn)(className, "loading")) })) : (icon && ((0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: icon, className: (0, _utils_1.cn)("button-icon", (0, _utils_1.pcn)(className, "icon")) }))), !isIconButton && label] }));
16
- }
17
- const ButtonComponentWrapper = ({ children, href, ...props }) => {
18
- return !href ? ((0, jsx_runtime_1.jsx)("button", { ...props, children: children })) : ((0, jsx_runtime_1.jsx)(link_1.default, { href: href, ...props, children: children }));
19
- };
@@ -1,11 +0,0 @@
1
- import { ReactNode } from "react";
2
- export interface AlertCardProps {
3
- title?: string | ReactNode;
4
- leftContent?: string | ReactNode;
5
- badge?: string | ReactNode;
6
- content?: string | ReactNode;
7
- footer?: string | ReactNode;
8
- /** Use custom class with: "badge::", "title::". */
9
- className?: string;
10
- }
11
- export declare function AlertCardComponent({ title, leftContent, badge, content, footer, className, }: AlertCardProps): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.AlertCardComponent = AlertCardComponent;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const _utils_1 = require("@utils");
7
- function AlertCardComponent({ title, leftContent, badge, content, footer, className = "", }) {
8
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("section", { className: (0, _utils_1.cn)("alert-card", (0, _utils_1.pcn)(className, "base")), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start sm:gap-8", children: [leftContent, (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("strong", { className: (0, _utils_1.cn)("alert-card-badge", (0, _utils_1.pcn)(className, "badge")), children: badge }), (0, jsx_runtime_1.jsx)("h3", { className: (0, _utils_1.cn)("alert-card-title", (0, _utils_1.pcn)(className, "title")), children: title }), content, footer && (0, jsx_runtime_1.jsx)("div", { className: "pt-4", children: footer })] })] }) }) }));
9
- }
@@ -1,5 +0,0 @@
1
- export interface CardProps {
2
- children: React.ReactNode;
3
- className?: string;
4
- }
5
- export declare function CardComponent({ children, className, }: CardProps): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.CardComponent = CardComponent;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const _utils_1 = require("@utils");
7
- function CardComponent({ children, className, }) {
8
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("card", className), children: children }) }));
9
- }
@@ -1,9 +0,0 @@
1
- import { ReactNode } from "react";
2
- export interface DashboardCardProps {
3
- content?: string | ReactNode;
4
- title?: string | ReactNode;
5
- rightContent?: string | ReactNode;
6
- path?: string;
7
- className?: string;
8
- }
9
- export declare function DashboardCardComponent({ content, title, rightContent, path, className, }: DashboardCardProps): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DashboardCardComponent = DashboardCardComponent;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const link_1 = __importDefault(require("next/link"));
10
- const _utils_1 = require("@utils");
11
- function DashboardCardComponent({ content, title, rightContent, path, className, }) {
12
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(link_1.default, { href: path || "", children: (0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("dashboard-card", className), children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "flex gap-4 items-center", children: content }), title] }), (0, jsx_runtime_1.jsx)("div", { children: rightContent })] }) }) }));
13
- }
@@ -1,7 +0,0 @@
1
- export interface GalleryCardProps {
2
- src: string;
3
- alt?: string;
4
- /** Use custom class with: "label::", "image::". */
5
- className?: string;
6
- }
7
- export declare function GalleryCardComponent({ src, alt, className, }: GalleryCardProps): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.GalleryCardComponent = GalleryCardComponent;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const image_1 = __importDefault(require("next/image"));
10
- const _utils_1 = require("@utils");
11
- function GalleryCardComponent({ src, alt = "", className = "", }) {
12
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.pcn)(className, "base"), children: [(0, jsx_runtime_1.jsx)(image_1.default, { src: src, alt: src, width: 400, height: 300, className: (0, _utils_1.cn)("gallery-card-image", (0, _utils_1.pcn)(className, "image")) }), (0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("gallery-card-label", (0, _utils_1.pcn)(className, "label")), children: alt })] }) }));
13
- }
@@ -1,9 +0,0 @@
1
- export interface ProductCardProps {
2
- name: string;
3
- price?: string;
4
- image?: string;
5
- description?: string | React.ReactNode;
6
- /** Use custom class with: "image::", "content::". */
7
- className?: string;
8
- }
9
- export declare function ProductCardComponent({ image, name, price, description, className, }: ProductCardProps): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ProductCardComponent = ProductCardComponent;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const image_1 = __importDefault(require("next/image"));
10
- const _utils_1 = require("@utils");
11
- function ProductCardComponent({ image = "", name, price, description, className = "", }) {
12
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("product-card", (0, _utils_1.pcn)(className, "base")), children: [(0, jsx_runtime_1.jsx)(image_1.default, { src: image, alt: image, width: 400, height: 300, className: (0, _utils_1.cn)("product-card-image", (0, _utils_1.pcn)(className, "image")) }), (0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("p-2", (0, _utils_1.pcn)(className, "content")), children: [(0, jsx_runtime_1.jsxs)("dl", { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("dt", { className: "sr-only", children: "Name" }), (0, jsx_runtime_1.jsx)("dd", { className: "text-sm", children: name })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("dt", { className: "sr-only", children: "Price" }), (0, jsx_runtime_1.jsx)("dd", { className: "font-semibold", children: price })] })] }), description && (0, jsx_runtime_1.jsx)("div", { children: description })] })] }) }));
13
- }
@@ -1,10 +0,0 @@
1
- export interface ProfileCardProps {
2
- name: string;
3
- short?: string;
4
- image?: string;
5
- description?: string | React.ReactNode;
6
- footer?: string | React.ReactNode;
7
- /** Use custom class with: "image::", "content::". */
8
- className?: string;
9
- }
10
- export declare function ProfileCardComponent({ image, name, short, description, footer, className, }: ProfileCardProps): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- "use client";
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ProfileCardComponent = ProfileCardComponent;
8
- const jsx_runtime_1 = require("react/jsx-runtime");
9
- const image_1 = __importDefault(require("next/image"));
10
- const _utils_1 = require("@utils");
11
- function ProfileCardComponent({ image = "", name, short, description, footer, className = "", }) {
12
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("profile-card", (0, _utils_1.pcn)(className, "base")), children: [(0, jsx_runtime_1.jsx)("span", { className: "absolute inset-x-0 bottom-0 h-1 bg-primary" }), (0, jsx_runtime_1.jsxs)("div", { className: "sm:flex sm:gap-4 sm:items-center", children: [image && ((0, jsx_runtime_1.jsx)("div", { className: "hidden sm:block sm:shrink-0", children: (0, jsx_runtime_1.jsx)(image_1.default, { src: image, alt: image, width: 400, height: 400, className: (0, _utils_1.cn)("profile-card-image", (0, _utils_1.pcn)(className, "image")) }) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.pcn)(className, "content"), children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-lg font-bold sm:text-xl", children: name }), (0, jsx_runtime_1.jsx)("p", { className: "mt-1 text-xs font-medium text-light-foreground", children: short })] })] }), description, footer && (0, jsx_runtime_1.jsx)("dl", { className: "mt-4", children: footer })] }) }));
13
- }
@@ -1,13 +0,0 @@
1
- interface CarouselItem {
2
- background: string;
3
- content?: string;
4
- }
5
- interface CarouselProps {
6
- items: CarouselItem[];
7
- noButton?: boolean;
8
- noNavigation?: boolean;
9
- /** Use custom class with: "item::", "prev-button::", "next-button::", "navigation::". */
10
- className?: string;
11
- }
12
- export declare function CarouselComponent({ items, className, noButton, noNavigation, }: CarouselProps): import("react").JSX.Element;
13
- export {};
@@ -1,37 +0,0 @@
1
- "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.CarouselComponent = CarouselComponent;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
8
- const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
9
- const _utils_1 = require("@utils");
10
- function CarouselComponent({ items, className = "", noButton, noNavigation, }) {
11
- const [currentIndex, setCurrentIndex] = (0, react_1.useState)(0);
12
- const touchStartX = (0, react_1.useRef)(null);
13
- const touchEndX = (0, react_1.useRef)(null);
14
- const intervalRef = (0, react_1.useRef)(null);
15
- const handlePrev = () => setCurrentIndex((prevIndex) => (prevIndex - 1 + items.length) % items.length);
16
- const handleNext = () => setCurrentIndex((prevIndex) => (prevIndex + 1) % items.length);
17
- const handleTouchStart = (e) => {
18
- touchStartX.current = e.touches[0].clientX;
19
- };
20
- const handleTouchEnd = (e) => {
21
- touchEndX.current = e.changedTouches[0].clientX;
22
- if (touchStartX.current !== null && touchEndX.current !== null) {
23
- if (touchStartX.current - touchEndX.current > 50)
24
- handleNext();
25
- if (touchEndX.current - touchStartX.current > 50)
26
- handlePrev();
27
- }
28
- };
29
- (0, react_1.useEffect)(() => {
30
- intervalRef.current = setInterval(handleNext, 10000);
31
- return () => {
32
- if (intervalRef.current)
33
- clearInterval(intervalRef.current);
34
- };
35
- }, []);
36
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, _utils_1.cn)("carousel", (0, _utils_1.pcn)(className, "base")), children: [(0, jsx_runtime_1.jsx)("div", { className: "carousel-inner", style: { transform: `translateX(-${currentIndex * 100}%)` }, onTouchStart: handleTouchStart, onTouchEnd: handleTouchEnd, children: items.map((item, index) => ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("carousel-item", (0, _utils_1.pcn)(className, "item")), style: { backgroundImage: `url(${item.background})` }, children: item.content }, index))) }), !noNavigation && ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("carousel-navigation", (0, _utils_1.pcn)(className, "navigation")), children: items.map((_, index) => ((0, jsx_runtime_1.jsx)("button", { className: `carousel-indicator ${currentIndex === index ? "carousel-indicator-active" : ""}`, onClick: () => setCurrentIndex(index) }, index))) })), !noButton && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("carousel-btn carousel-prev-btn", (0, _utils_1.pcn)(className, "prev-button")), onClick: handlePrev, children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronLeft }) }), (0, jsx_runtime_1.jsx)("button", { className: (0, _utils_1.cn)("carousel-btn carousel-next-btn", (0, _utils_1.pcn)(className, "next-button")), onClick: handleNext, children: (0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronRight }) })] }))] }));
37
- }
@@ -1,6 +0,0 @@
1
- export declare function ChipComponent({ items, onClick, onDelete, className, }: {
2
- items: Record<string, any>;
3
- onClick?: (item: any, index: number) => void;
4
- onDelete?: (item: any, index: number) => void;
5
- className?: string;
6
- }): import("react").JSX.Element;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChipComponent = ChipComponent;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
6
- const react_fontawesome_1 = require("@fortawesome/react-fontawesome");
7
- const _utils_1 = require("@utils");
8
- function ChipComponent({ items, onClick, onDelete, className, }) {
9
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, _utils_1.cn)("chip-group", className), children: items?.map((item, key) => {
10
- return ((0, jsx_runtime_1.jsxs)("div", { className: "chip", onClick: () => onClick?.(item, key), children: [(0, jsx_runtime_1.jsx)("span", { children: item }), onDelete && ((0, jsx_runtime_1.jsx)(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faTimes, className: "chip-delete", onClick: () => onDelete?.(item, key) }))] }, key));
11
- }) }));
12
- }
@@ -1,13 +0,0 @@
1
- export * from "./accordion";
2
- export * from "./breadcrumb";
3
- export * from "./button";
4
- export * from "./card";
5
- export * from "./carousel";
6
- export * from "./chip";
7
- export * from "./input";
8
- export * from "./modal";
9
- export * from "./nav";
10
- export * from "./supervision";
11
- export * from "./table";
12
- export * from "./typography";
13
- export * from "./wrap";