@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,10 +0,0 @@
1
- ---
2
- title: Radio Button
3
- component: RadioButtonGroup,RadioButton
4
- description: The RadioButton component implements the Radio component from Radix with default styling and the css prop
5
- category: Form primitives
6
- ---
7
-
8
- It needs to be wrapped with the `RadioButtonGroup` as it will not load without it. If only one `RadioButton` is needed please consider using a checkbox instead.
9
-
10
- A `RadioButton` needs to be associated with a label for accessibility purposes and to display the text for it. So rather than using the `RadioButton` component directly in a UI, consider using a `RadioButtonField`, which provides a `Label` and displays validation errors. Use this `RadioButton` to compose more complex `Field` type components.
@@ -1,25 +0,0 @@
1
- ---
2
- title: Radio Button Field
3
- component: RadioButtonField
4
- description: Combines a RadioButtonGroup and RadioButtons with a Label and InlineMessage
5
- category: Form fields
6
- ---
7
-
8
- `RadioButtonField` wraps a `RadioButtonGroup` to provide a legend and a `InlineMessage`. `RadioButtonField.Item` renders an individual `RadioButton` with an inline `Label`.
9
-
10
- **Note**: a `RadioButtonField.Item`’s `value` **must** be a `string`.
11
-
12
- ```tsx preview
13
- <Form>
14
- <RadioButtonField name="options" label="Please select an option">
15
- <RadioButtonField.Item label="Option 1" value="1" />
16
- <RadioButtonField.Item label="Option 2" value="2" />
17
- </RadioButtonField>
18
- </Form>
19
- ```
20
-
21
- If you need to know when the radio group value changes, you can pass `onValueChange`, which takes a `string` type as input.
22
-
23
- ```tsx
24
- <RadioButtonField onValueChange={onChangeHandler} />
25
- ```
@@ -1,62 +0,0 @@
1
- ---
2
- title: Radio Card
3
- component: RadioCardGroup,RadioCard
4
- description: A Radio Button that enables extra emphasis and descriptive capability
5
- category: Form primitives
6
- ---
7
-
8
- A set of `RadioCard`s should be wrapped with a `RadioCardGroup` component to provide the correct HTML structure for our radio buttons. Any text within the card will be used as the label for the radio button, so ensure that you test this content and use `aria-hidden` to remove any unnecessary content from the announced text.
9
-
10
- ```tsx preview
11
- <RadioCardGroup>
12
- <RadioCard value="1">
13
- <Text css={{ mb: '$2' }}>This is a radio card option</Text>
14
- <Text size="sm" css={{ color: '$tonal300' }}>
15
- With some additional text
16
- </Text>
17
- </RadioCard>
18
- <RadioCard value="2">
19
- <Text css={{ mb: '$2' }}>This is another radio card option</Text>
20
- <Text size="sm" css={{ color: '$tonal300' }}>
21
- With some additional text
22
- </Text>
23
- </RadioCard>
24
- <RadioCard value="3">
25
- <Text css={{ mb: '$2' }}>And a further radio card option</Text>
26
- <Text size="sm" css={{ color: '$tonal300' }}>
27
- With some additional text
28
- </Text>
29
- </RadioCard>
30
- </RadioCardGroup>
31
- ```
32
-
33
- You can pass props to `RadioCardGroup` to control the styling of every `RadioCard` within. Change the radio button alignment within the card, toggle between two sizes, and render each card at full width.
34
-
35
- ```tsx preview
36
- <RadioCardGroup align="right" size="lg" isFullWidth defaultValue="1">
37
- <RadioCard value="1">
38
- <Flex css={{ flexDirection: 'row', alignContent: 'center' }}>
39
- <Text css={{ mr: '$4' }} size="sm">
40
- £99
41
- </Text>
42
- <Heading size="xs">This is a radio card option</Heading>
43
- </Flex>
44
- </RadioCard>
45
- <RadioCard value="2">
46
- <Flex css={{ flexDirection: 'row', alignContent: 'center' }}>
47
- <Text css={{ mr: '$4' }} size="sm">
48
- £109
49
- </Text>
50
- <Heading size="xs">This is another radio card option</Heading>
51
- </Flex>
52
- </RadioCard>
53
- <RadioCard value="3">
54
- <Flex css={{ flexDirection: 'row', alignContent: 'center' }}>
55
- <Text css={{ mr: '$4' }} size="sm">
56
- £149
57
- </Text>
58
- <Heading size="xs">And a further additional radio card option</Heading>
59
- </Flex>
60
- </RadioCard>
61
- </RadioCardGroup>
62
- ```
@@ -1,26 +0,0 @@
1
- ---
2
- title: Search Field
3
- component: SearchField
4
- description: SearchField renders a field composed of an SearchInput, a Label and a InlineMessage
5
- category: Form fields
6
- ---
7
-
8
- `SearchField` is the preferred way to render a form field for search inputs.
9
-
10
- In addition to text `Label` (required) and a validation error (optional), `SearchField` accepts all the same props as `SearchInput` and will pass them on to the `SearchInput` it renders. However, as with all our composed components,
11
- `SearchField`’s `css` prop will be applied to a containing `Box`—the styling of the individual components inside `SearchField` cannot be altered.
12
-
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
- `SearchInput`, `Label` and `InlineMessage` components.
15
-
16
- ```tsx preview
17
- <Form>
18
- <SearchField
19
- name="Email address"
20
- label="Email address"
21
- placeholder="your.name@example.com"
22
- type="email"
23
- css={{ width: 320 }}
24
- />
25
- </Form>
26
- ```
@@ -1,13 +0,0 @@
1
- ---
2
- title: Search Input
3
- component: SearchInput
4
- description: A search input with matching search icon
5
- category: Form primitives
6
- ---
7
-
8
- `SearchInput` wraps `Input` and adds an icon to visualise the specific input type, it's recommended to use this component when the user is performing a search query.
9
- When the user types into the `SearchInput` the component renders a clear button that clears the typed value.
10
-
11
- ```tsx preview
12
- <SearchInput name="search" css={{ width: 320 }} placeholder="Search" />
13
- ```
@@ -1,56 +0,0 @@
1
- ---
2
- title: Select
3
- component: Select
4
- description: Select is a light wrapper around the HTML select element
5
- category: Form primitives
6
- ---
7
-
8
- It adds default styling and the `css` prop.
9
-
10
- A `Select` needs to be associated with a label for accessibility purposes, so rather than using the `Select` component directly in a UI, consider using a `SelectField`, which provides a `Label` and displays validation errors. Use this `Select` to compose more complex `Field` type components.
11
-
12
- ```tsx preview
13
- <Select css={{ width: 300 }}>
14
- <option value="apples">Apples</option>
15
- <option value="bananas">Bananas</option>
16
- </Select>
17
- ```
18
-
19
- ## Accessibility
20
-
21
- For accessibility purposes the component needs to have the `id` prop set, to link it to the label it is associated with. If a label is not available, please add an `aria-label` to ensure that the component remains accessible
22
-
23
- ## Placeholder
24
-
25
- The component can display a placeholder without a value by passing the `placeholder` property.
26
-
27
- ```tsx preview
28
- <Select placeholder="Please select a fruit" css={{ width: 300 }}>
29
- <option value="apples">Apples</option>
30
- <option value="bananas">Bananas</option>
31
- </Select>
32
- ```
33
-
34
- ## Disabled select
35
-
36
- The component has a `disabled` state, by setting the `disabled` property.
37
-
38
- ```tsx preview
39
- <Select disabled placeholder="Please select a fruit" css={{ width: 300 }}>
40
- <option value="apples">Apples</option>
41
- <option value="bananas">Bananas</option>
42
- </Select>
43
- ```
44
-
45
- ## Disabled Option
46
-
47
- The component can show an option as `disabled`, by setting the `disabled` property on the option.
48
-
49
- ```tsx preview
50
- <Select placeholder="Please select a fruit" css={{ width: 300 }}>
51
- <option value="apples">Apples</option>
52
- <option value="bananas" disabled>
53
- Bananas
54
- </option>
55
- </Select>
56
- ```
@@ -1,17 +0,0 @@
1
- ---
2
- title: Select Field
3
- component: SelectField
4
- description: Wraps a Select with a Label and InlineMessage
5
- category: Form fields
6
- ---
7
-
8
- `SelectField` wraps a `Select` with a `Label` and a `InlineMessage` to provide consistent behaviour and layout.
9
-
10
- ```tsx preview
11
- <Form>
12
- <SelectField name="options" label="Options" css={{ width: 320 }}>
13
- <option value="apples">Apples</option>
14
- <option value="bananas">Bananas</option>
15
- </SelectField>
16
- </Form>
17
- ```
@@ -1,155 +0,0 @@
1
- ---
2
- title: Sidedrawer
3
- component: Sidedrawer,Sidedrawer.Accordion,Sidedrawer.AccordionContent,Sidedrawer.AccordionTrigger,Sidedrawer.Body,Sidedrawer.Close,Sidedrawer.Content,Sidedrawer.Footer,Sidedrawer.Header,Sidedrawer.Item,Sidedrawer.Trigger
4
- description: A collection of items to build flexible sidedrawer
5
- category: Navigation
6
- ---
7
-
8
- `Sidedrawer` exports components that combine to build complex side navigation.
9
-
10
- ## The `Sidedrawer` root
11
-
12
- Sidedrawer exposes few main elements to build foundations.
13
- The core element is a `Sidedrawer` which wraps entire components composition.
14
- `Sidedrawer` has build-in state, but also allows you to pass props to control if from the outside.
15
- The Sidedrawer root is made in top of the [radix dialog](https://www.radix-ui.com/docs/primitives/components/dialog)
16
-
17
- Optional `Sidedrawer` props
18
-
19
- - `isOpen` property determines if the whole `Sidedrawer` is visible or not.
20
- - `onOpenChange` prop should be a function which updates `isOpen` state. This function is triggered automatically when click on `Sidedrawer.Overlay`, `Sidedrawer.Close` or press `Escape` key.
21
-
22
- ### Fundamental root componenents
23
-
24
- - `Sidedrawer.Trigger` - It's the main `trigger element` responsible for opening the whole `Sidedrawer.Content`. This component is build on top of [radix dialog trigger](https://www.radix-ui.com/docs/primitives/components/dialog#trigger)
25
- - `Sidedrawer.Content` - This is whe wrapper for whole content (`Sidedrawer.Header`, `Sidedrawer.Body`, `Sidedrawer.Footer` and other nested elements). This component is build on top of [radix dialog content](https://www.radix-ui.com/docs/primitives/components/dialog#content)
26
-
27
- ```tsx
28
- <Sidedrawer>
29
- <Sidedrawer.Trigger asChild>
30
- <Button>Open the navigation</Button>
31
- </Sidedrawer.Trigger>
32
- <Sidedrawer.Content>the sidedrawer content</Sidedrawer.Content>
33
- </Sidedrawer>
34
- ```
35
-
36
- ### The `Sidedrawer.Content` children building blocks
37
-
38
- - `Sidedrawer.Header` - It's based on `TopBar` component, so it plays really well with all `TopBar` subcomponents. This component is flexible, so you can render anything you need inside of it (for example app logo, Sidedrawer.Close etc.)
39
- - `Sidedrawer.Close` - It's an `"close" ActionIcon` which triggers `Sidedrawer.Content` closing.
40
- - `Sidedrawer.Body` - This is the wrapper for all `Sidedrawer.Item` items. The content is scrollable.
41
- - `Sidedrawer.Footer` - Optional part of the `Sidedrawer`. It's fixed to the botton. You can pass whatever you need as it's children.
42
-
43
- ```tsx
44
- <Sidedrawer>
45
- <Sidedrawer.Trigger asChild>
46
- <Button>Open the navigation</Button>
47
- </Sidedrawer.Trigger>
48
- <Sidedrawer.Content>
49
- <Sidedrawer.Header>
50
- <Sidedrawer.Close />
51
- </Sidedrawer.Header>
52
- <Sidedrawer.Body>Sidedrawer items and Accordions here</Sidedrawer.Body>
53
- <Sidedrawer.Footer>Footer items here</Sidedrawer.Footer>
54
- </Sidedrawer.Content>
55
- </Sidedrawer>
56
- ```
57
-
58
- ## Sidedrawer.Body children
59
-
60
- You most likely want to use `Sidedrawer.Item` or `Sidedrawer.Accordion` inside of `Sidedrawer.Body`
61
-
62
- ### Sidedrawer.Item
63
-
64
- Sidedrawer exposes `Item` component to build a navigation elements.
65
- `Sidedrawer.Item` is renderes as a `link` or a `button` depends on passed props.
66
-
67
- - `href` prop determine a link render
68
- - `onClick` prop determines a button render
69
-
70
- **Link item:**
71
-
72
- ```tsx
73
- <Sidedrawer.Item href={'/'}>
74
- <Icon is={Apps} css={{ mr: '$2' }} />
75
- Dashboard
76
- </Sidedrawer.Item>
77
- ```
78
-
79
- **Button item:**
80
-
81
- ```tsx
82
- <Sidedrawer.Item onClick={logout}>
83
- <Icon is={Exit} css={{ mr: '$2' }} />
84
- Log out
85
- </Sidedrawer.Item>
86
- ```
87
-
88
- ### Sidedrawer.Accordion
89
-
90
- **Accordion item:**
91
-
92
- Accordion item requires few elements to work properly:
93
-
94
- - `value` property is a unique identifier needed to expand accordion content. [read more](https://www.radix-ui.com/docs/primitives/components/accordion#item)
95
- - `Sidedrawer.AccordionTrigger` - This component is a trigger which expand/collapse Accordion content. You can pass a text or components composition as its children.
96
- - `Sidedrawer.AccordionContent` - This component contains whole accorion content. Most likely you would like to pass few another `Sidedrawer.Item` items inside. Accordion content is collapsed until you click the `Sidedrawer.AccordionTrigger` to expand it.
97
-
98
- ```tsx
99
- <Sidedrawer.Accordion value="your_unique_identifier">
100
- <Sidedrawer.AccordionTrigger>
101
- <Icon is={New} css={{ mr: '$2' }} />
102
- Set work
103
- </Sidedrawer.AccordionTrigger>
104
- <Sidedrawer.AccordionContent>
105
- <Sidedrawer.Item href={'/practice'}>
106
- <Icon is={Feed} css={{ mr: '$2' }} />
107
- Practice
108
- </Sidedrawer.Item>
109
- <Sidedrawer.Item href={'/test'}>
110
- <Icon is={Inbox} css={{ mr: '$2' }} />
111
- Test
112
- </Sidedrawer.Item>
113
- </Sidedrawer.AccordionContent>
114
- </Sidedrawer.Accordion>
115
- ```
116
-
117
- ## Whole Sidedrawer components composition
118
-
119
- ```tsx preview
120
- <Sidedrawer>
121
- <Sidedrawer.Trigger asChild>
122
- <Button>Open the Sidedrawer</Button>
123
- </Sidedrawer.Trigger>
124
- <Sidedrawer.Content>
125
- <Sidedrawer.Header>
126
- <Sidedrawer.Close />
127
- <TopBar.BrandLogo
128
- src={'https://atomlearning.co.uk/_next/static/media/logo.e9276284.svg'}
129
- />
130
- </Sidedrawer.Header>
131
- <Sidedrawer.Body>
132
- <Sidedrawer.Item href={'/'} active>
133
- Dashboard
134
- </Sidedrawer.Item>
135
- <Sidedrawer.Accordion value="1" disabled>
136
- <Sidedrawer.AccordionTrigger>Set work</Sidedrawer.AccordionTrigger>
137
- <Sidedrawer.AccordionContent>
138
- <Sidedrawer.Item href={'/'}>Set Practice</Sidedrawer.Item>
139
- <Sidedrawer.Item href={'/'}>Mock Tests</Sidedrawer.Item>
140
- </Sidedrawer.AccordionContent>
141
- </Sidedrawer.Accordion>
142
- <Sidedrawer.Accordion value="2">
143
- <Sidedrawer.AccordionTrigger>Resources</Sidedrawer.AccordionTrigger>
144
- <Sidedrawer.AccordionContent>
145
- <Sidedrawer.Item onClick={() => console.log('clicked!')}>
146
- I am a button
147
- </Sidedrawer.Item>
148
- <Sidedrawer.Item href="/">I am a link</Sidedrawer.Item>
149
- </Sidedrawer.AccordionContent>
150
- </Sidedrawer.Accordion>
151
- </Sidedrawer.Body>
152
- <Sidedrawer.Footer>The footer content</Sidedrawer.Footer>
153
- </Sidedrawer.Content>
154
- </Sidedrawer>
155
- ```
@@ -1,117 +0,0 @@
1
- ---
2
- title: Slider
3
- component: Slider, Slider.Value, Slider.Steps
4
- description: The slider component implements the Slider component from Radix, with default styling and the CSS prop.
5
- category: Form primitives
6
- ---
7
-
8
- The `Slider` is a simple component that renders a form slider.
9
-
10
- The `Slider` component should be rendered with a label for accesibility reasons. Rather than using the `Slider` component directly, it is best to use the `SliderField` component, which provides a field label, a value label, and easily integrates with the `Form` component.
11
-
12
- Should you wish to create a more complex UI with `Field` components, you should use this base component.
13
-
14
- Please note: the `value` or `defaultValue` passed in should always be an array.
15
-
16
- ```tsx preview
17
- <Slider defaultValue={[50]} css={{ width: '320px' }} />
18
- ```
19
-
20
- ## Multiple Values
21
-
22
- Should you wish to have more than one control on the slider, you can pass those values in the array.
23
-
24
- ```tsx preview
25
- <Slider defaultValue={[25, 75]} css={{ width: '320px' }} />
26
- ```
27
-
28
- ## Slider.Steps
29
-
30
- A separate component exists to output an array of labels which appear at given value points along the slider. These are passed in to the `steps` property using an array objects that contain a label and a value.
31
-
32
- This is most commonly used within the `SliderField`, but is here in case you need to compose your own complex component.
33
-
34
- Note: it is likely better to create steps as a constant and pass in with `steps={steps}` or similar, but this preview code cannot see values outside of JSX.
35
-
36
- ```tsx preview
37
- <Slider defaultValue={[50]} css={{ width: '320px' }}>
38
- <Slider.Steps
39
- min={0}
40
- max={100}
41
- steps={[
42
- { value: 0, label: 'min' },
43
- { value: 50, label: 'mid' },
44
- { value: 100, label: 'max' }
45
- ]}
46
- />
47
- </Slider>
48
- ```
49
-
50
- The component requires min and max values, these should be the same as the optional values that are passed to the Slider component.
51
-
52
- `Slider.Steps` work well with the built in `step` property, which defaults to 1 and changes the size of each movement. For example, this would limit the slider to three values only.
53
-
54
- ```tsx
55
- <Slider defaultValue={[50]} min={10} max={20} step={5}>
56
- <Slider.Steps
57
- min={10}
58
- max={20}
59
- steps={[
60
- { value: 10, label: 'min' },
61
- { value: 15, label: 'mid' },
62
- { value: 20, label: 'max' }
63
- ]}
64
- />
65
- </Slider>
66
- ```
67
-
68
- ## Slider.Value
69
-
70
- A separate component exists to output the value from a slider. This is most commonly used within the `SliderField`, but is here in case you need to compose your own complex component.
71
-
72
- ```tsx preview
73
- <Slider defaultValue={[50]} css={{ width: '320px' }}>
74
- {/**
75
- * The Slider.Value value must be manually controlled using onValueChange
76
- * from Slider. This is a visual example of how would render Slider.Value
77
- * and will not update when changed.
78
- */}
79
- <Slider.Value value={[50]} />
80
- </Slider>
81
- ```
82
-
83
- By default this simply outputs the value, however, this can be customised in a number of ways. The property `outputLabel` accepts a function that passes the value selected in the slider and expects a string returned for the label.
84
-
85
- You can also use this is in more complex ways, for example to set empty states and pluralisation, like below.
86
-
87
- ```tsx
88
- <Slider defaultValue={[50]} css={{ width: '320px' }}>
89
- <Slider.Value
90
- value={[50]}
91
- outputLabel={(value) =>
92
- value === 0
93
- ? 'You have no geese'
94
- : `You have ${value} ${value === 1 ? 'goose' : 'geese'}`
95
- }
96
- />
97
- </Slider>
98
- ```
99
-
100
- Should you wish to use the label with multiple values, you can use `Array.join()` like below.
101
-
102
- ```tsx
103
- <Slider.Value
104
- value={[25, 75]}
105
- outputLabel={(value) => `You have between ${value.join(' and ')} geese`}
106
- />
107
- ```
108
-
109
- ## Styling
110
-
111
- Depending on the background of your page, you can change the theme of the track to be either light or tonal using `theme="light"`. Default is `theme="tonal"`.
112
-
113
- ```tsx preview
114
- <Box css={{ p: '$5', bg: '$tonal100' }}>
115
- <Slider theme="light" defaultValue={[50]} css={{ width: '320px' }} />
116
- </Box>
117
- ```
@@ -1,35 +0,0 @@
1
- ---
2
- title: Slider Field
3
- component: SliderField
4
- description: Combines a Slider with a label and form integration.
5
- category: Form fields
6
- ---
7
-
8
- `SliderField` renders a `Slider` with a label, and easy implementation with `Form`. It also renders a `Slider.Value` label underneath the slider, and a `Slider.Steps` component should steps be passed in.
9
-
10
- In it's most simple form, a slider allows one value to be set between two given values (default 0 and 100).
11
-
12
- Please note: the `value` or `defaultValue` passed in should always be an array.
13
-
14
- ```tsx preview
15
- <Form>
16
- <SliderField name="slider" label="Select a value" defaultValue={[50]} />
17
- </Form>
18
- ```
19
-
20
- With optional `Slider.Steps`:
21
-
22
- ```tsx preview
23
- <Form>
24
- <SliderField
25
- name="slider"
26
- label="Select a value (now with steps)"
27
- defaultValue={[50]}
28
- steps={[
29
- { value: 0, label: 'min' },
30
- { value: 50, label: 'mid' },
31
- { value: 100, label: 'max' }
32
- ]}
33
- />
34
- </Form>
35
- ```
@@ -1,24 +0,0 @@
1
- ---
2
- title: Stack
3
- component: Stack
4
- description: Stack is a layout component that provides an abstraction over the flexbox gap property
5
- category: Layout
6
- ---
7
-
8
- `Stack` is a single axis layout component enabling you to space items evenly within it using the `gap` prop and change the direction of content with `direction`. In an ideal world this component would be redundant as `gap` would be widely supported when used with `display: flex`; unfortunately browser support [isn’t great](https://caniuse.com/flexbox-gap) with Safari being the last major browser yet to implement it. `@supports()` would usually enable us to progressively enable this property but there’s no way to test when it’s used alongside flexbox, as `gap` is also used in `display: grid`. Until we gain greater browser support, this `Stack` component should provide a similar output.
9
-
10
- ```tsx preview
11
- <Stack gap="2" direction="column">
12
- <Box css={{ bg: '$primary', size: '$5' }} />
13
- <Box css={{ bg: '$primary', size: '$5' }} />
14
- <Box css={{ bg: '$primary', size: '$5' }} />
15
- </Stack>
16
- ```
17
-
18
- ```tsx preview
19
- <Stack gap="2" direction="row">
20
- <Box css={{ bg: '$primary', size: '$5' }} />
21
- <Box css={{ bg: '$primary', size: '$5' }} />
22
- <Box css={{ bg: '$primary', size: '$5' }} />
23
- </Stack>
24
- ```
@@ -1,32 +0,0 @@
1
- ---
2
- title: Stack Content
3
- component: StackContent
4
- description: A layout component to provide internal spacing between content components
5
- category: Layout
6
- ---
7
-
8
- `StackContent` applies an opinionated set of spacing rules around our content components, `Heading`, `Text`, `List`, `Divider` and `Image`. It also applies a maximum width to `Heading`, `Text` and `List` to ensure optimal line length is preserved for readability.
9
-
10
- ```tsx preview
11
- <StackContent>
12
- <Heading size="sm">This is an example of how the content is spaced</Heading>
13
- <Text>
14
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
15
- tempor incididunt ut labore et dolore magna aliqua.
16
- </Text>
17
- <List>
18
- <List.Item>
19
- Ullamco laboris nisi ut aliquip ex ea commodo consequat.
20
- </List.Item>
21
- <List.Item>
22
- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
23
- dolore eu fugiat nulla pariatur.
24
- </List.Item>
25
- </List>
26
- <Divider />
27
- <Text>
28
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
29
- tempor incididunt ut labore et dolore magna aliqua.
30
- </Text>
31
- </StackContent>
32
- ```