@everlywell/ui-kit 0.0.4-menu-next → 0.0.5-next

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 (99) hide show
  1. package/.babelrc +13 -0
  2. package/.eslintrc.json +18 -0
  3. package/.storybook/main.ts +74 -0
  4. package/.storybook/preview.tsx +33 -0
  5. package/CHANGELOG.md +25 -0
  6. package/README.md +7 -0
  7. package/package.json +12 -1
  8. package/project.json +94 -0
  9. package/src/index.ts +85 -0
  10. package/src/lib/components/Fonts/Fonts.stories.tsx +24 -0
  11. package/src/lib/components/Fonts/Fonts.tsx +86 -0
  12. package/src/lib/components/ThemeProvider/ThemeProvider.stories.tsx +24 -0
  13. package/src/lib/components/ThemeProvider/ThemeProvider.tsx +20 -0
  14. package/src/lib/stories/foundations/Colors.mdx +21 -0
  15. package/src/lib/theme/accessibility/VisuallyHidden/VisuallyHidden.mdx +27 -0
  16. package/src/lib/theme/accessibility/VisuallyHidden/VisuallyHidden.stories.tsx +23 -0
  17. package/{lib/theme/accessibility/VisuallyHidden/VisuallyHidden.d.ts → src/lib/theme/accessibility/VisuallyHidden/VisuallyHidden.tsx} +1 -0
  18. package/src/lib/theme/actions/Button/Button.config.ts +174 -0
  19. package/src/lib/theme/actions/Button/Button.mdx +67 -0
  20. package/src/lib/theme/actions/Button/Button.stories.tsx +326 -0
  21. package/src/lib/theme/actions/Button/Button.tsx +8 -0
  22. package/src/lib/theme/actions/IconButton/IconButton.config.ts +1 -0
  23. package/src/lib/theme/actions/IconButton/IconButton.mdx +51 -0
  24. package/src/lib/theme/actions/IconButton/IconButton.stories.tsx +258 -0
  25. package/src/lib/theme/actions/IconButton/IconButton.tsx +25 -0
  26. package/src/lib/theme/actions/Menu/Menu.config.ts +100 -0
  27. package/src/lib/theme/actions/Menu/Menu.mdx +43 -0
  28. package/src/lib/theme/actions/Menu/Menu.stories.tsx +150 -0
  29. package/src/lib/theme/actions/Menu/Menu.tsx +24 -0
  30. package/src/lib/theme/foundations/colors.ts +91 -0
  31. package/src/lib/theme/index.ts +163 -0
  32. package/src/lib/theme/layout/Box/Box.mdx +39 -0
  33. package/src/lib/theme/layout/Box/Box.stories.tsx +102 -0
  34. package/{lib/theme/layout/Box/Box.d.ts → src/lib/theme/layout/Box/Box.tsx} +2 -0
  35. package/src/lib/theme/layout/Grid/Grid.mdx +48 -0
  36. package/src/lib/theme/layout/Grid/Grid.stories.tsx +142 -0
  37. package/src/lib/theme/layout/Grid/Grid.tsx +80 -0
  38. package/src/lib/theme/layout/Grid/GridItem.tsx +56 -0
  39. package/src/lib/theme/layout/Show-Hide/Show-Hide.config.ts +8 -0
  40. package/src/lib/theme/layout/Show-Hide/Show-Hide.mdx +33 -0
  41. package/src/lib/theme/layout/Show-Hide/Show-Hide.stories.tsx +20 -0
  42. package/src/lib/theme/layout/Show-Hide/Show-Hide.tsx +12 -0
  43. package/src/lib/theme/media/Icon/Icon.config.ts +20 -0
  44. package/src/lib/theme/media/Icon/Icon.mdx +59 -0
  45. package/src/lib/theme/media/Icon/Icon.stories.tsx +147 -0
  46. package/src/lib/theme/media/Icon/Icon.tsx +58 -0
  47. package/src/lib/theme/navigation/Link/Link.config.ts +31 -0
  48. package/src/lib/theme/navigation/Link/Link.mdx +46 -0
  49. package/src/lib/theme/navigation/Link/Link.stories.tsx +69 -0
  50. package/src/lib/theme/navigation/Link/Link.tsx +8 -0
  51. package/src/lib/theme/overlay/Drawer/Drawer.config.tsx +74 -0
  52. package/src/lib/theme/overlay/Drawer/Drawer.mdx +44 -0
  53. package/src/lib/theme/overlay/Drawer/Drawer.stories.tsx +152 -0
  54. package/src/lib/theme/overlay/Drawer/Drawer.tsx +13 -0
  55. package/src/lib/theme/overlay/Drawer/index.ts +2 -0
  56. package/src/lib/theme/typography/Heading/Heading.config.ts +50 -0
  57. package/src/lib/theme/typography/Heading/Heading.mdx +33 -0
  58. package/src/lib/theme/typography/Heading/Heading.stories.tsx +52 -0
  59. package/src/lib/theme/typography/Heading/Heading.tsx +9 -0
  60. package/src/lib/theme/typography/Text/Text.config.ts +33 -0
  61. package/src/lib/theme/typography/Text/Text.mdx +40 -0
  62. package/src/lib/theme/typography/Text/Text.stories.tsx +104 -0
  63. package/src/lib/theme/typography/Text/Text.tsx +8 -0
  64. package/src/lib/utils/utils.storybook.ts +45 -0
  65. package/tsconfig.json +25 -0
  66. package/tsconfig.lib.json +27 -0
  67. package/tsconfig.spec.json +25 -0
  68. package/tsconfig.storybook.json +32 -0
  69. package/vite.config.ts +67 -0
  70. package/.yarn/install-state.gz +0 -0
  71. package/index.d.mts +0 -16
  72. package/index.d.ts +0 -16
  73. package/index.js +0 -104
  74. package/index.mjs +0 -3300
  75. package/lib/components/Fonts/Fonts.d.ts +0 -2
  76. package/lib/components/ThemeProvider/ThemeProvider.d.ts +0 -5
  77. package/lib/theme/actions/Button/Button.config.d.ts +0 -95
  78. package/lib/theme/actions/Button/Button.d.ts +0 -3
  79. package/lib/theme/actions/IconButton/IconButton.d.ts +0 -11
  80. package/lib/theme/actions/Menu/Menu.config.d.ts +0 -92
  81. package/lib/theme/actions/Menu/Menu.d.ts +0 -3
  82. package/lib/theme/foundations/colors.d.ts +0 -96
  83. package/lib/theme/index.d.ts +0 -659
  84. package/lib/theme/layout/Grid/Grid.d.ts +0 -48
  85. package/lib/theme/layout/Grid/GridItem.d.ts +0 -5
  86. package/lib/theme/layout/Show-Hide/Show-Hide.d.ts +0 -5
  87. package/lib/theme/media/Icon/Icon.config.d.ts +0 -21
  88. package/lib/theme/media/Icon/Icon.d.ts +0 -14
  89. package/lib/theme/navigation/Link/Link.config.d.ts +0 -31
  90. package/lib/theme/navigation/Link/Link.d.ts +0 -3
  91. package/lib/theme/overlay/Drawer/Drawer.config.d.ts +0 -72
  92. package/lib/theme/overlay/Drawer/Drawer.d.ts +0 -3
  93. package/lib/theme/typography/Heading/Heading.config.d.ts +0 -48
  94. package/lib/theme/typography/Heading/Heading.d.ts +0 -3
  95. package/lib/theme/typography/Text/Text.config.d.ts +0 -37
  96. package/lib/theme/typography/Text/Text.d.ts +0 -3
  97. /package/{lib/components/Fonts/index.d.ts → src/lib/components/Fonts/index.ts} +0 -0
  98. /package/{lib/components/ThemeProvider/index.d.ts → src/lib/components/ThemeProvider/index.ts} +0 -0
  99. /package/{lib/theme/layout/Grid/index.d.ts → src/lib/theme/layout/Grid/index.ts} +0 -0
package/.babelrc ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@nx/react/babel",
5
+ {
6
+ "runtime": "automatic",
7
+ "useBuiltIns": "usage",
8
+ "importSource": "@emotion/react"
9
+ }
10
+ ]
11
+ ],
12
+ "plugins": ["@emotion/babel-plugin"]
13
+ }
package/.eslintrc.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": ["plugin:@nx/react", "../../.eslintrc.json"],
3
+ "ignorePatterns": ["!**/*"],
4
+ "overrides": [
5
+ {
6
+ "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7
+ "rules": {}
8
+ },
9
+ {
10
+ "files": ["*.ts", "*.tsx"],
11
+ "rules": {}
12
+ },
13
+ {
14
+ "files": ["*.js", "*.jsx"],
15
+ "rules": {}
16
+ }
17
+ ]
18
+ }
@@ -0,0 +1,74 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
+
3
+ const config: StorybookConfig = {
4
+ stories: [
5
+ {
6
+ directory: '../src/lib/stories/foundations',
7
+ titlePrefix: 'Foundation',
8
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
9
+ },
10
+ {
11
+ directory: '../src/lib/theme/navigation',
12
+ titlePrefix: 'Navigation',
13
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
14
+ },
15
+ {
16
+ directory: '../src/lib/theme/actions',
17
+ titlePrefix: 'Actions',
18
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
19
+ },
20
+ {
21
+ directory: '../src/lib/theme/layout',
22
+ titlePrefix: 'Layout',
23
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
24
+ },
25
+ {
26
+ directory: '../src/lib/theme/typography',
27
+ titlePrefix: 'Typography',
28
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
29
+ },
30
+ {
31
+ directory: '../src/lib/theme/media',
32
+ titlePrefix: 'Media & Icons',
33
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
34
+ },
35
+ {
36
+ directory: '../src/lib/theme/overlay',
37
+ titlePrefix: 'Overlay',
38
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
39
+ },
40
+ {
41
+ directory: '../src/lib/theme/accessibility',
42
+ titlePrefix: 'Accessibility',
43
+ files: `**/*.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))`,
44
+ },
45
+ ],
46
+ addons: ['@storybook/addon-essentials', '@storybook/addon-interactions'],
47
+ framework: {
48
+ name: '@storybook/react-vite',
49
+ options: {
50
+ builder: {
51
+ viteConfigPath: 'libs/ui-kit/vite.config.ts',
52
+ },
53
+ },
54
+ },
55
+ docs: {
56
+ defaultName: 'Documentation',
57
+ },
58
+ refs: {
59
+ storybook: {
60
+ title: 'www',
61
+ url: 'https://65a9bd6a6bac1bc320ca9b03-mbseqapsml.chromatic.com/',
62
+ expanded: false,
63
+ },
64
+ '@chakra-ui/react': {
65
+ disable: true,
66
+ },
67
+ },
68
+ };
69
+
70
+ export default config;
71
+
72
+ // To customize your Vite configuration you can use the viteFinal field.
73
+ // Check https://storybook.js.org/docs/react/builders/vite#configuration
74
+ // and https://nx.dev/recipes/storybook/custom-builder-configs
@@ -0,0 +1,33 @@
1
+ import theme from '../src/lib/theme';
2
+ import ThemeProvider from '../src/lib/components/ThemeProvider';
3
+
4
+ import { Preview } from '@storybook/react';
5
+
6
+ const preview: Preview = {
7
+ decorators: [
8
+ (Story): JSX.Element => (
9
+ <ThemeProvider theme={theme}>
10
+ {/* 👇 Decorators in Storybook also accept a function. Replace <Story/> with Story() to enable it */}
11
+ <Story />
12
+ </ThemeProvider>
13
+ ),
14
+ ],
15
+ parameters: {
16
+ layout: 'centered',
17
+ docs: {
18
+ source: { language: 'tsx' },
19
+ canvas: {
20
+ sourceState: 'shown',
21
+ },
22
+ toc: true,
23
+ },
24
+ // options: {
25
+ // storySort: (a: { id: string }, b: { id: string }) =>
26
+ // a.id === b.id
27
+ // ? 0
28
+ // : a.id.localeCompare(b.id, undefined, { numeric: true }),
29
+ // },
30
+ },
31
+ };
32
+
33
+ export default preview;
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # Changelog
2
+
3
+ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
+
5
+ ## [0.2.0](https://gitlab.com/everlywell/forest/compare/v0.1.0...v0.2.0) (2024-01-09)
6
+
7
+
8
+ ### Features
9
+
10
+ * add heading component ([23dc0e5](https://gitlab.com/everlywell/forest/commit/23dc0e57802f00900d093293aae4bc7878c682f8))
11
+ * **fonts:** add the new fonts to the theme provider ([db3e3d1](https://gitlab.com/everlywell/forest/commit/db3e3d11e4a90c760591296b61e8eadcc95bc142))
12
+ * **text:** add text component and update font styles in theme ([726a061](https://gitlab.com/everlywell/forest/commit/726a06124a23133d5245fdf0c3099a0cff1b9e09))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * feedback changes ([d61e3a2](https://gitlab.com/everlywell/forest/commit/d61e3a22beee457f51a70edf15fd9099cd2dadc2))
18
+ * fix conflict ([2fd22f7](https://gitlab.com/everlywell/forest/commit/2fd22f7316ffff04b68370d9a5c3d714907f9ba2))
19
+ * fix file conflict ([3d53de6](https://gitlab.com/everlywell/forest/commit/3d53de63ecd15cd093822ada28a4168978f4f808))
20
+
21
+ ## [0.1.0](https://gitlab.com/everlywell/forest/compare/v0.0.3...v0.1.0) (2023-12-18)
22
+
23
+ # Changelog
24
+
25
+ This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # ui-kit
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test ui-kit` to execute the unit tests via [Vitest](https://vitest.dev/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everlywell/ui-kit",
3
- "version": "0.0.4-menu-next",
3
+ "version": "0.0.5-next",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {
@@ -8,5 +8,16 @@
8
8
  "import": "./index.mjs",
9
9
  "require": "./index.js"
10
10
  }
11
+ },
12
+ "peerDependencies": {
13
+ "react": "18.x",
14
+ "react-dom": "18.x"
15
+ },
16
+ "dependencies": {
17
+ "@chakra-ui/react": "^2.8.1",
18
+ "@emotion/react": "11.11.3",
19
+ "@emotion/styled": "11.11.0",
20
+ "@phosphor-icons/react": "2.0.15",
21
+ "framer-motion": "^10.16.4"
11
22
  }
12
23
  }
package/project.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "ui-kit",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "libs/ui-kit/src",
5
+ "projectType": "library",
6
+ "tags": [],
7
+ "targets": {
8
+ "lint": {
9
+ "executor": "@nx/eslint:lint",
10
+ "outputs": [
11
+ "{options.outputFile}"
12
+ ],
13
+ "options": {
14
+ "lintFilePatterns": [
15
+ "libs/ui-kit/**/*.{ts,tsx,js,jsx}"
16
+ ]
17
+ }
18
+ },
19
+ "build": {
20
+ "executor": "@nx/vite:build",
21
+ "outputs": [
22
+ "{options.outputPath}"
23
+ ],
24
+ "defaultConfiguration": "production",
25
+ "options": {
26
+ "outputPath": "dist/libs/ui-kit"
27
+ },
28
+ "configurations": {
29
+ "development": {
30
+ "mode": "development"
31
+ },
32
+ "production": {
33
+ "mode": "production"
34
+ }
35
+ }
36
+ },
37
+ "test": {
38
+ "executor": "@nx/vite:test",
39
+ "outputs": [
40
+ "{options.reportsDirectory}"
41
+ ],
42
+ "options": {
43
+ "passWithNoTests": true,
44
+ "reportsDirectory": "../../coverage/libs/ui-kit"
45
+ }
46
+ },
47
+ "storybook": {
48
+ "executor": "@nx/storybook:storybook",
49
+ "options": {
50
+ "port": 4400,
51
+ "configDir": "libs/ui-kit/.storybook"
52
+ },
53
+ "configurations": {
54
+ "ci": {
55
+ "quiet": true
56
+ }
57
+ }
58
+ },
59
+ "build-storybook": {
60
+ "executor": "@nx/storybook:build",
61
+ "outputs": [
62
+ "{options.outputDir}"
63
+ ],
64
+ "options": {
65
+ "outputDir": "dist/storybook/ui-kit",
66
+ "configDir": "libs/ui-kit/.storybook"
67
+ },
68
+ "configurations": {
69
+ "ci": {
70
+ "quiet": true
71
+ }
72
+ }
73
+ },
74
+ "test-storybook": {
75
+ "executor": "nx:run-commands",
76
+ "options": {
77
+ "command": "test-storybook -c libs/ui-kit/.storybook --url=http://localhost:4400"
78
+ }
79
+ },
80
+ "static-storybook": {
81
+ "executor": "@nx/vite:preview-server",
82
+ "options": {
83
+ "buildTarget": "ui-kit:build-storybook",
84
+ "port": 9000,
85
+ "staticFilePath": "dist/storybook/ui-kit"
86
+ },
87
+ "configurations": {
88
+ "ci": {
89
+ "buildTarget": "ui-kit:build-storybook:ci"
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
package/src/index.ts ADDED
@@ -0,0 +1,85 @@
1
+ // theme components
2
+ export {
3
+ default as Button,
4
+ type ButtonProps,
5
+ } from './lib/theme/actions/Button/Button';
6
+
7
+ export { default as Box, type BoxProps } from './lib/theme/layout/Box/Box';
8
+ export {
9
+ default as IconButton,
10
+ type IconButtonProps,
11
+ } from './lib/theme/actions/IconButton/IconButton';
12
+
13
+ export {
14
+ Grid,
15
+ GridItem,
16
+ type GridProps,
17
+ type GridItemProps,
18
+ } from './lib/theme/layout/Grid';
19
+
20
+ export {
21
+ default as Heading,
22
+ type HeadingProps,
23
+ } from './lib/theme/typography/Heading/Heading';
24
+
25
+ export {
26
+ default as Text,
27
+ type TextProps,
28
+ } from './lib/theme/typography/Text/Text';
29
+
30
+ export {
31
+ default as Link,
32
+ type LinkProps,
33
+ } from './lib/theme/navigation/Link/Link';
34
+
35
+ export {
36
+ default as Drawer,
37
+ DrawerBody,
38
+ DrawerFooter,
39
+ DrawerHeader,
40
+ DrawerOverlay,
41
+ DrawerContent,
42
+ DrawerCloseButton,
43
+ type DrawerProps,
44
+ } from './lib/theme/overlay/Drawer/Drawer';
45
+
46
+ export {
47
+ default as Menu,
48
+ MenuButton,
49
+ MenuList,
50
+ MenuItem,
51
+ MenuGroup,
52
+ MenuCommand,
53
+ MenuDivider,
54
+ MenuOptionGroup,
55
+ MenuItemOption,
56
+ type MenuProps,
57
+ type MenuButtonProps,
58
+ type MenuListProps,
59
+ type MenuItemProps,
60
+ type MenuGroupProps,
61
+ type MenuCommandProps,
62
+ type MenuDividerProps,
63
+ } from './lib/theme/actions/Menu/Menu';
64
+
65
+ export {
66
+ Show,
67
+ Hide,
68
+ type ShowProps,
69
+ type HideProps,
70
+ } from './lib/theme/layout/Show-Hide/Show-Hide';
71
+
72
+ export { default as VisuallyHidden } from './lib/theme/accessibility/VisuallyHidden/VisuallyHidden';
73
+
74
+ export { default as Icon, type IconProps } from './lib/theme/media/Icon/Icon';
75
+
76
+ // utility components
77
+ export { default as ThemeProvider } from './lib/components/ThemeProvider';
78
+
79
+ // utility methods / components
80
+ export { extendBaseTheme as extendTheme } from '@chakra-ui/react';
81
+
82
+ export { default as styled } from '@emotion/styled';
83
+
84
+ // theme
85
+ export { theme } from './lib/theme';
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import Fonts from './Fonts';
3
+
4
+ import { within } from '@storybook/testing-library';
5
+ import { expect } from '@storybook/jest';
6
+
7
+ const meta: Meta<typeof Fonts> = {
8
+ component: Fonts,
9
+ title: 'Fonts',
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof Fonts>;
13
+
14
+ export const Primary = {
15
+ args: {},
16
+ };
17
+
18
+ export const Heading: Story = {
19
+ args: {},
20
+ play: async ({ canvasElement }) => {
21
+ const canvas = within(canvasElement);
22
+ expect(canvas.getByText(/Welcome to Fonts!/gi)).toBeTruthy();
23
+ },
24
+ };
@@ -0,0 +1,86 @@
1
+ import { Global } from '@emotion/react';
2
+
3
+ const Fonts = () => (
4
+ <Global
5
+ styles={`
6
+ /* PP Agrandir */
7
+ /* Agrandir is used for page headers, section titles, brand moments and quotations. */
8
+ @font-face {
9
+ font-family: 'PP Agrandir';
10
+ src: url('https://cdn.everlywell.com/fonts/PP Agrandir/PPAgrandir-Variable.woff2') format('woff2');
11
+ font-style: normal;
12
+ font-display: swap;
13
+ }
14
+
15
+ /* DM Sans */
16
+ /* Used for: Body copy, button copy and smaller sizes. */
17
+ @font-face {
18
+ font-family: 'DM Sans';
19
+ src: url('https://cdn.everlywell.com/fonts/DM Sans/DMSans-Italic-VariableFont_opsz,wght.woff2') format('woff2');
20
+ font-style: italic;
21
+ font-stretch: normal;
22
+ font-display: swap;
23
+ }
24
+ @font-face {
25
+ font-family: 'DM Sans';
26
+ src: url('https://cdn.everlywell.com/fonts/DM Sans/DMSans-VariableFont_opsz,wght.woff2') format('woff2');
27
+ font-style: normal;
28
+ font-stretch: normal;
29
+ font-display: swap;
30
+ }
31
+
32
+ /* DM Mono */
33
+ /* Used for: Body copy, button copy and smaller sizes. */
34
+ @font-face {
35
+ font-family: 'DM Mono';
36
+ src: url('https://cdn.everlywell.com/fonts/DM Mono/DMMono-Light.woff2') format('woff2');
37
+ font-style: normal;
38
+ font-weight: 300;
39
+ font-stretch: normal;
40
+ font-display: swap;
41
+ }
42
+ @font-face {
43
+ font-family: 'DM Mono';
44
+ src: url('https://cdn.everlywell.com/fonts/DM Mono/DMMono-LightItalic.woff2') format('woff2');
45
+ font-style: italic;
46
+ font-weight: 300;
47
+ font-stretch: normal;
48
+ font-display: swap;
49
+ }
50
+ @font-face {
51
+ font-family: 'DM Mono';
52
+ src: url('https://cdn.everlywell.com/fonts/DM Mono/DMMono-Regular.woff2') format('woff2');
53
+ font-style: normal;
54
+ font-weight: 400;
55
+ font-stretch: normal;
56
+ font-display: swap;
57
+ }
58
+ @font-face {
59
+ font-family: 'DM Mono';
60
+ src: url('https://cdn.everlywell.com/fonts/DM Mono/DMMono-Italic.woff2') format('woff2');
61
+ font-style: italic;
62
+ font-weight: 400;
63
+ font-stretch: normal;
64
+ font-display: swap;
65
+ }
66
+ @font-face {
67
+ font-family: 'DM Mono';
68
+ src: url('https://cdn.everlywell.com/fonts/DM Mono/DMMono-Medium.woff2') format('woff2');
69
+ font-style: normal;
70
+ font-weight: 500;
71
+ font-stretch: normal;
72
+ font-display: swap;
73
+ }
74
+ @font-face {
75
+ font-family: 'DM Mono';
76
+ src: url('https://cdn.everlywell.com/fonts/DM Mono/DMMono-MediumItalic.woff2') format('woff2');
77
+ font-style: italic;
78
+ font-weight: 500;
79
+ font-stretch: normal;
80
+ font-display: swap;
81
+ }
82
+ `}
83
+ />
84
+ );
85
+
86
+ export default Fonts;
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import { ThemeProvider } from './ThemeProvider';
3
+
4
+ import { within } from '@storybook/testing-library';
5
+ import { expect } from '@storybook/jest';
6
+
7
+ const meta: Meta<typeof ThemeProvider> = {
8
+ component: ThemeProvider,
9
+ title: 'ThemeProvider',
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof ThemeProvider>;
13
+
14
+ export const Primary = {
15
+ args: {},
16
+ };
17
+
18
+ export const Heading: Story = {
19
+ args: {},
20
+ play: async ({ canvasElement }) => {
21
+ const canvas = within(canvasElement);
22
+ expect(canvas.getByText(/Welcome to ThemeProvider!/gi)).toBeTruthy();
23
+ },
24
+ };
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ import { ChakraBaseProvider, ChakraProviderProps } from '@chakra-ui/react';
4
+ import Fonts from '../Fonts';
5
+
6
+ export type ThemeProviderProps = ChakraProviderProps;
7
+
8
+ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
9
+ children,
10
+ ...props
11
+ }) => {
12
+ return (
13
+ <ChakraBaseProvider {...props}>
14
+ <Fonts />
15
+ {children}
16
+ </ChakraBaseProvider>
17
+ );
18
+ };
19
+
20
+ export default ThemeProvider;
@@ -0,0 +1,21 @@
1
+ import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';
2
+
3
+ import colors from '../../theme/foundations/colors';
4
+
5
+ <Meta title="Colors" />
6
+
7
+ # Colors
8
+
9
+ <ColorPalette>
10
+ {Object.entries(colors).map(([key, value]) => {
11
+ const colors = typeof value === 'string' ?
12
+ { [key]: value } :
13
+ Object.entries(value)
14
+ .filter(([key]) => isNaN(key))
15
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {});
16
+
17
+ return <ColorItem key={key} title={key} colors={colors} />;
18
+
19
+ })}
20
+
21
+ </ColorPalette>
@@ -0,0 +1,27 @@
1
+ import { Canvas, Meta, Controls, Primary } from '@storybook/blocks';
2
+
3
+ import * as VisuallyHiddenStories from './VisuallyHidden.stories';
4
+
5
+ <Meta of={VisuallyHiddenStories} />
6
+
7
+ # VisuallyHidden
8
+
9
+ ## Overview
10
+
11
+ VisuallyHidden is a common technique used in web accessibility to hide content from the visual client, but keep it readable for screen readers.
12
+
13
+ ### Import
14
+
15
+ ```jsx
16
+ import { VisuallyHidden } from '@everlywell/ui-kit';
17
+ ```
18
+
19
+ ### Usage
20
+
21
+ `VisuallyHidden` renders a span component used to hide elements on screen.
22
+
23
+ <Primary />
24
+
25
+ ## More information
26
+
27
+ [Chakra-UI VisuallyHidden](https://chakra-ui.com/docs/components/visually-hidden)
@@ -0,0 +1,23 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { createPrimary } from '../../../utils/utils.storybook';
3
+
4
+ import VisuallyHidden from './VisuallyHidden';
5
+
6
+ import Box from '../../layout/Box/Box';
7
+ import Heading from '../../typography/Heading/Heading';
8
+
9
+ export default {
10
+ component: VisuallyHidden,
11
+ } as Meta;
12
+
13
+ export const Primary = createPrimary<Record<string, never>>(
14
+ (props) => (
15
+ <Box>
16
+ <Heading>Title and description</Heading>
17
+ <VisuallyHidden>This will be hidden</VisuallyHidden>
18
+ </Box>
19
+ ),
20
+ {
21
+ defaultProps: {},
22
+ },
23
+ );
@@ -1,2 +1,3 @@
1
1
  import { VisuallyHidden as ChakraVisuallyHidden } from '@chakra-ui/react';
2
+
2
3
  export default ChakraVisuallyHidden;