@grampro/kit 0.0.0-stage → 2.4.1
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/.gbs/skills/gbs-components/SKILL.md +190 -0
- package/.gbs/skills/gbs-components/references/accessibility.md +102 -0
- package/.gbs/skills/gbs-components/references/data-display.md +185 -0
- package/.gbs/skills/gbs-components/references/data-grid.md +116 -0
- package/.gbs/skills/gbs-components/references/forms.md +202 -0
- package/.gbs/skills/gbs-components/references/install.md +211 -0
- package/.gbs/skills/gbs-components/references/overlays.md +206 -0
- package/.gbs/skills/gbs-components/references/pickers.md +83 -0
- package/.gbs/skills/gbs-components/references/styling.md +246 -0
- package/.gbs/skills/gbs-components/references/toaster.md +57 -0
- package/CHANGELOG.md +173 -0
- package/LICENSE +15 -0
- package/README.md +193 -2
- package/index.cjs +1410 -0
- package/package.json +77 -6
- package/schema/passport-v1.schema.json +204 -0
- package/source/components/accordion/README.md +45 -0
- package/source/components/accordion/core/index.ts +2 -0
- package/source/components/accordion/core/open.ts +56 -0
- package/source/components/accordion/core/types.ts +17 -0
- package/source/components/accordion/index.ts +8 -0
- package/source/components/accordion/passport.json +259 -0
- package/source/components/accordion/react/Accordion.tsx +133 -0
- package/source/components/accordion/react/AccordionItem.tsx +120 -0
- package/source/components/accordion/react/context.ts +20 -0
- package/source/components/accordion/react/props.ts +13 -0
- package/source/components/accordion/styles.css +207 -0
- package/source/components/alert/README.md +39 -0
- package/source/components/alert/core/index.ts +2 -0
- package/source/components/alert/core/live.ts +25 -0
- package/source/components/alert/core/types.ts +7 -0
- package/source/components/alert/index.ts +5 -0
- package/source/components/alert/passport.json +250 -0
- package/source/components/alert/react/Alert.tsx +113 -0
- package/source/components/alert/react/icons.tsx +21 -0
- package/source/components/alert/react/locale.ts +5 -0
- package/source/components/alert/react/props.ts +11 -0
- package/source/components/alert/styles.css +154 -0
- package/source/components/avatar/core/identity.ts +103 -0
- package/source/components/avatar/core/index.ts +2 -0
- package/source/components/avatar/core/types.ts +12 -0
- package/source/components/avatar/index.ts +7 -0
- package/source/components/avatar/passport.json +294 -0
- package/source/components/avatar/react/Avatar.tsx +118 -0
- package/source/components/avatar/react/AvatarGroup.tsx +74 -0
- package/source/components/avatar/react/locale.ts +11 -0
- package/source/components/avatar/react/props.ts +6 -0
- package/source/components/avatar/styles.css +225 -0
- package/source/components/badge/README.md +37 -0
- package/source/components/badge/core/count.ts +37 -0
- package/source/components/badge/core/index.ts +2 -0
- package/source/components/badge/core/types.ts +11 -0
- package/source/components/badge/index.ts +7 -0
- package/source/components/badge/passport.json +332 -0
- package/source/components/badge/react/Badge.tsx +89 -0
- package/source/components/badge/react/Tag.tsx +82 -0
- package/source/components/badge/react/locale.ts +5 -0
- package/source/components/badge/react/props.ts +6 -0
- package/source/components/badge/styles.css +203 -0
- package/source/components/breadcrumb/README.md +34 -0
- package/source/components/breadcrumb/core/index.ts +4 -0
- package/source/components/breadcrumb/core/trail.ts +42 -0
- package/source/components/breadcrumb/core/types.ts +20 -0
- package/source/components/breadcrumb/index.ts +5 -0
- package/source/components/breadcrumb/passport.json +243 -0
- package/source/components/breadcrumb/react/Breadcrumb.tsx +177 -0
- package/source/components/breadcrumb/react/locale.ts +6 -0
- package/source/components/breadcrumb/react/props.ts +14 -0
- package/source/components/breadcrumb/styles.css +138 -0
- package/source/components/button/README.md +32 -0
- package/source/components/button/core/index.ts +3 -0
- package/source/components/button/core/state.ts +16 -0
- package/source/components/button/core/types.ts +28 -0
- package/source/components/button/index.ts +5 -0
- package/source/components/button/passport.json +402 -0
- package/source/components/button/passport.manual.json +31 -0
- package/source/components/button/react/Button.tsx +173 -0
- package/source/components/button/react/locale.ts +5 -0
- package/source/components/button/react/props.ts +23 -0
- package/source/components/button/styles.css +232 -0
- package/source/components/card/README.md +60 -0
- package/source/components/card/core/index.ts +4 -0
- package/source/components/card/core/trend.ts +32 -0
- package/source/components/card/core/types.ts +5 -0
- package/source/components/card/index.ts +5 -0
- package/source/components/card/passport.json +337 -0
- package/source/components/card/react/Card.tsx +133 -0
- package/source/components/card/react/Stat.tsx +127 -0
- package/source/components/card/react/props.ts +4 -0
- package/source/components/card/styles.css +230 -0
- package/source/components/checkbox/README.md +36 -0
- package/source/components/checkbox/core/group.ts +30 -0
- package/source/components/checkbox/core/index.ts +3 -0
- package/source/components/checkbox/core/types.ts +17 -0
- package/source/components/checkbox/index.ts +9 -0
- package/source/components/checkbox/passport.json +456 -0
- package/source/components/checkbox/react/Checkbox.tsx +147 -0
- package/source/components/checkbox/react/CheckboxGroup.tsx +149 -0
- package/source/components/checkbox/react/context.ts +16 -0
- package/source/components/checkbox/react/locale.ts +5 -0
- package/source/components/checkbox/react/props.ts +6 -0
- package/source/components/checkbox/styles.css +211 -0
- package/source/components/combobox/README.md +170 -0
- package/source/components/combobox/core/filter.ts +155 -0
- package/source/components/combobox/core/index.ts +16 -0
- package/source/components/combobox/core/types.ts +48 -0
- package/source/components/combobox/core/virtual.ts +67 -0
- package/source/components/combobox/index.ts +13 -0
- package/source/components/combobox/passport.json +456 -0
- package/source/components/combobox/react/Listbox.tsx +310 -0
- package/source/components/combobox/react/MultiSelect.tsx +265 -0
- package/source/components/combobox/react/Popover.tsx +38 -0
- package/source/components/combobox/react/Select.tsx +200 -0
- package/source/components/combobox/react/icons.tsx +11 -0
- package/source/components/combobox/react/locale.ts +16 -0
- package/source/components/combobox/react/props.ts +88 -0
- package/source/components/combobox/react/useCombobox.ts +409 -0
- package/source/components/combobox/styles.css +419 -0
- package/source/components/data-grid/README.md +233 -0
- package/source/components/data-grid/agent/coerce.ts +368 -0
- package/source/components/data-grid/agent/contract.ts +410 -0
- package/source/components/data-grid/agent/dataset.ts +92 -0
- package/source/components/data-grid/agent/engine.ts +470 -0
- package/source/components/data-grid/agent/executors.ts +155 -0
- package/source/components/data-grid/agent/index.ts +79 -0
- package/source/components/data-grid/agent/intent.ts +324 -0
- package/source/components/data-grid/agent/operations.ts +335 -0
- package/source/components/data-grid/agent/validate.ts +630 -0
- package/source/components/data-grid/agent/webmcp.ts +107 -0
- package/source/components/data-grid/core/columnHelper.ts +21 -0
- package/source/components/data-grid/core/columns.ts +288 -0
- package/source/components/data-grid/core/filtering.ts +237 -0
- package/source/components/data-grid/core/grid.ts +638 -0
- package/source/components/data-grid/core/index.ts +14 -0
- package/source/components/data-grid/core/rows.ts +64 -0
- package/source/components/data-grid/core/sorting.ts +133 -0
- package/source/components/data-grid/core/state.ts +82 -0
- package/source/components/data-grid/core/store.ts +52 -0
- package/source/components/data-grid/core/types.ts +302 -0
- package/source/components/data-grid/core/values.ts +98 -0
- package/source/components/data-grid/core/virtual.ts +85 -0
- package/source/components/data-grid/export/csv.ts +32 -0
- package/source/components/data-grid/export/download.ts +12 -0
- package/source/components/data-grid/export/pdf-font.ts +139 -0
- package/source/components/data-grid/export/pdf-writer.ts +113 -0
- package/source/components/data-grid/export/pdf.ts +379 -0
- package/source/components/data-grid/export/table.ts +73 -0
- package/source/components/data-grid/export/xlsx.ts +145 -0
- package/source/components/data-grid/export/zip.ts +87 -0
- package/source/components/data-grid/index.ts +14 -0
- package/source/components/data-grid/passport.json +1051 -0
- package/source/components/data-grid/passport.manual.json +255 -0
- package/source/components/data-grid/react/AskGrid.tsx +164 -0
- package/source/components/data-grid/react/Cell.tsx +282 -0
- package/source/components/data-grid/react/ColumnMenu.tsx +135 -0
- package/source/components/data-grid/react/DataGrid.tsx +335 -0
- package/source/components/data-grid/react/FilterForm.tsx +142 -0
- package/source/components/data-grid/react/HeaderRow.tsx +332 -0
- package/source/components/data-grid/react/Pagination.tsx +107 -0
- package/source/components/data-grid/react/Popover.tsx +35 -0
- package/source/components/data-grid/react/Row.tsx +85 -0
- package/source/components/data-grid/react/Toolbar.tsx +267 -0
- package/source/components/data-grid/react/Viewport.tsx +167 -0
- package/source/components/data-grid/react/context.ts +57 -0
- package/source/components/data-grid/react/hooks.ts +83 -0
- package/source/components/data-grid/react/icons.tsx +45 -0
- package/source/components/data-grid/react/keyboard.ts +110 -0
- package/source/components/data-grid/react/locale.ts +130 -0
- package/source/components/data-grid/styles.css +874 -0
- package/source/components/date-picker/README.md +141 -0
- package/source/components/date-picker/core/calendar.ts +266 -0
- package/source/components/date-picker/core/format.ts +170 -0
- package/source/components/date-picker/core/index.ts +41 -0
- package/source/components/date-picker/core/today.ts +72 -0
- package/source/components/date-picker/core/types.ts +68 -0
- package/source/components/date-picker/index.ts +16 -0
- package/source/components/date-picker/passport.json +407 -0
- package/source/components/date-picker/react/Calendar.tsx +160 -0
- package/source/components/date-picker/react/CalendarPanel.tsx +170 -0
- package/source/components/date-picker/react/DatePicker.tsx +249 -0
- package/source/components/date-picker/react/DateRangePicker.tsx +291 -0
- package/source/components/date-picker/react/MonthYearPanels.tsx +123 -0
- package/source/components/date-picker/react/Popover.tsx +45 -0
- package/source/components/date-picker/react/icons.tsx +15 -0
- package/source/components/date-picker/react/locale.ts +23 -0
- package/source/components/date-picker/react/props.ts +76 -0
- package/source/components/date-picker/react/useDatePicker.ts +557 -0
- package/source/components/date-picker/styles.css +445 -0
- package/source/components/dialog/README.md +39 -0
- package/source/components/dialog/core/api.ts +34 -0
- package/source/components/dialog/core/dialog.ts +11 -0
- package/source/components/dialog/core/index.ts +7 -0
- package/source/components/dialog/core/store.ts +81 -0
- package/source/components/dialog/core/types.ts +59 -0
- package/source/components/dialog/index.ts +7 -0
- package/source/components/dialog/passport.json +344 -0
- package/source/components/dialog/react/Dialog.tsx +279 -0
- package/source/components/dialog/react/DialogHost.tsx +45 -0
- package/source/components/dialog/react/icons.tsx +20 -0
- package/source/components/dialog/react/locale.ts +8 -0
- package/source/components/dialog/react/props.ts +13 -0
- package/source/components/dialog/styles.css +280 -0
- package/source/components/file-uploader/README.md +99 -0
- package/source/components/file-uploader/core/format.ts +79 -0
- package/source/components/file-uploader/core/index.ts +26 -0
- package/source/components/file-uploader/core/store.ts +432 -0
- package/source/components/file-uploader/core/transport.ts +154 -0
- package/source/components/file-uploader/core/types.ts +126 -0
- package/source/components/file-uploader/core/validate.ts +83 -0
- package/source/components/file-uploader/index.ts +7 -0
- package/source/components/file-uploader/passport.json +518 -0
- package/source/components/file-uploader/react/FileRow.tsx +268 -0
- package/source/components/file-uploader/react/FileUploader.tsx +511 -0
- package/source/components/file-uploader/react/icons.tsx +60 -0
- package/source/components/file-uploader/react/locale.ts +33 -0
- package/source/components/file-uploader/react/props.ts +31 -0
- package/source/components/file-uploader/react/useFileUploader.ts +32 -0
- package/source/components/file-uploader/styles.css +394 -0
- package/source/components/input/README.md +44 -0
- package/source/components/input/core/count.ts +5 -0
- package/source/components/input/core/index.ts +11 -0
- package/source/components/input/core/otp.ts +64 -0
- package/source/components/input/core/types.ts +14 -0
- package/source/components/input/index.ts +8 -0
- package/source/components/input/passport.json +536 -0
- package/source/components/input/react/Input.tsx +219 -0
- package/source/components/input/react/OtpInput.tsx +256 -0
- package/source/components/input/react/dom.ts +10 -0
- package/source/components/input/react/icons.tsx +17 -0
- package/source/components/input/react/locale.ts +9 -0
- package/source/components/input/react/props.ts +6 -0
- package/source/components/input/styles.css +295 -0
- package/source/components/menu/README.md +68 -0
- package/source/components/menu/core/index.ts +11 -0
- package/source/components/menu/core/navigation.ts +84 -0
- package/source/components/menu/core/types.ts +32 -0
- package/source/components/menu/index.ts +19 -0
- package/source/components/menu/passport.json +322 -0
- package/source/components/menu/react/Menu.tsx +371 -0
- package/source/components/menu/react/context.ts +31 -0
- package/source/components/menu/react/items.tsx +268 -0
- package/source/components/menu/react/locale.ts +6 -0
- package/source/components/menu/react/props.ts +4 -0
- package/source/components/menu/react/useMenuKeys.ts +124 -0
- package/source/components/menu/styles.css +224 -0
- package/source/components/modal/README.md +51 -0
- package/source/components/modal/core/dismiss.ts +29 -0
- package/source/components/modal/core/index.ts +3 -0
- package/source/components/modal/core/types.ts +27 -0
- package/source/components/modal/index.ts +5 -0
- package/source/components/modal/passport.json +289 -0
- package/source/components/modal/react/Modal.tsx +242 -0
- package/source/components/modal/react/icons.tsx +1 -0
- package/source/components/modal/react/locale.ts +5 -0
- package/source/components/modal/react/props.ts +17 -0
- package/source/components/modal/styles.css +241 -0
- package/source/components/number-input/README.md +53 -0
- package/source/components/number-input/core/format.ts +37 -0
- package/source/components/number-input/core/index.ts +4 -0
- package/source/components/number-input/core/parse.ts +118 -0
- package/source/components/number-input/core/step.ts +73 -0
- package/source/components/number-input/core/types.ts +32 -0
- package/source/components/number-input/index.ts +5 -0
- package/source/components/number-input/passport.json +541 -0
- package/source/components/number-input/react/NumberInput.tsx +465 -0
- package/source/components/number-input/react/icons.tsx +17 -0
- package/source/components/number-input/react/locale.ts +7 -0
- package/source/components/number-input/react/props.ts +11 -0
- package/source/components/number-input/styles.css +230 -0
- package/source/components/popover/README.md +44 -0
- package/source/components/popover/core/index.ts +2 -0
- package/source/components/popover/core/types.ts +12 -0
- package/source/components/popover/index.ts +4 -0
- package/source/components/popover/passport.json +238 -0
- package/source/components/popover/react/Popover.tsx +202 -0
- package/source/components/popover/react/locale.ts +5 -0
- package/source/components/popover/react/props.ts +4 -0
- package/source/components/popover/styles.css +148 -0
- package/source/components/progress/README.md +38 -0
- package/source/components/progress/core/index.ts +2 -0
- package/source/components/progress/core/progress.ts +40 -0
- package/source/components/progress/core/types.ts +23 -0
- package/source/components/progress/index.ts +7 -0
- package/source/components/progress/passport.json +270 -0
- package/source/components/progress/react/CircularProgress.tsx +106 -0
- package/source/components/progress/react/Progress.tsx +113 -0
- package/source/components/progress/react/locale.ts +7 -0
- package/source/components/progress/react/props.ts +6 -0
- package/source/components/progress/styles.css +200 -0
- package/source/components/radio-group/README.md +58 -0
- package/source/components/radio-group/core/group.ts +36 -0
- package/source/components/radio-group/core/index.ts +2 -0
- package/source/components/radio-group/core/types.ts +20 -0
- package/source/components/radio-group/index.ts +9 -0
- package/source/components/radio-group/passport.json +477 -0
- package/source/components/radio-group/react/Radio.tsx +144 -0
- package/source/components/radio-group/react/RadioGroup.tsx +179 -0
- package/source/components/radio-group/react/context.ts +18 -0
- package/source/components/radio-group/react/locale.ts +5 -0
- package/source/components/radio-group/react/props.ts +12 -0
- package/source/components/radio-group/styles.css +269 -0
- package/source/components/shared/README.md +54 -0
- package/source/components/shared/core/agent/adapter.ts +65 -0
- package/source/components/shared/core/agent/history.ts +120 -0
- package/source/components/shared/core/agent/index.ts +46 -0
- package/source/components/shared/core/agent/numbers.ts +217 -0
- package/source/components/shared/core/agent/schema.ts +180 -0
- package/source/components/shared/core/agent/types.ts +169 -0
- package/source/components/shared/core/agent/webmcp.ts +328 -0
- package/source/components/shared/core/cx.ts +9 -0
- package/source/components/shared/core/field.ts +35 -0
- package/source/components/shared/core/position.ts +124 -0
- package/source/components/shared/core/text.ts +14 -0
- package/source/components/shared/index.ts +17 -0
- package/source/components/shared/react/GramproAIProvider.tsx +50 -0
- package/source/components/shared/react/Popover.tsx +189 -0
- package/source/components/shared/react/icons.tsx +74 -0
- package/source/components/shared/react/useAskAgent.ts +217 -0
- package/source/components/shared/react/useControllableState.ts +42 -0
- package/source/components/shared/styles.css +79 -0
- package/source/components/shared/version.json +4 -0
- package/source/components/shared/version.ts +6 -0
- package/source/components/skeleton/README.md +58 -0
- package/source/components/skeleton/core/index.ts +3 -0
- package/source/components/skeleton/core/lines.ts +25 -0
- package/source/components/skeleton/core/types.ts +5 -0
- package/source/components/skeleton/index.ts +5 -0
- package/source/components/skeleton/passport.json +251 -0
- package/source/components/skeleton/react/Empty.tsx +51 -0
- package/source/components/skeleton/react/Skeleton.tsx +92 -0
- package/source/components/skeleton/react/props.ts +4 -0
- package/source/components/skeleton/styles.css +185 -0
- package/source/components/spinner/README.md +29 -0
- package/source/components/spinner/core/index.ts +3 -0
- package/source/components/spinner/core/types.ts +28 -0
- package/source/components/spinner/core/visibility.ts +34 -0
- package/source/components/spinner/index.ts +6 -0
- package/source/components/spinner/passport.json +245 -0
- package/source/components/spinner/react/Spinner.tsx +96 -0
- package/source/components/spinner/react/locale.ts +5 -0
- package/source/components/spinner/react/props.ts +4 -0
- package/source/components/spinner/react/useDelayedLoading.ts +39 -0
- package/source/components/spinner/styles.css +173 -0
- package/source/components/switch/README.md +46 -0
- package/source/components/switch/core/index.ts +2 -0
- package/source/components/switch/core/toggle.ts +54 -0
- package/source/components/switch/core/types.ts +9 -0
- package/source/components/switch/index.ts +5 -0
- package/source/components/switch/passport.json +421 -0
- package/source/components/switch/react/Switch.tsx +219 -0
- package/source/components/switch/react/locale.ts +5 -0
- package/source/components/switch/react/props.ts +12 -0
- package/source/components/switch/styles.css +227 -0
- package/source/components/tabs/README.md +32 -0
- package/source/components/tabs/core/index.ts +3 -0
- package/source/components/tabs/core/navigation.ts +54 -0
- package/source/components/tabs/core/types.ts +16 -0
- package/source/components/tabs/index.ts +5 -0
- package/source/components/tabs/passport.json +315 -0
- package/source/components/tabs/react/Tabs.tsx +306 -0
- package/source/components/tabs/react/context.ts +21 -0
- package/source/components/tabs/styles.css +263 -0
- package/source/components/textarea/README.md +39 -0
- package/source/components/textarea/core/count.ts +5 -0
- package/source/components/textarea/core/index.ts +4 -0
- package/source/components/textarea/core/size.ts +23 -0
- package/source/components/textarea/core/types.ts +17 -0
- package/source/components/textarea/index.ts +5 -0
- package/source/components/textarea/passport.json +382 -0
- package/source/components/textarea/react/Textarea.tsx +208 -0
- package/source/components/textarea/react/locale.ts +5 -0
- package/source/components/textarea/react/props.ts +4 -0
- package/source/components/textarea/styles.css +158 -0
- package/source/components/toaster/README.md +128 -0
- package/source/components/toaster/core/api.ts +87 -0
- package/source/components/toaster/core/index.ts +14 -0
- package/source/components/toaster/core/store.ts +211 -0
- package/source/components/toaster/core/toast.ts +12 -0
- package/source/components/toaster/core/types.ts +78 -0
- package/source/components/toaster/index.ts +6 -0
- package/source/components/toaster/passport.json +221 -0
- package/source/components/toaster/react/ToastItem.tsx +164 -0
- package/source/components/toaster/react/Toaster.tsx +187 -0
- package/source/components/toaster/react/icons.tsx +23 -0
- package/source/components/toaster/react/locale.ts +6 -0
- package/source/components/toaster/react/props.ts +15 -0
- package/source/components/toaster/react/useToasts.ts +11 -0
- package/source/components/toaster/styles.css +282 -0
- package/source/components/tooltip/README.md +43 -0
- package/source/components/tooltip/core/index.ts +4 -0
- package/source/components/tooltip/core/types.ts +4 -0
- package/source/components/tooltip/core/visibility.ts +34 -0
- package/source/components/tooltip/index.ts +3 -0
- package/source/components/tooltip/passport.json +170 -0
- package/source/components/tooltip/react/Tooltip.tsx +196 -0
- package/source/components/tooltip/react/props.ts +4 -0
- package/source/components/tooltip/styles.css +71 -0
- package/source/fallback/index.tsx +11 -0
- package/source/globalStyle.ts +74 -0
- package/source/hooks/SelectionHooks/type.ts +4 -0
- package/source/hooks/SelectionHooks/useClickOutside.ts +22 -0
- package/source/hooks/SelectionHooks/useMultiSelectState.ts +64 -0
- package/source/hooks/SelectionHooks/useSelectData.ts +58 -0
- package/source/hooks/SelectionHooks/useSelectState.ts +36 -0
- package/source/icon/Icon.tsx +102 -0
- package/source/icon/iconPaths.ts +206 -0
- package/source/legacy-components/bargraph/index.tsx +95 -0
- package/source/legacy-components/bargraph/type.ts +12 -0
- package/source/legacy-components/breadcrumb/index.tsx +66 -0
- package/source/legacy-components/breadcrumb/types.ts +10 -0
- package/source/legacy-components/button/index.tsx +42 -0
- package/source/legacy-components/card/index.tsx +31 -0
- package/source/legacy-components/checkbox/index.tsx +25 -0
- package/source/legacy-components/contextmenu/ContextMenu.tsx +87 -0
- package/source/legacy-components/contextmenu/ContextMenuItem.tsx +30 -0
- package/source/legacy-components/contextmenu/index.ts +2 -0
- package/source/legacy-components/contextmenu/types.ts +19 -0
- package/source/legacy-components/darkmode/index.tsx +55 -0
- package/source/legacy-components/datagrid/context/GridContext.tsx +215 -0
- package/source/legacy-components/datagrid/createTemplate.tsx +82 -0
- package/source/legacy-components/datagrid/hooks/index.ts +6 -0
- package/source/legacy-components/datagrid/hooks/useColumns.ts +33 -0
- package/source/legacy-components/datagrid/hooks/useDataSource.ts +54 -0
- package/source/legacy-components/datagrid/hooks/useFiltering.ts +169 -0
- package/source/legacy-components/datagrid/hooks/usePagination.ts +112 -0
- package/source/legacy-components/datagrid/hooks/useRowSelection.ts +48 -0
- package/source/legacy-components/datagrid/hooks/useSearch.ts +90 -0
- package/source/legacy-components/datagrid/index.tsx +28 -0
- package/source/legacy-components/datagrid/layout/FilterPopup.tsx +92 -0
- package/source/legacy-components/datagrid/layout/GridBody.tsx +184 -0
- package/source/legacy-components/datagrid/layout/GridPagination.tsx +119 -0
- package/source/legacy-components/datagrid/layout/GridToolbar.tsx +109 -0
- package/source/legacy-components/datagrid/layout/index.tsx +68 -0
- package/source/legacy-components/datagrid/type.ts +198 -0
- package/source/legacy-components/datepicker/index.tsx +365 -0
- package/source/legacy-components/datepicker/types.ts +12 -0
- package/source/legacy-components/dialog/index.tsx +44 -0
- package/source/legacy-components/dialog/types.ts +12 -0
- package/source/legacy-components/formrenderer/componentHandles/CheckBoxHandles.tsx +80 -0
- package/source/legacy-components/formrenderer/componentHandles/DatePickerHandles.tsx +93 -0
- package/source/legacy-components/formrenderer/componentHandles/InputHandles.tsx +106 -0
- package/source/legacy-components/formrenderer/componentHandles/MultiHandles.tsx +93 -0
- package/source/legacy-components/formrenderer/componentHandles/SelectHandles.tsx +95 -0
- package/source/legacy-components/formrenderer/helperFunctions.ts +72 -0
- package/source/legacy-components/formrenderer/index.tsx +93 -0
- package/source/legacy-components/formrenderer/types.ts +127 -0
- package/source/legacy-components/input/index.tsx +142 -0
- package/source/legacy-components/input/types.ts +10 -0
- package/source/legacy-components/materialInput/index.tsx +138 -0
- package/source/legacy-components/materialInput/types.ts +16 -0
- package/source/legacy-components/modal/index.tsx +152 -0
- package/source/legacy-components/modal/types.ts +19 -0
- package/source/legacy-components/multiselect/PortalDropDown.tsx +44 -0
- package/source/legacy-components/multiselect/index.tsx +269 -0
- package/source/legacy-components/multiselect/types.ts +26 -0
- package/source/legacy-components/navbar/AuthSection.tsx +98 -0
- package/source/legacy-components/navbar/MobileToggle.tsx +31 -0
- package/source/legacy-components/navbar/NavItemComponent.tsx +119 -0
- package/source/legacy-components/navbar/SearchBar.tsx +55 -0
- package/source/legacy-components/navbar/helperFunctions.ts +27 -0
- package/source/legacy-components/navbar/index.tsx +156 -0
- package/source/legacy-components/navbar/types.ts +69 -0
- package/source/legacy-components/select/PortalDropDown.tsx +59 -0
- package/source/legacy-components/select/index.tsx +249 -0
- package/source/legacy-components/select/types.ts +29 -0
- package/source/legacy-components/sidebar/components/MenuItem.tsx +101 -0
- package/source/legacy-components/sidebar/components/MenuSection.tsx +34 -0
- package/source/legacy-components/sidebar/components/SidebarFooter.tsx +50 -0
- package/source/legacy-components/sidebar/components/SidebarLogo.tsx +24 -0
- package/source/legacy-components/sidebar/components/SidebarMenu.tsx +29 -0
- package/source/legacy-components/sidebar/components/UserProfile.tsx +31 -0
- package/source/legacy-components/sidebar/hooks/useSidebarState.ts +41 -0
- package/source/legacy-components/sidebar/index.tsx +77 -0
- package/source/legacy-components/sidebar/type.ts +42 -0
- package/source/legacy-components/spinner/Stroke.tsx +89 -0
- package/source/legacy-components/spinner/index.tsx +54 -0
- package/source/legacy-components/spinner/types.ts +9 -0
- package/source/legacy-components/tabs/index.tsx +71 -0
- package/source/legacy-components/tabs/types.ts +16 -0
- package/source/legacy-components/textarea/index.tsx +123 -0
- package/source/legacy-components/textarea/types.ts +15 -0
- package/source/legacy-components/toast/ToastComponent.tsx +101 -0
- package/source/legacy-components/toast/ToastIcon.tsx +61 -0
- package/source/legacy-components/toast/index.tsx +42 -0
- package/source/legacy-components/toast/toastStore.ts +42 -0
- package/source/legacy-components/toast/types.ts +18 -0
- package/source/legacy-components/toast/useToast.ts +12 -0
- package/source/legacy-components/uploader/ProgressAnimation.tsx +50 -0
- package/source/legacy-components/uploader/UploadedFilePreview.tsx +130 -0
- package/source/legacy-components/uploader/index.tsx +311 -0
- package/source/legacy-components/uploader/types.ts +30 -0
- package/source/legacy-components/uploader/uploaderIcon.tsx +72 -0
- package/source/legacy-components/uploader/uploaderService.ts +134 -0
- package/source/legacy-components/useUploader/useUploader.tsx +310 -0
- package/source/legacy-components/usepaginateddata/usePaginatedData.ts +174 -0
- package/source/theme.ts +40 -0
- package/source/utils.ts +10 -0
- package/tools/env.cjs +61 -0
- package/tools/passport/cli.cjs +79 -0
- package/tools/passport/extract.cjs +493 -0
- package/tools/passport/index.cjs +185 -0
- package/tools/passport/merge.cjs +131 -0
- package/tools/passport/policy.cjs +65 -0
- package/tools/passport/validate.cjs +277 -0
- package/tools/ts-require.cjs +79 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import type { Toast } from "./types";
|
|
3
|
+
import { useToastStore } from "./toastStore";
|
|
4
|
+
import ToastIcon from "./ToastIcon";
|
|
5
|
+
|
|
6
|
+
interface ToastProps {
|
|
7
|
+
toast: Toast;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const leftBorderColors = {
|
|
11
|
+
default: "border-l-zinc-550 dark:border-l-zinc-600",
|
|
12
|
+
success: "border-l-emerald-500",
|
|
13
|
+
error: "border-l-rose-500",
|
|
14
|
+
warning: "border-l-amber-500",
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
const CloseButton = ({ onDismiss }: { onDismiss: () => void }) => (
|
|
18
|
+
<button
|
|
19
|
+
onClick={onDismiss}
|
|
20
|
+
className="shrink-0 rounded-md p-1 transition-colors text-zinc-400 hover:text-zinc-900 dark:hover:text-white hover:bg-zinc-100 dark:hover:bg-zinc-900 focus:outline-none"
|
|
21
|
+
>
|
|
22
|
+
<svg
|
|
23
|
+
className="h-3.5 w-3.5"
|
|
24
|
+
fill="none"
|
|
25
|
+
viewBox="0 0 24 24"
|
|
26
|
+
stroke="currentColor"
|
|
27
|
+
strokeWidth={2.5}
|
|
28
|
+
>
|
|
29
|
+
<path
|
|
30
|
+
strokeLinecap="round"
|
|
31
|
+
strokeLinejoin="round"
|
|
32
|
+
d="M6 18L18 6M6 6l12 12"
|
|
33
|
+
/>
|
|
34
|
+
</svg>
|
|
35
|
+
</button>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export function ToastComponent({ toast }: ToastProps) {
|
|
39
|
+
const { dismiss } = useToastStore();
|
|
40
|
+
const handleDismiss = () => dismiss(toast.id);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (toast.duration !== 0) {
|
|
44
|
+
const timer = setTimeout(() => {
|
|
45
|
+
handleDismiss();
|
|
46
|
+
}, toast.duration || 5000);
|
|
47
|
+
|
|
48
|
+
return () => clearTimeout(timer);
|
|
49
|
+
}
|
|
50
|
+
}, [toast.id, toast.duration]);
|
|
51
|
+
|
|
52
|
+
if (toast.content) {
|
|
53
|
+
return (
|
|
54
|
+
<div className="relative pointer-events-auto rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 p-4 shadow-lg">
|
|
55
|
+
{toast.content}
|
|
56
|
+
<div className="absolute top-2 right-2">
|
|
57
|
+
<CloseButton onDismiss={handleDismiss} />
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const borderClass = leftBorderColors[toast.type || "default"];
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
className={`
|
|
68
|
+
transform transition-all duration-300 ease-in-out
|
|
69
|
+
pointer-events-auto relative flex w-full items-start justify-between
|
|
70
|
+
overflow-hidden rounded-lg border border-zinc-200 dark:border-zinc-800 bg-white dark:bg-zinc-950 px-4 py-3.5 shadow-lg
|
|
71
|
+
border-l-4 ${borderClass}
|
|
72
|
+
animate-fade-in
|
|
73
|
+
`}
|
|
74
|
+
role="alert"
|
|
75
|
+
>
|
|
76
|
+
<div className="flex items-start gap-3 w-full">
|
|
77
|
+
<div className="mt-0.5 shrink-0">
|
|
78
|
+
<ToastIcon type={toast.type} />
|
|
79
|
+
</div>
|
|
80
|
+
<div className="flex-1 min-w-0">
|
|
81
|
+
{toast.title && (
|
|
82
|
+
<div className="font-bold text-sm text-zinc-900 dark:text-white tracking-tight leading-none">
|
|
83
|
+
{toast.title}
|
|
84
|
+
</div>
|
|
85
|
+
)}
|
|
86
|
+
{toast.description && (
|
|
87
|
+
<div className="text-xs font-medium text-zinc-500 dark:text-zinc-400 mt-1">
|
|
88
|
+
{toast.description}
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
</div>
|
|
92
|
+
{toast.action && (
|
|
93
|
+
<div className="shrink-0 flex items-center gap-2">
|
|
94
|
+
{toast.action}
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
<CloseButton onDismiss={handleDismiss} />
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Toast } from "./types";
|
|
2
|
+
|
|
3
|
+
const ToastIcon = ({ type }: { type: Toast["type"] }) => {
|
|
4
|
+
if (!type) return null;
|
|
5
|
+
|
|
6
|
+
const iconColors = {
|
|
7
|
+
default: "text-zinc-500",
|
|
8
|
+
success: "text-emerald-500",
|
|
9
|
+
error: "text-rose-500",
|
|
10
|
+
warning: "text-amber-500",
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={`h-4.5 w-4.5 ${iconColors[type]}`}>
|
|
15
|
+
{type === "success" && (
|
|
16
|
+
<svg
|
|
17
|
+
viewBox="0 0 24 24"
|
|
18
|
+
fill="none"
|
|
19
|
+
stroke="currentColor"
|
|
20
|
+
strokeWidth="2.5"
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
strokeLinecap="round"
|
|
24
|
+
strokeLinejoin="round"
|
|
25
|
+
d="M5 13l4 4L19 7"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
)}
|
|
29
|
+
{type === "error" && (
|
|
30
|
+
<svg
|
|
31
|
+
viewBox="0 0 24 24"
|
|
32
|
+
fill="none"
|
|
33
|
+
stroke="currentColor"
|
|
34
|
+
strokeWidth="2.5"
|
|
35
|
+
>
|
|
36
|
+
<path
|
|
37
|
+
strokeLinecap="round"
|
|
38
|
+
strokeLinejoin="round"
|
|
39
|
+
d="M6 18L18 6M6 6l12 12"
|
|
40
|
+
/>
|
|
41
|
+
</svg>
|
|
42
|
+
)}
|
|
43
|
+
{type === "warning" && (
|
|
44
|
+
<svg
|
|
45
|
+
viewBox="0 0 24 24"
|
|
46
|
+
fill="none"
|
|
47
|
+
stroke="currentColor"
|
|
48
|
+
strokeWidth="2.5"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
strokeLinecap="round"
|
|
52
|
+
strokeLinejoin="round"
|
|
53
|
+
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
54
|
+
/>
|
|
55
|
+
</svg>
|
|
56
|
+
)}
|
|
57
|
+
</div>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export default ToastIcon;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import type { ToastPosition } from "./types";
|
|
6
|
+
import { useToastStore } from "./toastStore";
|
|
7
|
+
import { ToastComponent } from "./ToastComponent";
|
|
8
|
+
|
|
9
|
+
const positions: Record<ToastPosition, string> = {
|
|
10
|
+
"top-right": "top-4 right-4",
|
|
11
|
+
"top-left": "top-4 left-4",
|
|
12
|
+
"top-center": "top-4 left-1/2 -translate-x-1/2",
|
|
13
|
+
"bottom-right": "bottom-4 right-4",
|
|
14
|
+
"bottom-left": "bottom-4 left-4",
|
|
15
|
+
"bottom-center": "bottom-4 left-1/2 -translate-x-1/2",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function Toaster({
|
|
19
|
+
position = "top-right",
|
|
20
|
+
}: {
|
|
21
|
+
position?: ToastPosition;
|
|
22
|
+
}) {
|
|
23
|
+
const [mounted, setMounted] = React.useState(false);
|
|
24
|
+
const { toasts } = useToastStore();
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setMounted(true);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
if (!mounted) return null;
|
|
31
|
+
|
|
32
|
+
return createPortal(
|
|
33
|
+
<div
|
|
34
|
+
className={`fixed z-50 flex flex-col gap-2 w-full max-w-[420px] ${positions[position]}`}
|
|
35
|
+
>
|
|
36
|
+
{toasts.map((toast) => (
|
|
37
|
+
<ToastComponent key={toast.id} toast={toast} />
|
|
38
|
+
))}
|
|
39
|
+
</div>,
|
|
40
|
+
document.body
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Toast } from "./types";
|
|
3
|
+
|
|
4
|
+
type ToastState = {
|
|
5
|
+
toasts: Toast[];
|
|
6
|
+
add: (toast: Omit<Toast, "id">) => void;
|
|
7
|
+
dismiss: (id: string) => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
let listeners: Array<(state: ToastState) => void> = [];
|
|
11
|
+
let state: ToastState = {
|
|
12
|
+
toasts: [],
|
|
13
|
+
add: (toast) => {
|
|
14
|
+
const id = Math.random().toString(36).slice(2);
|
|
15
|
+
state.toasts = [{ ...toast, id }, ...state.toasts];
|
|
16
|
+
emitChange();
|
|
17
|
+
},
|
|
18
|
+
dismiss: (id) => {
|
|
19
|
+
state.toasts = state.toasts.filter((t) => t.id !== id);
|
|
20
|
+
emitChange();
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
function emitChange() {
|
|
25
|
+
for (let listener of listeners) {
|
|
26
|
+
listener(state);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function useToastStore(): ToastState {
|
|
31
|
+
const [, setUpdate] = React.useState({});
|
|
32
|
+
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
const listener = () => setUpdate({});
|
|
35
|
+
listeners.push(listener);
|
|
36
|
+
return () => {
|
|
37
|
+
listeners = listeners.filter((l) => l !== listener);
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
return state;
|
|
42
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ToastType = "default" | "success" | "error" | "warning";
|
|
2
|
+
export type ToastPosition =
|
|
3
|
+
| "top-right"
|
|
4
|
+
| "top-left"
|
|
5
|
+
| "top-center"
|
|
6
|
+
| "bottom-right"
|
|
7
|
+
| "bottom-left"
|
|
8
|
+
| "bottom-center";
|
|
9
|
+
|
|
10
|
+
export interface Toast {
|
|
11
|
+
id: string;
|
|
12
|
+
type?: ToastType;
|
|
13
|
+
duration?: number;
|
|
14
|
+
content?: React.ReactNode;
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
action?: React.ReactNode;
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Toast } from "./types";
|
|
2
|
+
import { useToastStore } from "./toastStore";
|
|
3
|
+
|
|
4
|
+
export function useToast() {
|
|
5
|
+
const store = useToastStore();
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
toast: (props: Omit<Toast, "id">) => store.add(props),
|
|
9
|
+
dismiss: store.dismiss,
|
|
10
|
+
toasts: store.toasts,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Grampro Business Services and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
type AestheticProcessingAnimationProps = {
|
|
11
|
+
progressPercentage: number;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const AestheticProcessingAnimation = ({
|
|
15
|
+
progressPercentage,
|
|
16
|
+
}: AestheticProcessingAnimationProps) => {
|
|
17
|
+
return (
|
|
18
|
+
<div className="w-full max-w-md mx-auto p-2">
|
|
19
|
+
<div className="w-full h-1 bg-gray-200 rounded-full overflow-hidden">
|
|
20
|
+
<div className="h-full w-1/3 bg-black rounded-full animate-processing"></div>
|
|
21
|
+
</div>
|
|
22
|
+
<p className="text-xs mt-2 text-center">
|
|
23
|
+
Uploading in Progress {Math.floor(progressPercentage)}%, Please Wait...
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const AestheticProcessingAnimationWithStyles = ({
|
|
30
|
+
progressPercentage,
|
|
31
|
+
}: AestheticProcessingAnimationProps) => (
|
|
32
|
+
<>
|
|
33
|
+
<style dangerouslySetInnerHTML={{ __html: `
|
|
34
|
+
@keyframes processing {
|
|
35
|
+
0% {
|
|
36
|
+
transform: translateX(-100%);
|
|
37
|
+
}
|
|
38
|
+
100% {
|
|
39
|
+
transform: translateX(300%);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
.animate-processing {
|
|
43
|
+
animation: processing 2s ease-in-out infinite;
|
|
44
|
+
}
|
|
45
|
+
` }} />
|
|
46
|
+
<AestheticProcessingAnimation progressPercentage={progressPercentage} />
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export default AestheticProcessingAnimationWithStyles;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../icon/Icon";
|
|
3
|
+
import { cloudDownload, x } from "../icon/iconPaths";
|
|
4
|
+
import { GetFileIcon } from "./uploaderIcon";
|
|
5
|
+
import type { UploadedFilePreview } from "./types";
|
|
6
|
+
|
|
7
|
+
export default function UploadedFilePreview({
|
|
8
|
+
files = [],
|
|
9
|
+
UploadedFileData,
|
|
10
|
+
apiURL,
|
|
11
|
+
showImagePreview,
|
|
12
|
+
previewUrls,
|
|
13
|
+
onFileRemove,
|
|
14
|
+
isRemovable,
|
|
15
|
+
removedId,
|
|
16
|
+
}: UploadedFilePreview) {
|
|
17
|
+
const handleDownload = (fileId: any, fileName: any) => {
|
|
18
|
+
const downloadUrl = constructDownloadUrl(fileId);
|
|
19
|
+
window.open(downloadUrl, "_blank");
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const constructDownloadUrl = (fileId: any) => {
|
|
23
|
+
const url = new URL("download", apiURL);
|
|
24
|
+
url.searchParams.append("id", fileId);
|
|
25
|
+
return url.href;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const isImageFile = (fileName: any) => {
|
|
29
|
+
const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"];
|
|
30
|
+
return imageExtensions.some((ext) => fileName.toLowerCase().endsWith(ext));
|
|
31
|
+
};
|
|
32
|
+
return (
|
|
33
|
+
<div>
|
|
34
|
+
{/* Rendering Uploded Local Files */}
|
|
35
|
+
{files.length > 0 && (
|
|
36
|
+
<div className="mt-4 space-y-2">
|
|
37
|
+
{files.map((file: any, index: number) => (
|
|
38
|
+
<div
|
|
39
|
+
key={index}
|
|
40
|
+
className="flex items-center justify-between bg-gray-50 p-2 rounded-md"
|
|
41
|
+
>
|
|
42
|
+
<div className="flex items-center space-x-2">
|
|
43
|
+
<GetFileIcon
|
|
44
|
+
file={file}
|
|
45
|
+
showImagePreview={showImagePreview}
|
|
46
|
+
previewUrls={previewUrls}
|
|
47
|
+
/>
|
|
48
|
+
<div>
|
|
49
|
+
<p className="text-sm font-medium text-gray-700">
|
|
50
|
+
{file.name}
|
|
51
|
+
</p>
|
|
52
|
+
<p className="text-xs text-gray-500">
|
|
53
|
+
{(file.size / 1024 / 1024).toFixed(2)} MB
|
|
54
|
+
</p>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<button
|
|
58
|
+
type="button"
|
|
59
|
+
onClick={() => {
|
|
60
|
+
if (onFileRemove) onFileRemove(index);
|
|
61
|
+
}}
|
|
62
|
+
className="text-red-500 hover:text-red-700 transition-colors"
|
|
63
|
+
>
|
|
64
|
+
<Icon
|
|
65
|
+
dimensions={{ width: "16", height: "16" }}
|
|
66
|
+
elements={x}
|
|
67
|
+
svgClass={"stroke-red-500 fill-none dark:stroke-white"}
|
|
68
|
+
/>
|
|
69
|
+
</button>
|
|
70
|
+
</div>
|
|
71
|
+
))}
|
|
72
|
+
</div>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
{/* Rendering Uploded Remote Files Preview */}
|
|
76
|
+
{UploadedFileData.length > 0 &&
|
|
77
|
+
UploadedFileData.map((item: any, index: any) => (
|
|
78
|
+
<div
|
|
79
|
+
key={index}
|
|
80
|
+
className="flex items-center justify-between bg-gray-50 p-2 rounded-md mt-2"
|
|
81
|
+
>
|
|
82
|
+
<div className="flex items-center space-x-2">
|
|
83
|
+
{isImageFile(item.FileName) ? (
|
|
84
|
+
<img
|
|
85
|
+
src={constructDownloadUrl(item.FileID)}
|
|
86
|
+
alt={item.FileName}
|
|
87
|
+
className="mt-2 w-8 h-8 object-cover rounded-lg"
|
|
88
|
+
/>
|
|
89
|
+
) : (
|
|
90
|
+
<GetFileIcon file={{ type: item.FileName.split(".").pop() }} />
|
|
91
|
+
)}
|
|
92
|
+
<div>
|
|
93
|
+
<p className="text-sm font-medium text-gray-700">
|
|
94
|
+
{item.FileName}
|
|
95
|
+
</p>
|
|
96
|
+
<p className="text-xs text-gray-500">
|
|
97
|
+
{(item.FileSize / 1024 / 1024).toFixed(2)} MB
|
|
98
|
+
</p>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
<div className="flex gap-2">
|
|
102
|
+
<button
|
|
103
|
+
onClick={() => handleDownload(item.FileID, item.FileName)}
|
|
104
|
+
>
|
|
105
|
+
<Icon
|
|
106
|
+
dimensions={{ width: "18", height: "18" }}
|
|
107
|
+
elements={cloudDownload}
|
|
108
|
+
svgClass={"stroke-zinc-700 dark:stroke-zinc-400 fill-none"}
|
|
109
|
+
/>
|
|
110
|
+
</button>
|
|
111
|
+
{isRemovable && (
|
|
112
|
+
<button
|
|
113
|
+
aria-label="Remove"
|
|
114
|
+
onClick={() => {
|
|
115
|
+
if (removedId) removedId(item.FileID);
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
<Icon
|
|
119
|
+
dimensions={{ width: "16", height: "16" }}
|
|
120
|
+
elements={x}
|
|
121
|
+
svgClass={"stroke-red-500 fill-none dark:stroke-white"}
|
|
122
|
+
/>
|
|
123
|
+
</button>
|
|
124
|
+
)}
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
))}
|
|
128
|
+
</div>
|
|
129
|
+
);
|
|
130
|
+
}
|