@protonradio/proton-ui 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_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 +262 -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 +182 -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 +224 -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 +43 -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 +2 -0
- package/dist/dark.cjs.js.map +1 -0
- package/dist/dark.es.js +11 -0
- package/dist/dark.es.js.map +1 -0
- 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/{colors-Ceyo4oCJ.mjs.map → design/darkTheme/colors.cjs.js.map} +1 -1
- package/dist/{colors-Ceyo4oCJ.mjs → design/darkTheme/colors.es.js} +13 -13
- package/dist/{colors-CebzFjpe.js.map → design/darkTheme/colors.es.js.map} +1 -1
- package/dist/design/darkTheme/stylesheet.cjs.js +2 -0
- package/dist/design/darkTheme/stylesheet.cjs.js.map +1 -0
- package/dist/{theme/dark.es.js → design/darkTheme/stylesheet.es.js} +9 -15
- 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/{colors-DMkDnu4U.mjs.map → design/lightTheme/colors.cjs.js.map} +1 -1
- package/dist/{colors-DMkDnu4U.mjs → design/lightTheme/colors.es.js} +11 -11
- package/dist/{colors-DL1dYffC.js.map → design/lightTheme/colors.es.js.map} +1 -1
- package/dist/design/lightTheme/stylesheet.cjs.js +2 -0
- package/dist/design/lightTheme/stylesheet.cjs.js.map +1 -0
- package/dist/{theme/light.es.js → design/lightTheme/stylesheet.es.js} +10 -16
- 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/index.cjs.js +1 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +71 -105
- package/dist/index.es.js +60 -8700
- package/dist/index.es.js.map +1 -1
- package/dist/light.cjs.js +2 -0
- package/dist/light.cjs.js.map +1 -0
- package/dist/light.es.js +11 -0
- package/dist/light.es.js.map +1 -0
- 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 +47 -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 +423 -0
- package/dist/node_modules/@react-aria/focus/dist/FocusScope.es.js.map +1 -0
- package/dist/node_modules/@react-aria/focus/dist/isElementVisible.cjs.js +2 -0
- package/dist/node_modules/@react-aria/focus/dist/isElementVisible.cjs.js.map +1 -0
- package/dist/node_modules/@react-aria/focus/dist/isElementVisible.es.js +23 -0
- package/dist/node_modules/@react-aria/focus/dist/isElementVisible.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 +76 -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 +2 -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 +375 -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 +64 -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 +30 -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 +98 -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 +58 -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 +78 -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 +48 -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 +33 -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 +19 -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 +97 -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/style.css +1 -1
- 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/{copy-qSgElu2b.mjs → utils/copy.es.js} +2 -2
- 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 -16
- package/dist/utils.es.js.map +1 -1
- package/package.json +18 -22
- package/dist/Button-BLlr5ezy.js +0 -31
- package/dist/Button-BLlr5ezy.js.map +0 -1
- package/dist/Button-DuAhPJPD.mjs +0 -727
- package/dist/Button-DuAhPJPD.mjs.map +0 -1
- package/dist/Button.cjs.js +0 -2
- package/dist/Button.cjs.js.map +0 -1
- package/dist/Button.d.ts +0 -53
- package/dist/Button.es.js +0 -9
- package/dist/Button.es.js.map +0 -1
- 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-CmSJBHaf.js +0 -2
- package/dist/colors-CmSJBHaf.js.map +0 -1
- package/dist/colors-DL1dYffC.js +0 -2
- package/dist/copy-DxIZCnfT.js +0 -2
- package/dist/copy-DxIZCnfT.js.map +0 -1
- package/dist/copy-qSgElu2b.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-DdxS0JoV.js +0 -2
- package/dist/navigation-DdxS0JoV.js.map +0 -1
- package/dist/navigation-DsfDNfej.mjs +0 -16
- package/dist/navigation-DsfDNfej.mjs.map +0 -1
- package/dist/theme/dark.cjs.js +0 -2
- package/dist/theme/dark.cjs.js.map +0 -1
- package/dist/theme/dark.d.ts +0 -2
- package/dist/theme/dark.es.js.map +0 -1
- package/dist/theme/light.cjs.js +0 -2
- package/dist/theme/light.cjs.js.map +0 -1
- package/dist/theme/light.d.ts +0 -2
- package/dist/theme/light.es.js.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,183 @@
|
|
|
1
|
+
import { toRgba as r, adjustHue as F, getLuminance as c, lighten as A, darken as L, hasBadContrast as P, getScale as _ } from "../node_modules/color2k/dist/index.exports.import.es.es.js";
|
|
2
|
+
import { desaturate as u, saturate as E, arrayToRgbString as D } from "./color2k.es.js";
|
|
3
|
+
import { LIGHT_GRAYSCALE as U } from "../design/lightTheme/colors.es.js";
|
|
4
|
+
import { DARK_GRAYSCALE as s } from "../design/darkTheme/colors.es.js";
|
|
5
|
+
const K = (m) => {
|
|
6
|
+
const e = D(m), n = _("#FFFFFF", e, "#000000"), t = Array.from({ length: 12 }, (l, x) => {
|
|
7
|
+
const G = n(x / 11);
|
|
8
|
+
return u(G, 85e-4);
|
|
9
|
+
}), i = t.map(
|
|
10
|
+
(l) => E(h(l), 5e-3)
|
|
11
|
+
), S = r(E(F(e, 180), 1)), o = _("#FFFFFF", S, "#000000"), R = Array.from({ length: 12 }, (l, x) => {
|
|
12
|
+
const G = o(x / 11);
|
|
13
|
+
return u(G, 0.1);
|
|
14
|
+
}), I = R.map(
|
|
15
|
+
(l) => u(h(l), 0.22)
|
|
16
|
+
), d = f(
|
|
17
|
+
E(i[5], 0.115)
|
|
18
|
+
), H = u(I[4], 0.02);
|
|
19
|
+
return {
|
|
20
|
+
BASE_COLOR: D(m),
|
|
21
|
+
BRAND: {
|
|
22
|
+
PRIMARY: d,
|
|
23
|
+
PRIMARY_LIGHT: a(d, 0.25, {
|
|
24
|
+
min: 0.6,
|
|
25
|
+
max: 0.8
|
|
26
|
+
}),
|
|
27
|
+
PRIMARY_SUPER_LIGHT: a(d, 0.15, {
|
|
28
|
+
min: 0.8,
|
|
29
|
+
max: 0.9
|
|
30
|
+
}),
|
|
31
|
+
SECONDARY: H,
|
|
32
|
+
SECONDARY_LIGHT: a(H, 0.25, {
|
|
33
|
+
min: 0.6,
|
|
34
|
+
max: 0.8
|
|
35
|
+
}),
|
|
36
|
+
SECONDARY_SUPER_LIGHT: a(H, 0.15, {
|
|
37
|
+
min: 0.8,
|
|
38
|
+
max: 0.9
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
PRIMARY: {
|
|
42
|
+
//backgrounds
|
|
43
|
+
SUPER_DARK: a(
|
|
44
|
+
T(t[9]),
|
|
45
|
+
-0.6,
|
|
46
|
+
{
|
|
47
|
+
min: 0,
|
|
48
|
+
max: 0.02
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
DARK: a(T(t[8]), -0.4, {
|
|
52
|
+
min: 0.01,
|
|
53
|
+
max: 0.02
|
|
54
|
+
}),
|
|
55
|
+
//interactive components
|
|
56
|
+
MEDIUM: a(i[7], -0.2, {
|
|
57
|
+
min: 0,
|
|
58
|
+
max: 0.11
|
|
59
|
+
}),
|
|
60
|
+
//borders and seperators
|
|
61
|
+
MEDIUM_LIGHT: a(
|
|
62
|
+
u(i[6], 0.1),
|
|
63
|
+
0.08
|
|
64
|
+
),
|
|
65
|
+
//solid colors
|
|
66
|
+
LIGHT: a(E(i[5], 0.1), 0.16),
|
|
67
|
+
//accessible text
|
|
68
|
+
LIGHTEST: a(
|
|
69
|
+
E(i[3], 0.2),
|
|
70
|
+
0.12,
|
|
71
|
+
{
|
|
72
|
+
min: 0.5,
|
|
73
|
+
max: 0.9
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
SUPER_LIGHT: a(i[1], 0.02, {
|
|
77
|
+
min: 0.76,
|
|
78
|
+
max: 0.92
|
|
79
|
+
}),
|
|
80
|
+
WHITE: a(i[1], 0.11, {
|
|
81
|
+
min: 0.9,
|
|
82
|
+
max: 0.98
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
SECONDARY: {
|
|
86
|
+
//backgrounds
|
|
87
|
+
SUPER_DARK: a(
|
|
88
|
+
T(R[9]),
|
|
89
|
+
-0.6,
|
|
90
|
+
{
|
|
91
|
+
min: 0,
|
|
92
|
+
max: 0.02
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
DARK: a(T(R[8]), -0.4, {
|
|
96
|
+
min: 0.01,
|
|
97
|
+
max: 0.02
|
|
98
|
+
}),
|
|
99
|
+
// interactive components
|
|
100
|
+
MEDIUM: a(I[7], -0.2, {
|
|
101
|
+
min: 0,
|
|
102
|
+
max: 0.11
|
|
103
|
+
}),
|
|
104
|
+
//borders and seperators
|
|
105
|
+
MEDIUM_LIGHT: a(I[6], 0.1),
|
|
106
|
+
//solid colors
|
|
107
|
+
LIGHT: a(E(I[5], 0.1), 0.16),
|
|
108
|
+
//accessible text
|
|
109
|
+
LIGHTEST: a(
|
|
110
|
+
E(I[3], 0.2),
|
|
111
|
+
0.12,
|
|
112
|
+
{
|
|
113
|
+
min: 0.5,
|
|
114
|
+
max: 0.9
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
SUPER_LIGHT: a(I[1], 0.02, {
|
|
118
|
+
min: 0.76,
|
|
119
|
+
max: 0.92
|
|
120
|
+
}),
|
|
121
|
+
WHITE: a(I[1], 0.11, {
|
|
122
|
+
min: 0.9,
|
|
123
|
+
max: 0.98
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
//TODO: make theme aware grayscale color scale
|
|
127
|
+
//Can we remove the basecolor after this?
|
|
128
|
+
GRAYSCALE: {
|
|
129
|
+
SUPER_DARK: s.SUPER_DARK,
|
|
130
|
+
DARK: s.DARK,
|
|
131
|
+
MEDIUM: s.MEDIUM,
|
|
132
|
+
MEDIUM_LIGHT: s.MEDIUM_LIGHT,
|
|
133
|
+
LIGHT: s.LIGHT,
|
|
134
|
+
LIGHTEST: s.LIGHTEST,
|
|
135
|
+
SUPER_LIGHT: s.SUPER_LIGHT,
|
|
136
|
+
WHITE: s.WHITE
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}, a = (m, e, n = { min: 0.03, max: 0.97 }) => {
|
|
140
|
+
let t = m, i = c(t);
|
|
141
|
+
if (n.min < 0 && (n.min = 0), n.max > 1 && (n.max = 1), n.min >= n.max)
|
|
142
|
+
throw new Error("Invalid range: min must be less than max");
|
|
143
|
+
if (e > 0) {
|
|
144
|
+
const o = n.max - i;
|
|
145
|
+
if (o <= 0) return r(t);
|
|
146
|
+
const R = e * (o / (1 - i));
|
|
147
|
+
t = A(t, R);
|
|
148
|
+
} else if (e < 0) {
|
|
149
|
+
const o = i - n.min;
|
|
150
|
+
if (o <= 0) return r(t);
|
|
151
|
+
const R = e * (o / i);
|
|
152
|
+
t = L(t, Math.abs(R));
|
|
153
|
+
}
|
|
154
|
+
const S = c(t);
|
|
155
|
+
return (S > n.max || S < n.min) && (t = M(t, n)), r(t);
|
|
156
|
+
}, M = (m, e) => {
|
|
157
|
+
let n = m, t = c(n);
|
|
158
|
+
for (; t > e.max; )
|
|
159
|
+
n = L(n, 0.05), t = c(n);
|
|
160
|
+
for (; t < e.min; )
|
|
161
|
+
n = A(n, 0.05), t = c(n);
|
|
162
|
+
return r(n);
|
|
163
|
+
}, T = (m) => {
|
|
164
|
+
for (; P(m, "readable", U.DARK); )
|
|
165
|
+
m = A(m, 0.01);
|
|
166
|
+
return r(m);
|
|
167
|
+
}, f = (m) => {
|
|
168
|
+
for (; P(U.SUPER_LIGHT, "readable", m); )
|
|
169
|
+
m = L(m, 0.01);
|
|
170
|
+
return r(m);
|
|
171
|
+
}, h = (m) => {
|
|
172
|
+
let e = m, n = c(r(e)), t = 0;
|
|
173
|
+
const i = 6;
|
|
174
|
+
for (; n < 0.16 && t < i; )
|
|
175
|
+
t++, e = A(e, 0.1), n = c(r(e));
|
|
176
|
+
for (; n > 0.6 && t < i; )
|
|
177
|
+
t++, e = L(e, 0.1), n = c(r(e));
|
|
178
|
+
return r(e);
|
|
179
|
+
};
|
|
180
|
+
export {
|
|
181
|
+
K as generatePalette
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=palette.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.es.js","sources":["../../src/utils/palette.ts"],"sourcesContent":["import {\r\n adjustHue,\r\n darken,\r\n getLuminance,\r\n getScale,\r\n hasBadContrast,\r\n lighten,\r\n toRgba,\r\n} from \"color2k\";\r\nimport { ProtonPalette, RGBArray } from \"../design/types\";\r\nimport { arrayToRgbString, desaturate, saturate } from \"./color2k\";\r\nimport { LIGHT_GRAYSCALE } from \"../design/lightTheme/colors\";\r\nimport { DARK_GRAYSCALE } from \"../design/darkTheme/colors\";\r\n\r\n/**\r\n * Generates a complete color palette based on a primary color input.\r\n * The palette includes primary and secondary color scales with varying shades.\r\n *\r\n * @param primaryColor - The base RGB color array to generate the palette from\r\n * @returns A Palette object containing:\r\n * - BRAND colors (primary, light primary, and secondary)\r\n * - PRIMARY scale (7 shades from super dark to super light)\r\n * - SECONDARY scale (7 shades from super dark to super light)\r\n *\r\n * The function:\r\n * 1. Creates a 12-color scale from white to the primary color to black\r\n * 2. Generates a complementary secondary color by shifting the hue 180 degrees\r\n * 3. Creates another 12-color scale for the secondary color\r\n * 4. Maps specific positions from these scales to create the final palette structure\r\n */\r\nexport const generatePalette = (baseColor: RGBArray): ProtonPalette => {\r\n const primaryRgba = arrayToRgbString(baseColor);\r\n\r\n const primaryScaleFunc = getScale(\"#FFFFFF\", primaryRgba, \"#000000\");\r\n const primaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = primaryScaleFunc(i / 11);\r\n return desaturate(color, 0.0085);\r\n });\r\n\r\n const adjustedPrimaryScale = primaryScale.map((color) =>\r\n saturate(adjustBrightnessForLuminance(color), 0.005)\r\n );\r\n\r\n const secondaryColor = toRgba(saturate(adjustHue(primaryRgba, 180), 1));\r\n\r\n const secondaryScaleFunc = getScale(\"#FFFFFF\", secondaryColor, \"#000000\");\r\n const secondaryScale = Array.from({ length: 12 }, (_, i) => {\r\n const color = secondaryScaleFunc(i / 11);\r\n return desaturate(color, 0.1);\r\n });\r\n\r\n const adjustedSecondaryScale = secondaryScale.map((color) =>\r\n desaturate(adjustBrightnessForLuminance(color), 0.22)\r\n );\r\n\r\n const brandPrimary = darkenForContrast(\r\n saturate(adjustedPrimaryScale[5], 0.115)\r\n );\r\n const brandSecondary = desaturate(adjustedSecondaryScale[4], 0.02);\r\n\r\n return {\r\n BASE_COLOR: arrayToRgbString(baseColor),\r\n BRAND: {\r\n PRIMARY: brandPrimary,\r\n PRIMARY_LIGHT: lightenWithinRange(brandPrimary, 0.25, {\r\n min: 0.6,\r\n max: 0.8,\r\n }),\r\n PRIMARY_SUPER_LIGHT: lightenWithinRange(brandPrimary, 0.15, {\r\n min: 0.8,\r\n max: 0.9,\r\n }),\r\n SECONDARY: brandSecondary,\r\n SECONDARY_LIGHT: lightenWithinRange(brandSecondary, 0.25, {\r\n min: 0.6,\r\n max: 0.8,\r\n }),\r\n SECONDARY_SUPER_LIGHT: lightenWithinRange(brandSecondary, 0.15, {\r\n min: 0.8,\r\n max: 0.9,\r\n }),\r\n },\r\n PRIMARY: {\r\n //backgrounds\r\n SUPER_DARK: lightenWithinRange(\r\n lightenForContrast(primaryScale[9]),\r\n -0.6,\r\n {\r\n min: 0.0,\r\n max: 0.02,\r\n }\r\n ),\r\n DARK: lightenWithinRange(lightenForContrast(primaryScale[8]), -0.4, {\r\n min: 0.01,\r\n max: 0.02,\r\n }),\r\n //interactive components\r\n MEDIUM: lightenWithinRange(adjustedPrimaryScale[7], -0.2, {\r\n min: 0.0,\r\n max: 0.11,\r\n }),\r\n //borders and seperators\r\n MEDIUM_LIGHT: lightenWithinRange(\r\n desaturate(adjustedPrimaryScale[6], 0.1),\r\n 0.08\r\n ),\r\n //solid colors\r\n LIGHT: lightenWithinRange(saturate(adjustedPrimaryScale[5], 0.1), 0.16),\r\n //accessible text\r\n LIGHTEST: lightenWithinRange(\r\n saturate(adjustedPrimaryScale[3], 0.2),\r\n 0.12,\r\n {\r\n min: 0.5,\r\n max: 0.9,\r\n }\r\n ),\r\n SUPER_LIGHT: lightenWithinRange(adjustedPrimaryScale[1], 0.02, {\r\n min: 0.76,\r\n max: 0.92,\r\n }),\r\n WHITE: lightenWithinRange(adjustedPrimaryScale[1], 0.11, {\r\n min: 0.9,\r\n max: 0.98,\r\n }),\r\n },\r\n SECONDARY: {\r\n //backgrounds\r\n SUPER_DARK: lightenWithinRange(\r\n lightenForContrast(secondaryScale[9]),\r\n -0.6,\r\n {\r\n min: 0.0,\r\n max: 0.02,\r\n }\r\n ),\r\n DARK: lightenWithinRange(lightenForContrast(secondaryScale[8]), -0.4, {\r\n min: 0.01,\r\n max: 0.02,\r\n }),\r\n // interactive components\r\n MEDIUM: lightenWithinRange(adjustedSecondaryScale[7], -0.2, {\r\n min: 0.0,\r\n max: 0.11,\r\n }),\r\n //borders and seperators\r\n MEDIUM_LIGHT: lightenWithinRange(adjustedSecondaryScale[6], 0.1),\r\n //solid colors\r\n LIGHT: lightenWithinRange(saturate(adjustedSecondaryScale[5], 0.1), 0.16),\r\n //accessible text\r\n LIGHTEST: lightenWithinRange(\r\n saturate(adjustedSecondaryScale[3], 0.2),\r\n 0.12,\r\n {\r\n min: 0.5,\r\n max: 0.9,\r\n }\r\n ),\r\n SUPER_LIGHT: lightenWithinRange(adjustedSecondaryScale[1], 0.02, {\r\n min: 0.76,\r\n max: 0.92,\r\n }),\r\n WHITE: lightenWithinRange(adjustedSecondaryScale[1], 0.11, {\r\n min: 0.9,\r\n max: 0.98,\r\n }),\r\n },\r\n //TODO: make theme aware grayscale color scale\r\n //Can we remove the basecolor after this?\r\n GRAYSCALE: {\r\n SUPER_DARK: DARK_GRAYSCALE.SUPER_DARK,\r\n DARK: DARK_GRAYSCALE.DARK,\r\n MEDIUM: DARK_GRAYSCALE.MEDIUM,\r\n MEDIUM_LIGHT: DARK_GRAYSCALE.MEDIUM_LIGHT,\r\n LIGHT: DARK_GRAYSCALE.LIGHT,\r\n LIGHTEST: DARK_GRAYSCALE.LIGHTEST,\r\n SUPER_LIGHT: DARK_GRAYSCALE.SUPER_LIGHT,\r\n WHITE: DARK_GRAYSCALE.WHITE,\r\n },\r\n };\r\n};\r\n\r\nconst lightenWithinRange = (\r\n color: string,\r\n amount: number,\r\n range: { min: number; max: number } = { min: 0.03, max: 0.97 }\r\n): string => {\r\n let adjustedColor = color;\r\n let currentLuminance = getLuminance(adjustedColor);\r\n\r\n // Validate range bounds\r\n if (range.min < 0) range.min = 0;\r\n if (range.max > 1) range.max = 1;\r\n if (range.min >= range.max) {\r\n throw new Error(\"Invalid range: min must be less than max\");\r\n }\r\n\r\n // For lightening (positive amount)\r\n if (amount > 0) {\r\n // Calculate how much we can lighten before hitting max\r\n const remainingLuminance = range.max - currentLuminance;\r\n if (remainingLuminance <= 0) return toRgba(adjustedColor);\r\n\r\n // Scale the amount based on remaining room to lighten\r\n const scaledAmount = amount * (remainingLuminance / (1 - currentLuminance));\r\n adjustedColor = lighten(adjustedColor, scaledAmount);\r\n }\r\n // For darkening (negative amount)\r\n else if (amount < 0) {\r\n // Calculate how much we can darken before hitting min\r\n const remainingLuminance = currentLuminance - range.min;\r\n if (remainingLuminance <= 0) return toRgba(adjustedColor);\r\n\r\n // Scale the amount based on remaining room to darken\r\n const scaledAmount = amount * (remainingLuminance / currentLuminance);\r\n adjustedColor = darken(adjustedColor, Math.abs(scaledAmount));\r\n }\r\n\r\n // Verify final luminance is within bounds\r\n const finalLuminance = getLuminance(adjustedColor);\r\n if (finalLuminance > range.max) {\r\n adjustedColor = adjustBrightnessWithinRange(adjustedColor, range);\r\n } else if (finalLuminance < range.min) {\r\n adjustedColor = adjustBrightnessWithinRange(adjustedColor, range);\r\n }\r\n\r\n return toRgba(adjustedColor);\r\n};\r\n\r\nconst adjustBrightnessWithinRange = (\r\n color: string,\r\n range: { min: number; max: number }\r\n): string => {\r\n let adjustedColor = color;\r\n let luminance = getLuminance(adjustedColor);\r\n\r\n // Darken if too bright\r\n while (luminance > range.max) {\r\n adjustedColor = darken(adjustedColor, 0.05);\r\n luminance = getLuminance(adjustedColor);\r\n }\r\n\r\n // Lighten if too dark\r\n while (luminance < range.min) {\r\n adjustedColor = lighten(adjustedColor, 0.05);\r\n luminance = getLuminance(adjustedColor);\r\n }\r\n\r\n return toRgba(adjustedColor);\r\n};\r\n\r\nconst lightenForContrast = (color: string): string => {\r\n while (hasBadContrast(color, \"readable\", LIGHT_GRAYSCALE.DARK)) {\r\n color = lighten(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst darkenForContrast = (color: string): string => {\r\n while (hasBadContrast(LIGHT_GRAYSCALE.SUPER_LIGHT, \"readable\", color)) {\r\n color = darken(color, 0.01);\r\n }\r\n return toRgba(color);\r\n};\r\n\r\nconst adjustBrightnessForLuminance = (color: string): string => {\r\n let currentColor = color;\r\n let currentLuminance = getLuminance(toRgba(currentColor));\r\n let adjustmentAttempts = 0;\r\n const MAX_ATTEMPTS = 6;\r\n\r\n while (currentLuminance < 0.16 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = lighten(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n while (currentLuminance > 0.6 && adjustmentAttempts < MAX_ATTEMPTS) {\r\n adjustmentAttempts++;\r\n currentColor = darken(currentColor, 0.1);\r\n currentLuminance = getLuminance(toRgba(currentColor));\r\n }\r\n\r\n return toRgba(currentColor);\r\n};\r\n"],"names":["generatePalette","baseColor","primaryRgba","arrayToRgbString","primaryScaleFunc","getScale","primaryScale","_","i","color","desaturate","adjustedPrimaryScale","saturate","adjustBrightnessForLuminance","secondaryColor","toRgba","adjustHue","secondaryScaleFunc","secondaryScale","adjustedSecondaryScale","brandPrimary","darkenForContrast","brandSecondary","lightenWithinRange","lightenForContrast","DARK_GRAYSCALE","amount","range","adjustedColor","currentLuminance","getLuminance","remainingLuminance","scaledAmount","lighten","darken","finalLuminance","adjustBrightnessWithinRange","luminance","hasBadContrast","LIGHT_GRAYSCALE","currentColor","adjustmentAttempts","MAX_ATTEMPTS"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.cjs.js","sources":["../../src/utils/string.ts"],"sourcesContent":["/**\r\n * Concatenates class names into a single string, filtering out non-string values.\r\n */\r\nexport function csx(...classnames: unknown[]): string {\r\n return classnames.filter(isString).join(\" \");\r\n}\r\n\r\nconst isString = (x: unknown): boolean =>\r\n typeof x === \"string\" || x instanceof String;\r\n"],"names":["csx","classnames","isString","x"],"mappings":"gFAGO,SAASA,KAAOC,EAA+B,CACpD,OAAOA,EAAW,OAAOC,CAAQ,EAAE,KAAK,GAAG,CAC7C,CAEA,MAAMA,EAAYC,GAChB,OAAOA,GAAM,UAAYA,aAAa"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.es.js","sources":["../../src/utils/string.ts"],"sourcesContent":["/**\r\n * Concatenates class names into a single string, filtering out non-string values.\r\n */\r\nexport function csx(...classnames: unknown[]): string {\r\n return classnames.filter(isString).join(\" \");\r\n}\r\n\r\nconst isString = (x: unknown): boolean =>\r\n typeof x === \"string\" || x instanceof String;\r\n"],"names":["csx","classnames","isString","x"],"mappings":"AAGO,SAASA,KAAOC,GAA+B;AACpD,SAAOA,EAAW,OAAOC,CAAQ,EAAE,KAAK,GAAG;AAC7C;AAEA,MAAMA,IAAW,CAACC,MAChB,OAAOA,KAAM,YAAYA,aAAa;"}
|
package/dist/utils.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./color2k
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./utils/color2k.cjs.js"),a=require("./utils/string.cjs.js"),n=require("./utils/palette.cjs.js"),o=require("./utils/copy.cjs.js"),i=require("./utils/image.cjs.js"),r=require("./utils/navigation.cjs.js"),t=require("./node_modules/color2k/dist/index.exports.import.es.cjs.js");exports.arrayToRgbString=e.arrayToRgbString;exports.desaturate=e.desaturate;exports.saturate=e.saturate;exports.transparentize=e.transparentize;exports.csx=a.csx;exports.generatePalette=n.generatePalette;exports.copyTextToClipboard=o.copyTextToClipboard;exports.getDominantColor=i.getDominantColor;exports.handleInternalNavigation=r.handleInternalNavigation;exports.isUrlExternal=r.isUrlExternal;exports.darken=t.darken;exports.lighten=t.lighten;exports.toHex=t.toHex;exports.toRgba=t.toRgba;
|
|
2
2
|
//# sourceMappingURL=utils.cjs.js.map
|
package/dist/utils.es.js
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { arrayToRgbString as e, desaturate as o, saturate as a, transparentize as n } from "./utils/color2k.es.js";
|
|
2
|
+
import { csx as p } from "./utils/string.es.js";
|
|
3
|
+
import { generatePalette as l } from "./utils/palette.es.js";
|
|
4
|
+
import { copyTextToClipboard as f } from "./utils/copy.es.js";
|
|
5
|
+
import { getDominantColor as s } from "./utils/image.es.js";
|
|
6
|
+
import { handleInternalNavigation as b, isUrlExternal as T } from "./utils/navigation.es.js";
|
|
7
|
+
import { darken as h, lighten as u, toHex as y, toRgba as C } from "./node_modules/color2k/dist/index.exports.import.es.es.js";
|
|
5
8
|
export {
|
|
6
9
|
e as arrayToRgbString,
|
|
7
|
-
|
|
10
|
+
f as copyTextToClipboard,
|
|
8
11
|
p as csx,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
h as darken,
|
|
13
|
+
o as desaturate,
|
|
14
|
+
l as generatePalette,
|
|
15
|
+
s as getDominantColor,
|
|
16
|
+
b as handleInternalNavigation,
|
|
17
|
+
T as isUrlExternal,
|
|
18
|
+
u as lighten,
|
|
19
|
+
a as saturate,
|
|
20
|
+
y as toHex,
|
|
21
|
+
C as toRgba,
|
|
22
|
+
n as transparentize
|
|
20
23
|
};
|
|
21
24
|
//# sourceMappingURL=utils.es.js.map
|
package/dist/utils.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protonradio/proton-ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/proton-ui.umd.js",
|
|
6
6
|
"module": "./dist/proton-ui.es.js",
|
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
"import": "./dist/index.es.js",
|
|
11
11
|
"require": "./dist/index.cjs.js"
|
|
12
12
|
},
|
|
13
|
-
"./Button": {
|
|
14
|
-
"types": "./dist/Button.d.ts",
|
|
15
|
-
"import": "./dist/Button.es.js",
|
|
16
|
-
"require": "./dist/Button.cjs.js"
|
|
17
|
-
},
|
|
18
13
|
"./utils": {
|
|
19
14
|
"types": "./dist/utils.d.ts",
|
|
20
15
|
"import": "./dist/utils.es.js",
|
|
@@ -31,19 +26,19 @@
|
|
|
31
26
|
"require": "./dist/hooks.cjs.js"
|
|
32
27
|
},
|
|
33
28
|
"./theme": {
|
|
34
|
-
"types": "./dist/
|
|
35
|
-
"import": "./dist/
|
|
36
|
-
"require": "./dist/
|
|
29
|
+
"types": "./dist/theme.d.ts",
|
|
30
|
+
"import": "./dist/theme.es.js",
|
|
31
|
+
"require": "./dist/theme.cjs.js"
|
|
37
32
|
},
|
|
38
33
|
"./theme/light": {
|
|
39
|
-
"types": "./dist/
|
|
40
|
-
"import": "./dist/
|
|
41
|
-
"require": "./dist/
|
|
34
|
+
"types": "./dist/light.d.ts",
|
|
35
|
+
"import": "./dist/light.es.js",
|
|
36
|
+
"require": "./dist/light.cjs.js"
|
|
42
37
|
},
|
|
43
38
|
"./theme/dark": {
|
|
44
|
-
"types": "./dist/
|
|
45
|
-
"import": "./dist/
|
|
46
|
-
"require": "./dist/
|
|
39
|
+
"types": "./dist/dark.d.ts",
|
|
40
|
+
"import": "./dist/dark.es.js",
|
|
41
|
+
"require": "./dist/dark.cjs.js"
|
|
47
42
|
}
|
|
48
43
|
},
|
|
49
44
|
"typesVersions": {
|
|
@@ -51,9 +46,6 @@
|
|
|
51
46
|
"*": [
|
|
52
47
|
"./dist/index.d.ts"
|
|
53
48
|
],
|
|
54
|
-
"Button": [
|
|
55
|
-
"./dist/Button.d.ts"
|
|
56
|
-
],
|
|
57
49
|
"constants": [
|
|
58
50
|
"./dist/constants.d.ts"
|
|
59
51
|
],
|
|
@@ -64,18 +56,19 @@
|
|
|
64
56
|
"./dist/hooks.d.ts"
|
|
65
57
|
],
|
|
66
58
|
"theme": [
|
|
67
|
-
"./dist/
|
|
59
|
+
"./dist/theme.d.ts"
|
|
68
60
|
],
|
|
69
61
|
"theme/light": [
|
|
70
|
-
"./dist/
|
|
62
|
+
"./dist/light.d.ts"
|
|
71
63
|
],
|
|
72
64
|
"theme/dark": [
|
|
73
|
-
"./dist/
|
|
65
|
+
"./dist/dark.d.ts"
|
|
74
66
|
]
|
|
75
67
|
}
|
|
76
68
|
},
|
|
77
69
|
"sideEffects": [
|
|
78
|
-
"**/*.css"
|
|
70
|
+
"**/*.css",
|
|
71
|
+
"**/ThemeProvider.tsx"
|
|
79
72
|
],
|
|
80
73
|
"scripts": {
|
|
81
74
|
"dev": "vite",
|
|
@@ -97,6 +90,7 @@
|
|
|
97
90
|
"author": "",
|
|
98
91
|
"license": "MIT",
|
|
99
92
|
"dependencies": {
|
|
93
|
+
"@radix-ui/react-popover": "^1.1.14",
|
|
100
94
|
"@radix-ui/react-portal": "^1.1.9",
|
|
101
95
|
"@storybook/cli": "^8.4.2",
|
|
102
96
|
"color2k": "^2.0.3",
|
|
@@ -106,6 +100,8 @@
|
|
|
106
100
|
"react-dom": "^18.3.1"
|
|
107
101
|
},
|
|
108
102
|
"peerDependencies": {
|
|
103
|
+
"@radix-ui/react-portal": "^1.1.9",
|
|
104
|
+
"radix-ui": "^1.4.2",
|
|
109
105
|
"react-aria": "^3.39.0",
|
|
110
106
|
"react-aria-components": "^1.8.0",
|
|
111
107
|
"react-stately": "^3.37.0"
|
package/dist/Button-BLlr5ezy.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";const N=require("react"),z=require("./navigation-DdxS0JoV.js");var ae={exports:{}},L={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ce;function vr(){if(Ce)return L;Ce=1;var I=N,T=Symbol.for("react.element"),k=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,y=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,x={key:!0,ref:!0,__self:!0,__source:!0};function b(_,s,S){var d,f={},h=null,O=null;S!==void 0&&(h=""+S),s.key!==void 0&&(h=""+s.key),s.ref!==void 0&&(O=s.ref);for(d in s)R.call(s,d)&&!x.hasOwnProperty(d)&&(f[d]=s[d]);if(_&&_.defaultProps)for(d in s=_.defaultProps,s)f[d]===void 0&&(f[d]=s[d]);return{$$typeof:T,type:_,key:h,ref:O,props:f,_owner:y.current}}return L.Fragment=k,L.jsx=b,L.jsxs=b,L}var V={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var je;function pr(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var I=N,T=Symbol.for("react.element"),k=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),_=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),$=Symbol.iterator,U="@@iterator";function w(e){if(e===null||typeof e!="object")return null;var r=$&&e[$]||e[U];return typeof r=="function"?r:null}var F=I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ke("error",e,t)}}function ke(e,r,t){{var n=F.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var Fe=!1,Ae=!1,De=!1,Ie=!1,$e=!1,oe;oe=Symbol.for("react.module.reference");function We(e){return!!(typeof e=="string"||typeof e=="function"||e===R||e===x||$e||e===y||e===S||e===d||Ie||e===O||Fe||Ae||De||typeof e=="object"&&e!==null&&(e.$$typeof===h||e.$$typeof===f||e.$$typeof===b||e.$$typeof===_||e.$$typeof===s||e.$$typeof===oe||e.getModuleId!==void 0))}function Be(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ie(e){return e.displayName||"Context"}function E(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case k:return"Portal";case x:return"Profiler";case y:return"StrictMode";case S:return"Suspense";case d:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:var r=e;return ie(r)+".Consumer";case b:var t=e;return ie(t._context)+".Provider";case s:return Be(e,e.render,"ForwardRef");case f:var n=e.displayName||null;return n!==null?n:E(e.type)||"Memo";case h:{var i=e,u=i._payload,o=i._init;try{return E(o(u))}catch{return null}}}return null}var C=Object.assign,W=0,ue,se,le,ce,fe,de,ve;function pe(){}pe.__reactDisabledLog=!0;function Ye(){{if(W===0){ue=console.log,se=console.info,le=console.warn,ce=console.error,fe=console.group,de=console.groupCollapsed,ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Le(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:C({},e,{value:ue}),info:C({},e,{value:se}),warn:C({},e,{value:le}),error:C({},e,{value:ce}),group:C({},e,{value:fe}),groupCollapsed:C({},e,{value:de}),groupEnd:C({},e,{value:ve})})}W<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var G=F.ReactCurrentDispatcher,X;function M(e,r,t){{if(X===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);X=n&&n[1]||""}return`
|
|
18
|
-
`+X+e}}var H=!1,q;{var Ve=typeof WeakMap=="function"?WeakMap:Map;q=new Ve}function ge(e,r){if(!e||H)return"";{var t=q.get(e);if(t!==void 0)return t}var n;H=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=G.current,G.current=null,Ye();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(g){n=g}Reflect.construct(e,[],o)}else{try{o.call()}catch(g){n=g}e.call(o.prototype)}}else{try{throw Error()}catch(g){n=g}e()}}catch(g){if(g&&n&&typeof g.stack=="string"){for(var a=g.stack.split(`
|
|
19
|
-
`),p=n.stack.split(`
|
|
20
|
-
`),l=a.length-1,c=p.length-1;l>=1&&c>=0&&a[l]!==p[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==p[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==p[c]){var m=`
|
|
21
|
-
`+a[l].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,m),m}while(l>=1&&c>=0);break}}}finally{H=!1,G.current=u,Le(),Error.prepareStackTrace=i}var D=e?e.displayName||e.name:"",j=D?M(D):"";return typeof e=="function"&&q.set(e,j),j}function Ne(e,r,t){return ge(e,!1)}function Ue(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function J(e,r,t){if(e==null)return"";if(typeof e=="function")return ge(e,Ue(e));if(typeof e=="string")return M(e);switch(e){case S:return M("Suspense");case d:return M("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return Ne(e.render);case f:return J(e.type);case h:{var n=e,i=n._payload,u=n._init;try{return J(u(i))}catch{}}}return""}var B=Object.prototype.hasOwnProperty,me={},ye=F.ReactDebugCurrentFrame;function K(e){if(e){var r=J(e.type);ye.setExtraStackFrame(r)}else ye.setExtraStackFrame(null)}function Me(e,r,t,n,i){{var u=Function.call.bind(B);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var p=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(K(i),v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),K(null)),a instanceof Error&&!(a.message in me)&&(me[a.message]=!0,K(i),v("Failed %s type: %s",t,a.message),K(null))}}}var qe=Array.isArray;function Z(e){return qe(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Ke(e){try{return!1}catch{return!0}}function ze(e){return""+e}function be(e){if(Ke())return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),ze(e)}var Y=F.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},he,Ee,Q;Q={};function Xe(e){if(B.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function He(e){if(B.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ze(e,r){if(typeof e.ref=="string"&&Y.current&&r&&Y.current.stateNode!==r){var t=E(Y.current.type);Q[t]||(v('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',E(Y.current.type),e.ref),Q[t]=!0)}}function Qe(e,r){{var t=function(){he||(he=!0,v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function er(e,r){{var t=function(){Ee||(Ee=!0,v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var rr=function(e,r,t,n,i,u,o){var a={$$typeof:T,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function tr(e,r,t,n,i){{var u,o={},a=null,p=null;t!==void 0&&(be(t),a=""+t),He(r)&&(be(r.key),a=""+r.key),Xe(r)&&(p=r.ref,Ze(r,i));for(u in r)B.call(r,u)&&!Ge.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var l=e.defaultProps;for(u in l)o[u]===void 0&&(o[u]=l[u])}if(a||p){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Qe(o,c),p&&er(o,c)}return rr(e,a,p,i,n,Y.current,o)}}var ee=F.ReactCurrentOwner,Re=F.ReactDebugCurrentFrame;function A(e){if(e){var r=J(e.type);Re.setExtraStackFrame(r)}else Re.setExtraStackFrame(null)}var re;re=!1;function te(e){return typeof e=="object"&&e!==null&&e.$$typeof===T}function _e(){{if(ee.current){var e=E(ee.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function nr(e){return""}var Te={};function ar(e){{var r=_e();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function xe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=ar(r);if(Te[t])return;Te[t]=!0;var n="";e&&e._owner&&e._owner!==ee.current&&(n=" It was passed a child from "+E(e._owner.type)+"."),A(e),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),A(null)}}function Se(e,r){{if(typeof e!="object")return;if(Z(e))for(var t=0;t<e.length;t++){var n=e[t];te(n)&&xe(n,r)}else if(te(e))e._store&&(e._store.validated=!0);else if(e){var i=w(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)te(o.value)&&xe(o.value,r)}}}function or(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===s||r.$$typeof===f))t=r.propTypes;else return;if(t){var n=E(r);Me(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!re){re=!0;var i=E(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ir(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){A(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),A(null);break}}e.ref!==null&&(A(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var Oe={};function we(e,r,t,n,i,u){{var o=We(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var p=nr();p?a+=p:a+=_e();var l;e===null?l="null":Z(e)?l="array":e!==void 0&&e.$$typeof===T?(l="<"+(E(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var c=tr(e,r,t,i,u);if(c==null)return c;if(o){var m=r.children;if(m!==void 0)if(n)if(Z(m)){for(var D=0;D<m.length;D++)Se(m[D],e);Object.freeze&&Object.freeze(m)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Se(m,e)}if(B.call(r,"key")){var j=E(e),g=Object.keys(r).filter(function(dr){return dr!=="key"}),ne=g.length>0?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}";if(!Oe[j+ne]){var fr=g.length>0?"{"+g.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s {...props} />
|
|
28
|
-
React keys must be passed directly to JSX without using spread:
|
|
29
|
-
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,ne,j,fr,j),Oe[j+ne]=!0}}return e===R?ir(c):or(c),c}}function ur(e,r,t){return we(e,r,t,!0)}function sr(e,r,t){return we(e,r,t,!1)}var lr=sr,cr=ur;V.Fragment=R,V.jsx=lr,V.jsxs=cr}()),V}process.env.NODE_ENV==="production"?ae.exports=vr():ae.exports=pr();var P=ae.exports;const gr={primary:"primary",secondary:"secondary",success:"success",danger:"danger",translucent:"translucent"},mr={small:"small",medium:"medium",large:"large",xlarge:"xlarge","2xlarge":"2xlarge"},Pe=N.forwardRef(({variant:I="primary",size:T="medium",fullWidth:k=!1,icon:R,to:y,target:x,onPress:b,type:_="button",isDisabled:s,"data-testid":S,children:d},f)=>{const h=y&&z.isUrlExternal(y),O=N.useRef(null);N.useLayoutEffect(()=>{typeof f=="function"?f(O.current):f&&(f.current=O.current)},[f]);const $={className:z.csx("proton-Button",`proton-Button--${I}`,k&&"proton-Button--fullWidth",s&&"proton-Button--disabled",T&&`proton-Button--${T}`),"data-testid":S,...y&&{"aria-disabled":s},...s&&{tabIndex:-1}},U=P.jsxs(P.Fragment,{children:[R&&P.jsx("div",{className:z.csx("proton-Button__icon-decorator",k&&"proton-Button__icon-decorator--fullWidth"),children:R}),d&&P.jsx("div",{className:"proton-Button__text",children:d})]});return y?P.jsx("a",{...$,href:y,target:x||(h?"_blank":void 0),rel:h||x==="_blank"?"noopener noreferrer":void 0,ref:f,onClick:w=>{if(s){w.preventDefault();return}!h&&!x&&z.handleInternalNavigation(w,y),b==null||b(w)},role:"button",children:U}):P.jsx("button",{...$,type:_,disabled:s,ref:f,onClick:w=>{!s&&b&&b(w)},children:U})});Pe.displayName="ProtonUIButton";exports.Button=Pe;exports.ButtonSizes=mr;exports.ButtonVariants=gr;exports.jsxRuntimeExports=P;
|
|
31
|
-
//# sourceMappingURL=Button-BLlr5ezy.js.map
|