@protonradio/proton-ui 0.11.10 → 0.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -148
- package/dist/_virtual/jsx-runtime.cjs.js +2 -0
- package/dist/_virtual/jsx-runtime.cjs.js.map +1 -0
- package/dist/_virtual/jsx-runtime.es.js +5 -0
- package/dist/_virtual/jsx-runtime.es.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.development.cjs.js +2 -0
- package/dist/_virtual/react-jsx-runtime.development.cjs.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.development.es.js +5 -0
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.cjs.js +2 -0
- package/dist/_virtual/react-jsx-runtime.production.min.cjs.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.es.js +5 -0
- package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +1 -0
- package/dist/assets/svg/icons.svg.cjs.js +2 -0
- package/dist/assets/svg/icons.svg.cjs.js.map +1 -0
- package/dist/assets/svg/icons.svg.es.js +5 -0
- package/dist/assets/svg/icons.svg.es.js.map +1 -0
- package/dist/components/ActionMenu/ActionMenu.cjs.js +2 -0
- package/dist/components/ActionMenu/ActionMenu.cjs.js.map +1 -0
- package/dist/components/ActionMenu/ActionMenu.es.js +277 -0
- package/dist/components/ActionMenu/ActionMenu.es.js.map +1 -0
- package/dist/components/Badge/Badge.cjs.js +2 -0
- package/dist/components/Badge/Badge.cjs.js.map +1 -0
- package/dist/components/Badge/Badge.es.js +25 -0
- package/dist/components/Badge/Badge.es.js.map +1 -0
- package/dist/components/Banner/Banner.cjs.js +2 -0
- package/dist/components/Banner/Banner.cjs.js.map +1 -0
- package/dist/components/Banner/Banner.es.js +131 -0
- package/dist/components/Banner/Banner.es.js.map +1 -0
- package/dist/components/Button/Button.cjs.js +2 -0
- package/dist/components/Button/Button.cjs.js.map +1 -0
- package/dist/components/Button/Button.es.js +99 -0
- package/dist/components/Button/Button.es.js.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.cjs.js +2 -0
- package/dist/components/ButtonGroup/ButtonGroup.cjs.js.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.es.js +51 -0
- package/dist/components/ButtonGroup/ButtonGroup.es.js.map +1 -0
- package/dist/components/ButtonWithSelect/ButtonWithSelect.cjs.js +2 -0
- package/dist/components/ButtonWithSelect/ButtonWithSelect.cjs.js.map +1 -0
- package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js +80 -0
- package/dist/components/ButtonWithSelect/ButtonWithSelect.es.js.map +1 -0
- package/dist/components/DataTable/DataTable.cjs.js +2 -0
- package/dist/components/DataTable/DataTable.cjs.js.map +1 -0
- package/dist/components/DataTable/DataTable.es.js +137 -0
- package/dist/components/DataTable/DataTable.es.js.map +1 -0
- package/dist/components/Dialog/Dialog.cjs.js +2 -0
- package/dist/components/Dialog/Dialog.cjs.js.map +1 -0
- package/dist/components/Dialog/Dialog.es.js +15 -0
- package/dist/components/Dialog/Dialog.es.js.map +1 -0
- package/dist/components/Elevation/Elevation.cjs.js +2 -0
- package/dist/components/Elevation/Elevation.cjs.js.map +1 -0
- package/dist/components/Elevation/Elevation.es.js +33 -0
- package/dist/components/Elevation/Elevation.es.js.map +1 -0
- package/dist/components/Icon/Icon.cjs.js +2 -0
- package/dist/components/Icon/Icon.cjs.js.map +1 -0
- package/dist/components/Icon/Icon.es.js +42 -0
- package/dist/components/Icon/Icon.es.js.map +1 -0
- package/dist/components/ImageBackground/ImageBackground.cjs.js +2 -0
- package/dist/components/ImageBackground/ImageBackground.cjs.js.map +1 -0
- package/dist/components/ImageBackground/ImageBackground.es.js +55 -0
- package/dist/components/ImageBackground/ImageBackground.es.js.map +1 -0
- package/dist/components/Input/BaseInput/Input.cjs.js +2 -0
- package/dist/components/Input/BaseInput/Input.cjs.js.map +1 -0
- package/dist/components/Input/BaseInput/Input.es.js +186 -0
- package/dist/components/Input/BaseInput/Input.es.js.map +1 -0
- package/dist/components/Input/CopyInput/CopyInput.cjs.js +2 -0
- package/dist/components/Input/CopyInput/CopyInput.cjs.js.map +1 -0
- package/dist/components/Input/CopyInput/CopyInput.es.js +83 -0
- package/dist/components/Input/CopyInput/CopyInput.es.js.map +1 -0
- package/dist/components/Input/SearchInput/SearchInput.cjs.js +2 -0
- package/dist/components/Input/SearchInput/SearchInput.cjs.js.map +1 -0
- package/dist/components/Input/SearchInput/SearchInput.es.js +118 -0
- package/dist/components/Input/SearchInput/SearchInput.es.js.map +1 -0
- package/dist/components/Menu/MenuTrigger.cjs.js +2 -0
- package/dist/components/Menu/MenuTrigger.cjs.js.map +1 -0
- package/dist/components/Menu/MenuTrigger.es.js +89 -0
- package/dist/components/Menu/MenuTrigger.es.js.map +1 -0
- package/dist/components/Menu/PopoverMenu.cjs.js +2 -0
- package/dist/components/Menu/PopoverMenu.cjs.js.map +1 -0
- package/dist/components/Menu/PopoverMenu.es.js +122 -0
- package/dist/components/Menu/PopoverMenu.es.js.map +1 -0
- package/dist/components/Modal/Modal.cjs.js +2 -0
- package/dist/components/Modal/Modal.cjs.js.map +1 -0
- package/dist/components/Modal/Modal.es.js +122 -0
- package/dist/components/Modal/Modal.es.js.map +1 -0
- package/dist/components/Popover/Popover.cjs.js +2 -0
- package/dist/components/Popover/Popover.cjs.js.map +1 -0
- package/dist/components/Popover/Popover.es.js +54 -0
- package/dist/components/Popover/Popover.es.js.map +1 -0
- package/dist/components/ScreenOverlay/ScreenOverlay.cjs.js +2 -0
- package/dist/components/ScreenOverlay/ScreenOverlay.cjs.js.map +1 -0
- package/dist/components/ScreenOverlay/ScreenOverlay.es.js +44 -0
- package/dist/components/ScreenOverlay/ScreenOverlay.es.js.map +1 -0
- package/dist/components/Select/Select.cjs.js +2 -0
- package/dist/components/Select/Select.cjs.js.map +1 -0
- package/dist/components/Select/Select.es.js +228 -0
- package/dist/components/Select/Select.es.js.map +1 -0
- package/dist/components/Switch/Switch.cjs.js +2 -0
- package/dist/components/Switch/Switch.cjs.js.map +1 -0
- package/dist/components/Switch/Switch.es.js +40 -0
- package/dist/components/Switch/Switch.es.js.map +1 -0
- package/dist/components/Table/Collection/CompoundComponents.cjs.js +2 -0
- package/dist/components/Table/Collection/CompoundComponents.cjs.js.map +1 -0
- package/dist/components/Table/Collection/CompoundComponents.es.js +9 -0
- package/dist/components/Table/Collection/CompoundComponents.es.js.map +1 -0
- package/dist/components/Table/Collection/collectionParser.cjs.js +2 -0
- package/dist/components/Table/Collection/collectionParser.cjs.js.map +1 -0
- package/dist/components/Table/Collection/collectionParser.es.js +54 -0
- package/dist/components/Table/Collection/collectionParser.es.js.map +1 -0
- package/dist/components/Table/Collection/useTableCollection.cjs.js +2 -0
- package/dist/components/Table/Collection/useTableCollection.cjs.js.map +1 -0
- package/dist/components/Table/Collection/useTableCollection.es.js +59 -0
- package/dist/components/Table/Collection/useTableCollection.es.js.map +1 -0
- package/dist/components/Table/Table.cjs.js +2 -0
- package/dist/components/Table/Table.cjs.js.map +1 -0
- package/dist/components/Table/Table.es.js +89 -0
- package/dist/components/Table/Table.es.js.map +1 -0
- package/dist/components/Text/TextEllipsis/TextEllipsis.cjs.js +2 -0
- package/dist/components/Text/TextEllipsis/TextEllipsis.cjs.js.map +1 -0
- package/dist/components/Text/TextEllipsis/TextEllipsis.es.js +30 -0
- package/dist/components/Text/TextEllipsis/TextEllipsis.es.js.map +1 -0
- package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js +2 -0
- package/dist/components/Text/TextEmphasis/TextEmphasis.cjs.js.map +1 -0
- package/dist/components/Text/TextEmphasis/TextEmphasis.es.js +54 -0
- package/dist/components/Text/TextEmphasis/TextEmphasis.es.js.map +1 -0
- package/dist/components/ThemeProvider.cjs.js +2 -0
- package/dist/components/ThemeProvider.cjs.js.map +1 -0
- package/dist/components/ThemeProvider.es.js +42 -0
- package/dist/components/ThemeProvider.es.js.map +1 -0
- package/dist/components/Tombstone/Tombstone.cjs.js +2 -0
- package/dist/components/Tombstone/Tombstone.cjs.js.map +1 -0
- package/dist/components/Tombstone/Tombstone.es.js +35 -0
- package/dist/components/Tombstone/Tombstone.es.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.cjs.js +2 -0
- package/dist/components/Tooltip/Tooltip.cjs.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.es.js +78 -0
- package/dist/components/Tooltip/Tooltip.es.js.map +1 -0
- package/dist/components/Waveform/Waveform.cjs.js +2 -0
- package/dist/components/Waveform/Waveform.cjs.js.map +1 -0
- package/dist/components/Waveform/Waveform.es.js +163 -0
- package/dist/components/Waveform/Waveform.es.js.map +1 -0
- package/dist/components/Waveform/WaveformBar.cjs.js +2 -0
- package/dist/components/Waveform/WaveformBar.cjs.js.map +1 -0
- package/dist/components/Waveform/WaveformBar.es.js +74 -0
- package/dist/components/Waveform/WaveformBar.es.js.map +1 -0
- package/dist/constants/breakpoint.cjs.js +2 -0
- package/dist/constants/breakpoint.cjs.js.map +1 -0
- package/dist/{breakpoint-9y1_8U_b.mjs → constants/breakpoint.es.js} +2 -2
- package/dist/constants/breakpoint.es.js.map +1 -0
- package/dist/constants/placement.cjs.js +2 -0
- package/dist/constants/placement.cjs.js.map +1 -0
- package/dist/constants/placement.es.js +28 -0
- package/dist/constants/placement.es.js.map +1 -0
- package/dist/constants.cjs.js +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +3 -26
- package/dist/constants.es.js.map +1 -1
- package/dist/dark.cjs.js +1 -1
- package/dist/dark.cjs.js.map +1 -1
- package/dist/dark.es.js +8 -55
- package/dist/dark.es.js.map +1 -1
- package/dist/design/colors.cjs.js +2 -0
- package/dist/design/colors.cjs.js.map +1 -0
- package/dist/{colors-CWaj9dFz.mjs → design/colors.es.js} +7 -7
- package/dist/design/colors.es.js.map +1 -0
- package/dist/design/darkTheme/colors.cjs.js +2 -0
- package/dist/design/darkTheme/colors.cjs.js.map +1 -0
- package/dist/{colors-Ceyo4oCJ.mjs → design/darkTheme/colors.es.js} +13 -13
- package/dist/design/darkTheme/colors.es.js.map +1 -0
- package/dist/design/darkTheme/stylesheet.cjs.js +2 -0
- package/dist/design/darkTheme/stylesheet.cjs.js.map +1 -0
- package/dist/design/darkTheme/stylesheet.es.js +52 -0
- package/dist/design/darkTheme/stylesheet.es.js.map +1 -0
- package/dist/design/generateStylesheet.cjs.js +2 -0
- package/dist/design/generateStylesheet.cjs.js.map +1 -0
- package/dist/design/generateStylesheet.es.js +26 -0
- package/dist/design/generateStylesheet.es.js.map +1 -0
- package/dist/design/lightTheme/colors.cjs.js +2 -0
- package/dist/design/lightTheme/colors.cjs.js.map +1 -0
- package/dist/{colors-DMkDnu4U.mjs → design/lightTheme/colors.es.js} +11 -11
- package/dist/design/lightTheme/colors.es.js.map +1 -0
- package/dist/design/lightTheme/stylesheet.cjs.js +2 -0
- package/dist/design/lightTheme/stylesheet.cjs.js.map +1 -0
- package/dist/design/lightTheme/stylesheet.es.js +52 -0
- package/dist/design/lightTheme/stylesheet.es.js.map +1 -0
- package/dist/design/theme.cjs.js +2 -0
- package/dist/design/theme.cjs.js.map +1 -0
- package/dist/design/theme.es.js +12 -0
- package/dist/design/theme.es.js.map +1 -0
- package/dist/hooks/useBreakpoint.cjs.js +2 -0
- package/dist/hooks/useBreakpoint.cjs.js.map +1 -0
- package/dist/hooks/useBreakpoint.es.js +17 -0
- package/dist/hooks/useBreakpoint.es.js.map +1 -0
- package/dist/hooks/useIsClosing.cjs.js +2 -0
- package/dist/hooks/useIsClosing.cjs.js.map +1 -0
- package/dist/hooks/useIsClosing.es.js +30 -0
- package/dist/hooks/useIsClosing.es.js.map +1 -0
- package/dist/hooks/useLockBodyScroll.cjs.js +2 -0
- package/dist/hooks/useLockBodyScroll.cjs.js.map +1 -0
- package/dist/hooks/useLockBodyScroll.es.js +14 -0
- package/dist/hooks/useLockBodyScroll.es.js.map +1 -0
- package/dist/hooks/usePalette.cjs.js +2 -0
- package/dist/hooks/usePalette.cjs.js.map +1 -0
- package/dist/hooks/usePalette.es.js +37 -0
- package/dist/hooks/usePalette.es.js.map +1 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.cjs.js.map +1 -1
- package/dist/hooks.es.js +8 -37
- package/dist/hooks.es.js.map +1 -1
- package/dist/icons.svg +10 -10
- package/dist/index.cjs.js +1 -36
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +60 -5421
- package/dist/index.es.js.map +1 -1
- package/dist/light.cjs.js +1 -1
- package/dist/light.cjs.js.map +1 -1
- package/dist/light.es.js +8 -55
- package/dist/light.es.js.map +1 -1
- package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js +2 -0
- package/dist/node_modules/@react-aria/button/dist/useButton.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/button/dist/useButton.es.js +55 -0
- package/dist/node_modules/@react-aria/button/dist/useButton.es.js.map +1 -0
- package/dist/node_modules/@react-aria/dialog/dist/useDialog.cjs.js +2 -0
- package/dist/node_modules/@react-aria/dialog/dist/useDialog.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/dialog/dist/useDialog.es.js +44 -0
- package/dist/node_modules/@react-aria/dialog/dist/useDialog.es.js.map +1 -0
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js +2 -0
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js +437 -0
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js.map +1 -0
- package/dist/node_modules/@react-aria/form/dist/useFormValidation.cjs.js +2 -0
- package/dist/node_modules/@react-aria/form/dist/useFormValidation.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/form/dist/useFormValidation.es.js +78 -0
- package/dist/node_modules/@react-aria/form/dist/useFormValidation.es.js.map +1 -0
- package/dist/node_modules/@react-aria/i18n/dist/context.cjs.js +2 -0
- package/dist/node_modules/@react-aria/i18n/dist/context.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/i18n/dist/context.es.js +11 -0
- package/dist/node_modules/@react-aria/i18n/dist/context.es.js.map +1 -0
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.cjs.js +2 -0
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.es.js +30 -0
- package/dist/node_modules/@react-aria/i18n/dist/useDefaultLocale.es.js.map +1 -0
- package/dist/node_modules/@react-aria/i18n/dist/utils.cjs.js +2 -0
- package/dist/node_modules/@react-aria/i18n/dist/utils.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/i18n/dist/utils.es.js +45 -0
- package/dist/node_modules/@react-aria/i18n/dist/utils.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/context.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/context.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/context.es.js +10 -0
- package/dist/node_modules/@react-aria/interactions/dist/context.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/createEventHandler.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/createEventHandler.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/createEventHandler.es.js +29 -0
- package/dist/node_modules/@react-aria/interactions/dist/createEventHandler.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.es.js +15 -0
- package/dist/node_modules/@react-aria/interactions/dist/focusSafely.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/textSelection.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/textSelection.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/textSelection.es.js +35 -0
- package/dist/node_modules/@react-aria/interactions/dist/textSelection.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.es.js +30 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.es.js +63 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.es.js +56 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js +42 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusable.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js +51 -0
- package/dist/node_modules/@react-aria/interactions/dist/useInteractOutside.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useKeyboard.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/useKeyboard.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/useKeyboard.es.js +13 -0
- package/dist/node_modules/@react-aria/interactions/dist/useKeyboard.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/usePress.cjs.js +8 -0
- package/dist/node_modules/@react-aria/interactions/dist/usePress.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/usePress.es.js +386 -0
- package/dist/node_modules/@react-aria/interactions/dist/usePress.es.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.cjs.js +2 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.es.js +92 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.es.js.map +1 -0
- package/dist/node_modules/@react-aria/label/dist/useField.cjs.js +2 -0
- package/dist/node_modules/@react-aria/label/dist/useField.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/label/dist/useField.es.js +36 -0
- package/dist/node_modules/@react-aria/label/dist/useField.es.js.map +1 -0
- package/dist/node_modules/@react-aria/label/dist/useLabel.cjs.js +2 -0
- package/dist/node_modules/@react-aria/label/dist/useLabel.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/label/dist/useLabel.es.js +23 -0
- package/dist/node_modules/@react-aria/label/dist/useLabel.es.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/Overlay.cjs.js +2 -0
- package/dist/node_modules/@react-aria/overlays/dist/Overlay.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/Overlay.es.js +16 -0
- package/dist/node_modules/@react-aria/overlays/dist/Overlay.es.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js +2 -0
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js +70 -0
- package/dist/node_modules/@react-aria/overlays/dist/ariaHideOutside.es.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js +2 -0
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js +32 -0
- package/dist/node_modules/@react-aria/overlays/dist/useModalOverlay.es.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js +2 -0
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js +53 -0
- package/dist/node_modules/@react-aria/overlays/dist/useOverlay.es.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js +2 -0
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js +100 -0
- package/dist/node_modules/@react-aria/overlays/dist/usePreventScroll.es.js.map +1 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadio.cjs.js +2 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadio.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadio.es.js +70 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadio.es.js.map +1 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadioGroup.cjs.js +2 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadioGroup.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadioGroup.es.js +80 -0
- package/dist/node_modules/@react-aria/radio/dist/useRadioGroup.es.js.map +1 -0
- package/dist/node_modules/@react-aria/radio/dist/utils.cjs.js +2 -0
- package/dist/node_modules/@react-aria/radio/dist/utils.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/radio/dist/utils.es.js +5 -0
- package/dist/node_modules/@react-aria/radio/dist/utils.es.js.map +1 -0
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.cjs.js +2 -0
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.es.js +19 -0
- package/dist/node_modules/@react-aria/ssr/dist/SSRProvider.es.js.map +1 -0
- package/dist/node_modules/@react-aria/switch/dist/useSwitch.cjs.js +2 -0
- package/dist/node_modules/@react-aria/switch/dist/useSwitch.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/switch/dist/useSwitch.es.js +20 -0
- package/dist/node_modules/@react-aria/switch/dist/useSwitch.es.js.map +1 -0
- package/dist/node_modules/@react-aria/toggle/dist/useToggle.cjs.js +2 -0
- package/dist/node_modules/@react-aria/toggle/dist/useToggle.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/toggle/dist/useToggle.es.js +60 -0
- package/dist/node_modules/@react-aria/toggle/dist/useToggle.es.js.map +1 -0
- package/dist/node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.cjs.js +2 -0
- package/dist/node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.es.js +41 -0
- package/dist/node_modules/@react-aria/visually-hidden/dist/VisuallyHidden.es.js.map +1 -0
- package/dist/node_modules/@react-stately/form/dist/useFormValidationState.cjs.js +2 -0
- package/dist/node_modules/@react-stately/form/dist/useFormValidationState.cjs.js.map +1 -0
- package/dist/node_modules/@react-stately/form/dist/useFormValidationState.es.js +110 -0
- package/dist/node_modules/@react-stately/form/dist/useFormValidationState.es.js.map +1 -0
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js +2 -0
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.cjs.js.map +1 -0
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js +30 -0
- package/dist/node_modules/@react-stately/overlays/dist/useOverlayTriggerState.es.js.map +1 -0
- package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.cjs.js +2 -0
- package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.cjs.js.map +1 -0
- package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.es.js +35 -0
- package/dist/node_modules/@react-stately/radio/dist/useRadioGroupState.es.js.map +1 -0
- package/dist/node_modules/@react-stately/toggle/dist/useToggleState.cjs.js +2 -0
- package/dist/node_modules/@react-stately/toggle/dist/useToggleState.cjs.js.map +1 -0
- package/dist/node_modules/@react-stately/toggle/dist/useToggleState.es.js +22 -0
- package/dist/node_modules/@react-stately/toggle/dist/useToggleState.es.js.map +1 -0
- package/dist/node_modules/@react-stately/utils/dist/useControlledState.cjs.js +2 -0
- package/dist/node_modules/@react-stately/utils/dist/useControlledState.cjs.js.map +1 -0
- package/dist/node_modules/@react-stately/utils/dist/useControlledState.es.js +31 -0
- package/dist/node_modules/@react-stately/utils/dist/useControlledState.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.es.js +9 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.es.js +8 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.es.js +13 -0
- package/dist/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.es.js +9 -0
- package/dist/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.es.js +11 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_get.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.es.js +9 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.es.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.cjs.js +2 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.cjs.js.map +1 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.es.js +11 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_set.es.js.map +1 -0
- package/dist/node_modules/color2k/dist/index.exports.import.es.cjs.js +2 -0
- package/dist/node_modules/color2k/dist/index.exports.import.es.cjs.js.map +1 -0
- package/dist/node_modules/color2k/dist/index.exports.import.es.es.js +171 -0
- package/dist/node_modules/color2k/dist/index.exports.import.es.es.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js +23 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +609 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs.js +10 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.cjs.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.es.js +29 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.es.js.map +1 -0
- package/dist/node_modules/react/jsx-runtime.cjs.js +2 -0
- package/dist/node_modules/react/jsx-runtime.cjs.js.map +1 -0
- package/dist/node_modules/react/jsx-runtime.es.js +9 -0
- package/dist/node_modules/react/jsx-runtime.es.js.map +1 -0
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.cjs.js +2 -0
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.cjs.js.map +1 -0
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.es.js +37 -0
- package/dist/node_modules/react-aria-components/dist/OverlayArrow.es.js.map +1 -0
- package/dist/node_modules/react-aria-components/dist/Tooltip.cjs.js +2 -0
- package/dist/node_modules/react-aria-components/dist/Tooltip.cjs.js.map +1 -0
- package/dist/node_modules/react-aria-components/dist/Tooltip.es.js +98 -0
- package/dist/node_modules/react-aria-components/dist/Tooltip.es.js.map +1 -0
- package/dist/node_modules/react-aria-components/dist/utils.cjs.js +2 -0
- package/dist/node_modules/react-aria-components/dist/utils.cjs.js.map +1 -0
- package/dist/node_modules/react-aria-components/dist/utils.es.js +89 -0
- package/dist/node_modules/react-aria-components/dist/utils.es.js.map +1 -0
- package/dist/theme.cjs.js +1 -1
- package/dist/theme.cjs.js.map +1 -1
- package/dist/theme.es.js +9 -15
- package/dist/theme.es.js.map +1 -1
- package/dist/utils/color2k.cjs.js +2 -0
- package/dist/utils/color2k.cjs.js.map +1 -0
- package/dist/utils/color2k.es.js +14 -0
- package/dist/utils/color2k.es.js.map +1 -0
- package/dist/utils/copy.cjs.js +2 -0
- package/dist/utils/copy.cjs.js.map +1 -0
- package/dist/utils/copy.es.js +31 -0
- package/dist/utils/copy.es.js.map +1 -0
- package/dist/utils/image.cjs.js +2 -0
- package/dist/utils/image.cjs.js.map +1 -0
- package/dist/utils/image.es.js +28 -0
- package/dist/utils/image.es.js.map +1 -0
- package/dist/utils/navigation.cjs.js +2 -0
- package/dist/utils/navigation.cjs.js.map +1 -0
- package/dist/utils/navigation.es.js +12 -0
- package/dist/utils/navigation.es.js.map +1 -0
- package/dist/utils/palette.cjs.js +2 -0
- package/dist/utils/palette.cjs.js.map +1 -0
- package/dist/utils/palette.es.js +183 -0
- package/dist/utils/palette.es.js.map +1 -0
- package/dist/utils/string.cjs.js +2 -0
- package/dist/utils/string.cjs.js.map +1 -0
- package/dist/utils/string.es.js +8 -0
- package/dist/utils/string.es.js.map +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +19 -15
- package/dist/utils.es.js.map +1 -1
- package/package.json +140 -140
- package/dist/breakpoint-9y1_8U_b.mjs.map +0 -1
- package/dist/breakpoint-DtqbboOa.js +0 -2
- package/dist/breakpoint-DtqbboOa.js.map +0 -1
- package/dist/color2k-CpDB_dpw.mjs +0 -168
- package/dist/color2k-CpDB_dpw.mjs.map +0 -1
- package/dist/color2k-DCgwXUem.js +0 -2
- package/dist/color2k-DCgwXUem.js.map +0 -1
- package/dist/colors-CWaj9dFz.mjs.map +0 -1
- package/dist/colors-CebzFjpe.js +0 -2
- package/dist/colors-CebzFjpe.js.map +0 -1
- package/dist/colors-Ceyo4oCJ.mjs.map +0 -1
- package/dist/colors-CmSJBHaf.js +0 -2
- package/dist/colors-CmSJBHaf.js.map +0 -1
- package/dist/colors-DL1dYffC.js +0 -2
- package/dist/colors-DL1dYffC.js.map +0 -1
- package/dist/colors-DMkDnu4U.mjs.map +0 -1
- package/dist/image-CUSfY1_T.js +0 -2
- package/dist/image-CUSfY1_T.js.map +0 -1
- package/dist/image-DFyN0Kd9.mjs +0 -207
- package/dist/image-DFyN0Kd9.mjs.map +0 -1
- package/dist/navigation-BB0MBIiR.js +0 -2
- package/dist/navigation-BB0MBIiR.js.map +0 -1
- package/dist/navigation-Bj7Pex9j.mjs +0 -43
- package/dist/navigation-Bj7Pex9j.mjs.map +0 -1
- package/dist/useBreakpoint-CjRyGKN-.mjs +0 -53
- package/dist/useBreakpoint-CjRyGKN-.mjs.map +0 -1
- package/dist/useBreakpoint-DA-JqOu3.js +0 -2
- package/dist/useBreakpoint-DA-JqOu3.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Elevation.es.js","sources":["../../../src/components/Elevation/Elevation.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ReactNode } from \"react\";\r\nimport { transparentize, mix } from \"color2k\";\r\nimport { useTheme } from \"../ThemeProvider\";\r\nimport \"./Elevation.css\";\r\n\r\nexport interface ElevationProps {\r\n /**\r\n * The content to be displayed within the elevation.\r\n */\r\n children?: ReactNode;\r\n /**\r\n * The data-testid attribute for testing purposes.\r\n */\r\n \"data-testid\"?: string;\r\n /**\r\n * Whether the elevation should have a background gradient.\r\n * @important only works in custom dark mode\r\n * @default false\r\n */\r\n hasPrimaryGradient?: boolean;\r\n}\r\n\r\n/**\r\n * Elevation component creates a visual elevation effect using the theme-aware background color.\r\n *\r\n * This component is designed to be used as a visual layer that sits on top of other content\r\n * to create a sense of depth or hierarchy in the UI. It uses the `--proton-control__background-color-light`\r\n * CSS variable which is theme-aware and will adapt to light, dark themes.\r\n *\r\n * API:\r\n * - {@link ElevationProps}\r\n */\r\nexport const Elevation = ({\r\n children,\r\n hasPrimaryGradient = false,\r\n \"data-testid\": dataTestId,\r\n}: ElevationProps) => {\r\n const { hasPalette, palette, style } = useTheme();\r\n\r\n const defaultBg = style[\"--proton-control__background-color-light\"];\r\n let primaryDark = defaultBg;\r\n let secondaryDark = transparentize(defaultBg, 0.01);\r\n\r\n if (hasPalette) {\r\n primaryDark = transparentize(defaultBg, 0.1);\r\n secondaryDark = transparentize(defaultBg, 0.12);\r\n if (hasPrimaryGradient) {\r\n const basePrimary = transparentize(palette.PRIMARY.MEDIUM_LIGHT, 0.88);\r\n const baseSecondary = transparentize(palette.PRIMARY.LIGHT, 0.84);\r\n primaryDark = mix(primaryDark, basePrimary, 0.15);\r\n secondaryDark = mix(secondaryDark, baseSecondary, 0.15);\r\n }\r\n }\r\n\r\n return (\r\n <div\r\n className=\"proton-Elevation\"\r\n data-testid={dataTestId}\r\n role=\"presentation\"\r\n aria-label=\"Elevated content area\"\r\n style={{\r\n background: `linear-gradient(to top left, ${primaryDark}, ${secondaryDark})`,\r\n }}\r\n >\r\n {children}\r\n </div>\r\n );\r\n};\r\n"],"names":["Elevation","children","hasPrimaryGradient","dataTestId","hasPalette","palette","style","useTheme","defaultBg","primaryDark","secondaryDark","transparentize","basePrimary","baseSecondary","mix","jsx"],"mappings":";;;;AAkCO,MAAMA,IAAY,CAAC;AAAA,EACxB,UAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,eAAeC;AACjB,MAAsB;AACpB,QAAM,EAAE,YAAAC,GAAY,SAAAC,GAAS,OAAAC,MAAUC,EAAS,GAE1CC,IAAYF,EAAM,0CAA0C;AAClE,MAAIG,IAAcD,GACdE,IAAgBC,EAAeH,GAAW,IAAI;AAElD,MAAIJ,MACYK,IAAAE,EAAeH,GAAW,GAAG,GAC3BE,IAAAC,EAAeH,GAAW,IAAI,GAC1CN,IAAoB;AACtB,UAAMU,IAAcD,EAAeN,EAAQ,QAAQ,cAAc,IAAI,GAC/DQ,IAAgBF,EAAeN,EAAQ,QAAQ,OAAO,IAAI;AAClD,IAAAI,IAAAK,EAAIL,GAAaG,GAAa,IAAI,GAChCF,IAAAI,EAAIJ,GAAeG,GAAe,IAAI;AAAA,EACxD;AAIA,SAAAE,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAaZ;AAAA,MACb,MAAK;AAAA,MACL,cAAW;AAAA,MACX,OAAO;AAAA,QACL,YAAY,gCAAgCM,CAAW,KAAKC,CAAa;AAAA,MAC3E;AAAA,MAEC,UAAAT;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../node_modules/react/jsx-runtime.cjs.js"),o=require("../../assets/svg/icons.svg.cjs.js");function s(t){let i={height:t.size||void 0,width:t.size||void 0,color:t.color||void 0};return t.id==="chevron-right"?e.jsxRuntimeExports.jsx(n,{direction:"right",...i}):t.id==="chevron-left"?e.jsxRuntimeExports.jsx(n,{direction:"left",...i}):t.id==="chevron-up"?e.jsxRuntimeExports.jsx(n,{direction:"up",...i}):t.id==="chevron-down"?e.jsxRuntimeExports.jsx(n,{direction:"down",...i}):e.jsxRuntimeExports.jsx("svg",{style:i,...t,children:e.jsxRuntimeExports.jsx("use",{href:`${o.default}#${t.id}`})})}function n({direction:t,...i}){const r={right:0,down:90,left:180,up:270};return e.jsxRuntimeExports.jsx("svg",{viewBox:"0 0 16 16",style:{transform:`rotate(${r[t]}deg)`},...i,children:e.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04"})})}exports.Icon=s;
|
|
2
|
+
//# sourceMappingURL=Icon.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.cjs.js","sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import { SVGProps } from \"react\";\r\nimport iconURL from \"../../../assets/svg/icons.svg\";\r\n\r\ntype IconID =\r\n | \"external-link\"\r\n | \"caret-down\"\r\n | \"caret-right\"\r\n | \"chevron-right\"\r\n | \"chevron-left\"\r\n | \"chevron-up\"\r\n | \"chevron-down\";\r\n\r\n/*\r\n *\r\n * 🚧 UNDER CONSTRUCTION 🚧\r\n *\r\n */\r\n\r\nexport interface IconProps {\r\n /**\r\n * The spritesheet ID defined in the Icons spritesheet.\r\n */\r\n id: IconID;\r\n\r\n /**\r\n * The desired width/height of the icon. Accepts any valid CSS unit.\r\n */\r\n size?: number | string;\r\n\r\n /**\r\n * The stroke color of the icon.\r\n */\r\n color?: string;\r\n}\r\n\r\n/**\r\n * An icon component that displays SVG icons from a sprite sheet or inline.\r\n *\r\n * API:\r\n * - {@link IconProps}\r\n */\r\nexport function Icon(props: IconProps) {\r\n let iconStyle = {\r\n height: props.size || undefined,\r\n width: props.size || undefined,\r\n color: props.color || undefined,\r\n };\r\n\r\n if (props.id === \"chevron-right\") {\r\n return <Chevron direction=\"right\" {...iconStyle} />;\r\n }\r\n\r\n if (props.id === \"chevron-left\") {\r\n return <Chevron direction=\"left\" {...iconStyle} />;\r\n }\r\n\r\n if (props.id === \"chevron-up\") {\r\n return <Chevron direction=\"up\" {...iconStyle} />;\r\n }\r\n\r\n if (props.id === \"chevron-down\") {\r\n return <Chevron direction=\"down\" {...iconStyle} />;\r\n }\r\n\r\n return (\r\n <svg style={iconStyle} {...props}>\r\n <use href={`${iconURL}#${props.id}`} />\r\n </svg>\r\n );\r\n}\r\n\r\nfunction Chevron({\r\n direction,\r\n ...props\r\n}: {\r\n direction: \"right\" | \"left\" | \"up\" | \"down\";\r\n} & SVGProps<SVGSVGElement>) {\r\n const rotateMap = {\r\n right: 0,\r\n down: 90,\r\n left: 180,\r\n up: 270,\r\n };\r\n\r\n return (\r\n <svg\r\n viewBox=\"0 0 16 16\"\r\n style={{\r\n transform: `rotate(${rotateMap[direction]}deg)`,\r\n }}\r\n {...props}\r\n >\r\n {/* NOTE: this is the path for the \"right\" direction */}\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04\"\r\n />\r\n </svg>\r\n );\r\n}\r\n"],"names":["Icon","props","iconStyle","jsx","Chevron","iconURL","direction","rotateMap"],"mappings":"8LAyCO,SAASA,EAAKC,EAAkB,CACrC,IAAIC,EAAY,CACd,OAAQD,EAAM,MAAQ,OACtB,MAAOA,EAAM,MAAQ,OACrB,MAAOA,EAAM,OAAS,MAAA,EAGpB,OAAAA,EAAM,KAAO,gBACPE,EAAAA,kBAAAA,IAAAC,EAAA,CAAQ,UAAU,QAAS,GAAGF,CAAW,CAAA,EAG/CD,EAAM,KAAO,eACPE,EAAAA,kBAAAA,IAAAC,EAAA,CAAQ,UAAU,OAAQ,GAAGF,CAAW,CAAA,EAG9CD,EAAM,KAAO,aACPE,EAAAA,kBAAAA,IAAAC,EAAA,CAAQ,UAAU,KAAM,GAAGF,CAAW,CAAA,EAG5CD,EAAM,KAAO,eACPE,EAAAA,kBAAAA,IAAAC,EAAA,CAAQ,UAAU,OAAQ,GAAGF,CAAW,CAAA,EAI/CC,EAAA,kBAAA,IAAA,MAAA,CAAI,MAAOD,EAAY,GAAGD,EACzB,SAAAE,wBAAC,MAAI,CAAA,KAAM,GAAGE,EAAAA,OAAO,IAAIJ,EAAM,EAAE,GAAI,CACvC,CAAA,CAEJ,CAEA,SAASG,EAAQ,CACf,UAAAE,EACA,GAAGL,CACL,EAE6B,CAC3B,MAAMM,EAAY,CAChB,MAAO,EACP,KAAM,GACN,KAAM,IACN,GAAI,GAAA,EAIJ,OAAAJ,EAAA,kBAAA,IAAC,MAAA,CACC,QAAQ,YACR,MAAO,CACL,UAAW,UAAUI,EAAUD,CAAS,CAAC,MAC3C,EACC,GAAGL,EAGJ,SAAAE,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,kIAAA,CACJ,CAAA,CAAA,CAGN"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { j as t } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import o from "../../assets/svg/icons.svg.es.js";
|
|
3
|
+
function l(i) {
|
|
4
|
+
let e = {
|
|
5
|
+
height: i.size || void 0,
|
|
6
|
+
width: i.size || void 0,
|
|
7
|
+
color: i.color || void 0
|
|
8
|
+
};
|
|
9
|
+
return i.id === "chevron-right" ? /* @__PURE__ */ t.jsx(r, { direction: "right", ...e }) : i.id === "chevron-left" ? /* @__PURE__ */ t.jsx(r, { direction: "left", ...e }) : i.id === "chevron-up" ? /* @__PURE__ */ t.jsx(r, { direction: "up", ...e }) : i.id === "chevron-down" ? /* @__PURE__ */ t.jsx(r, { direction: "down", ...e }) : /* @__PURE__ */ t.jsx("svg", { style: e, ...i, children: /* @__PURE__ */ t.jsx("use", { href: `${o}#${i.id}` }) });
|
|
10
|
+
}
|
|
11
|
+
function r({
|
|
12
|
+
direction: i,
|
|
13
|
+
...e
|
|
14
|
+
}) {
|
|
15
|
+
const n = {
|
|
16
|
+
right: 0,
|
|
17
|
+
down: 90,
|
|
18
|
+
left: 180,
|
|
19
|
+
up: 270
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ t.jsx(
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
viewBox: "0 0 16 16",
|
|
25
|
+
style: {
|
|
26
|
+
transform: `rotate(${n[i]}deg)`
|
|
27
|
+
},
|
|
28
|
+
...e,
|
|
29
|
+
children: /* @__PURE__ */ t.jsx(
|
|
30
|
+
"path",
|
|
31
|
+
{
|
|
32
|
+
fill: "currentColor",
|
|
33
|
+
d: "M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04"
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
l as Icon
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=Icon.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.es.js","sources":["../../../src/components/Icon/Icon.tsx"],"sourcesContent":["import { SVGProps } from \"react\";\r\nimport iconURL from \"../../../assets/svg/icons.svg\";\r\n\r\ntype IconID =\r\n | \"external-link\"\r\n | \"caret-down\"\r\n | \"caret-right\"\r\n | \"chevron-right\"\r\n | \"chevron-left\"\r\n | \"chevron-up\"\r\n | \"chevron-down\";\r\n\r\n/*\r\n *\r\n * 🚧 UNDER CONSTRUCTION 🚧\r\n *\r\n */\r\n\r\nexport interface IconProps {\r\n /**\r\n * The spritesheet ID defined in the Icons spritesheet.\r\n */\r\n id: IconID;\r\n\r\n /**\r\n * The desired width/height of the icon. Accepts any valid CSS unit.\r\n */\r\n size?: number | string;\r\n\r\n /**\r\n * The stroke color of the icon.\r\n */\r\n color?: string;\r\n}\r\n\r\n/**\r\n * An icon component that displays SVG icons from a sprite sheet or inline.\r\n *\r\n * API:\r\n * - {@link IconProps}\r\n */\r\nexport function Icon(props: IconProps) {\r\n let iconStyle = {\r\n height: props.size || undefined,\r\n width: props.size || undefined,\r\n color: props.color || undefined,\r\n };\r\n\r\n if (props.id === \"chevron-right\") {\r\n return <Chevron direction=\"right\" {...iconStyle} />;\r\n }\r\n\r\n if (props.id === \"chevron-left\") {\r\n return <Chevron direction=\"left\" {...iconStyle} />;\r\n }\r\n\r\n if (props.id === \"chevron-up\") {\r\n return <Chevron direction=\"up\" {...iconStyle} />;\r\n }\r\n\r\n if (props.id === \"chevron-down\") {\r\n return <Chevron direction=\"down\" {...iconStyle} />;\r\n }\r\n\r\n return (\r\n <svg style={iconStyle} {...props}>\r\n <use href={`${iconURL}#${props.id}`} />\r\n </svg>\r\n );\r\n}\r\n\r\nfunction Chevron({\r\n direction,\r\n ...props\r\n}: {\r\n direction: \"right\" | \"left\" | \"up\" | \"down\";\r\n} & SVGProps<SVGSVGElement>) {\r\n const rotateMap = {\r\n right: 0,\r\n down: 90,\r\n left: 180,\r\n up: 270,\r\n };\r\n\r\n return (\r\n <svg\r\n viewBox=\"0 0 16 16\"\r\n style={{\r\n transform: `rotate(${rotateMap[direction]}deg)`,\r\n }}\r\n {...props}\r\n >\r\n {/* NOTE: this is the path for the \"right\" direction */}\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M5.74 3.2a.75.75 0 0 0-.04 1.06L9.227 8L5.7 11.74a.75.75 0 1 0 1.1 1.02l4-4.25a.75.75 0 0 0 0-1.02l-4-4.25a.75.75 0 0 0-1.06-.04\"\r\n />\r\n </svg>\r\n );\r\n}\r\n"],"names":["Icon","props","iconStyle","jsx","Chevron","iconURL","direction","rotateMap"],"mappings":";;AAyCO,SAASA,EAAKC,GAAkB;AACrC,MAAIC,IAAY;AAAA,IACd,QAAQD,EAAM,QAAQ;AAAA,IACtB,OAAOA,EAAM,QAAQ;AAAA,IACrB,OAAOA,EAAM,SAAS;AAAA,EAAA;AAGpB,SAAAA,EAAM,OAAO,kBACPE,gBAAAA,EAAAA,IAAAC,GAAA,EAAQ,WAAU,SAAS,GAAGF,EAAW,CAAA,IAG/CD,EAAM,OAAO,iBACPE,gBAAAA,EAAAA,IAAAC,GAAA,EAAQ,WAAU,QAAQ,GAAGF,EAAW,CAAA,IAG9CD,EAAM,OAAO,eACPE,gBAAAA,EAAAA,IAAAC,GAAA,EAAQ,WAAU,MAAM,GAAGF,EAAW,CAAA,IAG5CD,EAAM,OAAO,iBACPE,gBAAAA,EAAAA,IAAAC,GAAA,EAAQ,WAAU,QAAQ,GAAGF,EAAW,CAAA,IAI/CC,gBAAAA,EAAA,IAAA,OAAA,EAAI,OAAOD,GAAY,GAAGD,GACzB,UAAAE,gBAAAA,MAAC,OAAI,EAAA,MAAM,GAAGE,CAAO,IAAIJ,EAAM,EAAE,IAAI,EACvC,CAAA;AAEJ;AAEA,SAASG,EAAQ;AAAA,EACf,WAAAE;AAAA,EACA,GAAGL;AACL,GAE6B;AAC3B,QAAMM,IAAY;AAAA,IAChB,OAAO;AAAA,IACP,MAAM;AAAA,IACN,MAAM;AAAA,IACN,IAAI;AAAA,EAAA;AAIJ,SAAAJ,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,OAAO;AAAA,QACL,WAAW,UAAUI,EAAUD,CAAS,CAAC;AAAA,MAC3C;AAAA,MACC,GAAGL;AAAA,MAGJ,UAAAE,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,GAAE;AAAA,QAAA;AAAA,MACJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../node_modules/react/jsx-runtime.cjs.js");;/* empty css */const c=require("../ThemeProvider.cjs.js"),u=require("../../node_modules/color2k/dist/index.exports.import.es.cjs.js"),l=r=>{const[s,e,n]=r,t=s+e+n;if(t<65){const o=t/100;return`rgba(255, 255, 255, ${Math.max(.14,.36-o)})`}return""};function g({image:r,imageUrl:s="",onLoad:e}){const{palette:n}=c.useTheme(),t=u.parseToRgba(n.BASE_COLOR),o=l(t);return a.jsxRuntimeExports.jsxs("div",{id:"image-background","aria-label":"Background overlay",role:"dialog","aria-modal":"true",className:"proton-ScreenOverlay__background",children:[r?a.jsxRuntimeExports.jsx("div",{"aria-hidden":"true",children:r}):a.jsxRuntimeExports.jsx("img",{alt:"",src:s,className:"proton-ScreenOverlay__image",onLoad:i=>e==null?void 0:e(i.currentTarget),"aria-hidden":"true"}),a.jsxRuntimeExports.jsx("div",{className:"proton-ScreenOverlay__blur","aria-hidden":"true",style:{background:o}})]})}exports.ImageBackground=g;
|
|
2
|
+
//# sourceMappingURL=ImageBackground.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageBackground.cjs.js","sources":["../../../src/components/ImageBackground/ImageBackground.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport \"../ScreenOverlay/ScreenOverlay.css\";\r\nimport { useTheme } from \"../ThemeProvider\";\r\nimport { parseToRgba } from \"color2k\";\r\n\r\ninterface ImageBackgroundProps {\r\n /**\r\n * Manually display a background image. Useful for server-side rendering.\r\n * @important When using this prop, you must style your own image component appropriately.\r\n * The component will be placed directly in the background without additional styling.\r\n */\r\n image?: React.ReactNode;\r\n /**\r\n * The URL of the image to display in the background.\r\n * @important Client-side only. Cannot be used in Server Components.\r\n * When using this prop, the image will be automatically styled with the background effect.\r\n */\r\n imageUrl?: string;\r\n /**\r\n * Callback function to handle the image load event.\r\n * @important Client-side only. Cannot be used in Server Components.\r\n */\r\n onLoad?: (image: HTMLImageElement) => void;\r\n}\r\n\r\n/**\r\n * Calculates a background color with appropriate opacity based on the brightness of the base color.\r\n * For dark colors (sum of RGB values < 65), returns a white overlay with variable opacity.\r\n * For brighter colors, returns an empty string (no overlay needed).\r\n */\r\nconst getBgWhiteOverlayColor = (color: [number, number, number, number]) => {\r\n const [r, g, b] = color;\r\n const brightness = r + g + b;\r\n\r\n // Only apply white overlay for dark backgrounds\r\n if (brightness < 65) {\r\n // Calculate opacity inversely proportional to brightness\r\n // Brighter colors get less opacity, with a minimum of 0.1\r\n const brightnessPercentage = brightness / 100;\r\n const opacity = Math.max(0.14, 0.36 - brightnessPercentage);\r\n\r\n return `rgba(255, 255, 255, ${opacity})`;\r\n }\r\n\r\n return \"\";\r\n};\r\n\r\n/**\r\n * ImageOverlay component for displaying an image with a blur effect.\r\n *\r\n * API:\r\n * - {@link ImageBackgroundProps}\r\n */\r\nexport function ImageBackground({\r\n image,\r\n imageUrl = \"\",\r\n onLoad,\r\n}: ImageBackgroundProps) {\r\n const { palette } = useTheme();\r\n const baseColor = parseToRgba(palette.BASE_COLOR);\r\n const backgroundColor = getBgWhiteOverlayColor(baseColor);\r\n\r\n return (\r\n <div\r\n id=\"image-background\"\r\n aria-label=\"Background overlay\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n className=\"proton-ScreenOverlay__background\"\r\n >\r\n {image ? (\r\n <div aria-hidden=\"true\">{image}</div>\r\n ) : (\r\n <img\r\n alt=\"\" // Decorative image\r\n src={imageUrl}\r\n className=\"proton-ScreenOverlay__image\"\r\n onLoad={(event) => onLoad?.(event.currentTarget)}\r\n aria-hidden=\"true\"\r\n />\r\n )}\r\n <div\r\n className=\"proton-ScreenOverlay__blur\"\r\n aria-hidden=\"true\"\r\n style={{\r\n background: backgroundColor,\r\n }}\r\n />\r\n </div>\r\n );\r\n}\r\n"],"names":["getBgWhiteOverlayColor","color","r","g","b","brightness","brightnessPercentage","ImageBackground","image","imageUrl","onLoad","palette","useTheme","baseColor","parseToRgba","backgroundColor","jsxs","jsx","event"],"mappings":"2TA+BMA,EAA0BC,GAA4C,CAC1E,KAAM,CAACC,EAAGC,EAAGC,CAAC,EAAIH,EACZI,EAAaH,EAAIC,EAAIC,EAG3B,GAAIC,EAAa,GAAI,CAGnB,MAAMC,EAAuBD,EAAa,IAG1C,MAAO,uBAFS,KAAK,IAAI,IAAM,IAAOC,CAAoB,CAErB,GACvC,CAEO,MAAA,EACT,EAQO,SAASC,EAAgB,CAC9B,MAAAC,EACA,SAAAC,EAAW,GACX,OAAAC,CACF,EAAyB,CACjB,KAAA,CAAE,QAAAC,GAAYC,EAAAA,WACdC,EAAYC,EAAAA,YAAYH,EAAQ,UAAU,EAC1CI,EAAkBf,EAAuBa,CAAS,EAGtD,OAAAG,EAAA,kBAAA,KAAC,MAAA,CACC,GAAG,mBACH,aAAW,qBACX,KAAK,SACL,aAAW,OACX,UAAU,mCAET,SAAA,CAAAR,EACES,EAAAA,kBAAAA,IAAA,MAAA,CAAI,cAAY,OAAQ,UAAM,CAAA,EAE/BA,EAAA,kBAAA,IAAC,MAAA,CACC,IAAI,GACJ,IAAKR,EACL,UAAU,8BACV,OAASS,GAAUR,GAAA,YAAAA,EAASQ,EAAM,eAClC,cAAY,MAAA,CACd,EAEFD,EAAA,kBAAA,IAAC,MAAA,CACC,UAAU,6BACV,cAAY,OACZ,MAAO,CACL,WAAYF,CACd,CAAA,CACF,CAAA,CAAA,CAAA,CAGN"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { j as t } from "../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { useTheme as c } from "../ThemeProvider.es.js";
|
|
4
|
+
import { parseToRgba as l } from "../../node_modules/color2k/dist/index.exports.import.es.es.js";
|
|
5
|
+
const g = (e) => {
|
|
6
|
+
const [o, r, n] = e, a = o + r + n;
|
|
7
|
+
if (a < 65) {
|
|
8
|
+
const s = a / 100;
|
|
9
|
+
return `rgba(255, 255, 255, ${Math.max(0.14, 0.36 - s)})`;
|
|
10
|
+
}
|
|
11
|
+
return "";
|
|
12
|
+
};
|
|
13
|
+
function b({
|
|
14
|
+
image: e,
|
|
15
|
+
imageUrl: o = "",
|
|
16
|
+
onLoad: r
|
|
17
|
+
}) {
|
|
18
|
+
const { palette: n } = c(), a = l(n.BASE_COLOR), s = g(a);
|
|
19
|
+
return /* @__PURE__ */ t.jsxs(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
id: "image-background",
|
|
23
|
+
"aria-label": "Background overlay",
|
|
24
|
+
role: "dialog",
|
|
25
|
+
"aria-modal": "true",
|
|
26
|
+
className: "proton-ScreenOverlay__background",
|
|
27
|
+
children: [
|
|
28
|
+
e ? /* @__PURE__ */ t.jsx("div", { "aria-hidden": "true", children: e }) : /* @__PURE__ */ t.jsx(
|
|
29
|
+
"img",
|
|
30
|
+
{
|
|
31
|
+
alt: "",
|
|
32
|
+
src: o,
|
|
33
|
+
className: "proton-ScreenOverlay__image",
|
|
34
|
+
onLoad: (i) => r == null ? void 0 : r(i.currentTarget),
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ t.jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: "proton-ScreenOverlay__blur",
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
style: {
|
|
44
|
+
background: s
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
b as ImageBackground
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=ImageBackground.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageBackground.es.js","sources":["../../../src/components/ImageBackground/ImageBackground.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport \"../ScreenOverlay/ScreenOverlay.css\";\r\nimport { useTheme } from \"../ThemeProvider\";\r\nimport { parseToRgba } from \"color2k\";\r\n\r\ninterface ImageBackgroundProps {\r\n /**\r\n * Manually display a background image. Useful for server-side rendering.\r\n * @important When using this prop, you must style your own image component appropriately.\r\n * The component will be placed directly in the background without additional styling.\r\n */\r\n image?: React.ReactNode;\r\n /**\r\n * The URL of the image to display in the background.\r\n * @important Client-side only. Cannot be used in Server Components.\r\n * When using this prop, the image will be automatically styled with the background effect.\r\n */\r\n imageUrl?: string;\r\n /**\r\n * Callback function to handle the image load event.\r\n * @important Client-side only. Cannot be used in Server Components.\r\n */\r\n onLoad?: (image: HTMLImageElement) => void;\r\n}\r\n\r\n/**\r\n * Calculates a background color with appropriate opacity based on the brightness of the base color.\r\n * For dark colors (sum of RGB values < 65), returns a white overlay with variable opacity.\r\n * For brighter colors, returns an empty string (no overlay needed).\r\n */\r\nconst getBgWhiteOverlayColor = (color: [number, number, number, number]) => {\r\n const [r, g, b] = color;\r\n const brightness = r + g + b;\r\n\r\n // Only apply white overlay for dark backgrounds\r\n if (brightness < 65) {\r\n // Calculate opacity inversely proportional to brightness\r\n // Brighter colors get less opacity, with a minimum of 0.1\r\n const brightnessPercentage = brightness / 100;\r\n const opacity = Math.max(0.14, 0.36 - brightnessPercentage);\r\n\r\n return `rgba(255, 255, 255, ${opacity})`;\r\n }\r\n\r\n return \"\";\r\n};\r\n\r\n/**\r\n * ImageOverlay component for displaying an image with a blur effect.\r\n *\r\n * API:\r\n * - {@link ImageBackgroundProps}\r\n */\r\nexport function ImageBackground({\r\n image,\r\n imageUrl = \"\",\r\n onLoad,\r\n}: ImageBackgroundProps) {\r\n const { palette } = useTheme();\r\n const baseColor = parseToRgba(palette.BASE_COLOR);\r\n const backgroundColor = getBgWhiteOverlayColor(baseColor);\r\n\r\n return (\r\n <div\r\n id=\"image-background\"\r\n aria-label=\"Background overlay\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n className=\"proton-ScreenOverlay__background\"\r\n >\r\n {image ? (\r\n <div aria-hidden=\"true\">{image}</div>\r\n ) : (\r\n <img\r\n alt=\"\" // Decorative image\r\n src={imageUrl}\r\n className=\"proton-ScreenOverlay__image\"\r\n onLoad={(event) => onLoad?.(event.currentTarget)}\r\n aria-hidden=\"true\"\r\n />\r\n )}\r\n <div\r\n className=\"proton-ScreenOverlay__blur\"\r\n aria-hidden=\"true\"\r\n style={{\r\n background: backgroundColor,\r\n }}\r\n />\r\n </div>\r\n );\r\n}\r\n"],"names":["getBgWhiteOverlayColor","color","r","g","b","brightness","brightnessPercentage","ImageBackground","image","imageUrl","onLoad","palette","useTheme","baseColor","parseToRgba","backgroundColor","jsxs","jsx","event"],"mappings":";;;;AA+BA,MAAMA,IAAyB,CAACC,MAA4C;AAC1E,QAAM,CAACC,GAAGC,GAAGC,CAAC,IAAIH,GACZI,IAAaH,IAAIC,IAAIC;AAG3B,MAAIC,IAAa,IAAI;AAGnB,UAAMC,IAAuBD,IAAa;AAG1C,WAAO,uBAFS,KAAK,IAAI,MAAM,OAAOC,CAAoB,CAErB;AAAA,EACvC;AAEO,SAAA;AACT;AAQO,SAASC,EAAgB;AAAA,EAC9B,OAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,QAAAC;AACF,GAAyB;AACjB,QAAA,EAAE,SAAAC,MAAYC,KACdC,IAAYC,EAAYH,EAAQ,UAAU,GAC1CI,IAAkBf,EAAuBa,CAAS;AAGtD,SAAAG,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,IAAG;AAAA,MACH,cAAW;AAAA,MACX,MAAK;AAAA,MACL,cAAW;AAAA,MACX,WAAU;AAAA,MAET,UAAA;AAAA,QAAAR,IACES,gBAAAA,EAAAA,IAAA,OAAA,EAAI,eAAY,QAAQ,YAAM,CAAA,IAE/BA,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,KAAI;AAAA,YACJ,KAAKR;AAAA,YACL,WAAU;AAAA,YACV,QAAQ,CAACS,MAAUR,KAAA,gBAAAA,EAASQ,EAAM;AAAA,YAClC,eAAY;AAAA,UAAA;AAAA,QACd;AAAA,QAEFD,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,eAAY;AAAA,YACZ,OAAO;AAAA,cACL,YAAYF;AAAA,YACd;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../node_modules/react/jsx-runtime.cjs.js"),s=require("react"),B=require("../../ThemeProvider.cjs.js");;/* empty css */const F=require("../../../utils/copy.cjs.js"),o=require("../../../utils/string.cjs.js"),W=s.forwardRef(({prefix:l,suffix:d,description:i,descriptionPosition:j="top",isDisabled:v,error:n,onChange:_,label:x,name:u,placeholder:P,type:T="text",value:R,autoFocus:g,autoComplete:k,isRequired:h=!1,isReadOnly:y=!1,onSubmit:b,onClear:E,"data-testid":z},O)=>{const N=s.useRef(null),c=s.useRef(null),p=s.useRef(null),r=s.useRef(null),{className:S}=B.useTheme(),D=O||N;s.useEffect(()=>{if(!r.current)return;const t=()=>{var $,q;if(r.current){const a=r.current.offsetWidth||200;r.current.style.setProperty("--container-width",`${a}px`)}if(c.current){const a=c.current.offsetWidth||32;($=r.current)==null||$.style.setProperty("--prefix-width",`${a}px`)}if(p.current){const a=p.current.offsetWidth||32;(q=r.current)==null||q.style.setProperty("--suffix-width",`${a}px`)}};t();const f=new ResizeObserver(t);return r.current&&f.observe(r.current),c.current&&f.observe(c.current),p.current&&f.observe(p.current),()=>{f.disconnect()}},[l,d]);const w=`${u}-input`,m=`${u}-error`,I=`${u}-description`;return e.jsxRuntimeExports.jsxs("div",{ref:r,children:[i&&j==="top"&&e.jsxRuntimeExports.jsx("div",{id:I,className:"proton-Input__text","aria-live":"polite",children:i}),e.jsxRuntimeExports.jsxs("div",{className:o.csx("proton-Input__container-inner",l&&"proton-Input__has-prefix",d&&"proton-Input__has-suffix"),children:[l&&e.jsxRuntimeExports.jsx("div",{ref:c,className:o.csx("proton-Input__descriptor","proton-Input__prefix"),children:l}),e.jsxRuntimeExports.jsx("input",{id:w,name:u,type:T,value:R,onChange:t=>{_==null||_(t.target.value)},onKeyDown:t=>{switch(t.key){case"Enter":b&&(t.preventDefault(),b(t));break;case"Escape":E&&(t.preventDefault(),E());break}},onCopy:async()=>{var t;return await F.copyTextToClipboard((t=N.current)==null?void 0:t.value)},disabled:v,readOnly:y,required:h,autoFocus:g,autoComplete:k?"on":"off",placeholder:x?void 0:P,"aria-label":x||u,"aria-invalid":!!n,"aria-errormessage":typeof n=="string"?n:m,"aria-required":h,"aria-readonly":y,"aria-describedby":n?m:i?I:void 0,"aria-disabled":v,"data-testid":z,ref:D,className:o.csx("proton-Input",n&&"proton-Input--error",x&&"proton-Input__label-top",S)}),e.jsxRuntimeExports.jsxs("label",{htmlFor:w,className:o.csx("proton-Input__label",R&&"proton-Input__label--filled"),children:[x,h&&e.jsxRuntimeExports.jsx("span",{"aria-hidden":"true",children:" *"})]}),d&&e.jsxRuntimeExports.jsx("div",{ref:p,className:o.csx("proton-Input__descriptor","proton-Input__suffix"),children:d})]}),n?e.jsxRuntimeExports.jsx("div",{role:"alert",className:o.csx("proton-Input__error","proton-Input__text"),id:m,children:n}):i&&j==="bottom"?e.jsxRuntimeExports.jsx("div",{id:I,className:"proton-Input__text","aria-live":"polite",children:i}):null]})});W.displayName="ProtonUIInput";exports.Input=W;
|
|
2
|
+
//# sourceMappingURL=Input.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.cjs.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, useEffect, useRef } from \"react\";\r\n\r\nimport { useTheme } from \"../../ThemeProvider\";\r\nimport { csx } from \"../../../utils\";\r\nimport \"./Input.css\";\r\nimport { copyTextToClipboard } from \"../../../utils/copy\";\r\n\r\nexport interface BaseInputProps {\r\n /**\r\n * onChange handler for the input\r\n */\r\n onChange?: (value: string) => void;\r\n\r\n /** Whether the input is disabled. */\r\n isDisabled?: boolean;\r\n\r\n /** Description text shown above the input. */\r\n description?: React.ReactNode | string;\r\n\r\n /**\r\n * The position of the description text.\r\n * @default \"top\"\r\n */\r\n descriptionPosition?: \"top\" | \"bottom\";\r\n\r\n /** Error state that changes the input's visual style and displays an error message. */\r\n error?: React.ReactNode | string;\r\n\r\n /**\r\n * Label for the input element.\r\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\r\n */\r\n label?: string;\r\n\r\n /** Test ID for the component. */\r\n \"data-testid\"?: string;\r\n\r\n /** Content to display before the input. Typically used for icons. */\r\n prefix?: React.ReactNode;\r\n\r\n /** Content to display after the input. Typically used for icons. */\r\n suffix?: React.ReactNode;\r\n\r\n /**\r\n * Should the browser's autocomplete be enabled?\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\r\n */\r\n autoComplete?: boolean;\r\n\r\n /**\r\n * Should the input be autofocused?\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\r\n */\r\n autoFocus?: boolean;\r\n\r\n /**\r\n * The name attribute of the input element.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\r\n */\r\n name: string;\r\n\r\n /**\r\n * The placeholder text to display when the input is empty.\r\n * @note label takes precedence over placeholder, if both are provided.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\r\n */\r\n placeholder?: string;\r\n\r\n /**\r\n * The type attribute of the input element.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\r\n * @default \"text\"\r\n */\r\n type?: string;\r\n\r\n /**\r\n * The value of the input.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\r\n */\r\n value?: string;\r\n\r\n /**\r\n * Whether the input is required.\r\n * @default false\r\n */\r\n isRequired?: boolean;\r\n\r\n /**\r\n * Whether the input is read-only.\r\n * @default false\r\n */\r\n isReadOnly?: boolean;\r\n\r\n /**\r\n * Called when the input is submitted (e.g. by pressing Enter).\r\n */\r\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\r\n\r\n /**\r\n * Called when the input is cleared (e.g. by pressing Escape).\r\n */\r\n onClear?: () => void;\r\n}\r\n\r\n/**\r\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\r\n *\r\n * API:\r\n * - {@link BaseInputProps}\r\n */\r\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\r\n (\r\n {\r\n prefix,\r\n suffix,\r\n description,\r\n descriptionPosition = \"top\",\r\n isDisabled,\r\n error,\r\n onChange,\r\n label,\r\n name,\r\n placeholder,\r\n type = \"text\",\r\n value,\r\n autoFocus,\r\n autoComplete,\r\n isRequired = false,\r\n isReadOnly = false,\r\n onSubmit,\r\n onClear,\r\n \"data-testid\": testId,\r\n },\r\n forwardedRef: React.RefObject<HTMLInputElement>\r\n ) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const prefixRef = useRef<HTMLDivElement>(null);\r\n const suffixRef = useRef<HTMLDivElement>(null);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const { className } = useTheme();\r\n const ref = forwardedRef || inputRef;\r\n\r\n // Control dynamic prefix and suffix widths using ResizeObserver\r\n useEffect(() => {\r\n if (!containerRef.current) return;\r\n\r\n const updateSizes = () => {\r\n if (containerRef.current) {\r\n const containerWidth = containerRef.current.offsetWidth || 200;\r\n containerRef.current.style.setProperty(\r\n \"--container-width\",\r\n `${containerWidth}px`\r\n );\r\n }\r\n\r\n if (prefixRef.current) {\r\n const prefixWidth = prefixRef.current.offsetWidth || 32;\r\n containerRef.current?.style.setProperty(\r\n \"--prefix-width\",\r\n `${prefixWidth}px`\r\n );\r\n }\r\n\r\n if (suffixRef.current) {\r\n const suffixWidth = suffixRef.current.offsetWidth || 32;\r\n containerRef.current?.style.setProperty(\r\n \"--suffix-width\",\r\n `${suffixWidth}px`\r\n );\r\n }\r\n };\r\n\r\n updateSizes();\r\n\r\n const resizeObserver = new ResizeObserver(updateSizes);\r\n\r\n if (containerRef.current) {\r\n resizeObserver.observe(containerRef.current);\r\n }\r\n if (prefixRef.current) {\r\n resizeObserver.observe(prefixRef.current);\r\n }\r\n if (suffixRef.current) {\r\n resizeObserver.observe(suffixRef.current);\r\n }\r\n\r\n return () => {\r\n resizeObserver.disconnect();\r\n };\r\n }, [prefix, suffix]);\r\n\r\n const inputId = `${name}-input`;\r\n const errorId = `${name}-error`;\r\n const descriptionId = `${name}-description`;\r\n\r\n return (\r\n <div ref={containerRef}>\r\n {description && descriptionPosition === \"top\" && (\r\n <div\r\n id={descriptionId}\r\n className=\"proton-Input__text\"\r\n aria-live=\"polite\"\r\n >\r\n {description}\r\n </div>\r\n )}\r\n <div className={csx(\r\n \"proton-Input__container-inner\",\r\n prefix && \"proton-Input__has-prefix\",\r\n suffix && \"proton-Input__has-suffix\"\r\n )}>\r\n {prefix && (\r\n <div\r\n ref={prefixRef}\r\n className={csx(\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__prefix\"\r\n )}\r\n >\r\n {prefix}\r\n </div>\r\n )}\r\n\r\n <input\r\n id={inputId}\r\n name={name}\r\n type={type}\r\n value={value}\r\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\r\n onChange?.(e.target.value);\r\n }}\r\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\r\n switch (e.key) {\r\n case \"Enter\":\r\n if (onSubmit) {\r\n e.preventDefault();\r\n onSubmit(e);\r\n }\r\n break;\r\n case \"Escape\":\r\n if (onClear) {\r\n e.preventDefault();\r\n onClear();\r\n }\r\n break;\r\n }\r\n }}\r\n onCopy={async () =>\r\n await copyTextToClipboard(inputRef.current?.value)\r\n }\r\n disabled={isDisabled}\r\n readOnly={isReadOnly}\r\n required={isRequired}\r\n autoFocus={autoFocus}\r\n autoComplete={autoComplete ? \"on\" : \"off\"}\r\n placeholder={label ? undefined : placeholder}\r\n aria-label={label || name}\r\n aria-invalid={Boolean(error)}\r\n aria-errormessage={typeof error === \"string\" ? error : errorId}\r\n aria-required={isRequired}\r\n aria-readonly={isReadOnly}\r\n aria-describedby={\r\n error ? errorId : description ? descriptionId : undefined\r\n }\r\n aria-disabled={isDisabled}\r\n data-testid={testId}\r\n ref={ref}\r\n className={csx(\r\n \"proton-Input\",\r\n error && \"proton-Input--error\",\r\n label && \"proton-Input__label-top\",\r\n className\r\n )}\r\n />\r\n\r\n <label\r\n htmlFor={inputId}\r\n className={csx(\r\n \"proton-Input__label\",\r\n value && \"proton-Input__label--filled\"\r\n )}\r\n >\r\n {label}\r\n {isRequired && <span aria-hidden=\"true\"> *</span>}\r\n </label>\r\n\r\n {suffix && (\r\n <div\r\n ref={suffixRef}\r\n className={csx(\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n >\r\n {suffix}\r\n </div>\r\n )}\r\n </div>\r\n\r\n {error ? (\r\n <div\r\n role=\"alert\"\r\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\r\n id={errorId}\r\n >\r\n {error}\r\n </div>\r\n ) : description && descriptionPosition === \"bottom\" ? (\r\n <div\r\n id={descriptionId}\r\n className=\"proton-Input__text\"\r\n aria-live=\"polite\"\r\n >\r\n {description}\r\n </div>\r\n ) : null}\r\n </div>\r\n );\r\n }\r\n);\r\n\r\nInput.displayName = \"ProtonUIInput\";\r\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","updateSizes","containerWidth","prefixWidth","_a","suffixWidth","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","e","copyTextToClipboard"],"mappings":"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"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { j as r } from "../../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { forwardRef as K, useRef as _, useEffect as U } from "react";
|
|
3
|
+
import { useTheme as g } from "../../ThemeProvider.es.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { copyTextToClipboard as q } from "../../../utils/copy.es.js";
|
|
6
|
+
import { csx as o } from "../../../utils/string.es.js";
|
|
7
|
+
const A = K(
|
|
8
|
+
({
|
|
9
|
+
prefix: u,
|
|
10
|
+
suffix: l,
|
|
11
|
+
description: s,
|
|
12
|
+
descriptionPosition: v = "top",
|
|
13
|
+
isDisabled: y,
|
|
14
|
+
error: n,
|
|
15
|
+
onChange: x,
|
|
16
|
+
label: d,
|
|
17
|
+
name: i,
|
|
18
|
+
placeholder: k,
|
|
19
|
+
type: z = "text",
|
|
20
|
+
value: b,
|
|
21
|
+
autoFocus: P,
|
|
22
|
+
autoComplete: T,
|
|
23
|
+
isRequired: h = !1,
|
|
24
|
+
isReadOnly: j = !1,
|
|
25
|
+
onSubmit: N,
|
|
26
|
+
onClear: w,
|
|
27
|
+
"data-testid": D
|
|
28
|
+
}, O) => {
|
|
29
|
+
const W = _(null), a = _(null), p = _(null), e = _(null), { className: B } = g(), F = O || W;
|
|
30
|
+
U(() => {
|
|
31
|
+
if (!e.current) return;
|
|
32
|
+
const t = () => {
|
|
33
|
+
var R, E;
|
|
34
|
+
if (e.current) {
|
|
35
|
+
const c = e.current.offsetWidth || 200;
|
|
36
|
+
e.current.style.setProperty(
|
|
37
|
+
"--container-width",
|
|
38
|
+
`${c}px`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
if (a.current) {
|
|
42
|
+
const c = a.current.offsetWidth || 32;
|
|
43
|
+
(R = e.current) == null || R.style.setProperty(
|
|
44
|
+
"--prefix-width",
|
|
45
|
+
`${c}px`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
if (p.current) {
|
|
49
|
+
const c = p.current.offsetWidth || 32;
|
|
50
|
+
(E = e.current) == null || E.style.setProperty(
|
|
51
|
+
"--suffix-width",
|
|
52
|
+
`${c}px`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
t();
|
|
57
|
+
const f = new ResizeObserver(t);
|
|
58
|
+
return e.current && f.observe(e.current), a.current && f.observe(a.current), p.current && f.observe(p.current), () => {
|
|
59
|
+
f.disconnect();
|
|
60
|
+
};
|
|
61
|
+
}, [u, l]);
|
|
62
|
+
const $ = `${i}-input`, m = `${i}-error`, I = `${i}-description`;
|
|
63
|
+
return /* @__PURE__ */ r.jsxs("div", { ref: e, children: [
|
|
64
|
+
s && v === "top" && /* @__PURE__ */ r.jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
id: I,
|
|
68
|
+
className: "proton-Input__text",
|
|
69
|
+
"aria-live": "polite",
|
|
70
|
+
children: s
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ r.jsxs("div", { className: o(
|
|
74
|
+
"proton-Input__container-inner",
|
|
75
|
+
u && "proton-Input__has-prefix",
|
|
76
|
+
l && "proton-Input__has-suffix"
|
|
77
|
+
), children: [
|
|
78
|
+
u && /* @__PURE__ */ r.jsx(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
ref: a,
|
|
82
|
+
className: o(
|
|
83
|
+
"proton-Input__descriptor",
|
|
84
|
+
"proton-Input__prefix"
|
|
85
|
+
),
|
|
86
|
+
children: u
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ r.jsx(
|
|
90
|
+
"input",
|
|
91
|
+
{
|
|
92
|
+
id: $,
|
|
93
|
+
name: i,
|
|
94
|
+
type: z,
|
|
95
|
+
value: b,
|
|
96
|
+
onChange: (t) => {
|
|
97
|
+
x == null || x(t.target.value);
|
|
98
|
+
},
|
|
99
|
+
onKeyDown: (t) => {
|
|
100
|
+
switch (t.key) {
|
|
101
|
+
case "Enter":
|
|
102
|
+
N && (t.preventDefault(), N(t));
|
|
103
|
+
break;
|
|
104
|
+
case "Escape":
|
|
105
|
+
w && (t.preventDefault(), w());
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
onCopy: async () => {
|
|
110
|
+
var t;
|
|
111
|
+
return await q((t = W.current) == null ? void 0 : t.value);
|
|
112
|
+
},
|
|
113
|
+
disabled: y,
|
|
114
|
+
readOnly: j,
|
|
115
|
+
required: h,
|
|
116
|
+
autoFocus: P,
|
|
117
|
+
autoComplete: T ? "on" : "off",
|
|
118
|
+
placeholder: d ? void 0 : k,
|
|
119
|
+
"aria-label": d || i,
|
|
120
|
+
"aria-invalid": !!n,
|
|
121
|
+
"aria-errormessage": typeof n == "string" ? n : m,
|
|
122
|
+
"aria-required": h,
|
|
123
|
+
"aria-readonly": j,
|
|
124
|
+
"aria-describedby": n ? m : s ? I : void 0,
|
|
125
|
+
"aria-disabled": y,
|
|
126
|
+
"data-testid": D,
|
|
127
|
+
ref: F,
|
|
128
|
+
className: o(
|
|
129
|
+
"proton-Input",
|
|
130
|
+
n && "proton-Input--error",
|
|
131
|
+
d && "proton-Input__label-top",
|
|
132
|
+
B
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ r.jsxs(
|
|
137
|
+
"label",
|
|
138
|
+
{
|
|
139
|
+
htmlFor: $,
|
|
140
|
+
className: o(
|
|
141
|
+
"proton-Input__label",
|
|
142
|
+
b && "proton-Input__label--filled"
|
|
143
|
+
),
|
|
144
|
+
children: [
|
|
145
|
+
d,
|
|
146
|
+
h && /* @__PURE__ */ r.jsx("span", { "aria-hidden": "true", children: " *" })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
l && /* @__PURE__ */ r.jsx(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
ref: p,
|
|
154
|
+
className: o(
|
|
155
|
+
"proton-Input__descriptor",
|
|
156
|
+
"proton-Input__suffix"
|
|
157
|
+
),
|
|
158
|
+
children: l
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] }),
|
|
162
|
+
n ? /* @__PURE__ */ r.jsx(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
role: "alert",
|
|
166
|
+
className: o("proton-Input__error", "proton-Input__text"),
|
|
167
|
+
id: m,
|
|
168
|
+
children: n
|
|
169
|
+
}
|
|
170
|
+
) : s && v === "bottom" ? /* @__PURE__ */ r.jsx(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
id: I,
|
|
174
|
+
className: "proton-Input__text",
|
|
175
|
+
"aria-live": "polite",
|
|
176
|
+
children: s
|
|
177
|
+
}
|
|
178
|
+
) : null
|
|
179
|
+
] });
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
A.displayName = "ProtonUIInput";
|
|
183
|
+
export {
|
|
184
|
+
A as Input
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=Input.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.es.js","sources":["../../../../src/components/Input/BaseInput/Input.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport React, { forwardRef, useEffect, useRef } from \"react\";\r\n\r\nimport { useTheme } from \"../../ThemeProvider\";\r\nimport { csx } from \"../../../utils\";\r\nimport \"./Input.css\";\r\nimport { copyTextToClipboard } from \"../../../utils/copy\";\r\n\r\nexport interface BaseInputProps {\r\n /**\r\n * onChange handler for the input\r\n */\r\n onChange?: (value: string) => void;\r\n\r\n /** Whether the input is disabled. */\r\n isDisabled?: boolean;\r\n\r\n /** Description text shown above the input. */\r\n description?: React.ReactNode | string;\r\n\r\n /**\r\n * The position of the description text.\r\n * @default \"top\"\r\n */\r\n descriptionPosition?: \"top\" | \"bottom\";\r\n\r\n /** Error state that changes the input's visual style and displays an error message. */\r\n error?: React.ReactNode | string;\r\n\r\n /**\r\n * Label for the input element.\r\n * @note When a label is provided, the input will have extra padding, and the label will float above the text input when focused or filled.\r\n */\r\n label?: string;\r\n\r\n /** Test ID for the component. */\r\n \"data-testid\"?: string;\r\n\r\n /** Content to display before the input. Typically used for icons. */\r\n prefix?: React.ReactNode;\r\n\r\n /** Content to display after the input. Typically used for icons. */\r\n suffix?: React.ReactNode;\r\n\r\n /**\r\n * Should the browser's autocomplete be enabled?\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\r\n */\r\n autoComplete?: boolean;\r\n\r\n /**\r\n * Should the input be autofocused?\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autofocus\r\n */\r\n autoFocus?: boolean;\r\n\r\n /**\r\n * The name attribute of the input element.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/name\r\n */\r\n name: string;\r\n\r\n /**\r\n * The placeholder text to display when the input is empty.\r\n * @note label takes precedence over placeholder, if both are provided.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder\r\n */\r\n placeholder?: string;\r\n\r\n /**\r\n * The type attribute of the input element.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/type\r\n * @default \"text\"\r\n */\r\n type?: string;\r\n\r\n /**\r\n * The value of the input.\r\n * @external https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#value\r\n */\r\n value?: string;\r\n\r\n /**\r\n * Whether the input is required.\r\n * @default false\r\n */\r\n isRequired?: boolean;\r\n\r\n /**\r\n * Whether the input is read-only.\r\n * @default false\r\n */\r\n isReadOnly?: boolean;\r\n\r\n /**\r\n * Called when the input is submitted (e.g. by pressing Enter).\r\n */\r\n onSubmit?: React.FormEventHandler<HTMLInputElement>;\r\n\r\n /**\r\n * Called when the input is cleared (e.g. by pressing Escape).\r\n */\r\n onClear?: () => void;\r\n}\r\n\r\n/**\r\n * A controlled and customizable input component with support for labels, prefixes, suffixes, and error states.\r\n *\r\n * API:\r\n * - {@link BaseInputProps}\r\n */\r\nexport const Input = forwardRef<HTMLInputElement, BaseInputProps>(\r\n (\r\n {\r\n prefix,\r\n suffix,\r\n description,\r\n descriptionPosition = \"top\",\r\n isDisabled,\r\n error,\r\n onChange,\r\n label,\r\n name,\r\n placeholder,\r\n type = \"text\",\r\n value,\r\n autoFocus,\r\n autoComplete,\r\n isRequired = false,\r\n isReadOnly = false,\r\n onSubmit,\r\n onClear,\r\n \"data-testid\": testId,\r\n },\r\n forwardedRef: React.RefObject<HTMLInputElement>\r\n ) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const prefixRef = useRef<HTMLDivElement>(null);\r\n const suffixRef = useRef<HTMLDivElement>(null);\r\n const containerRef = useRef<HTMLDivElement>(null);\r\n const { className } = useTheme();\r\n const ref = forwardedRef || inputRef;\r\n\r\n // Control dynamic prefix and suffix widths using ResizeObserver\r\n useEffect(() => {\r\n if (!containerRef.current) return;\r\n\r\n const updateSizes = () => {\r\n if (containerRef.current) {\r\n const containerWidth = containerRef.current.offsetWidth || 200;\r\n containerRef.current.style.setProperty(\r\n \"--container-width\",\r\n `${containerWidth}px`\r\n );\r\n }\r\n\r\n if (prefixRef.current) {\r\n const prefixWidth = prefixRef.current.offsetWidth || 32;\r\n containerRef.current?.style.setProperty(\r\n \"--prefix-width\",\r\n `${prefixWidth}px`\r\n );\r\n }\r\n\r\n if (suffixRef.current) {\r\n const suffixWidth = suffixRef.current.offsetWidth || 32;\r\n containerRef.current?.style.setProperty(\r\n \"--suffix-width\",\r\n `${suffixWidth}px`\r\n );\r\n }\r\n };\r\n\r\n updateSizes();\r\n\r\n const resizeObserver = new ResizeObserver(updateSizes);\r\n\r\n if (containerRef.current) {\r\n resizeObserver.observe(containerRef.current);\r\n }\r\n if (prefixRef.current) {\r\n resizeObserver.observe(prefixRef.current);\r\n }\r\n if (suffixRef.current) {\r\n resizeObserver.observe(suffixRef.current);\r\n }\r\n\r\n return () => {\r\n resizeObserver.disconnect();\r\n };\r\n }, [prefix, suffix]);\r\n\r\n const inputId = `${name}-input`;\r\n const errorId = `${name}-error`;\r\n const descriptionId = `${name}-description`;\r\n\r\n return (\r\n <div ref={containerRef}>\r\n {description && descriptionPosition === \"top\" && (\r\n <div\r\n id={descriptionId}\r\n className=\"proton-Input__text\"\r\n aria-live=\"polite\"\r\n >\r\n {description}\r\n </div>\r\n )}\r\n <div className={csx(\r\n \"proton-Input__container-inner\",\r\n prefix && \"proton-Input__has-prefix\",\r\n suffix && \"proton-Input__has-suffix\"\r\n )}>\r\n {prefix && (\r\n <div\r\n ref={prefixRef}\r\n className={csx(\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__prefix\"\r\n )}\r\n >\r\n {prefix}\r\n </div>\r\n )}\r\n\r\n <input\r\n id={inputId}\r\n name={name}\r\n type={type}\r\n value={value}\r\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => {\r\n onChange?.(e.target.value);\r\n }}\r\n onKeyDown={(e: React.KeyboardEvent<HTMLInputElement>) => {\r\n switch (e.key) {\r\n case \"Enter\":\r\n if (onSubmit) {\r\n e.preventDefault();\r\n onSubmit(e);\r\n }\r\n break;\r\n case \"Escape\":\r\n if (onClear) {\r\n e.preventDefault();\r\n onClear();\r\n }\r\n break;\r\n }\r\n }}\r\n onCopy={async () =>\r\n await copyTextToClipboard(inputRef.current?.value)\r\n }\r\n disabled={isDisabled}\r\n readOnly={isReadOnly}\r\n required={isRequired}\r\n autoFocus={autoFocus}\r\n autoComplete={autoComplete ? \"on\" : \"off\"}\r\n placeholder={label ? undefined : placeholder}\r\n aria-label={label || name}\r\n aria-invalid={Boolean(error)}\r\n aria-errormessage={typeof error === \"string\" ? error : errorId}\r\n aria-required={isRequired}\r\n aria-readonly={isReadOnly}\r\n aria-describedby={\r\n error ? errorId : description ? descriptionId : undefined\r\n }\r\n aria-disabled={isDisabled}\r\n data-testid={testId}\r\n ref={ref}\r\n className={csx(\r\n \"proton-Input\",\r\n error && \"proton-Input--error\",\r\n label && \"proton-Input__label-top\",\r\n className\r\n )}\r\n />\r\n\r\n <label\r\n htmlFor={inputId}\r\n className={csx(\r\n \"proton-Input__label\",\r\n value && \"proton-Input__label--filled\"\r\n )}\r\n >\r\n {label}\r\n {isRequired && <span aria-hidden=\"true\"> *</span>}\r\n </label>\r\n\r\n {suffix && (\r\n <div\r\n ref={suffixRef}\r\n className={csx(\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n >\r\n {suffix}\r\n </div>\r\n )}\r\n </div>\r\n\r\n {error ? (\r\n <div\r\n role=\"alert\"\r\n className={csx(\"proton-Input__error\", \"proton-Input__text\")}\r\n id={errorId}\r\n >\r\n {error}\r\n </div>\r\n ) : description && descriptionPosition === \"bottom\" ? (\r\n <div\r\n id={descriptionId}\r\n className=\"proton-Input__text\"\r\n aria-live=\"polite\"\r\n >\r\n {description}\r\n </div>\r\n ) : null}\r\n </div>\r\n );\r\n }\r\n);\r\n\r\nInput.displayName = \"ProtonUIInput\";\r\n"],"names":["Input","forwardRef","prefix","suffix","description","descriptionPosition","isDisabled","error","onChange","label","name","placeholder","type","value","autoFocus","autoComplete","isRequired","isReadOnly","onSubmit","onClear","testId","forwardedRef","inputRef","useRef","prefixRef","suffixRef","containerRef","className","useTheme","ref","useEffect","updateSizes","containerWidth","prefixWidth","_a","suffixWidth","_b","resizeObserver","inputId","errorId","descriptionId","jsxs","jsx","csx","e","copyTextToClipboard"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),x=require("react"),a=require("../../../utils/copy.cjs.js"),c=require("../BaseInput/Input.cjs.js");;/* empty css */const r=require("../../../utils/string.cjs.js");function l({name:o,value:e,isDisabled:p,onError:u,onSuccess:n}){const[i,s]=x.useState(!1);return t.jsxRuntimeExports.jsx(c.Input,{name:o,value:e,isDisabled:p,suffix:t.jsxRuntimeExports.jsx(j,{isCopied:i,onClick:async()=>{await a.copyTextToClipboard(e,u)&&(s(!0),n==null||n(),setTimeout(()=>s(!1),5e3))}})})}const j=({isCopied:o,onClick:e})=>t.jsxRuntimeExports.jsx("div",{className:"proton-CopyInput-button-container",onClick:e,children:t.jsxRuntimeExports.jsxs("button",{"data-testid":"COPY_BUTTON",className:r.csx("proton-CopyInput-button",o&&"proton-CopyInput-button--copied"),children:[t.jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 512 512",children:[t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80"})]}),t.jsxRuntimeExports.jsx("span",{className:r.csx("proton-CopyInput-button-text",o&&"proton-CopyInput-button-text--copied"),children:o?"Copied!":"Copy"})]})});exports.CopyInput=l;
|
|
2
|
+
//# sourceMappingURL=CopyInput.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyInput.cjs.js","sources":["../../../../src/components/Input/CopyInput/CopyInput.tsx"],"sourcesContent":["import { useState } from \"react\";\r\nimport { csx } from \"../../../utils\";\r\nimport { copyTextToClipboard } from \"../../../utils/copy\";\r\nimport { Input } from \"../BaseInput/Input\";\r\nimport \"./CopyInput.css\";\r\n\r\nexport interface CopyInputProps {\r\n /** The name of the input field */\r\n name: string;\r\n\r\n /** The value to display in the input and copy to clipboard */\r\n value: string;\r\n\r\n /** Whether the input is disabled */\r\n isDisabled?: boolean;\r\n\r\n /** Optional callback when copy fails, receives the error object */\r\n onError?: (error: Error) => void;\r\n\r\n /** Optional callback when copy succeeds */\r\n onSuccess?: () => void;\r\n}\r\n\r\n/**\r\n * Input with a button to copy value to the clipboard.\r\n *\r\n * API:\r\n * - {@link CopyInputProps}\r\n */\r\nexport function CopyInput({\r\n name,\r\n value,\r\n isDisabled,\r\n onError,\r\n onSuccess,\r\n}: CopyInputProps) {\r\n const [isCopied, setCopied] = useState(false);\r\n\r\n return (\r\n <Input\r\n name={name}\r\n value={value}\r\n isDisabled={isDisabled}\r\n suffix={\r\n <CopyButton\r\n isCopied={isCopied}\r\n onClick={async () => {\r\n const copySuccess = await copyTextToClipboard(value, onError);\r\n if (!copySuccess) return;\r\n\r\n setCopied(true);\r\n onSuccess?.();\r\n setTimeout(() => setCopied(false), 5000);\r\n }}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\nconst CopyButton = ({ isCopied, onClick }) => {\r\n return (\r\n <div className=\"proton-CopyInput-button-container\" onClick={onClick}>\r\n <button\r\n data-testid=\"COPY_BUTTON\"\r\n className={csx(\r\n \"proton-CopyInput-button\",\r\n isCopied && \"proton-CopyInput-button--copied\"\r\n )}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"12\"\r\n height=\"12\"\r\n viewBox=\"0 0 512 512\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80\"\r\n />\r\n </svg>\r\n <span\r\n className={csx(\r\n \"proton-CopyInput-button-text\",\r\n isCopied && \"proton-CopyInput-button-text--copied\"\r\n )}\r\n >\r\n {isCopied ? \"Copied!\" : \"Copy\"}\r\n </span>\r\n </button>\r\n </div>\r\n );\r\n};\r\n"],"names":["CopyInput","name","value","isDisabled","onError","onSuccess","isCopied","setCopied","useState","jsx","Input","CopyButton","copyTextToClipboard","onClick","jsxs","csx"],"mappings":"sUA6BO,SAASA,EAAU,CACxB,KAAAC,EACA,MAAAC,EACA,WAAAC,EACA,QAAAC,EACA,UAAAC,CACF,EAAmB,CACjB,KAAM,CAACC,EAAUC,CAAS,EAAIC,WAAS,EAAK,EAG1C,OAAAC,EAAA,kBAAA,IAACC,EAAA,MAAA,CACC,KAAAT,EACA,MAAAC,EACA,WAAAC,EACA,OACEM,EAAA,kBAAA,IAACE,EAAA,CACC,SAAAL,EACA,QAAS,SAAY,CACC,MAAMM,EAAAA,oBAAoBV,EAAOE,CAAO,IAG5DG,EAAU,EAAI,EACFF,GAAA,MAAAA,IACZ,WAAW,IAAME,EAAU,EAAK,EAAG,GAAI,EACzC,CAAA,CACF,CAAA,CAAA,CAIR,CAEA,MAAMI,EAAa,CAAC,CAAE,SAAAL,EAAU,QAAAO,KAE3BJ,EAAAA,kBAAAA,IAAA,MAAA,CAAI,UAAU,oCAAoC,QAAAI,EACjD,SAAAC,EAAA,kBAAA,KAAC,SAAA,CACC,cAAY,cACZ,UAAWC,EAAA,IACT,0BACAT,GAAY,iCACd,EAEA,SAAA,CAAAQ,EAAA,kBAAA,KAAC,MAAA,CACC,MAAM,6BACN,MAAM,KACN,OAAO,KACP,QAAQ,cAER,SAAA,CAAAL,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,kGAAA,CACJ,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,oHAAA,CACJ,CAAA,CAAA,CACF,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,UAAWM,EAAA,IACT,+BACAT,GAAY,sCACd,EAEC,WAAW,UAAY,MAAA,CAC1B,CAAA,CAAA,CAEJ,CAAA,CAAA"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { j as t } from "../../../node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useState as u } from "react";
|
|
3
|
+
import { copyTextToClipboard as c } from "../../../utils/copy.es.js";
|
|
4
|
+
import { Input as x } from "../BaseInput/Input.es.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { csx as e } from "../../../utils/string.es.js";
|
|
7
|
+
function b({
|
|
8
|
+
name: o,
|
|
9
|
+
value: p,
|
|
10
|
+
isDisabled: s,
|
|
11
|
+
onError: i,
|
|
12
|
+
onSuccess: r
|
|
13
|
+
}) {
|
|
14
|
+
const [a, n] = u(!1);
|
|
15
|
+
return /* @__PURE__ */ t.jsx(
|
|
16
|
+
x,
|
|
17
|
+
{
|
|
18
|
+
name: o,
|
|
19
|
+
value: p,
|
|
20
|
+
isDisabled: s,
|
|
21
|
+
suffix: /* @__PURE__ */ t.jsx(
|
|
22
|
+
l,
|
|
23
|
+
{
|
|
24
|
+
isCopied: a,
|
|
25
|
+
onClick: async () => {
|
|
26
|
+
await c(p, i) && (n(!0), r == null || r(), setTimeout(() => n(!1), 5e3));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const l = ({ isCopied: o, onClick: p }) => /* @__PURE__ */ t.jsx("div", { className: "proton-CopyInput-button-container", onClick: p, children: /* @__PURE__ */ t.jsxs(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
"data-testid": "COPY_BUTTON",
|
|
37
|
+
className: e(
|
|
38
|
+
"proton-CopyInput-button",
|
|
39
|
+
o && "proton-CopyInput-button--copied"
|
|
40
|
+
),
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ t.jsxs(
|
|
43
|
+
"svg",
|
|
44
|
+
{
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
width: "12",
|
|
47
|
+
height: "12",
|
|
48
|
+
viewBox: "0 0 512 512",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ t.jsx(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
fill: "currentColor",
|
|
54
|
+
d: "M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72"
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ t.jsx(
|
|
58
|
+
"path",
|
|
59
|
+
{
|
|
60
|
+
fill: "currentColor",
|
|
61
|
+
d: "M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80"
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ t.jsx(
|
|
68
|
+
"span",
|
|
69
|
+
{
|
|
70
|
+
className: e(
|
|
71
|
+
"proton-CopyInput-button-text",
|
|
72
|
+
o && "proton-CopyInput-button-text--copied"
|
|
73
|
+
),
|
|
74
|
+
children: o ? "Copied!" : "Copy"
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
) });
|
|
80
|
+
export {
|
|
81
|
+
b as CopyInput
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=CopyInput.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyInput.es.js","sources":["../../../../src/components/Input/CopyInput/CopyInput.tsx"],"sourcesContent":["import { useState } from \"react\";\r\nimport { csx } from \"../../../utils\";\r\nimport { copyTextToClipboard } from \"../../../utils/copy\";\r\nimport { Input } from \"../BaseInput/Input\";\r\nimport \"./CopyInput.css\";\r\n\r\nexport interface CopyInputProps {\r\n /** The name of the input field */\r\n name: string;\r\n\r\n /** The value to display in the input and copy to clipboard */\r\n value: string;\r\n\r\n /** Whether the input is disabled */\r\n isDisabled?: boolean;\r\n\r\n /** Optional callback when copy fails, receives the error object */\r\n onError?: (error: Error) => void;\r\n\r\n /** Optional callback when copy succeeds */\r\n onSuccess?: () => void;\r\n}\r\n\r\n/**\r\n * Input with a button to copy value to the clipboard.\r\n *\r\n * API:\r\n * - {@link CopyInputProps}\r\n */\r\nexport function CopyInput({\r\n name,\r\n value,\r\n isDisabled,\r\n onError,\r\n onSuccess,\r\n}: CopyInputProps) {\r\n const [isCopied, setCopied] = useState(false);\r\n\r\n return (\r\n <Input\r\n name={name}\r\n value={value}\r\n isDisabled={isDisabled}\r\n suffix={\r\n <CopyButton\r\n isCopied={isCopied}\r\n onClick={async () => {\r\n const copySuccess = await copyTextToClipboard(value, onError);\r\n if (!copySuccess) return;\r\n\r\n setCopied(true);\r\n onSuccess?.();\r\n setTimeout(() => setCopied(false), 5000);\r\n }}\r\n />\r\n }\r\n />\r\n );\r\n}\r\n\r\nconst CopyButton = ({ isCopied, onClick }) => {\r\n return (\r\n <div className=\"proton-CopyInput-button-container\" onClick={onClick}>\r\n <button\r\n data-testid=\"COPY_BUTTON\"\r\n className={csx(\r\n \"proton-CopyInput-button\",\r\n isCopied && \"proton-CopyInput-button--copied\"\r\n )}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"12\"\r\n height=\"12\"\r\n viewBox=\"0 0 512 512\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M408 480H184a72 72 0 0 1-72-72V184a72 72 0 0 1 72-72h224a72 72 0 0 1 72 72v224a72 72 0 0 1-72 72\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M160 80h235.88A72.12 72.12 0 0 0 328 32H104a72 72 0 0 0-72 72v224a72.12 72.12 0 0 0 48 67.88V160a80 80 0 0 1 80-80\"\r\n />\r\n </svg>\r\n <span\r\n className={csx(\r\n \"proton-CopyInput-button-text\",\r\n isCopied && \"proton-CopyInput-button-text--copied\"\r\n )}\r\n >\r\n {isCopied ? \"Copied!\" : \"Copy\"}\r\n </span>\r\n </button>\r\n </div>\r\n );\r\n};\r\n"],"names":["CopyInput","name","value","isDisabled","onError","onSuccess","isCopied","setCopied","useState","jsx","Input","CopyButton","copyTextToClipboard","onClick","jsxs","csx"],"mappings":";;;;;;AA6BO,SAASA,EAAU;AAAA,EACxB,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AACF,GAAmB;AACjB,QAAM,CAACC,GAAUC,CAAS,IAAIC,EAAS,EAAK;AAG1C,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAT;AAAA,MACA,OAAAC;AAAA,MACA,YAAAC;AAAA,MACA,QACEM,gBAAAA,EAAA;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,UAAAL;AAAA,UACA,SAAS,YAAY;AAEnB,YADoB,MAAMM,EAAoBV,GAAOE,CAAO,MAG5DG,EAAU,EAAI,GACFF,KAAA,QAAAA,KACZ,WAAW,MAAME,EAAU,EAAK,GAAG,GAAI;AAAA,UACzC;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAIR;AAEA,MAAMI,IAAa,CAAC,EAAE,UAAAL,GAAU,SAAAO,QAE3BJ,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,qCAAoC,SAAAI,GACjD,UAAAC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,eAAY;AAAA,IACZ,WAAWC;AAAA,MACT;AAAA,MACAT,KAAY;AAAA,IACd;AAAA,IAEA,UAAA;AAAA,MAAAQ,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,OAAM;AAAA,UACN,OAAM;AAAA,UACN,QAAO;AAAA,UACP,SAAQ;AAAA,UAER,UAAA;AAAA,YAAAL,gBAAAA,EAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YACJ;AAAA,YACAA,gBAAAA,EAAA;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,GAAE;AAAA,cAAA;AAAA,YACJ;AAAA,UAAA;AAAA,QAAA;AAAA,MACF;AAAA,MACAA,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,WAAWM;AAAA,YACT;AAAA,YACAT,KAAY;AAAA,UACd;AAAA,UAEC,cAAW,YAAY;AAAA,QAAA;AAAA,MAC1B;AAAA,IAAA;AAAA,EAAA;AAEJ,EAAA,CAAA;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),c=require("react");;/* empty css */const E=require("../BaseInput/Input.cjs.js"),S=require("../../../utils/string.cjs.js"),v=({name:l="search",placeholder:p="Search...",autoComplete:o,isClearable:d=!0,isDisabled:h=!1,error:j,defaultValue:m,value:s,"data-testid":x="proton-SearchInput",onChange:r,onClear:i})=>{const u=c.useRef(null),[a,n]=c.useState(s??m??"");c.useEffect(()=>{s!==void 0&&n(s)},[s]);const f=e=>{n(e),r==null||r(e)},R=()=>{var e;n(""),r==null||r(""),i==null||i(),(e=u.current)==null||e.focus()};return t.jsxRuntimeExports.jsx("div",{className:"proton-SearchInput__wrapper","data-testid":x,role:"search",children:t.jsxRuntimeExports.jsx(E.Input,{type:"search",onChange:f,value:a,name:l,placeholder:p,autoComplete:o,error:j,ref:u,isDisabled:h,prefix:t.jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"2.8em",height:"1.6em",viewBox:"0 0 24 24",onClick:()=>{var e;return(e=u.current)==null?void 0:e.focus()},children:[t.jsxRuntimeExports.jsx("title",{children:"Magnifying Glass"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z"})]}),suffix:d&&a.length>0?t.jsxRuntimeExports.jsx("button",{type:"button",className:S.csx("proton-SearchInput__button","proton-Input__descriptor","proton-Input__suffix"),"data-testid":`${x}-clear`,onClick:R,"aria-label":"Clear search",children:t.jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 50 50",width:"1.6em",height:"1.2em",children:[t.jsxRuntimeExports.jsx("title",{children:"Clear"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z"}),t.jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z"})]})}):null})})};exports.SearchInput=v;
|
|
2
|
+
//# sourceMappingURL=SearchInput.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.cjs.js","sources":["../../../../src/components/Input/SearchInput/SearchInput.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useEffect, useRef, useState } from \"react\";\r\nimport \"./SearchInput.css\";\r\nimport { csx } from \"../../../utils\";\r\nimport { Input, type BaseInputProps } from \"../BaseInput/Input\";\r\n\r\nexport interface SearchInputProps\r\n extends Omit<\r\n BaseInputProps,\r\n | \"prefix\"\r\n | \"suffix\"\r\n | \"value\"\r\n | \"onChange\"\r\n | \"description\"\r\n | \"descriptionPosition\"\r\n | \"label\"\r\n > {\r\n /** The initial value of the input. */\r\n defaultValue?: string;\r\n\r\n /** Should the clear button be shown when there is text? */\r\n isClearable?: boolean;\r\n\r\n /** Called when the input value changes. */\r\n onChange?: (value: string) => void;\r\n\r\n /** Called when the clear button is clicked. */\r\n onClear?: () => void;\r\n\r\n /** The current value of the input (for controlled usage) */\r\n value?: string;\r\n}\r\n\r\n/**\r\n * A search input component with optional clear functionality and URL parameter sync.\r\n *\r\n * API:\r\n * - {@link SearchInputProps}\r\n * - extends {@link BaseInputProps}\r\n */\r\nexport const SearchInput = ({\r\n name = \"search\",\r\n placeholder = \"Search...\",\r\n autoComplete,\r\n isClearable = true,\r\n isDisabled = false,\r\n error,\r\n defaultValue,\r\n value: controlledValue,\r\n \"data-testid\": testId = \"proton-SearchInput\",\r\n onChange,\r\n onClear,\r\n}: SearchInputProps) => {\r\n const inputRef = useRef<HTMLInputElement>(null);\r\n const [value, setValue] = useState(controlledValue ?? defaultValue ?? \"\");\r\n\r\n // Sync with controlled value if provided\r\n useEffect(() => {\r\n if (controlledValue !== undefined) {\r\n setValue(controlledValue);\r\n }\r\n }, [controlledValue]);\r\n\r\n const handleChange = (newValue: string) => {\r\n setValue(newValue);\r\n onChange?.(newValue);\r\n };\r\n\r\n const handleClear = () => {\r\n setValue(\"\");\r\n onChange?.(\"\");\r\n onClear?.();\r\n inputRef.current?.focus();\r\n };\r\n\r\n return (\r\n <div\r\n className=\"proton-SearchInput__wrapper\"\r\n data-testid={testId}\r\n role=\"search\"\r\n >\r\n <Input\r\n type=\"search\"\r\n onChange={handleChange}\r\n value={value}\r\n name={name}\r\n placeholder={placeholder}\r\n autoComplete={autoComplete}\r\n error={error}\r\n ref={inputRef}\r\n isDisabled={isDisabled}\r\n prefix={\r\n <svg\r\n aria-hidden=\"true\"\r\n width=\"2.8em\"\r\n height=\"1.6em\"\r\n viewBox=\"0 0 24 24\"\r\n onClick={() => inputRef.current?.focus()}\r\n >\r\n <title>Magnifying Glass</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M10.5 18.5a8 8 0 1 1 0-16 8 8 0 0 1 0 16Zm0-1a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5.25-.75 4.5 4.5-1.25 1.25-4.5-4.5 1.25-1.25Z\"\r\n />\r\n </svg>\r\n }\r\n suffix={\r\n isClearable && value.length > 0 ? (\r\n <button\r\n type=\"button\"\r\n className={csx(\r\n \"proton-SearchInput__button\",\r\n \"proton-Input__descriptor\",\r\n \"proton-Input__suffix\"\r\n )}\r\n data-testid={`${testId}-clear`}\r\n onClick={handleClear}\r\n aria-label=\"Clear search\"\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n viewBox=\"0 0 50 50\"\r\n width=\"1.6em\"\r\n height=\"1.2em\"\r\n >\r\n <title>Clear</title>\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m37.304 11.282l1.414 1.414l-26.022 26.02l-1.414-1.413z\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m12.696 11.282l26.022 26.02l-1.414 1.415l-26.022-26.02z\"\r\n />\r\n </svg>\r\n </button>\r\n ) : null\r\n }\r\n />\r\n </div>\r\n );\r\n};\r\n"],"names":["SearchInput","name","placeholder","autoComplete","isClearable","isDisabled","error","defaultValue","controlledValue","testId","onChange","onClear","inputRef","useRef","value","setValue","useState","useEffect","handleChange","newValue","handleClear","_a","jsx","Input","jsxs","csx"],"mappings":"gSAyCaA,EAAc,CAAC,CAC1B,KAAAC,EAAO,SACP,YAAAC,EAAc,YACd,aAAAC,EACA,YAAAC,EAAc,GACd,WAAAC,EAAa,GACb,MAAAC,EACA,aAAAC,EACA,MAAOC,EACP,cAAeC,EAAS,qBACxB,SAAAC,EACA,QAAAC,CACF,IAAwB,CAChB,MAAAC,EAAWC,SAAyB,IAAI,EACxC,CAACC,EAAOC,CAAQ,EAAIC,EAAS,SAAAR,GAAmBD,GAAgB,EAAE,EAGxEU,EAAAA,UAAU,IAAM,CACVT,IAAoB,QACtBO,EAASP,CAAe,CAC1B,EACC,CAACA,CAAe,CAAC,EAEd,MAAAU,EAAgBC,GAAqB,CACzCJ,EAASI,CAAQ,EACjBT,GAAA,MAAAA,EAAWS,EAAQ,EAGfC,EAAc,IAAM,OACxBL,EAAS,EAAE,EACXL,GAAA,MAAAA,EAAW,IACDC,GAAA,MAAAA,KACVU,EAAAT,EAAS,UAAT,MAAAS,EAAkB,OAAM,EAIxB,OAAAC,EAAA,kBAAA,IAAC,MAAA,CACC,UAAU,8BACV,cAAab,EACb,KAAK,SAEL,SAAAa,EAAA,kBAAA,IAACC,EAAA,MAAA,CACC,KAAK,SACL,SAAUL,EACV,MAAAJ,EACA,KAAAb,EACA,YAAAC,EACA,aAAAC,EACA,MAAAG,EACA,IAAKM,EACL,WAAAP,EACA,OACEmB,EAAA,kBAAA,KAAC,MAAA,CACC,cAAY,OACZ,MAAM,QACN,OAAO,QACP,QAAQ,YACR,QAAS,IAAM,OAAA,OAAAH,EAAAT,EAAS,UAAT,YAAAS,EAAkB,SAEjC,SAAA,CAAAC,EAAAA,kBAAAA,IAAC,SAAM,SAAgB,kBAAA,CAAA,EACvBA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,4HAAA,CACJ,CAAA,CAAA,CACF,EAEF,OACElB,GAAeU,EAAM,OAAS,EAC5BQ,EAAA,kBAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAWG,EAAA,IACT,6BACA,2BACA,sBACF,EACA,cAAa,GAAGhB,CAAM,SACtB,QAASW,EACT,aAAW,eAEX,SAAAI,EAAA,kBAAA,KAAC,MAAA,CACC,cAAY,OACZ,QAAQ,YACR,MAAM,QACN,OAAO,QAEP,SAAA,CAAAF,EAAAA,kBAAAA,IAAC,SAAM,SAAK,OAAA,CAAA,EACZA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,wDAAA,CACJ,EACAA,EAAA,kBAAA,IAAC,OAAA,CACC,KAAK,eACL,EAAE,yDAAA,CACJ,CAAA,CAAA,CACF,CAAA,CAAA,EAEA,IAAA,CAER,CAAA,CAAA,CAGN"}
|