@commercetools/nimbus 0.0.2 → 0.0.3
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/index.d.ts +1412 -0
- package/dist/index.js +11183 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.cjs +27 -0
- package/dist/index.umd.cjs.map +1 -0
- package/package.json +63 -39
- package/.storybook/apca-check/index.ts +0 -150
- package/.storybook/main.ts +0 -64
- package/.storybook/preview.tsx +0 -92
- package/.storybook/vitest.setup.ts +0 -13
- package/docs/architecture-decisions/adr-0001-consumer-component-apis.md +0 -177
- package/docs/architecture-decisions/adr-0002-compound-component-extraction.md +0 -82
- package/src/components/accordion/accordion-context.tsx +0 -17
- package/src/components/accordion/accordion.mdx +0 -172
- package/src/components/accordion/accordion.recipe.tsx +0 -98
- package/src/components/accordion/accordion.slots.tsx +0 -39
- package/src/components/accordion/accordion.stories.tsx +0 -188
- package/src/components/accordion/accordion.tsx +0 -16
- package/src/components/accordion/accordion.types.tsx +0 -54
- package/src/components/accordion/components/accordion-content.tsx +0 -28
- package/src/components/accordion/components/accordion-group.tsx +0 -27
- package/src/components/accordion/components/accordion-header.tsx +0 -63
- package/src/components/accordion/components/accordion-item.tsx +0 -87
- package/src/components/accordion/index.ts +0 -2
- package/src/components/alert/alert.mdx +0 -92
- package/src/components/alert/alert.recipe.tsx +0 -65
- package/src/components/alert/alert.slots.tsx +0 -46
- package/src/components/alert/alert.stories.tsx +0 -308
- package/src/components/alert/alert.tsx +0 -18
- package/src/components/alert/alert.types.tsx +0 -70
- package/src/components/alert/components/alert.actions.tsx +0 -27
- package/src/components/alert/components/alert.description.tsx +0 -27
- package/src/components/alert/components/alert.dismiss-button.tsx +0 -41
- package/src/components/alert/components/alert.root.tsx +0 -92
- package/src/components/alert/components/alert.title.tsx +0 -29
- package/src/components/alert/index.ts +0 -2
- package/src/components/avatar/avatar.mdx +0 -80
- package/src/components/avatar/avatar.recipe.tsx +0 -36
- package/src/components/avatar/avatar.slots.tsx +0 -16
- package/src/components/avatar/avatar.stories.tsx +0 -136
- package/src/components/avatar/avatar.tsx +0 -34
- package/src/components/avatar/avatar.types.ts +0 -33
- package/src/components/avatar/index.ts +0 -2
- package/src/components/badge/badge.mdx +0 -91
- package/src/components/badge/badge.recipe.tsx +0 -72
- package/src/components/badge/badge.slots.tsx +0 -8
- package/src/components/badge/badge.stories.tsx +0 -124
- package/src/components/badge/badge.tsx +0 -35
- package/src/components/badge/badge.types.tsx +0 -40
- package/src/components/badge/index.ts +0 -2
- package/src/components/bleed/bleed.tsx +0 -1
- package/src/components/bleed/index.ts +0 -1
- package/src/components/box/box.mdx +0 -115
- package/src/components/box/box.stories.tsx +0 -71
- package/src/components/box/box.tsx +0 -11
- package/src/components/box/index.ts +0 -1
- package/src/components/button/button.mdx +0 -169
- package/src/components/button/button.recipe.ts +0 -185
- package/src/components/button/button.slots.tsx +0 -45
- package/src/components/button/button.stories.tsx +0 -369
- package/src/components/button/button.tsx +0 -37
- package/src/components/button/button.types.ts +0 -14
- package/src/components/button/index.ts +0 -2
- package/src/components/card/card.mdx +0 -92
- package/src/components/card/card.recipe.tsx +0 -71
- package/src/components/card/card.slots.tsx +0 -50
- package/src/components/card/card.stories.tsx +0 -175
- package/src/components/card/card.tsx +0 -9
- package/src/components/card/card.types.ts +0 -22
- package/src/components/card/components/card.content.tsx +0 -29
- package/src/components/card/components/card.header.tsx +0 -28
- package/src/components/card/components/card.root.tsx +0 -62
- package/src/components/card/index.ts +0 -2
- package/src/components/checkbox/checkbox.mdx +0 -78
- package/src/components/checkbox/checkbox.recipe.tsx +0 -116
- package/src/components/checkbox/checkbox.slots.tsx +0 -33
- package/src/components/checkbox/checkbox.stories.tsx +0 -200
- package/src/components/checkbox/checkbox.tsx +0 -77
- package/src/components/checkbox/checkbox.types.tsx +0 -22
- package/src/components/checkbox/index.ts +0 -2
- package/src/components/code/code.mdx +0 -17
- package/src/components/code/code.recipe.ts +0 -63
- package/src/components/code/code.tsx +0 -1
- package/src/components/code/index.ts +0 -1
- package/src/components/dialog/dialog.mdx +0 -20
- package/src/components/dialog/dialog.recipe.ts +0 -254
- package/src/components/dialog/dialog.tsx +0 -61
- package/src/components/dialog/index.ts +0 -1
- package/src/components/em/em.mdx +0 -17
- package/src/components/em/em.tsx +0 -1
- package/src/components/em/index.ts +0 -1
- package/src/components/flex/flex.mdx +0 -41
- package/src/components/flex/flex.tsx +0 -1
- package/src/components/flex/index.ts +0 -1
- package/src/components/grid/grid.mdx +0 -156
- package/src/components/grid/grid.stories.tsx +0 -151
- package/src/components/grid/grid.tsx +0 -29
- package/src/components/grid/index.ts +0 -1
- package/src/components/heading/heading.mdx +0 -23
- package/src/components/heading/heading.recipe.ts +0 -49
- package/src/components/heading/heading.tsx +0 -1
- package/src/components/heading/index.ts +0 -1
- package/src/components/highlight/highlight.mdx +0 -18
- package/src/components/highlight/highlight.tsx +0 -1
- package/src/components/highlight/index.ts +0 -1
- package/src/components/icon-button/icon-button.mdx +0 -98
- package/src/components/icon-button/icon-button.stories.tsx +0 -188
- package/src/components/icon-button/icon-button.tsx +0 -21
- package/src/components/icon-button/icon-button.types.tsx +0 -10
- package/src/components/icon-button/index.ts +0 -2
- package/src/components/index.ts +0 -33
- package/src/components/input/index.ts +0 -1
- package/src/components/input/input.mdx +0 -20
- package/src/components/input/input.recipe.ts +0 -95
- package/src/components/input/input.tsx +0 -1
- package/src/components/input-group/index.ts +0 -1
- package/src/components/input-group/input-group.mdx +0 -20
- package/src/components/input-group/input-group.tsx +0 -44
- package/src/components/kbd/index.ts +0 -1
- package/src/components/kbd/kbd.mdx +0 -18
- package/src/components/kbd/kbd.recipe.ts +0 -57
- package/src/components/kbd/kbd.tsx +0 -1
- package/src/components/link/index.ts +0 -2
- package/src/components/link/link.mdx +0 -77
- package/src/components/link/link.recipe.ts +0 -52
- package/src/components/link/link.slots.tsx +0 -29
- package/src/components/link/link.stories.tsx +0 -204
- package/src/components/link/link.tsx +0 -38
- package/src/components/link/link.types.tsx +0 -26
- package/src/components/list/index.ts +0 -1
- package/src/components/list/list.mdx +0 -18
- package/src/components/list/list.recipe.ts +0 -68
- package/src/components/list/list.tsx +0 -9
- package/src/components/loading-spinner/index.ts +0 -2
- package/src/components/loading-spinner/loading-spinner.mdx +0 -92
- package/src/components/loading-spinner/loading-spinner.recipe.tsx +0 -70
- package/src/components/loading-spinner/loading-spinner.slots.tsx +0 -38
- package/src/components/loading-spinner/loading-spinner.stories.tsx +0 -97
- package/src/components/loading-spinner/loading-spinner.tsx +0 -50
- package/src/components/loading-spinner/loading-spinner.types.tsx +0 -21
- package/src/components/nimbus-provider/color-mode.tsx +0 -32
- package/src/components/nimbus-provider/index.ts +0 -2
- package/src/components/nimbus-provider/nimbus-provider.mdx +0 -21
- package/src/components/nimbus-provider/nimbus-provider.tsx +0 -51
- package/src/components/select/components/select.clear-button.tsx +0 -31
- package/src/components/select/components/select.option-group.tsx +0 -48
- package/src/components/select/components/select.option.tsx +0 -21
- package/src/components/select/components/select.options.tsx +0 -23
- package/src/components/select/components/select.root.tsx +0 -81
- package/src/components/select/index.ts +0 -2
- package/src/components/select/select.mdx +0 -170
- package/src/components/select/select.recipe.tsx +0 -216
- package/src/components/select/select.slots.tsx +0 -58
- package/src/components/select/select.stories.tsx +0 -841
- package/src/components/select/select.tsx +0 -18
- package/src/components/select/select.types.tsx +0 -37
- package/src/components/simple-grid/index.ts +0 -1
- package/src/components/simple-grid/simple-grid.mdx +0 -133
- package/src/components/simple-grid/simple-grid.stories.tsx +0 -143
- package/src/components/simple-grid/simple-grid.tsx +0 -31
- package/src/components/stack/index.ts +0 -1
- package/src/components/stack/stack.mdx +0 -88
- package/src/components/stack/stack.stories.tsx +0 -82
- package/src/components/stack/stack.tsx +0 -15
- package/src/components/table/index.ts +0 -1
- package/src/components/table/table.mdx +0 -23
- package/src/components/table/table.recipe.ts +0 -170
- package/src/components/table/table.tsx +0 -43
- package/src/components/text/index.ts +0 -1
- package/src/components/text/text.mdx +0 -244
- package/src/components/text/text.tsx +0 -23
- package/src/components/text-input/index.ts +0 -2
- package/src/components/text-input/text-input.mdx +0 -118
- package/src/components/text-input/text-input.recipe.tsx +0 -68
- package/src/components/text-input/text-input.slots.tsx +0 -24
- package/src/components/text-input/text-input.stories.tsx +0 -282
- package/src/components/text-input/text-input.tsx +0 -39
- package/src/components/text-input/text-input.types.ts +0 -7
- package/src/components/toggle-button-group/components/toggle-button-group.button.tsx +0 -14
- package/src/components/toggle-button-group/components/toggle-button-group.root.tsx +0 -15
- package/src/components/toggle-button-group/index.ts +0 -2
- package/src/components/toggle-button-group/toggle-button-group.mdx +0 -94
- package/src/components/toggle-button-group/toggle-button-group.recipe.tsx +0 -64
- package/src/components/toggle-button-group/toggle-button-group.slots.tsx +0 -26
- package/src/components/toggle-button-group/toggle-button-group.stories.tsx +0 -311
- package/src/components/toggle-button-group/toggle-button-group.tsx +0 -12
- package/src/components/toggle-button-group/toggle-button-group.types.tsx +0 -62
- package/src/components/tooltip/index.ts +0 -4
- package/src/components/tooltip/make-element-focusable.stories.tsx +0 -56
- package/src/components/tooltip/make-element-focusable.tsx +0 -57
- package/src/components/tooltip/tooltip-trigger.stories.tsx +0 -157
- package/src/components/tooltip/tooltip-trigger.tsx +0 -15
- package/src/components/tooltip/tooltip.mdx +0 -48
- package/src/components/tooltip/tooltip.recipe.ts +0 -26
- package/src/components/tooltip/tooltip.slots.ts +0 -35
- package/src/components/tooltip/tooltip.stories.tsx +0 -139
- package/src/components/tooltip/tooltip.tsx +0 -31
- package/src/components/tooltip/tooltip.types.ts +0 -44
- package/src/components/visually-hidden/index.ts +0 -1
- package/src/components/visually-hidden/visually-hidden.mdx +0 -61
- package/src/components/visually-hidden/visually-hidden.stories.tsx +0 -124
- package/src/components/visually-hidden/visually-hidden.tsx +0 -18
- package/src/docs/accessibility.mdx +0 -21
- package/src/docs/background.mdx +0 -154
- package/src/docs/border.mdx +0 -226
- package/src/docs/changelog.mdx +0 -17
- package/src/docs/components-layout.mdx +0 -22
- package/src/docs/components.mdx +0 -17
- package/src/docs/data-display.mdx +0 -23
- package/src/docs/display.mdx +0 -55
- package/src/docs/effects.mdx +0 -73
- package/src/docs/feedback.mdx +0 -22
- package/src/docs/filters.mdx +0 -268
- package/src/docs/flex-and-grid.mdx +0 -445
- package/src/docs/forms.mdx +0 -22
- package/src/docs/generated/index.mdx +0 -16
- package/src/docs/getting-started.mdx +0 -17
- package/src/docs/home.mdx +0 -56
- package/src/docs/hooks.mdx +0 -16
- package/src/docs/inputs.mdx +0 -21
- package/src/docs/installation.mdx +0 -60
- package/src/docs/interactivity.mdx +0 -278
- package/src/docs/known-issues.mdx +0 -19
- package/src/docs/layout.mdx +0 -301
- package/src/docs/list.mdx +0 -82
- package/src/docs/markdown.mdx +0 -234
- package/src/docs/media.mdx +0 -22
- package/src/docs/naivgation.mdx +0 -22
- package/src/docs/playground.mdx +0 -16
- package/src/docs/rfcs-component-structure-rfcs.mdx +0 -17
- package/src/docs/rfcs-component-structure.mdx +0 -74
- package/src/docs/rfcs-hook-structure.mdx +0 -59
- package/src/docs/sizing.mdx +0 -210
- package/src/docs/spacing.mdx +0 -193
- package/src/docs/style-props-typography.mdx +0 -373
- package/src/docs/style-props.mdx +0 -15
- package/src/docs/svg.mdx +0 -58
- package/src/docs/tables.mdx +0 -95
- package/src/docs/toc.mdx +0 -39
- package/src/docs/tokens/animations.mdx +0 -68
- package/src/docs/tokens/aspect-ratios.mdx +0 -21
- package/src/docs/tokens/blurs.mdx +0 -20
- package/src/docs/tokens/borders.mdx +0 -25
- package/src/docs/tokens/breakpoints.mdx +0 -35
- package/src/docs/tokens/colors.mdx +0 -86
- package/src/docs/tokens/cursors.mdx +0 -21
- package/src/docs/tokens/radii.mdx +0 -23
- package/src/docs/tokens/shadows.mdx +0 -21
- package/src/docs/tokens/sizes.mdx +0 -54
- package/src/docs/tokens/spacing.mdx +0 -35
- package/src/docs/tokens/typography.mdx +0 -61
- package/src/docs/tokens/z-indices.mdx +0 -23
- package/src/docs/tokens-other.mdx +0 -17
- package/src/docs/tokens.mdx +0 -16
- package/src/docs/transforms.mdx +0 -150
- package/src/docs/transitions.mdx +0 -164
- package/src/docs/typography.mdx +0 -17
- package/src/docs/utilities.mdx +0 -17
- package/src/hooks/index.ts +0 -2
- package/src/hooks/use-copy-to-clipboard/use-copy-to-clipboard.mdx +0 -54
- package/src/hooks/use-copy-to-clipboard/use-copy-to-clipboard.ts +0 -1
- package/src/hooks/use-hotkeys/use-hotkeys.mdx +0 -48
- package/src/hooks/use-hotkeys/use-hotkeys.stories.tsx +0 -69
- package/src/hooks/use-hotkeys/use-hotkeys.ts +0 -1
- package/src/index.ts +0 -3
- package/src/test/utils.tsx +0 -20
- package/src/theme/animation-styles.ts +0 -52
- package/src/theme/breakpoints.ts +0 -32
- package/src/theme/global-css.ts +0 -53
- package/src/theme/index.ts +0 -35
- package/src/theme/keyframes.ts +0 -192
- package/src/theme/layer-styles.ts +0 -12
- package/src/theme/recipes/index.ts +0 -21
- package/src/theme/semantic-tokens/colors.ts +0 -55
- package/src/theme/semantic-tokens/index.ts +0 -9
- package/src/theme/semantic-tokens/radii.ts +0 -3
- package/src/theme/semantic-tokens/shadows.ts +0 -4
- package/src/theme/slot-recipes/index.ts +0 -15
- package/src/theme/text-styles.ts +0 -8
- package/src/theme/tokens/animations.ts +0 -4
- package/src/theme/tokens/aspect-ratios.ts +0 -5
- package/src/theme/tokens/blurs.ts +0 -5
- package/src/theme/tokens/borders.ts +0 -4
- package/src/theme/tokens/colors.ts +0 -8
- package/src/theme/tokens/cursor.ts +0 -4
- package/src/theme/tokens/durations.ts +0 -4
- package/src/theme/tokens/easings.ts +0 -4
- package/src/theme/tokens/font-sizes.ts +0 -4
- package/src/theme/tokens/font-weights.ts +0 -4
- package/src/theme/tokens/fonts.ts +0 -4
- package/src/theme/tokens/index.ts +0 -57
- package/src/theme/tokens/letter-spacings.ts +0 -24
- package/src/theme/tokens/line-heights.ts +0 -4
- package/src/theme/tokens/radii.ts +0 -4
- package/src/theme/tokens/sizes.ts +0 -120
- package/src/theme/tokens/spacing.ts +0 -4
- package/src/theme/tokens/z-index.ts +0 -4
- package/src/utils/extractStyleProps.ts +0 -26
- package/src/utils/fixedForwardRef.ts +0 -17
- package/tsconfig.json +0 -38
- package/vite.config.ts +0 -54
- package/vitest.config.ts +0 -50
package/src/docs/transitions.mdx
DELETED
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: Style Props-Transitions
|
|
3
|
-
title: Transitions
|
|
4
|
-
description:
|
|
5
|
-
JSX style props for controlling an element's transition and animation.
|
|
6
|
-
documentState: InitialDraft
|
|
7
|
-
order: 999
|
|
8
|
-
menu:
|
|
9
|
-
- Style Props
|
|
10
|
-
- Transitions
|
|
11
|
-
tags:
|
|
12
|
-
- document
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Transitions
|
|
16
|
-
|
|
17
|
-
JSX style props for controlling an element's transition and animation.
|
|
18
|
-
|
|
19
|
-
## Transition
|
|
20
|
-
|
|
21
|
-
Use the `transition` prop to control the transition of an element.
|
|
22
|
-
|
|
23
|
-
```jsx
|
|
24
|
-
// hardcoded value
|
|
25
|
-
<Box bg="red.400" _hover={{ bg: "red.500" }} transition="background 0.2s ease-in-out">
|
|
26
|
-
Hover me
|
|
27
|
-
</Box>
|
|
28
|
-
|
|
29
|
-
// shortcut value
|
|
30
|
-
<Box bg="red.400" _hover={{ bg: "red.500" }} transition="backgrounds">
|
|
31
|
-
Hover me
|
|
32
|
-
</Box>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
| Prop | CSS Property | Token Category |
|
|
36
|
-
| ------------ | ------------ | -------------- |
|
|
37
|
-
| `transition` | `transition` | - |
|
|
38
|
-
|
|
39
|
-
## Transition Timing Function
|
|
40
|
-
|
|
41
|
-
Use the `transitionTimingFunction` prop to control the timing function of a
|
|
42
|
-
transition.
|
|
43
|
-
|
|
44
|
-
```jsx
|
|
45
|
-
<Box
|
|
46
|
-
bg="red.400"
|
|
47
|
-
_hover={{ bg: "red.500" }}
|
|
48
|
-
transition="backgrounds"
|
|
49
|
-
transitionTimingFunction="ease-in-out"
|
|
50
|
-
>
|
|
51
|
-
Hover me
|
|
52
|
-
</Box>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
| Prop | CSS Property | Token Category |
|
|
56
|
-
| -------------------------- | ---------------------------- | -------------- |
|
|
57
|
-
| `transitionTimingFunction` | `transition-timing-function` | `easings` |
|
|
58
|
-
|
|
59
|
-
## Transition Duration
|
|
60
|
-
|
|
61
|
-
Use the `transitionDuration` prop to control the duration of a transition.
|
|
62
|
-
|
|
63
|
-
```jsx
|
|
64
|
-
<Box
|
|
65
|
-
bg="red.400"
|
|
66
|
-
_hover={{ bg: "red.500" }}
|
|
67
|
-
transition="backgrounds"
|
|
68
|
-
transitionDuration="fast"
|
|
69
|
-
>
|
|
70
|
-
Hover me
|
|
71
|
-
</Box>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
| Prop | CSS Property | Token Category |
|
|
75
|
-
| -------------------- | --------------------- | -------------- |
|
|
76
|
-
| `transitionDuration` | `transition-duration` | `durations` |
|
|
77
|
-
|
|
78
|
-
## Transition Delay
|
|
79
|
-
|
|
80
|
-
Use the `transitionDelay` prop to control the delay of a transition.
|
|
81
|
-
|
|
82
|
-
```jsx
|
|
83
|
-
<Box
|
|
84
|
-
bg="red.400"
|
|
85
|
-
_hover={{ bg: "red.500" }}
|
|
86
|
-
transition="backgrounds"
|
|
87
|
-
transitionDelay="fast"
|
|
88
|
-
>
|
|
89
|
-
Hover me
|
|
90
|
-
</Box>
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
| Prop | CSS Property | Token Category |
|
|
94
|
-
| ----------------- | ------------------ | -------------- |
|
|
95
|
-
| `transitionDelay` | `transition-delay` | `durations` |
|
|
96
|
-
|
|
97
|
-
## Animation
|
|
98
|
-
|
|
99
|
-
Use the `animation` prop to control the animation of an element.
|
|
100
|
-
|
|
101
|
-
```jsx
|
|
102
|
-
<Box animation="bounce" />
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
| Prop | CSS Property | Token Category |
|
|
106
|
-
| ----------- | ---------------- | -------------- |
|
|
107
|
-
| `animation` | `animation-name ` | `animations` |
|
|
108
|
-
|
|
109
|
-
## Animation Name
|
|
110
|
-
|
|
111
|
-
Use the `animationName` prop to control the name of an animation. Compose
|
|
112
|
-
multiple animation names to create complex animations.
|
|
113
|
-
|
|
114
|
-
:::info
|
|
115
|
-
|
|
116
|
-
The value of the `animation` prop points to a global keyframe animation. Use the
|
|
117
|
-
`theme.keyframes` object to define the animation.
|
|
118
|
-
|
|
119
|
-
:::
|
|
120
|
-
|
|
121
|
-
```jsx
|
|
122
|
-
<Box animationName="bounce, fade-in" animationDuration="fast" />
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
| Prop | CSS Property | Token Category |
|
|
126
|
-
| --------------- | ---------------- | -------------- |
|
|
127
|
-
| `animationName` | `animation-name` | `animations` |
|
|
128
|
-
|
|
129
|
-
## Animation Timing Function
|
|
130
|
-
|
|
131
|
-
Use the `animationTimingFunction` prop to control the timing function of an
|
|
132
|
-
animation.
|
|
133
|
-
|
|
134
|
-
```jsx
|
|
135
|
-
<Box animation="bounce" animationTimingFunction="ease-in-out" />
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
| Prop | CSS Property | Token Category |
|
|
139
|
-
| ------------------------- | --------------------------- | -------------- |
|
|
140
|
-
| `animationTimingFunction` | `animation-timing-function` | `easings` |
|
|
141
|
-
|
|
142
|
-
## Animation Duration
|
|
143
|
-
|
|
144
|
-
Use the `animationDuration` prop to control the duration of an animation.
|
|
145
|
-
|
|
146
|
-
```jsx
|
|
147
|
-
<Box animation="bounce" animationDuration="fast" />
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
| Prop | CSS Property | Token Category |
|
|
151
|
-
| ------------------- | -------------------- | -------------- |
|
|
152
|
-
| `animationDuration` | `animation-duration` | `durations` |
|
|
153
|
-
|
|
154
|
-
## Animation Delay
|
|
155
|
-
|
|
156
|
-
Use the `animationDelay` prop to control the delay of an animation.
|
|
157
|
-
|
|
158
|
-
```jsx
|
|
159
|
-
<Box animation="bounce" animationDelay="fast" />
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
| Prop | CSS Property | Token Category |
|
|
163
|
-
| ---------------- | ----------------- | -------------- |
|
|
164
|
-
| `animationDelay` | `animation-delay` | `durations` |
|
package/src/docs/typography.mdx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: Components-Typography
|
|
3
|
-
title: Typography
|
|
4
|
-
description: Components for text styling and formatting.
|
|
5
|
-
documentState: InitialDraft
|
|
6
|
-
order: 6
|
|
7
|
-
menu:
|
|
8
|
-
- Components
|
|
9
|
-
- Typography
|
|
10
|
-
tags:
|
|
11
|
-
- document
|
|
12
|
-
icon: FontDownload
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Typography
|
|
16
|
-
|
|
17
|
-
Components for text styling and formatting.
|
package/src/docs/utilities.mdx
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: Components-Utilities
|
|
3
|
-
title: Utilities
|
|
4
|
-
description: Low-level or functional components for utility purposes.
|
|
5
|
-
documentState: InitialDraft
|
|
6
|
-
order: 8
|
|
7
|
-
menu:
|
|
8
|
-
- Components
|
|
9
|
-
- Utilities
|
|
10
|
-
tags:
|
|
11
|
-
- document
|
|
12
|
-
icon: Construction
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# Utilities
|
|
16
|
-
|
|
17
|
-
Low-level or functional components for utility purposes.
|
package/src/hooks/index.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: useCopyToClipboard
|
|
3
|
-
title: useCopyToClipboard
|
|
4
|
-
description: copy text to the clipboard
|
|
5
|
-
documentState: InitialDraft
|
|
6
|
-
order: 999
|
|
7
|
-
menu:
|
|
8
|
-
- Hooks
|
|
9
|
-
- useCopyToClipboard
|
|
10
|
-
tags:
|
|
11
|
-
- clipboard
|
|
12
|
-
- copy
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# useCopyToClipboard
|
|
16
|
-
|
|
17
|
-
Copy text to a user's clipboard.
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
20
|
-
|
|
21
|
-
```jsx
|
|
22
|
-
const Demo = () => {
|
|
23
|
-
const [text, setText] = React.useState("");
|
|
24
|
-
const [state, copyToClipboard] = useCopyToClipboard();
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<div>
|
|
28
|
-
<input value={text} onChange={(e) => setText(e.target.value)} />
|
|
29
|
-
<button type="button" onClick={() => copyToClipboard(text)}>
|
|
30
|
-
copy text
|
|
31
|
-
</button>
|
|
32
|
-
{state.error ? (
|
|
33
|
-
<p>Unable to copy value: {state.error.message}</p>
|
|
34
|
-
) : (
|
|
35
|
-
state.value && <p>Copied {state.value}</p>
|
|
36
|
-
)}
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Reference
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
const [{ value, error, noUserInteraction }, copyToClipboard] =
|
|
46
|
-
useCopyToClipboard();
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
- `value` — value that was copied to clipboard, undefined when nothing was
|
|
50
|
-
copied.
|
|
51
|
-
- `error` — caught error when trying to copy to clipboard.
|
|
52
|
-
- `noUserInteraction` — boolean indicating if user interaction was
|
|
53
|
-
required to copy the value to clipboard to expose full API from underlying
|
|
54
|
-
[`copy-to-clipboard`](https://github.com/sudodoki/copy-to-clipboard) library.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useCopyToClipboard } from "react-use";
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: useHotkeys
|
|
3
|
-
title: useHotkeys
|
|
4
|
-
description: use keyboard shortcuts to do stuff
|
|
5
|
-
documentState: InitialDraft
|
|
6
|
-
order: 999
|
|
7
|
-
menu:
|
|
8
|
-
- Hooks
|
|
9
|
-
- useHotkeys
|
|
10
|
-
tags:
|
|
11
|
-
- keys
|
|
12
|
-
- shortcut
|
|
13
|
-
- keyboard
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
# useHotkeys
|
|
17
|
-
|
|
18
|
-
This hook allows you to listen to hotkeys in a declarative way and execute a
|
|
19
|
-
callback function once the user pressed down the given hotkey.
|
|
20
|
-
|
|
21
|
-
## Basic Usage
|
|
22
|
-
|
|
23
|
-
Import the `useHotkeys` hook from the package:
|
|
24
|
-
|
|
25
|
-
```js
|
|
26
|
-
import { useHotkeys } from "@commercetools/nimbus";
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Simple Hotkey
|
|
30
|
-
|
|
31
|
-
The most basic usage for the hook is to assign a hotkey you want to listen to
|
|
32
|
-
and a callback to get executed once the user hits that key.
|
|
33
|
-
|
|
34
|
-
```jsx-live
|
|
35
|
-
import { useHotkeys } from "@commercetools/nimbus";
|
|
36
|
-
|
|
37
|
-
const App = () => {
|
|
38
|
-
useHotkeys("a", () => alert("Key a was pressed"));
|
|
39
|
-
|
|
40
|
-
return <span>Press the a key to see it work.</span>;
|
|
41
|
-
};
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## More stuff
|
|
45
|
-
|
|
46
|
-
Use the documentation of the underlying library for now:
|
|
47
|
-
|
|
48
|
-
https://react-hotkeys-hook.vercel.app/docs/intro
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { useHotkeys } from "./use-hotkeys";
|
|
3
|
-
import { userEvent, expect, fn } from "@storybook/test";
|
|
4
|
-
import { useState } from "react";
|
|
5
|
-
|
|
6
|
-
const UseHotkeysDemo = ({
|
|
7
|
-
combo,
|
|
8
|
-
onHotkey = () => {},
|
|
9
|
-
}: {
|
|
10
|
-
combo: string;
|
|
11
|
-
onHotkey?: () => void;
|
|
12
|
-
}) => {
|
|
13
|
-
const [ran, setRan] = useState(0);
|
|
14
|
-
|
|
15
|
-
useHotkeys(combo, () => {
|
|
16
|
-
setRan(ran + 1);
|
|
17
|
-
onHotkey();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div>
|
|
22
|
-
{ran >= 1
|
|
23
|
-
? `Success, fn ran ${ran} x times`
|
|
24
|
-
: `Click here + hit ${combo} to trigger hotkey`}
|
|
25
|
-
</div>
|
|
26
|
-
);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const meta: Meta<typeof UseHotkeysDemo> = {
|
|
30
|
-
title: "Hooks/useHotkeys",
|
|
31
|
-
component: UseHotkeysDemo,
|
|
32
|
-
parameters: {
|
|
33
|
-
layout: "centered",
|
|
34
|
-
},
|
|
35
|
-
tags: ["!autodocs"],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default meta;
|
|
39
|
-
type Story = StoryObj<typeof UseHotkeysDemo>;
|
|
40
|
-
|
|
41
|
-
export const SingleKey: Story = {
|
|
42
|
-
args: {
|
|
43
|
-
combo: "esc",
|
|
44
|
-
onHotkey: fn(),
|
|
45
|
-
},
|
|
46
|
-
play: async ({ args, step }) => {
|
|
47
|
-
const onHotkey = args.onHotkey;
|
|
48
|
-
await step("Trigger hotkey", async () => {
|
|
49
|
-
await expect(onHotkey).toHaveBeenCalledTimes(0);
|
|
50
|
-
await userEvent.keyboard("{esc}");
|
|
51
|
-
await expect(onHotkey).toHaveBeenCalledTimes(1);
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const KeyCombo: Story = {
|
|
57
|
-
args: {
|
|
58
|
-
combo: "Ctrl+l",
|
|
59
|
-
onHotkey: fn(),
|
|
60
|
-
},
|
|
61
|
-
play: async ({ args, step }) => {
|
|
62
|
-
const onHotkey = args.onHotkey;
|
|
63
|
-
await step("Trigger hotkey combination", async () => {
|
|
64
|
-
await expect(onHotkey).toHaveBeenCalledTimes(0);
|
|
65
|
-
await userEvent.keyboard("{Control>}l{/Control}");
|
|
66
|
-
await expect(onHotkey).toHaveBeenCalledTimes(1);
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useHotkeys } from "react-hotkeys-hook";
|
package/src/index.ts
DELETED
package/src/test/utils.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import {
|
|
3
|
-
render,
|
|
4
|
-
type RenderOptions,
|
|
5
|
-
type RenderResult,
|
|
6
|
-
} from "@testing-library/react";
|
|
7
|
-
import { NimbusProvider } from "@/components";
|
|
8
|
-
import { userEvent as baseUserEvent } from "@testing-library/user-event";
|
|
9
|
-
|
|
10
|
-
const renderWithProvider = (
|
|
11
|
-
ui: ReactNode,
|
|
12
|
-
options?: RenderOptions
|
|
13
|
-
): RenderResult => {
|
|
14
|
-
return render(<NimbusProvider>{ui}</NimbusProvider>, options);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export * from "@testing-library/react";
|
|
18
|
-
export const userEvent = baseUserEvent.setup();
|
|
19
|
-
export { act } from "react";
|
|
20
|
-
export { renderWithProvider as render };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { defineAnimationStyles } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
type AnimationStylesType = ReturnType<typeof defineAnimationStyles>;
|
|
4
|
-
|
|
5
|
-
export const animationStyles: AnimationStylesType = defineAnimationStyles({
|
|
6
|
-
"slide-fade-in": {
|
|
7
|
-
value: {
|
|
8
|
-
transformOrigin: "var(--transform-origin)",
|
|
9
|
-
"&[data-placement^=top]": {
|
|
10
|
-
animationName: "slide-from-bottom, fade-in",
|
|
11
|
-
},
|
|
12
|
-
"&[data-placement^=bottom]": {
|
|
13
|
-
animationName: "slide-from-top, fade-in",
|
|
14
|
-
},
|
|
15
|
-
"&[data-placement^=left]": {
|
|
16
|
-
animationName: "slide-from-right, fade-in",
|
|
17
|
-
},
|
|
18
|
-
"&[data-placement^=right]": {
|
|
19
|
-
animationName: "slide-from-left, fade-in",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
"slide-fade-out": {
|
|
24
|
-
value: {
|
|
25
|
-
transformOrigin: "var(--transform-origin)",
|
|
26
|
-
"&[data-placement^=top]": {
|
|
27
|
-
animationName: "slide-to-bottom, fade-out",
|
|
28
|
-
},
|
|
29
|
-
"&[data-placement^=bottom]": {
|
|
30
|
-
animationName: "slide-to-top, fade-out",
|
|
31
|
-
},
|
|
32
|
-
"&[data-placement^=left]": {
|
|
33
|
-
animationName: "slide-to-right, fade-out",
|
|
34
|
-
},
|
|
35
|
-
"&[data-placement^=right]": {
|
|
36
|
-
animationName: "slide-to-left, fade-out",
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
"scale-fade-in": {
|
|
41
|
-
value: {
|
|
42
|
-
transformOrigin: "var(--transform-origin)",
|
|
43
|
-
animationName: "scale-in, fade-in",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
"scale-fade-out": {
|
|
47
|
-
value: {
|
|
48
|
-
transformOrigin: "var(--transform-origin)",
|
|
49
|
-
animationName: "scale-out, fade-out",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
});
|
package/src/theme/breakpoints.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { themeTokens } from "@commercetools/nimbus-tokens";
|
|
2
|
-
|
|
3
|
-
interface BreakpointValue {
|
|
4
|
-
value?: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface BreakpointsTokenObject {
|
|
9
|
-
[key: string]: string | BreakpointValue;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface TransformedBreakpoints {
|
|
13
|
-
[key: string]: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function transformBreakpoints(
|
|
17
|
-
input: BreakpointsTokenObject
|
|
18
|
-
): TransformedBreakpoints {
|
|
19
|
-
const transformed: TransformedBreakpoints = {};
|
|
20
|
-
|
|
21
|
-
for (const key in input) {
|
|
22
|
-
if ((input[key] as BreakpointValue)?.value) {
|
|
23
|
-
transformed[key] = (input[key] as BreakpointValue).value!;
|
|
24
|
-
} else {
|
|
25
|
-
transformed[key] = input[key] as string;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return transformed;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const breakpoints = transformBreakpoints(themeTokens.breakpoints);
|
package/src/theme/global-css.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { defineGlobalStyles } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
-
export const globalCss = defineGlobalStyles({
|
|
4
|
-
"*": {
|
|
5
|
-
fontFeatureSettings:
|
|
6
|
-
'"liga", "calt", "case", "ss01", "ss07", "ss08", "tnum"',
|
|
7
|
-
"--ring-inset": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
8
|
-
"--ring-offset-width": "0px",
|
|
9
|
-
"--ring-offset-color": "#fff",
|
|
10
|
-
"--ring-color": "rgba(66, 153, 225, 0.6)",
|
|
11
|
-
"--ring-offset-shadow": "0 0 #0000",
|
|
12
|
-
"--ring-shadow": "0 0 #0000",
|
|
13
|
-
"--focus-ring-color": "colors.primary.7",
|
|
14
|
-
"--brightness": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
15
|
-
"--contrast": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
16
|
-
"--grayscale": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
17
|
-
"--hue-rotate": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
18
|
-
"--invert": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
19
|
-
"--saturate": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
20
|
-
"--sepia": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
21
|
-
"--drop-shadow": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
22
|
-
"--backdrop-blur": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
23
|
-
"--backdrop-brightness": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
24
|
-
"--backdrop-contrast": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
25
|
-
"--backdrop-grayscale": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
26
|
-
"--backdrop-hue-rotate": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
27
|
-
"--backdrop-invert": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
28
|
-
"--backdrop-opacity": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
29
|
-
"--backdrop-saturate": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
30
|
-
"--backdrop-sepia": "var(--chakra-empty,/*!*/ /*!*/)",
|
|
31
|
-
"--global-font-mono": "fonts.mono",
|
|
32
|
-
"--global-font-body": "fonts.body",
|
|
33
|
-
"--global-color-border": "colors.border",
|
|
34
|
-
},
|
|
35
|
-
/** 'liga' may replace 2 characters with a single one,
|
|
36
|
-
* which causes differences in formatting when a monospace font is used.*/
|
|
37
|
-
"code *": {
|
|
38
|
-
fontFeatureSettings: '"calt", "case", "ss01", "ss07", "ss08", "tnum"',
|
|
39
|
-
},
|
|
40
|
-
html: {
|
|
41
|
-
color: "fg",
|
|
42
|
-
bg: "bg",
|
|
43
|
-
lineHeight: "1.5",
|
|
44
|
-
colorPalette: "neutral",
|
|
45
|
-
},
|
|
46
|
-
"*::placeholder": {
|
|
47
|
-
color: "fg.muted/80",
|
|
48
|
-
},
|
|
49
|
-
"*::selection": {
|
|
50
|
-
bg: "colorPalette.9",
|
|
51
|
-
color: "colorPalette.contrast",
|
|
52
|
-
},
|
|
53
|
-
});
|
package/src/theme/index.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSystem,
|
|
3
|
-
defaultBaseConfig,
|
|
4
|
-
defineConfig,
|
|
5
|
-
} from "@chakra-ui/react";
|
|
6
|
-
import { animationStyles } from "./animation-styles";
|
|
7
|
-
import { breakpoints } from "./breakpoints";
|
|
8
|
-
import { globalCss } from "./global-css";
|
|
9
|
-
import { keyframes } from "./keyframes";
|
|
10
|
-
import { layerStyles } from "./layer-styles";
|
|
11
|
-
import { recipes } from "./recipes";
|
|
12
|
-
import { semanticTokens } from "./semantic-tokens";
|
|
13
|
-
import { slotRecipes } from "./slot-recipes";
|
|
14
|
-
import { textStyles } from "./text-styles";
|
|
15
|
-
import { tokens } from "./tokens";
|
|
16
|
-
|
|
17
|
-
const themeConfig = defineConfig({
|
|
18
|
-
preflight: true,
|
|
19
|
-
cssVarsPrefix: "nimbus",
|
|
20
|
-
cssVarsRoot: ":where(:root, :host)",
|
|
21
|
-
globalCss,
|
|
22
|
-
theme: {
|
|
23
|
-
breakpoints,
|
|
24
|
-
keyframes,
|
|
25
|
-
tokens,
|
|
26
|
-
semanticTokens,
|
|
27
|
-
recipes,
|
|
28
|
-
slotRecipes,
|
|
29
|
-
textStyles,
|
|
30
|
-
layerStyles,
|
|
31
|
-
animationStyles,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const system = createSystem(defaultBaseConfig, themeConfig);
|