first commit

main
Juan Olvera 12 months ago
commit d16d06da3b

@ -0,0 +1,28 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-typescript",
{
"isTSX": true,
"allExtensions": true
}
],
[
"@babel/preset-react",
{
"runtime": "automatic"
}],
[
"@babel/preset-env",
{
"targets": {
"chrome": 100,
"safari": 15,
"firefox": 91
}
}
]
],
"plugins": []
}

@ -0,0 +1,2 @@
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/heroku/heroku-buildpack-static.git

7
.gitignore vendored

@ -0,0 +1,7 @@
.idea
dist
node_modules
.yalc
yalc.lock
storybook-static
src/catalyst

@ -0,0 +1,10 @@
.storybook
.idea
src
tailwind.config.js
tsup.config.ts
tsconfig.json
jest.config.js
.buildpacks
static.json
storybook-static

@ -0,0 +1 @@
legacy-peer-deps=true

@ -0,0 +1,24 @@
module.exports = {
stories: [
"../src/components/**/*.stories.mdx",
"../src/components/**/*.stories.@(js|jsx|ts|tsx)",
// "../src/examples/**/*.stories.mdx",
// "../src/examples/**/*.stories.@(js|jsx|ts|tsx)",
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
// "storybook-dark-mode",
],
docs: {
autodocs: true,
},
framework: {
name: "@storybook/react-webpack5",
options: {}
}
};

@ -0,0 +1,951 @@
/*
! tailwindcss v3.2.4 | MIT License | https://tailwindcss.com
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
::before,
::after {
box-sizing: border-box;
/* 1 */
border-width: 0;
/* 2 */
border-style: solid;
/* 2 */
border-color: #e5e7eb;
/* 2 */
}
::before,
::after {
--tw-content: '';
}
/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
*/
html {
line-height: 1.5;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
-moz-tab-size: 4;
/* 3 */
-o-tab-size: 4;
tab-size: 4;
/* 3 */
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */
font-feature-settings: normal;
/* 5 */
}
/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/
body {
margin: 0;
/* 1 */
line-height: inherit;
/* 2 */
}
/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/
hr {
height: 0;
/* 1 */
color: inherit;
/* 2 */
border-top-width: 1px;
/* 3 */
}
/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr:where([title]) {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
/*
Remove the default font size and weight for headings.
*/
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: inherit;
font-weight: inherit;
}
/*
Reset links to optimize for opt-in styling instead of opt-out.
*/
a {
color: inherit;
text-decoration: inherit;
}
/*
Add the correct font weight in Edge and Safari.
*/
b,
strong {
font-weight: bolder;
}
/*
1. Use the user's configured `mono` font family by default.
2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/*
Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/
table {
text-indent: 0;
/* 1 */
border-color: inherit;
/* 2 */
border-collapse: collapse;
/* 3 */
}
/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
font-weight: inherit;
/* 1 */
line-height: inherit;
/* 1 */
color: inherit;
/* 1 */
margin: 0;
/* 2 */
padding: 0;
/* 3 */
}
/*
Remove the inheritance of text transform in Edge and Firefox.
*/
button,
select {
text-transform: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
/* 1 */
background-color: transparent;
/* 2 */
background-image: none;
/* 2 */
}
/*
Use the modern Firefox focus style for all focusable elements.
*/
:-moz-focusring {
outline: auto;
}
/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/
:-moz-ui-invalid {
box-shadow: none;
}
/*
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/*
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/*
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/*
Add the correct display in Chrome and Safari.
*/
summary {
display: list-item;
}
/*
Removes the default spacing and border for appropriate elements.
*/
blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
margin: 0;
}
fieldset {
margin: 0;
padding: 0;
}
legend {
padding: 0;
}
ol,
ul,
menu {
list-style: none;
margin: 0;
padding: 0;
}
/*
Prevent resizing textareas horizontally by default.
*/
textarea {
resize: vertical;
}
/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/
input::-moz-placeholder, textarea::-moz-placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
input::placeholder,
textarea::placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}
/*
Set the default cursor for buttons.
*/
button,
[role="button"] {
cursor: pointer;
}
/*
Make sure disabled buttons don't get the pointer cursor.
*/
:disabled {
cursor: default;
}
/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
This can trigger a poorly considered lint error in some tools but is included by design.
*/
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
display: block;
/* 1 */
vertical-align: middle;
/* 2 */
}
/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/
img,
video {
max-width: 100%;
height: auto;
}
/* Make elements with the HTML hidden attribute stay hidden by default */
[hidden] {
display: none;
}
[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
border-radius: 0px;
padding-top: 0.5rem;
padding-right: 0.75rem;
padding-bottom: 0.5rem;
padding-left: 0.75rem;
font-size: 1rem;
line-height: 1.5rem;
--tw-shadow: 0 0 #0000;
}
[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: #2563eb;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
border-color: #2563eb;
}
input::-moz-placeholder, textarea::-moz-placeholder {
color: #6b7280;
opacity: 1;
}
input::placeholder,textarea::placeholder {
color: #6b7280;
opacity: 1;
}
::-webkit-datetime-edit-fields-wrapper {
padding: 0;
}
::-webkit-date-and-time-value {
min-height: 1.5em;
}
::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field {
padding-top: 0;
padding-bottom: 0;
}
select {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
background-position: right 0.5rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-right: 2.5rem;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
[multiple] {
background-image: initial;
background-position: initial;
background-repeat: unset;
background-size: initial;
padding-right: 0.75rem;
-webkit-print-color-adjust: unset;
print-color-adjust: unset;
}
[type='checkbox'],[type='radio'] {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
padding: 0;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
display: inline-block;
vertical-align: middle;
background-origin: border-box;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
flex-shrink: 0;
height: 1rem;
width: 1rem;
color: #2563eb;
background-color: #fff;
border-color: #6b7280;
border-width: 1px;
--tw-shadow: 0 0 #0000;
}
[type='checkbox'] {
border-radius: 0px;
}
[type='radio'] {
border-radius: 100%;
}
[type='checkbox']:focus,[type='radio']:focus {
outline: 2px solid transparent;
outline-offset: 2px;
--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
--tw-ring-offset-width: 2px;
--tw-ring-offset-color: #fff;
--tw-ring-color: #2563eb;
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
}
[type='checkbox']:checked,[type='radio']:checked {
border-color: transparent;
background-color: currentColor;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
[type='checkbox']:checked {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}
[type='radio']:checked {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}
[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
border-color: transparent;
background-color: currentColor;
}
[type='checkbox']:indeterminate {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
border-color: transparent;
background-color: currentColor;
background-size: 100% 100%;
background-position: center;
background-repeat: no-repeat;
}
[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
border-color: transparent;
background-color: currentColor;
}
[type='file'] {
background: unset;
border-color: inherit;
border-width: 0;
border-radius: 0;
padding: 0;
font-size: unset;
line-height: inherit;
}
[type='file']:focus {
outline: 1px solid ButtonText;
outline: 1px auto -webkit-focus-ring-color;
}
*, ::before, ::after {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
::backdrop {
--tw-border-spacing-x: 0;
--tw-border-spacing-y: 0;
--tw-translate-x: 0;
--tw-translate-y: 0;
--tw-rotate: 0;
--tw-skew-x: 0;
--tw-skew-y: 0;
--tw-scale-x: 1;
--tw-scale-y: 1;
--tw-pan-x: ;
--tw-pan-y: ;
--tw-pinch-zoom: ;
--tw-scroll-snap-strictness: proximity;
--tw-ordinal: ;
--tw-slashed-zero: ;
--tw-numeric-figure: ;
--tw-numeric-spacing: ;
--tw-numeric-fraction: ;
--tw-ring-inset: ;
--tw-ring-offset-width: 0px;
--tw-ring-offset-color: #fff;
--tw-ring-color: rgb(59 130 246 / 0.5);
--tw-ring-offset-shadow: 0 0 #0000;
--tw-ring-shadow: 0 0 #0000;
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
--tw-blur: ;
--tw-brightness: ;
--tw-contrast: ;
--tw-grayscale: ;
--tw-hue-rotate: ;
--tw-invert: ;
--tw-saturate: ;
--tw-sepia: ;
--tw-drop-shadow: ;
--tw-backdrop-blur: ;
--tw-backdrop-brightness: ;
--tw-backdrop-contrast: ;
--tw-backdrop-grayscale: ;
--tw-backdrop-hue-rotate: ;
--tw-backdrop-invert: ;
--tw-backdrop-opacity: ;
--tw-backdrop-saturate: ;
--tw-backdrop-sepia: ;
}
.absolute {
position: absolute;
}
.relative {
position: relative;
}
.top-\[50\%\] {
top: 50%;
}
.left-\[50\%\] {
left: 50%;
}
.isolate {
isolation: isolate;
}
.m-0 {
margin: 0px;
}
.box-border {
box-sizing: border-box;
}
.inline-flex {
display: inline-flex;
}
.w-full {
width: 100%;
}
.min-w-0 {
min-width: 0px;
}
.-translate-x-2\/4 {
--tw-translate-x: -50%;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.-translate-y-2\/4 {
--tw-translate-y: -50%;
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.animate-spin {
animation: spin 1s linear infinite;
}
.items-center {
align-items: center;
}
.justify-center {
justify-content: center;
}
.gap-x-2 {
-moz-column-gap: 0.5rem;
column-gap: 0.5rem;
}
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}
.rounded-lg {
border-radius: 0.5rem;
}
.border-2 {
border-width: 2px;
}
.border-mono-border {
--tw-border-opacity: 1;
border-color: rgb(209 213 219 / var(--tw-border-opacity));
}
.border-mono-primary {
--tw-border-opacity: 1;
border-color: rgb(39 39 42 / var(--tw-border-opacity));
}
.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.bg-mono-primary {
--tw-bg-opacity: 1;
background-color: rgb(39 39 42 / var(--tw-bg-opacity));
}
.py-0\.5 {
padding-top: 0.125rem;
padding-bottom: 0.125rem;
}
.px-1\.5 {
padding-left: 0.375rem;
padding-right: 0.375rem;
}
.py-0 {
padding-top: 0px;
padding-bottom: 0px;
}
.px-1 {
padding-left: 0.25rem;
padding-right: 0.25rem;
}
.py-1 {
padding-top: 0.25rem;
padding-bottom: 0.25rem;
}
.px-2 {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
.py-1\.5 {
padding-top: 0.375rem;
padding-bottom: 0.375rem;
}
.px-3\.5 {
padding-left: 0.875rem;
padding-right: 0.875rem;
}
.px-3 {
padding-left: 0.75rem;
padding-right: 0.75rem;
}
.text-sm {
font-size: 0.875rem;
line-height: 1.25rem;
}
.text-base {
font-size: 1rem;
line-height: 1.5rem;
}
.font-semibold {
font-weight: 600;
}
.text-mono-primary {
--tw-text-opacity: 1;
color: rgb(39 39 42 / var(--tw-text-opacity));
}
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
.opacity-0 {
opacity: 0;
}
html {
font-size: 14px;
}
.hover\:bg-gray-100:hover {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity));
}
.hover\:bg-mono-primary-hover:hover {
--tw-bg-opacity: 1;
background-color: rgb(63 63 70 / var(--tw-bg-opacity));
}
.focus\:outline-none:focus {
outline: 2px solid transparent;
outline-offset: 2px;
}
.focus-visible\:ring-2:focus-visible {
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}
.focus-visible\:ring-mono-primary:focus-visible {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(39 39 42 / var(--tw-ring-opacity));
}
.focus-visible\:ring-offset-2:focus-visible {
--tw-ring-offset-width: 2px;
}
.data-\[disabled\]\:opacity-50[data-disabled] {
opacity: 0.5;
}
.data-\[focus\]\:outline[data-focus] {
outline-style: solid;
}
.data-\[focus\]\:outline-2[data-focus] {
outline-width: 2px;
}
.data-\[focus\]\:outline-offset-2[data-focus] {
outline-offset: 2px;
}
.data-\[focus\]\:outline-blue-500[data-focus] {
outline-color: #3b82f6;
}
@media (prefers-reduced-motion: no-preference) {
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.motion-safe\:animate-spin {
animation: spin 1s linear infinite;
}
}
.\[\&\>\[data-slot\=icon\]\]\:-mx-0\.5>[data-slot=icon] {
margin-left: -0.125rem;
margin-right: -0.125rem;
}
.\[\&\>\[data-slot\=icon\]\]\:my-0\.5>[data-slot=icon] {
margin-top: 0.125rem;
margin-bottom: 0.125rem;
}
.\[\&\>\[data-slot\=icon\]\]\:shrink-0>[data-slot=icon] {
flex-shrink: 0;
}
.\[\&\>\[data-slot\=icon\]\]\:text-\[--btn-icon\]>[data-slot=icon] {
color: --btn-icon;
}
@media (min-width: 640px) {
.\[\&\>\[data-slot\=icon\]\]\:sm\:my-1>[data-slot=icon] {
margin-top: 0.25rem;
margin-bottom: 0.25rem;
}
}

@ -0,0 +1,16 @@
import "./output.css";
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
darkMode: {
darkClass: "dark",
classTarget: "html",
stylePreview: true,
},
};

@ -0,0 +1,210 @@
# Ew UI
Probably the most opinionated React UI library.
## Type of pages
1. App pages. Pages behind the login.
2. Public pages. Pages accessible to everyone.
## Dashboard
You build your own Dashboard using the DashboardContent component and the sidebar, like so:
```jsx
function Dashboard() {
return (
<>
<Sidebar />
<DashboardContent />
</>
)
}
```
## Color palette
You need to define these values:
```js
"ew-primary": {
DEFAULT: "#7F5aF0",
},
"ew-accent": {
DEFAULT: "#444652",
},
"ew-text": {
DEFAULT: "#333",
},
"ew-text-light": {
DEFAULT: "#fff",
},
"ew-link": {
DEFAULT: "#006bb8",
},
"ew-success": {
DEFAULT: "#12E999",
},
"ew-warning": {
DEFAULT: "#FBBD23",
},
"ew-error": {
DEFAULT: "#BD271E",
},
"ew-bg": {
DEFAULT: "#fff",
},
"ew-bg-dark": {
DEFAULT: "#333",
}
```
Then, generate the shades for each color using https://www.tints.dev/ and fill the objects as:
```js
"ew-primary": {
DEFAULT: "#7F5aF0",
50: "#F1ECFD",
100: "#E6DEFC",
200: "#CCBEF9",
300: "#B39DF6",
400: "#9A7CF3",
500: "#7F5AF0",
600: "#521FEB",
700: "#3A11B6",
800: "#270B7A",
900: "#13063D",
950: "#09031C",
},
"ew-accent": {
DEFAULT: "#444652",
50: "#E9EAF1",
100: "#D0D2E2",
200: "#A1A4C4",
300: "#757AA9",
400: "#505581",
500: "#333652",
600: "#292C42",
700: "#1F2132",
800: "#14151F",
900: "#0A0A10",
950: "#060609",
},
"ew-text": {
DEFAULT: "#333",
50: "#EBEBEB",
100: "#D6D6D6",
200: "#ADADAD",
300: "#858585",
400: "#5C5C5C",
500: "#333333",
600: "#292929",
700: "#1F1F1F",
800: "#141414",
900: "#0A0A0A",
950: "#050505",
},
"ew-text-light": {
DEFAULT: "#fff",
50: "#FFFFFF",
100: "#FFFFFF",
200: "#FFFFFF",
300: "#FFFFFF",
400: "#FFFFFF",
500: "#FFFFFF",
600: "#CCCCCC",
700: "#999999",
800: "#666666",
900: "#333333",
950: "#1A1A1A",
},
"ew-link": {
DEFAULT: "#006bb8",
50: "#E0F2FF",
100: "#BDE3FF",
200: "#7AC8FF",
300: "#3DAEFF",
400: "#0092FA",
500: "#006BB8",
600: "#005694",
700: "#004170",
800: "#002A47",
900: "#001524",
950: "#000C14",
},
"ew-success": {
DEFAULT: "#12E999",
50: "#E7FDF5",
100: "#D0FBEB",
200: "#A0F8D8",
300: "#71F4C4",
400: "#3DF0AE",
500: "#12E999",
600: "#0EB97A",
700: "#0B8E5E",
800: "#075F3F",
900: "#042F1F",
950: "#021810",
},
"ew-warning": {
DEFAULT: "#FBBD23",
50: "#FFF9EB",
100: "#FEF2D2",
200: "#FDE4A5",
300: "#FDD87D",
400: "#FCCB50",
500: "#FBBD23",
600: "#E1A304",
700: "#AA7B03",
800: "#6E5002",
900: "#372801",
950: "#1E1601",
},
"ew-error": {
DEFAULT: "#BD271E",
50: "#FBE6E5",
100: "#F7D1CF",
200: "#EF9E9A",
300: "#E77069",
400: "#DF3D35",
500: "#BD271E",
600: "#961E18",
700: "#721712",
800: "#4B0F0C",
900: "#280806",
950: "#120403",
},
"ew-bg": {
DEFAULT: "#fff",
50: "#FFFFFF",
100: "#FFFFFF",
200: "#FFFFFF",
300: "#FFFFFF",
400: "#FFFFFF",
500: "#FFFFFF",
600: "#CCCCCC",
700: "#999999",
800: "#666666",
900: "#333333",
950: "#1A1A1A",
},
"ew-bg-dark": {
DEFAULT: "#333",
50: "#EBEBEB",
100: "#D6D6D6",
200: "#ADADAD",
300: "#858585",
400: "#5C5C5C",
500: "#333333",
600: "#292929",
700: "#1F1F1F",
800: "#141414",
900: "#0A0A0A",
950: "#050505",
},
```
Resources:
* https://www.webdesignrankings.com/resources/lolcolors/
* https://www.happyhues.co/palettes/4

@ -0,0 +1,194 @@
/*
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
module.exports = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
// bail: 0,
// The directory where Jest should store its cached dependency information
// cacheDirectory: "/private/var/folders/_s/lk3nyf2127b85xch4yk9tlx00000gn/T/jest_dx",
// Automatically clear mock calls, instances, contexts and results before every test
// clearMocks: false,
// Indicates whether the coverage information should be collected while executing the test
// collectCoverage: false,
// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,
// The directory where Jest should output its coverage files
// coverageDirectory: undefined,
// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],
// Indicates which provider should be used to instrument code for coverage
// coverageProvider: "babel",
// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
// "clover"
// ],
// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
// A path to a custom dependency extractor
// dependencyExtractor: undefined,
// Make calling deprecated APIs throw helpful error messages
// errorOnDeprecated: false,
// The default configuration for fake timers
// fakeTimers: {
// "enableGlobally": false
// },
// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],
// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,
// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,
// A set of global variables that need to be available in all test environments
// globals: {},
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],
// An array of file extensions your modules use
// moduleFileExtensions: [
// "js",
// "mjs",
// "cjs",
// "jsx",
// "ts",
// "tsx",
// "json",
// "node"
// ],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// moduleNameMapper: {},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],
// Activates notifications for test results
// notify: false,
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",
// A preset that is used as a base for Jest's configuration
// presets: undefined,
// Run tests from one or more projects
// projects: undefined,
// Use this configuration option to add custom reporters to Jest
// reporters: undefined,
// Automatically reset mock state before every test
// resetMocks: false,
// Reset the module registry before running each individual test
// resetModules: false,
// A path to a custom resolver
// resolver: undefined,
// Automatically restore mock state and implementation before every test
// restoreMocks: false,
// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,
// A list of paths to directories that Jest should use to search for files in
// roots: [
// "<rootDir>"
// ],
// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",
// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
// The test environment that will be used for testing
testEnvironment: "jsdom",
// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
// Adds a location field to test results
// testLocationInResults: false,
// The glob patterns Jest uses to detect test files
testMatch: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[tj]s?(x)"],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "/node_modules/"
// ],
// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
// This option allows the use of a custom results processor
// testResultsProcessor: undefined,
// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",
// A map from regular expressions to paths to transformers
transform: {
"^.+\\.tsx?$": "ts-jest",
},
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "/node_modules/",
// "\\.pnp\\.[^\\/]+$"
// ],
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
// Indicates whether each individual test should be reported during the run
// verbose: undefined,
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
// watchPathIgnorePatterns: [],
// Whether to use watchman for file crawling
// watchman: true,
};

24943
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,103 @@
{
"name": "monoui",
"version": "0.1.0",
"description": "Mono UI",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"engines": {
"node": "18.17.0"
},
"scripts": {
"build": "tsup",
"watch": "tsup --watch",
"test": "jest",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"watch:storybook": "storybook dev -p 6006",
"watch:tailwind": "npx tailwindcss -i ./src/input.css -o ./.storybook/output.css --watch",
"dev": "npm-run-all --parallel watch:*",
"release": "np --no-2fa",
"heroku-postbuild": "npm run build-storybook"
},
"repository": {
"type": "git",
"url": "git+https://github.com/j0lv3r4/monoui.git"
},
"keywords": [
"React",
"UI",
"Components"
],
"author": "Juan Olvera",
"license": "MIT",
"bugs": {
"url": "https://github.com/j0lv3r4/monoui/issues"
},
"homepage": "https://github.com/j0lv3r4/monoui#readme",
"devDependencies": {
"@babel/preset-env": "^7.23.7",
"@storybook/addon-actions": "^7.6.7",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-interactions": "^7.6.7",
"@storybook/addon-links": "^7.6.7",
"@storybook/react": "^7.6.7",
"@storybook/react-webpack5": "^7.6.7",
"@storybook/testing-library": "^0.2.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.9",
"@tanstack/react-query": "^4.24.3",
"@tanstack/react-query-devtools": "^4.24.3",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/dashify": "^1.0.1",
"@types/jest": "^29.4.0",
"@types/react": "^18.0.27",
"autoprefixer": "^10.4.13",
"class-variance-authority": "^0.4.0",
"clsx": "^1.2.1",
"color": "^4.2.3",
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1",
"np": "^7.6.3",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.33",
"prettier": "^2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.43.2",
"rollup": "^3.12.0",
"storybook": "^7.6.7",
"tailwind-merge": "^1.11.0",
"tailwindcss": "^3.2.4",
"ts-jest": "^29.0.5",
"tsup": "^6.5.0",
"typescript": "^5.1.6",
"webpack": "^5.77.0"
},
"dependencies": {
"@radix-ui/react-dropdown-menu": "^2.0.4",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-primitive": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toggle": "^1.0.3",
"@react-spring/web": "^9.7.1",
"@tanstack/react-table": "^8.8.5",
"dashify": "^2.0.0",
"react-icons": "^4.7.1",
"react-number-format": "^5.1.4",
"ts-pattern": "^5.0.6",
"zustand": "^4.3.7"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"np": {
"yarn": false
},
"resolutions": {
"@storybook/{app}/webpack": "^5"
}
}

@ -0,0 +1,26 @@
import React from "react";
import type { Meta, StoryObj } from "@storybook/react";
import { Box } from "./Box";
const meta: Meta<typeof Box> = {
title: "UI/Box",
component: Box,
};
export default meta;
type Story = StoryObj<typeof Box>;
export const Default: Story = {
render: () => <Box>Hello world</Box>,
};
export const AsForm: Story = {
render: () => (
<Box asChild>
<form>
<input type="text" />
<button type="submit">Submit</button>
</form>
</Box>
),
};

@ -0,0 +1,7 @@
import { cva } from "class-variance-authority";
const base = ["box-border", "m-0", "min-w-0", "w-full"];
const boxStyles = cva(base);
export { boxStyles };

@ -0,0 +1,13 @@
import React, { HTMLAttributes } from "react";
import "@testing-library/jest-dom";
import { render, screen } from "@testing-library/react";
import { Box } from "./Box";
describe("Box", () => {
test("Check component renders", () => {
render(<Box data-testid="box">Hello world</Box>);
const box = screen.getByTestId("box") as HTMLDivElement;
expect(box.innerHTML).toBe("Hello world");
});
});

@ -0,0 +1,18 @@
import React, { ComponentPropsWithoutRef, ElementRef, forwardRef } from "react";
import { Primitive } from "@radix-ui/react-primitive";
import { boxStyles } from "./Box.styles";
import { cx } from "../../utils";
const Box = forwardRef<
ElementRef<typeof Primitive.div>, // renderer function
ComponentPropsWithoutRef<typeof Primitive.div> // exotic component (not fn components just objects) ref: https://stackoverflow.com/a/64239113
>(({ children, ...props }, forwardedRef) => {
const styles = cx(boxStyles, props.className);
return (
<Primitive.div {...props} className={styles} ref={forwardedRef}>
{children}
</Primitive.div>
);
});
export { Box };

@ -0,0 +1,2 @@
export * from "./Box";
export * from "./Box.types";

@ -0,0 +1,60 @@
import React from "react";
import { FaBeer, FaApple } from "react-icons/fa";
import { Meta, StoryObj } from "@storybook/react";
import { Button } from "./Button";
import { Box } from "../Box";
import { cx } from "../../utils";
const meta: Meta<typeof Button> = {
title: "UI/Button",
component: Button,
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Default: Story = {
render: () => <Button>Click me</Button>,
};
export const Primary: Story = {
render: () => <Button intent="primary">Click me</Button>,
};
export const Sizes: Story = {
render: () => (
<Box className={cx(["space-x-2"])}>
<Button size="sm">Click me</Button>
<Button size="md">Click me</Button>
<Button size="lg">Click me</Button>
</Box>
),
};
export const WithIcon: Story = {
render: () => (
<Box className={cx(["space-x-2"])}>
<Button>
<FaBeer />
Click me
</Button>
<Button intent="primary">
<FaApple />
Click me
</Button>
</Box>
),
};
export const Loading: Story = {
render: () => (
<Box className={cx(["space-x-2"])}>
<Button intent="primary" loading>
Click me
</Button>
</Box>
),
};

@ -0,0 +1,63 @@
import { cva } from "class-variance-authority";
const base = [
// Base
"relative isolate inline-flex items-center justify-center gap-x-2 rounded-lg border-2 text-base/6 font-semibold",
// Focus
// "focus:outline-none data-[focus]:outline data-[focus]:outline-2 data-[focus]:outline-offset-2 data-[focus]:outline-blue-500",
"focus:outline-none",
"data-[focus]:outline",
"focus-visible:ring-2",
"focus-visible:ring-offset-2",
"focus-visible:ring-mono-primary",
// Icon
// "[&>[data-slot=icon]]:-mx-0.5 [&>[data-slot=icon]]:my-0.5 [&>[data-slot=icon]]:size-5 [&>[data-slot=icon]]:shrink-0 [&>[data-slot=icon]]:text-[--btn-icon] [&>[data-slot=icon]]:sm:my-1 [&>[data-slot=icon]]:sm:size-4 forced-colors:[--btn-icon:ButtonText] forced-colors:data-[hover]:[--btn-icon:ButtonText]",
];
const size = {
sm: ["py-0.5", "px-1.5", "text-sm"],
md: ["py-1", "px-2"],
lg: ["py-1.5", "px-3.5", "text-base"],
};
const DEFAULT = [
"bg-white",
"hover:bg-gray-100",
"text-mono-primary",
"border-mono-border",
];
const primary = [
"bg-mono-primary",
"hover:bg-mono-primary-hover",
"border-mono-primary",
"text-white",
];
const buttonStyles = cva(base, {
variants: {
primary: {
true: primary,
},
intent: {
primary,
DEFAULT,
},
size,
fullWidth: {
true: "w-full",
},
disabled: {
true: ["data-[disabled]:opacity-50"],
},
},
defaultVariants: {
size: "md",
primary: false,
intent: "DEFAULT",
},
});
export { buttonStyles };

@ -0,0 +1,44 @@
import React, { forwardRef } from "react";
import { match, P } from "ts-pattern";
import { Primitive } from "@radix-ui/react-primitive";
import { CgSpinner } from "react-icons/cg";
import { buttonStyles } from "./Button.styles";
import type * as T from "./Button.types";
import { cx } from "../../utils";
const Button = forwardRef<T.ButtonElement, T.ButtonProps>(
(
{ size, intent, primary, loading = false, children, ...props },
forwardedRef
) => {
const classes = cx(
buttonStyles({ size, intent, primary }),
props.className
);
return (
<Primitive.button {...props} className={classes} ref={forwardedRef}>
{match({ loading })
.with({ loading: true }, () => (
<>
<span
className={cx([
"absolute",
"top-[50%]",
"left-[50%]",
"-translate-x-2/4",
"-translate-y-2/4",
])}
>
<CgSpinner className={cx("motion-safe:animate-spin")} />
</span>
<span className={cx(["opacity-0"])}>{children}</span>
</>
))
.otherwise(() => children)}
</Primitive.button>
);
}
);
export { Button };

@ -0,0 +1,13 @@
import { VariantProps } from "class-variance-authority";
import type { buttonStyles } from "./Button.styles";
import { ComponentPropsWithoutRef, ElementRef } from "react";
import { Primitive } from "@radix-ui/react-primitive";
type ButtonElement = ElementRef<typeof Primitive.button>;
type ButtonProps = ComponentPropsWithoutRef<typeof Primitive.button> &
VariantProps<typeof buttonStyles> & {
loading?: boolean;
};
export type { ButtonElement, ButtonProps };

@ -0,0 +1,2 @@
export * from "./Button";
export * from "./Button.types";

@ -0,0 +1,3 @@
export { Box } from "./components/Box";
export { Button } from "./components/Button";
export { cx } from "./utils";

@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
html {
font-size: 14px;
}

@ -0,0 +1,6 @@
import { ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
const cx = (...classes: ClassValue[]) => twMerge(clsx(classes));
export { cx };

@ -0,0 +1,7 @@
{
"root": "storybook-static/",
"clean_urls": true,
"routes": {
"/**": "index.html"
}
}

@ -0,0 +1,34 @@
const colors = require("tailwindcss/colors");
const Color = require("color");
// https://github.com/tailwindlabs/discuss/issues/392#issuecomment-559305633
const alpha = (clr, val) => Color(clr).alpha(val).rgb().string();
const lighen = (clr, val) => Color(clr).lighten(val).rgb().string();
const darken = (clr, val) => Color(clr).darken(val).rgb().string();
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: "class",
content: [
"./src/components/**/*.{ts,tsx}",
// "./src/examples/**/*.{ts,tsx}",
"./src/index.ts",
],
theme: {
extend: {
colors: {
"mono-primary": {
DEFAULT: colors.zinc[800],
hover: colors.zinc[700],
},
"mono-border": {
DEFAULT: colors.gray["300"],
},
"mono-text": {
DEFAULT: colors.zinc["800"],
},
},
},
},
plugins: [require("@tailwindcss/forms")],
};

@ -0,0 +1,104 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
"jsx": "react", /* Specify what JSX code is generated. */
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "ESNext", /* Specify what module code is generated. */
// "rootDir": "./", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "resolveJsonModule": true, /* Enable importing .json files. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
"emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "dist", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
"declarationDir": "types", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
},
"exclude": ["dist", "node_modules", "src/**/*.test.tsx", "src/**/*.stories.tsx"]
}

@ -0,0 +1,17 @@
import { defineConfig } from "tsup";
export default defineConfig({
outExtension({ format }) {
return {
js: `.${format}.js`,
};
},
entry: ["src/index.ts"],
format: ["esm", "cjs"],
dts: true,
splitting: false,
sourcemap: true,
clean: true,
minify: true,
noExternal: ["react-icons"],
});
Loading…
Cancel
Save