@graphcommerce/next-ui 4.21.0 → 4.22.0

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.
Files changed (41) hide show
  1. package/ActionCard/ActionCard.tsx +46 -12
  2. package/ActionCard/ActionCardList.tsx +17 -15
  3. package/ActionCard/ActionCardListForm.tsx +1 -2
  4. package/AnimatedRow/AnimatedRow.tsx +1 -0
  5. package/Blog/BlogHeader/BlogHeader.tsx +7 -1
  6. package/Blog/BlogListItem/BlogListItem.tsx +5 -1
  7. package/Blog/BlogTags/BlogTag.tsx +2 -3
  8. package/CHANGELOG.md +30 -0
  9. package/Footer/Footer.tsx +3 -2
  10. package/Form/Form.tsx +7 -1
  11. package/Form/FormActions.tsx +1 -1
  12. package/FramerScroller/SidebarGallery.tsx +1 -5
  13. package/IconSvg/IconSvg.tsx +4 -4
  14. package/Layout/components/LayoutHeaderClose.tsx +2 -0
  15. package/Layout/components/LayoutHeaderContent.tsx +3 -1
  16. package/LayoutDefault/components/LayoutDefault.tsx +3 -3
  17. package/LayoutOverlay/components/LayoutOverlay.tsx +2 -1
  18. package/LayoutParts/DesktopHeaderBadge.tsx +3 -3
  19. package/Navigation/components/NavigationItem.tsx +31 -17
  20. package/Navigation/components/NavigationList.tsx +21 -15
  21. package/Navigation/components/NavigationOverlay.tsx +47 -27
  22. package/Navigation/components/NavigationProvider.tsx +12 -30
  23. package/Navigation/hooks/useNavigation.ts +33 -6
  24. package/Overlay/components/Overlay.tsx +1 -2
  25. package/Overlay/components/OverlayBase.tsx +19 -19
  26. package/Overlay/hooks/useOverlayPosition.ts +6 -1
  27. package/Row/HeroBanner/HeroBanner.tsx +7 -2
  28. package/Row/ImageText/ImageText.tsx +10 -3
  29. package/Row/ImageTextBoxed/ImageTextBoxed.tsx +7 -1
  30. package/Row/ParagraphWithSidebarSlide/ParagraphWithSidebarSlide.tsx +4 -2
  31. package/Row/SpecialBanner/SpecialBanner.tsx +10 -2
  32. package/Snackbar/MessageSnackbarImpl.tsx +9 -5
  33. package/Stepper/Stepper.tsx +1 -1
  34. package/Styles/breakpointVal.tsx +1 -1
  35. package/TextInputNumber/TextInputNumber.tsx +5 -4
  36. package/Theme/MuiButton.ts +12 -3
  37. package/Theme/MuiFab.ts +2 -2
  38. package/ToggleButton/ToggleButton.tsx +15 -5
  39. package/hooks/index.ts +1 -0
  40. package/hooks/useMemoDeep.ts +15 -0
  41. package/package.json +5 -5
@@ -1,3 +1,4 @@
1
+ import { i18n } from '@lingui/core'
1
2
  import {
2
3
  IconButton,
3
4
  IconButtonProps,
@@ -15,7 +16,7 @@ import { iconMin, iconPlus } from '../icons'
15
16
 
16
17
  export type IconButtonPropsOmit = Omit<
17
18
  IconButtonProps,
18
- 'aria-label' | 'size' | 'onMouseDown' | 'onMouseUp' | 'disabled'
19
+ 'aria-labelledby' | 'aria-label' | 'size' | 'onMouseDown' | 'onMouseUp' | 'disabled'
19
20
  >
20
21
 
21
22
  export type TextInputNumberProps = Omit<TextFieldProps, 'type'> & {
@@ -95,7 +96,6 @@ export function TextInputNumber(props: TextInputNumberProps) {
95
96
  sx={[
96
97
  {
97
98
  width: responsiveVal(80, 120),
98
- backgroundColor: 'inherit',
99
99
  },
100
100
  ...(Array.isArray(sx) ? sx : [sx]),
101
101
  ]}
@@ -104,7 +104,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
104
104
  ...textFieldProps.InputProps,
105
105
  startAdornment: (
106
106
  <IconButton
107
- aria-label='step down'
107
+ aria-label={i18n._(/* i18n */ 'Decrease')}
108
108
  size='medium'
109
109
  edge='start'
110
110
  onPointerDown={() => setDirection('down')}
@@ -120,7 +120,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
120
120
  ),
121
121
  endAdornment: (
122
122
  <IconButton
123
- aria-label='step up'
123
+ aria-label={i18n._(/* i18n */ 'Increase')}
124
124
  size='medium'
125
125
  edge='end'
126
126
  onPointerDown={() => setDirection('up')}
@@ -141,6 +141,7 @@ export function TextInputNumber(props: TextInputNumberProps) {
141
141
  }}
142
142
  inputProps={{
143
143
  ...inputProps,
144
+ 'aria-label': i18n._(/* i18n */ 'Number'),
144
145
  sx: [
145
146
  {
146
147
  textAlign: 'center',
@@ -22,7 +22,10 @@ export const MuiButtonResponsive: ButtonVariants = [
22
22
  props: { size: 'small' },
23
23
  style: ({ theme }) => ({
24
24
  ...theme.typography.body2,
25
- padding: `${responsiveVal(3, 5)} ${responsiveVal(9, 15)}`,
25
+ padding: `${responsiveVal(3, 5)} ${responsiveVal(8, 15)}`,
26
+ '&.MuiLoadingButton-loading:hover': {
27
+ backgroundColor: theme.palette.action.disabledBackground,
28
+ },
26
29
  '& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(9, 15) },
27
30
  '& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(9, 15) },
28
31
  }),
@@ -31,7 +34,10 @@ export const MuiButtonResponsive: ButtonVariants = [
31
34
  props: { size: 'medium' },
32
35
  style: ({ theme }) => ({
33
36
  ...theme.typography.body1,
34
- padding: `${responsiveVal(8, 11)} ${responsiveVal(16, 24)}`,
37
+ padding: `${responsiveVal(7, 9)} ${responsiveVal(15, 22)}`,
38
+ '&.MuiLoadingButton-loading:hover': {
39
+ backgroundColor: theme.palette.action.disabledBackground,
40
+ },
35
41
  '& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(16, 24) },
36
42
  '& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(16, 24) },
37
43
  }),
@@ -41,7 +47,10 @@ export const MuiButtonResponsive: ButtonVariants = [
41
47
  style: ({ theme }) => ({
42
48
  ...theme.typography.subtitle1,
43
49
  fontWeight: theme.typography.fontWeightBold,
44
- padding: `${responsiveVal(10, 15)} ${responsiveVal(30, 60)}`,
50
+ padding: `${responsiveVal(10, 15)} ${responsiveVal(28, 58)}`,
51
+ '&.MuiLoadingButton-loading:hover': {
52
+ backgroundColor: theme.palette.action.disabledBackground,
53
+ },
45
54
  '& .MuiLoadingButton-loadingIndicatorEnd': { right: responsiveVal(30, 60) },
46
55
  '& .MuiLoadingButton-loadingIndicatorStart': { left: responsiveVal(30, 60) },
47
56
  }),
package/Theme/MuiFab.ts CHANGED
@@ -27,8 +27,8 @@ const defaultSizes: FabSizes = {
27
27
  */
28
28
  small: '40px',
29
29
  medium: '48px',
30
- large: '56px',
31
- responsive: responsiveVal(40, 56),
30
+ large: '54px',
31
+ responsive: responsiveVal(40, 54),
32
32
  }
33
33
 
34
34
  function fabSize(size: FabSize, theme: Theme) {
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { Button, ButtonProps } from '@mui/material'
2
+ import { alpha, Button, ButtonProps } from '@mui/material'
3
3
  import React, { FormEvent } from 'react'
4
4
  import { extendableComponent } from '../Styles'
5
- import { responsiveVal } from '../Styles/responsiveVal'
5
+ import { breakpointVal } from '../Styles/breakpointVal'
6
6
 
7
7
  export type ToggleButtonProps = Omit<ButtonProps, 'onClick' | 'onChange'> & {
8
8
  selected?: boolean
@@ -72,16 +72,26 @@ export const ToggleButton = React.forwardRef<any, ToggleButtonProps>((props, ref
72
72
  border: `1px solid ${theme.palette[color]?.main ?? theme.palette.primary.main}`,
73
73
  boxShadow: `inset 0 0 0 1px ${
74
74
  theme.palette[color]?.main ?? theme.palette.primary.main
75
- }`,
75
+ },0 0 0 4px ${alpha(
76
+ theme.palette.primary.main,
77
+ theme.palette.action.hoverOpacity,
78
+ )} !important`,
76
79
  },
77
80
  ':not(&.sizeSmall)': {
78
- borderRadius: responsiveVal(theme.shape.borderRadius * 2, theme.shape.borderRadius * 3),
81
+ ...breakpointVal(
82
+ 'borderRadius',
83
+ theme.shape.borderRadius * 2,
84
+ theme.shape.borderRadius * 3,
85
+ theme.breakpoints.values,
86
+ ),
79
87
  padding: `${theme.spacings.xxs} ${theme.spacings.xs}`,
80
88
  },
81
89
  '&.sizeSmall': {
82
- borderRadius: responsiveVal(
90
+ ...breakpointVal(
91
+ 'borderRadius',
83
92
  theme.shape.borderRadius * 1,
84
93
  theme.shape.borderRadius * 1.5,
94
+ theme.breakpoints.values,
85
95
  ),
86
96
  padding: `8px 12px`,
87
97
  },
package/hooks/index.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './useDateTimeFormat'
2
2
  export * from './useNumberFormat'
3
3
  export * from './useUrlQuery'
4
+ export * from './useMemoDeep'
@@ -0,0 +1,15 @@
1
+ import { equal } from '@wry/equality'
2
+ import { DependencyList, useMemo, useRef } from 'react'
3
+
4
+ export function useMemoDeep<T>(factory: () => T, deps: DependencyList | undefined): T {
5
+ const ref = useRef<DependencyList | undefined>(undefined)
6
+ const signalRef = useRef<number>(0)
7
+
8
+ if (!equal(deps, ref.current)) {
9
+ ref.current = deps
10
+ signalRef.current += 1
11
+ }
12
+
13
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14
+ return useMemo(() => factory(), [signalRef.current])
15
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.21.0",
5
+ "version": "4.22.0",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -19,10 +19,10 @@
19
19
  "@emotion/react": "^11.9.3",
20
20
  "@emotion/server": "^11.4.0",
21
21
  "@emotion/styled": "^11.9.3",
22
- "@graphcommerce/framer-next-pages": "3.2.5",
23
- "@graphcommerce/framer-scroller": "2.1.32",
24
- "@graphcommerce/framer-utils": "3.1.5",
25
- "@graphcommerce/image": "3.1.8",
22
+ "@graphcommerce/framer-next-pages": "3.3.0",
23
+ "@graphcommerce/framer-scroller": "2.1.33",
24
+ "@graphcommerce/framer-utils": "3.2.0",
25
+ "@graphcommerce/image": "3.1.9",
26
26
  "cookie": "^0.5.0",
27
27
  "react-is": "^18.2.0",
28
28
  "schema-dts": "^1.1.0"