@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.
- package/dist/components/accordion/Accordion.d.ts +1 -266
- package/dist/components/accordion/AccordionContent.d.ts +1 -266
- package/dist/components/accordion/AccordionContent.js +1 -1
- package/dist/components/accordion/AccordionItem.d.ts +1 -266
- package/dist/components/accordion/AccordionItem.js +1 -1
- package/dist/components/accordion/AccordionTrigger.d.ts +2 -270
- package/dist/components/accordion/AccordionTrigger.js +1 -1
- package/dist/components/action-icon/ActionIcon.d.ts +1 -281
- package/dist/components/alert-dialog/AlertDialog.d.ts +1 -266
- package/dist/components/alert-dialog/AlertDialogContent.d.ts +1 -268
- package/dist/components/alert-dialog/alert-context/AlertDialog.d.ts +1 -1
- package/dist/components/avatar/Avatar.d.ts +2 -536
- package/dist/components/badge/Badge.d.ts +1 -534
- package/dist/components/box/Box.d.ts +1 -266
- package/dist/components/button/Button.d.ts +2 -283
- package/dist/components/calendar/Calendar.d.ts +1 -1
- package/dist/components/calendar/Day.d.ts +1 -270
- package/dist/components/carousel/Carousel.d.ts +1 -1
- package/dist/components/carousel/CarouselArrows.d.ts +1 -1
- package/dist/components/carousel/CarouselPagination.d.ts +1 -267
- package/dist/components/carousel/CarouselSlide.d.ts +1 -266
- package/dist/components/carousel/CarouselSlider.d.ts +1 -269
- package/dist/components/checkbox/Checkbox.d.ts +1 -269
- package/dist/components/checkbox-field/CheckboxField.d.ts +2 -2
- package/dist/components/chip/Chip.d.ts +5 -1879
- package/dist/components/chip/ChipGroup.d.ts +1 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.d.ts +2 -547
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupRoot.d.ts +1 -5
- package/dist/components/chip-toggle-group/ChipToggleGroupItem.d.ts +1 -546
- package/dist/components/chip-toggle-group/ChipToggleGroupRoot.d.ts +1 -562
- package/dist/components/combobox/Combobox.d.ts +1 -266
- package/dist/components/combobox/ComboboxInput.d.ts +1 -268
- package/dist/components/combobox/ComboboxList.d.ts +1 -266
- package/dist/components/combobox/ComboboxOption.d.ts +1 -266
- package/dist/components/combobox/ComboboxPopover.d.ts +1 -266
- package/dist/components/data-table/DataTableLoading.d.ts +1 -270
- package/dist/components/data-table/drag-and-drop/Handle.d.ts +1 -559
- package/dist/components/data-table/pagination/Pagination.d.ts +1 -266
- package/dist/components/data-table/pagination/PaginationButtons.d.ts +1 -1
- package/dist/components/date-field/DateField.d.ts +2 -2
- package/dist/components/dialog/Dialog.d.ts +1 -266
- package/dist/components/dialog/DialogBackground.d.ts +1 -531
- package/dist/components/dialog/DialogClose.d.ts +1 -267
- package/dist/components/dialog/DialogContent.d.ts +1 -268
- package/dist/components/dismissible-group/DismissibleGroupItem.d.ts +1 -1
- package/dist/components/dismissible-group/index.d.ts +1 -1
- package/dist/components/divider/Divider.d.ts +1 -268
- package/dist/components/dropdown-menu/DropdownMenu.d.ts +1 -266
- package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +1 -267
- package/dist/components/dropdown-menu/DropdownMenuItem.d.ts +1 -267
- package/dist/components/dropdown-menu/DropdownMenuSeparator.d.ts +1 -267
- package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +1 -267
- package/dist/components/empty-state/EmptyState.d.ts +1 -533
- package/dist/components/empty-state/EmptyStateBody.d.ts +1 -543
- package/dist/components/empty-state/EmptyStateImage.d.ts +2 -542
- package/dist/components/empty-state/EmptyStateTitle.d.ts +1 -268
- package/dist/components/field-wrapper/FieldDescription.d.ts +1 -1
- package/dist/components/field-wrapper/FieldWrapper.d.ts +2 -2
- package/dist/components/field-wrapper/InlineFieldWrapper.d.ts +1 -1
- package/dist/components/flex/Flex.d.ts +1 -266
- package/dist/components/form/Form.d.ts +1 -266
- package/dist/components/grid/Grid.d.ts +1 -268
- package/dist/components/heading/Heading.d.ts +2 -270
- package/dist/components/icon/Icon.d.ts +2 -269
- package/dist/components/image/Image.d.ts +2 -269
- package/dist/components/inline-message/InlineMessage.config.d.ts +1 -1
- package/dist/components/inline-message/InlineMessage.d.ts +1 -534
- package/dist/components/input/Input.d.ts +2 -270
- package/dist/components/input-field/InputField.d.ts +2 -2
- package/dist/components/label/Label.d.ts +2 -272
- package/dist/components/link/Link.d.ts +3 -271
- package/dist/components/list/List.d.ts +2 -537
- package/dist/components/loader/Loader.d.ts +1 -1
- package/dist/components/markdown-content/MarkdownContent.d.ts +1 -1
- package/dist/components/markdown-content/components/MarkdownEmphasis.d.ts +1 -266
- package/dist/components/markdown-content/components/MarkdownImage.d.ts +1 -1
- package/dist/components/markdown-content/components/MarkdownList.d.ts +1 -1
- package/dist/components/markdown-content/components/MarkdownThematicBreak.d.ts +1 -1
- package/dist/components/navigation/NavigationMenu.d.ts +1 -1
- package/dist/components/navigation/NavigationMenuDropdown.d.ts +1 -1
- package/dist/components/navigation/NavigationMenuDropdownItem.d.ts +4 -543
- package/dist/components/navigation/NavigationMenuLink.d.ts +1 -1
- package/dist/components/notification-badge/NotificationBadge.d.ts +1 -531
- package/dist/components/number-input/NumberInput.d.ts +1 -1
- package/dist/components/number-input-field/NumberInputField.d.ts +2 -2
- package/dist/components/password-field/PasswordField.d.ts +2 -2
- package/dist/components/password-input/PasswordInput.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -266
- package/dist/components/popover/PopoverContent.d.ts +1 -268
- package/dist/components/progress-bar/ProgressBar.d.ts +1 -269
- package/dist/components/radio-button/RadioButton.d.ts +2 -268
- package/dist/components/radio-button/RadioButtonGroup.d.ts +1 -270
- package/dist/components/radio-button-field/RadioButtonField.d.ts +2 -2
- package/dist/components/radio-button-field/RadioField.d.ts +3 -3
- package/dist/components/radio-card/RadioCard.d.ts +1 -271
- package/dist/components/radio-card/RadioCardGroup.d.ts +1 -1
- package/dist/components/search-field/SearchField.d.ts +2 -2
- package/dist/components/search-input/SearchInput.d.ts +2 -2
- package/dist/components/select/Select.d.ts +2 -270
- package/dist/components/select-field/SelectField.d.ts +2 -2
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionContent.d.ts +1 -266
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionItem.d.ts +1 -267
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionRoot.d.ts +1 -267
- package/dist/components/sidedrawer/SidedrawerAccordion/SidedrawerAccordionTrigger.d.ts +1 -268
- package/dist/components/sidedrawer/SidedrawerContent.d.ts +1 -266
- package/dist/components/sidedrawer/SidedrawerFooter.d.ts +1 -266
- package/dist/components/sidedrawer/SidedrawerHeader.d.ts +1 -266
- package/dist/components/sidedrawer/SidedrawerOverlay.d.ts +1 -267
- package/dist/components/sidedrawer/SidedrawerTrigger.d.ts +1 -267
- package/dist/components/slider/Slider.d.ts +1 -268
- package/dist/components/slider-field/SliderField.d.ts +3 -3
- package/dist/components/stack/Stack.d.ts +2 -273
- package/dist/components/stack-content/StackContent.d.ts +2 -267
- package/dist/components/stepper/StepperStepBullet.d.ts +1 -533
- package/dist/components/stepper/StepperStepContainer.d.ts +1 -536
- package/dist/components/stepper/StepperStepLabel.d.ts +1 -544
- package/dist/components/stepper/types.d.ts +1 -1
- package/dist/components/switch/Switch.d.ts +1 -267
- package/dist/components/table/Table.d.ts +1 -269
- package/dist/components/table/TableBody.d.ts +1 -268
- package/dist/components/table/TableCell.d.ts +1 -266
- package/dist/components/table/TableFooter.d.ts +1 -266
- package/dist/components/table/TableFooterCell.d.ts +1 -266
- package/dist/components/table/TableHeader.d.ts +1 -268
- package/dist/components/table/TableHeaderCell.d.ts +1 -266
- package/dist/components/table/TableRow.d.ts +2 -536
- package/dist/components/tabs/TabTrigger.d.ts +8 -0
- package/dist/components/tabs/TabTrigger.js +1 -0
- package/dist/components/tabs/Tabs.d.ts +7 -272
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/TabsTriggerList.d.ts +6 -270
- package/dist/components/tabs/TabsTriggerList.js +1 -1
- package/dist/components/tabs/utils.d.ts +2 -0
- package/dist/components/tabs/utils.js +1 -0
- package/dist/components/text/Text.d.ts +3 -271
- package/dist/components/textarea/Textarea.d.ts +1 -268
- package/dist/components/textarea-field/TextareaField.d.ts +2 -2
- package/dist/components/toast/Toast.d.ts +1 -268
- package/dist/components/toggle-group/ToggleGroupButton.d.ts +1 -534
- package/dist/components/toggle-group/ToggleGroupItem.d.ts +2 -534
- package/dist/components/toggle-group/ToggleGroupRoot.d.ts +1 -271
- package/dist/components/toggle-group/index.d.ts +3 -1352
- package/dist/components/tooltip/TooltipContent.d.ts +1 -268
- package/dist/components/top-bar/TopBar.d.ts +2 -270
- package/dist/components/top-bar/TopBar.js +1 -1
- package/dist/components/top-bar/TopBarBrand.d.ts +4 -808
- package/dist/components/video/Video.d.ts +4 -535
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/stitches.d.ts +46 -1993
- package/dist/stitches.js +1 -1
- package/dist/utilities/create-theme-variants/createThemeVariants.d.ts +1 -109
- package/dist/utilities/css-wrapper/CSSWrapper.d.ts +1 -1
- package/dist/utilities/hooks/useCallbackRef.js +1 -1
- package/dist/utilities/hooks/useScrollPosition.d.ts +3 -6
- package/dist/utilities/hooks/useScrollPosition.js +1 -1
- package/dist/utilities/style/capsize.d.ts +1 -1
- package/dist/utilities/style/keyframe-animations.d.ts +8 -32
- package/package.json +4 -5
- package/CHANGELOG.md +0 -200
- package/dist/components/tabs/TabsContent.d.ts +0 -267
- package/dist/components/tabs/TabsContent.js +0 -1
- package/dist/components/tabs/TabsTrigger.d.ts +0 -272
- package/dist/components/tabs/TabsTrigger.js +0 -1
- package/dist/docgen.json +0 -1
- package/dist/docs/Accordion.mdx +0 -94
- package/dist/docs/ActionIcon.mdx +0 -87
- package/dist/docs/AlertDialog.mdx +0 -40
- package/dist/docs/Avatar.mdx +0 -129
- package/dist/docs/Badge.mdx +0 -55
- package/dist/docs/Box.mdx +0 -52
- package/dist/docs/Button.mdx +0 -76
- package/dist/docs/CONTRIBUTING.md +0 -224
- package/dist/docs/CSSWrapper.mdx +0 -10
- package/dist/docs/Carousel.mdx +0 -88
- package/dist/docs/Checkbox.mdx +0 -19
- package/dist/docs/CheckboxField.mdx +0 -14
- package/dist/docs/Chip.mdx +0 -118
- package/dist/docs/ChipDismissibleGroup.mdx +0 -33
- package/dist/docs/ChipToggleGroup.mdx +0 -27
- package/dist/docs/Combobox.mdx +0 -44
- package/dist/docs/DataTable.mdx +0 -279
- package/dist/docs/DateField.mdx +0 -20
- package/dist/docs/DateInput.mdx +0 -87
- package/dist/docs/Dialog.mdx +0 -68
- package/dist/docs/Dismissible.mdx +0 -48
- package/dist/docs/DismissibleGroup.mdx +0 -29
- package/dist/docs/Divider.mdx +0 -16
- package/dist/docs/DropdownMenu.mdx +0 -30
- package/dist/docs/EmptyState.mdx +0 -23
- package/dist/docs/FieldWrapper.mdx +0 -30
- package/dist/docs/FileInput.mdx +0 -45
- package/dist/docs/Flex.mdx +0 -16
- package/dist/docs/Form.mdx +0 -411
- package/dist/docs/Grid.mdx +0 -28
- package/dist/docs/Heading.mdx +0 -30
- package/dist/docs/Icon.mdx +0 -30
- package/dist/docs/Image.mdx +0 -14
- package/dist/docs/InlineMessage.mdx +0 -52
- package/dist/docs/Input.mdx +0 -24
- package/dist/docs/InputField.mdx +0 -26
- package/dist/docs/Label.mdx +0 -32
- package/dist/docs/Link.mdx +0 -53
- package/dist/docs/List.mdx +0 -38
- package/dist/docs/Loader.mdx +0 -16
- package/dist/docs/MarkdownContent.mdx +0 -77
- package/dist/docs/NavigationMenu.mdx +0 -144
- package/dist/docs/NotificationBadge.mdx +0 -35
- package/dist/docs/NumberInput.mdx +0 -37
- package/dist/docs/NumberInputField.mdx +0 -26
- package/dist/docs/PasswordField.mdx +0 -23
- package/dist/docs/PasswordInput.mdx +0 -15
- package/dist/docs/Popover.mdx +0 -29
- package/dist/docs/ProgressBar.mdx +0 -56
- package/dist/docs/README.mdx +0 -79
- package/dist/docs/RadioButton.mdx +0 -10
- package/dist/docs/RadioButtonField.mdx +0 -25
- package/dist/docs/RadioCard.mdx +0 -62
- package/dist/docs/SearchField.mdx +0 -26
- package/dist/docs/SearchInput.mdx +0 -13
- package/dist/docs/Select.mdx +0 -56
- package/dist/docs/SelectField.mdx +0 -17
- package/dist/docs/Sidedrawer.mdx +0 -155
- package/dist/docs/Slider.mdx +0 -117
- package/dist/docs/SliderField.mdx +0 -35
- package/dist/docs/Stack.mdx +0 -24
- package/dist/docs/StackContent.mdx +0 -32
- package/dist/docs/Stepper.mdx +0 -154
- package/dist/docs/Styling.mdx +0 -85
- package/dist/docs/Switch.mdx +0 -28
- package/dist/docs/Table.mdx +0 -146
- package/dist/docs/Tabs.mdx +0 -76
- package/dist/docs/Text.mdx +0 -24
- package/dist/docs/Textarea.mdx +0 -12
- package/dist/docs/TextareaField.mdx +0 -21
- package/dist/docs/Toast.mdx +0 -20
- package/dist/docs/ToggleGroup.mdx +0 -88
- package/dist/docs/Tooltip.mdx +0 -25
- package/dist/docs/TopBar.mdx +0 -95
- package/dist/docs/Video.mdx +0 -12
- package/dist/docs/accessibility.mdx +0 -67
- package/dist/docs/coreconcepts.mdx +0 -77
- package/dist/docs/introduction.mdx +0 -33
- package/dist/docs/versioning.mdx +0 -40
- package/dist/experiments/color-scheme/ColorScheme.d.ts +0 -201
- package/dist/experiments/color-scheme/ColorScheme.js +0 -1
- package/dist/experiments/color-scheme/blue.json.js +0 -1
- package/dist/experiments/color-scheme/generateAlphaColors.d.ts +0 -1
- package/dist/experiments/color-scheme/generateAlphaColors.js +0 -1
- package/dist/experiments/color-scheme/index.d.ts +0 -1
- package/dist/experiments/color-scheme/slate.json.js +0 -1
- package/dist/experiments/color-scheme/stitches.colorscheme.config.d.ts +0 -452
- package/dist/experiments/color-scheme/stitches.colorscheme.config.js +0 -1
- package/dist/utilities/hooks/useWindowScrollPosition.d.ts +0 -6
- package/dist/utilities/hooks/useWindowScrollPosition.js +0 -1
- package/dist/utilities/hooks/useWindowSize.d.ts +0 -8
- package/dist/utilities/hooks/useWindowSize.js +0 -1
package/dist/docs/Stepper.mdx
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Stepper
|
|
3
|
-
component: Stepper, Stepper.StepBack, Stepper.StepForward, Stepper.Steps
|
|
4
|
-
description: Stepper provides a bullet list of steps and forward/backwards navigation buttons.
|
|
5
|
-
category: Navigation
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
`Stepper` exports multiple components that combine to create a stepped progress view.
|
|
9
|
-
|
|
10
|
-
`Stepper.StepBack` represents the backwards navigation element. It can receive either a child text node or a `label` prop as a function that receives `activeStep` as an argument in order to possibly render different labels based on the current step the user is on. It is automatically disabled while the user is viewing the first step.
|
|
11
|
-
|
|
12
|
-
`Stepper.StepForward` represents the forward navigation element. It can receive either a child text node or a `label` prop as a function that receives `activeStep` as an argument in order to possibly render different labels based on the current step the user is on. It can receive an onClick prop to override its default behaviour in case some logic or validation needs to be applied before going to the next step.
|
|
13
|
-
|
|
14
|
-
`Stepper.Steps` holds the actual bullet list. It can receive a `css` prop, allowing for full customization.
|
|
15
|
-
|
|
16
|
-
The root `Stepper` component must be passed `stepCount` as a number in order to display the desired number of bullet steps. It also takes `onStepChange` as a function that takes `activeStep` as an argument. This can be used to determine what content to display, based on the current step. It can also take `onComplete` as a function that gets called when the user clicks the `StepForward` button while on the last step.
|
|
17
|
-
|
|
18
|
-
```tsx preview
|
|
19
|
-
<Stepper
|
|
20
|
-
stepCount={3}
|
|
21
|
-
css={{ display: 'grid', gridTemplateColumns: '1fr auto 1fr' }}
|
|
22
|
-
>
|
|
23
|
-
<Stepper.StepBack>Back</Stepper.StepBack>
|
|
24
|
-
<Stepper.Steps />
|
|
25
|
-
<Stepper.StepForward>Next</Stepper.StepForward>
|
|
26
|
-
</Stepper>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
The root `Stepper` component can also take an `allowSkip` prop that allows the user to navigate by clicking the actual bullets. However, navigating by clicking a bullet is only possible if the user has already viewed it by using the `Next` button.
|
|
30
|
-
|
|
31
|
-
Below is a more complex example that shows how to dynamically render the button labels, get the activeStep in order to potentially use it to determine what content to render based on the current position, and use an `onComplete` function to trigger custom behaviour when the user reaches the final step.
|
|
32
|
-
|
|
33
|
-
```tsx preview
|
|
34
|
-
<Stepper
|
|
35
|
-
stepCount={3}
|
|
36
|
-
allowSkip
|
|
37
|
-
onComplete={() => console.log('Finished')}
|
|
38
|
-
onStepChange={(activeStep) =>
|
|
39
|
-
console.log('Do something with the active step')
|
|
40
|
-
}
|
|
41
|
-
css={{ display: 'grid', gridTemplateColumns: '1fr auto 1fr' }}
|
|
42
|
-
>
|
|
43
|
-
<Stepper.StepBack label={(activeStep) => 'Back'} />
|
|
44
|
-
<Stepper.Steps />
|
|
45
|
-
<Stepper.StepForward
|
|
46
|
-
label={(activeStep) => (activeStep === 2 ? 'Finish' : 'Next')}
|
|
47
|
-
/>
|
|
48
|
-
</Stepper>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Below is how to override the forward default behavior if some logic or validation need to be done before moving to the next step
|
|
52
|
-
|
|
53
|
-
```tsx preview
|
|
54
|
-
<Stepper
|
|
55
|
-
stepCount={3}
|
|
56
|
-
css={{ display: 'grid', gridTemplateColumns: '1fr auto 1fr' }}
|
|
57
|
-
>
|
|
58
|
-
<Stepper.StepBack>Back</Stepper.StepBack>
|
|
59
|
-
<Stepper.Steps />
|
|
60
|
-
<Stepper.StepForward
|
|
61
|
-
onClick={(goToNextStep) => {
|
|
62
|
-
// do something before
|
|
63
|
-
goToNextStep()
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
Next
|
|
67
|
-
</Stepper.StepForward>
|
|
68
|
-
</Stepper>
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
The root `Stepper` component also allows the user to pass a `steps` prop in order to render step labels. When the `steps` prop is passed, the `Stepper` component will be used as a controlled component thereby taking control of its state. When used as a controlled component, navigation across steps, and identifying the state of a step would be controlled by the array of steps passed to the component.
|
|
72
|
-
|
|
73
|
-
Below is an example that shows how to use the controlled component. Each object in the `steps` array must include a `label` and a `status` property to determine what content to render based on the current position.
|
|
74
|
-
|
|
75
|
-
```tsx preview
|
|
76
|
-
<Stepper
|
|
77
|
-
steps={[
|
|
78
|
-
{
|
|
79
|
-
label: 'Step 1',
|
|
80
|
-
status: 'viewed'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
label: 'Step 2',
|
|
84
|
-
status: 'active'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
label: 'Step 3',
|
|
88
|
-
status: 'default'
|
|
89
|
-
}
|
|
90
|
-
]}
|
|
91
|
-
>
|
|
92
|
-
<Stepper.Steps />
|
|
93
|
-
</Stepper>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
The root `Stepper` component also allows the user to pass a `hideLabels` prop in order to hide step labels passed in the `step` object.
|
|
97
|
-
|
|
98
|
-
Below is an example that shows how to hide step labels
|
|
99
|
-
|
|
100
|
-
```tsx preview
|
|
101
|
-
<Stepper
|
|
102
|
-
steps={[
|
|
103
|
-
{
|
|
104
|
-
label: 'Step 1',
|
|
105
|
-
status: 'viewed'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
label: 'Step 2',
|
|
109
|
-
status: 'active'
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
label: 'Step 3',
|
|
113
|
-
status: 'default'
|
|
114
|
-
}
|
|
115
|
-
]}
|
|
116
|
-
hideLabels={true}
|
|
117
|
-
>
|
|
118
|
-
<Stepper.Steps />
|
|
119
|
-
</Stepper>
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The root `Stepper` component also allows the user to pass a `showCompletedIcons` prop in order to replace step numbers with tick icons when the step has been completed. This defaults to `false`.
|
|
123
|
-
|
|
124
|
-
```tsx preview
|
|
125
|
-
<Stepper
|
|
126
|
-
steps={[
|
|
127
|
-
{
|
|
128
|
-
label: 'Step 1',
|
|
129
|
-
status: 'completed'
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
label: 'Step 2',
|
|
133
|
-
status: 'active'
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
label: 'Step 3',
|
|
137
|
-
status: 'default'
|
|
138
|
-
}
|
|
139
|
-
]}
|
|
140
|
-
showCompletedIcons
|
|
141
|
-
>
|
|
142
|
-
<Stepper.Steps />
|
|
143
|
-
</Stepper>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
The root `Stepper` component also allows the user to pass a `direction` prop in order to the alternate the component direction .
|
|
147
|
-
|
|
148
|
-
Below is an example that shows how to render steps in vertical direction.
|
|
149
|
-
|
|
150
|
-
```tsx preview
|
|
151
|
-
<Stepper stepCount={2} direction="vertical">
|
|
152
|
-
<Stepper.Steps />
|
|
153
|
-
</Stepper>
|
|
154
|
-
```
|
package/dist/docs/Styling.mdx
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Styling
|
|
3
|
-
description: Stitches is our styling library of choice. It leans on modern CSS best practices, has near-zero runtime, and provides a great developer experience
|
|
4
|
-
category: Overview
|
|
5
|
-
priority: 3
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
To read about Stitches in more depth you can refer to the [official documentation](https://stitches.dev/), the information provided here is mainly focused on the choices we made to configure Stitches for the component library.
|
|
9
|
-
|
|
10
|
-
`@atom-learning/components` exports not only a collection of React components built with Stitches but also the full Stitches library to allow full use of `styled()` and other related methods. This enables you to write more complex components with variants, typed tokens, descendant selectors, keyframe animations and more, some of which are unavailable when using `css`.
|
|
11
|
-
|
|
12
|
-
When creating a new component alongside the component library we strongly recommend that you utilise the `styled()` function to maintain a consistent component API. This will automatically provide `as` and `css` to the user without any extra configuration, in a way that `<Box />` or another generic layout component wouldn’t.
|
|
13
|
-
|
|
14
|
-
## Media Queries / Conditions
|
|
15
|
-
|
|
16
|
-
Stitches also has responsive styles built into its API, we've provided an initial set of mobile-first breakpoints alongside feature queries like `prefers-reduced-motion`.
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
export const conditions = {
|
|
20
|
-
sm: '(min-width: 550px)',
|
|
21
|
-
md: '(min-width: 800px)',
|
|
22
|
-
lg: '(min-width: 1100px)',
|
|
23
|
-
xl: '(min-width: 1350px)',
|
|
24
|
-
reducedMotion: '(prefers-reduced-motion)',
|
|
25
|
-
hover: '(hover: hover)'
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
You can use these in `styled()` or `css` by prefixing the key with `@`, e.g. `@reducedMotion` or `@xl`
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
const Section = styled('section', {
|
|
33
|
-
margin: '$1',
|
|
34
|
-
padding: '$2',
|
|
35
|
-
'@md': {
|
|
36
|
-
margin: '$2',
|
|
37
|
-
padding: '$3'
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
```tsx
|
|
43
|
-
<Text
|
|
44
|
-
css={{
|
|
45
|
-
color: '$tonal300',
|
|
46
|
-
'@md': { color: '$primary' },
|
|
47
|
-
'@lg': { color: '$primaryDark' }
|
|
48
|
-
}}
|
|
49
|
-
>
|
|
50
|
-
Hello World
|
|
51
|
-
</Text>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
You can also use them to switch [variants](https://stitches.dev/docs/variants)
|
|
55
|
-
|
|
56
|
-
```tsx
|
|
57
|
-
<Button
|
|
58
|
-
// change the 'theme' to 'success' when you trigger the 'md' breakpoint
|
|
59
|
-
theme={{
|
|
60
|
-
'@initial': 'primary',
|
|
61
|
-
'@md': 'success'
|
|
62
|
-
}}
|
|
63
|
-
// change the 'size' to 'md' when you trigger the 'sm' breakpoint
|
|
64
|
-
size: {{
|
|
65
|
-
'@initial': 'sm',
|
|
66
|
-
'@sm': 'md'
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
Click me
|
|
70
|
-
</Button>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Read more about responsive styling on the [Stitches docs](https://stitches.dev/docs/responsive-styles)
|
|
74
|
-
|
|
75
|
-
## Utilities
|
|
76
|
-
|
|
77
|
-
Stitches enables you to create shorthand utilities to improve the CSS authoring experience within `styled()` or `css`. We have provided an initial set of utilities that should be a useful starting point when composing components with a need to provide contextual layout or styles.
|
|
78
|
-
|
|
79
|
-
A quick example using `bg` and `size` to create a little blue square.
|
|
80
|
-
|
|
81
|
-
```tsx preview
|
|
82
|
-
<Box css={{ bg: '$primary', size: 100 }} />
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
The full list of utilities can be found in the [component library source](https://github.com/Atom-Learning/components/blob/main/src/stitches.ts)
|
package/dist/docs/Switch.mdx
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Switch
|
|
3
|
-
component: Switch
|
|
4
|
-
description: An implementation of the Switch component from Radix with default styling and the css prop
|
|
5
|
-
category: Form primitives
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
The `Switch` component implements [Radix's Switch component](https://radix-ui.com/primitives/docs/components/switch).
|
|
9
|
-
|
|
10
|
-
Switches are used to toggle application state between two mutually exlusive values. The `Switch` defaults to the "off" state unless it's rendered with the `defaultChecked` prop.
|
|
11
|
-
|
|
12
|
-
The `Switch` component should not be used to collect form data — use checkboxes or radio buttons for that. Only use `Switch` inside a form if it is serving its primary purpose of toggling some state with immediate effect (e.g. to conditionally render a section of the form).
|
|
13
|
-
|
|
14
|
-
```tsx preview
|
|
15
|
-
<Switch />
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Disabled state
|
|
19
|
-
|
|
20
|
-
The `disabled` stated can be set using the `disabled` property.
|
|
21
|
-
|
|
22
|
-
```tsx preview
|
|
23
|
-
<Switch disabled />
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Accessibility
|
|
27
|
-
|
|
28
|
-
Adheres to the `switch` [role requirements](https://www.w3.org/TR/wai-aria-1.2/#switch)
|
package/dist/docs/Table.mdx
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Table
|
|
3
|
-
component: Table, Table.Body, Table.Cell, Table.Footer, Table.FooterCell, Table.Header, Table.HeaderCell, Table.Row
|
|
4
|
-
description: The Table component displays a collection of data grouped into rows
|
|
5
|
-
category: Content
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
The `Table` component structure mirrors that of a regular HTML table, with the smaller `Table.Body`, `Table.Cell`, `Table.Footer`, `Table.Header`, `Table.HeaderCell` and `Table Row` components corresponding to the `<tbody>`, `<td>`, `<tfoot>`, `<thead>`, `<th>` and `<tr>` tags, respectively.
|
|
9
|
-
|
|
10
|
-
```jsx preview
|
|
11
|
-
<Table css={{ width: '500px', mb: '100px' }}>
|
|
12
|
-
<Table.Header>
|
|
13
|
-
<Table.Row>
|
|
14
|
-
<Table.HeaderCell>First Name</Table.HeaderCell>
|
|
15
|
-
<Table.HeaderCell>Last Name</Table.HeaderCell>
|
|
16
|
-
<Table.HeaderCell>Age</Table.HeaderCell>
|
|
17
|
-
</Table.Row>
|
|
18
|
-
</Table.Header>
|
|
19
|
-
<Table.Body>
|
|
20
|
-
<Table.Row>
|
|
21
|
-
<Table.Cell>Rakim</Table.Cell>
|
|
22
|
-
<Table.Cell>Jackson</Table.Cell>
|
|
23
|
-
<Table.Cell>35</Table.Cell>
|
|
24
|
-
</Table.Row>
|
|
25
|
-
<Table.Row>
|
|
26
|
-
<Table.Cell>Evelyn</Table.Cell>
|
|
27
|
-
<Table.Cell>Smith</Table.Cell>
|
|
28
|
-
<Table.Cell>27</Table.Cell>
|
|
29
|
-
</Table.Row>
|
|
30
|
-
<Table.Row>
|
|
31
|
-
<Table.Cell>Miguel</Table.Cell>
|
|
32
|
-
<Table.Cell>Fernandez</Table.Cell>
|
|
33
|
-
<Table.Cell>52</Table.Cell>
|
|
34
|
-
</Table.Row>
|
|
35
|
-
</Table.Body>
|
|
36
|
-
<Table.Footer>
|
|
37
|
-
<Table.Row>
|
|
38
|
-
<Table.FooterCell>Footer 1</Table.FooterCell>
|
|
39
|
-
<Table.FooterCell>Footer 2</Table.FooterCell>
|
|
40
|
-
<Table.FooterCell>Footer 3</Table.FooterCell>
|
|
41
|
-
</Table.Row>
|
|
42
|
-
</Table.Footer>
|
|
43
|
-
</Table>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Styling
|
|
47
|
-
|
|
48
|
-
The default table width is 100% of the parent container, but this and other styles can be overridden with the `css` prop on all components.
|
|
49
|
-
|
|
50
|
-
Best practice: Due to rendering issues with some browsers, adding borders to `Table.Row` is possible by styling the Table component with `border-collapse: collapse`; however, this practice is generally not recommended. The preferred method for adding borders is applying styles to the `Table.Cell` and `Table.HeaderCell` components.
|
|
51
|
-
|
|
52
|
-
```jsx preview
|
|
53
|
-
<Table css={{ width: '500px', mt: '100px', ml: '100px' }}>
|
|
54
|
-
<Table.Header>
|
|
55
|
-
<Table.Row>
|
|
56
|
-
<Table.HeaderCell css={{ bg: '$subjectEnglish' }}>
|
|
57
|
-
First Name
|
|
58
|
-
</Table.HeaderCell>
|
|
59
|
-
<Table.HeaderCell css={{ bg: '$subjectEnglish' }}>
|
|
60
|
-
Last Name
|
|
61
|
-
</Table.HeaderCell>
|
|
62
|
-
<Table.HeaderCell css={{ bg: '$subjectEnglish' }}>Age</Table.HeaderCell>
|
|
63
|
-
</Table.Row>
|
|
64
|
-
</Table.Header>
|
|
65
|
-
<Table.Body>
|
|
66
|
-
<Table.Row>
|
|
67
|
-
<Table.Cell>Rakim</Table.Cell>
|
|
68
|
-
<Table.Cell>Jackson</Table.Cell>
|
|
69
|
-
<Table.Cell>35</Table.Cell>
|
|
70
|
-
</Table.Row>
|
|
71
|
-
<Table.Row>
|
|
72
|
-
<Table.Cell>Evelyn</Table.Cell>
|
|
73
|
-
<Table.Cell>Smith</Table.Cell>
|
|
74
|
-
<Table.Cell>27</Table.Cell>
|
|
75
|
-
</Table.Row>
|
|
76
|
-
<Table.Row>
|
|
77
|
-
<Table.Cell>Miguel</Table.Cell>
|
|
78
|
-
<Table.Cell>Fernandez</Table.Cell>
|
|
79
|
-
<Table.Cell>52</Table.Cell>
|
|
80
|
-
</Table.Row>
|
|
81
|
-
</Table.Body>
|
|
82
|
-
<Table.Footer>
|
|
83
|
-
<Table.Row>
|
|
84
|
-
<Table.FooterCell css={{ fontStyle: 'italic', color: '$subjectEnglish' }}>
|
|
85
|
-
Footer 1
|
|
86
|
-
</Table.FooterCell>
|
|
87
|
-
<Table.FooterCell css={{ fontStyle: 'italic', color: '$subjectEnglish' }}>
|
|
88
|
-
Footer 2
|
|
89
|
-
</Table.FooterCell>
|
|
90
|
-
<Table.FooterCell css={{ fontStyle: 'italic', color: '$subjectEnglish' }}>
|
|
91
|
-
Footer 3
|
|
92
|
-
</Table.FooterCell>
|
|
93
|
-
</Table.Row>
|
|
94
|
-
</Table.Footer>
|
|
95
|
-
</Table>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Variants
|
|
99
|
-
|
|
100
|
-
The `Table` component has 2 size variants that control the row height. The two available sizes are `md`(default) and `lg` which should be used when the table needs to show more than just text, ie: `Button(s)` and `ActionIcon(s)`. The increased height helps keep the elements clickable on smaller screensizes.
|
|
101
|
-
|
|
102
|
-
```jsx preview
|
|
103
|
-
<Table size="lg" css={{ width: '500px', mt: '100px', ml: '100px' }}>
|
|
104
|
-
<Table.Header>
|
|
105
|
-
<Table.Row>
|
|
106
|
-
<Table.HeaderCell>First Name</Table.HeaderCell>
|
|
107
|
-
<Table.HeaderCell>Last Name</Table.HeaderCell>
|
|
108
|
-
<Table.HeaderCell>Age</Table.HeaderCell>
|
|
109
|
-
</Table.Row>
|
|
110
|
-
</Table.Header>
|
|
111
|
-
<Table.Body>
|
|
112
|
-
<Table.Row>
|
|
113
|
-
<Table.Cell>Rakim</Table.Cell>
|
|
114
|
-
<Table.Cell>Jackson</Table.Cell>
|
|
115
|
-
<Table.Cell>35</Table.Cell>
|
|
116
|
-
</Table.Row>
|
|
117
|
-
<Table.Row>
|
|
118
|
-
<Table.Cell>Evelyn</Table.Cell>
|
|
119
|
-
<Table.Cell>Smith</Table.Cell>
|
|
120
|
-
<Table.Cell>27</Table.Cell>
|
|
121
|
-
</Table.Row>
|
|
122
|
-
</Table.Body>
|
|
123
|
-
</Table>
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
The `Table` component by default renders with a slight border radius. If you want to remove this, for example if you are rendering the `Table` inside another component that has border radius, you can remove this by setting `corners="square"`. The default is `corners="round"`.
|
|
127
|
-
|
|
128
|
-
```tsx
|
|
129
|
-
<Table corners="square">...</Table>
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
`Table.Header` accepts a theme prop, the current available options are `primary`, `primaryDark`, and `light`. The default is `primaryDark`.
|
|
133
|
-
|
|
134
|
-
```tsx
|
|
135
|
-
<Table>
|
|
136
|
-
<Table.Header theme="light">...</Table.Header>
|
|
137
|
-
</Table>
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
`Table.Body` accepts an appearance prop, which determines whether the rows will be alternate coloured or not. The current options are `striped` and `simple`, and the default is `striped`.
|
|
141
|
-
|
|
142
|
-
```tsx
|
|
143
|
-
<Table>
|
|
144
|
-
<Table.Body appearance="simple">...</Table.Body>
|
|
145
|
-
</Table>
|
|
146
|
-
```
|
package/dist/docs/Tabs.mdx
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Tabs
|
|
3
|
-
component: Tabs,TriggerListWrapper,TabTrigger
|
|
4
|
-
description: Tabs is a component that provides different sections of content that are displayed one at a time.
|
|
5
|
-
category: Layout
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Functionality based on the [`Tab`](https://www.radix-ui.com/docs/primitives/components/tabs) radix component, which already allows for: controlled/uncontrolled tabbing, disabling or partly disabling options, adds keyboard navigation and orientation and more.
|
|
9
|
-
|
|
10
|
-
Implements experimental ColorScheme component to allow multiple colour setups.
|
|
11
|
-
|
|
12
|
-
```tsx preview
|
|
13
|
-
<Tabs defaultValue="tab2">
|
|
14
|
-
<Tabs.TriggerList>
|
|
15
|
-
<Tabs.Trigger value="tab1">
|
|
16
|
-
Nested component under the Tabs.Trigger component
|
|
17
|
-
</Tabs.Trigger>
|
|
18
|
-
<Tabs.Trigger value="tab2">Simple text</Tabs.Trigger>
|
|
19
|
-
</Tabs.TriggerList>
|
|
20
|
-
<Tabs.Content css={{ p: '$3' }} value="tab1">
|
|
21
|
-
<Text>Content for tab1.</Text>
|
|
22
|
-
</Tabs.Content>
|
|
23
|
-
<Tabs.Content css={{ p: '$3' }} value="tab2">
|
|
24
|
-
<Text>
|
|
25
|
-
Content for the second tab. It can also hold other components, like a
|
|
26
|
-
</Text>
|
|
27
|
-
<Button>Button</Button>
|
|
28
|
-
</Tabs.Content>
|
|
29
|
-
</Tabs>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Disabled
|
|
33
|
-
|
|
34
|
-
A `Tabs.Trigger` component can take a `disabled` prop, which would make it unselectable.
|
|
35
|
-
The corresponding `Tabs.Content` component's content will be, in this case, permanently hidden.
|
|
36
|
-
|
|
37
|
-
```tsx preview
|
|
38
|
-
<Tabs defaultValue="tab1">
|
|
39
|
-
<Tabs.TriggerList>
|
|
40
|
-
<Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
|
|
41
|
-
<Tabs.Trigger value="tab2" disabled>
|
|
42
|
-
Tab 2
|
|
43
|
-
</Tabs.Trigger>
|
|
44
|
-
</Tabs.TriggerList>
|
|
45
|
-
<Tabs.Content css={{ p: '$3' }} value="tab1">
|
|
46
|
-
<Text>Content for tab1.</Text>
|
|
47
|
-
</Tabs.Content>
|
|
48
|
-
<Tabs.Content css={{ p: '$3' }} value="tab2">
|
|
49
|
-
<Text>Content for tab2.</Text>
|
|
50
|
-
</Tabs.Content>
|
|
51
|
-
</Tabs>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Color Scheme
|
|
55
|
-
|
|
56
|
-
You can pass in a `colorScheme` object to the TriggerList to customise the colours of the component.
|
|
57
|
-
Defaults to `{ base: "slate", accent: "blue", interactive: "hiContrast1"}`
|
|
58
|
-
ColorScheme is experimental and has been implemented only locally but you can read more about how it
|
|
59
|
-
currently works and available options [on the repository's github](https://github.com/Atom-Learning/components/tree/main/lib/src/experiments/color-scheme#readme).
|
|
60
|
-
|
|
61
|
-
```tsx preview live
|
|
62
|
-
<Tabs defaultValue="tab2">
|
|
63
|
-
<Tabs.TriggerList
|
|
64
|
-
colorScheme={{ base: 'slate', accent: 'slate', interactive: 'hiContrast2' }}
|
|
65
|
-
>
|
|
66
|
-
<Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
|
|
67
|
-
<Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
|
|
68
|
-
</Tabs.TriggerList>
|
|
69
|
-
<Tabs.Content css={{ p: '$3' }} value="tab1">
|
|
70
|
-
<Text>Content for tab1.</Text>
|
|
71
|
-
</Tabs.Content>
|
|
72
|
-
<Tabs.Content css={{ p: '$3' }} value="tab2">
|
|
73
|
-
<Text>Content for tab2.</Text>
|
|
74
|
-
</Tabs.Content>
|
|
75
|
-
</Tabs>
|
|
76
|
-
```
|
package/dist/docs/Text.mdx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Text
|
|
3
|
-
component: Text
|
|
4
|
-
description: Text is our basic component for rendering text, use it for any non-heading text
|
|
5
|
-
category: Content
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Sizes
|
|
9
|
-
|
|
10
|
-
[Capsize](https://seek-oss.github.io/capsize/) is used to size the text to the height of its capital letters, trimming the space above capital letters and below the baseline.
|
|
11
|
-
|
|
12
|
-
```tsx preview
|
|
13
|
-
<Text size="sm">
|
|
14
|
-
Anything smaller than body text. E.g. "forgot your password?" prompts
|
|
15
|
-
</Text>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```tsx preview
|
|
19
|
-
<Text>Body text. Most text in the app will use this.</Text>
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
```tsx preview
|
|
23
|
-
<Text size="lg">Large, non-heading text. E.g. a drop quote in an article</Text>
|
|
24
|
-
```
|
package/dist/docs/Textarea.mdx
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Textarea
|
|
3
|
-
component: Textarea
|
|
4
|
-
description: Textarea is the lowest-level textarea component for longer text
|
|
5
|
-
category: Form primitives
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Textareas should be accompanied by labels, so rather than using `Textarea` directly in a UI, it’s normally best to use a `field` component, which combines an `Textarea` with a `Label` and displays validation errors. If none of the existing field components suit your needs, it might be worth adding a new one.
|
|
9
|
-
|
|
10
|
-
```tsx live
|
|
11
|
-
<Textarea placeholder="Placeholder text" css={{ width: 340 }} />
|
|
12
|
-
```
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Textarea Field
|
|
3
|
-
component: TextareaField
|
|
4
|
-
description: TextareaField renders a field composed of a Textarea, a Label and a InlineMessage
|
|
5
|
-
category: Form fields
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
TextareaField is the preferred way to render a form field for multi-line text.
|
|
9
|
-
|
|
10
|
-
In addition to text `Label` (required) and a validation error (optional), TextareaField accepts all the same props as `Textarea` and will pass them on to the `textarea` it renders. However, as with all our composed components, `TextareaField`’s css prop will be applied to a containing Box — the styling of the individual components inside `TextareaField` cannot be altered.
|
|
11
|
-
|
|
12
|
-
```tsx preview
|
|
13
|
-
<Form>
|
|
14
|
-
<TextareaField
|
|
15
|
-
label="Write something"
|
|
16
|
-
name="example"
|
|
17
|
-
id="example"
|
|
18
|
-
css={{ width: 320 }}
|
|
19
|
-
/>
|
|
20
|
-
</Form>
|
|
21
|
-
```
|
package/dist/docs/Toast.mdx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Toast
|
|
3
|
-
component: ToastProvider
|
|
4
|
-
description: A toast notification that gives non-intrusive feedback to the user and times out automatically
|
|
5
|
-
category: Feedback
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
`Toast` has 2 exports, the `ToastProvider` component which is the container for all the notifications and the `toast` function that allows triggering the notification. It sets all the default behaviour, like pausing on hover and positioning and styles the different types of notification (`blank` (default), `error` and `success`).
|
|
9
|
-
|
|
10
|
-
This is the preferred user feedback way as it is not intrusive and it simply provides some state information to the user without waiting for feedback, ie: the information was saved. When feedback is required consider using the `AlertDialog` component.
|
|
11
|
-
|
|
12
|
-
```tsx preview
|
|
13
|
-
<ToastProvider>
|
|
14
|
-
<Button onClick={() => toast.success('This is the toast message')}>
|
|
15
|
-
Click for toast
|
|
16
|
-
</Button>
|
|
17
|
-
</ToastProvider>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
This component can render a string message by default. However, it can be overriden to show more complex component structure [Render more than a string](https://react-hot-toast.com/docs/toast). For more information on other configuration options and props, please read about the underlying behaviour at [react-hot-toast](https://react-hot-toast.com/)
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Toggle Group
|
|
3
|
-
component: ToggleGroupRoot,ToggleGroup.Button,ToggleGroup.Item
|
|
4
|
-
description: Extends functionality the Toggle Group radix component
|
|
5
|
-
category: Content
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Lets users toggle between a group of limited options(Suggested range is 2-6 options).
|
|
9
|
-
|
|
10
|
-
Functionality based on the [`ToggleGroup`](https://www.radix-ui.com/docs/primitives/components/toggle-group) radix component, which already allows for: single/multiple select, disabling or partly disabling options, adds keyboard navigation and orientation and more.
|
|
11
|
-
|
|
12
|
-
Extends visually by allowing for different sizing, vertical/horizontal display and gaps using the Stack component. When there is no gap, rounds the border for _only_ the edge/outer corners.
|
|
13
|
-
|
|
14
|
-
## Orientation
|
|
15
|
-
|
|
16
|
-
`orientation="vertical | horizontal"`
|
|
17
|
-
|
|
18
|
-
```jsx preview
|
|
19
|
-
<ToggleGroup.Root type="multiple" orientation="vertical">
|
|
20
|
-
<ToggleGroup.Button value="a">A</ToggleGroup.Button>
|
|
21
|
-
<ToggleGroup.Button value="b">B</ToggleGroup.Button>
|
|
22
|
-
</ToggleGroup.Root>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Gap
|
|
26
|
-
|
|
27
|
-
`gap={0 | 1 | 2 | ... | 9}`
|
|
28
|
-
|
|
29
|
-
```jsx preview
|
|
30
|
-
<ToggleGroup.Root type="single" gap={3}>
|
|
31
|
-
<ToggleGroup.Button value="a">A</ToggleGroup.Button>
|
|
32
|
-
<ToggleGroup.Button value="b">B</ToggleGroup.Button>
|
|
33
|
-
</ToggleGroup.Root>
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Size
|
|
37
|
-
|
|
38
|
-
`size="sm | md | lg"`
|
|
39
|
-
|
|
40
|
-
```jsx preview
|
|
41
|
-
<ToggleGroup.Root type="single" gap={3}>
|
|
42
|
-
<ToggleGroup.Button value="a" size="sm">
|
|
43
|
-
<Icon is={Upload} /> A
|
|
44
|
-
</ToggleGroup.Button>
|
|
45
|
-
<ToggleGroup.Button value="b" size="sm">
|
|
46
|
-
B
|
|
47
|
-
</ToggleGroup.Button>
|
|
48
|
-
<ToggleGroup.Button value="icon" size="sm">
|
|
49
|
-
<Icon is={Upload} />
|
|
50
|
-
</ToggleGroup.Button>
|
|
51
|
-
</ToggleGroup.Root>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Full width
|
|
55
|
-
|
|
56
|
-
`isFullWidth={boolean}`
|
|
57
|
-
|
|
58
|
-
```jsx preview
|
|
59
|
-
<ToggleGroup.Root type="multiple" isFullWidth gap={3}>
|
|
60
|
-
<ToggleGroup.Button value="a">A</ToggleGroup.Button>
|
|
61
|
-
<ToggleGroup.Button value="b">B</ToggleGroup.Button>
|
|
62
|
-
<ToggleGroup.Button value="c">C</ToggleGroup.Button>
|
|
63
|
-
</ToggleGroup.Root>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Disabled
|
|
67
|
-
|
|
68
|
-
### Partly
|
|
69
|
-
|
|
70
|
-
```jsx preview
|
|
71
|
-
<ToggleGroup.Root type="multiple" gap={3} defaultValue="a">
|
|
72
|
-
<ToggleGroup.Button value="a">A</ToggleGroup.Button>
|
|
73
|
-
<ToggleGroup.Button value="b">B</ToggleGroup.Button>
|
|
74
|
-
<ToggleGroup.Button value="c" disabled>
|
|
75
|
-
C
|
|
76
|
-
</ToggleGroup.Button>
|
|
77
|
-
</ToggleGroup.Root>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Fully
|
|
81
|
-
|
|
82
|
-
```jsx preview
|
|
83
|
-
<ToggleGroup.Root type="multiple" gap={3} defaultValue="a" disabled>
|
|
84
|
-
<ToggleGroup.Button value="a">A</ToggleGroup.Button>
|
|
85
|
-
<ToggleGroup.Button value="b">B</ToggleGroup.Button>
|
|
86
|
-
<ToggleGroup.Button value="c">C</ToggleGroup.Button>
|
|
87
|
-
</ToggleGroup.Root>
|
|
88
|
-
```
|