@moderneinc/neo-styled-components 2.0.3-next.ba615c → 2.0.3-next.bac2ba

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.js CHANGED
@@ -3984,11 +3984,11 @@ NeoInputField.displayName = 'NeoInputField';
3984
3984
  // Size configuration for consistent styling
3985
3985
  const sizeConfig = {
3986
3986
  small: {
3987
- height: 36,
3988
- paddingTop: neoDesign.spacing.spacing_1,
3989
- paddingRight: neoDesign.spacing.spacing_1_1_4,
3990
- paddingBottom: neoDesign.spacing.spacing_1,
3991
- paddingLeft: neoDesign.spacing.spacing_1_1_4,
3987
+ height: neoDesign.spacing.spacing_3_1_2,
3988
+ paddingTop: 1,
3989
+ paddingRight: neoDesign.spacing.spacing_3_4,
3990
+ paddingBottom: 1,
3991
+ paddingLeft: neoDesign.spacing.spacing_3_4,
3992
3992
  gap: neoDesign.spacing.spacing_1,
3993
3993
  iconSize: neoDesign.typography.fontSize.h4,
3994
3994
  fontSize: neoDesign.typography.fontSize.sm,
@@ -3996,10 +3996,10 @@ const sizeConfig = {
3996
3996
  },
3997
3997
  medium: {
3998
3998
  height: neoDesign.spacing.spacing_5,
3999
- paddingTop: neoDesign.spacing.spacing_1,
4000
- paddingRight: neoDesign.spacing.spacing_1_1_4,
4001
- paddingBottom: neoDesign.spacing.spacing_1,
4002
- paddingLeft: neoDesign.spacing.spacing_1,
3999
+ paddingTop: 1,
4000
+ paddingRight: neoDesign.spacing.spacing_3_4,
4001
+ paddingBottom: 1,
4002
+ paddingLeft: neoDesign.spacing.spacing_3_4,
4003
4003
  gap: neoDesign.spacing.spacing_1,
4004
4004
  iconSize: neoDesign.typography.fontSize.h4,
4005
4005
  fontSize: neoDesign.typography.fontSize.default,
@@ -4007,10 +4007,10 @@ const sizeConfig = {
4007
4007
  },
4008
4008
  large: {
4009
4009
  height: neoDesign.spacing.spacing_6,
4010
- paddingTop: neoDesign.spacing.spacing_1,
4011
- paddingRight: neoDesign.spacing.spacing_1_1_4,
4012
- paddingBottom: neoDesign.spacing.spacing_1,
4013
- paddingLeft: neoDesign.spacing.spacing_1_1_4,
4010
+ paddingTop: 1,
4011
+ paddingRight: neoDesign.spacing.spacing_3_4,
4012
+ paddingBottom: 1,
4013
+ paddingLeft: neoDesign.spacing.spacing_3_4,
4014
4014
  gap: neoDesign.spacing.spacing_1_1_2,
4015
4015
  iconSize: neoDesign.typography.fontSize.h2,
4016
4016
  fontSize: neoDesign.typography.fontSize.default,
@@ -4019,10 +4019,10 @@ const sizeConfig = {
4019
4019
  },
4020
4020
  xlarge: {
4021
4021
  height: neoDesign.spacing.spacing_8,
4022
- paddingTop: neoDesign.spacing.spacing_1,
4023
- paddingRight: neoDesign.spacing.spacing_1_1_4,
4024
- paddingBottom: neoDesign.spacing.spacing_1,
4025
- paddingLeft: neoDesign.spacing.spacing_1_1_4,
4022
+ paddingTop: 1,
4023
+ paddingRight: neoDesign.spacing.spacing_3_4,
4024
+ paddingBottom: 1,
4025
+ paddingLeft: neoDesign.spacing.spacing_3_4,
4026
4026
  gap: neoDesign.spacing.spacing_2,
4027
4027
  iconSize: neoDesign.typography.fontSize.h2,
4028
4028
  fontSize: neoDesign.typography.fontSize.default,
@@ -4031,10 +4031,10 @@ const sizeConfig = {
4031
4031
  },
4032
4032
  xxlarge: {
4033
4033
  height: neoDesign.spacing.spacing_10,
4034
- paddingTop: neoDesign.spacing.spacing_1,
4035
- paddingRight: neoDesign.spacing.spacing_1_1_2,
4036
- paddingBottom: neoDesign.spacing.spacing_1,
4037
- paddingLeft: neoDesign.spacing.spacing_1_1_2,
4034
+ paddingTop: 1,
4035
+ paddingRight: neoDesign.spacing.spacing_3_4,
4036
+ paddingBottom: 1,
4037
+ paddingLeft: neoDesign.spacing.spacing_3_4,
4038
4038
  gap: neoDesign.spacing.spacing_2,
4039
4039
  iconSize: neoDesign.spacing.spacing_5,
4040
4040
  fontSize: neoDesign.typography.fontSize.h5,
@@ -4079,10 +4079,17 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
4079
4079
  }),
4080
4080
  },
4081
4081
  // Primary text styling
4082
+ // Font weight varies by size per Figma:
4083
+ // - Default: small/medium use 400, large/xlarge/xxlarge use 500
4084
+ // - Link: xxlarge uses 600, others use their default weight
4082
4085
  '& .list-item-primary': {
4083
4086
  fontSize: theme.typography.pxToRem(config.fontSize),
4084
4087
  lineHeight: config.lineHeight,
4085
- fontWeight: neoDesign.typography.fontWeight.medium,
4088
+ fontWeight: isLink && size === 'xxlarge'
4089
+ ? neoDesign.typography.fontWeight.semiBold
4090
+ : size === 'small' || size === 'medium'
4091
+ ? neoDesign.typography.fontWeight.regular
4092
+ : neoDesign.typography.fontWeight.medium,
4086
4093
  color: isLink
4087
4094
  ? neoDesign.semanticColors.typography.link.primary
4088
4095
  : neoDesign.semanticColors.typography.navigation.default,
@@ -4114,6 +4121,9 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
4114
4121
  backgroundColor: neoDesign.semanticColors.input.background,
4115
4122
  },
4116
4123
  // Selected/Active state
4124
+ // Font weights per Figma:
4125
+ // - Primary: small/medium/xxlarge use 500, large/xlarge use 600
4126
+ // - Secondary: large/xlarge use 500, xxlarge uses 400
4117
4127
  [`&.${ListItemButton.listItemButtonClasses.selected}`]: {
4118
4128
  backgroundColor: neoDesign.semanticColors.buttons.secondary.hoverBackground,
4119
4129
  '&:hover': {
@@ -4123,11 +4133,15 @@ const StyledListItemButton$1 = styles.styled(ListItemButton, {
4123
4133
  color: neoDesign.semanticColors.icons.pressed,
4124
4134
  },
4125
4135
  '& .list-item-primary': {
4126
- fontWeight: neoDesign.typography.fontWeight.semiBold,
4136
+ fontWeight: size === 'large' || size === 'xlarge'
4137
+ ? neoDesign.typography.fontWeight.semiBold
4138
+ : neoDesign.typography.fontWeight.medium,
4127
4139
  color: neoDesign.semanticColors.typography.navigation.default,
4128
4140
  },
4129
4141
  '& .list-item-secondary': {
4130
- fontWeight: neoDesign.typography.fontWeight.medium,
4142
+ fontWeight: size === 'large' || size === 'xlarge'
4143
+ ? neoDesign.typography.fontWeight.medium
4144
+ : neoDesign.typography.fontWeight.regular,
4131
4145
  },
4132
4146
  },
4133
4147
  // Disabled state
@@ -4315,6 +4329,11 @@ const NeoListItemButton = ({ children, selected = false, disabled = false, ...pr
4315
4329
  };
4316
4330
  NeoListItemButton.displayName = 'NeoListItemButton';
4317
4331
 
4332
+ /**
4333
+ * Focus ring box-shadow using Neo design tokens
4334
+ * Combines focusWhite1 (inner white ring) and focusBlue2 (outer blue ring)
4335
+ */
4336
+ const focusRingShadow = `${neoDesign.shadows.focusWhite1.x}px ${neoDesign.shadows.focusWhite1.y}px ${neoDesign.shadows.focusWhite1.blur}px ${neoDesign.shadows.focusWhite1.spread}px ${neoDesign.shadows.focusWhite1.shadow}, ${neoDesign.shadows.focusBlue2.x}px ${neoDesign.shadows.focusBlue2.y}px ${neoDesign.shadows.focusBlue2.blur}px ${neoDesign.shadows.focusBlue2.spread}px ${neoDesign.shadows.focusBlue2.shadow}`;
4318
4337
  /**
4319
4338
  * Styled Card component with Neo design tokens
4320
4339
  */
@@ -4327,19 +4346,20 @@ const StyledCard = styles.styled(MuiCard, {
4327
4346
  display: 'flex',
4328
4347
  flexDirection: 'column',
4329
4348
  gap: theme.spacing(2), // 16px
4330
- backgroundColor: neoDesign.semanticColors.surfaces.card,
4349
+ backgroundColor: selected ? neoDesign.semanticColors.status.info.light : neoDesign.semanticColors.surfaces.card,
4331
4350
  border: `1px solid ${selected ? neoDesign.semanticColors.border.tabActive : neoDesign.semanticColors.border.card}`,
4332
4351
  borderRadius: theme.typography.pxToRem(4),
4333
4352
  boxShadow: 'none',
4334
- transition: theme.transitions.create(['border-color']),
4353
+ transition: theme.transitions.create(['border-color', 'background-color', 'box-shadow']),
4335
4354
  cursor: 'pointer',
4336
4355
  '&:hover': {
4337
4356
  borderColor: selected ? neoDesign.semanticColors.border.tabActive : neoDesign.semanticColors.border.card,
4338
4357
  },
4339
4358
  '&:focus-visible': {
4340
- outline: `2px solid ${neoDesign.semanticColors.border.tabActive}`,
4341
- outlineOffset: '2px',
4359
+ backgroundColor: neoDesign.semanticColors.status.info.light,
4342
4360
  borderColor: neoDesign.semanticColors.border.tabActive,
4361
+ boxShadow: focusRingShadow,
4362
+ outline: 'none',
4343
4363
  },
4344
4364
  ...(disabled && {
4345
4365
  opacity: 0.5,
@@ -4434,9 +4454,12 @@ const Description = styles.styled('p')(({ theme }) => ({
4434
4454
  * - Property 1="Default" → Base state (no props)
4435
4455
  *
4436
4456
  * Design Tokens Used:
4437
- * - semanticColors.surfaces.card (#FFFFFF) - Card background
4457
+ * - semanticColors.surfaces.card (#FFFFFF) - Default card background
4458
+ * - semanticColors.status.info.light (#f2f3ff) - Active/focused card background
4438
4459
  * - semanticColors.border.card (#d1d5db) - Default border
4439
4460
  * - semanticColors.border.tabActive (#2f42ff) - Active/focused border
4461
+ * - shadows.focusWhite1 - Inner white focus ring (2px spread)
4462
+ * - shadows.focusBlue2 - Outer blue focus ring (4px spread)
4440
4463
  * - colors.grey[800] (#1F2937) - Text color
4441
4464
  * - typography.fontSize.xxs (10px) - Recipe count
4442
4465
  * - typography.fontSize.xs (12px) - Description
@@ -5678,10 +5701,10 @@ const NeoToastButton = ({ primary, variant = 'default', children, ...props }) =>
5678
5701
  NeoToast.displayName = 'NeoToast';
5679
5702
  NeoToastButton.displayName = 'NeoToastButton';
5680
5703
 
5681
- const ToggleContainer = styles.styled('label')(({ disabled }) => ({
5704
+ const ToggleContainer = styles.styled('label')(({ disabled, size = 'medium' }) => ({
5682
5705
  display: 'inline-flex',
5683
5706
  alignItems: 'flex-start',
5684
- gap: 12,
5707
+ gap: size === 'small' ? 8 : 12,
5685
5708
  cursor: disabled ? 'not-allowed' : 'pointer',
5686
5709
  userSelect: 'none',
5687
5710
  }));
@@ -5833,7 +5856,7 @@ const NeoToggle = ({ size = 'medium', label, helperText, disabled, ...props }) =
5833
5856
  return jsxRuntime.jsx(StyledSwitch, { size: size, disabled: disabled, ...props });
5834
5857
  }
5835
5858
  // With label, wrap in container for proper layout
5836
- return (jsxRuntime.jsxs(ToggleContainer, { disabled: disabled, children: [jsxRuntime.jsx(StyledSwitch, { size: size, disabled: disabled, ...props }), jsxRuntime.jsxs(LabelContainer, { children: [label && jsxRuntime.jsx(Label, { size: size, children: label }), helperText && jsxRuntime.jsx(HelperText, { size: size, children: helperText })] })] }));
5859
+ return (jsxRuntime.jsxs(ToggleContainer, { disabled: disabled, size: size, children: [jsxRuntime.jsx(StyledSwitch, { size: size, disabled: disabled, ...props }), jsxRuntime.jsxs(LabelContainer, { children: [label && jsxRuntime.jsx(Label, { size: size, children: label }), helperText && jsxRuntime.jsx(HelperText, { size: size, children: helperText })] })] }));
5837
5860
  };
5838
5861
  NeoToggle.displayName = 'NeoToggle';
5839
5862