@atom-learning/components 2.28.3-beta.2 → 2.29.0-beta.2

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 (257) hide show
  1. package/dist/components/accordion/Accordion.d.ts +1 -266
  2. package/dist/components/accordion/AccordionContent.d.ts +1 -266
  3. package/dist/components/accordion/AccordionContent.js +1 -1
  4. package/dist/components/accordion/AccordionItem.d.ts +1 -266
  5. package/dist/components/accordion/AccordionItem.js +1 -1
  6. package/dist/components/accordion/AccordionTrigger.d.ts +2 -270
  7. package/dist/components/accordion/AccordionTrigger.js +1 -1
  8. package/dist/components/action-icon/ActionIcon.d.ts +1 -281
  9. package/dist/components/alert-dialog/AlertDialog.d.ts +1 -266
  10. package/dist/components/alert-dialog/AlertDialogContent.d.ts +1 -268
  11. package/dist/components/alert-dialog/alert-context/AlertDialog.d.ts +1 -1
  12. package/dist/components/avatar/Avatar.d.ts +2 -536
  13. package/dist/components/badge/Badge.d.ts +1 -534
  14. package/dist/components/box/Box.d.ts +1 -266
  15. package/dist/components/button/Button.d.ts +2 -283
  16. package/dist/components/calendar/Calendar.d.ts +1 -1
  17. package/dist/components/calendar/Day.d.ts +1 -270
  18. package/dist/components/carousel/Carousel.d.ts +1 -1
  19. package/dist/components/carousel/CarouselArrows.d.ts +1 -1
  20. package/dist/components/carousel/CarouselPagination.d.ts +1 -267
  21. package/dist/components/carousel/CarouselSlide.d.ts +1 -266
  22. package/dist/components/carousel/CarouselSlider.d.ts +1 -269
  23. package/dist/components/checkbox/Checkbox.d.ts +1 -269
  24. package/dist/components/checkbox-field/CheckboxField.d.ts +2 -2
  25. package/dist/components/chip/Chip.d.ts +5 -1879
  26. package/dist/components/chip/ChipGroup.d.ts +1 -1
  27. package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.d.ts +2 -547
  28. package/dist/components/chip-dismissible-group/ChipDismissibleGroupRoot.d.ts +1 -5
  29. package/dist/components/chip-toggle-group/ChipToggleGroupItem.d.ts +1 -546
  30. package/dist/components/chip-toggle-group/ChipToggleGroupRoot.d.ts +1 -562
  31. package/dist/components/combobox/Combobox.d.ts +1 -266
  32. package/dist/components/combobox/ComboboxInput.d.ts +1 -268
  33. package/dist/components/combobox/ComboboxList.d.ts +1 -266
  34. package/dist/components/combobox/ComboboxOption.d.ts +1 -266
  35. package/dist/components/combobox/ComboboxPopover.d.ts +1 -266
  36. package/dist/components/data-table/DataTableLoading.d.ts +1 -270
  37. package/dist/components/data-table/drag-and-drop/Handle.d.ts +1 -559
  38. package/dist/components/data-table/pagination/Pagination.d.ts +1 -266
  39. package/dist/components/data-table/pagination/PaginationButtons.d.ts +1 -1
  40. package/dist/components/date-field/DateField.d.ts +2 -2
  41. package/dist/components/dialog/Dialog.d.ts +1 -266
  42. package/dist/components/dialog/DialogBackground.d.ts +1 -531
  43. package/dist/components/dialog/DialogClose.d.ts +1 -267
  44. package/dist/components/dialog/DialogContent.d.ts +1 -268
  45. package/dist/components/dismissible-group/DismissibleGroupItem.d.ts +1 -1
  46. package/dist/components/dismissible-group/index.d.ts +1 -1
  47. package/dist/components/divider/Divider.d.ts +1 -268
  48. package/dist/components/dropdown-menu/DropdownMenu.d.ts +1 -266
  49. package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +1 -267
  50. package/dist/components/dropdown-menu/DropdownMenuItem.d.ts +1 -267
  51. package/dist/components/dropdown-menu/DropdownMenuSeparator.d.ts +1 -267
  52. package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +1 -267
  53. package/dist/components/empty-state/EmptyState.d.ts +1 -533
  54. package/dist/components/empty-state/EmptyStateBody.d.ts +1 -543
  55. package/dist/components/empty-state/EmptyStateImage.d.ts +2 -542
  56. package/dist/components/empty-state/EmptyStateTitle.d.ts +1 -268
  57. package/dist/components/field-wrapper/FieldDescription.d.ts +1 -1
  58. package/dist/components/field-wrapper/FieldWrapper.d.ts +2 -2
  59. package/dist/components/field-wrapper/InlineFieldWrapper.d.ts +1 -1
  60. package/dist/components/flex/Flex.d.ts +1 -266
  61. package/dist/components/form/Form.d.ts +1 -266
  62. package/dist/components/grid/Grid.d.ts +1 -268
  63. package/dist/components/heading/Heading.d.ts +2 -270
  64. package/dist/components/icon/Icon.d.ts +2 -269
  65. package/dist/components/image/Image.d.ts +2 -269
  66. package/dist/components/inline-message/InlineMessage.config.d.ts +1 -1
  67. package/dist/components/inline-message/InlineMessage.d.ts +1 -534
  68. package/dist/components/input/Input.d.ts +2 -270
  69. package/dist/components/input-field/InputField.d.ts +2 -2
  70. package/dist/components/label/Label.d.ts +2 -272
  71. package/dist/components/link/Link.d.ts +3 -271
  72. package/dist/components/list/List.d.ts +2 -537
  73. package/dist/components/loader/Loader.d.ts +1 -1
  74. package/dist/components/markdown-content/MarkdownContent.d.ts +1 -1
  75. package/dist/components/markdown-content/components/MarkdownEmphasis.d.ts +1 -266
  76. package/dist/components/markdown-content/components/MarkdownImage.d.ts +1 -1
  77. package/dist/components/markdown-content/components/MarkdownList.d.ts +1 -1
  78. package/dist/components/markdown-content/components/MarkdownThematicBreak.d.ts +1 -1
  79. package/dist/components/navigation/NavigationMenu.d.ts +1 -1
  80. package/dist/components/navigation/NavigationMenuDropdown.d.ts +1 -1
  81. package/dist/components/navigation/NavigationMenuDropdownItem.d.ts +4 -543
  82. package/dist/components/navigation/NavigationMenuLink.d.ts +1 -1
  83. package/dist/components/notification-badge/NotificationBadge.d.ts +1 -531
  84. package/dist/components/number-input/NumberInput.d.ts +1 -1
  85. package/dist/components/number-input-field/NumberInputField.d.ts +2 -2
  86. package/dist/components/password-field/PasswordField.d.ts +2 -2
  87. package/dist/components/password-input/PasswordInput.d.ts +1 -1
  88. package/dist/components/popover/Popover.d.ts +1 -266
  89. package/dist/components/popover/PopoverContent.d.ts +1 -268
  90. package/dist/components/progress-bar/ProgressBar.d.ts +1 -269
  91. package/dist/components/radio-button/RadioButton.d.ts +2 -268
  92. package/dist/components/radio-button/RadioButtonGroup.d.ts +1 -270
  93. package/dist/components/radio-button-field/RadioButtonField.d.ts +2 -2
  94. package/dist/components/radio-button-field/RadioField.d.ts +3 -3
  95. package/dist/components/radio-card/RadioCard.d.ts +1 -271
  96. package/dist/components/radio-card/RadioCardGroup.d.ts +1 -1
  97. package/dist/components/search-field/SearchField.d.ts +2 -2
  98. package/dist/components/search-input/SearchInput.d.ts +2 -2
  99. package/dist/components/select/Select.d.ts +2 -270
  100. package/dist/components/select-field/SelectField.d.ts +2 -2
  101. package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionContent.d.ts +1 -266
  102. package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionItem.d.ts +1 -267
  103. package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionRoot.d.ts +1 -267
  104. package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionTrigger.d.ts +1 -268
  105. package/dist/components/sidedrawer/SidedrawerContent.d.ts +1 -266
  106. package/dist/components/sidedrawer/SidedrawerFooter.d.ts +1 -266
  107. package/dist/components/sidedrawer/SidedrawerHeader.d.ts +1 -266
  108. package/dist/components/sidedrawer/SidedrawerOverlay.d.ts +1 -267
  109. package/dist/components/sidedrawer/SidedrawerTrigger.d.ts +1 -267
  110. package/dist/components/slider/Slider.d.ts +1 -268
  111. package/dist/components/slider-field/SliderField.d.ts +3 -3
  112. package/dist/components/stack/Stack.d.ts +2 -273
  113. package/dist/components/stack-content/StackContent.d.ts +2 -267
  114. package/dist/components/stepper/StepperStepBullet.d.ts +1 -533
  115. package/dist/components/stepper/StepperStepContainer.d.ts +1 -536
  116. package/dist/components/stepper/StepperStepLabel.d.ts +1 -544
  117. package/dist/components/stepper/types.d.ts +1 -1
  118. package/dist/components/switch/Switch.d.ts +1 -267
  119. package/dist/components/table/Table.d.ts +1 -269
  120. package/dist/components/table/TableBody.d.ts +1 -268
  121. package/dist/components/table/TableCell.d.ts +1 -266
  122. package/dist/components/table/TableFooter.d.ts +1 -266
  123. package/dist/components/table/TableFooterCell.d.ts +1 -266
  124. package/dist/components/table/TableHeader.d.ts +1 -268
  125. package/dist/components/table/TableHeaderCell.d.ts +1 -266
  126. package/dist/components/table/TableRow.d.ts +2 -536
  127. package/dist/components/tabs/TabTrigger.d.ts +8 -0
  128. package/dist/components/tabs/TabTrigger.js +1 -0
  129. package/dist/components/tabs/Tabs.d.ts +7 -272
  130. package/dist/components/tabs/Tabs.js +1 -1
  131. package/dist/components/tabs/TabsTriggerList.d.ts +6 -270
  132. package/dist/components/tabs/TabsTriggerList.js +1 -1
  133. package/dist/components/tabs/utils.d.ts +2 -0
  134. package/dist/components/tabs/utils.js +1 -0
  135. package/dist/components/text/Text.d.ts +3 -271
  136. package/dist/components/textarea/Textarea.d.ts +1 -268
  137. package/dist/components/textarea-field/TextareaField.d.ts +2 -2
  138. package/dist/components/toast/Toast.d.ts +1 -268
  139. package/dist/components/toggle-group/ToggleGroupButton.d.ts +1 -534
  140. package/dist/components/toggle-group/ToggleGroupItem.d.ts +2 -534
  141. package/dist/components/toggle-group/ToggleGroupRoot.d.ts +1 -271
  142. package/dist/components/toggle-group/index.d.ts +3 -1352
  143. package/dist/components/tooltip/TooltipContent.d.ts +1 -268
  144. package/dist/components/top-bar/TopBar.d.ts +2 -270
  145. package/dist/components/top-bar/TopBar.js +1 -1
  146. package/dist/components/top-bar/TopBarBrand.d.ts +4 -808
  147. package/dist/components/video/Video.d.ts +4 -535
  148. package/dist/index.cjs.js +1 -1
  149. package/dist/index.d.ts +1 -1
  150. package/dist/stitches.d.ts +46 -1993
  151. package/dist/stitches.js +1 -1
  152. package/dist/utilities/create-theme-variants/createThemeVariants.d.ts +1 -109
  153. package/dist/utilities/css-wrapper/CSSWrapper.d.ts +1 -1
  154. package/dist/utilities/hooks/useCallbackRef.js +1 -1
  155. package/dist/utilities/hooks/useScrollPosition.d.ts +3 -6
  156. package/dist/utilities/hooks/useScrollPosition.js +1 -1
  157. package/dist/utilities/style/capsize.d.ts +1 -1
  158. package/dist/utilities/style/keyframe-animations.d.ts +8 -32
  159. package/package.json +4 -5
  160. package/CHANGELOG.md +0 -200
  161. package/dist/components/tabs/TabsContent.d.ts +0 -267
  162. package/dist/components/tabs/TabsContent.js +0 -1
  163. package/dist/components/tabs/TabsTrigger.d.ts +0 -272
  164. package/dist/components/tabs/TabsTrigger.js +0 -1
  165. package/dist/docgen.json +0 -1
  166. package/dist/docs/Accordion.mdx +0 -94
  167. package/dist/docs/ActionIcon.mdx +0 -87
  168. package/dist/docs/AlertDialog.mdx +0 -40
  169. package/dist/docs/Avatar.mdx +0 -129
  170. package/dist/docs/Badge.mdx +0 -55
  171. package/dist/docs/Box.mdx +0 -52
  172. package/dist/docs/Button.mdx +0 -76
  173. package/dist/docs/CONTRIBUTING.md +0 -224
  174. package/dist/docs/CSSWrapper.mdx +0 -10
  175. package/dist/docs/Carousel.mdx +0 -88
  176. package/dist/docs/Checkbox.mdx +0 -19
  177. package/dist/docs/CheckboxField.mdx +0 -14
  178. package/dist/docs/Chip.mdx +0 -118
  179. package/dist/docs/ChipDismissibleGroup.mdx +0 -33
  180. package/dist/docs/ChipToggleGroup.mdx +0 -27
  181. package/dist/docs/Combobox.mdx +0 -44
  182. package/dist/docs/DataTable.mdx +0 -279
  183. package/dist/docs/DateField.mdx +0 -20
  184. package/dist/docs/DateInput.mdx +0 -87
  185. package/dist/docs/Dialog.mdx +0 -68
  186. package/dist/docs/Dismissible.mdx +0 -48
  187. package/dist/docs/DismissibleGroup.mdx +0 -29
  188. package/dist/docs/Divider.mdx +0 -16
  189. package/dist/docs/DropdownMenu.mdx +0 -30
  190. package/dist/docs/EmptyState.mdx +0 -23
  191. package/dist/docs/FieldWrapper.mdx +0 -30
  192. package/dist/docs/FileInput.mdx +0 -45
  193. package/dist/docs/Flex.mdx +0 -16
  194. package/dist/docs/Form.mdx +0 -411
  195. package/dist/docs/Grid.mdx +0 -28
  196. package/dist/docs/Heading.mdx +0 -30
  197. package/dist/docs/Icon.mdx +0 -30
  198. package/dist/docs/Image.mdx +0 -14
  199. package/dist/docs/InlineMessage.mdx +0 -52
  200. package/dist/docs/Input.mdx +0 -24
  201. package/dist/docs/InputField.mdx +0 -26
  202. package/dist/docs/Label.mdx +0 -32
  203. package/dist/docs/Link.mdx +0 -53
  204. package/dist/docs/List.mdx +0 -38
  205. package/dist/docs/Loader.mdx +0 -16
  206. package/dist/docs/MarkdownContent.mdx +0 -77
  207. package/dist/docs/NavigationMenu.mdx +0 -144
  208. package/dist/docs/NotificationBadge.mdx +0 -35
  209. package/dist/docs/NumberInput.mdx +0 -37
  210. package/dist/docs/NumberInputField.mdx +0 -26
  211. package/dist/docs/PasswordField.mdx +0 -23
  212. package/dist/docs/PasswordInput.mdx +0 -15
  213. package/dist/docs/Popover.mdx +0 -29
  214. package/dist/docs/ProgressBar.mdx +0 -56
  215. package/dist/docs/README.mdx +0 -79
  216. package/dist/docs/RadioButton.mdx +0 -10
  217. package/dist/docs/RadioButtonField.mdx +0 -25
  218. package/dist/docs/RadioCard.mdx +0 -62
  219. package/dist/docs/SearchField.mdx +0 -26
  220. package/dist/docs/SearchInput.mdx +0 -13
  221. package/dist/docs/Select.mdx +0 -56
  222. package/dist/docs/SelectField.mdx +0 -17
  223. package/dist/docs/Sidedrawer.mdx +0 -155
  224. package/dist/docs/Slider.mdx +0 -117
  225. package/dist/docs/SliderField.mdx +0 -35
  226. package/dist/docs/Stack.mdx +0 -24
  227. package/dist/docs/StackContent.mdx +0 -32
  228. package/dist/docs/Stepper.mdx +0 -154
  229. package/dist/docs/Styling.mdx +0 -85
  230. package/dist/docs/Switch.mdx +0 -28
  231. package/dist/docs/Table.mdx +0 -146
  232. package/dist/docs/Tabs.mdx +0 -76
  233. package/dist/docs/Text.mdx +0 -24
  234. package/dist/docs/Textarea.mdx +0 -12
  235. package/dist/docs/TextareaField.mdx +0 -21
  236. package/dist/docs/Toast.mdx +0 -20
  237. package/dist/docs/ToggleGroup.mdx +0 -88
  238. package/dist/docs/Tooltip.mdx +0 -25
  239. package/dist/docs/TopBar.mdx +0 -95
  240. package/dist/docs/Video.mdx +0 -12
  241. package/dist/docs/accessibility.mdx +0 -67
  242. package/dist/docs/coreconcepts.mdx +0 -77
  243. package/dist/docs/introduction.mdx +0 -33
  244. package/dist/docs/versioning.mdx +0 -40
  245. package/dist/experiments/color-scheme/ColorScheme.d.ts +0 -201
  246. package/dist/experiments/color-scheme/ColorScheme.js +0 -1
  247. package/dist/experiments/color-scheme/blue.json.js +0 -1
  248. package/dist/experiments/color-scheme/generateAlphaColors.d.ts +0 -1
  249. package/dist/experiments/color-scheme/generateAlphaColors.js +0 -1
  250. package/dist/experiments/color-scheme/index.d.ts +0 -1
  251. package/dist/experiments/color-scheme/slate.json.js +0 -1
  252. package/dist/experiments/color-scheme/stitches.colorscheme.config.d.ts +0 -452
  253. package/dist/experiments/color-scheme/stitches.colorscheme.config.js +0 -1
  254. package/dist/utilities/hooks/useWindowScrollPosition.d.ts +0 -6
  255. package/dist/utilities/hooks/useWindowScrollPosition.js +0 -1
  256. package/dist/utilities/hooks/useWindowSize.d.ts +0 -8
  257. package/dist/utilities/hooks/useWindowSize.js +0 -1
@@ -1,94 +0,0 @@
1
- ---
2
- title: Accordion
3
- component: Accordion,Accordion.Item,Accordion.Trigger,Accordion.Content
4
- description: A vertically stacked group of interactive headings that reveal an associated section of content when clicked
5
- category: Layout
6
- ---
7
-
8
- Functionality based on the [`Accordion`](https://radix-ui.com/primitives/docs/components/accordion) radix component.
9
-
10
- Implements experimental ColorScheme component to allow multiple colour setups.
11
-
12
- The Accordion exports 4 components that combine to make the `Accordion`. The parent Accordion contains `Accordion.Item` components, which themselves must contain `Accordion.Trigger` and `Accordion.Content`.
13
-
14
- The `Accordion.Trigger` has been simplified to include a chevron icon. Generally, you would only want to render text inside the rest.
15
-
16
- Default styling has been applied to `Accordion.Trigger`, but `Accordion.Content` is an empty container without styling. Should only text be placed inside, it is highly advisable to apply spacing to align with the styling of the rest of the Accordion. This can be done with either the `css` property, or by placing any other components inside the `Accordion.Content`.
17
-
18
- ```tsx preview
19
- <Accordion type="single" defaultValue="1">
20
- <Accordion.Item value="1">
21
- <Accordion.Trigger>Accordion Header 1</Accordion.Trigger>
22
- <Accordion.Content css={{ p: '$3' }}>
23
- <Text>Accordion content 1</Text>
24
- </Accordion.Content>
25
- </Accordion.Item>
26
- <Accordion.Item value="2">
27
- <Accordion.Trigger>Accordion Header 2</Accordion.Trigger>
28
- <Accordion.Content css={{ p: '$3' }}>
29
- <Text>Accordion content 2</Text>
30
- </Accordion.Content>
31
- </Accordion.Item>
32
- </Accordion>
33
- ```
34
-
35
- ## Values
36
-
37
- Each `Accordion.Item` must have a value, which can either be used as a `defaultValue` on the Accordion, or by setting the `value` of the Accordion so it is a controlled component. If value is set, it must also contain an `onValueChange` function that sets the value to a new value.
38
-
39
- ## Collapsible
40
-
41
- Accordions can be given the property `collapsible`, which allows all items to be collapsed. Without passing this at least one item must be open.
42
-
43
- ## Type
44
-
45
- Accordions can have `type` as either `single` or `multiple`. This changes how many items can be expanded at once. The default is `single`.
46
-
47
- Note: if `multiple`, `value` and `defaultValue` must be in an array. Even if you want just one item to be visible initially, you must pass something like `defaultValue={['name']}`
48
-
49
- ## Disabled
50
-
51
- An `Accordion.Item` component can take a `disabled` prop, which would make it untoggleable.
52
- The corresponding `Accordion.Content` component's content will be, in this case, permanently in its original state.
53
-
54
- ```tsx preview live
55
- <Accordion type="single" defaultValue="1">
56
- <Accordion.Item value="1" disabled>
57
- <Accordion.Trigger>Accordion Header 1</Accordion.Trigger>
58
- <Accordion.Content css={{ p: '$3' }}>
59
- <Text>Accordion content 1</Text>
60
- </Accordion.Content>
61
- </Accordion.Item>
62
- <Accordion.Item value="2">
63
- <Accordion.Trigger>Accordion Header 2</Accordion.Trigger>
64
- <Accordion.Content css={{ p: '$3' }}>
65
- <Text>Accordion content 2</Text>
66
- </Accordion.Content>
67
- </Accordion.Item>
68
- </Accordion>
69
- ```
70
-
71
- ## Color Scheme
72
-
73
- You can pass in a `colorScheme` object to the Accordion.Trigger to customise the colours of the component.
74
- Defaults to `{ accent: "slate", interactive: "loContrast1"}`
75
- ColorScheme is experimental and has been implemented only locally but you can read more about how it
76
- currently works and available options [on the repository's github](https://github.com/Atom-Learning/components/tree/main/lib/src/experiments/color-scheme#readme).
77
-
78
- ```tsx preview live
79
- <Accordion type="single" defaultValue="1">
80
- <Accordion.Item value="1">
81
- <Accordion.Trigger
82
- colorScheme={{
83
- accent: 'blue',
84
- interactive: 'hiContrast2'
85
- }}
86
- >
87
- Accordion Header 1
88
- </Accordion.Trigger>
89
- <Accordion.Content css={{ p: '$3' }}>
90
- <Text>Accordion content 1</Text>
91
- </Accordion.Content>
92
- </Accordion.Item>
93
- </Accordion>
94
- ```
@@ -1,87 +0,0 @@
1
- ---
2
- title: Action Icon
3
- component: ActionIcon
4
- description: An accessible interactive wrapper around Icon
5
- category: Navigation
6
- ---
7
-
8
- `ActionIcon` should be used alongside `Icon` when you require a user interaction.
9
-
10
- ```tsx preview
11
- <>
12
- <ActionIcon label="Attach a file" appearance="simple">
13
- <Icon is={Clip} />
14
- </ActionIcon>
15
- <ActionIcon label="Attach a file" appearance="outline">
16
- <Icon is={Clip} />
17
- </ActionIcon>
18
- <ActionIcon label="Attach a file" appearance="solid">
19
- <Icon is={Clip} />
20
- </ActionIcon>
21
- </>
22
- ```
23
-
24
- ## Rounded Variant
25
-
26
- Setting `isRounded` makes the Action circular when paired with the options "outline" and "solid" for the `appearance` prop
27
-
28
- ```tsx preview
29
- <>
30
- <ActionIcon label="Attach a file" appearance="outline" isRounded>
31
- <Icon is={Bell} />
32
- </ActionIcon>
33
- <ActionIcon label="Attach a file" appearance="solid" isRounded>
34
- <Icon is={Bell} />
35
- </ActionIcon>
36
- </>
37
- ```
38
-
39
- ## Disabled state
40
-
41
- Passing `disabled` makes the Action Icon take a disabled appearance, where any cursor interaction with the component will not render any changes in its UI.
42
-
43
- ```tsx preview
44
- <>
45
- <ActionIcon label="Attach a file" appearance="simple" disabled>
46
- <Icon is={Bell} />
47
- </ActionIcon>
48
- <ActionIcon label="Attach a file" appearance="outline" disabled>
49
- <Icon is={Bell} />
50
- </ActionIcon>
51
- <ActionIcon label="Attach a file" appearance="solid" disabled>
52
- <Icon is={Bell} />
53
- </ActionIcon>
54
- </>
55
- ```
56
-
57
- It is recommended to pair `ActionIcon` with `Tooltip` to provide a clear visual description of the action the user is about to perform.
58
-
59
- ```tsx preview
60
- // `Tooltip.Provider` is included here to enable the example `Tooltip`, but you should generally place it at the root of your application
61
- <Tooltip.Provider>
62
- <Tooltip>
63
- <Tooltip.Trigger asChild>
64
- <ActionIcon size="lg" label="Add to basket">
65
- <Icon is={Basket} size="md" />
66
- </ActionIcon>
67
- </Tooltip.Trigger>
68
- <Tooltip.Content>Add to basket</Tooltip.Content>
69
- </Tooltip>
70
- </Tooltip.Provider>
71
- ```
72
-
73
- ## Polymorphism
74
-
75
- The `ActionIcon` component supports polymorphism, therefore depending on whether it receives an `onClick`/`href` as a prop, it will produce a `button` or `link` respectively
76
-
77
- ```tsx preview
78
- <ActionIcon label="Shuffle selection" onClick={() => console.log('clicked')}>
79
- <Icon is={Shuffle} />
80
- </ActionIcon>
81
- ```
82
-
83
- ```tsx preview
84
- <ActionIcon label="Add a new folder" href="/directory/add">
85
- <Icon is={FolderAdd} />
86
- </ActionIcon>
87
- ```
@@ -1,40 +0,0 @@
1
- ---
2
- title: Alert Dialog
3
- component: AlertDialog,AlertDialog.Trigger,AlertDialog.Content
4
- description: A modal dialog that interrupts the user with important content and expects a response
5
- category: Feedback
6
- ---
7
-
8
- `AlertDialog` exports a number of components that can be composed together to create a modal pop up that expects a response from the user. `AlertDialog` also exports a custom hook that can be used to dynamically render an alert based on some content and a callback; you can see an example of this below.
9
-
10
- ```tsx
11
- import { AlertProvider, Button, useAlert } from '@atom-learning/components'
12
-
13
- const Component = () => {
14
- const { showAlert } = useAlert()
15
-
16
- const handleClick = () => {
17
- showAlert({
18
- title: 'Are you sure you want to delete this school?',
19
- description: 'This will remove all restrictions from your school',
20
- confirmActionText: 'Delete school',
21
- cancelActionText: 'Cancel',
22
- onAction: (result) => {
23
- if (result) console.log('Confirmation')
24
- }
25
- })
26
- }
27
-
28
- return <Button onClick={handleClick}>Delete school</Button>
29
- }
30
-
31
- const App = () => (
32
- <AlertProvider>
33
- <Component />
34
- </AlertProvider>
35
- )
36
- ```
37
-
38
- ### Accessibility
39
-
40
- Consider pairing the `onAction` function with a method that can announce a message to the user. In the above example a message of "School has been deleted" would be appropriate for screen reader users. [Radix UI Announce](https://radix-ui.com/primitives/docs/utilities/announce) would be a good candidate for this.
@@ -1,129 +0,0 @@
1
- ---
2
- title: Avatar
3
- component: Avatar,Avatar.Image,Avatar.Initial,Avatar.Placeholder,Avatar.Icon
4
- description: Show a thumbnail representation of an individual or entity.
5
- category: Media
6
- ---
7
-
8
- The `Avatar` component can be used to show a visual representation of a user or entity. It helps to quickly identify users or objects.
9
-
10
- ```jsx preview
11
- <Avatar name="Alice Smith">
12
- <Avatar.Image
13
- alt="Alice Smith's avatar"
14
- src="https://thispersondoesnotexist.com/image"
15
- />
16
- </Avatar>
17
- ```
18
-
19
- Instead of an image, the initial of the name or a placeholder icon can be used
20
-
21
- ```jsx preview
22
- <>
23
- <Avatar name="Alice Smith">
24
- <Avatar.Initial />
25
- </Avatar>
26
- <Avatar>
27
- <Avatar.Placeholder />
28
- </Avatar>
29
- </>
30
- ```
31
-
32
- When an image src is missing it will fallback to the initial of the name.
33
-
34
- ```jsx preview
35
- <Avatar name="Alice Smith">
36
- <Avatar.Image alt="" src="" />
37
- </Avatar>
38
- ```
39
-
40
- When the name is also missing it will fallback to the placeholder icon.
41
-
42
- ```jsx preview
43
- <Avatar name="">
44
- <Avatar.Image alt="Alice Smith's avatar" src="" />
45
- </Avatar>
46
- ```
47
-
48
- When `<Avatar.Initial />` is used but the name is missing, it will fallback to the placeholder icon.
49
-
50
- ```jsx preview
51
- <Avatar name="">
52
- <Avatar.Initial />
53
- </Avatar>
54
- ```
55
-
56
- An `onClick` prop can be used, this will make the component focusable using the keyboard, as it uses a `<button>` under the hood.
57
-
58
- ```jsx preview
59
- <Avatar name="Alice Smith" onClick={() => alert('Thanks for clicking')}>
60
- <Avatar.Initial />
61
- </Avatar>
62
- ```
63
-
64
- When disabled, the onClick won't work.
65
-
66
- ```jsx preview
67
- <Avatar
68
- name="Alice Smith"
69
- disabled
70
- onClick={() => alert('This message will not appear')}
71
- >
72
- <Avatar.Initial />
73
- </Avatar>
74
- ```
75
-
76
- Instead of an image, an icon can be passed.
77
-
78
- ```jsx preview
79
- <>
80
- <Avatar>
81
- <Avatar.Icon is={BatteryMedium} />
82
- </Avatar>
83
- </>
84
- ```
85
-
86
- ## Size
87
-
88
- The available `size`s for this component are: `xs`, `sm`, `md`, `lg`, `xl` and `xxl`. The default is `lg`.
89
-
90
- ```jsx live
91
- <>
92
- <Avatar size="xs" name="Alice Smith">
93
- <Avatar.Image
94
- alt="Alice Smith's avatar"
95
- src="https://thispersondoesnotexist.com/image"
96
- />
97
- </Avatar>
98
- <Avatar size="sm" name="Alice Smith">
99
- <Avatar.Image
100
- alt="Alice Smith's avatar"
101
- src="https://thispersondoesnotexist.com/image"
102
- />
103
- </Avatar>
104
- <Avatar size="md" name="Alice Smith">
105
- <Avatar.Image
106
- alt="Alice Smith's avatar"
107
- src="https://thispersondoesnotexist.com/image"
108
- />
109
- </Avatar>
110
- <Avatar size="lg" name="Alice Smith">
111
- <Avatar.Image
112
- alt="Alice Smith's avatar"
113
- src="https://thispersondoesnotexist.com/image"
114
- />
115
- </Avatar>
116
- <Avatar size="xl" name="Alice Smith">
117
- <Avatar.Image
118
- alt="Alice Smith's avatar"
119
- src="https://thispersondoesnotexist.com/image"
120
- />
121
- </Avatar>
122
- <Avatar size="xxl" name="Alice Smith">
123
- <Avatar.Image
124
- alt="Alice Smith's avatar"
125
- src="https://thispersondoesnotexist.com/image"
126
- />
127
- </Avatar>
128
- </>
129
- ```
@@ -1,55 +0,0 @@
1
- ---
2
- title: Badge
3
- component: Badge
4
- description: Highlights a small piece of information
5
- category: Feedback
6
- ---
7
-
8
- The `Badge` component can be used to highlight a short piece of information, like a status.
9
-
10
- ```tsx preview
11
- <Badge>New Data</Badge>
12
- ```
13
-
14
- ## Theme
15
-
16
- These are the available `theme`s for this component: `success`, `warning`, `danger`, `neutral` and `info`. The default is `info`
17
-
18
- ```tsx preview
19
- <>
20
- <Badge>Info</Badge>
21
- <Badge theme="neutral">Neutral</Badge>
22
- <Badge theme="success">Success</Badge>
23
- <Badge theme="warning">Warning</Badge>
24
- <Badge theme="danger">Danger</Badge>
25
- </>
26
- ```
27
-
28
- ## Size
29
-
30
- These are the available `size`s for this component: `xs`, `sm` and `md`. The default is `sm`
31
-
32
- ```tsx preview
33
- <>
34
- <Badge size="xs">extra small</Badge>
35
- <Badge size="sm">small</Badge>
36
- <Badge size="md">medium</Badge>
37
- </>
38
- ```
39
-
40
- ## With icons
41
-
42
- An `<Icon />` can be passed as a child to show alongside text.
43
-
44
- ```tsx preview
45
- <>
46
- <Badge>
47
- <Icon is={Wifi} />
48
- Info with icon
49
- </Badge>
50
- <Badge theme="neutral">
51
- Info with icon
52
- <Icon is={Wifi} />
53
- </Badge>
54
- </>
55
- ```
package/dist/docs/Box.mdx DELETED
@@ -1,52 +0,0 @@
1
- ---
2
- title: Box
3
- component: Box
4
- description: Box is our most fundamental layout component
5
- category: Layout
6
- ---
7
-
8
- `Box` can largely be seen as an abstraction over the `div` element. It is most useful when used as a generic containing component, and when paired with `as` and `css` allows a high degree of composition and flexibility.
9
-
10
- `Box` falls back to rendering a `div`, but we should use it to render more sematically relevant container elements e.g. `<Box as="section">`. As an example, a card component could use `Box` to render a `section`, `header` and `footer`.
11
-
12
- Avoid rendering any of these elements directly in our components — `Box` has all the same flexibility, but with the addition of the powerful `css` prop and various styling utilities based on our themes.
13
-
14
- ## Example
15
-
16
- To show an example of the benefits of using `Box`, the card below is composed together using `Box` alongside other relevant components:
17
-
18
- ```tsx live
19
- <Box
20
- as="article"
21
- css={{
22
- border: '1px solid $tonal100',
23
- borderRadius: '$1',
24
- overflow: 'hidden',
25
- width: '320px'
26
- }}
27
- >
28
- <Box as="figure" css={{ m: 0, position: 'relative' }}>
29
- <Image src="http://placekitten.com/320/200" alt="Cats having a nice time" />
30
- <Text
31
- as="figcaption"
32
- size="sm"
33
- css={{
34
- bottom: '$3',
35
- color: 'white',
36
- position: 'absolute',
37
- right: '$3'
38
- }}
39
- >
40
- Here is a cute cat
41
- </Text>
42
- </Box>
43
- <Stack gap="4" css={{ px: '$3', py: '$4' }}>
44
- <Heading as="h2" size="sm">
45
- Cat
46
- </Heading>
47
- <Text>
48
- The cat (Felis catus) is a domestic species of small carnivorous mammal.
49
- </Text>
50
- </Stack>
51
- </Box>
52
- ```
@@ -1,76 +0,0 @@
1
- ---
2
- title: Button
3
- component: Button
4
- description: The Button component is a light wrapper around an HTML button element
5
- category: Navigation
6
- ---
7
-
8
- It adds default styling and the `css` prop. By default `primary` theme is displayed with a `solid` appearance.
9
-
10
- ```tsx live
11
- <Button>Hello world</Button>
12
- ```
13
-
14
- ## Themes
15
-
16
- These are the available `themes` for the `Button` component: `primary` (default), `secondary`, `success`, `warning`, `danger`, and `neutral`.
17
-
18
- ```tsx preview
19
- <>
20
- <Button>Primary</Button>
21
- <Button theme="secondary">Secondary</Button>
22
- <Button theme="success">Success</Button>
23
- <Button theme="warning">Warning</Button>
24
- <Button theme="danger">Danger</Button>
25
- <Button theme="neutral">Neutral</Button>
26
- </>
27
- ```
28
-
29
- ## Appearance
30
-
31
- There are two options for the `appearance` property: `solid` and `outline`. There are the available `outline` variations for the `primary`, `secondary` and `neutral` themes.
32
-
33
- ```tsx preview
34
- <Button appearance="outline">Primary</Button>
35
- ```
36
-
37
- ## Disabled state
38
-
39
- Each variation has an `disabled` stated, by setting the `disabled` property.
40
-
41
- ```tsx preview
42
- <>
43
- <Button disabled>Disabled button</Button>
44
- <Button theme="success" disabled>
45
- Disabled button
46
- </Button>
47
- </>
48
- ```
49
-
50
- ## Loading state
51
-
52
- When using a button to request data or fire an action that has a potential delay, including a loading state to the button can be a useful indicator that stuff is happening. The `isLoading` prop must be a boolean value to activate the loading state.
53
-
54
- ```tsx live
55
- <Button isLoading> Hello world</Button>
56
- ```
57
-
58
- ## Rounded Variant
59
-
60
- Setting `isRounded` creates a rounded button
61
-
62
- ```tsx live
63
- <Button isRounded>Rounded Button</Button>
64
- ```
65
-
66
- ## Polymorphism
67
-
68
- The `Button` component supports polymorphism, therefore depending on whether it receives an `onClick`/`href` as a prop, it will produce a `button` or `link` respectively
69
-
70
- ```tsx preview
71
- <Button href="http://example.com/">I'm a link</Button>
72
- ```
73
-
74
- ```tsx preview
75
- <Button onClick={() => console.log('clicked')}>I'm a button</Button>
76
- ```