@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.
Files changed (181) hide show
  1. package/package.json +15 -14
  2. package/public/components/Accordion/Accordion.js +8 -10
  3. package/public/components/Avatar/Avatar.js +20 -19
  4. package/public/components/Button/Button.js +2 -2
  5. package/public/components/ConveyorLogo/ConveyorLogo.js +6 -6
  6. package/public/components/Drawer/Drawer.js +7 -7
  7. package/public/components/Frame/Frame.d.ts +1 -1
  8. package/public/components/Icon/Icon.d.ts +1 -0
  9. package/public/components/Icon/Icon.js +3 -1
  10. package/public/components/MenuRenderer/MenuRenderer.js +4 -7
  11. package/public/components/Modal/Modal.js +1 -1
  12. package/public/components/OptionButton/OptionButton.js +18 -13
  13. package/public/components/Select/Select.js +4 -4
  14. package/public/components/Select/SelectPopover.js +6 -6
  15. package/public/components/Select/index.d.ts +2 -0
  16. package/public/components/Select/index.js +3 -0
  17. package/public/components/Select/theme.js +22 -22
  18. package/public/components/Svg/Svg.d.ts +3 -3
  19. package/public/components/Svg/Svg.js +1 -2
  20. package/public/components/Tooltip/Tooltip.js +11 -19
  21. package/public/components/VisuallyHidden/VisuallyHidden.d.ts +2 -1
  22. package/public/components/VisuallyHidden/VisuallyHidden.js +3 -5
  23. package/public/css/styles.css +139 -59
  24. package/public/css/styles.min.css +1 -1
  25. package/public/css/styles.min.css.map +1 -1
  26. package/public/hooks/index.d.ts +3 -0
  27. package/public/hooks/index.js +7 -1
  28. package/public/hooks/useMatchMedia.d.ts +1 -0
  29. package/public/hooks/useMatchMedia.js +27 -0
  30. package/public/hooks/usePrefersReducedMotion.d.ts +1 -0
  31. package/public/hooks/usePrefersReducedMotion.js +9 -0
  32. package/public/hooks/useScreenOrientation.d.ts +1 -0
  33. package/public/hooks/useScreenOrientation.js +24 -0
  34. package/public/{style-dictionary → src/style-dictionary}/dist/tokens.css +1 -0
  35. package/public/src/style-dictionary/dist/tokens.d.ts +428 -0
  36. package/public/src/style-dictionary/dist/tokens.js +428 -0
  37. package/public/src/style-dictionary/dist/tokens.module.js +428 -0
  38. package/public/src/style-dictionary/tailwind.config.js +87 -0
  39. package/public/storybook-components/EnumTable.js +2 -1
  40. package/public/storybook-components/Story.d.ts +2 -1
  41. package/public/storybook-components/Story.js +4 -1
  42. package/public/style-dictionary/dist/tokens.d.ts +428 -422
  43. package/public/style-dictionary/dist/tokens.js +415 -416
  44. package/public/style-dictionary/dist/tokens.module.d.ts +431 -0
  45. package/public/style-dictionary/dist/tokens.module.js +412 -415
  46. package/public/style-dictionary/src/border-radius.d.ts +31 -0
  47. package/public/style-dictionary/src/border-radius.js +10 -9
  48. package/public/style-dictionary/src/border-width.d.ts +21 -0
  49. package/public/style-dictionary/src/border-width.js +9 -8
  50. package/public/style-dictionary/src/color.d.ts +249 -0
  51. package/public/style-dictionary/src/color.js +97 -95
  52. package/public/style-dictionary/src/font-size.d.ts +45 -0
  53. package/public/style-dictionary/src/font-size.js +14 -13
  54. package/public/style-dictionary/src/font-weight.d.ts +13 -0
  55. package/public/style-dictionary/src/font-weight.js +6 -5
  56. package/public/style-dictionary/src/height.d.ts +215 -0
  57. package/public/style-dictionary/src/height.js +10 -10
  58. package/public/style-dictionary/src/leading.d.ts +17 -0
  59. package/public/style-dictionary/src/leading.js +7 -6
  60. package/public/style-dictionary/src/screen-width.d.ts +17 -0
  61. package/public/style-dictionary/src/screen-width.js +7 -6
  62. package/public/style-dictionary/src/shadow.d.ts +63 -0
  63. package/public/style-dictionary/src/shadow.js +19 -18
  64. package/public/style-dictionary/src/spacing.d.ts +197 -0
  65. package/public/style-dictionary/src/spacing.js +68 -67
  66. package/public/style-dictionary/src/tracking.d.ts +13 -0
  67. package/public/style-dictionary/src/tracking.js +6 -5
  68. package/public/style-dictionary/src/type.d.ts +13 -0
  69. package/public/style-dictionary/src/type.js +32 -31
  70. package/public/style-dictionary/src/width.d.ts +287 -0
  71. package/public/style-dictionary/src/width.js +29 -29
  72. package/public/style-dictionary/src/z-index.d.ts +53 -0
  73. package/public/style-dictionary/src/z-index.js +20 -19
  74. package/public/style-dictionary/tailwind.config.d.ts +392 -0
  75. package/public/style-dictionary/tailwind.config.js +51 -72
  76. package/src/components/Accordion/Accordion.tsx +39 -27
  77. package/src/components/Avatar/Avatar.tsx +20 -19
  78. package/src/components/Button/Button.tsx +3 -3
  79. package/src/components/Button/index.css +12 -1
  80. package/src/components/Card/Card.story.mdx +45 -37
  81. package/src/components/ConveyorLogo/ConveyorLogo.tsx +6 -6
  82. package/src/components/Drawer/Drawer.tsx +1 -1
  83. package/src/components/Frame/Frame.story.mdx +140 -5
  84. package/src/components/Frame/Frame.tsx +1 -1
  85. package/src/components/Frame/index.css +8 -13
  86. package/src/components/Icon/Icon.tsx +3 -0
  87. package/src/components/MenuRenderer/MenuRenderer.tsx +7 -9
  88. package/src/components/Modal/Modal.tsx +1 -1
  89. package/src/components/Modal/index.css +8 -3
  90. package/src/components/OptionButton/OptionButton.story.mdx +91 -36
  91. package/src/components/OptionButton/OptionButton.tsx +19 -18
  92. package/src/components/OptionButton/index.css +13 -0
  93. package/src/components/Overlay/Overlay.story.mdx +26 -0
  94. package/src/components/Select/Select.tsx +4 -4
  95. package/src/components/Select/SelectPopover.tsx +6 -6
  96. package/src/components/Select/index.ts +14 -0
  97. package/src/components/Select/theme.ts +22 -22
  98. package/src/components/Svg/Svg.story.mdx +36 -0
  99. package/src/components/Svg/Svg.tsx +6 -4
  100. package/src/components/Text/Text.story.mdx +34 -0
  101. package/src/components/Tooltip/Tooltip.story.mdx +21 -0
  102. package/src/components/Tooltip/Tooltip.tsx +23 -27
  103. package/src/components/Tooltip/index.css +31 -0
  104. package/src/components/VisuallyHidden/VisuallyHidden.story.mdx +54 -0
  105. package/src/components/VisuallyHidden/VisuallyHidden.tsx +10 -5
  106. package/src/components/VisuallyHidden/index.css +3 -0
  107. package/src/css/components.css +2 -0
  108. package/src/docs/Colors.story.mdx +13 -13
  109. package/src/docs/Spacing.story.mdx +4 -20
  110. package/src/docs/Tokens.story.mdx +230 -0
  111. package/src/docs/Typography.story.mdx +17 -94
  112. package/src/docs/hooks/useDisclosureHook.story.mdx +58 -0
  113. package/src/docs/hooks/useKeyPressHook.story.mdx +54 -0
  114. package/src/docs/hooks/useMatchMediaHook.story.mdx +42 -0
  115. package/src/docs/hooks/useOutsideClickHook.story.mdx +56 -0
  116. package/src/docs/hooks/usePrefersReducedMotion.story.mdx +61 -0
  117. package/src/docs/hooks/useScreenOrientationHook.story.mdx +56 -0
  118. package/src/docs/hooks/useStepHook.story.mdx +102 -0
  119. package/src/hooks/index.ts +3 -0
  120. package/src/hooks/useMatchMedia.ts +40 -0
  121. package/src/hooks/usePrefersReducedMotion.ts +9 -0
  122. package/src/hooks/useScreenOrientation.ts +27 -0
  123. package/src/storybook-components/EnumTable.tsx +3 -2
  124. package/src/storybook-components/Story.tsx +13 -1
  125. package/src/style-dictionary/dist/tokens.css +378 -0
  126. package/src/style-dictionary/dist/tokens.d.ts +428 -0
  127. package/src/style-dictionary/dist/tokens.js +428 -0
  128. package/src/style-dictionary/dist/tokens.module.js +428 -0
  129. package/src/style-dictionary/src/border-radius.js +11 -0
  130. package/src/style-dictionary/src/border-width.js +10 -0
  131. package/src/style-dictionary/src/color.js +98 -0
  132. package/src/style-dictionary/src/font-size.js +15 -0
  133. package/src/style-dictionary/src/font-weight.js +7 -0
  134. package/src/style-dictionary/src/height.js +13 -0
  135. package/src/style-dictionary/src/leading.js +8 -0
  136. package/src/style-dictionary/src/screen-width.js +8 -0
  137. package/src/style-dictionary/src/shadow.js +19 -0
  138. package/src/style-dictionary/src/spacing.js +69 -0
  139. package/src/style-dictionary/src/tracking.js +7 -0
  140. package/src/style-dictionary/src/type.js +34 -0
  141. package/src/style-dictionary/src/width.js +32 -0
  142. package/src/style-dictionary/src/z-index.js +21 -0
  143. package/src/style-dictionary/tailwind.config.js +87 -0
  144. package/src/tokens/borders.ts +6 -0
  145. package/src/tokens/box-shadow.ts +3 -0
  146. package/src/tokens/colors.ts +6 -0
  147. package/src/tokens/font-family.ts +3 -0
  148. package/src/tokens/font-size.ts +3 -0
  149. package/src/tokens/font-weight.ts +3 -0
  150. package/src/tokens/height.ts +3 -0
  151. package/src/tokens/index.ts +3 -2
  152. package/src/tokens/letter-spacing.ts +3 -0
  153. package/src/tokens/line-height.ts +3 -0
  154. package/src/tokens/margin.ts +3 -0
  155. package/src/tokens/padding.ts +3 -0
  156. package/src/tokens/screens.ts +3 -0
  157. package/src/tokens/sizing-scale.ts +6 -0
  158. package/src/tokens/width.ts +9 -0
  159. package/src/tokens/will-change.ts +3 -0
  160. package/src/tokens/z-index.ts +3 -0
  161. package/src/types/index.ts +3 -0
  162. package/public/components/Overlay/Overlay.story.d.ts +0 -1
  163. package/public/components/Overlay/Overlay.story.js +0 -12
  164. package/public/components/Svg/Svg.story.d.ts +0 -1
  165. package/public/components/Svg/Svg.story.js +0 -14
  166. package/public/components/Text/Text.story.d.ts +0 -1
  167. package/public/components/Text/Text.story.js +0 -31
  168. package/public/components/VisuallyHidden/VisuallyHidden.story.d.ts +0 -1
  169. package/public/components/VisuallyHidden/VisuallyHidden.story.js +0 -36
  170. package/public/components/useStep/ExampleSetupWizard.d.ts +0 -4
  171. package/public/components/useStep/ExampleSetupWizard.js +0 -33
  172. package/src/components/Overlay/Overlay.md +0 -14
  173. package/src/components/Overlay/Overlay.story.tsx +0 -12
  174. package/src/components/Svg/Svg.md +0 -14
  175. package/src/components/Svg/Svg.story.tsx +0 -15
  176. package/src/components/Text/Text.md +0 -14
  177. package/src/components/Text/Text.story.tsx +0 -12
  178. package/src/components/VisuallyHidden/VisuallyHidden.md +0 -23
  179. package/src/components/VisuallyHidden/VisuallyHidden.story.tsx +0 -19
  180. package/src/components/useStep/ExampleSetupWizard.tsx +0 -63
  181. 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
- ```