@mindlogic-ai/logician-ui 4.0.0-alpha.13 → 4.0.0-alpha.14

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 (161) hide show
  1. package/dist/components/Button/Button.styles.d.ts.map +1 -1
  2. package/dist/components/Button/Button.styles.js +17 -12
  3. package/dist/components/Button/Button.styles.js.map +1 -1
  4. package/dist/components/Button/Button.styles.mjs +17 -12
  5. package/dist/components/Button/Button.styles.mjs.map +1 -1
  6. package/dist/components/Card/Card.styles.d.ts +4 -0
  7. package/dist/components/Card/Card.styles.d.ts.map +1 -1
  8. package/dist/components/Card/Card.styles.js +8 -0
  9. package/dist/components/Card/Card.styles.js.map +1 -1
  10. package/dist/components/Card/Card.styles.mjs +8 -0
  11. package/dist/components/Card/Card.styles.mjs.map +1 -1
  12. package/dist/components/Card/Card.types.d.ts +1 -1
  13. package/dist/components/Card/Card.types.d.ts.map +1 -1
  14. package/dist/components/Form/FieldError/FieldError.d.ts +15 -0
  15. package/dist/components/Form/FieldError/FieldError.d.ts.map +1 -0
  16. package/dist/components/Form/FieldError/FieldError.js +22 -0
  17. package/dist/components/Form/FieldError/FieldError.js.map +1 -0
  18. package/dist/components/Form/FieldError/FieldError.mjs +20 -0
  19. package/dist/components/Form/FieldError/FieldError.mjs.map +1 -0
  20. package/dist/components/Form/FieldError/index.d.ts +3 -0
  21. package/dist/components/Form/FieldError/index.d.ts.map +1 -0
  22. package/dist/components/Form/FieldHelp/FieldHelp.d.ts +14 -0
  23. package/dist/components/Form/FieldHelp/FieldHelp.d.ts.map +1 -0
  24. package/dist/components/Form/FieldHelp/FieldHelp.js +19 -0
  25. package/dist/components/Form/FieldHelp/FieldHelp.js.map +1 -0
  26. package/dist/components/Form/FieldHelp/FieldHelp.mjs +17 -0
  27. package/dist/components/Form/FieldHelp/FieldHelp.mjs.map +1 -0
  28. package/dist/components/Form/FieldHelp/index.d.ts +3 -0
  29. package/dist/components/Form/FieldHelp/index.d.ts.map +1 -0
  30. package/dist/components/Form/FieldLabel/FieldLabel.d.ts +12 -0
  31. package/dist/components/Form/FieldLabel/FieldLabel.d.ts.map +1 -0
  32. package/dist/components/Form/FieldLabel/FieldLabel.js +32 -0
  33. package/dist/components/Form/FieldLabel/FieldLabel.js.map +1 -0
  34. package/dist/components/Form/FieldLabel/FieldLabel.mjs +30 -0
  35. package/dist/components/Form/FieldLabel/FieldLabel.mjs.map +1 -0
  36. package/dist/components/Form/FieldLabel/FieldLabel.types.d.ts +21 -0
  37. package/dist/components/Form/FieldLabel/FieldLabel.types.d.ts.map +1 -0
  38. package/dist/components/Form/FieldLabel/index.d.ts +3 -0
  39. package/dist/components/Form/FieldLabel/index.d.ts.map +1 -0
  40. package/dist/components/Form/FieldRow/FieldRow.d.ts +15 -0
  41. package/dist/components/Form/FieldRow/FieldRow.d.ts.map +1 -0
  42. package/dist/components/Form/FieldRow/FieldRow.js +27 -0
  43. package/dist/components/Form/FieldRow/FieldRow.js.map +1 -0
  44. package/dist/components/Form/FieldRow/FieldRow.mjs +25 -0
  45. package/dist/components/Form/FieldRow/FieldRow.mjs.map +1 -0
  46. package/dist/components/Form/FieldRow/FieldRow.types.d.ts +27 -0
  47. package/dist/components/Form/FieldRow/FieldRow.types.d.ts.map +1 -0
  48. package/dist/components/Form/FieldRow/index.d.ts +3 -0
  49. package/dist/components/Form/FieldRow/index.d.ts.map +1 -0
  50. package/dist/components/Form/FormFooter/FormFooter.d.ts +11 -0
  51. package/dist/components/Form/FormFooter/FormFooter.d.ts.map +1 -0
  52. package/dist/components/Form/FormFooter/FormFooter.js +20 -0
  53. package/dist/components/Form/FormFooter/FormFooter.js.map +1 -0
  54. package/dist/components/Form/FormFooter/FormFooter.mjs +18 -0
  55. package/dist/components/Form/FormFooter/FormFooter.mjs.map +1 -0
  56. package/dist/components/Form/FormFooter/FormFooter.types.d.ts +23 -0
  57. package/dist/components/Form/FormFooter/FormFooter.types.d.ts.map +1 -0
  58. package/dist/components/Form/FormFooter/index.d.ts +3 -0
  59. package/dist/components/Form/FormFooter/index.d.ts.map +1 -0
  60. package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts +19 -0
  61. package/dist/components/Form/FormModalFooter/FormModalFooter.d.ts.map +1 -0
  62. package/dist/components/Form/FormModalFooter/FormModalFooter.js +42 -0
  63. package/dist/components/Form/FormModalFooter/FormModalFooter.js.map +1 -0
  64. package/dist/components/Form/FormModalFooter/FormModalFooter.mjs +40 -0
  65. package/dist/components/Form/FormModalFooter/FormModalFooter.mjs.map +1 -0
  66. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts +49 -0
  67. package/dist/components/Form/FormModalFooter/FormModalFooter.types.d.ts.map +1 -0
  68. package/dist/components/Form/FormModalFooter/index.d.ts +3 -0
  69. package/dist/components/Form/FormModalFooter/index.d.ts.map +1 -0
  70. package/dist/components/Form/FormScrollArea/FormScrollArea.d.ts +14 -0
  71. package/dist/components/Form/FormScrollArea/FormScrollArea.d.ts.map +1 -0
  72. package/dist/components/Form/FormScrollArea/FormScrollArea.js +18 -0
  73. package/dist/components/Form/FormScrollArea/FormScrollArea.js.map +1 -0
  74. package/dist/components/Form/FormScrollArea/FormScrollArea.mjs +16 -0
  75. package/dist/components/Form/FormScrollArea/FormScrollArea.mjs.map +1 -0
  76. package/dist/components/Form/FormScrollArea/index.d.ts +2 -0
  77. package/dist/components/Form/FormScrollArea/index.d.ts.map +1 -0
  78. package/dist/components/Form/FormSection/CollapsibleFormSection.d.ts +10 -0
  79. package/dist/components/Form/FormSection/CollapsibleFormSection.d.ts.map +1 -0
  80. package/dist/components/Form/FormSection/CollapsibleFormSection.js +43 -0
  81. package/dist/components/Form/FormSection/CollapsibleFormSection.js.map +1 -0
  82. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs +41 -0
  83. package/dist/components/Form/FormSection/CollapsibleFormSection.mjs.map +1 -0
  84. package/dist/components/Form/FormSection/FlatFormSection.d.ts +6 -0
  85. package/dist/components/Form/FormSection/FlatFormSection.d.ts.map +1 -0
  86. package/dist/components/Form/FormSection/FlatFormSection.js +12 -0
  87. package/dist/components/Form/FormSection/FlatFormSection.js.map +1 -0
  88. package/dist/components/Form/FormSection/FlatFormSection.mjs +10 -0
  89. package/dist/components/Form/FormSection/FlatFormSection.mjs.map +1 -0
  90. package/dist/components/Form/FormSection/FormSection.d.ts +13 -0
  91. package/dist/components/Form/FormSection/FormSection.d.ts.map +1 -0
  92. package/dist/components/Form/FormSection/FormSection.js +21 -0
  93. package/dist/components/Form/FormSection/FormSection.js.map +1 -0
  94. package/dist/components/Form/FormSection/FormSection.mjs +19 -0
  95. package/dist/components/Form/FormSection/FormSection.mjs.map +1 -0
  96. package/dist/components/Form/FormSection/FormSection.types.d.ts +34 -0
  97. package/dist/components/Form/FormSection/FormSection.types.d.ts.map +1 -0
  98. package/dist/components/Form/FormSection/index.d.ts +3 -0
  99. package/dist/components/Form/FormSection/index.d.ts.map +1 -0
  100. package/dist/components/Form/FormSectionHeader/FormSectionHeader.d.ts +13 -0
  101. package/dist/components/Form/FormSectionHeader/FormSectionHeader.d.ts.map +1 -0
  102. package/dist/components/Form/FormSectionHeader/FormSectionHeader.js +30 -0
  103. package/dist/components/Form/FormSectionHeader/FormSectionHeader.js.map +1 -0
  104. package/dist/components/Form/FormSectionHeader/FormSectionHeader.mjs +28 -0
  105. package/dist/components/Form/FormSectionHeader/FormSectionHeader.mjs.map +1 -0
  106. package/dist/components/Form/FormSectionHeader/FormSectionHeader.types.d.ts +17 -0
  107. package/dist/components/Form/FormSectionHeader/FormSectionHeader.types.d.ts.map +1 -0
  108. package/dist/components/Form/FormSectionHeader/index.d.ts +3 -0
  109. package/dist/components/Form/FormSectionHeader/index.d.ts.map +1 -0
  110. package/dist/components/Form/index.d.ts +18 -0
  111. package/dist/components/Form/index.d.ts.map +1 -0
  112. package/dist/index.d.ts +1 -0
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.js +18 -0
  115. package/dist/index.js.map +1 -1
  116. package/dist/index.mjs +9 -0
  117. package/dist/index.mjs.map +1 -1
  118. package/package.json +1 -1
  119. package/src/components/Button/Button.styles.ts +17 -12
  120. package/src/components/Card/Card.stories.tsx +7 -0
  121. package/src/components/Card/Card.styles.ts +8 -0
  122. package/src/components/Card/Card.types.ts +1 -1
  123. package/src/components/Form/FieldError/FieldError.test.tsx +33 -0
  124. package/src/components/Form/FieldError/FieldError.tsx +20 -0
  125. package/src/components/Form/FieldError/index.ts +2 -0
  126. package/src/components/Form/FieldHelp/FieldHelp.tsx +18 -0
  127. package/src/components/Form/FieldHelp/index.ts +2 -0
  128. package/src/components/Form/FieldLabel/FieldLabel.tsx +46 -0
  129. package/src/components/Form/FieldLabel/FieldLabel.types.ts +21 -0
  130. package/src/components/Form/FieldLabel/index.ts +2 -0
  131. package/src/components/Form/FieldRow/FieldRow.stories.tsx +85 -0
  132. package/src/components/Form/FieldRow/FieldRow.test.tsx +89 -0
  133. package/src/components/Form/FieldRow/FieldRow.tsx +46 -0
  134. package/src/components/Form/FieldRow/FieldRow.types.ts +32 -0
  135. package/src/components/Form/FieldRow/index.ts +2 -0
  136. package/src/components/Form/FormFooter/FormFooter.stories.tsx +70 -0
  137. package/src/components/Form/FormFooter/FormFooter.test.tsx +67 -0
  138. package/src/components/Form/FormFooter/FormFooter.tsx +46 -0
  139. package/src/components/Form/FormFooter/FormFooter.types.ts +23 -0
  140. package/src/components/Form/FormFooter/index.ts +2 -0
  141. package/src/components/Form/FormModalFooter/FormModalFooter.stories.tsx +64 -0
  142. package/src/components/Form/FormModalFooter/FormModalFooter.test.tsx +155 -0
  143. package/src/components/Form/FormModalFooter/FormModalFooter.tsx +83 -0
  144. package/src/components/Form/FormModalFooter/FormModalFooter.types.ts +53 -0
  145. package/src/components/Form/FormModalFooter/index.ts +2 -0
  146. package/src/components/Form/FormScrollArea/FormScrollArea.tsx +27 -0
  147. package/src/components/Form/FormScrollArea/index.ts +1 -0
  148. package/src/components/Form/FormSection/CollapsibleFormSection.tsx +35 -0
  149. package/src/components/Form/FormSection/FlatFormSection.tsx +41 -0
  150. package/src/components/Form/FormSection/FormSection.stories.tsx +115 -0
  151. package/src/components/Form/FormSection/FormSection.test.tsx +89 -0
  152. package/src/components/Form/FormSection/FormSection.tsx +33 -0
  153. package/src/components/Form/FormSection/FormSection.types.ts +34 -0
  154. package/src/components/Form/FormSection/index.ts +2 -0
  155. package/src/components/Form/FormSectionHeader/FormSectionHeader.stories.tsx +53 -0
  156. package/src/components/Form/FormSectionHeader/FormSectionHeader.test.tsx +74 -0
  157. package/src/components/Form/FormSectionHeader/FormSectionHeader.tsx +48 -0
  158. package/src/components/Form/FormSectionHeader/FormSectionHeader.types.ts +17 -0
  159. package/src/components/Form/FormSectionHeader/index.ts +2 -0
  160. package/src/components/Form/index.ts +17 -0
  161. package/src/index.ts +1 -0
@@ -0,0 +1,53 @@
1
+ import { Box } from '@chakra-ui/react';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+
4
+ import { Button } from '@/components/Button';
5
+ import { InfoSprinkle } from '@/components/InfoSprinkle';
6
+
7
+ import { FormSectionHeader } from './FormSectionHeader';
8
+
9
+ const meta: Meta<typeof FormSectionHeader> = {
10
+ title: 'Components/Form/FormSectionHeader',
11
+ component: FormSectionHeader,
12
+ decorators: [
13
+ (Story) => (
14
+ <Box maxW="480px">
15
+ <Story />
16
+ </Box>
17
+ ),
18
+ ],
19
+ args: {
20
+ title: 'Collaboration',
21
+ },
22
+ };
23
+
24
+ export default meta;
25
+ type Story = StoryObj<typeof FormSectionHeader>;
26
+
27
+ export const TitleOnly: Story = {};
28
+
29
+ export const WithDescription: Story = {
30
+ args: {
31
+ description: 'Grant analysts and editors access to work on this assistant.',
32
+ },
33
+ };
34
+
35
+ export const WithTitleAdornment: Story = {
36
+ args: {
37
+ title: 'Attached files',
38
+ description: 'Files this assistant can reference when answering.',
39
+ titleAdornment: <InfoSprinkle>Up to 20 files, 100MB each.</InfoSprinkle>,
40
+ },
41
+ };
42
+
43
+ export const WithAction: Story = {
44
+ args: {
45
+ title: 'Connectors',
46
+ description: 'Live data sources this assistant can query.',
47
+ action: (
48
+ <Button size="sm" variant="ghost">
49
+ Add
50
+ </Button>
51
+ ),
52
+ },
53
+ };
@@ -0,0 +1,74 @@
1
+ import type { ReactNode } from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { describe, expect, it, vi } from 'vitest';
4
+
5
+ import { FormSectionHeader } from './FormSectionHeader';
6
+
7
+ // Stub the layout chrome and typography so the test asserts FormSectionHeader's
8
+ // own conditional slots (title / adornment / description / action), not
9
+ // Chakra/logician internals.
10
+ vi.mock('@chakra-ui/react', () => ({
11
+ Box: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
12
+ Flex: ({ children }: { children?: ReactNode }) => <div>{children}</div>,
13
+ }));
14
+
15
+ vi.mock('@/components/Typography', () => ({
16
+ H5: ({ children }: { children?: ReactNode }) => <h5>{children}</h5>,
17
+ Subtext: ({ children }: { children?: ReactNode }) => (
18
+ <span data-testid="description">{children}</span>
19
+ ),
20
+ }));
21
+
22
+ describe('FormSectionHeader', () => {
23
+ it('renders the title as a heading with a description below it', () => {
24
+ render(
25
+ <FormSectionHeader
26
+ title="Collaboration"
27
+ description="Grant access to work on this assistant."
28
+ />
29
+ );
30
+ expect(
31
+ screen.getByRole('heading', { name: 'Collaboration' })
32
+ ).toBeInTheDocument();
33
+ expect(screen.getByTestId('description')).toHaveTextContent(
34
+ 'Grant access to work on this assistant.'
35
+ );
36
+ });
37
+
38
+ it('renders the inline title adornment next to the heading', () => {
39
+ render(
40
+ <FormSectionHeader
41
+ title="Files"
42
+ titleAdornment={<span data-testid="sprinkle">i</span>}
43
+ />
44
+ );
45
+ expect(screen.getByRole('heading', { name: 'Files' })).toBeInTheDocument();
46
+ expect(screen.getByTestId('sprinkle')).toBeInTheDocument();
47
+ });
48
+
49
+ it('renders the right-aligned action', () => {
50
+ render(
51
+ <FormSectionHeader
52
+ title="Connectors"
53
+ action={<button type="button">Add</button>}
54
+ />
55
+ );
56
+ expect(screen.getByRole('button', { name: 'Add' })).toBeInTheDocument();
57
+ });
58
+
59
+ it('omits the heading row entirely when there is no title or adornment', () => {
60
+ render(<FormSectionHeader description="Standalone description." />);
61
+ expect(screen.queryByRole('heading')).toBeNull();
62
+ expect(screen.getByTestId('description')).toHaveTextContent(
63
+ 'Standalone description.'
64
+ );
65
+ });
66
+
67
+ it('renders a bare heading with no description when none is given', () => {
68
+ render(<FormSectionHeader title="Visibility" />);
69
+ expect(
70
+ screen.getByRole('heading', { name: 'Visibility' })
71
+ ).toBeInTheDocument();
72
+ expect(screen.queryByTestId('description')).toBeNull();
73
+ });
74
+ });
@@ -0,0 +1,48 @@
1
+ import { Box, Flex } from '@chakra-ui/react';
2
+
3
+ import { H5, Subtext } from '@/components/Typography';
4
+
5
+ import { FormSectionHeaderProps } from './FormSectionHeader.types';
6
+
7
+ /**
8
+ * The standardized section (fieldset) header — the section-level counterpart to
9
+ * {@link FieldLabel}. A heading, an optional inline adornment, a description,
10
+ * and a right-aligned action, laid out with one consistent rhythm (`H5` over a
11
+ * muted `Subtext`). Shared by `FormSection` and the studio `GroupHeader` so
12
+ * every titled field group reads the same everywhere.
13
+ *
14
+ * The description sits inside the left column so a tall `action` centers against
15
+ * the whole heading+description block, matching the prior studio `GroupHeader`.
16
+ */
17
+ export const FormSectionHeader = ({
18
+ title,
19
+ titleAdornment,
20
+ description,
21
+ action,
22
+ mb = 3,
23
+ ...flexProps
24
+ }: FormSectionHeaderProps) => (
25
+ <Flex
26
+ align="center"
27
+ justify="space-between"
28
+ gap={2}
29
+ mb={mb}
30
+ w="100%"
31
+ {...flexProps}
32
+ >
33
+ <Box>
34
+ {(title || titleAdornment) && (
35
+ <Flex align="center" gap={1} mb={description ? 1 : 0}>
36
+ {title && <H5>{title}</H5>}
37
+ {titleAdornment}
38
+ </Flex>
39
+ )}
40
+ {description && (
41
+ <Subtext color="fg.muted" fontWeight="normal">
42
+ {description}
43
+ </Subtext>
44
+ )}
45
+ </Box>
46
+ {action}
47
+ </Flex>
48
+ );
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { FlexProps } from '@chakra-ui/react';
3
+
4
+ export interface FormSectionHeaderProps extends Omit<FlexProps, 'title'> {
5
+ /** Section heading — the fieldset-level label. */
6
+ title?: ReactNode;
7
+ /**
8
+ * Inline element rendered immediately after the title text (e.g. an
9
+ * `InfoSprinkle`). Distinct from `action`, which sits at the far right of
10
+ * the row.
11
+ */
12
+ titleAdornment?: ReactNode;
13
+ /** Secondary description under the title. */
14
+ description?: ReactNode;
15
+ /** Right-aligned slot on the title row (e.g. an add button). */
16
+ action?: ReactNode;
17
+ }
@@ -0,0 +1,2 @@
1
+ export { FormSectionHeader } from './FormSectionHeader';
2
+ export type { FormSectionHeaderProps } from './FormSectionHeader.types';
@@ -0,0 +1,17 @@
1
+ export type { FieldErrorProps } from './FieldError';
2
+ export { FieldError } from './FieldError';
3
+ export type { FieldHelpProps } from './FieldHelp';
4
+ export { FieldHelp } from './FieldHelp';
5
+ export type { FieldLabelProps } from './FieldLabel';
6
+ export { FieldLabel } from './FieldLabel';
7
+ export type { FieldRowProps } from './FieldRow';
8
+ export { FieldRow } from './FieldRow';
9
+ export type { FormFooterProps } from './FormFooter';
10
+ export { FormFooter } from './FormFooter';
11
+ export type { FormModalFooterProps } from './FormModalFooter';
12
+ export { FormModalFooter } from './FormModalFooter';
13
+ export { FormScrollArea } from './FormScrollArea';
14
+ export type { FormSectionProps } from './FormSection';
15
+ export { FormSection } from './FormSection';
16
+ export type { FormSectionHeaderProps } from './FormSectionHeader';
17
+ export { FormSectionHeader } from './FormSectionHeader';
package/src/index.ts CHANGED
@@ -24,6 +24,7 @@ export * from './components/FileItem';
24
24
  export * from './components/FileList';
25
25
 
26
26
  // Form Components
27
+ export * from './components/Form';
27
28
  export * from './components/FormControl';
28
29
  export * from './components/FormLabel';
29
30