@conveyorhq/arrow-ds 2.0.0-beta.7 → 2.0.0-beta.9
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/package.json +15 -14
- package/public/components/Accordion/Accordion.js +8 -10
- package/public/components/Avatar/Avatar.js +20 -19
- package/public/components/Button/Button.js +2 -2
- package/public/components/ConveyorLogo/ConveyorLogo.js +6 -6
- package/public/components/Drawer/Drawer.js +7 -7
- package/public/components/Frame/Frame.d.ts +1 -1
- package/public/components/Icon/Icon.d.ts +1 -0
- package/public/components/Icon/Icon.js +3 -1
- package/public/components/MenuRenderer/MenuRenderer.js +4 -7
- package/public/components/Modal/Modal.js +1 -1
- package/public/components/OptionButton/OptionButton.js +18 -13
- package/public/components/Select/Select.js +4 -4
- package/public/components/Select/SelectPopover.js +6 -6
- package/public/components/Select/index.d.ts +2 -0
- package/public/components/Select/index.js +3 -0
- package/public/components/Select/theme.js +22 -22
- package/public/components/Svg/Svg.d.ts +3 -3
- package/public/components/Svg/Svg.js +1 -2
- package/public/components/Tooltip/Tooltip.js +11 -19
- package/public/components/VisuallyHidden/VisuallyHidden.d.ts +2 -1
- package/public/components/VisuallyHidden/VisuallyHidden.js +3 -5
- package/public/css/styles.css +139 -59
- package/public/css/styles.min.css +1 -1
- package/public/css/styles.min.css.map +1 -1
- package/public/hooks/index.d.ts +3 -0
- package/public/hooks/index.js +7 -1
- package/public/hooks/useMatchMedia.d.ts +1 -0
- package/public/hooks/useMatchMedia.js +27 -0
- package/public/hooks/usePrefersReducedMotion.d.ts +1 -0
- package/public/hooks/usePrefersReducedMotion.js +9 -0
- package/public/hooks/useScreenOrientation.d.ts +1 -0
- package/public/hooks/useScreenOrientation.js +24 -0
- package/public/{style-dictionary → src/style-dictionary}/dist/tokens.css +1 -0
- package/public/src/style-dictionary/dist/tokens.d.ts +428 -0
- package/public/src/style-dictionary/dist/tokens.js +428 -0
- package/public/src/style-dictionary/dist/tokens.module.js +428 -0
- package/public/src/style-dictionary/tailwind.config.js +87 -0
- package/public/storybook-components/EnumTable.js +2 -1
- package/public/storybook-components/Story.d.ts +2 -1
- package/public/storybook-components/Story.js +4 -1
- package/public/style-dictionary/dist/tokens.d.ts +428 -422
- package/public/style-dictionary/dist/tokens.js +415 -416
- package/public/style-dictionary/dist/tokens.module.d.ts +431 -0
- package/public/style-dictionary/dist/tokens.module.js +412 -415
- package/public/style-dictionary/src/border-radius.d.ts +31 -0
- package/public/style-dictionary/src/border-radius.js +10 -9
- package/public/style-dictionary/src/border-width.d.ts +21 -0
- package/public/style-dictionary/src/border-width.js +9 -8
- package/public/style-dictionary/src/color.d.ts +249 -0
- package/public/style-dictionary/src/color.js +97 -95
- package/public/style-dictionary/src/font-size.d.ts +45 -0
- package/public/style-dictionary/src/font-size.js +14 -13
- package/public/style-dictionary/src/font-weight.d.ts +13 -0
- package/public/style-dictionary/src/font-weight.js +6 -5
- package/public/style-dictionary/src/height.d.ts +215 -0
- package/public/style-dictionary/src/height.js +10 -10
- package/public/style-dictionary/src/leading.d.ts +17 -0
- package/public/style-dictionary/src/leading.js +7 -6
- package/public/style-dictionary/src/screen-width.d.ts +17 -0
- package/public/style-dictionary/src/screen-width.js +7 -6
- package/public/style-dictionary/src/shadow.d.ts +63 -0
- package/public/style-dictionary/src/shadow.js +19 -18
- package/public/style-dictionary/src/spacing.d.ts +197 -0
- package/public/style-dictionary/src/spacing.js +68 -67
- package/public/style-dictionary/src/tracking.d.ts +13 -0
- package/public/style-dictionary/src/tracking.js +6 -5
- package/public/style-dictionary/src/type.d.ts +13 -0
- package/public/style-dictionary/src/type.js +32 -31
- package/public/style-dictionary/src/width.d.ts +287 -0
- package/public/style-dictionary/src/width.js +29 -29
- package/public/style-dictionary/src/z-index.d.ts +53 -0
- package/public/style-dictionary/src/z-index.js +20 -19
- package/public/style-dictionary/tailwind.config.d.ts +392 -0
- package/public/style-dictionary/tailwind.config.js +51 -72
- package/src/components/Accordion/Accordion.tsx +39 -27
- package/src/components/Avatar/Avatar.tsx +20 -19
- package/src/components/Button/Button.tsx +3 -3
- package/src/components/Button/index.css +12 -1
- package/src/components/Card/Card.story.mdx +45 -37
- package/src/components/ConveyorLogo/ConveyorLogo.tsx +6 -6
- package/src/components/Drawer/Drawer.tsx +1 -1
- package/src/components/Frame/Frame.story.mdx +140 -5
- package/src/components/Frame/Frame.tsx +1 -1
- package/src/components/Frame/index.css +8 -13
- package/src/components/Icon/Icon.tsx +3 -0
- package/src/components/MenuRenderer/MenuRenderer.tsx +7 -9
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Modal/index.css +8 -3
- package/src/components/OptionButton/OptionButton.story.mdx +91 -36
- package/src/components/OptionButton/OptionButton.tsx +19 -18
- package/src/components/OptionButton/index.css +13 -0
- package/src/components/Overlay/Overlay.story.mdx +26 -0
- package/src/components/Select/Select.tsx +4 -4
- package/src/components/Select/SelectPopover.tsx +6 -6
- package/src/components/Select/index.ts +14 -0
- package/src/components/Select/theme.ts +22 -22
- package/src/components/Svg/Svg.story.mdx +36 -0
- package/src/components/Svg/Svg.tsx +6 -4
- package/src/components/Text/Text.story.mdx +34 -0
- package/src/components/Tooltip/Tooltip.story.mdx +21 -0
- package/src/components/Tooltip/Tooltip.tsx +23 -27
- package/src/components/Tooltip/index.css +31 -0
- package/src/components/VisuallyHidden/VisuallyHidden.story.mdx +54 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +10 -5
- package/src/components/VisuallyHidden/index.css +3 -0
- package/src/css/components.css +2 -0
- package/src/docs/Colors.story.mdx +13 -13
- package/src/docs/Spacing.story.mdx +4 -20
- package/src/docs/Tokens.story.mdx +230 -0
- package/src/docs/Typography.story.mdx +17 -94
- package/src/docs/hooks/useDisclosureHook.story.mdx +58 -0
- package/src/docs/hooks/useKeyPressHook.story.mdx +54 -0
- package/src/docs/hooks/useMatchMediaHook.story.mdx +42 -0
- package/src/docs/hooks/useOutsideClickHook.story.mdx +56 -0
- package/src/docs/hooks/usePrefersReducedMotion.story.mdx +61 -0
- package/src/docs/hooks/useScreenOrientationHook.story.mdx +56 -0
- package/src/docs/hooks/useStepHook.story.mdx +102 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useMatchMedia.ts +40 -0
- package/src/hooks/usePrefersReducedMotion.ts +9 -0
- package/src/hooks/useScreenOrientation.ts +27 -0
- package/src/storybook-components/EnumTable.tsx +3 -2
- package/src/storybook-components/Story.tsx +13 -1
- package/src/style-dictionary/dist/tokens.css +378 -0
- package/src/style-dictionary/dist/tokens.d.ts +428 -0
- package/src/style-dictionary/dist/tokens.js +428 -0
- package/src/style-dictionary/dist/tokens.module.js +428 -0
- package/src/style-dictionary/src/border-radius.js +11 -0
- package/src/style-dictionary/src/border-width.js +10 -0
- package/src/style-dictionary/src/color.js +98 -0
- package/src/style-dictionary/src/font-size.js +15 -0
- package/src/style-dictionary/src/font-weight.js +7 -0
- package/src/style-dictionary/src/height.js +13 -0
- package/src/style-dictionary/src/leading.js +8 -0
- package/src/style-dictionary/src/screen-width.js +8 -0
- package/src/style-dictionary/src/shadow.js +19 -0
- package/src/style-dictionary/src/spacing.js +69 -0
- package/src/style-dictionary/src/tracking.js +7 -0
- package/src/style-dictionary/src/type.js +34 -0
- package/src/style-dictionary/src/width.js +32 -0
- package/src/style-dictionary/src/z-index.js +21 -0
- package/src/style-dictionary/tailwind.config.js +87 -0
- package/src/tokens/borders.ts +6 -0
- package/src/tokens/box-shadow.ts +3 -0
- package/src/tokens/colors.ts +6 -0
- package/src/tokens/font-family.ts +3 -0
- package/src/tokens/font-size.ts +3 -0
- package/src/tokens/font-weight.ts +3 -0
- package/src/tokens/height.ts +3 -0
- package/src/tokens/index.ts +3 -2
- package/src/tokens/letter-spacing.ts +3 -0
- package/src/tokens/line-height.ts +3 -0
- package/src/tokens/margin.ts +3 -0
- package/src/tokens/padding.ts +3 -0
- package/src/tokens/screens.ts +3 -0
- package/src/tokens/sizing-scale.ts +6 -0
- package/src/tokens/width.ts +9 -0
- package/src/tokens/will-change.ts +3 -0
- package/src/tokens/z-index.ts +3 -0
- package/src/types/index.ts +3 -0
- package/public/components/Overlay/Overlay.story.d.ts +0 -1
- package/public/components/Overlay/Overlay.story.js +0 -12
- package/public/components/Svg/Svg.story.d.ts +0 -1
- package/public/components/Svg/Svg.story.js +0 -14
- package/public/components/Text/Text.story.d.ts +0 -1
- package/public/components/Text/Text.story.js +0 -31
- package/public/components/VisuallyHidden/VisuallyHidden.story.d.ts +0 -1
- package/public/components/VisuallyHidden/VisuallyHidden.story.js +0 -36
- package/public/components/useStep/ExampleSetupWizard.d.ts +0 -4
- package/public/components/useStep/ExampleSetupWizard.js +0 -33
- package/src/components/Overlay/Overlay.md +0 -14
- package/src/components/Overlay/Overlay.story.tsx +0 -12
- package/src/components/Svg/Svg.md +0 -14
- package/src/components/Svg/Svg.story.tsx +0 -15
- package/src/components/Text/Text.md +0 -14
- package/src/components/Text/Text.story.tsx +0 -12
- package/src/components/VisuallyHidden/VisuallyHidden.md +0 -23
- package/src/components/VisuallyHidden/VisuallyHidden.story.tsx +0 -19
- package/src/components/useStep/ExampleSetupWizard.tsx +0 -63
- package/src/components/useStep/useStep.story.mdx +0 -76
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Usage
|
|
2
|
-
|
|
3
|
-
`<VisuallyHidden />` provides text for screen readers that is visually hidden. It is the logical opposite of the aria-hidden attribute.
|
|
4
|
-
|
|
5
|
-
`import { VisuallyHidden } from "@conveyorhq/arrow-ds"`
|
|
6
|
-
|
|
7
|
-
In the following example, screen readers will announce "Sync" and will ignore the icon; the browser displays the icon and ignores the text.
|
|
8
|
-
|
|
9
|
-
```jsx
|
|
10
|
-
<button>
|
|
11
|
-
<VisuallyHidden>Sync</VisuallyHidden>
|
|
12
|
-
<Icon icon="sync" />
|
|
13
|
-
</button>
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
Further reading: https://a11yproject.com/posts/how-to-hide-content/
|
|
17
|
-
|
|
18
|
-
## Props
|
|
19
|
-
|
|
20
|
-
| Prop | Type | Required | Description |
|
|
21
|
-
|:--- |:--- |:--- |:--- |
|
|
22
|
-
| className | ClassName | No | CSS Classname applied to underlying div
|
|
23
|
-
| children | React.Node | Yes | Child nodes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { storiesOf } from "@storybook/react";
|
|
3
|
-
import Story from "../../storybook-components/Story";
|
|
4
|
-
import { Box } from "../Box";
|
|
5
|
-
import { Icon, ICON_TYPE } from "../Icon";
|
|
6
|
-
import { VisuallyHidden } from "./VisuallyHidden";
|
|
7
|
-
|
|
8
|
-
const stories = storiesOf("Components/Disclosure/Visually Hidden", module);
|
|
9
|
-
|
|
10
|
-
stories.add("Default", () => (
|
|
11
|
-
<Story title="VisuallyHidden">
|
|
12
|
-
<Box className="p-12">
|
|
13
|
-
<button type="button">
|
|
14
|
-
<VisuallyHidden as="span">Sync</VisuallyHidden>
|
|
15
|
-
<Icon icon={ICON_TYPE.SYNC} />
|
|
16
|
-
</button>
|
|
17
|
-
</Box>
|
|
18
|
-
</Story>
|
|
19
|
-
));
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box } from "../Box";
|
|
3
|
-
import { Panel } from "../Panel";
|
|
4
|
-
import { Button, BUTTON_VARIANT } from "../Button";
|
|
5
|
-
import { useStep } from "../../hooks/useStep";
|
|
6
|
-
|
|
7
|
-
export const ExampleSetupWizard = ({
|
|
8
|
-
steps,
|
|
9
|
-
initialStep,
|
|
10
|
-
}: {
|
|
11
|
-
steps: number;
|
|
12
|
-
initialStep?: number;
|
|
13
|
-
}) => {
|
|
14
|
-
const { step, goToNextStep, goToPreviousStep, goToStep } = useStep({
|
|
15
|
-
steps,
|
|
16
|
-
initialStep,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Box>
|
|
21
|
-
<Panel className="p-8">
|
|
22
|
-
{step === 1 && <>Step 1</>}
|
|
23
|
-
{step === 2 && <>Step 2</>}
|
|
24
|
-
{step === 3 && <>Step 3</>}
|
|
25
|
-
{step === 4 && <>Step 4</>}
|
|
26
|
-
</Panel>
|
|
27
|
-
|
|
28
|
-
<Button.Group className="mt-4 justify-end">
|
|
29
|
-
{step !== 1 && (
|
|
30
|
-
<Button.Group className="mr-auto">
|
|
31
|
-
<Button
|
|
32
|
-
variant={BUTTON_VARIANT.SECONDARY}
|
|
33
|
-
onClick={goToPreviousStep}
|
|
34
|
-
>
|
|
35
|
-
Previous Step
|
|
36
|
-
</Button>
|
|
37
|
-
</Button.Group>
|
|
38
|
-
)}
|
|
39
|
-
|
|
40
|
-
<Button
|
|
41
|
-
variant={BUTTON_VARIANT.SECONDARY}
|
|
42
|
-
onClick={() => {
|
|
43
|
-
goToStep(1);
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
Cancel
|
|
47
|
-
</Button>
|
|
48
|
-
|
|
49
|
-
{step === 4 ? (
|
|
50
|
-
<Button
|
|
51
|
-
onClick={() => {
|
|
52
|
-
console.log("Create button clicked");
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
Create
|
|
56
|
-
</Button>
|
|
57
|
-
) : (
|
|
58
|
-
<Button onClick={goToNextStep}>Next Step</Button>
|
|
59
|
-
)}
|
|
60
|
-
</Button.Group>
|
|
61
|
-
</Box>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Story, Preview, Props, Meta } from "@storybook/addon-docs/blocks";
|
|
2
|
-
import { ExampleSetupWizard } from "./ExampleSetupWizard";
|
|
3
|
-
|
|
4
|
-
<Meta title="Hooks/useStep" component={ExampleSetupWizard} />
|
|
5
|
-
|
|
6
|
-
# useStep
|
|
7
|
-
|
|
8
|
-
<Preview>
|
|
9
|
-
<Story name="useStep">
|
|
10
|
-
<ExampleSetupWizard steps={4} />
|
|
11
|
-
</Story>
|
|
12
|
-
</Preview>
|
|
13
|
-
|
|
14
|
-
## Props
|
|
15
|
-
|
|
16
|
-
<Props of={ExampleSetupWizard} />
|
|
17
|
-
|
|
18
|
-
## Example
|
|
19
|
-
|
|
20
|
-
This code snippet is from the `ExampleSetupWizard` from above.
|
|
21
|
-
|
|
22
|
-
To see an example within a modal, look at the [modal story](/?path=/docs/components-modal--default#set-up-wizard-example).
|
|
23
|
-
|
|
24
|
-
```jsx
|
|
25
|
-
export const ExampleSetupWizard = () => {
|
|
26
|
-
const { step, goToNextStep, goToPreviousStep, goToStep } = useStep({
|
|
27
|
-
steps: 4,
|
|
28
|
-
initialStep: 2,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<Box>
|
|
33
|
-
<Panel className="p-8">
|
|
34
|
-
{step === 1 && <>Step 1</>}
|
|
35
|
-
{step === 2 && <>Step 2</>}
|
|
36
|
-
{step === 3 && <>Step 3</>}
|
|
37
|
-
{step === 4 && <>Step 4</>}
|
|
38
|
-
</Panel>
|
|
39
|
-
|
|
40
|
-
<Button.Group className="mt-4 justify-end">
|
|
41
|
-
{step !== 1 && (
|
|
42
|
-
<Button.Group className="mr-auto">
|
|
43
|
-
<Button
|
|
44
|
-
variant={BUTTON_VARIANT.SECONDARY}
|
|
45
|
-
onClick={goToPreviousStep}
|
|
46
|
-
>
|
|
47
|
-
Previous Step
|
|
48
|
-
</Button>
|
|
49
|
-
</Button.Group>
|
|
50
|
-
)}
|
|
51
|
-
|
|
52
|
-
<Button
|
|
53
|
-
variant={BUTTON_VARIANT.SECONDARY}
|
|
54
|
-
onClick={() => {
|
|
55
|
-
goToStep(1);
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
Cancel
|
|
59
|
-
</Button>
|
|
60
|
-
|
|
61
|
-
{step === 4 ? (
|
|
62
|
-
<Button
|
|
63
|
-
onClick={() => {
|
|
64
|
-
console.log("Create button clicked");
|
|
65
|
-
}}
|
|
66
|
-
>
|
|
67
|
-
Create
|
|
68
|
-
</Button>
|
|
69
|
-
) : (
|
|
70
|
-
<Button onClick={goToNextStep}>Next Step</Button>
|
|
71
|
-
)}
|
|
72
|
-
</Button.Group>
|
|
73
|
-
</Box>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
```
|