@atom-learning/components 1.24.2 → 2.1.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.
- package/CHANGELOG.md +3 -3
- package/dist/components/accordion/Accordion.d.ts +1 -0
- package/dist/components/accordion/AccordionContent.d.ts +1 -0
- package/dist/components/accordion/AccordionItem.d.ts +1 -0
- package/dist/components/accordion/AccordionTrigger.d.ts +1 -0
- package/dist/components/action-icon/ActionIcon.constants.d.ts +6 -0
- package/dist/components/action-icon/ActionIcon.constants.js +1 -0
- package/dist/components/action-icon/ActionIcon.d.ts +2 -1
- package/dist/components/action-icon/ActionIcon.js +1 -1
- package/dist/components/alert-dialog/AlertDialog.d.ts +1 -0
- package/dist/components/alert-dialog/AlertDialogContent.d.ts +1 -0
- package/dist/components/badge/Badge.d.ts +2 -0
- package/dist/components/box/Box.d.ts +1 -0
- package/dist/components/button/Button.d.ts +1 -0
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/calendar/Day.d.ts +1 -0
- package/dist/components/carousel/CarouselPagination.d.ts +1 -0
- package/dist/components/carousel/CarouselSlide.d.ts +1 -0
- package/dist/components/carousel/CarouselSlider.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.d.ts +1 -0
- package/dist/components/combobox/Combobox.d.ts +1 -0
- package/dist/components/combobox/ComboboxInput.d.ts +1 -0
- package/dist/components/combobox/ComboboxList.d.ts +1 -0
- package/dist/components/combobox/ComboboxOption.d.ts +1 -0
- package/dist/components/combobox/ComboboxPopover.d.ts +1 -0
- package/dist/components/date-input/DateInput.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +1 -0
- package/dist/components/dialog/DialogBackground.d.ts +2 -0
- package/dist/components/dialog/DialogClose.d.ts +1 -0
- package/dist/components/dialog/DialogContent.d.ts +1 -0
- package/dist/components/dialog/DialogContent.js +1 -1
- package/dist/components/divider/Divider.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenuItem.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenuSeparator.d.ts +1 -0
- package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +1 -0
- package/dist/components/empty-state/EmptyState.d.ts +2 -0
- package/dist/components/empty-state/EmptyStateBody.d.ts +2 -0
- package/dist/components/empty-state/EmptyStateImage.d.ts +2 -0
- package/dist/components/empty-state/EmptyStateTitle.d.ts +1 -0
- package/dist/components/field-wrapper/FieldWrapper.js +1 -1
- package/dist/components/field-wrapper/InlineFieldWrapper.js +1 -1
- package/dist/components/flex/Flex.d.ts +1 -0
- package/dist/components/form/Form.d.ts +1 -0
- package/dist/components/grid/Grid.d.ts +1 -0
- package/dist/components/heading/Heading.d.ts +1 -0
- package/dist/components/icon/Icon.d.ts +1 -0
- package/dist/components/image/Image.d.ts +1 -0
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inline-message/InlineMessage.config.d.ts +5 -0
- package/dist/components/inline-message/InlineMessage.config.js +1 -0
- package/dist/components/inline-message/InlineMessage.d.ts +541 -0
- package/dist/components/inline-message/InlineMessage.js +1 -0
- package/dist/components/inline-message/InlineMessage.types.d.ts +1 -0
- package/dist/components/inline-message/index.d.ts +1 -0
- package/dist/components/input/Input.d.ts +1 -0
- package/dist/components/label/Label.d.ts +1 -0
- package/dist/components/link/Link.d.ts +1 -0
- package/dist/components/list/List.d.ts +2 -0
- package/dist/components/notification-badge/NotificationBadge.d.ts +2 -0
- package/dist/components/password-input/PasswordInput.js +1 -1
- package/dist/components/popover/Popover.d.ts +1 -0
- package/dist/components/popover/PopoverContent.d.ts +1 -0
- package/dist/components/popover/PopoverContent.js +1 -1
- package/dist/components/progress-bar/ProgressBar.d.ts +1 -0
- package/dist/components/radio-button/RadioButton.d.ts +1 -0
- package/dist/components/radio-button/RadioButtonGroup.d.ts +1 -0
- package/dist/components/radio-button-field/RadioButtonField.js +1 -1
- package/dist/components/radio-card/RadioCard.d.ts +1 -0
- package/dist/components/search-input/SearchInput.js +1 -1
- package/dist/components/select/Select.d.ts +1 -0
- package/dist/components/slider/Slider.d.ts +1 -0
- package/dist/components/stack/Stack.d.ts +1 -0
- package/dist/components/stack-content/StackContent.d.ts +1 -0
- package/dist/components/stepper/StepperStepBullet.d.ts +2 -0
- package/dist/components/stepper/StepperStepContainer.d.ts +2 -0
- package/dist/components/stepper/StepperStepLabel.d.ts +2 -0
- package/dist/components/switch/Switch.d.ts +1 -0
- package/dist/components/table/Table.d.ts +1 -0
- package/dist/components/table/TableBody.d.ts +1 -0
- package/dist/components/table/TableCell.d.ts +1 -0
- package/dist/components/table/TableFooter.d.ts +1 -0
- package/dist/components/table/TableFooterCell.d.ts +1 -0
- package/dist/components/table/TableHeader.d.ts +1 -0
- package/dist/components/table/TableHeaderCell.d.ts +1 -0
- package/dist/components/table/TableRow.d.ts +1 -0
- package/dist/components/tabs/TabTrigger.d.ts +1 -0
- package/dist/components/tabs/Tabs.d.ts +2 -0
- package/dist/components/tabs/TabsTriggerList.d.ts +1 -0
- package/dist/components/tabs/TabsTriggerList.js +1 -1
- package/dist/components/text/Text.d.ts +1 -0
- package/dist/components/textarea/Textarea.d.ts +1 -0
- package/dist/components/toast/Toast.d.ts +1 -0
- package/dist/components/toggle-group/ToggleGroupButton.d.ts +2 -0
- package/dist/components/toggle-group/ToggleGroupItem.d.ts +2 -0
- package/dist/components/toggle-group/ToggleGroupRoot.d.ts +1 -0
- package/dist/components/toggle-group/index.d.ts +5 -0
- package/dist/components/tooltip/TooltipContent.d.ts +1 -0
- package/dist/components/video/Video.d.ts +2 -0
- package/dist/docgen.json +1 -1
- package/dist/docs/ActionIcon.mdx +13 -19
- package/dist/docs/CheckboxField.mdx +1 -1
- package/dist/docs/DateField.mdx +2 -2
- package/dist/docs/FieldWrapper.mdx +1 -1
- package/dist/docs/Form.mdx +3 -3
- package/dist/docs/Icon.mdx +1 -1
- package/dist/docs/InlineMessage.mdx +52 -0
- package/dist/docs/InputField.mdx +2 -2
- package/dist/docs/RadioButtonField.mdx +2 -2
- package/dist/docs/SelectField.mdx +2 -2
- package/dist/docs/TextareaField.mdx +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/stitches.d.ts +10 -0
- package/package.json +3 -2
- package/dist/components/validation-error/ValidationError.d.ts +0 -7
- package/dist/components/validation-error/ValidationError.js +0 -1
- package/dist/components/validation-error/index.d.ts +0 -1
- package/dist/docs/ValidationError.mdx +0 -12
package/dist/docs/ActionIcon.mdx
CHANGED
|
@@ -10,34 +10,28 @@ category: Navigation
|
|
|
10
10
|
```tsx preview
|
|
11
11
|
<>
|
|
12
12
|
<ActionIcon label="Attach a file" appearance="simple">
|
|
13
|
-
<Icon is={Clip}
|
|
14
|
-
</ActionIcon>
|
|
15
|
-
<ActionIcon label="Attach a file" appearance="subtle">
|
|
16
|
-
<Icon is={Clip} size="sm" />
|
|
13
|
+
<Icon is={Clip} />
|
|
17
14
|
</ActionIcon>
|
|
18
15
|
<ActionIcon label="Attach a file" appearance="outline">
|
|
19
|
-
<Icon is={Clip}
|
|
16
|
+
<Icon is={Clip} />
|
|
20
17
|
</ActionIcon>
|
|
21
18
|
<ActionIcon label="Attach a file" appearance="solid">
|
|
22
|
-
<Icon is={Clip}
|
|
19
|
+
<Icon is={Clip} />
|
|
23
20
|
</ActionIcon>
|
|
24
21
|
</>
|
|
25
22
|
```
|
|
26
23
|
|
|
27
24
|
## Rounded Variant
|
|
28
25
|
|
|
29
|
-
Setting `isRounded` makes the Action circular when paired with the options "
|
|
26
|
+
Setting `isRounded` makes the Action circular when paired with the options "outline" and "solid" for the `appearance` prop
|
|
30
27
|
|
|
31
28
|
```tsx preview
|
|
32
29
|
<>
|
|
33
|
-
<ActionIcon label="Attach a file" appearance="subtle" isRounded>
|
|
34
|
-
<Icon is={Bell} size="sm" />
|
|
35
|
-
</ActionIcon>
|
|
36
30
|
<ActionIcon label="Attach a file" appearance="outline" isRounded>
|
|
37
|
-
<Icon is={Bell}
|
|
31
|
+
<Icon is={Bell} />
|
|
38
32
|
</ActionIcon>
|
|
39
33
|
<ActionIcon label="Attach a file" appearance="solid" isRounded>
|
|
40
|
-
<Icon is={Bell}
|
|
34
|
+
<Icon is={Bell} />
|
|
41
35
|
</ActionIcon>
|
|
42
36
|
</>
|
|
43
37
|
```
|
|
@@ -48,14 +42,14 @@ Passing `disabled` makes the Action Icon take a disabled appearance, where any c
|
|
|
48
42
|
|
|
49
43
|
```tsx preview
|
|
50
44
|
<>
|
|
51
|
-
<ActionIcon label="Attach a file" appearance="
|
|
52
|
-
<Icon is={Bell}
|
|
45
|
+
<ActionIcon label="Attach a file" appearance="simple" disabled>
|
|
46
|
+
<Icon is={Bell} />
|
|
53
47
|
</ActionIcon>
|
|
54
48
|
<ActionIcon label="Attach a file" appearance="outline" disabled>
|
|
55
|
-
<Icon is={Bell}
|
|
49
|
+
<Icon is={Bell} />
|
|
56
50
|
</ActionIcon>
|
|
57
51
|
<ActionIcon label="Attach a file" appearance="solid" disabled>
|
|
58
|
-
<Icon is={Bell}
|
|
52
|
+
<Icon is={Bell} />
|
|
59
53
|
</ActionIcon>
|
|
60
54
|
</>
|
|
61
55
|
```
|
|
@@ -66,7 +60,7 @@ It is recommended to pair `ActionIcon` with `Tooltip` to provide a clear visual
|
|
|
66
60
|
<Tooltip>
|
|
67
61
|
<Tooltip.Trigger>
|
|
68
62
|
<ActionIcon size="lg" label="Add to basket">
|
|
69
|
-
<Icon is={Basket}
|
|
63
|
+
<Icon is={Basket} />
|
|
70
64
|
</ActionIcon>
|
|
71
65
|
</Tooltip.Trigger>
|
|
72
66
|
<Tooltip.Content>Add to basket</Tooltip.Content>
|
|
@@ -79,12 +73,12 @@ The `ActionIcon` component supports polymorphism, therefore depending on whether
|
|
|
79
73
|
|
|
80
74
|
```tsx preview
|
|
81
75
|
<ActionIcon label="Shuffle selection" onClick={() => console.log('clicked')}>
|
|
82
|
-
<Icon is={Shuffle}
|
|
76
|
+
<Icon is={Shuffle} />
|
|
83
77
|
</ActionIcon>
|
|
84
78
|
```
|
|
85
79
|
|
|
86
80
|
```tsx preview
|
|
87
81
|
<ActionIcon label="Add a new folder" href="/directory/add">
|
|
88
|
-
<Icon is={FolderAdd}
|
|
82
|
+
<Icon is={FolderAdd} />
|
|
89
83
|
</ActionIcon>
|
|
90
84
|
```
|
package/dist/docs/DateField.mdx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Date Field
|
|
3
3
|
component: DateField
|
|
4
|
-
description: DateField renders a field composed of an DateInput, a Label and a
|
|
4
|
+
description: DateField renders a field composed of an DateInput, a Label and a InlineMessage
|
|
5
5
|
category: Form fields
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ In addition to text `Label` (required) and a validation error (optional), `DateF
|
|
|
11
11
|
`DateField`’s `css` prop will be applied to a containing `Box`—the styling of the individual components inside `DateField` cannot be altered.
|
|
12
12
|
|
|
13
13
|
Err on the side of using consistent form fields, but if you really need something with different styling then consider composing your own field from the
|
|
14
|
-
`DateInput`, `Label` and `
|
|
14
|
+
`DateInput`, `Label` and `InlineMessage` components.
|
|
15
15
|
|
|
16
16
|
```tsx preview
|
|
17
17
|
<Form>
|
|
@@ -5,7 +5,7 @@ description: A utility component to help with composing consistent form fields
|
|
|
5
5
|
category: Form primitives
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
`FieldWrapper` renders a `Label` and (when applicable) a `
|
|
8
|
+
`FieldWrapper` renders a `Label` and (when applicable) a `InlineMessage`. Use it to wrap any type of input to create a consistent set of form fields.
|
|
9
9
|
|
|
10
10
|
```tsx preview
|
|
11
11
|
<FieldWrapper label="Example Field" fieldId="example">
|
package/dist/docs/Form.mdx
CHANGED
|
@@ -174,7 +174,7 @@ Here's an example using the `persist` prop:
|
|
|
174
174
|
|
|
175
175
|
## Composing form field components
|
|
176
176
|
|
|
177
|
-
It’s easy to compose your own custom form fields from the low-level components in this library (`Input`, `Label`, `
|
|
177
|
+
It’s easy to compose your own custom form fields from the low-level components in this library (`Input`, `Label`, `InlineMessage` etc) but there are some requirements that your new
|
|
178
178
|
field must meet in order to be fully compatible with our `Form`.
|
|
179
179
|
|
|
180
180
|
### Props
|
|
@@ -183,7 +183,7 @@ Your custom form field component must take the props specified in [General](#Gen
|
|
|
183
183
|
|
|
184
184
|
#### error
|
|
185
185
|
|
|
186
|
-
`error` should be displayed in a `
|
|
186
|
+
`error` should be displayed in a `InlineMessage` when present. You don’t need to pass `error` to your component manually; the `Form` will pass it in automatically when appropriate.
|
|
187
187
|
|
|
188
188
|
To properly retrieve the error in both static and dynamic fields it is necessary to use the `useFieldError` hook stored in the form directory, that accepts a field name parameter.
|
|
189
189
|
|
|
@@ -258,7 +258,7 @@ const EmailField = ({ css, name, validation, required, ...rest }) => {
|
|
|
258
258
|
error={error}
|
|
259
259
|
{...rest}
|
|
260
260
|
/>
|
|
261
|
-
{error && <
|
|
261
|
+
{error && <InlineMessage css={{ mt: '$1' }}>{error}</InlineMessage>}
|
|
262
262
|
</FieldWrapper>
|
|
263
263
|
)
|
|
264
264
|
}
|
package/dist/docs/Icon.mdx
CHANGED
|
@@ -25,6 +25,6 @@ import { Icon } from '@atom-learning/components'
|
|
|
25
25
|
import { Brightness } from '@atom-learning/icons'
|
|
26
26
|
|
|
27
27
|
const Component = () => (
|
|
28
|
-
<Icon is={Brightness} size="
|
|
28
|
+
<Icon is={Brightness} size="md" css={{ color: '$primary' }} />
|
|
29
29
|
)
|
|
30
30
|
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Inline Message
|
|
3
|
+
component: InlineMessage
|
|
4
|
+
description: Inline feedback message with an optional icon
|
|
5
|
+
category: Feedback
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Inline messages consist of an inline feedback message in the form of simple text that inform the user of relevant information, revealed in context.
|
|
9
|
+
|
|
10
|
+
```tsx preview
|
|
11
|
+
<InlineMessage>This is an Inline Message</InlineMessage>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Theme
|
|
15
|
+
|
|
16
|
+
These are the available `theme`s for this component: `success`, `warning`, `error`, `neutral` and `info`. The default is `error` (due to most frequent context).
|
|
17
|
+
|
|
18
|
+
```tsx preview
|
|
19
|
+
<>
|
|
20
|
+
<InlineMessage theme="error">This is an error Inline Message</InlineMessage>
|
|
21
|
+
<InlineMessage theme="warning">
|
|
22
|
+
This is a warning Inline Message
|
|
23
|
+
</InlineMessage>
|
|
24
|
+
<InlineMessage theme="success">
|
|
25
|
+
This is a success Inline Message
|
|
26
|
+
</InlineMessage>
|
|
27
|
+
<InlineMessage theme="info">This is an info Inline Message</InlineMessage>
|
|
28
|
+
<InlineMessage theme="neutral">
|
|
29
|
+
This is a neutral Inline Message
|
|
30
|
+
</InlineMessage>
|
|
31
|
+
</>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Size
|
|
35
|
+
|
|
36
|
+
These are the available `size`s for this component: `xs`, `sm` and `md`. The default is `sm`
|
|
37
|
+
|
|
38
|
+
```tsx preview
|
|
39
|
+
<>
|
|
40
|
+
<InlineMessage size="xs">This is an xs Inline Message</InlineMessage>
|
|
41
|
+
<InlineMessage size="sm">This is a sm Inline Message</InlineMessage>
|
|
42
|
+
<InlineMessage size="md">This is a md Inline Message</InlineMessage>
|
|
43
|
+
</>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Icon
|
|
47
|
+
|
|
48
|
+
Each theme has a specific icon it should export, so showing or hiding an icon is simply done using the `showIcon` prop. Default is `true`.
|
|
49
|
+
|
|
50
|
+
```tsx preview
|
|
51
|
+
<InlineMessage showIcon={false}>This is an Inline Message</InlineMessage>
|
|
52
|
+
```
|
package/dist/docs/InputField.mdx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Input Field
|
|
3
3
|
component: InputField
|
|
4
|
-
description: InputField renders a field composed of an Input, a Label and a
|
|
4
|
+
description: InputField renders a field composed of an Input, a Label and a InlineMessage
|
|
5
5
|
category: Form fields
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ In addition to text `Label` (required) and a validation error (optional), `Input
|
|
|
11
11
|
`InputField`’s `css` prop will be applied to a containing `Box`—the styling of the individual components inside `InputField` cannot be altered.
|
|
12
12
|
|
|
13
13
|
Err on the side of using consistent form fields, but if you really need something with different styling then consider composing your own field from the
|
|
14
|
-
`Input`, `Label` and `
|
|
14
|
+
`Input`, `Label` and `InlineMessage` components.
|
|
15
15
|
|
|
16
16
|
```tsx preview
|
|
17
17
|
<Form>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Radio Button Field
|
|
3
3
|
component: RadioButtonField
|
|
4
|
-
description: Combines a RadioButtonGroup and RadioButtons with a Label and
|
|
4
|
+
description: Combines a RadioButtonGroup and RadioButtons with a Label and InlineMessage
|
|
5
5
|
category: Form fields
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
`RadioButtonField` wraps a `RadioButtonGroup` to provide a legend and a `
|
|
8
|
+
`RadioButtonField` wraps a `RadioButtonGroup` to provide a legend and a `InlineMessage`. `RadioButtonField.Item` renders an individual `RadioButton` with an inline `Label`.
|
|
9
9
|
|
|
10
10
|
**Note**: a `RadioButtonField.Item`’s `value` **must** be a `string`.
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Select Field
|
|
3
3
|
component: SelectField
|
|
4
|
-
description: Wraps a Select with a Label and
|
|
4
|
+
description: Wraps a Select with a Label and InlineMessage
|
|
5
5
|
category: Form fields
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
`SelectField` wraps a `Select` with a `Label` and a `
|
|
8
|
+
`SelectField` wraps a `Select` with a `Label` and a `InlineMessage` to provide consistent behaviour and layout.
|
|
9
9
|
|
|
10
10
|
```tsx preview
|
|
11
11
|
<Form>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Textarea Field
|
|
3
3
|
component: TextareaField
|
|
4
|
-
description: TextareaField renders a field composed of a Textarea, a Label and a
|
|
4
|
+
description: TextareaField renders a field composed of a Textarea, a Label and a InlineMessage
|
|
5
5
|
category: Form fields
|
|
6
6
|
---
|
|
7
7
|
|