@pihanga2/shadcn 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -0
- package/cards/badge/badge.component.d.ts +14 -0
- package/cards/badge/badge.component.js +18 -0
- package/cards/badge/badge.component.js.map +1 -0
- package/cards/badge/badge.types.d.ts +37 -0
- package/cards/badge/badge.types.js +7 -0
- package/cards/badge/badge.types.js.map +1 -0
- package/cards/badge/index.d.ts +1 -0
- package/cards/badge/index.js +12 -0
- package/cards/badge/index.js.map +1 -0
- package/cards/box/box.component.d.ts +4 -0
- package/cards/box/box.component.js +24 -0
- package/cards/box/box.component.js.map +1 -0
- package/cards/box/box.types.d.ts +71 -0
- package/cards/box/box.types.js +7 -0
- package/cards/box/box.types.js.map +1 -0
- package/cards/box/index.d.ts +1 -0
- package/cards/box/index.js +12 -0
- package/cards/box/index.js.map +1 -0
- package/cards/button/button.component.d.ts +4 -0
- package/cards/button/button.component.js +71 -0
- package/cards/button/button.component.js.map +1 -0
- package/cards/button/button.types.d.ts +106 -0
- package/cards/button/button.types.js +7 -0
- package/cards/button/button.types.js.map +1 -0
- package/cards/button/index.d.ts +1 -0
- package/cards/button/index.js +13 -0
- package/cards/button/index.js.map +1 -0
- package/cards/checkbox/checkbox.component.d.ts +4 -0
- package/cards/checkbox/checkbox.component.js +36 -0
- package/cards/checkbox/checkbox.component.js.map +1 -0
- package/cards/checkbox/checkbox.types.d.ts +37 -0
- package/cards/checkbox/checkbox.types.js +7 -0
- package/cards/checkbox/checkbox.types.js.map +1 -0
- package/cards/checkbox/index.d.ts +1 -0
- package/cards/checkbox/index.js +13 -0
- package/cards/checkbox/index.js.map +1 -0
- package/cards/conditional/conditional.component.d.ts +11 -0
- package/cards/conditional/conditional.component.js +15 -0
- package/cards/conditional/conditional.component.js.map +1 -0
- package/cards/conditional/conditional.types.d.ts +29 -0
- package/cards/conditional/conditional.types.js +7 -0
- package/cards/conditional/conditional.types.js.map +1 -0
- package/cards/conditional/index.d.ts +1 -0
- package/cards/conditional/index.js +12 -0
- package/cards/conditional/index.js.map +1 -0
- package/cards/core-index.d.ts +30 -0
- package/cards/core-index.js +61 -0
- package/cards/dataTable/dataTable.component.d.ts +4 -0
- package/cards/dataTable/dataTable.component.js +209 -0
- package/cards/dataTable/dataTable.component.js.map +1 -0
- package/cards/dataTable/dataTable.types.d.ts +196 -0
- package/cards/dataTable/dataTable.types.js +13 -0
- package/cards/dataTable/dataTable.types.js.map +1 -0
- package/cards/dataTable/dataTableRowDetail.component.d.ts +26 -0
- package/cards/dataTable/dataTableRowDetail.component.js +47 -0
- package/cards/dataTable/dataTableRowDetail.component.js.map +1 -0
- package/cards/dataTable/index.d.ts +1 -0
- package/cards/dataTable/index.js +16 -0
- package/cards/dataTable/index.js.map +1 -0
- package/cards/dialog/dialog.component.d.ts +4 -0
- package/cards/dialog/dialog.component.js +89 -0
- package/cards/dialog/dialog.component.js.map +1 -0
- package/cards/dialog/dialog.types.d.ts +115 -0
- package/cards/dialog/dialog.types.js +11 -0
- package/cards/dialog/dialog.types.js.map +1 -0
- package/cards/dialog/index.d.ts +1 -0
- package/cards/dialog/index.js +13 -0
- package/cards/dialog/index.js.map +1 -0
- package/cards/dropDownMenu/drop-down.component.d.ts +4 -0
- package/cards/dropDownMenu/drop-down.component.js +205 -0
- package/cards/dropDownMenu/drop-down.component.js.map +1 -0
- package/cards/dropDownMenu/drop-down.types.d.ts +131 -0
- package/cards/dropDownMenu/drop-down.types.js +7 -0
- package/cards/dropDownMenu/drop-down.types.js.map +1 -0
- package/cards/dropDownMenu/dropdown-context.d.ts +7 -0
- package/cards/dropDownMenu/dropdown-context.js +7 -0
- package/cards/dropDownMenu/dropdown-context.js.map +1 -0
- package/cards/dropDownMenu/dropdown-menu.ui.d.ts +42 -0
- package/cards/dropDownMenu/dropdown-menu.ui.js +111 -0
- package/cards/dropDownMenu/dropdown-menu.ui.js.map +1 -0
- package/cards/dropDownMenu/index.d.ts +1 -0
- package/cards/dropDownMenu/index.js +13 -0
- package/cards/dropDownMenu/index.js.map +1 -0
- package/cards/emptyCard.d.ts +7 -0
- package/cards/field/field.component.d.ts +4 -0
- package/cards/field/field.component.js +38 -0
- package/cards/field/field.component.js.map +1 -0
- package/cards/field/field.types.d.ts +30 -0
- package/cards/field/field.types.js +7 -0
- package/cards/field/field.types.js.map +1 -0
- package/cards/field/index.d.ts +1 -0
- package/cards/field/index.js +12 -0
- package/cards/field/index.js.map +1 -0
- package/cards/flexGrid/flexGrid.component.d.ts +4 -0
- package/cards/flexGrid/flexGrid.component.js +40 -0
- package/cards/flexGrid/flexGrid.component.js.map +1 -0
- package/cards/flexGrid/flexGrid.types.d.ts +23 -0
- package/cards/flexGrid/flexGrid.types.js +7 -0
- package/cards/flexGrid/flexGrid.types.js.map +1 -0
- package/cards/flexGrid/index.d.ts +1 -0
- package/cards/flexGrid/index.js +12 -0
- package/cards/flexGrid/index.js.map +1 -0
- package/cards/form/form.component.d.ts +4 -0
- package/cards/form/form.component.js +64 -0
- package/cards/form/form.component.js.map +1 -0
- package/cards/form/form.context.d.ts +23 -0
- package/cards/form/form.context.js +13 -0
- package/cards/form/form.context.js.map +1 -0
- package/cards/form/form.types.d.ts +43 -0
- package/cards/form/form.types.js +7 -0
- package/cards/form/form.types.js.map +1 -0
- package/cards/form/index.d.ts +2 -0
- package/cards/form/index.js +14 -0
- package/cards/form/index.js.map +1 -0
- package/cards/framework/framework.component.d.ts +3 -0
- package/cards/framework/framework.component.js +21 -0
- package/cards/framework/framework.component.js.map +1 -0
- package/cards/framework/index.d.ts +2 -0
- package/cards/framework/index.js +12 -0
- package/cards/framework/index.js.map +1 -0
- package/cards/graphin/graphin.component.d.ts +4 -0
- package/cards/graphin/graphin.types.d.ts +18 -0
- package/cards/graphin/index.d.ts +2 -0
- package/cards/graphin/tooltip.component.d.ts +10 -0
- package/cards/icons.d.ts +15 -0
- package/cards/icons.js +15 -0
- package/cards/icons.js.map +1 -0
- package/cards/input/index.d.ts +1 -0
- package/cards/input/index.js +13 -0
- package/cards/input/index.js.map +1 -0
- package/cards/input/input.component.d.ts +4 -0
- package/cards/input/input.component.js +69 -0
- package/cards/input/input.component.js.map +1 -0
- package/cards/input/input.types.d.ts +80 -0
- package/cards/input/input.types.js +7 -0
- package/cards/input/input.types.js.map +1 -0
- package/cards/jsonViewer/index.d.ts +1 -0
- package/cards/jsonViewer/jsonViewer.component.d.ts +4 -0
- package/cards/jsonViewer/jsonViewer.types.d.ts +76 -0
- package/cards/list/index.d.ts +1 -0
- package/cards/list/index.js +13 -0
- package/cards/list/index.js.map +1 -0
- package/cards/list/list.component.d.ts +4 -0
- package/cards/list/list.component.js +102 -0
- package/cards/list/list.component.js.map +1 -0
- package/cards/list/list.types.d.ts +65 -0
- package/cards/list/list.types.js +7 -0
- package/cards/list/list.types.js.map +1 -0
- package/cards/loadingOverlay/index.d.ts +1 -0
- package/cards/loadingOverlay/index.js +12 -0
- package/cards/loadingOverlay/index.js.map +1 -0
- package/cards/loadingOverlay/loadingOverlay.component.d.ts +4 -0
- package/cards/loadingOverlay/loadingOverlay.component.js +31 -0
- package/cards/loadingOverlay/loadingOverlay.component.js.map +1 -0
- package/cards/loadingOverlay/loadingOverlay.types.d.ts +13 -0
- package/cards/loadingOverlay/loadingOverlay.types.js +7 -0
- package/cards/loadingOverlay/loadingOverlay.types.js.map +1 -0
- package/cards/loadingSkeleton/index.d.ts +1 -0
- package/cards/loadingSkeleton/index.js +12 -0
- package/cards/loadingSkeleton/index.js.map +1 -0
- package/cards/loadingSkeleton/loading-skeleton.component.d.ts +19 -0
- package/cards/loadingSkeleton/loading-skeleton.component.js +33 -0
- package/cards/loadingSkeleton/loading-skeleton.component.js.map +1 -0
- package/cards/loadingSkeleton/loading-skeleton.types.d.ts +94 -0
- package/cards/loadingSkeleton/loading-skeleton.types.js +7 -0
- package/cards/loadingSkeleton/loading-skeleton.types.js.map +1 -0
- package/cards/markdownViewer/index.d.ts +1 -0
- package/cards/markdownViewer/markdownViewer.component.d.ts +4 -0
- package/cards/markdownViewer/markdownViewer.types.d.ts +28 -0
- package/cards/menu/index.d.ts +1 -0
- package/cards/menu/index.js +13 -0
- package/cards/menu/index.js.map +1 -0
- package/cards/menu/menu.component.d.ts +4 -0
- package/cards/menu/menu.component.js +23 -0
- package/cards/menu/menu.component.js.map +1 -0
- package/cards/menu/menu.types.d.ts +53 -0
- package/cards/menu/menu.types.js +7 -0
- package/cards/menu/menu.types.js.map +1 -0
- package/cards/modeToggle/index.d.ts +1 -0
- package/cards/modeToggle/index.js +13 -0
- package/cards/modeToggle/index.js.map +1 -0
- package/cards/modeToggle/mode-toggle.component.d.ts +4 -0
- package/cards/modeToggle/mode-toggle.component.js +32 -0
- package/cards/modeToggle/mode-toggle.component.js.map +1 -0
- package/cards/modeToggle/mode-toggle.types.d.ts +20 -0
- package/cards/modeToggle/mode-toggle.types.js +7 -0
- package/cards/modeToggle/mode-toggle.types.js.map +1 -0
- package/cards/navbarSearch/index.d.ts +1 -0
- package/cards/navbarSearch/index.js +13 -0
- package/cards/navbarSearch/index.js.map +1 -0
- package/cards/navbarSearch/navbarSearch.component.d.ts +3 -0
- package/cards/navbarSearch/navbarSearch.component.js +88 -0
- package/cards/navbarSearch/navbarSearch.component.js.map +1 -0
- package/cards/navbarSearch/navbarSearch.type.d.ts +32 -0
- package/cards/navbarSearch/navbarSearch.type.js +11 -0
- package/cards/navbarSearch/navbarSearch.type.js.map +1 -0
- package/cards/pageWithNavbar/index.d.ts +2 -0
- package/cards/pageWithNavbar/index.js +14 -0
- package/cards/pageWithNavbar/index.js.map +1 -0
- package/cards/pageWithNavbar/pageWithNavbar.component.d.ts +12 -0
- package/cards/pageWithNavbar/pageWithNavbar.component.js +153 -0
- package/cards/pageWithNavbar/pageWithNavbar.component.js.map +1 -0
- package/cards/pageWithNavbar/pageWithNavbar.type.d.ts +81 -0
- package/cards/pageWithNavbar/pageWithNavbar.type.js +7 -0
- package/cards/pageWithNavbar/pageWithNavbar.type.js.map +1 -0
- package/cards/pasteTarget/index.d.ts +1 -0
- package/cards/pasteTarget/index.js +13 -0
- package/cards/pasteTarget/index.js.map +1 -0
- package/cards/pasteTarget/pasteTarget.component.d.ts +4 -0
- package/cards/pasteTarget/pasteTarget.component.js +158 -0
- package/cards/pasteTarget/pasteTarget.component.js.map +1 -0
- package/cards/pasteTarget/pasteTarget.types.d.ts +46 -0
- package/cards/pasteTarget/pasteTarget.types.js +11 -0
- package/cards/pasteTarget/pasteTarget.types.js.map +1 -0
- package/cards/resizable/index.d.ts +1 -0
- package/cards/resizable/resizable.component.d.ts +4 -0
- package/cards/resizable/resizable.types.d.ts +49 -0
- package/cards/select/index.d.ts +1 -0
- package/cards/select/index.js +13 -0
- package/cards/select/index.js.map +1 -0
- package/cards/select/select.component.d.ts +4 -0
- package/cards/select/select.component.js +41 -0
- package/cards/select/select.component.js.map +1 -0
- package/cards/select/select.types.d.ts +73 -0
- package/cards/select/select.types.js +11 -0
- package/cards/select/select.types.js.map +1 -0
- package/cards/stack/index.d.ts +1 -0
- package/cards/stack/index.js +12 -0
- package/cards/stack/index.js.map +1 -0
- package/cards/stack/stack.component.d.ts +7 -0
- package/cards/stack/stack.component.js +83 -0
- package/cards/stack/stack.component.js.map +1 -0
- package/cards/stack/stack.types.d.ts +47 -0
- package/cards/stack/stack.types.js +7 -0
- package/cards/stack/stack.types.js.map +1 -0
- package/cards/stepper/index.d.ts +1 -0
- package/cards/stepper/index.js +13 -0
- package/cards/stepper/index.js.map +1 -0
- package/cards/stepper/stepper.component.d.ts +4 -0
- package/cards/stepper/stepper.component.js +48 -0
- package/cards/stepper/stepper.component.js.map +1 -0
- package/cards/stepper/stepper.types.d.ts +96 -0
- package/cards/stepper/stepper.types.js +7 -0
- package/cards/stepper/stepper.types.js.map +1 -0
- package/cards/switch/index.d.ts +1 -0
- package/cards/switch/index.js +13 -0
- package/cards/switch/index.js.map +1 -0
- package/cards/switch/switch.component.d.ts +4 -0
- package/cards/switch/switch.component.js +34 -0
- package/cards/switch/switch.component.js.map +1 -0
- package/cards/switch/switch.types.d.ts +39 -0
- package/cards/switch/switch.types.js +7 -0
- package/cards/switch/switch.types.js.map +1 -0
- package/cards/tabs/index.d.ts +1 -0
- package/cards/tabs/index.js +13 -0
- package/cards/tabs/index.js.map +1 -0
- package/cards/tabs/tabs.component.d.ts +4 -0
- package/cards/tabs/tabs.component.js +42 -0
- package/cards/tabs/tabs.component.js.map +1 -0
- package/cards/tabs/tabs.types.d.ts +72 -0
- package/cards/tabs/tabs.types.js +7 -0
- package/cards/tabs/tabs.types.js.map +1 -0
- package/cards/textField/index.d.ts +1 -0
- package/cards/textField/index.js +13 -0
- package/cards/textField/index.js.map +1 -0
- package/cards/textField/textField.component.d.ts +4 -0
- package/cards/textField/textField.component.js +29 -0
- package/cards/textField/textField.component.js.map +1 -0
- package/cards/textField/textField.types.d.ts +36 -0
- package/cards/textField/textField.types.js +7 -0
- package/cards/textField/textField.types.js.map +1 -0
- package/cards/toast/index.d.ts +1 -0
- package/cards/toast/index.js +13 -0
- package/cards/toast/index.js.map +1 -0
- package/cards/toast/toast.component.d.ts +4 -0
- package/cards/toast/toast.component.js +76 -0
- package/cards/toast/toast.component.js.map +1 -0
- package/cards/toast/toast.types.d.ts +100 -0
- package/cards/toast/toast.types.js +12 -0
- package/cards/toast/toast.types.js.map +1 -0
- package/cards/toggleGroup/index.d.ts +1 -0
- package/cards/toggleGroup/index.js +13 -0
- package/cards/toggleGroup/index.js.map +1 -0
- package/cards/toggleGroup/toggleGroup.component.d.ts +4 -0
- package/cards/toggleGroup/toggleGroup.component.js +55 -0
- package/cards/toggleGroup/toggleGroup.component.js.map +1 -0
- package/cards/toggleGroup/toggleGroup.types.d.ts +96 -0
- package/cards/toggleGroup/toggleGroup.types.js +7 -0
- package/cards/toggleGroup/toggleGroup.types.js.map +1 -0
- package/cards/types.d.ts +72 -0
- package/cards/types.js +22 -0
- package/cards/types.js.map +1 -0
- package/cards/typography/index.d.ts +1 -0
- package/cards/typography/index.js +12 -0
- package/cards/typography/index.js.map +1 -0
- package/cards/typography/typography.component.d.ts +4 -0
- package/cards/typography/typography.component.js +44 -0
- package/cards/typography/typography.component.js.map +1 -0
- package/cards/typography/typography.types.d.ts +23 -0
- package/cards/typography/typography.types.js +7 -0
- package/cards/typography/typography.types.js.map +1 -0
- package/components/hooks/use-is-touch-device.d.ts +1 -0
- package/components/lib/utils.js +10 -0
- package/components/lib/utils.js.map +1 -0
- package/components/theme-provider/index.d.ts +4 -0
- package/components/theme-provider/index.js +12 -0
- package/components/theme-provider/index.js.map +1 -0
- package/components/theme-provider/theme-provider.component.d.ts +2 -0
- package/components/theme-provider/theme-provider.component.js +31 -0
- package/components/theme-provider/theme-provider.component.js.map +1 -0
- package/components/theme-provider/theme-provider.types.d.ts +12 -0
- package/components/theme-provider/theme-provider.types.js +9 -0
- package/components/theme-provider/theme-provider.types.js.map +1 -0
- package/components/ui/avatar.js +30 -0
- package/components/ui/avatar.js.map +1 -0
- package/components/ui/badge.js +26 -0
- package/components/ui/badge.js.map +1 -0
- package/components/ui/button.js +98 -0
- package/components/ui/button.js.map +1 -0
- package/components/ui/dialog.js +109 -0
- package/components/ui/dialog.js.map +1 -0
- package/components/ui/field.js +68 -0
- package/components/ui/field.js.map +1 -0
- package/components/ui/input.js +16 -0
- package/components/ui/input.js.map +1 -0
- package/components/ui/label.js +16 -0
- package/components/ui/label.js.map +1 -0
- package/components/ui/menubar.js +62 -0
- package/components/ui/menubar.js.map +1 -0
- package/components/ui/select.js +84 -0
- package/components/ui/select.js.map +1 -0
- package/components/ui/separator.js +5 -0
- package/components/ui/sheet.js +49 -0
- package/components/ui/sheet.js.map +1 -0
- package/components/ui/spinner.js +35 -0
- package/components/ui/spinner.js.map +1 -0
- package/components/ui/stepper.js +145 -0
- package/components/ui/stepper.js.map +1 -0
- package/components/ui/switch.js +20 -0
- package/components/ui/switch.js.map +1 -0
- package/components/ui/table.js +61 -0
- package/components/ui/table.js.map +1 -0
- package/components/ui/tabs.js +38 -0
- package/components/ui/tabs.js.map +1 -0
- package/components/ui/toggle-group.js +50 -0
- package/components/ui/toggle-group.js.map +1 -0
- package/components/ui/toggle.js +27 -0
- package/components/ui/toggle.js.map +1 -0
- package/components/ui/tooltip.js +38 -0
- package/components/ui/tooltip.js.map +1 -0
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +10 -0
- package/lib/utils.js.map +1 -0
- package/mountain-snow.svg +4 -0
- package/package.json +203 -0
- package/pihanga-shadcn.css +2 -0
- package/r/badge.json +35 -0
- package/r/box.json +26 -0
- package/r/button.json +39 -0
- package/r/checkbox.json +31 -0
- package/r/conditional.json +30 -0
- package/r/dataTable.json +43 -0
- package/r/dialog.json +36 -0
- package/r/dropDownMenu.json +47 -0
- package/r/field.json +35 -0
- package/r/flexGrid.json +32 -0
- package/r/form.json +37 -0
- package/r/framework.json +28 -0
- package/r/graphin.json +42 -0
- package/r/input.json +35 -0
- package/r/jsonViewer.json +40 -0
- package/r/list.json +39 -0
- package/r/loadingOverlay.json +39 -0
- package/r/loadingSkeleton.json +30 -0
- package/r/markdownViewer.json +51 -0
- package/r/menu.json +34 -0
- package/r/modeToggle.json +36 -0
- package/r/navbarSearch.json +31 -0
- package/r/pageWithNavbar.json +46 -0
- package/r/pasteTarget.json +41 -0
- package/r/pihanga-base.json +11 -0
- package/r/pihanga-cards-icons.json +16 -0
- package/r/pihanga-cards-types.json +16 -0
- package/r/pihanga-hook-use-is-touch-device.json +15 -0
- package/r/pihanga-lib-utils.json +18 -0
- package/r/pihanga-theme-provider.json +25 -0
- package/r/pihanga-ui-extras.json +68 -0
- package/r/registry.json +171 -0
- package/r/resizable.json +35 -0
- package/r/select.json +35 -0
- package/r/stack.json +27 -0
- package/r/stepper.json +39 -0
- package/r/switch.json +36 -0
- package/r/tabs.json +33 -0
- package/r/textField.json +32 -0
- package/r/toast.json +32 -0
- package/r/toggleGroup.json +35 -0
- package/r/typography.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# @pihanga2/shadcn
|
|
2
|
+
|
|
3
|
+
Pihanga core card components — built on [shadcn/ui](https://ui.shadcn.com) and
|
|
4
|
+
[Radix UI](https://radix-ui.com).
|
|
5
|
+
|
|
6
|
+
This is the traditional **npm package** distribution of the
|
|
7
|
+
[pihanga-shadcn](https://github.com/ivcap-works/pihanga-shadcn) card library.
|
|
8
|
+
|
|
9
|
+
A **copy-on-install shadcn registry** is also available for teams that prefer
|
|
10
|
+
the shadcn workflow:
|
|
11
|
+
```sh
|
|
12
|
+
npx shadcn@latest add https://ivcap-works.github.io/pihanga-shadcn/r/button
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npm install @pihanga2/shadcn
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Install the required peer dependencies:
|
|
24
|
+
```sh
|
|
25
|
+
npm install react react-dom @pihanga2/core @pihanga2/cards
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Tailwind CSS
|
|
31
|
+
|
|
32
|
+
This package ships TypeScript source with Tailwind CSS utility classes. Add
|
|
33
|
+
the package to your Tailwind content glob so that utility classes are included
|
|
34
|
+
in your generated CSS.
|
|
35
|
+
|
|
36
|
+
**Tailwind v3** (`tailwind.config.js`):
|
|
37
|
+
```js
|
|
38
|
+
module.exports = {
|
|
39
|
+
content: [
|
|
40
|
+
// … your project files …
|
|
41
|
+
"./node_modules/@pihanga2/shadcn/dist-lib/**/*.{js,jsx,ts,tsx}",
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Tailwind v4** (`tailwind.css`):
|
|
47
|
+
```css
|
|
48
|
+
@source "../../node_modules/@pihanga2/shadcn/dist-lib";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
### Register all core cards at once
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import "@pihanga2/shadcn";
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This imports `core-index.js`, which calls `registerCardComponent()` for every
|
|
62
|
+
core card in the Pihanga runtime.
|
|
63
|
+
|
|
64
|
+
### Register individual cards (tree-shakeable)
|
|
65
|
+
|
|
66
|
+
Import only the cards your app uses — unused cards are eliminated by your bundler:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import "@pihanga2/shadcn/cards/button";
|
|
70
|
+
import "@pihanga2/shadcn/cards/dialog";
|
|
71
|
+
import "@pihanga2/shadcn/cards/dataTable";
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Included cards (30)
|
|
77
|
+
|
|
78
|
+
- `badge`
|
|
79
|
+
- `box`
|
|
80
|
+
- `button`
|
|
81
|
+
- `checkbox`
|
|
82
|
+
- `conditional`
|
|
83
|
+
- `dataTable`
|
|
84
|
+
- `dialog`
|
|
85
|
+
- `dropDownMenu`
|
|
86
|
+
- `field`
|
|
87
|
+
- `flexGrid`
|
|
88
|
+
- `form`
|
|
89
|
+
- `framework`
|
|
90
|
+
- `input`
|
|
91
|
+
- `list`
|
|
92
|
+
- `loadingOverlay`
|
|
93
|
+
- `loadingSkeleton`
|
|
94
|
+
- `menu`
|
|
95
|
+
- `modeToggle`
|
|
96
|
+
- `navbarSearch`
|
|
97
|
+
- `pageWithNavbar`
|
|
98
|
+
- `pasteTarget`
|
|
99
|
+
- `select`
|
|
100
|
+
- `stack`
|
|
101
|
+
- `stepper`
|
|
102
|
+
- `switch`
|
|
103
|
+
- `tabs`
|
|
104
|
+
- `textField`
|
|
105
|
+
- `toast`
|
|
106
|
+
- `toggleGroup`
|
|
107
|
+
- `typography`
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Source & registry
|
|
112
|
+
|
|
113
|
+
- Repository: <https://github.com/ivcap-works/pihanga-shadcn>
|
|
114
|
+
- shadcn registry: <https://ivcap-works.github.io/pihanga-shadcn/r>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PiCardProps } from '@pihanga2/core';
|
|
2
|
+
import { BadgeCardProps } from './badge.types';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* `shad/badge` card component.
|
|
6
|
+
*
|
|
7
|
+
* Renders a shadcn `<Badge>` element with a `label` and an optional `variant`.
|
|
8
|
+
* The variant vocabulary is intentionally identical to the `BadgeColumn.variants`
|
|
9
|
+
* map used by the `shad/data-table` card, so both can be driven from the same
|
|
10
|
+
* source-of-truth value:
|
|
11
|
+
*
|
|
12
|
+
* "default" | "secondary" | "destructive" | "outline"
|
|
13
|
+
*/
|
|
14
|
+
export declare const BadgeComponent: (props: PiCardProps<BadgeCardProps>) => React.ReactNode;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Badge as e } from "../../components/ui/badge.js";
|
|
2
|
+
import { cn as t } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/cards/badge/badge.component.tsx
|
|
6
|
+
var r = (r) => {
|
|
7
|
+
let { label: i, variant: a = "secondary", className: o, cardName: s } = r;
|
|
8
|
+
return /* @__PURE__ */ n(e, {
|
|
9
|
+
variant: a,
|
|
10
|
+
className: t(o),
|
|
11
|
+
"data-pihanga": s,
|
|
12
|
+
children: i
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as BadgeComponent };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=badge.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.component.js","names":[],"sources":["../../../src/cards/badge/badge.component.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {type PiCardProps} from \"@pihanga2/core\";\nimport {Badge} from \"@/components/ui/badge\";\nimport {cn} from \"@/lib/utils\";\nimport type {BadgeCardProps} from \"./badge.types\";\n\n/**\n * `shad/badge` card component.\n *\n * Renders a shadcn `<Badge>` element with a `label` and an optional `variant`.\n * The variant vocabulary is intentionally identical to the `BadgeColumn.variants`\n * map used by the `shad/data-table` card, so both can be driven from the same\n * source-of-truth value:\n *\n * \"default\" | \"secondary\" | \"destructive\" | \"outline\"\n */\nexport const BadgeComponent = (\n props: PiCardProps<BadgeCardProps>,\n): React.ReactNode => {\n const {label, variant = \"secondary\", className, cardName} = props;\n\n return (\n <Badge\n variant={variant}\n className={cn(className)}\n data-pihanga={cardName}\n >\n {label}\n </Badge>\n );\n};\n"],"mappings":";;;;;AAgBA,IAAa,KACX,MACoB;CACpB,IAAM,EAAC,UAAO,aAAU,aAAa,cAAW,gBAAY;CAE5D,OACE,kBAAC,GAAD;EACW;EACT,WAAW,EAAG,CAAS;EACvB,gBAAc;YAEb;CACI,CAAA;AAEX"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const BADGE_CARD = "shad/badge";
|
|
2
|
+
/**
|
|
3
|
+
* Badge visual style variants — mirrors the shadcn `Badge` `variant` prop and
|
|
4
|
+
* the `variants` map used in the dataTable `BadgeColumn` type, so the same
|
|
5
|
+
* string values work in both contexts.
|
|
6
|
+
*
|
|
7
|
+
* | Value | Appearance |
|
|
8
|
+
* |-----------------|------------------------------------------|
|
|
9
|
+
* | `"default"` | Primary colour, filled |
|
|
10
|
+
* | `"secondary"` | Muted/secondary colour, filled (default) |
|
|
11
|
+
* | `"destructive"` | Red / error colour, filled |
|
|
12
|
+
* | `"outline"` | Transparent background, border only |
|
|
13
|
+
*/
|
|
14
|
+
export type BadgeVariant = "default" | "secondary" | "destructive" | "outline";
|
|
15
|
+
export type BadgeCardProps = {
|
|
16
|
+
/** Text content rendered inside the badge */
|
|
17
|
+
label: string;
|
|
18
|
+
/**
|
|
19
|
+
* Visual style variant. Matches the shadcn Badge variants and the
|
|
20
|
+
* `BadgeColumn.variants` map in `dataTable.types.ts`.
|
|
21
|
+
* @default "secondary"
|
|
22
|
+
*/
|
|
23
|
+
variant?: BadgeVariant;
|
|
24
|
+
/** Additional Tailwind classes applied to the `<Badge>` element */
|
|
25
|
+
className?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Factory function for declaring a `shad/badge` card instance.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* import {registerCard} from "@pihanga2/core";
|
|
32
|
+
* import {ShadBadge} from "@/cards/badge";
|
|
33
|
+
*
|
|
34
|
+
* registerCard("myApp/status", ShadBadge({label: "Active", variant: "default"}));
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const ShadBadge: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<BadgeCardProps, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.types.js","names":[],"sources":["../../../src/cards/badge/badge.types.ts"],"sourcesContent":["import {createCardDeclaration} from \"@pihanga2/core\";\n\nexport const BADGE_CARD = \"shad/badge\";\n\n/**\n * Badge visual style variants — mirrors the shadcn `Badge` `variant` prop and\n * the `variants` map used in the dataTable `BadgeColumn` type, so the same\n * string values work in both contexts.\n *\n * | Value | Appearance |\n * |-----------------|------------------------------------------|\n * | `\"default\"` | Primary colour, filled |\n * | `\"secondary\"` | Muted/secondary colour, filled (default) |\n * | `\"destructive\"` | Red / error colour, filled |\n * | `\"outline\"` | Transparent background, border only |\n */\nexport type BadgeVariant = \"default\" | \"secondary\" | \"destructive\" | \"outline\";\n\nexport type BadgeCardProps = {\n /** Text content rendered inside the badge */\n label: string;\n\n /**\n * Visual style variant. Matches the shadcn Badge variants and the\n * `BadgeColumn.variants` map in `dataTable.types.ts`.\n * @default \"secondary\"\n */\n variant?: BadgeVariant;\n\n /** Additional Tailwind classes applied to the `<Badge>` element */\n className?: string;\n};\n\n/**\n * Factory function for declaring a `shad/badge` card instance.\n *\n * ```ts\n * import {registerCard} from \"@pihanga2/core\";\n * import {ShadBadge} from \"@/cards/badge\";\n *\n * registerCard(\"myApp/status\", ShadBadge({label: \"Active\", variant: \"default\"}));\n * ```\n */\nexport const ShadBadge = createCardDeclaration<BadgeCardProps>(BADGE_CARD);\n"],"mappings":";;AAEA,IAAa,IAAa,cAyCb,IAAY,EAAsC,CAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './badge.types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BadgeComponent as e } from "./badge.component.js";
|
|
2
|
+
import { BADGE_CARD as t, ShadBadge as n } from "./badge.types.js";
|
|
3
|
+
import { registerCardComponent as r } from "@pihanga2/core";
|
|
4
|
+
//#region src/cards/badge/index.ts
|
|
5
|
+
r({
|
|
6
|
+
name: t,
|
|
7
|
+
component: e
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as BADGE_CARD, n as ShadBadge };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/badge/index.ts"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\n\nimport {BadgeComponent} from \"./badge.component\";\nimport {BADGE_CARD} from \"./badge.types\";\n\nexport * from \"./badge.types\";\n\nregisterCardComponent({\n name: BADGE_CARD,\n component: BadgeComponent,\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Card as e } from "@pihanga2/core";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/cards/box/box.component.tsx
|
|
5
|
+
var r = (r) => {
|
|
6
|
+
let { content: i, className: a, style: o, cardName: s } = r, c = {};
|
|
7
|
+
r.height && (c.height = `${r.height}px`), r.width && (c.height = `${r.width}px`), r.marginTop && (c["margin-top"] = `${r.marginTop}px`), r.marginBottom && (c["margin-bottom"] = `${r.marginBottom}px`), r.marginLeft && (c["margin-ledt"] = `${r.marginLeft}px`), r.marginRight && (c["margin-right"] = `${r.marginRight}px`), r.paddingTop && (c["padding-top"] = `${r.paddingTop}px`), r.paddingBottom && (c["padding-bottom"] = `${r.paddingBottom}px`), r.paddingLeft && (c["padding-ledt"] = `${r.paddingLeft}px`), r.paddingRight && (c["padding-right"] = `${r.paddingRight}px`), c = { ...o?.shad };
|
|
8
|
+
function l() {
|
|
9
|
+
return i ? i.map((n, r) => /* @__PURE__ */ t(e, {
|
|
10
|
+
cardName: n,
|
|
11
|
+
parentCard: s
|
|
12
|
+
}, r)) : null;
|
|
13
|
+
}
|
|
14
|
+
return /* @__PURE__ */ n("div", {
|
|
15
|
+
className: a,
|
|
16
|
+
style: c,
|
|
17
|
+
"data-pihanga": s,
|
|
18
|
+
children: [l(), r.children]
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { r as BoxComponent };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=box.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box.component.js","names":[],"sources":["../../../src/cards/box/box.component.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport type {BoxProps} from \"./box.types\";\n\nexport const BoxComponent = (props: PiCardProps<BoxProps>): React.ReactNode => {\n const {content, className, style, cardName} = props;\n\n let sy: Record<string, string | number> = {};\n if (props.height) sy.height = `${props.height}px`;\n if (props.width) sy.height = `${props.width}px`;\n\n if (props.marginTop) sy[\"margin-top\"] = `${props.marginTop}px`;\n if (props.marginBottom) sy[\"margin-bottom\"] = `${props.marginBottom}px`;\n if (props.marginLeft) sy[\"margin-ledt\"] = `${props.marginLeft}px`;\n if (props.marginRight) sy[\"margin-right\"] = `${props.marginRight}px`;\n\n if (props.paddingTop) sy[\"padding-top\"] = `${props.paddingTop}px`;\n if (props.paddingBottom) sy[\"padding-bottom\"] = `${props.paddingBottom}px`;\n if (props.paddingLeft) sy[\"padding-ledt\"] = `${props.paddingLeft}px`;\n if (props.paddingRight) sy[\"padding-right\"] = `${props.paddingRight}px`;\n\n sy = {\n ...(style as {shad?: Record<string, string | number>} | undefined)?.shad,\n };\n\n function renderContent() {\n if (!content) return null;\n return content.map((cn, i) => (\n <Card cardName={cn} parentCard={cardName} key={i} />\n ));\n }\n\n return (\n <div className={className} style={sy} data-pihanga={cardName}>\n {renderContent()}\n {props.children}\n </div>\n );\n};\n"],"mappings":";;;;AAKA,IAAa,KAAgB,MAAkD;CAC7E,IAAM,EAAC,YAAS,cAAW,UAAO,gBAAY,GAE1C,IAAsC,CAAC;CAc3C,AAbI,EAAM,WAAQ,EAAG,SAAS,GAAG,EAAM,OAAO,MAC1C,EAAM,UAAO,EAAG,SAAS,GAAG,EAAM,MAAM,MAExC,EAAM,cAAW,EAAG,gBAAgB,GAAG,EAAM,UAAU,MACvD,EAAM,iBAAc,EAAG,mBAAmB,GAAG,EAAM,aAAa,MAChE,EAAM,eAAY,EAAG,iBAAiB,GAAG,EAAM,WAAW,MAC1D,EAAM,gBAAa,EAAG,kBAAkB,GAAG,EAAM,YAAY,MAE7D,EAAM,eAAY,EAAG,iBAAiB,GAAG,EAAM,WAAW,MAC1D,EAAM,kBAAe,EAAG,oBAAoB,GAAG,EAAM,cAAc,MACnE,EAAM,gBAAa,EAAG,kBAAkB,GAAG,EAAM,YAAY,MAC7D,EAAM,iBAAc,EAAG,mBAAmB,GAAG,EAAM,aAAa,MAEpE,IAAK,EACH,GAAI,GAAgE,KACtE;CAEA,SAAS,IAAgB;EAEvB,OADK,IACE,EAAQ,KAAK,GAAI,MACtB,kBAAC,GAAD;GAAM,UAAU;GAAI,YAAY;EAAmB,GAAJ,CAAI,CACpD,IAHoB;CAIvB;CAEA,OACE,kBAAC,OAAD;EAAgB;EAAW,OAAO;EAAI,gBAAc;YAApD,CACG,EAAc,GACd,EAAM,QACJ;;AAET"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { PiCardRef } from '@pihanga2/core';
|
|
2
|
+
export declare const BOX_CARD = "shad/box";
|
|
3
|
+
/**
|
|
4
|
+
* CSS `align-items` values supported by the Box card.
|
|
5
|
+
*/
|
|
6
|
+
export type AlignItemsT = "normal" | "stretch" | "center" | "flex-start" | "flex-end" | "start" | "end" | "baseline" | "initial" | "inherit";
|
|
7
|
+
/**
|
|
8
|
+
* Responsive display grid breakpoints.
|
|
9
|
+
*
|
|
10
|
+
* Each key maps to a CSS display value applied at that viewport width:
|
|
11
|
+
* - `xs`: < 640 px (default / mobile-first)
|
|
12
|
+
* - `sm`: ≥ 640 px
|
|
13
|
+
* - `md`: ≥ 768 px
|
|
14
|
+
* - `lg`: ≥ 1024 px
|
|
15
|
+
* - `xl`: ≥ 1280 px
|
|
16
|
+
* - `xxl`: ≥ 1536 px
|
|
17
|
+
*/
|
|
18
|
+
export type DisplayGridT = {
|
|
19
|
+
xs?: string;
|
|
20
|
+
sm?: string;
|
|
21
|
+
md?: string;
|
|
22
|
+
lg?: string;
|
|
23
|
+
xl?: string;
|
|
24
|
+
xxl?: string;
|
|
25
|
+
};
|
|
26
|
+
export type BoxProps<S = object> = {
|
|
27
|
+
/** Child card refs rendered inside the box */
|
|
28
|
+
content?: PiCardRef[];
|
|
29
|
+
/** Override the root element type */
|
|
30
|
+
component?: React.ElementType;
|
|
31
|
+
/** Fixed height in pixels */
|
|
32
|
+
height?: number;
|
|
33
|
+
/** Fixed width in pixels */
|
|
34
|
+
width?: number;
|
|
35
|
+
marginTop?: number;
|
|
36
|
+
marginBottom?: number;
|
|
37
|
+
marginLeft?: number;
|
|
38
|
+
marginRight?: number;
|
|
39
|
+
paddingTop?: number;
|
|
40
|
+
paddingBottom?: number;
|
|
41
|
+
paddingLeft?: number;
|
|
42
|
+
paddingRight?: number;
|
|
43
|
+
alignItems?: AlignItemsT;
|
|
44
|
+
/** Tailwind gap spacing units */
|
|
45
|
+
gap?: number;
|
|
46
|
+
/** Uniform padding in pixels */
|
|
47
|
+
padding?: number;
|
|
48
|
+
/** Responsive display grid breakpoints */
|
|
49
|
+
display?: DisplayGridT;
|
|
50
|
+
/** Card style object (use the `shad` key for Tailwind-compatible overrides) */
|
|
51
|
+
style?: S;
|
|
52
|
+
/** Additional Tailwind utility classes */
|
|
53
|
+
className?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Factory function for declaring a `shad/box` card instance.
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import {registerCard} from "@pihanga2/core";
|
|
60
|
+
* import {Box} from "@/cards/box";
|
|
61
|
+
*
|
|
62
|
+
* registerCard("myApp/spacer", Box({height: 24}));
|
|
63
|
+
*
|
|
64
|
+
* registerCard("myApp/contentRegion", Box({
|
|
65
|
+
* content: ["myApp/card1", "myApp/card2"],
|
|
66
|
+
* paddingTop: 16,
|
|
67
|
+
* className: "rounded-lg border bg-card",
|
|
68
|
+
* }));
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare const Box: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<BoxProps<object>, S, {}>) => import('@pihanga2/core').PiCardDef;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box.types.js","names":[],"sources":["../../../src/cards/box/box.types.ts"],"sourcesContent":["import {type PiCardRef, createCardDeclaration} from \"@pihanga2/core\";\n\nexport const BOX_CARD = \"shad/box\";\n\n/**\n * CSS `align-items` values supported by the Box card.\n */\nexport type AlignItemsT =\n | \"normal\"\n | \"stretch\"\n | \"center\"\n | \"flex-start\"\n | \"flex-end\"\n | \"start\"\n | \"end\"\n | \"baseline\"\n | \"initial\"\n | \"inherit\";\n\n/**\n * Responsive display grid breakpoints.\n *\n * Each key maps to a CSS display value applied at that viewport width:\n * - `xs`: < 640 px (default / mobile-first)\n * - `sm`: ≥ 640 px\n * - `md`: ≥ 768 px\n * - `lg`: ≥ 1024 px\n * - `xl`: ≥ 1280 px\n * - `xxl`: ≥ 1536 px\n */\nexport type DisplayGridT = {\n xs?: string;\n sm?: string;\n md?: string;\n lg?: string;\n xl?: string;\n xxl?: string;\n};\n\nexport type BoxProps<S = object> = {\n /** Child card refs rendered inside the box */\n content?: PiCardRef[];\n\n /** Override the root element type */\n component?: React.ElementType;\n\n /** Fixed height in pixels */\n height?: number;\n /** Fixed width in pixels */\n width?: number;\n\n marginTop?: number;\n marginBottom?: number;\n marginLeft?: number;\n marginRight?: number;\n\n paddingTop?: number;\n paddingBottom?: number;\n paddingLeft?: number;\n paddingRight?: number;\n\n alignItems?: AlignItemsT;\n /** Tailwind gap spacing units */\n gap?: number;\n /** Uniform padding in pixels */\n padding?: number;\n /** Responsive display grid breakpoints */\n display?: DisplayGridT;\n\n /** Card style object (use the `shad` key for Tailwind-compatible overrides) */\n style?: S;\n /** Additional Tailwind utility classes */\n className?: string;\n};\n\n/**\n * Factory function for declaring a `shad/box` card instance.\n *\n * ```ts\n * import {registerCard} from \"@pihanga2/core\";\n * import {Box} from \"@/cards/box\";\n *\n * registerCard(\"myApp/spacer\", Box({height: 24}));\n *\n * registerCard(\"myApp/contentRegion\", Box({\n * content: [\"myApp/card1\", \"myApp/card2\"],\n * paddingTop: 16,\n * className: \"rounded-lg border bg-card\",\n * }));\n * ```\n */\nexport const Box = createCardDeclaration<BoxProps>(BOX_CARD);\n"],"mappings":";;AAEA,IAAa,IAAW,YAyFX,IAAM,EAAgC,CAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './box.types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BoxComponent as e } from "./box.component.js";
|
|
2
|
+
import { BOX_CARD as t, Box as n } from "./box.types.js";
|
|
3
|
+
import { registerCardComponent as r } from "@pihanga2/core";
|
|
4
|
+
//#region src/cards/box/index.ts
|
|
5
|
+
r({
|
|
6
|
+
name: t,
|
|
7
|
+
component: e
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as BOX_CARD, n as Box };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/box/index.ts"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\n\nimport {BoxComponent} from \"./box.component\";\nimport {BOX_CARD} from \"./box.types\";\n\nexport * from \"./box.types\";\n\nregisterCardComponent({\n name: BOX_CARD,\n component: BoxComponent,\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Button as e, LinkButton as t } from "../../components/ui/button.js";
|
|
2
|
+
import { Tooltip as n, TooltipContent as r, TooltipTrigger as i } from "../../components/ui/tooltip.js";
|
|
3
|
+
import { getIcon as a } from "../icons.js";
|
|
4
|
+
import { useDropdownOpen as o } from "../dropDownMenu/dropdown-context.js";
|
|
5
|
+
import { Card as s } from "@pihanga2/core";
|
|
6
|
+
import "react";
|
|
7
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
//#region src/cards/button/button.component.tsx
|
|
9
|
+
function d(e) {
|
|
10
|
+
return e ? a(e) : null;
|
|
11
|
+
}
|
|
12
|
+
var f = (a) => {
|
|
13
|
+
let { opts: f, ariaLabel: p, label: m, iconLabel: h, contentCard: g, href: _, target: v, tooltip: y, tooltipCard: b, tooltipMode: x, tooltipPlacement: S, className: C, id: w, onClicked: T, cardName: E, _cls: D, active: O, focused: k, disabled: A, loading: j, isPending: M } = a, N = o(), P = d(f?.beforeIcon), F = d(f?.afterIcon), I = /* @__PURE__ */ u(c, { children: [
|
|
14
|
+
P,
|
|
15
|
+
h ? d(h) : g ? /* @__PURE__ */ l(s, {
|
|
16
|
+
cardName: g,
|
|
17
|
+
parentCard: E
|
|
18
|
+
}) : m,
|
|
19
|
+
F
|
|
20
|
+
] }), L = {
|
|
21
|
+
active: O,
|
|
22
|
+
focused: k,
|
|
23
|
+
isMenu: f?.isMenu,
|
|
24
|
+
truncate: f?.truncate,
|
|
25
|
+
variant: f?.variant,
|
|
26
|
+
size: f?.size,
|
|
27
|
+
disabled: A,
|
|
28
|
+
loading: j,
|
|
29
|
+
isPending: M,
|
|
30
|
+
loadingClassName: f?.loadingClassName,
|
|
31
|
+
className: `${D("root")} ${C || ""}`.trim()
|
|
32
|
+
}, R = () => {
|
|
33
|
+
T({ id: w });
|
|
34
|
+
}, z = () => _ ? /* @__PURE__ */ l(t, {
|
|
35
|
+
...L,
|
|
36
|
+
href: _,
|
|
37
|
+
target: v,
|
|
38
|
+
"data-pihanga": E,
|
|
39
|
+
label: p ?? m,
|
|
40
|
+
onClick: R,
|
|
41
|
+
children: I
|
|
42
|
+
}) : /* @__PURE__ */ l(e, {
|
|
43
|
+
...L,
|
|
44
|
+
"data-pihanga": E,
|
|
45
|
+
label: p ?? m,
|
|
46
|
+
onClick: R,
|
|
47
|
+
children: I
|
|
48
|
+
});
|
|
49
|
+
if (!y && !b) return z();
|
|
50
|
+
let B = N ? !1 : x === "open" ? !0 : x === "closed" ? !1 : void 0, V = b ? /* @__PURE__ */ l(s, {
|
|
51
|
+
cardName: b,
|
|
52
|
+
parentCard: E
|
|
53
|
+
}) : /* @__PURE__ */ l("p", {
|
|
54
|
+
"data-pihanga": `${E}-tooltip`,
|
|
55
|
+
children: y
|
|
56
|
+
});
|
|
57
|
+
return /* @__PURE__ */ u(n, {
|
|
58
|
+
open: B,
|
|
59
|
+
children: [/* @__PURE__ */ l(i, {
|
|
60
|
+
asChild: !0,
|
|
61
|
+
children: z()
|
|
62
|
+
}), /* @__PURE__ */ l(r, {
|
|
63
|
+
side: S,
|
|
64
|
+
children: V
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { f as ButtonComponent };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=button.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.component.js","names":[],"sources":["../../../src/cards/button/button.component.tsx"],"sourcesContent":["import React from \"react\";\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\n\nimport {Button, LinkButton} from \"@/registry/ui/button\";\nimport {Tooltip, TooltipContent, TooltipTrigger} from \"@/registry/ui/tooltip\";\nimport {getIcon} from \"@/cards/icons\";\nimport {useDropdownOpen} from \"@/cards/dropDownMenu/dropdown-context\";\n\nimport type {PiButtonEvents, PiButtonProps} from \"./button.types\";\n\nfunction resolveIconByName(name?: string): React.ReactNode {\n if (!name) return null;\n return getIcon(name);\n}\n\nexport const ButtonComponent = (\n props: PiCardProps<PiButtonProps, PiButtonEvents>,\n): React.ReactNode => {\n const {\n opts,\n ariaLabel,\n label,\n iconLabel,\n contentCard: content,\n href,\n target,\n tooltip,\n tooltipCard,\n tooltipMode,\n tooltipPlacement,\n className,\n id,\n onClicked,\n cardName,\n _cls,\n active,\n focused,\n disabled,\n loading,\n isPending,\n } = props;\n\n // Check if this button is inside an open dropdown menu\n const isInsideOpenDropdown = useDropdownOpen();\n\n const beforeIcon = resolveIconByName(opts?.beforeIcon);\n const afterIcon = resolveIconByName(opts?.afterIcon);\n\n // Determine base content: iconLabel takes precedence, then contentCard, then label\n const baseContent = iconLabel ? (\n resolveIconByName(iconLabel)\n ) : content ? (\n <Card cardName={content} parentCard={cardName} />\n ) : (\n label\n );\n\n // Render icons as children following shadcn/ui pattern\n const children = (\n <>\n {beforeIcon}\n {baseContent}\n {afterIcon}\n </>\n );\n\n const common = {\n active,\n focused,\n isMenu: opts?.isMenu,\n truncate: opts?.truncate,\n variant: opts?.variant,\n size: opts?.size,\n\n disabled,\n loading,\n isPending,\n loadingClassName: opts?.loadingClassName,\n\n className: `${_cls(\"root\")} ${className || \"\"}`.trim(),\n };\n\n const handleClick = () => {\n onClicked({id});\n };\n\n const renderButton = () => {\n if (href) {\n return (\n <LinkButton\n {...common}\n href={href}\n target={target}\n data-pihanga={cardName}\n label={ariaLabel ?? label}\n onClick={handleClick}\n >\n {children}\n </LinkButton>\n );\n }\n\n return (\n <Button\n {...common}\n data-pihanga={cardName}\n label={ariaLabel ?? label}\n onClick={handleClick}\n >\n {children}\n </Button>\n );\n };\n\n if (!tooltip && !tooltipCard) return renderButton();\n\n // Determine tooltip open state based on mode.\n // If the button is inside an open dropdown, force the tooltip closed\n // to avoid UI conflicts (dropdown menu should take precedence).\n const tooltipOpen = isInsideOpenDropdown\n ? false\n : tooltipMode === \"open\"\n ? true\n : tooltipMode === \"closed\"\n ? false\n : undefined; // 'auto' or undefined = uncontrolled\n\n // Render tooltip content: use tooltipCard if provided, otherwise use tooltip string\n const tooltipContent = tooltipCard ? (\n <Card cardName={tooltipCard} parentCard={cardName} />\n ) : (\n <p data-pihanga={`${cardName}-tooltip`}>{tooltip}</p>\n );\n\n return (\n <Tooltip open={tooltipOpen}>\n <TooltipTrigger asChild>{renderButton()}</TooltipTrigger>\n <TooltipContent side={tooltipPlacement}>{tooltipContent}</TooltipContent>\n </Tooltip>\n );\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,EAAkB,GAAgC;CAEzD,OADK,IACE,EAAQ,CAAI,IADD;AAEpB;AAEA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,SACA,cACA,UACA,cACA,aAAa,GACb,SACA,WACA,YACA,gBACA,gBACA,qBACA,cACA,OACA,cACA,aACA,SACA,WACA,YACA,aACA,YACA,iBACE,GAGE,IAAuB,EAAgB,GAEvC,IAAa,EAAkB,GAAM,UAAU,GAC/C,IAAY,EAAkB,GAAM,SAAS,GAY7C,IACJ,kBAAA,GAAA,EAAA,UAAA;EACG;EAXe,IAClB,EAAkB,CAAS,IACzB,IACF,kBAAC,GAAD;GAAM,UAAU;GAAS,YAAY;EAAW,CAAA,IAEhD;EAQG;CACD,EAAA,CAAA,GAGE,IAAS;EACb;EACA;EACA,QAAQ,GAAM;EACd,UAAU,GAAM;EAChB,SAAS,GAAM;EACf,MAAM,GAAM;EAEZ;EACA;EACA;EACA,kBAAkB,GAAM;EAExB,WAAW,GAAG,EAAK,MAAM,EAAE,GAAG,KAAa,KAAK,KAAK;CACvD,GAEM,UAAoB;EACxB,EAAU,EAAC,MAAE,CAAC;CAChB,GAEM,UACA,IAEA,kBAAC,GAAD;EACE,GAAI;EACE;EACE;EACR,gBAAc;EACd,OAAO,KAAa;EACpB,SAAS;EAER;CACS,CAAA,IAKd,kBAAC,GAAD;EACE,GAAI;EACJ,gBAAc;EACd,OAAO,KAAa;EACpB,SAAS;EAER;CACK,CAAA;CAIZ,IAAI,CAAC,KAAW,CAAC,GAAa,OAAO,EAAa;CAKlD,IAAM,IAAc,IAChB,KACA,MAAgB,SACd,KACA,MAAgB,WACd,KACA,KAAA,GAGF,IAAiB,IACrB,kBAAC,GAAD;EAAM,UAAU;EAAa,YAAY;CAAW,CAAA,IAEpD,kBAAC,KAAD;EAAG,gBAAc,GAAG,EAAS;YAAY;CAAW,CAAA;CAGtD,OACE,kBAAC,GAAD;EAAS,MAAM;YAAf,CACE,kBAAC,GAAD;GAAgB,SAAA;aAAS,EAAa;EAAkB,CAAA,GACxD,kBAAC,GAAD;GAAgB,MAAM;aAAmB;EAA+B,CAAA,CACjE;;AAEb"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { PiCardRef } from '@pihanga2/core';
|
|
2
|
+
export declare const PI_BUTTON_CARD = "pi/button";
|
|
3
|
+
export declare const Button: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<PiButtonProps, S, PiButtonEvents>) => import('@pihanga2/core').PiCardDef;
|
|
4
|
+
export declare const PI_BUTTON_ACTION: {
|
|
5
|
+
CLICKED: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const onPiButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').PiRegister, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
|
+
cardID: string;
|
|
9
|
+
} & PiButtonClickedEvent>) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Declarative "opts" subset based on `src/registry/ui/button.tsx`.
|
|
12
|
+
*
|
|
13
|
+
* Notes:
|
|
14
|
+
* - Any icon is referenced by name and resolved via `src/pihanga/icons.ts`.
|
|
15
|
+
* - `children` are provided via `label` (simple) or `content` (card ref).
|
|
16
|
+
*/
|
|
17
|
+
export type PiButtonOpts = {
|
|
18
|
+
/**
|
|
19
|
+
* Visual style variant of the button.
|
|
20
|
+
* Determines the button's appearance (colors, borders, etc.).
|
|
21
|
+
*/
|
|
22
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "ghost2" | "ghost3" | "ghostActive" | "brand" | "nav" | "navAction" | "menuAction" | "blockAction" | "blockActionSecondary" | "primaryOutline" | "radio" | "none";
|
|
23
|
+
/**
|
|
24
|
+
* Size of the button.
|
|
25
|
+
* Controls padding, font size, and overall dimensions.
|
|
26
|
+
*/
|
|
27
|
+
size?: "default" | "xs" | "sm" | "md" | "lg" | "icon" | "iconSm" | "navAction" | "menuAction" | "blockAction" | "none";
|
|
28
|
+
/** Truncate button content with ellipsis if it overflows. */
|
|
29
|
+
truncate?: boolean;
|
|
30
|
+
/** If true, button is rendered as a menu trigger button. */
|
|
31
|
+
isMenu?: boolean;
|
|
32
|
+
/** Custom CSS class to apply to the loading spinner/indicator. */
|
|
33
|
+
loadingClassName?: string;
|
|
34
|
+
/** Icon to display before the button content. Set 'size' to 'icon' if ONLY show icon */
|
|
35
|
+
beforeIcon?: string;
|
|
36
|
+
/** Icon to display after the button content */
|
|
37
|
+
afterIcon?: string;
|
|
38
|
+
};
|
|
39
|
+
export type PiButtonProps = {
|
|
40
|
+
id?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Optional explicit aria-label.
|
|
43
|
+
*
|
|
44
|
+
* Useful for icon-only / letter-only buttons where the visible content
|
|
45
|
+
* shouldn't be used as the accessible name.
|
|
46
|
+
*/
|
|
47
|
+
ariaLabel?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Declarative options; maps closely to `@/registry/ui/button`.
|
|
50
|
+
*/
|
|
51
|
+
opts?: PiButtonOpts;
|
|
52
|
+
/** Simple label; used as children and aria-label fallback. */
|
|
53
|
+
label?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Icon name to use as the main button content (instead of text label).
|
|
56
|
+
* Resolved via `src/pihanga/icons.ts`.
|
|
57
|
+
* Takes precedence over `label` and `contentCard`.
|
|
58
|
+
*/
|
|
59
|
+
iconLabel?: string;
|
|
60
|
+
/**
|
|
61
|
+
* If set, renders this card as the content instead of `label`.
|
|
62
|
+
* (Useful for rich content.)
|
|
63
|
+
*/
|
|
64
|
+
contentCard?: PiCardRef;
|
|
65
|
+
/** When provided, button will render as an anchor. */
|
|
66
|
+
href?: string;
|
|
67
|
+
target?: string;
|
|
68
|
+
tooltip?: string;
|
|
69
|
+
/**
|
|
70
|
+
* If set, renders this card as the tooltip content instead of `tooltip`.
|
|
71
|
+
* (Useful for rich tooltip content.)
|
|
72
|
+
*/
|
|
73
|
+
tooltipCard?: PiCardRef;
|
|
74
|
+
/**
|
|
75
|
+
* Controls tooltip visibility mode.
|
|
76
|
+
* - 'auto' (default): Normal hover behavior
|
|
77
|
+
* - 'open': Force tooltip to be visible
|
|
78
|
+
* - 'closed': Force tooltip to be hidden
|
|
79
|
+
*/
|
|
80
|
+
tooltipMode?: "auto" | "open" | "closed";
|
|
81
|
+
/**
|
|
82
|
+
* Controls tooltip placement/position.
|
|
83
|
+
* - 'top': Tooltip appears above the button (default)
|
|
84
|
+
* - 'right': Tooltip appears to the right of the button
|
|
85
|
+
* - 'bottom': Tooltip appears below the button
|
|
86
|
+
* - 'left': Tooltip appears to the left of the button
|
|
87
|
+
*/
|
|
88
|
+
tooltipPlacement?: "top" | "right" | "bottom" | "left";
|
|
89
|
+
/** Indicates whether the button is in an active/selected state. */
|
|
90
|
+
active?: boolean;
|
|
91
|
+
/** Indicates whether the button has focus state styling applied. */
|
|
92
|
+
focused?: boolean;
|
|
93
|
+
/** If true, disables the button and prevents interaction. */
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
/** If true, shows loading state and typically disables interaction. */
|
|
96
|
+
loading?: boolean;
|
|
97
|
+
/** If true, indicates an async operation is pending (similar to loading but distinct). */
|
|
98
|
+
isPending?: boolean;
|
|
99
|
+
className?: string;
|
|
100
|
+
};
|
|
101
|
+
export type PiButtonClickedEvent = {
|
|
102
|
+
id?: string;
|
|
103
|
+
};
|
|
104
|
+
export type PiButtonEvents = {
|
|
105
|
+
onClicked: PiButtonClickedEvent;
|
|
106
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createCardDeclaration as e, createOnAction as t, registerActions as n } from "@pihanga2/core";
|
|
2
|
+
//#region src/cards/button/button.types.ts
|
|
3
|
+
var r = "pi/button", i = e(r), a = n(r, ["clicked"]), o = t(a.CLICKED);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { i as Button, a as PI_BUTTON_ACTION, r as PI_BUTTON_CARD, o as onPiButtonClicked };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=button.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.types.js","names":[],"sources":["../../../src/cards/button/button.types.ts"],"sourcesContent":["import {\n createCardDeclaration,\n createOnAction,\n PiCardRef,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const PI_BUTTON_CARD = \"pi/button\";\n\nexport const Button = createCardDeclaration<PiButtonProps, PiButtonEvents>(\n PI_BUTTON_CARD,\n);\n\nexport const PI_BUTTON_ACTION = registerActions(PI_BUTTON_CARD, [\"clicked\"]);\n\nexport const onPiButtonClicked = createOnAction<PiButtonClickedEvent>(\n PI_BUTTON_ACTION.CLICKED,\n);\n\n/**\n * Declarative \"opts\" subset based on `src/registry/ui/button.tsx`.\n *\n * Notes:\n * - Any icon is referenced by name and resolved via `src/pihanga/icons.ts`.\n * - `children` are provided via `label` (simple) or `content` (card ref).\n */\nexport type PiButtonOpts = {\n /**\n * Visual style variant of the button.\n * Determines the button's appearance (colors, borders, etc.).\n */\n variant?:\n | \"default\"\n | \"destructive\"\n | \"outline\"\n | \"secondary\"\n | \"ghost\"\n | \"ghost2\"\n | \"ghost3\"\n | \"ghostActive\"\n | \"brand\"\n | \"nav\"\n | \"navAction\"\n | \"menuAction\"\n | \"blockAction\"\n | \"blockActionSecondary\"\n | \"primaryOutline\"\n | \"radio\"\n | \"none\";\n\n /**\n * Size of the button.\n * Controls padding, font size, and overall dimensions.\n */\n size?:\n | \"default\"\n | \"xs\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"icon\"\n | \"iconSm\"\n | \"navAction\"\n | \"menuAction\"\n | \"blockAction\"\n | \"none\";\n\n /** Truncate button content with ellipsis if it overflows. */\n truncate?: boolean;\n\n /** If true, button is rendered as a menu trigger button. */\n isMenu?: boolean;\n\n /** Custom CSS class to apply to the loading spinner/indicator. */\n loadingClassName?: string;\n\n /** Icon to display before the button content. Set 'size' to 'icon' if ONLY show icon */\n beforeIcon?: string;\n\n /** Icon to display after the button content */\n afterIcon?: string;\n};\n\nexport type PiButtonProps = {\n id?: string; // optional 'id' to be added to events\n\n /**\n * Optional explicit aria-label.\n *\n * Useful for icon-only / letter-only buttons where the visible content\n * shouldn't be used as the accessible name.\n */\n ariaLabel?: string;\n\n /**\n * Declarative options; maps closely to `@/registry/ui/button`.\n */\n opts?: PiButtonOpts;\n\n /** Simple label; used as children and aria-label fallback. */\n label?: string;\n\n /**\n * Icon name to use as the main button content (instead of text label).\n * Resolved via `src/pihanga/icons.ts`.\n * Takes precedence over `label` and `contentCard`.\n */\n iconLabel?: string;\n\n /**\n * If set, renders this card as the content instead of `label`.\n * (Useful for rich content.)\n */\n contentCard?: PiCardRef;\n\n /** When provided, button will render as an anchor. */\n href?: string;\n target?: string;\n\n tooltip?: string;\n\n /**\n * If set, renders this card as the tooltip content instead of `tooltip`.\n * (Useful for rich tooltip content.)\n */\n tooltipCard?: PiCardRef;\n\n /**\n * Controls tooltip visibility mode.\n * - 'auto' (default): Normal hover behavior\n * - 'open': Force tooltip to be visible\n * - 'closed': Force tooltip to be hidden\n */\n tooltipMode?: \"auto\" | \"open\" | \"closed\";\n\n /**\n * Controls tooltip placement/position.\n * - 'top': Tooltip appears above the button (default)\n * - 'right': Tooltip appears to the right of the button\n * - 'bottom': Tooltip appears below the button\n * - 'left': Tooltip appears to the left of the button\n */\n tooltipPlacement?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\n /** Indicates whether the button is in an active/selected state. */\n active?: boolean;\n\n /** Indicates whether the button has focus state styling applied. */\n focused?: boolean;\n\n /** If true, disables the button and prevents interaction. */\n disabled?: boolean;\n\n /** If true, shows loading state and typically disables interaction. */\n loading?: boolean;\n\n /** If true, indicates an async operation is pending (similar to loading but distinct). */\n isPending?: boolean;\n\n className?: string;\n};\n\nexport type PiButtonClickedEvent = {\n id?: string;\n};\n\nexport type PiButtonEvents = {\n onClicked: PiButtonClickedEvent;\n};\n"],"mappings":";;AAOA,IAAa,IAAiB,aAEjB,IAAS,EACpB,CACF,GAEa,IAAmB,EAAgB,GAAgB,CAAC,SAAS,CAAC,GAE9D,IAAoB,EAC/B,EAAiB,OACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './button.types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ButtonComponent as e } from "./button.component.js";
|
|
2
|
+
import { Button as t, PI_BUTTON_ACTION as n, PI_BUTTON_CARD as r, onPiButtonClicked as i } from "./button.types.js";
|
|
3
|
+
import { actionTypesToEvents as a, registerCardComponent as o } from "@pihanga2/core";
|
|
4
|
+
//#region src/cards/button/index.ts
|
|
5
|
+
o({
|
|
6
|
+
name: r,
|
|
7
|
+
component: e,
|
|
8
|
+
events: a(n)
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as Button, n as PI_BUTTON_ACTION, r as PI_BUTTON_CARD, i as onPiButtonClicked };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/button/index.ts"],"sourcesContent":["import {actionTypesToEvents, registerCardComponent} from \"@pihanga2/core\";\n\nimport {ButtonComponent} from \"./button.component\";\nimport {PI_BUTTON_ACTION, PI_BUTTON_CARD} from \"./button.types\";\n\nexport * from \"./button.types\";\n\n// Optional convenience alias (mirrors older pattern like SdDropDownMenu)\n// export const SdButton = createCardDeclaration<PiButtonProps, PiButtonEvents>(\n// PI_BUTTON_CARD,\n// );\n\nregisterCardComponent({\n name: PI_BUTTON_CARD,\n component: ButtonComponent,\n events: actionTypesToEvents(PI_BUTTON_ACTION),\n});\n"],"mappings":";;;;AAYA,EAAsB;CACpB,MAAM;CACN,WAAW;CACX,QAAQ,EAAoB,CAAgB;AAC9C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PiCardProps } from '@pihanga2/core';
|
|
3
|
+
import { PiCheckboxEvents, PiCheckboxProps } from './checkbox.types';
|
|
4
|
+
export declare const CheckboxComponent: (props: PiCardProps<PiCheckboxProps, PiCheckboxEvents>) => React.ReactNode;
|