@coveord/plasma-mantine 59.2.0 → 59.4.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 (50) hide show
  1. package/.turbo/turbo-build.log +4 -4
  2. package/.turbo/turbo-test.log +93 -93
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/cjs/components/CopyToClipboard/CopyToClipboard.d.ts +1 -0
  5. package/dist/cjs/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -1
  6. package/dist/cjs/components/CopyToClipboard/CopyToClipboard.js.map +1 -1
  7. package/dist/cjs/components/InfoToken/InfoToken.module.css +1 -1
  8. package/dist/cjs/components/Input/InputLabelInfo.d.ts.map +1 -1
  9. package/dist/cjs/components/Input/InputLabelInfo.js +4 -1
  10. package/dist/cjs/components/Input/InputLabelInfo.js.map +1 -1
  11. package/dist/cjs/components/Input/InputLabelInfo.module.css +1 -0
  12. package/dist/cjs/components/RadioCard/RadioCard.d.ts.map +1 -1
  13. package/dist/cjs/components/RadioCard/RadioCard.js +18 -18
  14. package/dist/cjs/components/RadioCard/RadioCard.js.map +1 -1
  15. package/dist/cjs/styles/ActionIcon.module.css +23 -0
  16. package/dist/cjs/styles/CloseButton.module.css +15 -0
  17. package/dist/cjs/styles/Pill.module.css +13 -0
  18. package/dist/cjs/styles/RadioCard.module.css +31 -30
  19. package/dist/cjs/theme/Theme.d.ts.map +1 -1
  20. package/dist/cjs/theme/Theme.js +4 -2
  21. package/dist/cjs/theme/Theme.js.map +1 -1
  22. package/dist/esm/components/CopyToClipboard/CopyToClipboard.d.ts +1 -0
  23. package/dist/esm/components/CopyToClipboard/CopyToClipboard.d.ts.map +1 -1
  24. package/dist/esm/components/CopyToClipboard/CopyToClipboard.js.map +1 -1
  25. package/dist/esm/components/InfoToken/InfoToken.module.css +1 -1
  26. package/dist/esm/components/Input/InputLabelInfo.d.ts.map +1 -1
  27. package/dist/esm/components/Input/InputLabelInfo.js +2 -1
  28. package/dist/esm/components/Input/InputLabelInfo.js.map +1 -1
  29. package/dist/esm/components/Input/InputLabelInfo.module.css +1 -0
  30. package/dist/esm/components/RadioCard/RadioCard.d.ts.map +1 -1
  31. package/dist/esm/components/RadioCard/RadioCard.js +20 -20
  32. package/dist/esm/components/RadioCard/RadioCard.js.map +1 -1
  33. package/dist/esm/styles/ActionIcon.module.css +23 -0
  34. package/dist/esm/styles/CloseButton.module.css +15 -0
  35. package/dist/esm/styles/Pill.module.css +13 -0
  36. package/dist/esm/styles/RadioCard.module.css +31 -30
  37. package/dist/esm/theme/Theme.d.ts.map +1 -1
  38. package/dist/esm/theme/Theme.js +4 -2
  39. package/dist/esm/theme/Theme.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/components/CopyToClipboard/CopyToClipboard.tsx +1 -0
  42. package/src/components/InfoToken/InfoToken.module.css +1 -1
  43. package/src/components/Input/InputLabelInfo.module.css +1 -0
  44. package/src/components/Input/InputLabelInfo.tsx +7 -2
  45. package/src/components/RadioCard/RadioCard.tsx +25 -12
  46. package/src/styles/ActionIcon.module.css +23 -0
  47. package/src/styles/CloseButton.module.css +15 -0
  48. package/src/styles/Pill.module.css +13 -0
  49. package/src/styles/RadioCard.module.css +31 -30
  50. package/src/theme/Theme.tsx +3 -1
@@ -1,13 +1,11 @@
1
1
  import {
2
- Box,
3
2
  Factory,
4
- Group,
5
3
  RadioCardProps as MantineRadioCardProps,
6
4
  RadioCardStylesNames as MantineRadioCardStylesNames,
7
5
  Radio,
8
6
  RadioCardCssVariables,
7
+ Stack,
9
8
  StylesApiProps,
10
- Title,
11
9
  Tooltip,
12
10
  factory,
13
11
  useProps,
@@ -15,6 +13,7 @@ import {
15
13
  } from '@mantine/core';
16
14
  import {ReactNode} from 'react';
17
15
  import classes from '../../styles/RadioCard.module.css';
16
+ import {Input} from '../Input/Input';
18
17
 
19
18
  export type RadioCardStylesNames = MantineRadioCardStylesNames | 'container' | 'indicator' | 'title' | 'description';
20
19
  export type RadioCardFactory = Factory<{
@@ -47,8 +46,19 @@ export type RadioCardProps = MantineRadioCardProps &
47
46
  const defaultProps: Partial<RadioCardProps> = {};
48
47
 
49
48
  export const RadioCard = factory<RadioCardFactory>((_props, ref) => {
50
- const {classNames, styles, style, className, vars, disabled, label, description, disabledTooltip, ...others} =
51
- useProps('RadioCard', defaultProps, _props);
49
+ const {
50
+ children,
51
+ classNames,
52
+ styles,
53
+ style,
54
+ className,
55
+ vars,
56
+ disabled,
57
+ label,
58
+ description,
59
+ disabledTooltip,
60
+ ...others
61
+ } = useProps('RadioCard', defaultProps, _props);
52
62
  const getStyles = useStyles<RadioCardFactory>({
53
63
  name: 'RadioCard',
54
64
  classes,
@@ -69,13 +79,16 @@ export const RadioCard = factory<RadioCardFactory>((_props, ref) => {
69
79
  {...getStyles('card', {className, style, classNames, styles})}
70
80
  {...others}
71
81
  >
72
- <Group {...getStyles('container', {classNames, styles})}>
73
- <Radio.Indicator size="xs" disabled={disabled} {...getStyles('indicator', {classNames, styles})} />
74
- <Title order={4} {...getStyles('title', {classNames, styles})}>
75
- {label}
76
- </Title>
77
- </Group>
78
- {description && <Box {...getStyles('description', {classNames, styles})}>{description}</Box>}
82
+ <Radio.Indicator disabled={disabled} {...getStyles('indicator', {classNames, styles})} />
83
+ <Stack {...getStyles('container', {classNames, styles})}>
84
+ <Input.Label {...getStyles('title', {classNames, styles})}>{label}</Input.Label>
85
+ {description && (
86
+ <Input.Description {...getStyles('description', {classNames, styles})}>
87
+ {description}
88
+ </Input.Description>
89
+ )}
90
+ {children}
91
+ </Stack>
79
92
  </Radio.Card>
80
93
  </Tooltip>
81
94
  );
@@ -1,5 +1,28 @@
1
1
  .root {
2
+ --ai-size-sm: 16px;
3
+ --ai-size-md: 24px;
2
4
  --ai-size-lg: 36px;
5
+ --ai-icon-size: 20px;
6
+
7
+ svg {
8
+ width: var(--ai-icon-size);
9
+ height: var(--ai-icon-size);
10
+ }
11
+
12
+ &[data-size='sm'] {
13
+ --ai-radius: var(--mantine-radius-sm);
14
+ --ai-icon-size: 12px;
15
+ }
16
+
17
+ &[data-size='md'] {
18
+ --ai-radius: var(--mantine-radius-sm);
19
+ --ai-icon-size: 16px;
20
+ }
21
+
22
+ &[data-size='lg'] {
23
+ --ai-radius: var(--mantine-radius-md);
24
+ --ai-icon-size: 20px;
25
+ }
3
26
 
4
27
  &[data-variant='subtle'] {
5
28
  &:where(:disabled:not([data-loading]), [data-disabled]:not([data-loading])) {
@@ -0,0 +1,15 @@
1
+ .root {
2
+ &[data-size='sm'] {
3
+ & svg {
4
+ width: 12px;
5
+ height: 12px;
6
+ }
7
+ }
8
+
9
+ &[data-size='md'] {
10
+ & svg {
11
+ width: 16px;
12
+ height: 16px;
13
+ }
14
+ }
15
+ }
@@ -1,4 +1,17 @@
1
1
  .root {
2
+ padding: 0 var(--mantine-spacing-xs);
2
3
  color: var(--mantine-color-text);
3
4
  background-color: var(--mantine-color-gray-light);
5
+
6
+ &[data-with-remove] {
7
+ padding: 0 var(--mantine-spacing-xxs) 0 var(--mantine-spacing-xs);
8
+
9
+ &[data-size='md'] {
10
+ padding: 0 2px 0 var(--mantine-spacing-xs);
11
+ }
12
+ }
13
+ }
14
+
15
+ .remove {
16
+ padding: 0;
4
17
  }
@@ -5,24 +5,30 @@
5
5
  }
6
6
 
7
7
  .card {
8
- display: inline-flex;
9
- flex-direction: column;
8
+ --radio-card-outline-color: var(--mantine-color-default-border);
9
+
10
+ display: flex;
11
+ flex-flow: row nowrap;
10
12
  align-items: flex-start;
13
+ gap: var(--mantine-spacing-sm);
11
14
  padding: var(--mantine-spacing-sm);
12
15
  border-radius: var(--mantine-radius-lg);
16
+ border-color: var(--radio-card-outline-color);
17
+ transition: border-color 150ms ease;
13
18
 
14
19
  &[data-checked] {
15
- border-color: var(--mantine-primary-color-filled);
20
+ --radio-card-outline-color: var(--mantine-primary-color-filled);
21
+ }
22
+
23
+ &[disabled],
24
+ &[readonly] {
25
+ --radio-card-outline-color: var(--mantine-color-default-border);
16
26
  }
17
27
 
18
28
  &[disabled] {
19
29
  cursor: not-allowed;
20
- border-color: var(--mantine-color-default-border);
21
-
22
- .title {
23
- color: var(--mantine-color-disabled-color);
24
- }
25
30
 
31
+ .title,
26
32
  .description {
27
33
  color: var(--mantine-color-disabled-color);
28
34
  }
@@ -30,44 +36,39 @@
30
36
 
31
37
  &[readonly] {
32
38
  pointer-events: none;
33
- border-color: var(--mantine-color-default-border);
34
39
 
35
- & .indicator {
36
- border-color: var(--mantine-color-default-border);
40
+ .indicator[data-checked] {
41
+ background-color: var(--mantine-color-default);
42
+ color: var(--coveo-color-text-readonly);
37
43
 
38
- &[data-checked] {
39
- background-color: var(--coveo-color-bg-readonly);
40
- color: var(--coveo-color-text-readonly);
41
-
42
- & > svg {
43
- color: var(--coveo-color-text-readonly);
44
- }
44
+ & > svg {
45
+ color: inherit;
45
46
  }
46
47
  }
47
48
  }
48
49
  }
49
50
 
50
51
  .container {
51
- flex-wrap: nowrap;
52
- gap: var(--mantine-spacing-sm);
53
- align-items: baseline;
54
- justify-content: flex-start;
55
- width: 100%;
56
- margin-bottom: var(--mantine-spacing-xs);
52
+ gap: var(--mantine-spacing-xs);
57
53
  }
58
54
 
59
55
  .title {
60
- flex: 1;
61
- word-break: break-word;
56
+ line-height: 20px;
62
57
  }
63
58
 
59
+ .title,
64
60
  .description {
65
- padding-left: var(--mantine-spacing-lg);
66
- color: var(--mantine-color-dimmed);
67
- font-weight: 400;
68
- font-size: var(--mantine-font-size-xs);
61
+ flex: 1;
62
+ overflow-wrap: anywhere;
69
63
  }
70
64
 
71
65
  .indicator {
72
66
  cursor: pointer;
67
+ transition: border-color 150ms ease;
68
+
69
+ &,
70
+ &[data-disabled],
71
+ &[data-checked] {
72
+ border-color: var(--radio-card-outline-color);
73
+ }
73
74
  }
@@ -83,6 +83,7 @@ import CardClasses from '../styles/Card.module.css';
83
83
  import CheckboxClasses from '../styles/Checkbox.module.css';
84
84
  import CheckboxIndicatorClasses from '../styles/CheckboxIndicator.module.css';
85
85
  import ChipClasses from '../styles/Chip.module.css';
86
+ import CloseButtonClasses from '../styles/CloseButton.module.css';
86
87
  import ComboboxClasses from '../styles/Combobox.module.css';
87
88
  import DatePickerClasses from '../styles/DatePicker.module.css';
88
89
  import DateTimePickerClasses from '../styles/DateTimePicker.module.css';
@@ -186,7 +187,7 @@ export const plasmaTheme: MantineThemeOverride = createTheme({
186
187
  }),
187
188
  ActionIcon: ActionIcon.extend({
188
189
  defaultProps: {
189
- size: 'lg',
190
+ size: 'md',
190
191
  },
191
192
  classNames: ActionIconClasses,
192
193
  }),
@@ -273,6 +274,7 @@ export const plasmaTheme: MantineThemeOverride = createTheme({
273
274
  defaultProps: {
274
275
  icon: <CrossSize16Px height={16} aria-label="close" />,
275
276
  },
277
+ classNames: CloseButtonClasses,
276
278
  }),
277
279
  ColorSwatch: ColorSwatch.extend({
278
280
  defaultProps: {