@pixpilot/shadcn-ui 0.1.0 → 0.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/dist/AbsoluteFill.cjs +24 -1
- package/dist/AbsoluteFill.d.ts +2 -2
- package/dist/AbsoluteFill.js +21 -1
- package/dist/Alert.cjs +81 -1
- package/dist/Alert.js +77 -1
- package/dist/Button.cjs +84 -1
- package/dist/Button.js +79 -1
- package/dist/CloseButtonAbsolute.cjs +20 -1
- package/dist/CloseButtonAbsolute.js +16 -1
- package/dist/CloseButtonRounded.cjs +22 -1
- package/dist/CloseButtonRounded.js +17 -1
- package/dist/Combobox.cjs +53 -1
- package/dist/Combobox.js +48 -1
- package/dist/CommandOptionList.cjs +29 -1
- package/dist/CommandOptionList.js +25 -1
- package/dist/ContentCard.cjs +27 -1
- package/dist/ContentCard.js +23 -1
- package/dist/DatePicker.cjs +38 -1
- package/dist/DatePicker.d.ts +2 -2
- package/dist/DatePicker.js +33 -1
- package/dist/LoadingOverlay.cjs +65 -1
- package/dist/LoadingOverlay.js +60 -1
- package/dist/Select.cjs +27 -1
- package/dist/Select.d.cts +2 -2
- package/dist/Select.d.ts +2 -2
- package/dist/Select.js +23 -1
- package/dist/Slider.cjs +19 -1
- package/dist/Slider.js +15 -1
- package/dist/ThemeToggle.cjs +98 -1
- package/dist/ThemeToggle.d.cts +2 -2
- package/dist/ThemeToggle.d.ts +2 -2
- package/dist/ThemeToggle.js +94 -1
- package/dist/_virtual/rolldown_runtime.cjs +44 -1
- package/dist/_virtual/rolldown_runtime.js +43 -0
- package/dist/confirmation-dialog/ConfirmationDialog.cjs +47 -1
- package/dist/confirmation-dialog/ConfirmationDialog.d.cts +1 -0
- package/dist/confirmation-dialog/ConfirmationDialog.js +43 -1
- package/dist/confirmation-dialog/DialogProvider.cjs +16 -1
- package/dist/confirmation-dialog/DialogProvider.js +12 -1
- package/dist/confirmation-dialog/confirmation-dialogs.cjs +14 -1
- package/dist/confirmation-dialog/confirmation-dialogs.js +12 -1
- package/dist/confirmation-dialog/index.cjs +7 -1
- package/dist/confirmation-dialog/index.js +6 -1
- package/dist/file-upload/FileUpload.cjs +68 -0
- package/dist/file-upload/FileUpload.d.cts +7 -0
- package/dist/file-upload/FileUpload.d.ts +7 -0
- package/dist/file-upload/FileUpload.js +63 -0
- package/dist/file-upload/FileUploadItems.cjs +36 -0
- package/dist/file-upload/FileUploadItems.js +32 -0
- package/dist/file-upload/FileUploadListItem.cjs +89 -0
- package/dist/file-upload/FileUploadListItem.js +83 -0
- package/dist/file-upload/hooks/index.cjs +4 -0
- package/dist/file-upload/hooks/index.d.cts +2 -0
- package/dist/file-upload/hooks/index.d.ts +2 -0
- package/dist/file-upload/hooks/index.js +3 -0
- package/dist/file-upload/hooks/use-file-error.cjs +15 -0
- package/dist/file-upload/hooks/use-file-error.js +14 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.cjs +34 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.d.cts +1 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.d.ts +1 -0
- package/dist/file-upload/hooks/use-file-upload-progress-callbacks.js +32 -0
- package/dist/file-upload/hooks/use-file-upload-store.cjs +77 -0
- package/dist/file-upload/hooks/use-file-upload-store.d.cts +2 -0
- package/dist/file-upload/hooks/use-file-upload-store.d.ts +2 -0
- package/dist/file-upload/hooks/use-file-upload-store.js +75 -0
- package/dist/file-upload/index.cjs +6 -0
- package/dist/file-upload/index.d.cts +3 -0
- package/dist/file-upload/index.d.ts +3 -0
- package/dist/file-upload/index.js +5 -0
- package/dist/file-upload/types/index.d.cts +40 -0
- package/dist/file-upload/types/index.d.ts +40 -0
- package/dist/file-upload/utils/create-placeholder-file.cjs +12 -0
- package/dist/file-upload/utils/create-placeholder-file.js +10 -0
- package/dist/file-upload/utils/get-file-key.cjs +9 -0
- package/dist/file-upload/utils/get-file-key.d.cts +1 -0
- package/dist/file-upload/utils/get-file-key.d.ts +1 -0
- package/dist/file-upload/utils/get-file-key.js +7 -0
- package/dist/file-upload/utils/get-file-meta.cjs +24 -0
- package/dist/file-upload/utils/get-file-meta.d.cts +1 -0
- package/dist/file-upload/utils/get-file-meta.d.ts +1 -0
- package/dist/file-upload/utils/get-file-meta.js +21 -0
- package/dist/file-upload/utils/index.d.cts +4 -0
- package/dist/file-upload/utils/index.d.ts +4 -0
- package/dist/file-upload/utils/is-file-equal.cjs +10 -0
- package/dist/file-upload/utils/is-file-equal.d.cts +1 -0
- package/dist/file-upload/utils/is-file-equal.d.ts +1 -0
- package/dist/file-upload/utils/is-file-equal.js +8 -0
- package/dist/file-upload/utils/merge-file-metadata.cjs +27 -0
- package/dist/file-upload/utils/merge-file-metadata.d.cts +1 -0
- package/dist/file-upload/utils/merge-file-metadata.d.ts +1 -0
- package/dist/file-upload/utils/merge-file-metadata.js +26 -0
- package/dist/file-upload-inline/FileUploadInline.cjs +71 -0
- package/dist/file-upload-inline/FileUploadInline.d.cts +10 -0
- package/dist/file-upload-inline/FileUploadInline.d.ts +10 -0
- package/dist/file-upload-inline/FileUploadInline.js +66 -0
- package/dist/file-upload-inline/FileUploadInlineItem.cjs +96 -0
- package/dist/file-upload-inline/FileUploadInlineItem.js +90 -0
- package/dist/file-upload-inline/defaults.cjs +12 -0
- package/dist/file-upload-inline/defaults.js +10 -0
- package/dist/file-upload-inline/index.cjs +2 -0
- package/dist/file-upload-inline/index.d.cts +2 -0
- package/dist/file-upload-inline/index.d.ts +2 -0
- package/dist/file-upload-inline/index.js +1 -0
- package/dist/file-upload-inline/types.d.cts +16 -0
- package/dist/file-upload-inline/types.d.ts +16 -0
- package/dist/file-upload-inline/utils.cjs +37 -0
- package/dist/file-upload-inline/utils.js +34 -0
- package/dist/hooks/index.cjs +2 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/use-media-query.cjs +9 -1
- package/dist/hooks/use-media-query.js +7 -1
- package/dist/icon-selector/IconPicker.cjs +93 -1
- package/dist/icon-selector/IconPicker.d.cts +3 -2
- package/dist/icon-selector/IconPicker.d.ts +3 -2
- package/dist/icon-selector/IconPicker.js +88 -1
- package/dist/icon-selector/constants.cjs +7 -1
- package/dist/icon-selector/constants.js +5 -0
- package/dist/icon-selector/icon-picker-container.cjs +35 -1
- package/dist/icon-selector/icon-picker-container.js +32 -1
- package/dist/icon-selector/icon-picker-content.cjs +146 -1
- package/dist/icon-selector/icon-picker-content.js +141 -1
- package/dist/icon-selector/index.cjs +2 -1
- package/dist/icon-selector/index.d.cts +1 -2
- package/dist/icon-selector/index.d.ts +1 -2
- package/dist/icon-selector/index.js +1 -1
- package/dist/icon-selector/types.d.cts +4 -2
- package/dist/icon-selector/types.d.ts +4 -2
- package/dist/icon-selector/use-async-providers.cjs +69 -1
- package/dist/icon-selector/use-async-providers.js +67 -1
- package/dist/icon-selector/utils/is-valid-provider.cjs +12 -1
- package/dist/icon-selector/utils/is-valid-provider.js +10 -1
- package/dist/icon-selector/virtualized-icon-grid.cjs +137 -1
- package/dist/icon-selector/virtualized-icon-grid.js +132 -1
- package/dist/index.cjs +76 -1
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +37 -1
- package/dist/node_modules/.pnpm/@diceui_shared@0.12.0_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@1_2c51ffe880f01dd537d5b6a13313daf4/node_modules/@diceui/shared/dist/index.cjs +558 -0
- package/dist/node_modules/.pnpm/@diceui_shared@0.12.0_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@1_2c51ffe880f01dd537d5b6a13313daf4/node_modules/@diceui/shared/dist/index.js +555 -0
- package/dist/node_modules/.pnpm/@diceui_tags-input@0.7.2_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__reac_e193dc2ff0d426ed009417f8d89778fd/node_modules/@diceui/tags-input/dist/index.cjs +566 -0
- package/dist/node_modules/.pnpm/@diceui_tags-input@0.7.2_@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__reac_e193dc2ff0d426ed009417f8d89778fd/node_modules/@diceui/tags-input/dist/index.js +565 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +695 -0
- package/dist/node_modules/.pnpm/@floating-ui_core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.js +679 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +521 -0
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +503 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +282 -0
- package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.6_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +266 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.esm.cjs +3767 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.esm.js +3747 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.utils.cjs +426 -0
- package/dist/node_modules/.pnpm/@floating-ui_react@0.27.16_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@floating-ui/react/dist/floating-ui.react.utils.js +379 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +165 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +175 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +151 -0
- package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +138 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.cjs +13 -0
- package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.js +11 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +33 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.js +30 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.cjs +92 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-context/dist/index.js +88 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react_4f1d9653b0e2175502748f45fd432185/node_modules/@radix-ui/react-dialog/dist/index.cjs +310 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react_4f1d9653b0e2175502748f45fd432185/node_modules/@radix-ui/react-dialog/dist/index.js +299 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +190 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +187 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +34 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.js +32 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +203 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9/node_modules/@radix-ui/react-focus-scope/dist/index.js +200 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.cjs +18 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-id/dist/index.js +16 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9/node_modules/@radix-ui/react-portal/dist/index.cjs +29 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9/node_modules/@radix-ui/react-portal/dist/index.js +25 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs +110 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.js +108 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596/node_modules/@radix-ui/react-primitive/dist/index.cjs +52 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596/node_modules/@radix-ui/react-primitive/dist/index.js +47 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs +92 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.3_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.js +89 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs +103 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-slot@1.2.4_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-slot/dist/index.js +100 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +15 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +13 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +64 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +62 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +19 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +17 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +9 -0
- package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +108 -0
- package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es5/index.cjs +155 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.cjs +19 -0
- package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/.pnpm/detect-node-es@1.1.0/node_modules/detect-node-es/es5/node.cjs +14 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +9 -0
- package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es5/index.cjs +22 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js +46 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +12 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/index.js +3 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +37 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es5/component.cjs +61 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es5/constants.cjs +23 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es5/index.cjs +57 -0
- package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll-bar/dist/es5/utils.cjs +49 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js +17 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +163 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/UI.js +64 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +16 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +85 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/medium.js +7 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js +9 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/Combination.cjs +29 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/SideEffect.cjs +179 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/UI.cjs +79 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/aggresiveCapture.cjs +27 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/handleScroll.cjs +98 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/index.cjs +19 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/medium.cjs +18 -0
- package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es5/sidecar.cjs +21 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/component.js +21 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/hook.js +27 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/index.js +3 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es2015/singleton.js +43 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es5/component.cjs +33 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es5/hook.cjs +40 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es5/index.cjs +39 -0
- package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0/node_modules/react-style-singleton/dist/es5/singleton.cjs +55 -0
- package/dist/node_modules/.pnpm/tabbable@6.3.0/node_modules/tabbable/dist/index.cjs +347 -0
- package/dist/node_modules/.pnpm/tabbable@6.3.0/node_modules/tabbable/dist/index.esm.js +268 -0
- package/dist/node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.cjs +1895 -0
- package/dist/node_modules/.pnpm/tailwind-merge@3.4.0/node_modules/tailwind-merge/dist/bundle-mjs.js +1893 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.cjs +557 -0
- package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +31 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.js +22 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +47 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/assignRef.cjs +34 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/createRef.cjs +39 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/index.cjs +85 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/mergeRef.cjs +40 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/refToCallback.cjs +59 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/transformRef.cjs +34 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/useMergeRef.cjs +61 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/useRef.cjs +53 -0
- package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0/node_modules/use-callback-ref/dist/es5/useTransformRef.cjs +38 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/exports.js +19 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es2015/medium.js +84 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/config.cjs +22 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/env.cjs +21 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/exports.cjs +31 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/hoc.cjs +31 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/hook.cjs +60 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/index.cjs +69 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/medium.cjs +101 -0
- package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0/node_modules/use-sidecar/dist/es5/renderProp.cjs +58 -0
- package/dist/packages/shadcn/src/components/index.cjs +6 -0
- package/dist/packages/shadcn/src/components/index.js +5 -0
- package/dist/packages/shadcn/src/components/ui/OrContinueWithSeparator.cjs +6 -0
- package/dist/packages/shadcn/src/components/ui/OrContinueWithSeparator.js +3 -0
- package/dist/packages/shadcn/src/components/ui/alert-dialog.cjs +10 -0
- package/dist/packages/shadcn/src/components/ui/alert-dialog.js +6 -0
- package/dist/packages/shadcn/src/components/ui/alert.cjs +44 -0
- package/dist/packages/shadcn/src/components/ui/alert.js +38 -0
- package/dist/packages/shadcn/src/components/ui/avatar.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/avatar.js +2 -0
- package/dist/packages/shadcn/src/components/ui/badge.cjs +20 -0
- package/dist/packages/shadcn/src/components/ui/badge.js +16 -0
- package/dist/packages/shadcn/src/components/ui/button.cjs +50 -0
- package/dist/packages/shadcn/src/components/ui/button.js +45 -0
- package/dist/packages/shadcn/src/components/ui/calendar.cjs +8 -0
- package/dist/packages/shadcn/src/components/ui/calendar.js +4 -0
- package/dist/packages/shadcn/src/components/ui/card.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/card.js +2 -0
- package/dist/packages/shadcn/src/components/ui/checkbox.cjs +10 -0
- package/dist/packages/shadcn/src/components/ui/checkbox.js +6 -0
- package/dist/packages/shadcn/src/components/ui/command.cjs +11 -0
- package/dist/packages/shadcn/src/components/ui/command.js +7 -0
- package/dist/packages/shadcn/src/components/ui/dialog.cjs +93 -0
- package/dist/packages/shadcn/src/components/ui/dialog.js +81 -0
- package/dist/packages/shadcn/src/components/ui/dropdown-menu.cjs +7 -0
- package/dist/packages/shadcn/src/components/ui/dropdown-menu.js +3 -0
- package/dist/packages/shadcn/src/components/ui/file-upload.cjs +49 -0
- package/dist/packages/shadcn/src/components/ui/file-upload.js +45 -0
- package/dist/packages/shadcn/src/components/ui/form.cjs +12 -0
- package/dist/packages/shadcn/src/components/ui/form.js +9 -0
- package/dist/packages/shadcn/src/components/ui/index.cjs +30 -0
- package/dist/packages/shadcn/src/components/ui/index.js +29 -0
- package/dist/packages/shadcn/src/components/ui/input.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/input.js +2 -0
- package/dist/packages/shadcn/src/components/ui/label.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/label.js +2 -0
- package/dist/packages/shadcn/src/components/ui/pagination.cjs +9 -0
- package/dist/packages/shadcn/src/components/ui/pagination.js +4 -0
- package/dist/packages/shadcn/src/components/ui/popover.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/popover.js +2 -0
- package/dist/packages/shadcn/src/components/ui/radio-group.cjs +7 -0
- package/dist/packages/shadcn/src/components/ui/radio-group.js +3 -0
- package/dist/packages/shadcn/src/components/ui/select.cjs +10 -0
- package/dist/packages/shadcn/src/components/ui/select.js +6 -0
- package/dist/packages/shadcn/src/components/ui/separator.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/separator.js +2 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags/index.cjs +26 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags/index.js +22 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags-input-inline/index.cjs +6 -0
- package/dist/packages/shadcn/src/components/ui/shadcn-io/tags-input-inline/index.js +3 -0
- package/dist/packages/shadcn/src/components/ui/sheet.cjs +7 -0
- package/dist/packages/shadcn/src/components/ui/sheet.js +3 -0
- package/dist/packages/shadcn/src/components/ui/slider.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/slider.js +2 -0
- package/dist/packages/shadcn/src/components/ui/switch.cjs +8 -0
- package/dist/packages/shadcn/src/components/ui/switch.js +5 -0
- package/dist/packages/shadcn/src/components/ui/tabs.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/tabs.js +2 -0
- package/dist/packages/shadcn/src/components/ui/textarea.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/textarea.js +2 -0
- package/dist/packages/shadcn/src/components/ui/tooltip.cjs +5 -0
- package/dist/packages/shadcn/src/components/ui/tooltip.js +2 -0
- package/dist/packages/shadcn/src/lib/utils.cjs +11 -0
- package/dist/packages/shadcn/src/lib/utils.js +10 -0
- package/dist/pagination/Pagination.cjs +156 -0
- package/dist/{Pagination → pagination}/Pagination.d.cts +1 -1
- package/dist/{Pagination → pagination}/Pagination.d.ts +1 -1
- package/dist/pagination/Pagination.js +151 -0
- package/dist/pagination/index.cjs +2 -0
- package/dist/pagination/index.js +1 -0
- package/dist/rich-text-editor/RichTextEditor.cjs +132 -0
- package/dist/rich-text-editor/RichTextEditor.d.cts +55 -0
- package/dist/rich-text-editor/RichTextEditor.d.ts +55 -0
- package/dist/rich-text-editor/RichTextEditor.js +126 -0
- package/dist/rich-text-editor/index.cjs +2 -0
- package/dist/rich-text-editor/index.d.cts +1 -0
- package/dist/rich-text-editor/index.d.ts +1 -0
- package/dist/rich-text-editor/index.js +1 -0
- package/dist/rich-text-editor/predefined-toolbar-options.cjs +84 -0
- package/dist/rich-text-editor/predefined-toolbar-options.js +81 -0
- package/dist/spinner/index.cjs +2 -1
- package/dist/spinner/index.js +1 -1
- package/dist/spinner/spinner.cjs +73 -6
- package/dist/spinner/spinner.js +70 -6
- package/dist/spinner/styles.cjs +25 -12
- package/dist/spinner/styles.js +23 -12
- package/dist/tags-input.cjs +226 -1
- package/dist/tags-input.d.cts +2 -2
- package/dist/tags-input.d.ts +2 -2
- package/dist/tags-input.js +222 -1
- package/dist/theme-provider/ThemeProvider.cjs +27 -1
- package/dist/theme-provider/ThemeProvider.js +23 -1
- package/dist/theme-provider/index.cjs +4 -1
- package/dist/theme-provider/index.js +4 -1
- package/dist/toast/AlertToast.cjs +36 -1
- package/dist/toast/AlertToast.js +31 -1
- package/dist/toast/index.cjs +2 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/toast.cjs +75 -1
- package/dist/toast/toast.js +66 -1
- package/package.json +11 -4
- package/dist/FileUploadInline.cjs +0 -1
- package/dist/FileUploadInline.d.cts +0 -75
- package/dist/FileUploadInline.d.ts +0 -75
- package/dist/FileUploadInline.js +0 -1
- package/dist/Pagination/Pagination.cjs +0 -1
- package/dist/Pagination/Pagination.js +0 -1
- package/dist/Pagination/index.cjs +0 -1
- package/dist/Pagination/index.js +0 -1
- package/dist/PopoverContent.cjs +0 -1
- package/dist/PopoverContent.d.cts +0 -8
- package/dist/PopoverContent.d.ts +0 -8
- package/dist/PopoverContent.js +0 -1
- package/dist/icon-selector/use-async-providers.d.cts +0 -14
- package/dist/icon-selector/use-async-providers.d.ts +0 -14
- package/dist/shadcn/src/components/ui/alert.cjs +0 -1
- package/dist/shadcn/src/components/ui/alert.js +0 -1
- package/dist/shadcn/src/components/ui/dialog.cjs +0 -1
- package/dist/shadcn/src/components/ui/dialog.js +0 -1
- package/dist/shadcn/src/lib/index.cjs +0 -1
- package/dist/shadcn/src/lib/index.js +0 -1
- package/dist/shadcn/src/lib/utils.cjs +0 -1
- package/dist/shadcn/src/lib/utils.js +0 -1
- /package/dist/{Pagination → pagination}/index.d.cts +0 -0
- /package/dist/{Pagination → pagination}/index.d.ts +0 -0
|
@@ -1 +1,93 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_Button = require('../Button.cjs');
|
|
3
|
+
const require_use_media_query = require('../hooks/use-media-query.cjs');
|
|
4
|
+
const require_constants = require('./constants.cjs');
|
|
5
|
+
const require_icon_picker_container = require('./icon-picker-container.cjs');
|
|
6
|
+
const require_icon_picker_content = require('./icon-picker-content.cjs');
|
|
7
|
+
require('../index.cjs');
|
|
8
|
+
let react = require("react");
|
|
9
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
10
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
12
|
+
let __iconify_react = require("@iconify/react");
|
|
13
|
+
__iconify_react = require_rolldown_runtime.__toESM(__iconify_react);
|
|
14
|
+
|
|
15
|
+
//#region src/icon-selector/IconPicker.tsx
|
|
16
|
+
const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popover, variant = "default", providers: providersProp }) => {
|
|
17
|
+
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
18
|
+
const isMobile = require_use_media_query.useMediaQuery({ maxWidth: 768 });
|
|
19
|
+
const handleSelectIcon = (0, react.useCallback)((iconName) => {
|
|
20
|
+
onChange?.(iconName);
|
|
21
|
+
setIsOpen(false);
|
|
22
|
+
onOpenChange?.(false);
|
|
23
|
+
}, [onChange, onOpenChange]);
|
|
24
|
+
const hasValue = typeof value === "string" && value.length > 0;
|
|
25
|
+
const displayIcon = hasValue ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__iconify_react.Icon, {
|
|
26
|
+
icon: value,
|
|
27
|
+
width: "20",
|
|
28
|
+
height: "20"
|
|
29
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
30
|
+
className: "text-sm text-muted-foreground",
|
|
31
|
+
children: "No icon selected"
|
|
32
|
+
});
|
|
33
|
+
const selectorContent = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icon_picker_content.default, {
|
|
34
|
+
providers: providersProp,
|
|
35
|
+
onChange: handleSelectIcon,
|
|
36
|
+
onSelect: () => setIsOpen(false)
|
|
37
|
+
});
|
|
38
|
+
if (providersProp.length === 0) if (process.env.NODE_ENV === "development") throw new Error(require_constants.ICON_SELECTOR_ERROR_MESSAGE);
|
|
39
|
+
else return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: "No icons configured" });
|
|
40
|
+
let effectiveMode;
|
|
41
|
+
if (pickerMode === "popover") effectiveMode = isMobile ? "dialog" : "popover";
|
|
42
|
+
else effectiveMode = pickerMode;
|
|
43
|
+
const isIconButtonVariant = variant === "icon-button";
|
|
44
|
+
const iconButtonLabel = hasValue ? `Change selected icon (${value})` : "Select an icon";
|
|
45
|
+
const iconButtonContent = hasValue ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__iconify_react.Icon, {
|
|
46
|
+
icon: value,
|
|
47
|
+
width: "20",
|
|
48
|
+
height: "20"
|
|
49
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
50
|
+
"aria-hidden": "true",
|
|
51
|
+
className: "text-muted-foreground text-lg",
|
|
52
|
+
children: "+"
|
|
53
|
+
});
|
|
54
|
+
if (isIconButtonVariant) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icon_picker_container.IconPickerContainer, {
|
|
55
|
+
effectiveMode,
|
|
56
|
+
isOpen,
|
|
57
|
+
setIsOpen,
|
|
58
|
+
selectorContent,
|
|
59
|
+
popover,
|
|
60
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
61
|
+
type: "button",
|
|
62
|
+
variant: "outline",
|
|
63
|
+
className: "p-2",
|
|
64
|
+
"aria-label": iconButtonLabel,
|
|
65
|
+
children: iconButtonContent
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
69
|
+
className: "flex items-center gap-2",
|
|
70
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
71
|
+
className: "flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2",
|
|
72
|
+
children: [displayIcon, hasValue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
73
|
+
className: "text-sm text-muted-foreground",
|
|
74
|
+
children: value
|
|
75
|
+
})]
|
|
76
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_icon_picker_container.IconPickerContainer, {
|
|
77
|
+
effectiveMode,
|
|
78
|
+
isOpen,
|
|
79
|
+
setIsOpen,
|
|
80
|
+
selectorContent,
|
|
81
|
+
popover,
|
|
82
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.Button, {
|
|
83
|
+
type: "button",
|
|
84
|
+
variant: "outline",
|
|
85
|
+
className: "whitespace-nowrap",
|
|
86
|
+
children: hasValue ? "Change Icon" : "Select Icon"
|
|
87
|
+
})
|
|
88
|
+
})]
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
exports.IconPicker = IconPicker;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconProvider } from "./types.cjs";
|
|
2
|
+
import "../index.cjs";
|
|
2
3
|
import { PopoverContent } from "@pixpilot/shadcn";
|
|
3
4
|
import { FC } from "react";
|
|
4
5
|
|
|
@@ -22,7 +23,7 @@ interface IconPickerProps {
|
|
|
22
23
|
pickerMode?: MountType;
|
|
23
24
|
popover?: Partial<React.ComponentProps<typeof PopoverContent>>;
|
|
24
25
|
variant?: IconPickerVariant;
|
|
25
|
-
providers:
|
|
26
|
+
providers: IconProvider[];
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
onProvidersLoaded?: (providers: Array<{
|
|
28
29
|
prefix: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IconProvider } from "./types.js";
|
|
2
|
+
import "../index.js";
|
|
2
3
|
import { PopoverContent } from "@pixpilot/shadcn";
|
|
3
4
|
import { FC } from "react";
|
|
4
5
|
|
|
@@ -22,7 +23,7 @@ interface IconPickerProps {
|
|
|
22
23
|
pickerMode?: MountType;
|
|
23
24
|
popover?: Partial<React.ComponentProps<typeof PopoverContent>>;
|
|
24
25
|
variant?: IconPickerVariant;
|
|
25
|
-
providers:
|
|
26
|
+
providers: IconProvider[];
|
|
26
27
|
isLoading?: boolean;
|
|
27
28
|
onProvidersLoaded?: (providers: Array<{
|
|
28
29
|
prefix: string;
|
|
@@ -1 +1,88 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { Button } from "../Button.js";
|
|
2
|
+
import { useMediaQuery } from "../hooks/use-media-query.js";
|
|
3
|
+
import { ICON_SELECTOR_ERROR_MESSAGE } from "./constants.js";
|
|
4
|
+
import { IconPickerContainer } from "./icon-picker-container.js";
|
|
5
|
+
import icon_picker_content_default from "./icon-picker-content.js";
|
|
6
|
+
import "../index.js";
|
|
7
|
+
import { useCallback, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Icon } from "@iconify/react";
|
|
10
|
+
|
|
11
|
+
//#region src/icon-selector/IconPicker.tsx
|
|
12
|
+
const IconPicker = ({ value, onChange, onOpenChange, pickerMode = "dialog", popover, variant = "default", providers: providersProp }) => {
|
|
13
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
14
|
+
const isMobile = useMediaQuery({ maxWidth: 768 });
|
|
15
|
+
const handleSelectIcon = useCallback((iconName) => {
|
|
16
|
+
onChange?.(iconName);
|
|
17
|
+
setIsOpen(false);
|
|
18
|
+
onOpenChange?.(false);
|
|
19
|
+
}, [onChange, onOpenChange]);
|
|
20
|
+
const hasValue = typeof value === "string" && value.length > 0;
|
|
21
|
+
const displayIcon = hasValue ? /* @__PURE__ */ jsx(Icon, {
|
|
22
|
+
icon: value,
|
|
23
|
+
width: "20",
|
|
24
|
+
height: "20"
|
|
25
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "text-sm text-muted-foreground",
|
|
27
|
+
children: "No icon selected"
|
|
28
|
+
});
|
|
29
|
+
const selectorContent = /* @__PURE__ */ jsx(icon_picker_content_default, {
|
|
30
|
+
providers: providersProp,
|
|
31
|
+
onChange: handleSelectIcon,
|
|
32
|
+
onSelect: () => setIsOpen(false)
|
|
33
|
+
});
|
|
34
|
+
if (providersProp.length === 0) throw new Error(ICON_SELECTOR_ERROR_MESSAGE);
|
|
35
|
+
let effectiveMode;
|
|
36
|
+
if (pickerMode === "popover") effectiveMode = isMobile ? "dialog" : "popover";
|
|
37
|
+
else effectiveMode = pickerMode;
|
|
38
|
+
const isIconButtonVariant = variant === "icon-button";
|
|
39
|
+
const iconButtonLabel = hasValue ? `Change selected icon (${value})` : "Select an icon";
|
|
40
|
+
const iconButtonContent = hasValue ? /* @__PURE__ */ jsx(Icon, {
|
|
41
|
+
icon: value,
|
|
42
|
+
width: "20",
|
|
43
|
+
height: "20"
|
|
44
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: "text-muted-foreground text-lg",
|
|
47
|
+
children: "+"
|
|
48
|
+
});
|
|
49
|
+
if (isIconButtonVariant) return /* @__PURE__ */ jsx(IconPickerContainer, {
|
|
50
|
+
effectiveMode,
|
|
51
|
+
isOpen,
|
|
52
|
+
setIsOpen,
|
|
53
|
+
selectorContent,
|
|
54
|
+
popover,
|
|
55
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
56
|
+
type: "button",
|
|
57
|
+
variant: "outline",
|
|
58
|
+
className: "p-2",
|
|
59
|
+
"aria-label": iconButtonLabel,
|
|
60
|
+
children: iconButtonContent
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: "flex items-center gap-2",
|
|
65
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: "flex items-center gap-2 rounded-md border border-input bg-background px-3 py-2",
|
|
67
|
+
children: [displayIcon, hasValue && /* @__PURE__ */ jsx("span", {
|
|
68
|
+
className: "text-sm text-muted-foreground",
|
|
69
|
+
children: value
|
|
70
|
+
})]
|
|
71
|
+
}), /* @__PURE__ */ jsx(IconPickerContainer, {
|
|
72
|
+
effectiveMode,
|
|
73
|
+
isOpen,
|
|
74
|
+
setIsOpen,
|
|
75
|
+
selectorContent,
|
|
76
|
+
popover,
|
|
77
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
78
|
+
type: "button",
|
|
79
|
+
variant: "outline",
|
|
80
|
+
className: "whitespace-nowrap",
|
|
81
|
+
children: hasValue ? "Change Icon" : "Select Icon"
|
|
82
|
+
})
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { IconPicker };
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/icon-selector/constants.ts
|
|
4
|
+
const ICON_SELECTOR_ERROR_MESSAGE = `IconSelector requires icon providers configured in <Form fields={{iconSelector: {providers: [{prefix, icons, name}, ...]}}}>`;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.ICON_SELECTOR_ERROR_MESSAGE = ICON_SELECTOR_ERROR_MESSAGE;
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
3
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
6
|
+
|
|
7
|
+
//#region src/icon-selector/icon-picker-container.tsx
|
|
8
|
+
const IconPickerContainer = ({ effectiveMode, isOpen, setIsOpen, selectorContent, children, popover }) => {
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [effectiveMode === "dialog" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Dialog, {
|
|
10
|
+
open: isOpen,
|
|
11
|
+
onOpenChange: setIsOpen,
|
|
12
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.DialogTrigger, {
|
|
13
|
+
asChild: true,
|
|
14
|
+
children
|
|
15
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.DialogContent, {
|
|
16
|
+
className: "max-h-[80vh] w-full overflow-hidden",
|
|
17
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.DialogHeader, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.DialogTitle, { children: "Select an Icon" }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: selectorContent })]
|
|
18
|
+
})]
|
|
19
|
+
}), effectiveMode === "popover" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Popover, {
|
|
20
|
+
open: isOpen,
|
|
21
|
+
onOpenChange: setIsOpen,
|
|
22
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverTrigger, {
|
|
23
|
+
asChild: true,
|
|
24
|
+
children
|
|
25
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.PopoverContent, {
|
|
26
|
+
side: "right",
|
|
27
|
+
...popover,
|
|
28
|
+
className: (0, __pixpilot_shadcn.cn)("w-full min-w-sm lg:min-w-lg p-4", "max-h-dvh md:max-h-auto", popover?.className),
|
|
29
|
+
children: selectorContent
|
|
30
|
+
})]
|
|
31
|
+
})] });
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
exports.IconPickerContainer = IconPickerContainer;
|
|
@@ -1 +1,32 @@
|
|
|
1
|
-
import{Dialog
|
|
1
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, Popover, PopoverContent, PopoverTrigger, cn } from "@pixpilot/shadcn";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/icon-selector/icon-picker-container.tsx
|
|
5
|
+
const IconPickerContainer = ({ effectiveMode, isOpen, setIsOpen, selectorContent, children, popover }) => {
|
|
6
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [effectiveMode === "dialog" && /* @__PURE__ */ jsxs(Dialog, {
|
|
7
|
+
open: isOpen,
|
|
8
|
+
onOpenChange: setIsOpen,
|
|
9
|
+
children: [/* @__PURE__ */ jsx(DialogTrigger, {
|
|
10
|
+
asChild: true,
|
|
11
|
+
children
|
|
12
|
+
}), /* @__PURE__ */ jsxs(DialogContent, {
|
|
13
|
+
className: "max-h-[80vh] w-full overflow-hidden",
|
|
14
|
+
children: [/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: "Select an Icon" }) }), /* @__PURE__ */ jsx("div", { children: selectorContent })]
|
|
15
|
+
})]
|
|
16
|
+
}), effectiveMode === "popover" && /* @__PURE__ */ jsxs(Popover, {
|
|
17
|
+
open: isOpen,
|
|
18
|
+
onOpenChange: setIsOpen,
|
|
19
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
20
|
+
asChild: true,
|
|
21
|
+
children
|
|
22
|
+
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
23
|
+
side: "right",
|
|
24
|
+
...popover,
|
|
25
|
+
className: cn("w-full min-w-sm lg:min-w-lg p-4", "max-h-dvh md:max-h-auto", popover?.className),
|
|
26
|
+
children: selectorContent
|
|
27
|
+
})]
|
|
28
|
+
})] });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { IconPickerContainer };
|
|
@@ -1 +1,146 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_LoadingOverlay = require('../LoadingOverlay.cjs');
|
|
3
|
+
const require_use_async_providers = require('./use-async-providers.cjs');
|
|
4
|
+
const require_virtualized_icon_grid = require('./virtualized-icon-grid.cjs');
|
|
5
|
+
let __pixpilot_shadcn = require("@pixpilot/shadcn");
|
|
6
|
+
__pixpilot_shadcn = require_rolldown_runtime.__toESM(__pixpilot_shadcn);
|
|
7
|
+
let lucide_react = require("lucide-react");
|
|
8
|
+
lucide_react = require_rolldown_runtime.__toESM(lucide_react);
|
|
9
|
+
let react = require("react");
|
|
10
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
11
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
12
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
13
|
+
|
|
14
|
+
//#region src/icon-selector/icon-picker-content.tsx
|
|
15
|
+
function noIconMessage(hasIcons, isSearching) {
|
|
16
|
+
if (hasIcons) return "";
|
|
17
|
+
if (!isSearching) return "No icons provided by the selected provider!";
|
|
18
|
+
return "No icons found matching your search";
|
|
19
|
+
}
|
|
20
|
+
const IconPickerContent = ({ providers: providersProp, onChange, onSelect, maxHeight = "60vh" }) => {
|
|
21
|
+
const [searchQuery, setSearchQuery] = (0, react.useState)("");
|
|
22
|
+
const { providers, isLoading } = require_use_async_providers.useAsyncProviders(providersProp);
|
|
23
|
+
const providerPrefixes = (0, react.useMemo)(() => providers.map((provider) => provider.prefix), [providers]);
|
|
24
|
+
const [activeProvider, setActiveProvider] = (0, react.useState)(providerPrefixes[0] ?? "default");
|
|
25
|
+
/**
|
|
26
|
+
* Sync activeProvider when providers load with delay
|
|
27
|
+
*/
|
|
28
|
+
(0, react.useEffect)(() => {
|
|
29
|
+
if (providerPrefixes.length > 0) setActiveProvider((current) => {
|
|
30
|
+
if (current === "default") return providerPrefixes[0] ?? "default";
|
|
31
|
+
return current;
|
|
32
|
+
});
|
|
33
|
+
}, [providerPrefixes]);
|
|
34
|
+
/**
|
|
35
|
+
* Get all icons for a provider
|
|
36
|
+
*/
|
|
37
|
+
const getProviderIcons = (0, react.useCallback)((provider) => {
|
|
38
|
+
try {
|
|
39
|
+
return provider.icons.map((iconName) => `${provider.prefix}:${iconName}`);
|
|
40
|
+
} catch {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
/**
|
|
45
|
+
* Create a map of all icons grouped by provider
|
|
46
|
+
*/
|
|
47
|
+
const allIconsByProvider = (0, react.useMemo)(() => {
|
|
48
|
+
const map = {};
|
|
49
|
+
for (const provider of providers) map[provider.prefix] = getProviderIcons(provider);
|
|
50
|
+
return map;
|
|
51
|
+
}, [providers, getProviderIcons]);
|
|
52
|
+
/**
|
|
53
|
+
* Filter icons: when searching, show from all providers; otherwise show active
|
|
54
|
+
*/
|
|
55
|
+
const filteredIconsData = (0, react.useMemo)(() => {
|
|
56
|
+
if (!searchQuery) return {
|
|
57
|
+
isSearching: false,
|
|
58
|
+
data: allIconsByProvider[activeProvider] ?? []
|
|
59
|
+
};
|
|
60
|
+
const results = [];
|
|
61
|
+
const searchLower = searchQuery.toLowerCase();
|
|
62
|
+
for (const provider of providers) {
|
|
63
|
+
const filtered = (allIconsByProvider[provider.prefix] ?? []).filter((icon) => icon.toLowerCase().includes(searchLower));
|
|
64
|
+
results.push(...filtered);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
isSearching: true,
|
|
68
|
+
data: results
|
|
69
|
+
};
|
|
70
|
+
}, [
|
|
71
|
+
searchQuery,
|
|
72
|
+
activeProvider,
|
|
73
|
+
allIconsByProvider,
|
|
74
|
+
providers
|
|
75
|
+
]);
|
|
76
|
+
const handleSelectIcon = (0, react.useCallback)((iconName) => {
|
|
77
|
+
onChange?.(iconName);
|
|
78
|
+
onSelect?.();
|
|
79
|
+
}, [onChange, onSelect]);
|
|
80
|
+
const { isSearching, data: filteredData } = filteredIconsData;
|
|
81
|
+
const hasNoResults = !isSearching && filteredData.length === 0 || isSearching && filteredData.length === 0;
|
|
82
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
83
|
+
className: "flex flex-col gap-4 min-h-[200px] max-h-[80vh]",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
86
|
+
className: "relative",
|
|
87
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.Input, {
|
|
88
|
+
placeholder: "Search icons...",
|
|
89
|
+
value: searchQuery,
|
|
90
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
91
|
+
autoFocus: true,
|
|
92
|
+
disabled: isLoading
|
|
93
|
+
}), searchQuery && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
94
|
+
type: "button",
|
|
95
|
+
onClick: () => setSearchQuery(""),
|
|
96
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
97
|
+
"aria-label": "Clear search",
|
|
98
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.X, { className: "h-4 w-4" })
|
|
99
|
+
})]
|
|
100
|
+
}),
|
|
101
|
+
!isSearching && providers.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__pixpilot_shadcn.Tabs, {
|
|
102
|
+
value: activeProvider,
|
|
103
|
+
onValueChange: setActiveProvider,
|
|
104
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TabsList, {
|
|
105
|
+
className: "w-full",
|
|
106
|
+
children: providers.map((provider) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TabsTrigger, {
|
|
107
|
+
value: provider.prefix,
|
|
108
|
+
children: provider.name ?? provider.prefix
|
|
109
|
+
}, provider.prefix))
|
|
110
|
+
}), providers.map((provider) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__pixpilot_shadcn.TabsContent, {
|
|
111
|
+
value: provider.prefix,
|
|
112
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_virtualized_icon_grid.default, {
|
|
113
|
+
icons: allIconsByProvider[provider.prefix] ?? [],
|
|
114
|
+
onSelectIcon: handleSelectIcon,
|
|
115
|
+
maxHeight
|
|
116
|
+
})
|
|
117
|
+
}, provider.prefix))]
|
|
118
|
+
}),
|
|
119
|
+
hasNoResults && isSearching && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
120
|
+
className: "flex items-center justify-center py-8",
|
|
121
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
122
|
+
className: "text-sm text-muted-foreground",
|
|
123
|
+
children: noIconMessage(false, isSearching)
|
|
124
|
+
})
|
|
125
|
+
}),
|
|
126
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LoadingOverlay.LoadingOverlay, {
|
|
127
|
+
message: "Loading icons...",
|
|
128
|
+
loading: isLoading
|
|
129
|
+
}),
|
|
130
|
+
isSearching && providers.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_virtualized_icon_grid.default, {
|
|
131
|
+
icons: filteredData,
|
|
132
|
+
onSelectIcon: handleSelectIcon,
|
|
133
|
+
maxHeight
|
|
134
|
+
}),
|
|
135
|
+
!isSearching && providers.length === 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_virtualized_icon_grid.default, {
|
|
136
|
+
icons: filteredData,
|
|
137
|
+
onSelectIcon: handleSelectIcon,
|
|
138
|
+
maxHeight
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
var icon_picker_content_default = IconPickerContent;
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
exports.default = icon_picker_content_default;
|
|
@@ -1 +1,141 @@
|
|
|
1
|
-
import{LoadingOverlay
|
|
1
|
+
import { LoadingOverlay } from "../LoadingOverlay.js";
|
|
2
|
+
import { useAsyncProviders } from "./use-async-providers.js";
|
|
3
|
+
import virtualized_icon_grid_default from "./virtualized-icon-grid.js";
|
|
4
|
+
import { Input, Tabs, TabsContent, TabsList, TabsTrigger } from "@pixpilot/shadcn";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/icon-selector/icon-picker-content.tsx
|
|
10
|
+
function noIconMessage(hasIcons, isSearching) {
|
|
11
|
+
if (hasIcons) return "";
|
|
12
|
+
if (!isSearching) return "No icons provided by the selected provider!";
|
|
13
|
+
return "No icons found matching your search";
|
|
14
|
+
}
|
|
15
|
+
const IconPickerContent = ({ providers: providersProp, onChange, onSelect, maxHeight = "60vh" }) => {
|
|
16
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
17
|
+
const { providers, isLoading } = useAsyncProviders(providersProp);
|
|
18
|
+
const providerPrefixes = useMemo(() => providers.map((provider) => provider.prefix), [providers]);
|
|
19
|
+
const [activeProvider, setActiveProvider] = useState(providerPrefixes[0] ?? "default");
|
|
20
|
+
/**
|
|
21
|
+
* Sync activeProvider when providers load with delay
|
|
22
|
+
*/
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (providerPrefixes.length > 0) setActiveProvider((current) => {
|
|
25
|
+
if (current === "default") return providerPrefixes[0] ?? "default";
|
|
26
|
+
return current;
|
|
27
|
+
});
|
|
28
|
+
}, [providerPrefixes]);
|
|
29
|
+
/**
|
|
30
|
+
* Get all icons for a provider
|
|
31
|
+
*/
|
|
32
|
+
const getProviderIcons = useCallback((provider) => {
|
|
33
|
+
try {
|
|
34
|
+
return provider.icons.map((iconName) => `${provider.prefix}:${iconName}`);
|
|
35
|
+
} catch {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
}, []);
|
|
39
|
+
/**
|
|
40
|
+
* Create a map of all icons grouped by provider
|
|
41
|
+
*/
|
|
42
|
+
const allIconsByProvider = useMemo(() => {
|
|
43
|
+
const map = {};
|
|
44
|
+
for (const provider of providers) map[provider.prefix] = getProviderIcons(provider);
|
|
45
|
+
return map;
|
|
46
|
+
}, [providers, getProviderIcons]);
|
|
47
|
+
/**
|
|
48
|
+
* Filter icons: when searching, show from all providers; otherwise show active
|
|
49
|
+
*/
|
|
50
|
+
const filteredIconsData = useMemo(() => {
|
|
51
|
+
if (!searchQuery) return {
|
|
52
|
+
isSearching: false,
|
|
53
|
+
data: allIconsByProvider[activeProvider] ?? []
|
|
54
|
+
};
|
|
55
|
+
const results = [];
|
|
56
|
+
const searchLower = searchQuery.toLowerCase();
|
|
57
|
+
for (const provider of providers) {
|
|
58
|
+
const filtered = (allIconsByProvider[provider.prefix] ?? []).filter((icon) => icon.toLowerCase().includes(searchLower));
|
|
59
|
+
results.push(...filtered);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
isSearching: true,
|
|
63
|
+
data: results
|
|
64
|
+
};
|
|
65
|
+
}, [
|
|
66
|
+
searchQuery,
|
|
67
|
+
activeProvider,
|
|
68
|
+
allIconsByProvider,
|
|
69
|
+
providers
|
|
70
|
+
]);
|
|
71
|
+
const handleSelectIcon = useCallback((iconName) => {
|
|
72
|
+
onChange?.(iconName);
|
|
73
|
+
onSelect?.();
|
|
74
|
+
}, [onChange, onSelect]);
|
|
75
|
+
const { isSearching, data: filteredData } = filteredIconsData;
|
|
76
|
+
const hasNoResults = !isSearching && filteredData.length === 0 || isSearching && filteredData.length === 0;
|
|
77
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
78
|
+
className: "flex flex-col gap-4 min-h-[200px] max-h-[80vh]",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "relative",
|
|
82
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
83
|
+
placeholder: "Search icons...",
|
|
84
|
+
value: searchQuery,
|
|
85
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
86
|
+
autoFocus: true,
|
|
87
|
+
disabled: isLoading
|
|
88
|
+
}), searchQuery && /* @__PURE__ */ jsx("button", {
|
|
89
|
+
type: "button",
|
|
90
|
+
onClick: () => setSearchQuery(""),
|
|
91
|
+
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",
|
|
92
|
+
"aria-label": "Clear search",
|
|
93
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
94
|
+
})]
|
|
95
|
+
}),
|
|
96
|
+
!isSearching && providers.length > 1 && /* @__PURE__ */ jsxs(Tabs, {
|
|
97
|
+
value: activeProvider,
|
|
98
|
+
onValueChange: setActiveProvider,
|
|
99
|
+
children: [/* @__PURE__ */ jsx(TabsList, {
|
|
100
|
+
className: "w-full",
|
|
101
|
+
children: providers.map((provider) => /* @__PURE__ */ jsx(TabsTrigger, {
|
|
102
|
+
value: provider.prefix,
|
|
103
|
+
children: provider.name ?? provider.prefix
|
|
104
|
+
}, provider.prefix))
|
|
105
|
+
}), providers.map((provider) => /* @__PURE__ */ jsx(TabsContent, {
|
|
106
|
+
value: provider.prefix,
|
|
107
|
+
children: /* @__PURE__ */ jsx(virtualized_icon_grid_default, {
|
|
108
|
+
icons: allIconsByProvider[provider.prefix] ?? [],
|
|
109
|
+
onSelectIcon: handleSelectIcon,
|
|
110
|
+
maxHeight
|
|
111
|
+
})
|
|
112
|
+
}, provider.prefix))]
|
|
113
|
+
}),
|
|
114
|
+
hasNoResults && isSearching && /* @__PURE__ */ jsx("div", {
|
|
115
|
+
className: "flex items-center justify-center py-8",
|
|
116
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
117
|
+
className: "text-sm text-muted-foreground",
|
|
118
|
+
children: noIconMessage(false, isSearching)
|
|
119
|
+
})
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ jsx(LoadingOverlay, {
|
|
122
|
+
message: "Loading icons...",
|
|
123
|
+
loading: isLoading
|
|
124
|
+
}),
|
|
125
|
+
isSearching && providers.length > 0 && /* @__PURE__ */ jsx(virtualized_icon_grid_default, {
|
|
126
|
+
icons: filteredData,
|
|
127
|
+
onSelectIcon: handleSelectIcon,
|
|
128
|
+
maxHeight
|
|
129
|
+
}),
|
|
130
|
+
!isSearching && providers.length === 1 && /* @__PURE__ */ jsx(virtualized_icon_grid_default, {
|
|
131
|
+
icons: filteredData,
|
|
132
|
+
onSelectIcon: handleSelectIcon,
|
|
133
|
+
maxHeight
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
var icon_picker_content_default = IconPickerContent;
|
|
139
|
+
|
|
140
|
+
//#endregion
|
|
141
|
+
export { icon_picker_content_default as default };
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_IconPicker = require('./IconPicker.cjs');
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { AsyncIconProvider, IconProviderLoader, useAsyncProviders } from "./use-async-providers.cjs";
|
|
2
1
|
import { IconPicker, IconPickerProps, IconPickerVariant } from "./IconPicker.cjs";
|
|
3
|
-
import { IconProvider } from "./types.cjs";
|
|
2
|
+
import { IconProvider, IconProviderLoader, IconProviderProps } from "./types.cjs";
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { AsyncIconProvider, IconProviderLoader, useAsyncProviders } from "./use-async-providers.js";
|
|
2
1
|
import { IconPicker, IconPickerProps, IconPickerVariant } from "./IconPicker.js";
|
|
3
|
-
import { IconProvider } from "./types.js";
|
|
2
|
+
import { IconProvider, IconProviderLoader, IconProviderProps } from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { IconPicker } from "./IconPicker.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/icon-selector/types.d.ts
|
|
2
|
-
interface
|
|
2
|
+
interface IconProviderProps {
|
|
3
3
|
prefix: string;
|
|
4
4
|
icons: string[];
|
|
5
5
|
/**
|
|
@@ -7,5 +7,7 @@ interface IconProvider {
|
|
|
7
7
|
*/
|
|
8
8
|
name: string;
|
|
9
9
|
}
|
|
10
|
+
type IconProviderLoader = () => Promise<IconProviderProps>;
|
|
11
|
+
type IconProvider = IconProviderProps | IconProviderLoader;
|
|
10
12
|
//#endregion
|
|
11
|
-
export { IconProvider };
|
|
13
|
+
export { IconProvider, IconProviderLoader, IconProviderProps };
|