@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.
Files changed (120) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/dist/components/accordion/Accordion.d.ts +1 -0
  3. package/dist/components/accordion/AccordionContent.d.ts +1 -0
  4. package/dist/components/accordion/AccordionItem.d.ts +1 -0
  5. package/dist/components/accordion/AccordionTrigger.d.ts +1 -0
  6. package/dist/components/action-icon/ActionIcon.constants.d.ts +6 -0
  7. package/dist/components/action-icon/ActionIcon.constants.js +1 -0
  8. package/dist/components/action-icon/ActionIcon.d.ts +2 -1
  9. package/dist/components/action-icon/ActionIcon.js +1 -1
  10. package/dist/components/alert-dialog/AlertDialog.d.ts +1 -0
  11. package/dist/components/alert-dialog/AlertDialogContent.d.ts +1 -0
  12. package/dist/components/badge/Badge.d.ts +2 -0
  13. package/dist/components/box/Box.d.ts +1 -0
  14. package/dist/components/button/Button.d.ts +1 -0
  15. package/dist/components/calendar/Calendar.js +1 -1
  16. package/dist/components/calendar/Day.d.ts +1 -0
  17. package/dist/components/carousel/CarouselPagination.d.ts +1 -0
  18. package/dist/components/carousel/CarouselSlide.d.ts +1 -0
  19. package/dist/components/carousel/CarouselSlider.d.ts +1 -0
  20. package/dist/components/checkbox/Checkbox.d.ts +1 -0
  21. package/dist/components/combobox/Combobox.d.ts +1 -0
  22. package/dist/components/combobox/ComboboxInput.d.ts +1 -0
  23. package/dist/components/combobox/ComboboxList.d.ts +1 -0
  24. package/dist/components/combobox/ComboboxOption.d.ts +1 -0
  25. package/dist/components/combobox/ComboboxPopover.d.ts +1 -0
  26. package/dist/components/date-input/DateInput.js +1 -1
  27. package/dist/components/dialog/Dialog.d.ts +1 -0
  28. package/dist/components/dialog/DialogBackground.d.ts +2 -0
  29. package/dist/components/dialog/DialogClose.d.ts +1 -0
  30. package/dist/components/dialog/DialogContent.d.ts +1 -0
  31. package/dist/components/dialog/DialogContent.js +1 -1
  32. package/dist/components/divider/Divider.d.ts +1 -0
  33. package/dist/components/dropdown-menu/DropdownMenu.d.ts +1 -0
  34. package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +1 -0
  35. package/dist/components/dropdown-menu/DropdownMenuItem.d.ts +1 -0
  36. package/dist/components/dropdown-menu/DropdownMenuSeparator.d.ts +1 -0
  37. package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +1 -0
  38. package/dist/components/empty-state/EmptyState.d.ts +2 -0
  39. package/dist/components/empty-state/EmptyStateBody.d.ts +2 -0
  40. package/dist/components/empty-state/EmptyStateImage.d.ts +2 -0
  41. package/dist/components/empty-state/EmptyStateTitle.d.ts +1 -0
  42. package/dist/components/field-wrapper/FieldWrapper.js +1 -1
  43. package/dist/components/field-wrapper/InlineFieldWrapper.js +1 -1
  44. package/dist/components/flex/Flex.d.ts +1 -0
  45. package/dist/components/form/Form.d.ts +1 -0
  46. package/dist/components/grid/Grid.d.ts +1 -0
  47. package/dist/components/heading/Heading.d.ts +1 -0
  48. package/dist/components/icon/Icon.d.ts +1 -0
  49. package/dist/components/image/Image.d.ts +1 -0
  50. package/dist/components/index.d.ts +1 -1
  51. package/dist/components/inline-message/InlineMessage.config.d.ts +5 -0
  52. package/dist/components/inline-message/InlineMessage.config.js +1 -0
  53. package/dist/components/inline-message/InlineMessage.d.ts +541 -0
  54. package/dist/components/inline-message/InlineMessage.js +1 -0
  55. package/dist/components/inline-message/InlineMessage.types.d.ts +1 -0
  56. package/dist/components/inline-message/index.d.ts +1 -0
  57. package/dist/components/input/Input.d.ts +1 -0
  58. package/dist/components/label/Label.d.ts +1 -0
  59. package/dist/components/link/Link.d.ts +1 -0
  60. package/dist/components/list/List.d.ts +2 -0
  61. package/dist/components/notification-badge/NotificationBadge.d.ts +2 -0
  62. package/dist/components/password-input/PasswordInput.js +1 -1
  63. package/dist/components/popover/Popover.d.ts +1 -0
  64. package/dist/components/popover/PopoverContent.d.ts +1 -0
  65. package/dist/components/popover/PopoverContent.js +1 -1
  66. package/dist/components/progress-bar/ProgressBar.d.ts +1 -0
  67. package/dist/components/radio-button/RadioButton.d.ts +1 -0
  68. package/dist/components/radio-button/RadioButtonGroup.d.ts +1 -0
  69. package/dist/components/radio-button-field/RadioButtonField.js +1 -1
  70. package/dist/components/radio-card/RadioCard.d.ts +1 -0
  71. package/dist/components/search-input/SearchInput.js +1 -1
  72. package/dist/components/select/Select.d.ts +1 -0
  73. package/dist/components/slider/Slider.d.ts +1 -0
  74. package/dist/components/stack/Stack.d.ts +1 -0
  75. package/dist/components/stack-content/StackContent.d.ts +1 -0
  76. package/dist/components/stepper/StepperStepBullet.d.ts +2 -0
  77. package/dist/components/stepper/StepperStepContainer.d.ts +2 -0
  78. package/dist/components/stepper/StepperStepLabel.d.ts +2 -0
  79. package/dist/components/switch/Switch.d.ts +1 -0
  80. package/dist/components/table/Table.d.ts +1 -0
  81. package/dist/components/table/TableBody.d.ts +1 -0
  82. package/dist/components/table/TableCell.d.ts +1 -0
  83. package/dist/components/table/TableFooter.d.ts +1 -0
  84. package/dist/components/table/TableFooterCell.d.ts +1 -0
  85. package/dist/components/table/TableHeader.d.ts +1 -0
  86. package/dist/components/table/TableHeaderCell.d.ts +1 -0
  87. package/dist/components/table/TableRow.d.ts +1 -0
  88. package/dist/components/tabs/TabTrigger.d.ts +1 -0
  89. package/dist/components/tabs/Tabs.d.ts +2 -0
  90. package/dist/components/tabs/TabsTriggerList.d.ts +1 -0
  91. package/dist/components/tabs/TabsTriggerList.js +1 -1
  92. package/dist/components/text/Text.d.ts +1 -0
  93. package/dist/components/textarea/Textarea.d.ts +1 -0
  94. package/dist/components/toast/Toast.d.ts +1 -0
  95. package/dist/components/toggle-group/ToggleGroupButton.d.ts +2 -0
  96. package/dist/components/toggle-group/ToggleGroupItem.d.ts +2 -0
  97. package/dist/components/toggle-group/ToggleGroupRoot.d.ts +1 -0
  98. package/dist/components/toggle-group/index.d.ts +5 -0
  99. package/dist/components/tooltip/TooltipContent.d.ts +1 -0
  100. package/dist/components/video/Video.d.ts +2 -0
  101. package/dist/docgen.json +1 -1
  102. package/dist/docs/ActionIcon.mdx +13 -19
  103. package/dist/docs/CheckboxField.mdx +1 -1
  104. package/dist/docs/DateField.mdx +2 -2
  105. package/dist/docs/FieldWrapper.mdx +1 -1
  106. package/dist/docs/Form.mdx +3 -3
  107. package/dist/docs/Icon.mdx +1 -1
  108. package/dist/docs/InlineMessage.mdx +52 -0
  109. package/dist/docs/InputField.mdx +2 -2
  110. package/dist/docs/RadioButtonField.mdx +2 -2
  111. package/dist/docs/SelectField.mdx +2 -2
  112. package/dist/docs/TextareaField.mdx +1 -1
  113. package/dist/index.cjs.js +1 -1
  114. package/dist/index.js +1 -1
  115. package/dist/stitches.d.ts +10 -0
  116. package/package.json +3 -2
  117. package/dist/components/validation-error/ValidationError.d.ts +0 -7
  118. package/dist/components/validation-error/ValidationError.js +0 -1
  119. package/dist/components/validation-error/index.d.ts +0 -1
  120. package/dist/docs/ValidationError.mdx +0 -12
@@ -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} size="sm" />
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} size="sm" />
16
+ <Icon is={Clip} />
20
17
  </ActionIcon>
21
18
  <ActionIcon label="Attach a file" appearance="solid">
22
- <Icon is={Clip} size="sm" />
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 "subtle", "outline" and "solid" for the `appearance` prop
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} size="sm" />
31
+ <Icon is={Bell} />
38
32
  </ActionIcon>
39
33
  <ActionIcon label="Attach a file" appearance="solid" isRounded>
40
- <Icon is={Bell} size="sm" />
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="subtle" disabled>
52
- <Icon is={Bell} size="sm" />
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} size="sm" />
49
+ <Icon is={Bell} />
56
50
  </ActionIcon>
57
51
  <ActionIcon label="Attach a file" appearance="solid" disabled>
58
- <Icon is={Bell} size="sm" />
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} size="md" />
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} size="sm" />
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} size="sm" />
82
+ <Icon is={FolderAdd} />
89
83
  </ActionIcon>
90
84
  ```
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Checkbox Field
3
3
  component: CheckboxField
4
- description: Combines a Checkbox with a Label and ValidationError
4
+ description: Combines a Checkbox with a Label and InlineMessage
5
5
  category: Form fields
6
6
  ---
7
7
 
@@ -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 ValidationError
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 `ValidationError` components.
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 `ValidationError`. Use it to wrap any type of input to create a consistent set of form fields.
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">
@@ -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`, `ValidationError` etc) but there are some requirements that your new
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 `ValidationError` when present. You don’t need to pass `error` to your component manually; the `Form` will pass it in automatically when appropriate.
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 && <ValidationError css={{ mt: '$1' }}>{error}</ValidationError>}
261
+ {error && <InlineMessage css={{ mt: '$1' }}>{error}</InlineMessage>}
262
262
  </FieldWrapper>
263
263
  )
264
264
  }
@@ -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="lg" css={{ color: '$primary' }} />
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
+ ```
@@ -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 ValidationError
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 `ValidationError` components.
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 ValidationError
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 `ValidationError`. `RadioButtonField.Item` renders an individual `RadioButton` with an inline `Label`.
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 ValidationError
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 `ValidationError` to provide consistent behaviour and layout.
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 ValidationError
4
+ description: TextareaField renders a field composed of a Textarea, a Label and a InlineMessage
5
5
  category: Form fields
6
6
  ---
7
7