@appdirect/design-system 0.0.22 → 0.0.25

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 (65) hide show
  1. package/README.md +1 -1
  2. package/dist/Combobox/ADMultiselect.js +91 -0
  3. package/dist/Combobox/ADMultiselect.tsx +237 -0
  4. package/dist/Combobox/AutocompleteClearable.js +33 -35
  5. package/dist/Combobox/AutocompleteClearable.tsx +56 -121
  6. package/dist/Combobox/SearchableSelect.js +23 -42
  7. package/dist/Combobox/SearchableSelect.tsx +33 -129
  8. package/dist/Combobox/Select.js +13 -19
  9. package/dist/Combobox/Select.tsx +15 -44
  10. package/dist/Combobox/index.js +1 -1
  11. package/dist/Combobox/index.ts +2 -2
  12. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/CustomBottomToolbar.module.css +1 -24
  13. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.js +2 -5
  14. package/dist/ComplexComponents/DataTable/CustomBottomToolbar/index.tsx +15 -22
  15. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.js +1 -2
  16. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.module.css +2 -9
  17. package/dist/ComplexComponents/DataTable/CustomTopToolbar/SearchFilter.tsx +4 -5
  18. package/dist/ComplexComponents/DataTable/DataTableGrid/DataTableGrid.module.css +2 -6
  19. package/dist/ComplexComponents/DataTable/DataTableGrid/index.js +1 -1
  20. package/dist/ComplexComponents/DataTable/DataTableGrid/index.tsx +1 -1
  21. package/dist/ComplexComponents/Utilities/CopyButton.js +15 -27
  22. package/dist/ComplexComponents/Utilities/CopyButton.tsx +35 -49
  23. package/dist/DESIGN.md +7 -7
  24. package/dist/DataDisplay/Avatar.js +26 -81
  25. package/dist/DataDisplay/Avatar.tsx +35 -93
  26. package/dist/DataDisplay/Pill.js +21 -79
  27. package/dist/DataDisplay/Pill.tsx +34 -116
  28. package/dist/Inputs/ColorInput.js +12 -18
  29. package/dist/Inputs/ColorInput.tsx +13 -41
  30. package/dist/Inputs/NumberInput.js +15 -50
  31. package/dist/Inputs/NumberInput.tsx +18 -117
  32. package/dist/Inputs/Radio.js +1 -1
  33. package/dist/Inputs/Radio.tsx +1 -1
  34. package/dist/Inputs/RadioGroup.js +1 -1
  35. package/dist/Inputs/RadioGroup.tsx +1 -1
  36. package/dist/Inputs/TextArea.js +12 -18
  37. package/dist/Inputs/TextArea.tsx +13 -41
  38. package/dist/Inputs/TextInput.js +12 -18
  39. package/dist/Inputs/TextInput.tsx +13 -41
  40. package/dist/Inputs/inputLabel.js +35 -0
  41. package/dist/Inputs/inputLabel.tsx +83 -0
  42. package/dist/Layout/Inline.js +5 -42
  43. package/dist/Layout/Inline.tsx +6 -79
  44. package/dist/Overlays/Tooltip.js +2 -2
  45. package/dist/Overlays/Tooltip.tsx +4 -1
  46. package/dist/contracts/index.json +1 -1
  47. package/dist/css/foundations.css +44 -2
  48. package/dist/css/mantine.css +236 -43
  49. package/dist/css/tokens.css +58 -26
  50. package/dist/index.js +3 -3
  51. package/dist/index.ts +4 -4
  52. package/dist/stories/Combobox/{Multiselect.stories.tsx → ADMultiselect.stories.tsx} +159 -53
  53. package/dist/stories/Combobox/SearchableSelect.stories.tsx +3 -3
  54. package/dist/stories/Combobox/Select.stories.tsx +1 -1
  55. package/dist/stories/ComplexComponents/Utilities/CopyButton.stories.tsx +4 -14
  56. package/dist/stories/Inputs/ColorInput.stories.tsx +12 -0
  57. package/dist/stories/Inputs/NumberInput.stories.tsx +12 -0
  58. package/dist/stories/Inputs/Radio.stories.tsx +10 -5
  59. package/dist/stories/Inputs/RadioGroup.stories.tsx +122 -80
  60. package/dist/stories/Inputs/TextArea.stories.tsx +12 -0
  61. package/dist/stories/Inputs/TextInput.stories.tsx +12 -0
  62. package/dist/stories/index.json +42 -35
  63. package/package.json +10 -6
  64. package/dist/Combobox/Multiselect.js +0 -31
  65. package/dist/Combobox/Multiselect.tsx +0 -158
@@ -1,11 +1,9 @@
1
1
  'use client';
2
2
 
3
3
  import React, { forwardRef } from 'react';
4
- import { Textarea as MantineTextarea, TextareaProps as MantineTextareaProps, ActionIcon, Group } from '@mantine/core';
5
- import { IconInfoCircle } from '@tabler/icons-react';
4
+ import { Textarea as MantineTextarea, TextareaProps as MantineTextareaProps } from '@mantine/core';
6
5
  import { ComponentSize } from '../config';
7
- import { Text } from '../Typography/Text';
8
- import { Tooltip } from '../Overlays/Tooltip';
6
+ import { getInputLabelProps } from './inputLabel';
9
7
 
10
8
  // ========================== TYPES ==========================
11
9
 
@@ -14,7 +12,7 @@ export interface DSTextAreaProps extends Omit<MantineTextareaProps, 'size' | 'ra
14
12
  size?: ComponentSize;
15
13
  /** Whether to show "(Optional)" text after label */
16
14
  showOptional?: boolean;
17
- /** Whether to show a help icon with a tooltip in the right section */
15
+ /** Whether to show a (?) help icon with a tooltip to the right of the label */
18
16
  hasHelpIcon?: boolean;
19
17
  /** Tooltip label shown when hovering the help icon. Also used as aria-label for a11y */
20
18
  helpIconLabel?: string;
@@ -73,40 +71,14 @@ export const TextArea = forwardRef<HTMLTextAreaElement, DSTextAreaProps>(
73
71
  ) => {
74
72
  const effectiveError = error === true ? (errorCaption ?? true) : error;
75
73
 
76
- const enhancedLabel = React.useMemo(() => {
77
- if (!label) return label;
78
- if (showOptional && !required) {
79
- return (
80
- <>
81
- {label} <Text span c="dimmed" fw="normal">(Optional)</Text>
82
- </>
83
- );
84
- }
85
- return label;
86
- }, [label, showOptional, required]);
87
-
88
- const helpIconElement = hasHelpIcon ? (
89
- <Tooltip
90
- label={helpIconLabel ?? 'Help'}
91
- position="top"
92
- withArrow
93
- >
94
- <ActionIcon
95
- variant="transparent"
96
- size="xs"
97
- aria-label={helpIconLabel ?? 'Help'}
98
- onClick={onHelpIconClick}
99
- color="gray"
100
- style={{ cursor: onHelpIconClick ? 'pointer' : 'default' }}
101
- >
102
- <IconInfoCircle size={14} aria-hidden />
103
- </ActionIcon>
104
- </Tooltip>
105
- ) : null;
106
-
107
- const composedRightSection = (helpIconElement && rightSection)
108
- ? <Group gap={4} wrap="nowrap">{rightSection}{helpIconElement}</Group>
109
- : helpIconElement || rightSection;
74
+ const labelProps = getInputLabelProps({
75
+ label,
76
+ required,
77
+ showOptional,
78
+ hasHelpIcon,
79
+ helpIconLabel,
80
+ onHelpIconClick,
81
+ });
110
82
 
111
83
  return (
112
84
  <MantineTextarea
@@ -114,8 +86,8 @@ export const TextArea = forwardRef<HTMLTextAreaElement, DSTextAreaProps>(
114
86
  size={size}
115
87
  radius="sm"
116
88
  required={required}
117
- label={enhancedLabel}
118
- rightSection={composedRightSection}
89
+ rightSection={rightSection}
90
+ {...labelProps}
119
91
  error={effectiveError}
120
92
  {...props}
121
93
  />
@@ -1,10 +1,8 @@
1
1
  'use client';
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import React, { forwardRef } from 'react';
4
- import { TextInput as MantineTextInput, ActionIcon, Group } from '@mantine/core';
5
- import { IconInfoCircle } from '@tabler/icons-react';
6
- import { Text } from '../Typography/Text.js';
7
- import { Tooltip } from '../Overlays/Tooltip.js';
4
+ import { TextInput as MantineTextInput } from '@mantine/core';
5
+ import { getInputLabelProps } from './inputLabel.js';
8
6
  /**
9
7
  * AppDirect Design System TextInput Component
10
8
  *
@@ -70,18 +68,14 @@ import { Tooltip } from '../Overlays/Tooltip.js';
70
68
  */
71
69
  export const TextInput = forwardRef(({ size = 'md', leftSection, rightSection, showOptional = false, required, label, hasHelpIcon = false, helpIconLabel, onHelpIconClick, error, errorCaption, ...props }, ref) => {
72
70
  const effectiveError = error === true ? (errorCaption ?? true) : error;
73
- const enhancedLabel = React.useMemo(() => {
74
- if (!label)
75
- return label;
76
- if (showOptional && !required) {
77
- return (_jsxs(_Fragment, { children: [label, " ", _jsx(Text, { span: true, c: "dimmed", fw: "normal", children: "(Optional)" })] }));
78
- }
79
- return label;
80
- }, [label, showOptional, required]);
81
- const helpIconElement = hasHelpIcon ? (_jsx(Tooltip, { label: helpIconLabel ?? 'Help', position: "top", withArrow: true, children: _jsx(ActionIcon, { variant: "transparent", size: "xs", "aria-label": helpIconLabel ?? 'Help', onClick: onHelpIconClick, color: "gray", style: { cursor: onHelpIconClick ? 'pointer' : 'default' }, children: _jsx(IconInfoCircle, { size: 14, "aria-hidden": true }) }) })) : null;
82
- const composedRightSection = (helpIconElement && rightSection)
83
- ? _jsxs(Group, { gap: 4, wrap: "nowrap", children: [rightSection, helpIconElement] })
84
- : helpIconElement || rightSection;
85
- return (_jsx(MantineTextInput, { ref: ref, size: size, radius: "sm", required: required, leftSection: leftSection, rightSection: composedRightSection, label: enhancedLabel, error: effectiveError, ...props }));
71
+ const labelProps = getInputLabelProps({
72
+ label,
73
+ required,
74
+ showOptional,
75
+ hasHelpIcon,
76
+ helpIconLabel,
77
+ onHelpIconClick,
78
+ });
79
+ return (_jsx(MantineTextInput, { ref: ref, size: size, radius: "sm", required: required, leftSection: leftSection, rightSection: rightSection, ...labelProps, error: effectiveError, ...props }));
86
80
  });
87
81
  TextInput.displayName = 'TextInput';
@@ -1,11 +1,9 @@
1
1
  'use client';
2
2
 
3
3
  import React, { forwardRef } from 'react';
4
- import { TextInput as MantineTextInput, TextInputProps as MantineTextInputProps, ActionIcon, Group } from '@mantine/core';
5
- import { IconInfoCircle } from '@tabler/icons-react';
4
+ import { TextInput as MantineTextInput, TextInputProps as MantineTextInputProps } from '@mantine/core';
6
5
  import { ComponentSize } from '../config';
7
- import { Text } from '../Typography/Text';
8
- import { Tooltip } from '../Overlays/Tooltip';
6
+ import { getInputLabelProps } from './inputLabel';
9
7
 
10
8
  /**
11
9
  * Enhanced TextInput props extending Mantine's TextInputProps
@@ -17,7 +15,7 @@ export interface DSTextInputProps extends Omit<MantineTextInputProps, 'size' | '
17
15
  required?: boolean;
18
16
  /** Whether to show "(Optional)" text after label */
19
17
  showOptional?: boolean;
20
- /** Whether to show a help icon with a tooltip in the right section */
18
+ /** Whether to show a (?) help icon with a tooltip to the right of the label */
21
19
  hasHelpIcon?: boolean;
22
20
  /** Tooltip label shown when hovering the help icon. Also used as aria-label for a11y */
23
21
  helpIconLabel?: string;
@@ -113,40 +111,14 @@ export const TextInput = forwardRef<HTMLInputElement, DSTextInputProps>(
113
111
  ) => {
114
112
  const effectiveError = error === true ? (errorCaption ?? true) : error;
115
113
 
116
- const enhancedLabel = React.useMemo(() => {
117
- if (!label) return label;
118
- if (showOptional && !required) {
119
- return (
120
- <>
121
- {label} <Text span c="dimmed" fw="normal">(Optional)</Text>
122
- </>
123
- );
124
- }
125
- return label;
126
- }, [label, showOptional, required]);
127
-
128
- const helpIconElement = hasHelpIcon ? (
129
- <Tooltip
130
- label={helpIconLabel ?? 'Help'}
131
- position="top"
132
- withArrow
133
- >
134
- <ActionIcon
135
- variant="transparent"
136
- size="xs"
137
- aria-label={helpIconLabel ?? 'Help'}
138
- onClick={onHelpIconClick}
139
- color="gray"
140
- style={{ cursor: onHelpIconClick ? 'pointer' : 'default' }}
141
- >
142
- <IconInfoCircle size={14} aria-hidden />
143
- </ActionIcon>
144
- </Tooltip>
145
- ) : null;
146
-
147
- const composedRightSection = (helpIconElement && rightSection)
148
- ? <Group gap={4} wrap="nowrap">{rightSection}{helpIconElement}</Group>
149
- : helpIconElement || rightSection;
114
+ const labelProps = getInputLabelProps({
115
+ label,
116
+ required,
117
+ showOptional,
118
+ hasHelpIcon,
119
+ helpIconLabel,
120
+ onHelpIconClick,
121
+ });
150
122
 
151
123
  return (
152
124
  <MantineTextInput
@@ -155,8 +127,8 @@ export const TextInput = forwardRef<HTMLInputElement, DSTextInputProps>(
155
127
  radius="sm"
156
128
  required={required}
157
129
  leftSection={leftSection}
158
- rightSection={composedRightSection}
159
- label={enhancedLabel}
130
+ rightSection={rightSection}
131
+ {...labelProps}
160
132
  error={effectiveError}
161
133
  {...props}
162
134
  />
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { ActionIcon } from '@mantine/core';
4
+ import { IconHelp } from '@tabler/icons-react';
5
+ import { Text } from '../Typography/Text.js';
6
+ import { Tooltip } from '../Overlays/Tooltip.js';
7
+ /**
8
+ * Shared label for DS form inputs: label, required asterisk or "(Optional)", then
9
+ * the (?) help icon, the order used by the Figma input label.
10
+ *
11
+ * Returns the props to spread onto the Mantine input. `withAsterisk` is only set
12
+ * when a help icon is shown: Mantine renders its asterisk inside the label after
13
+ * the content, which would put it behind the icon, so in that case the asterisk is
14
+ * rendered here instead. The help icon needs a label to attach to.
15
+ *
16
+ * Sizing follows Mantine core: the label font-size tracks the field `size`, set by the
17
+ * input tokens (`input.label.sizes`) on `.mantine-InputWrapper-label[data-size]`. The
18
+ * "(Optional)" text inherits it and the (?) icon is sized by the same tokens.
19
+ */
20
+ export function getInputLabelProps({ label, required, showOptional, hasHelpIcon, helpIconLabel, onHelpIconClick, }) {
21
+ if (!label)
22
+ return { label };
23
+ const optional = showOptional && !required && (_jsxs(_Fragment, { children: [' ', _jsx(Text, { span: true, fz: "inherit", c: "dimmed", fw: "normal", children: "(Optional)" })] }));
24
+ if (!hasHelpIcon) {
25
+ return optional ? { label: _jsxs(_Fragment, { children: [label, optional] }) } : { label };
26
+ }
27
+ return {
28
+ withAsterisk: false,
29
+ label: (_jsxs(_Fragment, { children: [label, required && (_jsx("span", { className: "mantine-InputWrapper-required", "aria-hidden": true, children: ' *' })), optional, ' ', _jsx(Tooltip, { label: helpIconLabel ?? 'Help', position: "top", withArrow: true, children: _jsx(ActionIcon, { variant: "transparent", size: "xs", color: "gray", "aria-label": helpIconLabel ?? 'Help', onClick: (event) => {
30
+ // The icon lives inside the <label>; don't let the click focus the field.
31
+ event.preventDefault();
32
+ onHelpIconClick?.(event);
33
+ }, children: _jsx(IconHelp, { size: 16, "aria-hidden": true }) }) })] })),
34
+ };
35
+ }
@@ -0,0 +1,83 @@
1
+ import React from 'react';
2
+ import { ActionIcon } from '@mantine/core';
3
+ import { IconHelp } from '@tabler/icons-react';
4
+ import { Text } from '../Typography/Text';
5
+ import { Tooltip } from '../Overlays/Tooltip';
6
+
7
+ export interface InputLabelOptions {
8
+ label?: React.ReactNode;
9
+ required?: boolean;
10
+ /** Show "(Optional)" after the label when the field is not required */
11
+ showOptional?: boolean;
12
+ /** Show a (?) help icon with a tooltip to the right of the label */
13
+ hasHelpIcon?: boolean;
14
+ /** Tooltip text for the help icon; also its aria-label */
15
+ helpIconLabel?: string;
16
+ /** Click handler for the help icon */
17
+ onHelpIconClick?: React.MouseEventHandler<HTMLButtonElement>;
18
+ }
19
+
20
+ /**
21
+ * Shared label for DS form inputs: label, required asterisk or "(Optional)", then
22
+ * the (?) help icon, the order used by the Figma input label.
23
+ *
24
+ * Returns the props to spread onto the Mantine input. `withAsterisk` is only set
25
+ * when a help icon is shown: Mantine renders its asterisk inside the label after
26
+ * the content, which would put it behind the icon, so in that case the asterisk is
27
+ * rendered here instead. The help icon needs a label to attach to.
28
+ *
29
+ * Sizing follows Mantine core: the label font-size tracks the field `size`, set by the
30
+ * input tokens (`input.label.sizes`) on `.mantine-InputWrapper-label[data-size]`. The
31
+ * "(Optional)" text inherits it and the (?) icon is sized by the same tokens.
32
+ */
33
+ export function getInputLabelProps({
34
+ label,
35
+ required,
36
+ showOptional,
37
+ hasHelpIcon,
38
+ helpIconLabel,
39
+ onHelpIconClick,
40
+ }: InputLabelOptions): { label: React.ReactNode; withAsterisk?: boolean } {
41
+ if (!label) return { label };
42
+
43
+ const optional = showOptional && !required && (
44
+ <>
45
+ {' '}
46
+ <Text span fz="inherit" c="dimmed" fw="normal">(Optional)</Text>
47
+ </>
48
+ );
49
+
50
+ if (!hasHelpIcon) {
51
+ return optional ? { label: <>{label}{optional}</> } : { label };
52
+ }
53
+
54
+ return {
55
+ withAsterisk: false,
56
+ label: (
57
+ <>
58
+ {label}
59
+ {required && (
60
+ <span className="mantine-InputWrapper-required" aria-hidden>
61
+ {' *'}
62
+ </span>
63
+ )}
64
+ {optional}{' '}
65
+ <Tooltip label={helpIconLabel ?? 'Help'} position="top" withArrow>
66
+ <ActionIcon
67
+ variant="transparent"
68
+ size="xs"
69
+ color="gray"
70
+ aria-label={helpIconLabel ?? 'Help'}
71
+ onClick={(event) => {
72
+ // The icon lives inside the <label>; don't let the click focus the field.
73
+ event.preventDefault();
74
+ onHelpIconClick?.(event);
75
+ }}
76
+ >
77
+ <IconHelp size={16} aria-hidden />
78
+ </ActionIcon>
79
+ </Tooltip>
80
+ </>
81
+ ),
82
+ };
83
+ }
@@ -1,46 +1,9 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import React, { forwardRef } from 'react';
4
- import { Group as MantineGroup } from '@mantine/core';
2
+ import { Group } from './Group.js';
5
3
  /**
6
- * AppDirect Design System Inline Component
4
+ * Inline
7
5
  *
8
- * Horizontal layout primitive for new Figma-mapped and prototype code
9
- * (`flex-direction: row` → `Inline`). `Group` is the Mantine-named alias of this
10
- * same primitive — do not mix both in new code.
11
- *
12
- * Arranges children horizontally with design-system spacing. Built on Mantine Group.
13
- *
14
- * @example
15
- * ```tsx
16
- * // Basic horizontal layout
17
- * <Inline gap="md">
18
- * <Button>First</Button>
19
- * <Button>Second</Button>
20
- * <Button>Third</Button>
21
- * </Inline>
22
- * ```
23
- *
24
- * @example
25
- * ```tsx
26
- * // Inline with alignment and wrapping
27
- * <Inline gap="sm" align="center" wrap="wrap">
28
- * <Badge>Tag 1</Badge>
29
- * <Badge>Tag 2</Badge>
30
- * <Badge>Tag 3</Badge>
31
- * </Inline>
32
- * ```
33
- *
34
- * @example
35
- * ```tsx
36
- * // Justified inline layout
37
- * <Inline justify="space-between">
38
- * <Text>Left content</Text>
39
- * <Button>Right action</Button>
40
- * </Inline>
41
- * ```
6
+ * The DS name for a horizontal flex row (Figma `flex-direction: row`). It is the same
7
+ * component as `Group` (Mantine's `Group` with DS defaults), not a separate implementation.
42
8
  */
43
- export const Inline = forwardRef(({ gap = 'md', align = 'center', justify = 'flex-start', wrap = 'wrap', children, ...props }, ref) => {
44
- return (_jsx(MantineGroup, { ref: ref, gap: gap, align: align, justify: justify, wrap: wrap, ...props, children: children }));
45
- });
46
- Inline.displayName = 'Inline';
9
+ export const Inline = Group;
@@ -1,86 +1,13 @@
1
1
  'use client';
2
2
 
3
- import React, { forwardRef } from 'react';
4
- import { Group as MantineGroup, GroupProps as MantineGroupProps } from '@mantine/core';
5
- import { SpacingScale } from './Stack';
3
+ import { Group, DSGroupProps } from './Group';
6
4
 
7
- /**
8
- * Enhanced Inline props extending Mantine's GroupProps
9
- */
10
- export interface DSInlineProps extends Omit<MantineGroupProps, 'gap'> {
11
- /** Spacing between inline items using design system scale */
12
- gap?: SpacingScale | string | number;
13
- /** Alignment of items along the cross axis */
14
- align?: 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
15
- /** Distribution of items along the main axis */
16
- justify?: 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
17
- /** Whether items should wrap to new lines */
18
- wrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
19
- }
5
+ export type DSInlineProps = DSGroupProps;
20
6
 
21
7
  /**
22
- * AppDirect Design System Inline Component
8
+ * Inline
23
9
  *
24
- * Horizontal layout primitive for new Figma-mapped and prototype code
25
- * (`flex-direction: row` → `Inline`). `Group` is the Mantine-named alias of this
26
- * same primitive — do not mix both in new code.
27
- *
28
- * Arranges children horizontally with design-system spacing. Built on Mantine Group.
29
- *
30
- * @example
31
- * ```tsx
32
- * // Basic horizontal layout
33
- * <Inline gap="md">
34
- * <Button>First</Button>
35
- * <Button>Second</Button>
36
- * <Button>Third</Button>
37
- * </Inline>
38
- * ```
39
- *
40
- * @example
41
- * ```tsx
42
- * // Inline with alignment and wrapping
43
- * <Inline gap="sm" align="center" wrap="wrap">
44
- * <Badge>Tag 1</Badge>
45
- * <Badge>Tag 2</Badge>
46
- * <Badge>Tag 3</Badge>
47
- * </Inline>
48
- * ```
49
- *
50
- * @example
51
- * ```tsx
52
- * // Justified inline layout
53
- * <Inline justify="space-between">
54
- * <Text>Left content</Text>
55
- * <Button>Right action</Button>
56
- * </Inline>
57
- * ```
10
+ * The DS name for a horizontal flex row (Figma `flex-direction: row`). It is the same
11
+ * component as `Group` (Mantine's `Group` with DS defaults), not a separate implementation.
58
12
  */
59
- export const Inline = forwardRef<HTMLDivElement, DSInlineProps>(
60
- (
61
- {
62
- gap = 'md',
63
- align = 'center',
64
- justify = 'flex-start',
65
- wrap = 'wrap',
66
- children,
67
- ...props
68
- },
69
- ref
70
- ) => {
71
- return (
72
- <MantineGroup
73
- ref={ref}
74
- gap={gap}
75
- align={align}
76
- justify={justify}
77
- wrap={wrap}
78
- {...props}
79
- >
80
- {children}
81
- </MantineGroup>
82
- );
83
- }
84
- );
85
-
86
- Inline.displayName = 'Inline';
13
+ export const Inline = Group;
@@ -41,7 +41,7 @@ import { Tooltip as MantineTooltip } from '@mantine/core';
41
41
  * <Button>Delayed</Button>
42
42
  * </Tooltip>
43
43
  */
44
- export const Tooltip = forwardRef(({ label, children, position = 'top', disabled = false, openDelay = 0, closeDelay = 0, keepMounted = false, width = 'auto', withArrow = true, arrowSize = 6, ...props }, ref) => {
44
+ export const Tooltip = forwardRef(({ label, children, position = 'top', disabled = false, openDelay = 0, closeDelay = 0, keepMounted = false, width = 'auto', maxWidth = 300, withArrow = true, arrowSize = 6, ...props }, ref) => {
45
45
  return (_jsx(MantineTooltip, { ref: ref, label: label, position: position, disabled: disabled, openDelay: openDelay, closeDelay: closeDelay, keepMounted: keepMounted, withArrow: withArrow, arrowSize: arrowSize,
46
46
  // Design system styling from Figma
47
47
  color: "dark", radius: "sm",
@@ -58,7 +58,7 @@ export const Tooltip = forwardRef(({ label, children, position = 'top', disabled
58
58
  borderRadius: '4px',
59
59
  border: 'none',
60
60
  width: width !== 'auto' ? width : undefined,
61
- maxWidth: width === 'auto' ? '300px' : undefined,
61
+ maxWidth: width === 'auto' ? `${maxWidth}px` : undefined,
62
62
  },
63
63
  arrow: {
64
64
  backgroundColor: '#212529',
@@ -22,6 +22,8 @@ export interface DSTooltipProps extends Omit<MantineTooltipProps, 'color' | 'rad
22
22
  keepMounted?: boolean;
23
23
  /** Custom width for tooltip */
24
24
  width?: number | 'auto';
25
+ /** Maximum width in px when `width` is 'auto' (default 300) */
26
+ maxWidth?: number;
25
27
  /** Whether to show arrow pointer */
26
28
  withArrow?: boolean;
27
29
  /** Size of arrow pointer */
@@ -78,6 +80,7 @@ export const Tooltip = forwardRef<HTMLDivElement, DSTooltipProps>(
78
80
  closeDelay = 0,
79
81
  keepMounted = false,
80
82
  width = 'auto',
83
+ maxWidth = 300,
81
84
  withArrow = true,
82
85
  arrowSize = 6,
83
86
  ...props
@@ -110,7 +113,7 @@ export const Tooltip = forwardRef<HTMLDivElement, DSTooltipProps>(
110
113
  borderRadius: '4px',
111
114
  border: 'none',
112
115
  width: width !== 'auto' ? width : undefined,
113
- maxWidth: width === 'auto' ? '300px' : undefined,
116
+ maxWidth: width === 'auto' ? `${maxWidth}px` : undefined,
114
117
  },
115
118
  arrow: {
116
119
  backgroundColor: '#212529',
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.22",
2
+ "version": "0.0.25",
3
3
  "contracts": [
4
4
  {
5
5
  "id": "Alert",
@@ -706,10 +706,52 @@
706
706
  --ad-action-default-border: #424242;
707
707
  }
708
708
 
709
- /* Mantine semantic aliases — map Mantine CSS vars onto AppDirect tokens */
709
+ /* Mantine semantic aliases — parity with micro-ui-ts global.css (:root / :host block) */
710
+ :root,
711
+ :host {
712
+ --mantine-color-scheme: light dark;
713
+ --mantine-font-family:
714
+ "Inter", sans-serif, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial,
715
+ sans-serif, Apple Color Emoji, Segoe UI Emoji;
716
+ --mantine-radius-default: calc(0.25rem * var(--mantine-scale));
717
+ --mantine-color-blue-0: var(--ad-open-color-blue-0, #e9f4ff);
718
+ --mantine-color-blue-1: var(--ad-open-color-blue-1, #d5e3fb);
719
+ --mantine-color-blue-2: var(--ad-open-color-blue-2, #abc5f0);
720
+ --mantine-color-blue-3: var(--ad-open-color-blue-3, #7ea4e6);
721
+ --mantine-color-blue-4: var(--ad-open-color-blue-4, #5889dd);
722
+ --mantine-color-blue-5: var(--ad-open-color-blue-5, #4078d8);
723
+ --mantine-color-blue-6: var(--ad-open-color-blue-6, #326fde);
724
+ --mantine-color-blue-7: var(--ad-open-color-blue-7, #235ebf);
725
+ --mantine-color-blue-8: var(--ad-open-color-blue-8, #1953ac);
726
+ --mantine-color-blue-9: var(--ad-open-color-blue-9, #024899);
727
+ }
728
+
710
729
  :root,
711
730
  :root[data-mantine-color-scheme="light"],
712
731
  :root[data-mantine-color-scheme="dark"],
732
+ :host([data-mantine-color-scheme="light"]),
733
+ :host([data-mantine-color-scheme="dark"]),
713
734
  [data-theme="dark"] {
714
- --mantine-color-dimmed: var(--ad-color-text-dimmed, var(--mantine-color-gray-6));
735
+ --mantine-color-dimmed: var(--ad-color-text-dimmed, #495057);
736
+ }
737
+
738
+ :root[data-mantine-color-scheme="light"],
739
+ :host([data-mantine-color-scheme="light"]) {
740
+ --mantine-color-text: var(--ad-color-text-default, #000);
741
+ --mantine-color-body: var(--ad-color-bg-default, #fff);
742
+ --mantine-color-error: var(--ad-color-status-error, #fa5252);
743
+ --mantine-color-success: var(--ad-color-status-success, var(--mantine-color-green-6));
744
+ /* micro-ui a11y: darker than --ad-color-text-placeholder for light-mode contrast */
745
+ --mantine-color-placeholder: #767676;
746
+ --mantine-color-anchor: var(--ad-color-text-link, #326fde);
747
+ --mantine-color-blue-filled: var(--ad-color-brand-primary, var(--mantine-color-blue-6));
748
+ --mantine-color-blue-filled-hover: var(--ad-color-brand-primary-hover, var(--mantine-color-blue-7));
749
+ }
750
+
751
+ :root[data-mantine-color-scheme="dark"],
752
+ :host([data-mantine-color-scheme="dark"]) {
753
+ --mantine-color-success: var(--ad-color-status-success, var(--mantine-color-green-8));
754
+ --mantine-color-anchor: var(--ad-color-text-link, var(--mantine-color-blue-4));
755
+ --mantine-color-blue-filled: var(--ad-color-brand-primary, var(--mantine-color-blue-8));
756
+ --mantine-color-blue-filled-hover: var(--ad-color-brand-primary-hover, var(--mantine-color-blue-9));
715
757
  }