@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,25 +0,0 @@
1
- ---
2
- title: Tooltip
3
- component: Tooltip,Tooltip.Trigger,Tooltip.Content,Tooltip.Provider, Tooltip.Portal
4
- description: A component that displays information related to an element when the element receives keyboard focus or the mouse hovers over it
5
- category: Surfaces
6
- ---
7
-
8
- `Tooltip` exports 4 components that combine to create our tooltip. The `Tooltip.Trigger` requires a React component child (or passed to `as`) to allow the necessary event bindings and accessible properties to be cloned.
9
-
10
- Also, note that the component must accept a `ref`.
11
-
12
- `Tooltip.Provider` is **required to avoid regressions** and should be included at the root level of the application.
13
-
14
- Read more about the underlying UI component on the [Radix UI documentation site](https://radix-ui.com/primitives/docs/components/tooltip).
15
-
16
- ```tsx preview
17
- <Tooltip.Provider>
18
- <Tooltip>
19
- <Tooltip.Trigger>
20
- <Text>Hover on me</Text>
21
- </Tooltip.Trigger>
22
- <Tooltip.Content>This is the tooltip content, hello</Tooltip.Content>
23
- </Tooltip>
24
- </Tooltip.Provider>
25
- ```
@@ -1,95 +0,0 @@
1
- ---
2
- title: TopBar
3
- component: TopBar,TopBar.Brand,TopBar.BrandLogo,TopBar.BrandText,TopBar.ActionIcon
4
- description: The top bar provides content and actions related to the current screen. It is used for branding, screen titles, navigation, and actions.
5
- category: Surfaces
6
- ---
7
-
8
- `TopBar` exports components that combine to form the elements that you would expect to commonly see in a TopBar. However, the `TopBar` is not limited to these components, as any components may sit within the `TopBar` to create a flexible and custom UI.
9
-
10
- By default, `TopBar` uses a flex layout with flex items placed immediately after each other. To align flex items, an optional css prop with `justifyContent` can be passed.
11
-
12
- Alternatively, if you want to avoid wrapping groups of items with a `div` purely for alignment purposes, you could use a spacer. In this example, the styling of the `Flex` component has been extended so that it stretches to fill the available space.
13
-
14
- ```tsx preview
15
- <TopBar>
16
- <TopBar.Brand href="atomlearning.co.uk">
17
- <TopBar.BrandName>Admin Panel</TopBar.BrandName>
18
- </TopBar.Brand>
19
- <Flex css={{ flex: 1, justifySelf: 'stretch', alignSelf: 'stretch' }} />
20
- <Stack gap="2" direction="row">
21
- <TopBar.ActionIcon icon={Search} label="Search" />
22
- <TopBar.Divider />
23
- <TopBar.ActionIcon icon={SwitchOff} label="Light/Dark mode" />
24
- </Stack>
25
- </TopBar>
26
- ```
27
-
28
- ## TopBar Size Variant
29
-
30
- TopBar has a default size of `md` which means that the default height of the component is 64px and the `Topbar.BrandLogo` is 24px.
31
-
32
- ```tsx preview
33
- <TopBar>
34
- <TopBar.Brand href="atomlearning.co.uk">
35
- <TopBar.BrandLogo
36
- src={
37
- 'https://space-1.atomlearning.com/static/f61e49cfb245016e612a34818e27dcfb.svg'
38
- }
39
- />
40
- </TopBar.Brand>
41
- </TopBar>
42
- ```
43
-
44
- If size `lg` is passed to the `TopBar` it will be 96px in height and the `TopBar.BrandLogo` will be 32px in height.
45
-
46
- ```tsx preview
47
- <TopBar size="lg">
48
- <TopBar.Brand href="atomlearning.co.uk">
49
- <TopBar.BrandLogo
50
- src={
51
- 'https://space-1.atomlearning.com/static/f61e49cfb245016e612a34818e27dcfb.svg'
52
- }
53
- />
54
- </TopBar.Brand>
55
- </TopBar>
56
- ```
57
-
58
- ## TopBar.Brand
59
-
60
- `TopBar.Brand` renders a styled link.
61
-
62
- ```tsx
63
- // You'll import the logo like this in practice, but it doesn't work
64
- // in these previews
65
- // import logo from '@atom-learning/theme/lib/assets/logo.svg'
66
-
67
- const App = () => {
68
- return (
69
- <TopBar>
70
- <TopBar.Brand href="atomlearning.co.uk">
71
- <TopBar.BrandLogo
72
- src={
73
- 'https://space-1.atomlearning.com/static/f61e49cfb245016e612a34818e27dcfb.svg'
74
- }
75
- />
76
- <TopBar.BrandName>Admin Panel</TopBar.BrandName>
77
- </TopBar.Brand>
78
- </TopBar>
79
- )
80
- }
81
- ```
82
-
83
- ## TopBar.BrandLogo
84
-
85
- `TopBar.BrandLogo` renders an image with set styles and is primarily intended for the Atom logo.
86
-
87
- ## TopBar.BrandName
88
-
89
- `TopBar.BrandName` renders a `Text` component with set styles and is primarily intended to display the name of the current app.
90
-
91
- ## TopBar.ActionIcon
92
-
93
- `TopBar.ActionIcon` extends the base `ActionIcon` component with set props.
94
-
95
- Note that instead of needing to include a seperate `Icon` component as children, an icon can be passed directly to this component as a prop.
@@ -1,12 +0,0 @@
1
- ---
2
- title: Video
3
- component: Video
4
- description: Video component supports playing Vimeo hosted videos
5
- category: Media
6
- ---
7
-
8
- The `Video` component supports playing Vimeo hosted videos by setting the `id`.
9
-
10
- ```tsx preview
11
- <Video id="453650357" />
12
- ```
@@ -1,67 +0,0 @@
1
- ---
2
- title: Accessibility
3
- description: We aim to adhere to strict accessibility standards with AA as the minimum
4
- category: Overview
5
- priority: 4
6
- ---
7
-
8
- We have configured a few tools to help automate some accessibility testing but these tests are only valid with the context they are testing on, so they can't guarantee that a component is fully accessible. Manual testing is always required along with design validation.
9
-
10
- To enable this, `eslint-plugin-jsx-a11y` is set to strict mode. Different tools are used to validate the components as each serves a different purpose. The accessibility unit tests will fail the pipeline and prevent releasing inaccessible components.
11
-
12
- Before contributing to the codebase, please take some time to read the following sections and the reading provided.
13
-
14
- ## Things to consider whilst developing
15
-
16
- - Add unit tests to test accessibility
17
-
18
- > Add an accessibility unit test (using the `jest-axe` package) to ensure that the components’ different variations or functionality don't have any accessibility issues. Example:
19
-
20
- ```tsx
21
- it('has no programmatically detectable a11y issues', async () => {
22
- const { container } = render(<Component />)
23
- expect(await axe(container)).toHaveNoViolations()
24
- })
25
-
26
- // or
27
-
28
- it('has no programmatically detectable a11y issues', async () => {
29
- render(<Flex />, document.body)
30
- const results = await axe(document.body)
31
- expect(results).toHaveNoViolations()
32
- })
33
- ```
34
-
35
- _Note:_ `axe` doesn't catch contrast issues when run on `jsdom` which `jest` is using.
36
-
37
- - Using `React.Fragment` where possible to avoid adding extra `<div>`
38
-
39
- > Sometimes we break HTML semantics when we add `<div>` elements to our JSX to make our React code work, especially when working with lists (`<ol>`, `<ul>` and `<dl>`) and the HTML `<table>`. In these cases we should rather use React Fragments to group together multiple elements. for examples please look at the [React documentation](https://reactjs.org/docs/accessibility.html)
40
-
41
- - Using the React Testing Library rules into adopting a user-centric testing an approach. [Priority](https://testing-library.com/docs/queries/about/#priority)
42
- - Test real interactions
43
- - Verify the perceivable results
44
- - Always validating any concerns with the design team
45
- - Manually test complex components for keyboard navigation
46
-
47
- ## Things to consider whilst consuming the library
48
-
49
- As mentioned above, accessibility testing is heavily reliant on the context, so when using the Design System in an app, please consider the following:
50
-
51
- - Testing the components for accessibility in the context of where they are used
52
- - Testing the entire page for at least the following:
53
- - contrast issues
54
- - keyboard navigation
55
- - autofocus
56
- - general accesibility issues
57
- - Always raising concerns to the design team
58
-
59
- ## Reading list
60
-
61
- - [Axe-core rules](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md)
62
- - [Accessibility](https://reactjs.org/docs/accessibility.html)
63
- - [React Library Testing - priority](https://testing-library.com/docs/queries/about/#priority)
64
- - [Testing Accessibility](https://www.24a11y.com/2017/writing-automated-tests-accessibility/)
65
- - [Debunking the Myth: Accessibility and React](https://www.deque.com/blog/debunking-the-myth-accessibility-and-react/)
66
- - [Accessibility auditing with react-axe and eslint-plugin-jsx-a11y](https://web.dev/accessibility-auditing-react/)
67
- - [jest-axe](https://github.com/nickcolley/jest-axe#testing-react-with-react-testing-library)
@@ -1,77 +0,0 @@
1
- ---
2
- title: Core concepts
3
- description: Our component library is underpinned by concepts that help with component composition, encapsulated styling and consistent UI
4
- category: Overview
5
- priority: 2
6
- ---
7
-
8
- These components are intended to provide an abstraction over HTML elements and native components, providing an interface to ease creation of user interfaces in React. This library isn't comprehensive, but it should provide enough primitive, low-level components to be able to easily create pages, layouts, content, forms, as well as using them to compose more complex components with additional logic.
9
-
10
- Each component in the design system is built from a `styled()` function and this gives them access to some common props, `as` and `css`.
11
-
12
- ## Semantic elements with `as`
13
-
14
- To apply the correct semantic element to one of our components, you can use `as` and pass in a string HTML element. For example, when using the `Heading` component you can pass in `h3` to use that element.
15
-
16
- ```tsx
17
- <Heading as="h3">Hello World</Heading>
18
- ```
19
-
20
- ```html
21
- <h3>Hello World</h3>
22
- ```
23
-
24
- Some components have a restricted set of valid elements to pass into `as`, for example, `Heading` only allows `h1` through to `h6`, and some components remove the ability to change the HTML element altogether, like `<Select />` or `<Icon />` which require a certain element to work correctly, or `<InputField />` which renders multiple elements. Each of these restrictions are detailed on the component documentation under `API Reference`.
25
-
26
- Abstracting the underlying HTML from the component is beneficial as it allows us to control the document outline whilst preserving the ability to use a visually distinct style. This is often the case with container elements where you need to render a `section`, `aside`, `nav` or `main`, but still utilise a particular styled component, e.g. `<Panel as="aside" />`
27
-
28
- ## Contextual styling with `css`
29
-
30
- The `css` prop is available on all of our components to allow you to style them. You can pass in an object of CSS key value pairs and the component will apply those styles as a class on the rendered component.
31
-
32
- The benefit of using the `css` prop as opposed to writing inline styles is that we can directly access values from our design tokens, write responsive styles, and use practical shorthand utilities for applying style.
33
-
34
- An additional benefit is that we can apply context specific styles to the component only when necessary and avoid the problem of assuming usage and intent when authoring the components. Adding styles to a component that may affect surrounding components is a side-effect, and our aim should always be to avoid adding side-effects to our encapsulated, reusable components.
35
-
36
- ```tsx
37
- <Box
38
- css={{
39
- // we can write standard CSS here
40
- fontFamily: 'Arial',
41
- color: 'red',
42
-
43
- // we can also access design tokens
44
- backgroundColor: '$primary',
45
- padding: '$3',
46
-
47
- // utilise shorthand utilities
48
- mb: '$3',
49
- size: 30
50
-
51
- // and write responsive styles
52
- '@lg': {
53
- color: 'blue'
54
- },
55
- '@media (prefers-color-scheme: dark)': {
56
- color: 'white'
57
- }
58
- }}
59
- />
60
- ```
61
-
62
- There are multiple cases where a component returns more than one element, in which case the `css` prop only applies to the containing element.
63
-
64
- `@atom-learning/components` also exports the underlying `styled()` function that was used to create these components, refer to the [Stitches page](/components/stitches) to read more about the difference between `css` and `styled()`. You can also read more about our shorthand utilities and other default configuration options.
65
-
66
- ## Consistency with design tokens
67
-
68
- To quote the [React UI](https://react-ui.dev/core-concepts/constraints-based-design) docs:
69
-
70
- > At the core of every high quality interface, is a set of constraints that help in creating a level of consistency and quality. Constraints help build consistent features at a faster pace by moving the decisions into reusable patterns.
71
-
72
- These constraints are baked into our design tokens and represent design decisions that encorporate spacing, sizing, colours and typography. [Stitches](https://stitches.dev) uses the [System UI](https://system-ui.com/theme/) theme specification to map these values to their corresponding CSS property. You can read more about this and see the full token set by referring to the [tokens reference](/theme/tokens).
73
-
74
- As a quick example, our tokens come in two main forms, values and scales:
75
-
76
- - For a layout property like `padding` or `margin`, the token represents the nth value on the spacing scale, e.g. `padding: '$2'` will render `padding: '8px'`.
77
- - For a property like `color`, it will look up the colors tokens and will use the value directly, e.g. `color: '$warning'` will render `color: 'hsl(24, 100%, 55%)'`.
@@ -1,33 +0,0 @@
1
- ---
2
- title: Introduction
3
- description: Atom Learning’s component library is a collection of generic React components built using stitches, including components that cover layout, content, data collection, media and a host of other UI concerns
4
- category: Overview
5
- priority: 1
6
- ---
7
-
8
- ## Getting started
9
-
10
- Install the three packages to gain access to the components, icons and design tokens.
11
-
12
- ```bash
13
- yarn add @atom-learning/components @atom-learning/icons @atom-learning/theme
14
- ```
15
-
16
- All components are available as named exports from `@atom-learning/components`, and icons as named exports from `@atom-learning/icons`. The theme is consumed automatically by `@atom-learning/components` to provide the relevant token references for the `css` prop and `styled` function.
17
-
18
- ```tsx
19
- import { ChevronRight } from '@atom-learning/icons'
20
- import { Box, Heading, Icon, Text } from '@atom-learning/components'
21
-
22
- const Component = () => (
23
- <Box as="article">
24
- <Heading css={{ mb: '$3' }}>
25
- <Icon is={ChevronRight} css={{ mr: '$2' }} />
26
- This is a heading
27
- </Heading>
28
- <Text>This is a paragraph of text</Text>
29
- </Box>
30
- )
31
- ```
32
-
33
- Refer to the individual component documentation for recommended usage and API references for each component, as well as the theme documentation to understand the design token usage.
@@ -1,40 +0,0 @@
1
- ---
2
- title: Versioning
3
- description: The project follows the SemVer standard to make using the library easy
4
- category: Overview
5
- priority: 5
6
- ---
7
-
8
- SemVer uses the `MAJOR`.`MINOR`.`PATCH` notation to identify changes with `MAJOR` representing breaking changes that are not backwards compatible, `MINOR` representing new features / non-breaking additions and `PATCH` representing fixes.
9
-
10
- It is also a requirement to use [Semantic commits](https://www.conventionalcommits.org/en/v1.0.0/) as each tag will translate to a different type of version upgrade. For example:
11
-
12
- - `fix` for bug fixes (patch version)
13
- - `perf` for performance improvements (patch version)
14
- - `feat` for new features (minor version)
15
-
16
- Other subjects (such as `chore`) will not cause a new release **unless** the commit footer starts with `BREAKING CHANGE:` (followed by an explanation of the breaking change).
17
-
18
- Commits that introduce a breaking change should start with `feat!:` and include the `BREAKING CHANGE:` footer. Breaking changes will cause a major version increase.
19
-
20
- _Note:_ The `precommit` hooks will prevent commits that don’t have the required tag prefixed to the message
21
-
22
- Versioning happens automatically when a feature branch gets merged into `main`. [semantic-release](https://github.com/semantic-release/semantic-release) is employed to calculate the new version number by running through all the new commits and their commit message tag. Once the new version is calculated, it updates the package.json and automatically updates the `CHANGELOG.md`. Then it proceeds to publish the new version both in `GitHub` and `npm`.
23
-
24
- _Note:_ Once a branch gets merged into `main`, it is automatically published, therefore `main` always needs to be in a pristine state. For that reason, following the [GitFlow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow) model, all work needs to happen into a branch, and `main` is locked
25
-
26
- ## Purpose
27
-
28
- - To ensure that each version is marked clearly and can be consumed without any issues
29
- - To reduce the amount of manual effort required to publish a new version
30
- - To help enforce the selected standards and frameworks, and reduce the room for human error
31
-
32
- ## Tools
33
-
34
- - [Semantic-release](https://github.com/semantic-release/semantic-release)
35
- - Plugins:
36
- - `@semantic-release/commit-analyzer` - checks commits messages for the required tags
37
- - `@semantic-release/release-notes-generator` - creates/updates the release notes
38
- - `@semantic-release/npm` - publishes version to `npm`
39
- - `@semantic-release/github` - publishes version to `GitHub Releases`
40
- - `husky` - precommit hook to prevent incomplete commit messages
@@ -1,201 +0,0 @@
1
- import * as React from 'react';
2
- import { bases, accents } from './stitches.colorscheme.config';
3
- declare type TColorSchemeOwnProps = {
4
- base?: keyof typeof bases;
5
- accent?: keyof typeof accents;
6
- interactive?: 'loContrast1' | 'loContrast2' | 'hiContrast1' | 'hiContrast2';
7
- asChild?: boolean;
8
- };
9
- declare const StyledColorScheme: import("@stitches/react/types/styled-component").StyledComponent<"div", {}, {
10
- sm: string;
11
- md: string;
12
- lg: string;
13
- xl: string;
14
- reducedMotion: string;
15
- allowMotion: string;
16
- hover: string;
17
- }, import("@stitches/react/types/css-util").CSS<{
18
- sm: string;
19
- md: string;
20
- lg: string;
21
- xl: string;
22
- reducedMotion: string;
23
- allowMotion: string;
24
- hover: string;
25
- }, {
26
- colors: {
27
- slate1: any;
28
- slate2: any;
29
- slate3: any;
30
- slate4: any;
31
- slate5: any;
32
- slate6: any;
33
- slate7: any;
34
- slate8: any;
35
- slate9: any;
36
- slate10: any;
37
- blue1: any;
38
- blue2: any;
39
- blue3: any;
40
- blue4: any;
41
- blue5: any;
42
- blue6: any;
43
- blue7: any;
44
- blue8: any;
45
- blue9: any;
46
- blue10: any;
47
- background: any;
48
- foreground: any;
49
- foreground6plus: any;
50
- };
51
- }, import("@stitches/react/types/config").DefaultThemeMap, {
52
- bg: (value: {
53
- readonly [$$PropertyValue]: "background";
54
- }) => {
55
- background: {
56
- readonly [$$PropertyValue]: "background";
57
- };
58
- };
59
- inset: (value: string | number | {
60
- readonly [$$ScaleValue]: "space";
61
- }) => {
62
- top: string | number | {
63
- readonly [$$ScaleValue]: "space";
64
- };
65
- right: string | number | {
66
- readonly [$$ScaleValue]: "space";
67
- };
68
- bottom: string | number | {
69
- readonly [$$ScaleValue]: "space";
70
- };
71
- left: string | number | {
72
- readonly [$$ScaleValue]: "space";
73
- };
74
- };
75
- size: (value: string | number | {
76
- readonly [$$ScaleValue]: "size";
77
- }) => {
78
- height: string | number | {
79
- readonly [$$ScaleValue]: "size";
80
- };
81
- width: string | number | {
82
- readonly [$$ScaleValue]: "size";
83
- };
84
- };
85
- p: (value: string | number | {
86
- readonly [$$ScaleValue]: "space";
87
- }) => {
88
- padding: string | number | {
89
- readonly [$$ScaleValue]: "space";
90
- };
91
- };
92
- pt: (value: string | number | {
93
- readonly [$$ScaleValue]: "space";
94
- }) => {
95
- paddingTop: string | number | {
96
- readonly [$$ScaleValue]: "space";
97
- };
98
- };
99
- pr: (value: string | number | {
100
- readonly [$$ScaleValue]: "space";
101
- }) => {
102
- paddingRight: string | number | {
103
- readonly [$$ScaleValue]: "space";
104
- };
105
- };
106
- pb: (value: string | number | {
107
- readonly [$$ScaleValue]: "space";
108
- }) => {
109
- paddingBottom: string | number | {
110
- readonly [$$ScaleValue]: "space";
111
- };
112
- };
113
- pl: (value: string | number | {
114
- readonly [$$ScaleValue]: "space";
115
- }) => {
116
- paddingLeft: string | number | {
117
- readonly [$$ScaleValue]: "space";
118
- };
119
- };
120
- px: (value: string | number | {
121
- readonly [$$ScaleValue]: "space";
122
- }) => {
123
- paddingLeft: string | number | {
124
- readonly [$$ScaleValue]: "space";
125
- };
126
- paddingRight: string | number | {
127
- readonly [$$ScaleValue]: "space";
128
- };
129
- };
130
- py: (value: string | number | {
131
- readonly [$$ScaleValue]: "space";
132
- }) => {
133
- paddingTop: string | number | {
134
- readonly [$$ScaleValue]: "space";
135
- };
136
- paddingBottom: string | number | {
137
- readonly [$$ScaleValue]: "space";
138
- };
139
- };
140
- m: (value: string | number | {
141
- readonly [$$ScaleValue]: "space";
142
- }) => {
143
- margin: string | number | {
144
- readonly [$$ScaleValue]: "space";
145
- };
146
- };
147
- mt: (value: string | number | {
148
- readonly [$$ScaleValue]: "space";
149
- }) => {
150
- marginTop: string | number | {
151
- readonly [$$ScaleValue]: "space";
152
- };
153
- };
154
- mr: (value: string | number | {
155
- readonly [$$ScaleValue]: "space";
156
- }) => {
157
- marginRight: string | number | {
158
- readonly [$$ScaleValue]: "space";
159
- };
160
- };
161
- mb: (value: string | number | {
162
- readonly [$$ScaleValue]: "space";
163
- }) => {
164
- marginBottom: string | number | {
165
- readonly [$$ScaleValue]: "space";
166
- };
167
- };
168
- ml: (value: string | number | {
169
- readonly [$$ScaleValue]: "space";
170
- }) => {
171
- marginLeft: string | number | {
172
- readonly [$$ScaleValue]: "space";
173
- };
174
- };
175
- mx: (value: string | number | {
176
- readonly [$$ScaleValue]: "space";
177
- }) => {
178
- marginLeft: string | number | {
179
- readonly [$$ScaleValue]: "space";
180
- };
181
- marginRight: string | number | {
182
- readonly [$$ScaleValue]: "space";
183
- };
184
- };
185
- my: (value: string | number | {
186
- readonly [$$ScaleValue]: "space";
187
- }) => {
188
- marginTop: string | number | {
189
- readonly [$$ScaleValue]: "space";
190
- };
191
- marginBottom: string | number | {
192
- readonly [$$ScaleValue]: "space";
193
- };
194
- };
195
- }>>;
196
- declare type TColorSchemeProps = React.ComponentProps<typeof StyledColorScheme> & TColorSchemeOwnProps;
197
- /**
198
- * @experimental Component has not been finalised. Further design input required. Use with caution.
199
- */
200
- export declare const ColorScheme: React.ForwardRefExoticComponent<Pick<TColorSchemeProps, "css" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | keyof TColorSchemeOwnProps> & React.RefAttributes<HTMLDivElement>>;
201
- export {};
@@ -1 +0,0 @@
1
- import*as o from"react";import{styled as f,colorSchemes as e}from"./stitches.colorscheme.config.js";import{Slot as d}from"@radix-ui/react-slot";const p=f("div"),t=o.forwardRef(({base:r="",accent:a="",interactive:c="",className:m,asChild:s=!1,...i},l)=>{const n=[m,e[`interactive-${c}`],e[`accent-${a}`],e[`base-${r}`]].filter(Boolean).join(" ");return o.createElement(s?d:p,{ref:l,className:n,...i})});t.displayName="ColorScheme";export{t as ColorScheme};
@@ -1 +0,0 @@
1
- var e="#F3F8FF",l="#E5F1FF",u="#D6EAFF",b="#C2DEFF",F="#B3D4FA",a="#057AFF",r="#0F67F5",v="#194DCC",D="#102DA3",A="#15235E",E={blue1:e,blue2:l,blue3:u,blue4:b,blue5:F,blue6:a,blue7:r,blue8:v,blue9:D,blue10:A};export{e as blue1,A as blue10,l as blue2,u as blue3,b as blue4,F as blue5,a as blue6,r as blue7,v as blue8,D as blue9,E as default};
@@ -1 +0,0 @@
1
- export declare const generateAlphaColors: (colorName: string, colors: Record<string, string>) => Record<string, string>;
@@ -1 +0,0 @@
1
- import{parseToRgba as u}from"color2k";const M=[255,255,255,1],r=[.05,.1,.15,.2,.27,.35,.5,.7,.8,.95],n=a=>Math.round(Math.max(Math.min(a,255),0)),$=(a,h)=>{const e={};return Object.entries(h).forEach(([f,i],o)=>{const[m,p,b]=u(i),[t,s,c]=M,g=[n((m-t)/r[o]+t),n((p-s)/r[o]+s),n((b-c)/r[o]+c),r[o]];e[`${a}A${o+1}`]=`rgba(${g.join(",")})`}),e};export{$ as generateAlphaColors};
@@ -1 +0,0 @@
1
- export { ColorScheme } from './ColorScheme';
@@ -1 +0,0 @@
1
- var a="#F6F6F6",e="#EBEBEB",t="#E0E0E0",l="#CECECE",s="#C2C2C2",r="#757575",v="#545454",C="#333333",E="#1F1F1F",F="#1C1C1C",B={slate1:a,slate2:e,slate3:t,slate4:l,slate5:s,slate6:r,slate7:v,slate8:C,slate9:E,slate10:F};export{B as default,a as slate1,F as slate10,e as slate2,t as slate3,l as slate4,s as slate5,r as slate6,v as slate7,C as slate8,E as slate9};