@spothero/ui 25.1.6 → 25.2.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  import { Modal as Modal$1, ModalOverlay, ModalContent, Box, ModalCloseButton, keyframes, theme as theme$2, Button as Button$2, Drawer as Drawer$1, DrawerOverlay, DrawerContent, DrawerHeader, DrawerCloseButton, Alert as Alert$1, Icon, VStack, AlertTitle, AlertDescription, Flex, forwardRef as forwardRef$1, Tabs as Tabs$1, FormControl as FormControl$2, FormLabel, Text as Text$1, FormHelperText, FormErrorMessage, Select as Select$2, Switch as Switch$1, Grid as Grid$1, GridItem as GridItem$1, List as List$1, Spinner as Spinner$1, Heading as Heading$1, Container as Container$1, createMultiStyleConfigHelpers, extendTheme, ChakraProvider, Img, Image as Image$1, CircularProgress, Progress as Progress$1, Checkbox as Checkbox$1, Input as Input$2, InputGroup, InputLeftElement, InputRightElement, useTheme, Radio as Radio$1, RadioGroup as RadioGroup$1, Stack, usePrefersReducedMotion, Divider as Divider$1, Textarea as Textarea$1, Popover as Popover$1, PopoverArrow as PopoverArrow$1, PopoverCloseButton as PopoverCloseButton$1, PopoverContent as PopoverContent$1, PopoverHeader, PopoverBody, ButtonGroup, Menu as Menu$1 } from '@chakra-ui/react';
3
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AspectRatio, Badge, Input as BasicInput, Textarea as BasicTextarea, Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, ButtonGroup, Center, CheckboxGroup, Circle, Code, Collapse, DrawerBody, DrawerCloseButton, Drawer as DrawerContainer, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, Fade, Flex, HStack, Icon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkBox, LinkOverlay, ListItem, MenuButton, MenuDivider, MenuGroup, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, ModalBody, ModalFooter, ModalHeader, PopoverAnchor, PopoverTrigger, Portal, ScaleFade, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slide, SlideFade, Square, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, TableContainer, Tbody, Td, Tfoot, Th, Thead, Tooltip, Tr, VStack, createIcon, keyframes, useBreakpointValue, useClipboard, useControllableProp, useControllableState, useDisclosure, useMediaQuery, usePopper, usePrefersReducedMotion, useStyleConfig, useTheme, useToast, useToken } from '@chakra-ui/react';
3
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AspectRatio, Badge, Input as BasicInput, Textarea as BasicTextarea, Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, ButtonGroup, Center, CheckboxGroup, Circle, Code, Collapse, DrawerBody, DrawerCloseButton, Drawer as DrawerContainer, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, Fade, Flex, HStack, Icon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkBox, LinkOverlay, ListItem, MenuButton, MenuDivider, MenuGroup, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, ModalBody, ModalFooter, ModalHeader, PopoverAnchor, PopoverTrigger, Portal, ScaleFade, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slide, SlideFade, Square, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, TableContainer, Tbody, Td, Tfoot, Th, Thead, Tooltip, Tr, VStack, createIcon, extendTheme, keyframes, useBreakpointValue, useClipboard, useControllableProp, useControllableState, useDisclosure, useMediaQuery, usePopper, usePrefersReducedMotion, useStyleConfig, useTheme, useToast, useToken } from '@chakra-ui/react';
4
4
  import * as React from 'react';
5
5
  import React__default, { forwardRef, useState, useEffect, Children, cloneElement } from 'react';
6
6
  import merge from 'lodash/merge';
@@ -748,6 +748,19 @@ var base = /*#__PURE__*/Object.freeze({
748
748
  zIndices: indices
749
749
  });
750
750
 
751
+ const heightProps = function () {
752
+ let height = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'md';
753
+ const heights = {
754
+ md: {},
755
+ lg: {
756
+ height: 12,
757
+ lineHeight: sizes$6['6']
758
+ }
759
+ };
760
+ return heights[height] || {
761
+ height // when a custom height is provided, pass it as is
762
+ };
763
+ };
751
764
  const baseStyle$f = {
752
765
  px: 8,
753
766
  py: 3,
@@ -757,7 +770,7 @@ const baseStyle$f = {
757
770
  fontWeight: 'semibold',
758
771
  borderWidth: '1px',
759
772
  borderStyle: 'solid',
760
- borderRadius: '1.25rem',
773
+ borderRadius: 'md',
761
774
  textTransform: 'capitalize',
762
775
  transition: 'all normal ease',
763
776
  _disabled: {
@@ -788,24 +801,80 @@ const destructiveButtonStyles = {
788
801
  color: 'red.800'
789
802
  }, disabledButtonHoverStyle)
790
803
  };
804
+
805
+ /**
806
+ * ## OKLCH Color Adjustments Reference
807
+ * | State | OKLCH Calculation | Visual Effect |
808
+ * |-------|-------------------|---------------|
809
+ * | Default | `primary.default` | Base color |
810
+ * | Hover (light bg) | `calc(l - 0.1)` | 10% darker (lightness) |
811
+ * | Active/Pressed | `calc(l - 0.15)` | 15% darker (lightness) |
812
+ * | Hover (secondary) | `calc(l - 0.3)` | 3% darker (lightness) |
813
+ * | Active/Pressed (secondary) | `calc(l - 0.6)` | 6% darker (lightness) |
814
+ * | Hover (dark bg) | `calc(l + 0.1)` | 10% lighter (lightness) |
815
+ * | Disabled | `opacity: 0.4` | 60% transparent |
816
+ */
817
+
818
+ //Helper function to make oklch color strings
819
+ const generateOklchColor = (colorVar, adjustment) => {
820
+ return "oklch(from var(--chakra-colors-".concat(colorVar, ") calc(l ").concat(adjustment, ") c h)");
821
+ };
822
+
823
+ // 10% darker (lightness)
824
+ const hoverPrimaryColor = generateOklchColor('primary-default', '- 0.1');
825
+ // 15% darker (lightness)
826
+ const activePrimaryColor = generateOklchColor('primary-default', '- 0.15');
827
+ // 3% darker (lightness)
828
+ const hoverSecondaryColor = generateOklchColor('white', '- 0.03');
829
+ // 6% darker (lightness)
830
+ const activeSecondaryColor = generateOklchColor('white', '- 0.06');
831
+ // 10% lighter (lightness)
832
+ const hoverDarkColor = generateOklchColor('yellow-default', '+ 0.1');
833
+
834
+ /**
835
+ * Button Variants - Simplified Color System Using OKLCH
836
+ *
837
+ * This implementation uses OKLCH relative color syntax for perceptually uniform color adjustments.
838
+ * Benefits:
839
+ * - White-label theming: Only need ONE brand color (primary.default)
840
+ * - No package dependencies (native CSS)
841
+ * - Text color NOT affected (unlike CSS filters)
842
+ * - Perceptually uniform adjustments (10% lighter looks consistent across all hues)
843
+ * - Can adjust lightness, chroma, or hue independently
844
+ * - Future-proof modern CSS standard
845
+ *
846
+ * OKLCH Syntax: oklch(from <color> <lightness> <chroma> <hue>)
847
+ * - Lightness adjustments: calc(l - 0.1) = 10% darker, calc(l + 0.1) = 10% lighter
848
+ * - Works with any color format (hex, rgb, etc.) - CSS converts automatically
849
+ *
850
+ * Browser Support: Chrome 111+, Safari 16.4+, Firefox 113+ (Mar-May 2023)
851
+ * Fallback: Older browsers use base color without hover effect degradation
852
+ *
853
+ * Note: Destructive variants still use semantic red for safety/UX consistency
854
+ */
791
855
  const variants$d = {
792
856
  primary: {
793
857
  bg: 'primary.default',
794
858
  borderColor: 'primary.default',
795
859
  color: 'white',
796
860
  _hover: _objectSpread2({
797
- bg: 'primary.600',
798
- borderColor: 'primary.600',
861
+ bg: hoverPrimaryColor,
862
+ borderColor: hoverPrimaryColor,
863
+ color: 'white'
864
+ }, disabledButtonHoverStyle),
865
+ _active: {
866
+ bg: activePrimaryColor,
867
+ borderColor: activePrimaryColor,
799
868
  color: 'white'
800
- }, disabledButtonHoverStyle)
869
+ }
801
870
  },
802
871
  primaryOnDark: {
803
872
  bg: 'yellow.default',
804
873
  borderColor: 'yellow.default',
805
874
  color: 'black',
806
875
  _hover: _objectSpread2({
807
- bg: 'yellow.500',
808
- borderColor: 'yellow.500',
876
+ bg: hoverDarkColor,
877
+ borderColor: hoverDarkColor,
809
878
  color: 'black'
810
879
  }, disabledButtonHoverStyle),
811
880
  _focus: {
@@ -817,9 +886,12 @@ const variants$d = {
817
886
  borderColor: 'gray.medium',
818
887
  color: 'primary.default',
819
888
  _hover: _objectSpread2({
820
- borderColor: 'primary.600',
821
- color: 'primary.600'
822
- }, disabledButtonHoverStyle)
889
+ bg: hoverSecondaryColor,
890
+ color: 'primary.default'
891
+ }, disabledButtonHoverStyle),
892
+ _active: {
893
+ bg: activeSecondaryColor
894
+ }
823
895
  },
824
896
  secondaryOnDark: {
825
897
  bg: 'none',
@@ -827,8 +899,7 @@ const variants$d = {
827
899
  color: 'white',
828
900
  _hover: _objectSpread2({
829
901
  bg: 'white',
830
- borderColor: 'white',
831
- color: 'black'
902
+ color: 'white'
832
903
  }, disabledButtonHoverStyle),
833
904
  _focus: {
834
905
  boxShadow: '0 0 0 3px rgba(255, 255, 255, 0.7)'
@@ -849,13 +920,11 @@ const variants$d = {
849
920
  color: 'gray.dark'
850
921
  },
851
922
  _hover: {
852
- color: 'primary.600',
853
923
  _disabled: {
854
924
  color: 'gray.dark'
855
925
  }
856
926
  },
857
927
  _active: {
858
- color: 'primary.600',
859
928
  _disabled: {
860
929
  color: 'gray.dark'
861
930
  }
@@ -873,13 +942,13 @@ const variants$d = {
873
942
  _disabled: {
874
943
  bg: 'none',
875
944
  color: 'white',
876
- opacity: '.7'
945
+ opacity: 0.4
877
946
  },
878
947
  _hover: {
879
948
  color: 'white',
880
- opacity: '.8',
949
+ opacity: 0.8,
881
950
  _disabled: {
882
- opacity: '.7'
951
+ opacity: 0.4
883
952
  }
884
953
  }
885
954
  },
@@ -964,20 +1033,6 @@ const anchorProps = function () {
964
1033
  rel: 'noopener noreferrer'
965
1034
  });
966
1035
  };
967
- const heightProps = function () {
968
- let height = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'md';
969
- const heights = {
970
- md: {},
971
- lg: {
972
- height: 12,
973
- borderRadius: sizes$6['6'],
974
- lineHeight: sizes$6['6']
975
- }
976
- };
977
- return heights[height] || {
978
- height // when a custom height is provided, pass it as is
979
- };
980
- };
981
1036
  const Button$1 = /*#__PURE__*/forwardRef((_ref, ref) => {
982
1037
  let {
983
1038
  asAnchor,
@@ -3569,7 +3624,7 @@ const controlStyles = {
3569
3624
  color: 'gray.600'
3570
3625
  },
3571
3626
  '& + label': {
3572
- color: 'error'
3627
+ color: 'text.secondary.light'
3573
3628
  },
3574
3629
  '& + label .chakra-form__required-indicator': {
3575
3630
  //Styling for asterisk always to be red if invalid