@moderneinc/design-system-components 7.1.0-next.a4cbde → 7.1.0-next.b16a41
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/SearchChip/SearchChip.d.ts +12 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.esm.js +30 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +29 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { type InputBaseProps } from '@mui/material/InputBase';
|
|
2
|
-
|
|
2
|
+
type SearchChipSize = 'small' | 'medium';
|
|
3
|
+
export interface ModSearchChipProps extends Omit<InputBaseProps, 'startAdornment' | 'endAdornment' | 'type' | 'size'> {
|
|
4
|
+
/**
|
|
5
|
+
* The size of the search chip
|
|
6
|
+
* @default "medium"
|
|
7
|
+
*/
|
|
8
|
+
size?: SearchChipSize;
|
|
3
9
|
/**
|
|
4
10
|
* Handler for clearing the search value (shows X icon when provided and value is non-empty)
|
|
5
11
|
*/
|
|
@@ -10,8 +16,13 @@ export interface ModSearchChipProps extends Omit<InputBaseProps, 'startAdornment
|
|
|
10
16
|
*
|
|
11
17
|
* @example
|
|
12
18
|
* <ModSearchChip placeholder="Search titles" value={query} onChange={handleChange} onClear={handleClear} />
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Small size
|
|
22
|
+
* <ModSearchChip size="small" placeholder="Search titles" value={query} onChange={handleChange} />
|
|
13
23
|
*/
|
|
14
24
|
export declare const ModSearchChip: {
|
|
15
25
|
({ onClear, value, ...props }: ModSearchChipProps): import("react/jsx-runtime").JSX.Element;
|
|
16
26
|
displayName: string;
|
|
17
27
|
};
|
|
28
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2551,7 +2551,13 @@ interface ModRipplingDotProps extends BoxProps$1 {
|
|
|
2551
2551
|
*/
|
|
2552
2552
|
declare const ModRipplingDot: FunctionComponent<ModRipplingDotProps>;
|
|
2553
2553
|
|
|
2554
|
-
|
|
2554
|
+
type SearchChipSize = 'small' | 'medium';
|
|
2555
|
+
interface ModSearchChipProps extends Omit<InputBaseProps, 'startAdornment' | 'endAdornment' | 'type' | 'size'> {
|
|
2556
|
+
/**
|
|
2557
|
+
* The size of the search chip
|
|
2558
|
+
* @default "medium"
|
|
2559
|
+
*/
|
|
2560
|
+
size?: SearchChipSize;
|
|
2555
2561
|
/**
|
|
2556
2562
|
* Handler for clearing the search value (shows X icon when provided and value is non-empty)
|
|
2557
2563
|
*/
|
|
@@ -2562,6 +2568,10 @@ interface ModSearchChipProps extends Omit<InputBaseProps, 'startAdornment' | 'en
|
|
|
2562
2568
|
*
|
|
2563
2569
|
* @example
|
|
2564
2570
|
* <ModSearchChip placeholder="Search titles" value={query} onChange={handleChange} onClear={handleClear} />
|
|
2571
|
+
*
|
|
2572
|
+
* @example
|
|
2573
|
+
* // Small size
|
|
2574
|
+
* <ModSearchChip size="small" placeholder="Search titles" value={query} onChange={handleChange} />
|
|
2565
2575
|
*/
|
|
2566
2576
|
declare const ModSearchChip: {
|
|
2567
2577
|
({ onClear, value, ...props }: ModSearchChipProps): react_jsx_runtime.JSX.Element;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { semanticColors, spacing, typography, borderRadius, shadows, colors, semanticColorsDark, semanticTypography } from '@moderneinc/design-system-tokens';
|
|
2
|
+
import { semanticColors, spacing, typography, borderRadius, shadows, colors, semanticColorsDark, semanticTypography, height } from '@moderneinc/design-system-tokens';
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import { styled, useTheme, alpha } from '@mui/material/styles';
|
|
5
5
|
import Chip, { chipClasses } from '@mui/material/Chip';
|
|
@@ -965,17 +965,21 @@ ModButtonTab.displayName = 'ModButtonTab';
|
|
|
965
965
|
*
|
|
966
966
|
* Custom styling:
|
|
967
967
|
* - Rounded-rectangle border (borderRadius.button)
|
|
968
|
-
* - Size variants (small=
|
|
968
|
+
* - Size variants (small=24px, medium=40px)
|
|
969
969
|
* - Border colors using semantic tokens
|
|
970
970
|
* - Selected state colors from design system tokens
|
|
971
971
|
*/
|
|
972
972
|
const StyledButtonTabGroup = styled(MuiToggleButtonGroup)(({ theme, size = 'medium' }) => {
|
|
973
973
|
const sizeStyles = {
|
|
974
974
|
small: {
|
|
975
|
-
height: spacing.
|
|
975
|
+
height: spacing.spacing_3,
|
|
976
|
+
padding: `0 ${spacing.spacing_1_1_2}px`,
|
|
977
|
+
fontSize: typography.fontSize.caption,
|
|
976
978
|
},
|
|
977
979
|
medium: {
|
|
978
980
|
height: spacing.spacing_5,
|
|
981
|
+
padding: `${spacing.spacing_1}px ${spacing.spacing_2}px`,
|
|
982
|
+
fontSize: typography.fontSize.sm,
|
|
979
983
|
},
|
|
980
984
|
};
|
|
981
985
|
return {
|
|
@@ -987,8 +991,8 @@ const StyledButtonTabGroup = styled(MuiToggleButtonGroup)(({ theme, size = 'medi
|
|
|
987
991
|
flex: 1,
|
|
988
992
|
minWidth: 'auto',
|
|
989
993
|
height: sizeStyles[size].height,
|
|
990
|
-
padding:
|
|
991
|
-
fontSize: theme.typography.pxToRem(
|
|
994
|
+
padding: sizeStyles[size].padding,
|
|
995
|
+
fontSize: theme.typography.pxToRem(sizeStyles[size].fontSize),
|
|
992
996
|
fontWeight: typography.fontWeight.regular,
|
|
993
997
|
lineHeight: 1,
|
|
994
998
|
textTransform: 'none',
|
|
@@ -2407,7 +2411,7 @@ function ModDataGridColumnsButton() {
|
|
|
2407
2411
|
}
|
|
2408
2412
|
ModDataGridColumnsButton.displayName = 'ModDataGridColumnsButton';
|
|
2409
2413
|
|
|
2410
|
-
const sizeStyles$
|
|
2414
|
+
const sizeStyles$2 = {
|
|
2411
2415
|
small: {
|
|
2412
2416
|
height: 16,
|
|
2413
2417
|
minWidth: 16,
|
|
@@ -2504,7 +2508,7 @@ const StyledChip$2 = styled(Chip, {
|
|
|
2504
2508
|
lineHeight: semanticTypography.chip.lineHeight,
|
|
2505
2509
|
fontWeight: semanticTypography.chip.fontWeight,
|
|
2506
2510
|
overflow: 'visible',
|
|
2507
|
-
...(size && sizeStyles$
|
|
2511
|
+
...(size && sizeStyles$2[size]),
|
|
2508
2512
|
[`& .${chipClasses.label}`]: {
|
|
2509
2513
|
padding: 0,
|
|
2510
2514
|
overflow: 'visible',
|
|
@@ -5318,12 +5322,24 @@ const ModRipplingDot = props => (jsx(Box$1, { "aria-hidden": "true", ...props, s
|
|
|
5318
5322
|
} }));
|
|
5319
5323
|
ModRipplingDot.displayName = 'ModRipplingDot';
|
|
5320
5324
|
|
|
5321
|
-
const
|
|
5325
|
+
const sizeStyles$1 = {
|
|
5326
|
+
small: {
|
|
5327
|
+
height: height.input.dense,
|
|
5328
|
+
padding: `0 ${spacing.spacing_1_1_4}px`,
|
|
5329
|
+
},
|
|
5330
|
+
medium: {
|
|
5331
|
+
height: height.input.default,
|
|
5332
|
+
padding: `0 ${spacing.spacing_1_1_2}px`,
|
|
5333
|
+
},
|
|
5334
|
+
};
|
|
5335
|
+
const StyledSearchChip = styled(InputBase, {
|
|
5336
|
+
shouldForwardProp: prop => prop !== 'size' && !isMuiInternalProp(prop),
|
|
5337
|
+
})(({ theme, size = 'medium' }) => ({
|
|
5322
5338
|
borderRadius: borderRadius.button,
|
|
5323
5339
|
border: `1px solid ${semanticColors.color.border.primary}`,
|
|
5324
5340
|
backgroundColor: semanticColors.color.surface.raised,
|
|
5325
|
-
height:
|
|
5326
|
-
padding:
|
|
5341
|
+
height: sizeStyles$1[size].height,
|
|
5342
|
+
padding: sizeStyles$1[size].padding,
|
|
5327
5343
|
gap: spacing.spacing_1_2,
|
|
5328
5344
|
fontSize: theme.typography.pxToRem(typography.fontSize.sm),
|
|
5329
5345
|
fontWeight: typography.fontWeight.medium,
|
|
@@ -5388,6 +5404,10 @@ const ClearButton = styled(ButtonBase)({
|
|
|
5388
5404
|
*
|
|
5389
5405
|
* @example
|
|
5390
5406
|
* <ModSearchChip placeholder="Search titles" value={query} onChange={handleChange} onClear={handleClear} />
|
|
5407
|
+
*
|
|
5408
|
+
* @example
|
|
5409
|
+
* // Small size
|
|
5410
|
+
* <ModSearchChip size="small" placeholder="Search titles" value={query} onChange={handleChange} />
|
|
5391
5411
|
*/
|
|
5392
5412
|
const ModSearchChip = ({ onClear, value, ...props }) => {
|
|
5393
5413
|
const hasValue = Boolean(value && String(value).length > 0);
|