@gv-tech/design-system 0.8.0

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 (88) hide show
  1. package/.github/CODEOWNERS +2 -0
  2. package/.github/CONTRIBUTING.md +38 -0
  3. package/.github/FUNDING.yml +4 -0
  4. package/.github/PULL_REQUEST_TEMPLATE/build.md +5 -0
  5. package/.github/PULL_REQUEST_TEMPLATE/standard.md +3 -0
  6. package/.github/RELEASING.md +37 -0
  7. package/.github/copilot-instructions.md +93 -0
  8. package/.github/workflows/ci.yml +82 -0
  9. package/.github/workflows/codeql-analysis.yml +34 -0
  10. package/.github/workflows/release-please.yml +53 -0
  11. package/.husky/pre-commit +1 -0
  12. package/.nvmrc +1 -0
  13. package/.prettierignore +1 -0
  14. package/.storybook/.preview-head.html +1 -0
  15. package/.storybook/main.ts +38 -0
  16. package/.storybook/preview.tsx +30 -0
  17. package/.tool-versions +1 -0
  18. package/.vscode/launch.json +22 -0
  19. package/.vscode/settings.json +30 -0
  20. package/.yarn/releases/yarn-4.12.0.cjs +942 -0
  21. package/.yarnrc.yml +7 -0
  22. package/CHANGELOG.md +490 -0
  23. package/LICENSE +21 -0
  24. package/README.md +116 -0
  25. package/SECURITY.md +9 -0
  26. package/babel.config.js +3 -0
  27. package/dist/favicon.ico +0 -0
  28. package/dist/index.demo.html +40 -0
  29. package/dist/index.js +647 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/index.mjs +1053 -0
  32. package/dist/index.mjs.map +1 -0
  33. package/dist/logo192.png +0 -0
  34. package/dist/logo512.png +0 -0
  35. package/dist/manifest.json +25 -0
  36. package/dist/robots.txt +2 -0
  37. package/dist/vendor-DXgJBoQh.mjs +265 -0
  38. package/dist/vendor-DXgJBoQh.mjs.map +1 -0
  39. package/dist/vendor-nZSsnGb7.js +7 -0
  40. package/dist/vendor-nZSsnGb7.js.map +1 -0
  41. package/docs/MIGRATE_TO_GVTECH_SCOPE.md +74 -0
  42. package/eslint.config.mjs +95 -0
  43. package/netlify.toml +6 -0
  44. package/package.json +130 -0
  45. package/public/favicon.ico +0 -0
  46. package/public/index.demo.html +40 -0
  47. package/public/logo192.png +0 -0
  48. package/public/logo512.png +0 -0
  49. package/public/manifest.json +25 -0
  50. package/public/robots.txt +2 -0
  51. package/scripts/validate.js +56 -0
  52. package/serve.json +4 -0
  53. package/src/Avatar.stories.tsx +67 -0
  54. package/src/Avatar.tsx +174 -0
  55. package/src/Badge.stories.tsx +87 -0
  56. package/src/Badge.tsx +76 -0
  57. package/src/Button.stories.tsx +244 -0
  58. package/src/Button.tsx +384 -0
  59. package/src/Icon.stories.tsx +101 -0
  60. package/src/Icon.tsx +64 -0
  61. package/src/Intro.stories.tsx +20 -0
  62. package/src/Link.stories.tsx +69 -0
  63. package/src/Link.tsx +252 -0
  64. package/src/StoryLinkWrapper.d.ts +1 -0
  65. package/src/StoryLinkWrapper.tsx +33 -0
  66. package/src/__tests__/Avatar.test.tsx +28 -0
  67. package/src/__tests__/Badge.test.tsx +25 -0
  68. package/src/__tests__/Button.test.tsx +38 -0
  69. package/src/__tests__/Icon.test.tsx +26 -0
  70. package/src/__tests__/Link.test.tsx +31 -0
  71. package/src/index.ts +13 -0
  72. package/src/mdx.d.ts +5 -0
  73. package/src/setupTests.ts +1 -0
  74. package/src/shared/animation.d.ts +18 -0
  75. package/src/shared/animation.js +60 -0
  76. package/src/shared/global.d.ts +12 -0
  77. package/src/shared/global.js +120 -0
  78. package/src/shared/icons.d.ts +34 -0
  79. package/src/shared/icons.js +282 -0
  80. package/src/shared/styles.d.ts +86 -0
  81. package/src/shared/styles.js +98 -0
  82. package/src/test-utils/axe.ts +25 -0
  83. package/src/types.ts +316 -0
  84. package/tsconfig.build.json +12 -0
  85. package/tsconfig.json +20 -0
  86. package/tsconfig.node.json +10 -0
  87. package/vite.config.ts +35 -0
  88. package/vitest.config.ts +13 -0
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
1
+ import * as styles from './shared/styles';
2
+ import * as global from './shared/global';
3
+ import * as animation from './shared/animation';
4
+ import * as icons from './shared/icons';
5
+
6
+ export { styles, global, animation, icons };
7
+
8
+ export * from './types';
9
+ export * from './Avatar';
10
+ export * from './Badge';
11
+ export * from './Button';
12
+ export * from './Icon';
13
+ export * from './Link';
package/src/mdx.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ declare module '*.mdx' {
2
+ import * as React from 'react';
3
+ const MDXComponent: (props: Record<string, unknown>) => React.JSX.Element;
4
+ export default MDXComponent;
5
+ }
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Type declarations for shared/animation.js
3
+ */
4
+
5
+ import { Keyframes, FlattenSimpleInterpolation } from 'styled-components';
6
+
7
+ export interface Easing {
8
+ rubber: string;
9
+ }
10
+
11
+ export declare const easing: Easing;
12
+
13
+ export declare const rotate360: Keyframes;
14
+ export declare const glow: Keyframes;
15
+ export declare const float: Keyframes;
16
+ export declare const jiggle: Keyframes;
17
+ export declare const shake: Keyframes;
18
+ export declare const inlineGlow: FlattenSimpleInterpolation;
@@ -0,0 +1,60 @@
1
+ // Handy CSS animations for micro-interactions
2
+ import { css, keyframes } from 'styled-components';
3
+ import { color } from './styles';
4
+
5
+ export const easing = {
6
+ rubber: 'cubic-bezier(0.175, 0.885, 0.335, 1.05)',
7
+ };
8
+
9
+ export const rotate360 = keyframes`
10
+ from {
11
+ transform: rotate(0deg);
12
+ }
13
+ to {
14
+ transform: rotate(360deg);
15
+ }
16
+ `;
17
+
18
+ export const glow = keyframes`
19
+ 0%, 100% { opacity: 1; }
20
+ 50% { opacity: .4; }
21
+ `;
22
+
23
+ export const float = keyframes`
24
+ 0% { transform: translateY(1px); }
25
+ 25% { transform: translateY(0px); }
26
+ 50% { transform: translateY(-3px); }
27
+ 100% { transform: translateY(1px); }
28
+ `;
29
+
30
+ export const jiggle = keyframes`
31
+ 0%, 100% { transform:translate3d(0,0,0); }
32
+ 12.5%, 62.5% { transform:translate3d(-4px,0,0); }
33
+ 37.5%, 87.5% { transform: translate3d(4px,0,0); }
34
+ `;
35
+
36
+ export const shake = keyframes`
37
+ 0% { transform:rotate(-3deg) }
38
+ 1.68421% { transform:rotate(3deg) }
39
+ 2.10526% { transform:rotate(6deg) }
40
+ 3.78947% { transform:rotate(-6deg) }
41
+ 4.21053% { transform:rotate(-6deg) }
42
+ 5.89474% { transform:rotate(6deg) }
43
+ 6.31579% { transform:rotate(6deg) }
44
+ 8% { transform:rotate(-6deg) }
45
+ 8.42105% { transform:rotate(-6deg) }
46
+ 10.10526% { transform:rotate(6deg) }
47
+ 10.52632% { transform:rotate(6deg) }
48
+ 12.21053% { transform:rotate(-6deg) }
49
+ 12.63158% { transform:rotate(-6deg) }
50
+ 14.31579% { transform:rotate(6deg) }
51
+ 15.78947% { transform:rotate(0deg) }
52
+ 100% { transform:rotate(0deg) }
53
+ `;
54
+
55
+ export const inlineGlow = css`
56
+ animation: ${glow} 1.5s ease-in-out infinite;
57
+ background: ${color.mediumlight};
58
+ color: transparent;
59
+ cursor: progress;
60
+ `;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type declarations for shared/global.js
3
+ */
4
+
5
+ import { FlattenSimpleInterpolation } from 'styled-components';
6
+
7
+ export declare const fontUrl: string;
8
+ export declare const bodyStyles: FlattenSimpleInterpolation;
9
+ export declare const GlobalStyle: import('styled-components').GlobalStyleComponent<
10
+ object,
11
+ import('styled-components').DefaultTheme
12
+ >;
@@ -0,0 +1,120 @@
1
+ import { createGlobalStyle, css } from 'styled-components';
2
+ import { color, typography } from './styles';
3
+
4
+ export const fontUrl = 'https://fonts.googleapis.com/css?family=Nunito+Sans:400,700,800,900';
5
+
6
+ export const bodyStyles = css`
7
+ font-family: ${typography.type.primary};
8
+ font-size: ${typography.size.s3}px;
9
+ color: ${color.darkest};
10
+
11
+ -webkit-font-smoothing: antialiased;
12
+ -moz-osx-font-smoothing: grayscale;
13
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
14
+ -webkit-tap-highlight-color: transparent;
15
+ -webkit-overflow-scrolling: touch;
16
+
17
+ * {
18
+ box-sizing: border-box;
19
+ }
20
+
21
+ h1,
22
+ h2,
23
+ h3,
24
+ h4,
25
+ h5,
26
+ h6 {
27
+ font-weight: ${typography.weight.regular};
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+
32
+ button,
33
+ input,
34
+ textarea,
35
+ select {
36
+ outline: none;
37
+ font-family: ${typography.type.primary};
38
+ }
39
+
40
+ sub,
41
+ sup {
42
+ font-size: 0.8em;
43
+ }
44
+
45
+ sub {
46
+ bottom: -0.2em;
47
+ }
48
+
49
+ sup {
50
+ top: -0.2em;
51
+ }
52
+
53
+ b,
54
+ em {
55
+ font-weight: ${typography.weight.bold};
56
+ }
57
+
58
+ hr {
59
+ border: none;
60
+ border-top: 1px solid ${color.border};
61
+ clear: both;
62
+ margin-bottom: 1.25rem;
63
+ }
64
+
65
+ code,
66
+ pre {
67
+ font-family: ${typography.type.code};
68
+ font-size: ${typography.size.s2 - 1}px;
69
+ -webkit-font-smoothing: antialiased;
70
+ -moz-osx-font-smoothing: grayscale;
71
+ }
72
+
73
+ code {
74
+ display: inline-block;
75
+ padding-left: 2px;
76
+ padding-right: 2px;
77
+ vertical-align: baseline;
78
+
79
+ color: ${color.secondary};
80
+ }
81
+
82
+ pre {
83
+ line-height: 18px;
84
+ padding: 11px 1rem;
85
+ white-space: pre-wrap;
86
+
87
+ background: rgba(0, 0, 0, 0.05);
88
+ color: ${color.darkest};
89
+ border-radius: 3px;
90
+ margin: 1rem 0;
91
+ }
92
+
93
+ &.ReactModal__Body--open {
94
+ overflow: hidden;
95
+ &.hide-intercom #intercom-container {
96
+ display: none;
97
+ }
98
+ }
99
+
100
+ .ReactModalPortal > div {
101
+ opacity: 0;
102
+ }
103
+
104
+ .ReactModalPortal .ReactModal__Overlay {
105
+ transition: all 200ms ease-in;
106
+
107
+ &--after-open {
108
+ opacity: 1;
109
+ }
110
+ &--before-close {
111
+ opacity: 0;
112
+ }
113
+ }
114
+ `;
115
+
116
+ export const GlobalStyle = createGlobalStyle`
117
+ body {
118
+ ${bodyStyles}
119
+ }
120
+ `;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Type declarations for shared/icons.js
3
+ */
4
+
5
+ export interface Icons {
6
+ mobile: string;
7
+ watch: string;
8
+ tablet: string;
9
+ browser: string;
10
+ sidebar: string;
11
+ sidebaralt: string;
12
+ bottombar: string;
13
+ useralt: string;
14
+ user: string;
15
+ useradd: string;
16
+ users: string;
17
+ profile: string;
18
+ bookmark: string;
19
+ bookmarkhollow: string;
20
+ book: string;
21
+ star: string;
22
+ starhollow: string;
23
+ circle: string;
24
+ circlehollow: string;
25
+ heart: string;
26
+ hearthollow: string;
27
+ facehappy: string;
28
+ facesad: string;
29
+ faceneutral: string;
30
+ lock: string;
31
+ [key: string]: string; // Allow for additional icons
32
+ }
33
+
34
+ export declare const icons: Icons;