@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
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { __toESM } from "../../../../../../../_virtual/rolldown_runtime.js";
|
|
5
|
+
import { require_dist } from "../../../../../@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";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
|
|
8
|
+
//#region ../../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
|
|
9
|
+
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
10
|
+
var ROOT_NAME = "TagsInputRoot";
|
|
11
|
+
var [TagsInputProvider, useTagsInput] = (0, import_dist.createContext)(ROOT_NAME);
|
|
12
|
+
var TagsInputRoot = React$1.forwardRef((props, ref) => {
|
|
13
|
+
const { value: valueProp, defaultValue, onValueChange, onValidate, onInvalid, displayValue = (value2) => value2.toString(), addOnPaste = false, addOnTab = false, disabled = false, editable = false, loop = false, blurBehavior, delimiter = ",", max = Number.POSITIVE_INFINITY, readOnly = false, required = false, name, children, dir: dirProp, id: idProp,...rootProps } = props;
|
|
14
|
+
const [value = [], setValue] = (0, import_dist.useControllableState)({
|
|
15
|
+
prop: valueProp,
|
|
16
|
+
defaultProp: defaultValue,
|
|
17
|
+
onChange: onValueChange
|
|
18
|
+
});
|
|
19
|
+
const [highlightedIndex, setHighlightedIndex] = React$1.useState(null);
|
|
20
|
+
const [editingIndex, setEditingIndex] = React$1.useState(null);
|
|
21
|
+
const [isInvalidInput, setIsInvalidInput] = React$1.useState(false);
|
|
22
|
+
const collectionRef = React$1.useRef(null);
|
|
23
|
+
const inputRef = React$1.useRef(null);
|
|
24
|
+
const id = (0, import_dist.useId)();
|
|
25
|
+
const inputId = (0, import_dist.useId)();
|
|
26
|
+
const labelId = (0, import_dist.useId)();
|
|
27
|
+
const dir = (0, import_dist.useDirection)(dirProp);
|
|
28
|
+
const { getEnabledItems } = (0, import_dist.useItemCollection)({ ref: collectionRef });
|
|
29
|
+
const { isFormControl, onTriggerChange } = (0, import_dist.useFormControl)();
|
|
30
|
+
const composedRef = (0, import_dist.useComposedRefs)(ref, collectionRef, (node) => onTriggerChange(node));
|
|
31
|
+
const onItemAdd = React$1.useCallback((textValue, options) => {
|
|
32
|
+
if (disabled || readOnly) return false;
|
|
33
|
+
if (addOnPaste && options?.viaPaste) {
|
|
34
|
+
const splitValues = textValue.split(delimiter).map((v) => v.trim()).filter(Boolean);
|
|
35
|
+
if (value.length + splitValues.length > max && max > 0) {
|
|
36
|
+
onInvalid?.(textValue);
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
let newValues2 = [];
|
|
40
|
+
for (const v of splitValues) if (value.includes(v)) onInvalid?.(v);
|
|
41
|
+
newValues2 = [...new Set(splitValues.filter((v) => !value.includes(v)))];
|
|
42
|
+
const validValues = newValues2.filter((v) => !onValidate || onValidate(v));
|
|
43
|
+
if (validValues.length === 0) return false;
|
|
44
|
+
setValue([...value, ...validValues]);
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (value.length >= max && max > 0) {
|
|
48
|
+
onInvalid?.(textValue);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const trimmedValue = textValue.trim();
|
|
52
|
+
if (onValidate && !onValidate(trimmedValue)) {
|
|
53
|
+
setIsInvalidInput(true);
|
|
54
|
+
onInvalid?.(trimmedValue);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
if (value.some((v) => {
|
|
58
|
+
return v === trimmedValue;
|
|
59
|
+
})) {
|
|
60
|
+
setIsInvalidInput(true);
|
|
61
|
+
onInvalid?.(trimmedValue);
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
const newValue = trimmedValue;
|
|
65
|
+
setValue([...value, newValue]);
|
|
66
|
+
setHighlightedIndex(null);
|
|
67
|
+
setEditingIndex(null);
|
|
68
|
+
setIsInvalidInput(false);
|
|
69
|
+
return true;
|
|
70
|
+
}, [
|
|
71
|
+
value,
|
|
72
|
+
max,
|
|
73
|
+
addOnPaste,
|
|
74
|
+
delimiter,
|
|
75
|
+
setValue,
|
|
76
|
+
onInvalid,
|
|
77
|
+
onValidate,
|
|
78
|
+
disabled,
|
|
79
|
+
readOnly
|
|
80
|
+
]);
|
|
81
|
+
const onItemUpdate = React$1.useCallback((index, newTextValue) => {
|
|
82
|
+
if (disabled || readOnly) return;
|
|
83
|
+
if (index !== -1) {
|
|
84
|
+
const trimmedValue = newTextValue.trim();
|
|
85
|
+
if (value.some((v, i) => {
|
|
86
|
+
if (i === index) return false;
|
|
87
|
+
return v === trimmedValue;
|
|
88
|
+
})) {
|
|
89
|
+
setIsInvalidInput(true);
|
|
90
|
+
onInvalid?.(trimmedValue);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (onValidate && !onValidate(trimmedValue)) {
|
|
94
|
+
setIsInvalidInput(true);
|
|
95
|
+
onInvalid?.(trimmedValue);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const updatedValue = displayValue(trimmedValue);
|
|
99
|
+
const newValues = [...value];
|
|
100
|
+
newValues[index] = updatedValue;
|
|
101
|
+
setValue(newValues);
|
|
102
|
+
setHighlightedIndex(index);
|
|
103
|
+
setEditingIndex(null);
|
|
104
|
+
setIsInvalidInput(false);
|
|
105
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
106
|
+
}
|
|
107
|
+
}, [
|
|
108
|
+
value,
|
|
109
|
+
setValue,
|
|
110
|
+
displayValue,
|
|
111
|
+
onInvalid,
|
|
112
|
+
onValidate,
|
|
113
|
+
disabled,
|
|
114
|
+
readOnly
|
|
115
|
+
]);
|
|
116
|
+
const onItemRemove = React$1.useCallback((index) => {
|
|
117
|
+
if (disabled || readOnly) return;
|
|
118
|
+
if (index !== -1) {
|
|
119
|
+
const newValues = [...value];
|
|
120
|
+
newValues.splice(index, 1);
|
|
121
|
+
setValue(newValues);
|
|
122
|
+
setHighlightedIndex(null);
|
|
123
|
+
setEditingIndex(null);
|
|
124
|
+
inputRef.current?.focus();
|
|
125
|
+
}
|
|
126
|
+
}, [
|
|
127
|
+
value,
|
|
128
|
+
setValue,
|
|
129
|
+
disabled,
|
|
130
|
+
readOnly
|
|
131
|
+
]);
|
|
132
|
+
const onItemLeave = React$1.useCallback(() => {
|
|
133
|
+
setHighlightedIndex(null);
|
|
134
|
+
setEditingIndex(null);
|
|
135
|
+
inputRef.current?.focus();
|
|
136
|
+
}, []);
|
|
137
|
+
const onInputKeydown = React$1.useCallback((event) => {
|
|
138
|
+
const target = event.target;
|
|
139
|
+
if (!(target instanceof HTMLInputElement)) return;
|
|
140
|
+
const isArrowLeft = event.key === "ArrowLeft" && dir === "ltr" || event.key === "ArrowRight" && dir === "rtl";
|
|
141
|
+
const isArrowRight = event.key === "ArrowRight" && dir === "ltr" || event.key === "ArrowLeft" && dir === "rtl";
|
|
142
|
+
if (target.value && target.selectionStart !== 0) {
|
|
143
|
+
setHighlightedIndex(null);
|
|
144
|
+
setEditingIndex(null);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
function findNextEnabledIndex(currentIndex, direction) {
|
|
148
|
+
if (!collectionRef.current) return null;
|
|
149
|
+
const enabledIndices = getEnabledItems().map((_, index) => index);
|
|
150
|
+
if (enabledIndices.length === 0) return null;
|
|
151
|
+
if (currentIndex === null) return direction === "prev" ? enabledIndices[enabledIndices.length - 1] ?? null : enabledIndices[0] ?? null;
|
|
152
|
+
const currentEnabledIndex = enabledIndices.indexOf(currentIndex);
|
|
153
|
+
if (direction === "next") return currentEnabledIndex >= enabledIndices.length - 1 ? loop ? enabledIndices[0] ?? null : null : enabledIndices[currentEnabledIndex + 1] ?? null;
|
|
154
|
+
return currentEnabledIndex <= 0 ? loop ? enabledIndices[enabledIndices.length - 1] ?? null : null : enabledIndices[currentEnabledIndex - 1] ?? null;
|
|
155
|
+
}
|
|
156
|
+
switch (event.key) {
|
|
157
|
+
case "Delete":
|
|
158
|
+
case "Backspace":
|
|
159
|
+
if (target.selectionStart !== 0 || target.selectionEnd !== 0) break;
|
|
160
|
+
if (highlightedIndex !== null) {
|
|
161
|
+
const newIndex = findNextEnabledIndex(highlightedIndex, "prev");
|
|
162
|
+
onItemRemove(highlightedIndex);
|
|
163
|
+
setHighlightedIndex(newIndex);
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
} else if (event.key === "Backspace" && value.length > 0) {
|
|
166
|
+
setHighlightedIndex(findNextEnabledIndex(null, "prev"));
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
}
|
|
169
|
+
break;
|
|
170
|
+
case "Enter":
|
|
171
|
+
if (highlightedIndex !== null && editable && !disabled) {
|
|
172
|
+
setEditingIndex(highlightedIndex);
|
|
173
|
+
event.preventDefault();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
break;
|
|
177
|
+
case "ArrowLeft":
|
|
178
|
+
case "ArrowRight":
|
|
179
|
+
if (target.selectionStart === 0 && isArrowLeft && highlightedIndex === null && value.length > 0) {
|
|
180
|
+
setHighlightedIndex(findNextEnabledIndex(null, "prev"));
|
|
181
|
+
event.preventDefault();
|
|
182
|
+
} else if (highlightedIndex !== null) {
|
|
183
|
+
const nextIndex = findNextEnabledIndex(highlightedIndex, isArrowLeft ? "prev" : "next");
|
|
184
|
+
if (nextIndex !== null) {
|
|
185
|
+
setHighlightedIndex(nextIndex);
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
} else if (isArrowRight) {
|
|
188
|
+
setHighlightedIndex(null);
|
|
189
|
+
requestAnimationFrame(() => target.setSelectionRange(0, 0));
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
break;
|
|
193
|
+
case "Home":
|
|
194
|
+
if (highlightedIndex !== null) {
|
|
195
|
+
setHighlightedIndex(findNextEnabledIndex(null, "next"));
|
|
196
|
+
event.preventDefault();
|
|
197
|
+
}
|
|
198
|
+
break;
|
|
199
|
+
case "End":
|
|
200
|
+
if (highlightedIndex !== null) {
|
|
201
|
+
setHighlightedIndex(findNextEnabledIndex(null, "prev"));
|
|
202
|
+
event.preventDefault();
|
|
203
|
+
}
|
|
204
|
+
break;
|
|
205
|
+
case "Escape":
|
|
206
|
+
if (highlightedIndex !== null) setHighlightedIndex(null);
|
|
207
|
+
if (editingIndex !== null) setEditingIndex(null);
|
|
208
|
+
requestAnimationFrame(() => target.setSelectionRange(0, 0));
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
}, [
|
|
212
|
+
dir,
|
|
213
|
+
editingIndex,
|
|
214
|
+
highlightedIndex,
|
|
215
|
+
value,
|
|
216
|
+
onItemRemove,
|
|
217
|
+
getEnabledItems,
|
|
218
|
+
editable,
|
|
219
|
+
disabled,
|
|
220
|
+
loop
|
|
221
|
+
]);
|
|
222
|
+
const getIsClickedInEmptyRoot = React$1.useCallback((target) => {
|
|
223
|
+
return collectionRef.current?.contains(target) && !target.hasAttribute(import_dist.DATA_ITEM_ATTR) && target.tagName !== "INPUT";
|
|
224
|
+
}, []);
|
|
225
|
+
return /* @__PURE__ */ React$1.createElement(TagsInputProvider, {
|
|
226
|
+
value,
|
|
227
|
+
onValueChange: setValue,
|
|
228
|
+
onItemAdd,
|
|
229
|
+
onItemRemove,
|
|
230
|
+
onItemUpdate,
|
|
231
|
+
onInputKeydown,
|
|
232
|
+
highlightedIndex,
|
|
233
|
+
setHighlightedIndex,
|
|
234
|
+
editingIndex,
|
|
235
|
+
setEditingIndex,
|
|
236
|
+
displayValue,
|
|
237
|
+
onItemLeave,
|
|
238
|
+
inputRef,
|
|
239
|
+
isInvalidInput,
|
|
240
|
+
addOnPaste,
|
|
241
|
+
addOnTab,
|
|
242
|
+
disabled,
|
|
243
|
+
editable,
|
|
244
|
+
loop,
|
|
245
|
+
readOnly,
|
|
246
|
+
blurBehavior,
|
|
247
|
+
delimiter,
|
|
248
|
+
max,
|
|
249
|
+
dir,
|
|
250
|
+
id,
|
|
251
|
+
inputId,
|
|
252
|
+
labelId
|
|
253
|
+
}, /* @__PURE__ */ React$1.createElement(import_dist.Primitive.div, {
|
|
254
|
+
id,
|
|
255
|
+
"data-disabled": disabled ? "" : void 0,
|
|
256
|
+
"data-invalid": isInvalidInput ? "" : void 0,
|
|
257
|
+
"data-readonly": readOnly ? "" : void 0,
|
|
258
|
+
dir,
|
|
259
|
+
...rootProps,
|
|
260
|
+
ref: composedRef,
|
|
261
|
+
onClick: (0, import_dist.composeEventHandlers)(rootProps.onClick, (event) => {
|
|
262
|
+
const target = event.target;
|
|
263
|
+
if (!(target instanceof HTMLElement)) return;
|
|
264
|
+
if (getIsClickedInEmptyRoot(target) && document.activeElement !== inputRef.current) {
|
|
265
|
+
event.currentTarget.focus();
|
|
266
|
+
inputRef.current?.focus();
|
|
267
|
+
}
|
|
268
|
+
}),
|
|
269
|
+
onMouseDown: (0, import_dist.composeEventHandlers)(rootProps.onMouseDown, (event) => {
|
|
270
|
+
const target = event.target;
|
|
271
|
+
if (!(target instanceof HTMLElement)) return;
|
|
272
|
+
if (getIsClickedInEmptyRoot(target)) event.preventDefault();
|
|
273
|
+
}),
|
|
274
|
+
onBlur: (0, import_dist.composeEventHandlers)(rootProps.onBlur, (event) => {
|
|
275
|
+
if (event.relatedTarget !== inputRef.current && !collectionRef.current?.contains(event.relatedTarget)) requestAnimationFrame(() => setHighlightedIndex(null));
|
|
276
|
+
})
|
|
277
|
+
}, typeof children === "function" ? /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, children({ value })) : children, isFormControl && name && /* @__PURE__ */ React$1.createElement(import_dist.VisuallyHiddenInput, {
|
|
278
|
+
type: "hidden",
|
|
279
|
+
control: collectionRef.current,
|
|
280
|
+
name,
|
|
281
|
+
value,
|
|
282
|
+
disabled,
|
|
283
|
+
required
|
|
284
|
+
})));
|
|
285
|
+
});
|
|
286
|
+
TagsInputRoot.displayName = ROOT_NAME;
|
|
287
|
+
var LABEL_NAME = "TagsInputLabel";
|
|
288
|
+
var TagsInputLabel = React$1.forwardRef((props, ref) => {
|
|
289
|
+
const context = useTagsInput(LABEL_NAME);
|
|
290
|
+
return /* @__PURE__ */ React$1.createElement(import_dist.Primitive.label, {
|
|
291
|
+
id: context.labelId,
|
|
292
|
+
htmlFor: context.inputId,
|
|
293
|
+
...props,
|
|
294
|
+
ref
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
TagsInputLabel.displayName = LABEL_NAME;
|
|
298
|
+
var ITEM_NAME = "TagsInputItem";
|
|
299
|
+
var [TagsInputItemProvider, useTagsInputItem] = (0, import_dist.createContext)(ITEM_NAME);
|
|
300
|
+
var TagsInputItem = React$1.forwardRef((props, ref) => {
|
|
301
|
+
const { value, disabled,...itemProps } = props;
|
|
302
|
+
const pointerTypeRef = React$1.useRef("touch");
|
|
303
|
+
const context = useTagsInput(ITEM_NAME);
|
|
304
|
+
const id = (0, import_dist.useId)();
|
|
305
|
+
const textId = `${id}text`;
|
|
306
|
+
const index = context.value.indexOf(value);
|
|
307
|
+
const isHighlighted = index === context.highlightedIndex;
|
|
308
|
+
const isEditing = index === context.editingIndex;
|
|
309
|
+
const itemDisabled = disabled || context.disabled;
|
|
310
|
+
const displayValue = context.displayValue(value);
|
|
311
|
+
const onItemSelect = React$1.useCallback(() => {
|
|
312
|
+
context.setHighlightedIndex(index);
|
|
313
|
+
context.inputRef.current?.focus();
|
|
314
|
+
}, [
|
|
315
|
+
context.setHighlightedIndex,
|
|
316
|
+
context.inputRef,
|
|
317
|
+
index
|
|
318
|
+
]);
|
|
319
|
+
return /* @__PURE__ */ React$1.createElement(TagsInputItemProvider, {
|
|
320
|
+
id,
|
|
321
|
+
value,
|
|
322
|
+
index,
|
|
323
|
+
isHighlighted,
|
|
324
|
+
isEditing,
|
|
325
|
+
disabled: itemDisabled,
|
|
326
|
+
textId,
|
|
327
|
+
displayValue
|
|
328
|
+
}, /* @__PURE__ */ React$1.createElement(import_dist.Primitive.div, {
|
|
329
|
+
id,
|
|
330
|
+
"aria-labelledby": textId,
|
|
331
|
+
"aria-current": isHighlighted,
|
|
332
|
+
"aria-disabled": itemDisabled,
|
|
333
|
+
[import_dist.DATA_ITEM_ATTR]: "",
|
|
334
|
+
"data-state": isHighlighted ? "active" : "inactive",
|
|
335
|
+
"data-highlighted": isHighlighted ? "" : void 0,
|
|
336
|
+
"data-editing": isEditing ? "" : void 0,
|
|
337
|
+
"data-editable": context.editable ? "" : void 0,
|
|
338
|
+
"data-disabled": itemDisabled ? "" : void 0,
|
|
339
|
+
...itemProps,
|
|
340
|
+
ref,
|
|
341
|
+
onClick: (0, import_dist.composeEventHandlers)(itemProps.onClick, (event) => {
|
|
342
|
+
event.stopPropagation();
|
|
343
|
+
if (!isEditing && pointerTypeRef.current !== "mouse") onItemSelect();
|
|
344
|
+
}),
|
|
345
|
+
onDoubleClick: (0, import_dist.composeEventHandlers)(itemProps.onDoubleClick, () => {
|
|
346
|
+
if (context.editable && !itemDisabled) requestAnimationFrame(() => context.setEditingIndex(index));
|
|
347
|
+
}),
|
|
348
|
+
onPointerUp: (0, import_dist.composeEventHandlers)(itemProps.onPointerUp, () => {
|
|
349
|
+
if (pointerTypeRef.current === "mouse") onItemSelect();
|
|
350
|
+
}),
|
|
351
|
+
onPointerDown: (0, import_dist.composeEventHandlers)(itemProps.onPointerDown, (event) => pointerTypeRef.current = event.pointerType),
|
|
352
|
+
onPointerMove: (0, import_dist.composeEventHandlers)(itemProps.onPointerMove, (event) => {
|
|
353
|
+
pointerTypeRef.current = event.pointerType;
|
|
354
|
+
if (disabled) context.onItemLeave();
|
|
355
|
+
else if (pointerTypeRef.current === "mouse") event.currentTarget.focus({ preventScroll: true });
|
|
356
|
+
}),
|
|
357
|
+
onPointerLeave: (0, import_dist.composeEventHandlers)(itemProps.onPointerLeave, (event) => {
|
|
358
|
+
if (event.currentTarget === document.activeElement) context.onItemLeave();
|
|
359
|
+
})
|
|
360
|
+
}));
|
|
361
|
+
});
|
|
362
|
+
TagsInputItem.displayName = ITEM_NAME;
|
|
363
|
+
var INPUT_NAME = "TagsInputInput";
|
|
364
|
+
var TagsInputInput = React$1.forwardRef((props, ref) => {
|
|
365
|
+
const { autoFocus,...inputProps } = props;
|
|
366
|
+
const context = useTagsInput(INPUT_NAME);
|
|
367
|
+
const onTab = React$1.useCallback((event) => {
|
|
368
|
+
if (!context.addOnTab) return;
|
|
369
|
+
onCustomKeydown(event);
|
|
370
|
+
}, [context.addOnTab]);
|
|
371
|
+
const onCustomKeydown = React$1.useCallback((event) => {
|
|
372
|
+
if (event.defaultPrevented) return;
|
|
373
|
+
const value = event.currentTarget.value;
|
|
374
|
+
if (!value) return;
|
|
375
|
+
if (context.onItemAdd(value)) {
|
|
376
|
+
event.currentTarget.value = "";
|
|
377
|
+
context.setHighlightedIndex(null);
|
|
378
|
+
}
|
|
379
|
+
event.preventDefault();
|
|
380
|
+
}, [context.onItemAdd, context.setHighlightedIndex]);
|
|
381
|
+
React$1.useEffect(() => {
|
|
382
|
+
if (!autoFocus) return;
|
|
383
|
+
const animationFrameId = requestAnimationFrame(() => context.inputRef.current?.focus());
|
|
384
|
+
return () => cancelAnimationFrame(animationFrameId);
|
|
385
|
+
}, [autoFocus, context.inputRef]);
|
|
386
|
+
return /* @__PURE__ */ React$1.createElement(import_dist.Primitive.input, {
|
|
387
|
+
type: "text",
|
|
388
|
+
id: context.inputId,
|
|
389
|
+
autoCapitalize: "off",
|
|
390
|
+
autoComplete: "off",
|
|
391
|
+
autoCorrect: "off",
|
|
392
|
+
spellCheck: "false",
|
|
393
|
+
autoFocus,
|
|
394
|
+
"aria-labelledby": context.labelId,
|
|
395
|
+
"aria-readonly": context.readOnly,
|
|
396
|
+
"data-invalid": context.isInvalidInput ? "" : void 0,
|
|
397
|
+
dir: context.dir,
|
|
398
|
+
disabled: context.disabled,
|
|
399
|
+
readOnly: context.readOnly,
|
|
400
|
+
...inputProps,
|
|
401
|
+
ref: (0, import_dist.composeRefs)(context.inputRef, ref),
|
|
402
|
+
onBlur: (0, import_dist.composeEventHandlers)(inputProps.onBlur, (event) => {
|
|
403
|
+
if (context.readOnly) return;
|
|
404
|
+
if (context.blurBehavior === "add") {
|
|
405
|
+
const value = event.target.value;
|
|
406
|
+
if (value) {
|
|
407
|
+
if (context.onItemAdd(value)) event.target.value = "";
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (context.blurBehavior === "clear") event.target.value = "";
|
|
411
|
+
}),
|
|
412
|
+
onChange: (0, import_dist.composeEventHandlers)(inputProps.onChange, (event) => {
|
|
413
|
+
if (context.readOnly) return;
|
|
414
|
+
const target = event.target;
|
|
415
|
+
if (!(target instanceof HTMLInputElement)) return;
|
|
416
|
+
if (context.delimiter === target.value.slice(-1)) {
|
|
417
|
+
const value = target.value.slice(0, -1);
|
|
418
|
+
target.value = "";
|
|
419
|
+
if (value) {
|
|
420
|
+
context.onItemAdd(value);
|
|
421
|
+
context.setHighlightedIndex(null);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}),
|
|
425
|
+
onKeyDown: (0, import_dist.composeEventHandlers)(inputProps.onKeyDown, (event) => {
|
|
426
|
+
if (context.readOnly) return;
|
|
427
|
+
if (event.key === "Enter") onCustomKeydown(event);
|
|
428
|
+
if (event.key === "Tab") onTab(event);
|
|
429
|
+
context.onInputKeydown(event);
|
|
430
|
+
if (event.key.length === 1) context.setHighlightedIndex(null);
|
|
431
|
+
}),
|
|
432
|
+
onPaste: (0, import_dist.composeEventHandlers)(inputProps.onPaste, (event) => {
|
|
433
|
+
if (context.readOnly) return;
|
|
434
|
+
if (context.addOnPaste) {
|
|
435
|
+
event.preventDefault();
|
|
436
|
+
const value = event.clipboardData.getData("text");
|
|
437
|
+
context.onItemAdd(value, { viaPaste: true });
|
|
438
|
+
context.setHighlightedIndex(null);
|
|
439
|
+
}
|
|
440
|
+
})
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
TagsInputInput.displayName = INPUT_NAME;
|
|
444
|
+
var ITEM_DELETE_NAME = "TagsInputItemDelete";
|
|
445
|
+
var TagsInputItemDelete = React$1.forwardRef((props, ref) => {
|
|
446
|
+
const context = useTagsInput(ITEM_DELETE_NAME);
|
|
447
|
+
const itemContext = useTagsInputItem(ITEM_DELETE_NAME);
|
|
448
|
+
const disabled = itemContext.disabled || context.disabled;
|
|
449
|
+
if (itemContext.isEditing) return null;
|
|
450
|
+
return /* @__PURE__ */ React$1.createElement(import_dist.Primitive.button, {
|
|
451
|
+
type: "button",
|
|
452
|
+
tabIndex: disabled ? void 0 : -1,
|
|
453
|
+
"aria-labelledby": itemContext.textId,
|
|
454
|
+
"aria-controls": itemContext.id,
|
|
455
|
+
"aria-current": itemContext.isHighlighted,
|
|
456
|
+
"data-state": itemContext.isHighlighted ? "active" : "inactive",
|
|
457
|
+
"data-disabled": disabled ? "" : void 0,
|
|
458
|
+
...props,
|
|
459
|
+
ref,
|
|
460
|
+
onClick: (0, import_dist.composeEventHandlers)(props.onClick, () => {
|
|
461
|
+
if (disabled) return;
|
|
462
|
+
const index = context.value.findIndex((i) => i === itemContext.value);
|
|
463
|
+
context.onItemRemove(index);
|
|
464
|
+
})
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
TagsInputItemDelete.displayName = ITEM_DELETE_NAME;
|
|
468
|
+
var ITEM_TEXT_NAME = "TagsInputItemText";
|
|
469
|
+
var TagsInputItemText = React$1.forwardRef((props, ref) => {
|
|
470
|
+
const { children,...itemTextProps } = props;
|
|
471
|
+
const context = useTagsInput(ITEM_TEXT_NAME);
|
|
472
|
+
const itemContext = useTagsInputItem(ITEM_TEXT_NAME);
|
|
473
|
+
if (itemContext.isEditing && context.editable && !itemContext.disabled) return /* @__PURE__ */ React$1.createElement(TagsInputEditableItemText, null);
|
|
474
|
+
return /* @__PURE__ */ React$1.createElement(import_dist.Primitive.span, {
|
|
475
|
+
id: itemContext.textId,
|
|
476
|
+
...itemTextProps,
|
|
477
|
+
ref
|
|
478
|
+
}, children ?? itemContext.displayValue);
|
|
479
|
+
});
|
|
480
|
+
function TagsInputEditableItemText() {
|
|
481
|
+
const context = useTagsInput(ITEM_TEXT_NAME);
|
|
482
|
+
const itemContext = useTagsInputItem(ITEM_TEXT_NAME);
|
|
483
|
+
const [editValue, setEditValue] = React$1.useState(itemContext.displayValue);
|
|
484
|
+
const onBlur = React$1.useCallback(() => {
|
|
485
|
+
setEditValue(itemContext.displayValue);
|
|
486
|
+
context.setEditingIndex(null);
|
|
487
|
+
}, [context.setEditingIndex, itemContext.displayValue]);
|
|
488
|
+
const onChange = React$1.useCallback((event) => {
|
|
489
|
+
const target = event.target;
|
|
490
|
+
target.style.width = "0";
|
|
491
|
+
target.style.width = `${target.scrollWidth + 4}px`;
|
|
492
|
+
setEditValue(event.target.value);
|
|
493
|
+
}, []);
|
|
494
|
+
const onFocus = React$1.useCallback((event) => {
|
|
495
|
+
event.target.select();
|
|
496
|
+
event.target.style.width = "0";
|
|
497
|
+
event.target.style.width = `${event.target.scrollWidth + 4}px`;
|
|
498
|
+
}, []);
|
|
499
|
+
const onKeyDown = React$1.useCallback((event) => {
|
|
500
|
+
if (event.key === "Enter") {
|
|
501
|
+
const index = context.value.findIndex((v) => v === itemContext.value);
|
|
502
|
+
context.onItemUpdate(index, editValue);
|
|
503
|
+
} else if (event.key === "Escape") {
|
|
504
|
+
setEditValue(itemContext.displayValue);
|
|
505
|
+
context.setEditingIndex(null);
|
|
506
|
+
context.setHighlightedIndex(itemContext.index);
|
|
507
|
+
context.inputRef.current?.focus();
|
|
508
|
+
}
|
|
509
|
+
event.stopPropagation();
|
|
510
|
+
}, [
|
|
511
|
+
context.value,
|
|
512
|
+
context.onItemUpdate,
|
|
513
|
+
context.setEditingIndex,
|
|
514
|
+
itemContext.displayValue,
|
|
515
|
+
context.inputRef.current?.focus,
|
|
516
|
+
editValue,
|
|
517
|
+
itemContext.value,
|
|
518
|
+
context.setHighlightedIndex,
|
|
519
|
+
itemContext.index
|
|
520
|
+
]);
|
|
521
|
+
return /* @__PURE__ */ React$1.createElement(import_dist.Primitive.input, {
|
|
522
|
+
type: "text",
|
|
523
|
+
autoCapitalize: "off",
|
|
524
|
+
autoComplete: "off",
|
|
525
|
+
autoCorrect: "off",
|
|
526
|
+
spellCheck: "false",
|
|
527
|
+
autoFocus: true,
|
|
528
|
+
"aria-describedby": itemContext.textId,
|
|
529
|
+
value: editValue,
|
|
530
|
+
onChange,
|
|
531
|
+
onKeyDown,
|
|
532
|
+
onFocus,
|
|
533
|
+
onBlur,
|
|
534
|
+
style: {
|
|
535
|
+
outline: "none",
|
|
536
|
+
background: "inherit",
|
|
537
|
+
border: "none",
|
|
538
|
+
font: "inherit",
|
|
539
|
+
color: "inherit",
|
|
540
|
+
padding: 0,
|
|
541
|
+
minWidth: "1ch"
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
var CLEAR_NAME = "TagsInputClear";
|
|
546
|
+
var TagsInputClear = React$1.forwardRef((props, ref) => {
|
|
547
|
+
const { forceMount,...clearProps } = props;
|
|
548
|
+
const context = useTagsInput(CLEAR_NAME);
|
|
549
|
+
return /* @__PURE__ */ React$1.createElement(import_dist.Presence, { present: forceMount || context.value.length > 0 }, /* @__PURE__ */ React$1.createElement(import_dist.Primitive.button, {
|
|
550
|
+
type: "button",
|
|
551
|
+
"aria-disabled": context.disabled,
|
|
552
|
+
"data-state": context.value.length > 0 ? "visible" : "invisible",
|
|
553
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
554
|
+
...clearProps,
|
|
555
|
+
ref,
|
|
556
|
+
onClick: (0, import_dist.composeEventHandlers)(props.onClick, () => {
|
|
557
|
+
if (context.disabled) return;
|
|
558
|
+
context.onValueChange([]);
|
|
559
|
+
context.inputRef.current?.focus();
|
|
560
|
+
})
|
|
561
|
+
}));
|
|
562
|
+
});
|
|
563
|
+
TagsInputClear.displayName = CLEAR_NAME;
|
|
564
|
+
|
|
565
|
+
//#endregion
|