kahuna-base-react-components 1.0.6 → 1.1.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 (150) hide show
  1. package/.prettierrc +8 -0
  2. package/README.md +23 -0
  3. package/dist/components/KButton/KButton.d.ts +23 -0
  4. package/dist/components/KButton/index.d.ts +1 -0
  5. package/dist/components/KCodeInput/KCodeInput.d.ts +36 -0
  6. package/dist/components/KCodeInput/index.d.ts +1 -0
  7. package/dist/components/KDropdown/KDropdown.d.ts +38 -0
  8. package/dist/components/KDropdown/index.d.ts +1 -0
  9. package/dist/components/KDropdownToggle/KDropdownToggle.d.ts +35 -0
  10. package/dist/components/KDropdownToggle/index.d.ts +1 -0
  11. package/dist/components/KInput/KInput.d.ts +32 -0
  12. package/dist/components/KInput/index.d.ts +1 -0
  13. package/dist/components/KLogo/KLogo.d.ts +18 -0
  14. package/dist/components/KLogo/index.d.ts +1 -0
  15. package/dist/components/KSelectDate/KSelectDate.d.ts +9 -0
  16. package/dist/components/KSelectDate/index.d.ts +1 -0
  17. package/dist/components/KSlider/KSlider.d.ts +15 -0
  18. package/dist/components/KSlider/index.d.ts +1 -0
  19. package/dist/components/KSliderLabel/KSliderLabel.d.ts +19 -0
  20. package/dist/components/KSliderLabel/index.d.ts +1 -0
  21. package/dist/components/KSpan/KSpan.d.ts +18 -0
  22. package/dist/components/KSpan/index.d.ts +1 -0
  23. package/dist/components/KTextArea/KTextArea.d.ts +32 -0
  24. package/dist/components/KTextArea/index.d.ts +1 -0
  25. package/dist/components/KTitleSpan/KTitleSpan.d.ts +14 -0
  26. package/dist/components/KTitleSpan/index.d.ts +1 -0
  27. package/dist/components/KTooltip/KTooltip.d.ts +19 -0
  28. package/dist/components/KTooltip/index.d.ts +1 -0
  29. package/dist/fonts/AeonikPro-Bold/AeonikPro-Bold.otf +0 -0
  30. package/dist/fonts/AeonikPro-Bold/CoType EULA Desktop.pdf +1388 -3
  31. package/dist/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
  32. package/dist/fonts/Inter/OFL.txt +93 -0
  33. package/dist/fonts/Inter/README.txt +72 -0
  34. package/dist/fonts/Inter/static/Inter-Black.ttf +0 -0
  35. package/dist/fonts/Inter/static/Inter-Bold.ttf +0 -0
  36. package/dist/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
  37. package/dist/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
  38. package/dist/fonts/Inter/static/Inter-Light.ttf +0 -0
  39. package/dist/fonts/Inter/static/Inter-Medium.ttf +0 -0
  40. package/dist/fonts/Inter/static/Inter-Regular.ttf +0 -0
  41. package/dist/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
  42. package/dist/fonts/Inter/static/Inter-Thin.ttf +0 -0
  43. package/dist/index.d.ts +13 -0
  44. package/dist/index.esm.js +9 -1
  45. package/dist/index.esm.js.map +1 -1
  46. package/dist/index.js +9 -1
  47. package/dist/index.js.map +1 -1
  48. package/dist/types.d.ts +241 -8
  49. package/package.json +14 -3
  50. package/postcss.config.js +6 -0
  51. package/removeUseClient.js +22 -0
  52. package/rollup.config.js +9 -3
  53. package/src/assets/calendar-hovered.svg +3 -0
  54. package/src/assets/calendar.svg +3 -0
  55. package/src/assets/check.svg +3 -0
  56. package/src/assets/chevron-left.svg +7 -0
  57. package/src/assets/chevron-right.svg +7 -0
  58. package/src/assets/fonts/AeonikPro/AeonikPro-Bold.otf +0 -0
  59. package/src/assets/fonts/AeonikPro/AeonikPro-Medium.otf +0 -0
  60. package/src/assets/fonts/AeonikPro/CoType EULA Desktop.pdf +1388 -3
  61. package/src/assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf +0 -0
  62. package/src/assets/fonts/Inter/OFL.txt +93 -0
  63. package/src/assets/fonts/Inter/README.txt +72 -0
  64. package/src/assets/fonts/Inter/static/Inter-Black.ttf +0 -0
  65. package/src/assets/fonts/Inter/static/Inter-Bold.ttf +0 -0
  66. package/src/assets/fonts/Inter/static/Inter-ExtraBold.ttf +0 -0
  67. package/src/assets/fonts/Inter/static/Inter-ExtraLight.ttf +0 -0
  68. package/src/assets/fonts/Inter/static/Inter-Light.ttf +0 -0
  69. package/src/assets/fonts/Inter/static/Inter-Medium.ttf +0 -0
  70. package/src/assets/fonts/Inter/static/Inter-Regular.ttf +0 -0
  71. package/src/assets/fonts/Inter/static/Inter-SemiBold.ttf +0 -0
  72. package/src/assets/fonts/Inter/static/Inter-Thin.ttf +0 -0
  73. package/src/assets/kahuna-text.svg +3 -0
  74. package/src/assets/logo-gray.svg +10 -0
  75. package/src/assets/logo-small-hovered.svg +4 -0
  76. package/src/assets/logo-small.svg +11 -0
  77. package/src/assets/logo.svg +11 -0
  78. package/src/assets/progress.svg +37 -0
  79. package/src/assets/separator.svg +3 -0
  80. package/src/assets/slider-dots.svg +7 -0
  81. package/src/assets/slider-step.svg +3 -0
  82. package/src/assets/slider-thumb.svg +3 -0
  83. package/src/assets/tracks.svg +5 -0
  84. package/src/assets/union.svg +3 -0
  85. package/src/assets/vector.svg +3 -0
  86. package/src/components/KButton/KButton.stories.tsx +69 -12
  87. package/src/components/KButton/KButton.tsx +51 -14
  88. package/src/components/KCodeInput/KCodeInput.stories.tsx +84 -0
  89. package/src/components/KCodeInput/KCodeInput.tsx +260 -0
  90. package/src/components/KCodeInput/index.ts +1 -0
  91. package/src/components/KDropdown/KDropdown.stories.tsx +90 -0
  92. package/src/components/KDropdown/KDropdown.tsx +201 -0
  93. package/src/components/KDropdown/index.ts +1 -0
  94. package/src/components/KInput/KInput.stories.tsx +84 -0
  95. package/src/components/KInput/KInput.tsx +128 -0
  96. package/src/components/KInput/index.ts +1 -0
  97. package/src/components/KLogo/KLogo.stories.tsx +24 -0
  98. package/src/components/KLogo/KLogo.tsx +79 -0
  99. package/src/components/KLogo/index.ts +1 -0
  100. package/src/components/KSelectDate/CalendarCustom.css +235 -0
  101. package/src/components/KSelectDate/KSelectDate.stories.tsx +54 -0
  102. package/src/components/KSelectDate/KSelectDate.tsx +314 -0
  103. package/src/components/KSelectDate/index.ts +1 -0
  104. package/src/components/KSlider/KSlider.stories.tsx +19 -0
  105. package/src/components/KSlider/KSlider.tsx +67 -0
  106. package/src/components/KSlider/index.ts +1 -0
  107. package/src/components/KSliderLabel/KSliderLabel.stories.tsx +61 -0
  108. package/src/components/KSliderLabel/KSliderLabel.tsx +137 -0
  109. package/src/components/KSliderLabel/index.ts +1 -0
  110. package/src/components/KSpan/KSpan.stories.tsx +31 -11
  111. package/src/components/KSpan/KSpan.tsx +65 -9
  112. package/src/components/KTextArea/KTextArea.stories.tsx +65 -0
  113. package/src/components/KTextArea/KTextArea.tsx +130 -0
  114. package/src/components/KTextArea/index.ts +1 -0
  115. package/src/components/KTitleSpan/KTitleSpan.stories.tsx +23 -0
  116. package/src/components/KTitleSpan/KTitleSpan.tsx +33 -0
  117. package/src/components/KTitleSpan/index.ts +1 -0
  118. package/src/components/KTooltip/KTooltip.stories.tsx +94 -0
  119. package/src/components/KTooltip/KTooltip.tsx +67 -0
  120. package/src/components/KTooltip/index.ts +1 -0
  121. package/src/index.ts +12 -1
  122. package/src/main.css +251 -0
  123. package/tailwind.config.js +9 -0
  124. package/tsconfig.json +6 -1
  125. package/src/stories/Button.stories.ts +0 -50
  126. package/src/stories/Button.tsx +0 -48
  127. package/src/stories/Configure.mdx +0 -364
  128. package/src/stories/Header.stories.ts +0 -27
  129. package/src/stories/Header.tsx +0 -56
  130. package/src/stories/Page.stories.ts +0 -32
  131. package/src/stories/Page.tsx +0 -73
  132. package/src/stories/assets/accessibility.png +0 -0
  133. package/src/stories/assets/accessibility.svg +0 -5
  134. package/src/stories/assets/addon-library.png +0 -0
  135. package/src/stories/assets/assets.png +0 -0
  136. package/src/stories/assets/avif-test-image.avif +0 -0
  137. package/src/stories/assets/context.png +0 -0
  138. package/src/stories/assets/discord.svg +0 -15
  139. package/src/stories/assets/docs.png +0 -0
  140. package/src/stories/assets/figma-plugin.png +0 -0
  141. package/src/stories/assets/github.svg +0 -3
  142. package/src/stories/assets/share.png +0 -0
  143. package/src/stories/assets/styling.png +0 -0
  144. package/src/stories/assets/testing.png +0 -0
  145. package/src/stories/assets/theming.png +0 -0
  146. package/src/stories/assets/tutorials.svg +0 -12
  147. package/src/stories/assets/youtube.svg +0 -4
  148. package/src/stories/button.css +0 -30
  149. package/src/stories/header.css +0 -32
  150. package/src/stories/page.css +0 -69
package/src/main.css ADDED
@@ -0,0 +1,251 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+
6
+ @font-face {
7
+ font-family: "Inter";
8
+ src: local("Inter"), url("./assets/fonts/Inter/Inter-VariableFont_slnt,wght.ttf") format("truetype");
9
+ }
10
+
11
+ @font-face {
12
+ font-family: "Aeonik Pro";
13
+ src: local("Aeonik Pro"), url("./assets/fonts/AeonikPro/AeonikPro-Medium.otf") format("truetype");
14
+ }
15
+ @font-face {
16
+ font-family: "Aeonik Pro Bold";
17
+ src: local("Aeonik Pro Bold"), url("./assets/fonts/AeonikPro/AeonikPro-Bold.otf") format("truetype");
18
+ }
19
+
20
+ .k-title-span {
21
+ font-feature-settings: 'ss11' on, 'cv09' on, 'liga' off, 'calt' off;
22
+ font-family: "Aeonik Pro";
23
+ }
24
+ .k-title-span-bold {
25
+ font-feature-settings: 'ss11' on, 'cv09' on, 'liga' off, 'calt' off;
26
+ font-family: "Aeonik Pro Bold";
27
+ }
28
+
29
+ .k-span {
30
+ font-feature-settings: 'ss11' on, 'cv09' on, 'liga' off, 'calt' off;
31
+ font-family: "Inter";
32
+ }
33
+
34
+ .k-span-hover {
35
+ display: none;
36
+ }
37
+
38
+ .k-span-hover-div:hover .k-span-hover {
39
+ display: inline;
40
+ }
41
+
42
+
43
+ .k-input-container {
44
+ display: flex;
45
+ align-items: center;
46
+ align-self: stretch;
47
+ }
48
+
49
+ .k-input {
50
+ color: #111;
51
+ font-feature-settings: 'ss11' on, 'cv09' on, 'liga' off, 'calt' off;
52
+ /* Paragraph/Small */
53
+ font-family: Inter;
54
+ font-style: normal;
55
+ font-weight: 400;
56
+ line-height: 20px;
57
+ /* 142.857% */
58
+ letter-spacing: -0.084px;
59
+ }
60
+
61
+ .k-input::placeholder {
62
+ color: #737373;
63
+ }
64
+
65
+ .k-input:focus {
66
+ outline: none !important;
67
+ }
68
+
69
+ .k-button {
70
+ display: flex;
71
+ justify-content: center;
72
+ align-items: center;
73
+ gap: 4px;
74
+ align-self: stretch;
75
+ }
76
+
77
+
78
+ .k-dropdown-container {
79
+ display: flex;
80
+ align-items: center;
81
+ }
82
+
83
+ .k-dropdown {
84
+ width: 100%;
85
+ font-family: Inter;
86
+ }
87
+
88
+ .k-dropdown:focus {
89
+ outline: none !important;
90
+ }
91
+
92
+ .k-slider-input {
93
+ -webkit-appearance: none;
94
+ appearance: none;
95
+ width: 100%;
96
+ cursor: pointer;
97
+ outline: none;
98
+ border-radius: 16px;
99
+ background: transparent;
100
+ overflow: visible;
101
+ }
102
+
103
+ .k-slider-input::-webkit-slider-runnable-track {
104
+ height: 8px;
105
+ border-radius: 20px;
106
+ }
107
+
108
+ .k-slider-input::-webkit-slider-thumb {
109
+ -webkit-appearance: none;
110
+ cursor: pointer;
111
+ margin-top: -4px;
112
+ /* Align the thumb vertically with the track */
113
+ width: 16px;
114
+ /* Width of the thumb */
115
+ height: 16px;
116
+ /* Height of the thumb */
117
+ border-radius: 50px;
118
+ background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28' fill='none'%3E%3Cg filter='url(%23filter0_di_252_33228)'%3E%3Crect x='6' y='6' width='16' height='16' rx='8' fill='white'/%3E%3Crect x='6.5' y='6.5' width='15' height='15' rx='7.5' stroke='white'/%3E%3C/g%3E%3Cg filter='url(%23filter1_d_252_33228)'%3E%3Cpath d='M11 14C11 12.3431 12.3431 11 14 11C15.6569 11 17 12.3431 17 14C17 15.6569 15.6569 17 14 17C12.3431 17 11 15.6569 11 14Z' fill='%23B5B5B5'/%3E%3C/g%3E%3Cdefs%3E%3Cfilter id='filter0_di_252_33228' x='0' y='0' width='28' height='28' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3E%3CfeOffset/%3E%3CfeGaussianBlur stdDeviation='3'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.105882 0 0 0 0 0.109804 0 0 0 0 0.113725 0 0 0 0.06 0'/%3E%3CfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_252_33228'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_252_33228' result='shape'/%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3E%3CfeOffset dy='-3'/%3E%3CfeGaussianBlur stdDeviation='1.5'/%3E%3CfeComposite in2='hardAlpha' operator='arithmetic' k2='-1' k3='1'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.894118 0 0 0 0 0.898039 0 0 0 0 0.905882 0 0 0 1 0'/%3E%3CfeBlend mode='normal' in2='shape' result='effect2_innerShadow_252_33228'/%3E%3C/filter%3E%3Cfilter id='filter1_d_252_33228' x='7' y='9' width='14' height='14' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3E%3CfeFlood flood-opacity='0' result='BackgroundImageFix'/%3E%3CfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3E%3CfeOffset dy='2'/%3E%3CfeGaussianBlur stdDeviation='2'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.105882 0 0 0 0 0.109804 0 0 0 0 0.113725 0 0 0 0.04 0'/%3E%3CfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_252_33228'/%3E%3CfeBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_252_33228' result='shape'/%3E%3C/filter%3E%3C/defs%3E%3C/svg%3E") center / cover;
119
+ background-size: auto;
120
+ background-position: center;
121
+ }
122
+
123
+ .k-tooltip-top {
124
+ bottom: 100%;
125
+ left: 50%;
126
+ transform: translateX(-50%);
127
+ margin-bottom: 10px;
128
+ }
129
+
130
+ .k-tooltip-right {
131
+ top: 50%;
132
+ left: 100%;
133
+ transform: translateY(-50%);
134
+ margin-left: 10px;
135
+ }
136
+
137
+ .k-tooltip-bottom {
138
+ top: 100%;
139
+ left: 50%;
140
+ transform: translateX(-50%);
141
+ margin-top: 10px;
142
+ }
143
+
144
+ .k-tooltip-left {
145
+ top: 50%;
146
+ right: 100%;
147
+ transform: translateY(-50%);
148
+ margin-right: 10px;
149
+ }
150
+
151
+ .k-tooltip-enter {
152
+ opacity: 1;
153
+ visibility: visible;
154
+ pointer-events: auto;
155
+ transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
156
+ }
157
+
158
+ .k-tooltip-exit {
159
+ opacity: 0;
160
+ pointer-events: none;
161
+ visibility: hidden;
162
+ transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
163
+ }
164
+
165
+ .arrow-left {
166
+ position: absolute;
167
+ width: 10px;
168
+ height: 10px;
169
+ top: 50%;
170
+ left: calc(100% - 5px);
171
+ transform-origin: center;
172
+ transform: translateY(-50%) rotateZ(45deg);
173
+ z-index: -100;
174
+ }
175
+
176
+ .arrow-right {
177
+ position: absolute;
178
+ width: 10px;
179
+ height: 10px;
180
+ top: 50%;
181
+ right: calc(100% - 5px);
182
+ transform-origin: center;
183
+ transform: translateY(-50%) rotateZ(45deg);
184
+ z-index: -100;
185
+ }
186
+
187
+ .arrow-top {
188
+ position: absolute;
189
+ width: 10px;
190
+ height: 10px;
191
+ top: calc(100% - 5px);
192
+ left: 50%;
193
+ transform-origin: center;
194
+ transform: translateX(-50%) rotateZ(45deg);
195
+ z-index: -100;
196
+ }
197
+
198
+ .arrow-bottom {
199
+ position: absolute;
200
+ width: 10px;
201
+ height: 10px;
202
+ bottom: calc(100% - 5px);
203
+ left: 50%;
204
+ transform-origin: center;
205
+ transform: translateX(-50%) rotateZ(45deg);
206
+ z-index: -100;
207
+ }
208
+ .k-slider-label-input {
209
+ -webkit-appearance: none;
210
+ appearance: none;
211
+ width: 100%;
212
+ outline: none;
213
+ border-radius: 16px;
214
+ background: transparent;
215
+ overflow: visible;
216
+ }
217
+ .k-slider-label-input:active {
218
+ cursor: default !important;
219
+ }
220
+ .k-slider-label-input::-webkit-slider-runnable-track {
221
+ border-radius: 20px;
222
+ height: 48px;
223
+ z-index: 0;
224
+ }
225
+
226
+ .k-slider-label-input::-webkit-slider-thumb {
227
+ margin-top: -4px;
228
+ /* Align the thumb vertically with the track */
229
+ /* Width of the thumb */
230
+ background: url('data:image/svg+xml,%3Csvg%20width%3D%222%22%20height%3D%2216%22%20viewBox%3D%220%200%202%2016%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20width%3D%222%22%20height%3D%2216%22%20rx%3D%221%22%20fill%3D%22%23666666%22%2F%3E%3C%2Fsvg%3E') no-repeat;
231
+ /* Height of the thumb */
232
+ background-size: contain;
233
+ margin-top: 16px ;
234
+ background-position: center;
235
+ position: relative;
236
+ cursor: grab;
237
+ opacity: 0;
238
+ }
239
+ .k-slider-label-input::-webkit-slider-thumb:active {
240
+ cursor: grabbing;
241
+ }
242
+ .k-code-input-character-container {
243
+ outline: none !important;
244
+ text-align: center;
245
+ font-family: "Inter";
246
+ caret-color: #B7B7B7;
247
+ }
248
+ .k-code-input-character-container:disabled {
249
+ background: #F7F7F7 !important;
250
+ border: none !important;
251
+ }
@@ -0,0 +1,9 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: ["./src/**/*.{js,jsx,ts,tsx}"],
4
+ theme: {
5
+ extend: {},
6
+ },
7
+ plugins: [],
8
+ }
9
+
package/tsconfig.json CHANGED
@@ -2,6 +2,8 @@
2
2
  "compilerOptions": {
3
3
  "target": "es5",
4
4
  "lib": ["dom", "dom.iterable", "esnext"],
5
+ "declaration": true,
6
+ "declarationDir": "dist",
5
7
  "allowJs": true,
6
8
  "skipLibCheck": true,
7
9
  "esModuleInterop": true,
@@ -16,5 +18,8 @@
16
18
  "noEmit": true,
17
19
  "jsx": "react-jsx"
18
20
  },
19
- "include": ["src"]
21
+ "include": ["src"],
22
+ "exclude": [
23
+ "src/stories"
24
+ ]
20
25
  }
@@ -1,50 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { Button } from './Button';
4
-
5
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
6
- const meta = {
7
- title: 'Example/Button',
8
- component: Button,
9
- parameters: {
10
- // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
11
- layout: 'centered',
12
- },
13
- // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
14
- tags: ['autodocs'],
15
- // More on argTypes: https://storybook.js.org/docs/api/argtypes
16
- argTypes: {
17
- backgroundColor: { control: 'color' },
18
- },
19
- } satisfies Meta<typeof Button>;
20
-
21
- export default meta;
22
- type Story = StoryObj<typeof meta>;
23
-
24
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
25
- export const Primary: Story = {
26
- args: {
27
- primary: true,
28
- label: 'Button',
29
- },
30
- };
31
-
32
- export const Secondary: Story = {
33
- args: {
34
- label: 'Button',
35
- },
36
- };
37
-
38
- export const Large: Story = {
39
- args: {
40
- size: 'large',
41
- label: 'Button',
42
- },
43
- };
44
-
45
- export const Small: Story = {
46
- args: {
47
- size: 'small',
48
- label: 'Button',
49
- },
50
- };
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- import './button.css';
3
-
4
- interface ButtonProps {
5
- /**
6
- * Is this the principal call to action on the page?
7
- */
8
- primary?: boolean;
9
- /**
10
- * What background color to use
11
- */
12
- backgroundColor?: string;
13
- /**
14
- * How large should the button be?
15
- */
16
- size?: 'small' | 'medium' | 'large';
17
- /**
18
- * Button contents
19
- */
20
- label: string;
21
- /**
22
- * Optional click handler
23
- */
24
- onClick?: () => void;
25
- }
26
-
27
- /**
28
- * Primary UI component for user interaction
29
- */
30
- export const Button = ({
31
- primary = false,
32
- size = 'medium',
33
- backgroundColor,
34
- label,
35
- ...props
36
- }: ButtonProps) => {
37
- const mode = primary ? 'storybook-button--primary' : 'storybook-button--secondary';
38
- return (
39
- <button
40
- type="button"
41
- className={['storybook-button', `storybook-button--${size}`, mode].join(' ')}
42
- style={{ backgroundColor }}
43
- {...props}
44
- >
45
- {label}
46
- </button>
47
- );
48
- };