@incognia/cosmik 0.0.1

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 (122) hide show
  1. package/.eslintrc.cjs +18 -0
  2. package/.github/CODEOWNERS +4 -0
  3. package/.storybook/main.ts +19 -0
  4. package/.storybook/preview.ts +17 -0
  5. package/CONTRIBUTING.md +20 -0
  6. package/README.md +39 -0
  7. package/components.json +12 -0
  8. package/dist/Button/Button.stories.d.ts +23 -0
  9. package/dist/Button/Button.stories.d.ts.map +1 -0
  10. package/dist/Button/index.d.ts +12 -0
  11. package/dist/Button/index.d.ts.map +1 -0
  12. package/dist/Colors.d.ts +53 -0
  13. package/dist/Colors.d.ts.map +1 -0
  14. package/dist/cosmik.css +666 -0
  15. package/dist/index.cjs.js +2 -0
  16. package/dist/index.cjs.js.map +1 -0
  17. package/dist/index.cjs10.js +2 -0
  18. package/dist/index.cjs10.js.map +1 -0
  19. package/dist/index.cjs11.js +2 -0
  20. package/dist/index.cjs11.js.map +1 -0
  21. package/dist/index.cjs12.js +10 -0
  22. package/dist/index.cjs12.js.map +1 -0
  23. package/dist/index.cjs13.js +20 -0
  24. package/dist/index.cjs13.js.map +1 -0
  25. package/dist/index.cjs14.js +2 -0
  26. package/dist/index.cjs14.js.map +1 -0
  27. package/dist/index.cjs15.js +2 -0
  28. package/dist/index.cjs15.js.map +1 -0
  29. package/dist/index.cjs16.js +2 -0
  30. package/dist/index.cjs16.js.map +1 -0
  31. package/dist/index.cjs17.js +2 -0
  32. package/dist/index.cjs17.js.map +1 -0
  33. package/dist/index.cjs18.js +2 -0
  34. package/dist/index.cjs18.js.map +1 -0
  35. package/dist/index.cjs19.js +2 -0
  36. package/dist/index.cjs19.js.map +1 -0
  37. package/dist/index.cjs2.js +2 -0
  38. package/dist/index.cjs2.js.map +1 -0
  39. package/dist/index.cjs20.js +2 -0
  40. package/dist/index.cjs20.js.map +1 -0
  41. package/dist/index.cjs21.js +2 -0
  42. package/dist/index.cjs21.js.map +1 -0
  43. package/dist/index.cjs22.js +2 -0
  44. package/dist/index.cjs22.js.map +1 -0
  45. package/dist/index.cjs3.js +2 -0
  46. package/dist/index.cjs3.js.map +1 -0
  47. package/dist/index.cjs4.js +2 -0
  48. package/dist/index.cjs4.js.map +1 -0
  49. package/dist/index.cjs5.js +2 -0
  50. package/dist/index.cjs5.js.map +1 -0
  51. package/dist/index.cjs6.js +2 -0
  52. package/dist/index.cjs6.js.map +1 -0
  53. package/dist/index.cjs7.js +2 -0
  54. package/dist/index.cjs7.js.map +1 -0
  55. package/dist/index.cjs8.js +2 -0
  56. package/dist/index.cjs8.js.map +1 -0
  57. package/dist/index.cjs9.js +2 -0
  58. package/dist/index.cjs9.js.map +1 -0
  59. package/dist/index.d.ts +10 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.es.js +10 -0
  62. package/dist/index.es.js.map +1 -0
  63. package/dist/index.es10.js +37 -0
  64. package/dist/index.es10.js.map +1 -0
  65. package/dist/index.es11.js +5 -0
  66. package/dist/index.es11.js.map +1 -0
  67. package/dist/index.es12.js +33 -0
  68. package/dist/index.es12.js.map +1 -0
  69. package/dist/index.es13.js +602 -0
  70. package/dist/index.es13.js.map +1 -0
  71. package/dist/index.es14.js +5 -0
  72. package/dist/index.es14.js.map +1 -0
  73. package/dist/index.es15.js +154 -0
  74. package/dist/index.es15.js.map +1 -0
  75. package/dist/index.es16.js +19 -0
  76. package/dist/index.es16.js.map +1 -0
  77. package/dist/index.es17.js +345 -0
  78. package/dist/index.es17.js.map +1 -0
  79. package/dist/index.es18.js +48 -0
  80. package/dist/index.es18.js.map +1 -0
  81. package/dist/index.es19.js +5 -0
  82. package/dist/index.es19.js.map +1 -0
  83. package/dist/index.es2.js +55 -0
  84. package/dist/index.es2.js.map +1 -0
  85. package/dist/index.es20.js +5 -0
  86. package/dist/index.es20.js.map +1 -0
  87. package/dist/index.es21.js +5 -0
  88. package/dist/index.es21.js.map +1 -0
  89. package/dist/index.es22.js +7 -0
  90. package/dist/index.es22.js.map +1 -0
  91. package/dist/index.es3.js +242 -0
  92. package/dist/index.es3.js.map +1 -0
  93. package/dist/index.es4.js +46 -0
  94. package/dist/index.es4.js.map +1 -0
  95. package/dist/index.es5.js +266 -0
  96. package/dist/index.es5.js.map +1 -0
  97. package/dist/index.es6.js +9 -0
  98. package/dist/index.es6.js.map +1 -0
  99. package/dist/index.es7.js +9 -0
  100. package/dist/index.es7.js.map +1 -0
  101. package/dist/index.es8.js +7 -0
  102. package/dist/index.es8.js.map +1 -0
  103. package/dist/index.es9.js +108 -0
  104. package/dist/index.es9.js.map +1 -0
  105. package/dist/lib/utils.d.ts +3 -0
  106. package/dist/lib/utils.d.ts.map +1 -0
  107. package/dist/tailwind-theme-config.d.ts +198 -0
  108. package/dist/tailwind-theme-config.d.ts.map +1 -0
  109. package/package.json +69 -0
  110. package/postcss.config.js +6 -0
  111. package/src/Button/Button.stories.tsx +88 -0
  112. package/src/Button/index.tsx +56 -0
  113. package/src/Colors.ts +60 -0
  114. package/src/css/font.css +68 -0
  115. package/src/css/index.css +37 -0
  116. package/src/index.css +5 -0
  117. package/src/index.ts +10 -0
  118. package/src/lib/utils.ts +6 -0
  119. package/src/tailwind-theme-config.ts +240 -0
  120. package/tailwind.config.js +7 -0
  121. package/tsconfig.json +21 -0
  122. package/vite.config.ts +33 -0
package/.eslintrc.cjs ADDED
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: { browser: true, es2020: true },
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:react-hooks/recommended',
8
+ ],
9
+ ignorePatterns: ['dist', '.eslintrc.cjs'],
10
+ parser: '@typescript-eslint/parser',
11
+ plugins: ['react-refresh'],
12
+ rules: {
13
+ 'react-refresh/only-export-components': [
14
+ 'warn',
15
+ { allowConstantExport: true },
16
+ ],
17
+ },
18
+ }
@@ -0,0 +1,4 @@
1
+ # These owners will be the default owners for everything in
2
+ # the repo. Unless a later match takes precedence, they will be
3
+ # requested for review when someone opens a pull request.
4
+ * @FranciscoGileno @marcelscr @ottony @julianalucena @leonardoAnjos16
@@ -0,0 +1,19 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite'
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
+ addons: [
6
+ '@storybook/addon-links',
7
+ '@storybook/addon-essentials',
8
+ '@storybook/addon-onboarding',
9
+ '@storybook/addon-interactions'
10
+ ],
11
+ framework: {
12
+ name: '@storybook/react-vite',
13
+ options: {}
14
+ },
15
+ docs: {
16
+ autodocs: 'tag'
17
+ }
18
+ }
19
+ export default config
@@ -0,0 +1,17 @@
1
+ import type { Preview } from '@storybook/react'
2
+
3
+ import '../src/index.css'
4
+
5
+ const preview: Preview = {
6
+ parameters: {
7
+ actions: { argTypesRegex: '^on[A-Z].*' },
8
+ controls: {
9
+ matchers: {
10
+ color: /(background|color)$/i,
11
+ date: /Date$/
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ export default preview
@@ -0,0 +1,20 @@
1
+ 1. Clone the repo:
2
+
3
+ ```sh
4
+ git clone git@github.com:inloco/cosmik.git
5
+ ```
6
+
7
+ 2. Install `pnpm`: Follow: https://pnpm.io/installation
8
+
9
+ 3. Install deps and build the project
10
+ ```sh
11
+ cd cosmik
12
+ pnpm install
13
+ ```
14
+
15
+ 4. Run storybook
16
+ ```sh
17
+ pnpm storybook
18
+ ```
19
+
20
+ This should start a storybook webserver.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # Cosmik
2
+
3
+ Incognia component library, based on Shadcn UI.
4
+
5
+ Component Docs: https://inloco.github.io/cosmik
6
+
7
+ # Usage
8
+ 1. Install
9
+ ```sh
10
+ npm install --save @incognia/cosmik
11
+ ```
12
+
13
+ 2. CSS: There are two ways to import the CSS depeding on wheather your project uses the cosmik tailwindcss theme
14
+
15
+ 2.1. Uses cosmik tailwind theme (prefered):
16
+ Configure your tailwind file (tailwind.config.js):
17
+ ```js
18
+ const { tailwindTheme } = require('@incognia/cosmik')
19
+
20
+ /** @type {import('tailwindcss').Config} */
21
+ export default {
22
+ content: [
23
+ './index.html',
24
+ './src/**/*.{js,ts,jsx,tsx}',
25
+ './node_modules/@incognia/cosmik/dist/**/*.js'
26
+ ],
27
+ theme: tailwindTheme
28
+ }
29
+ ```
30
+ 2.2. Does not use cosmik tailwind theme:
31
+ Add the cosmik css to your project:
32
+ ```js
33
+ import '@incognia/cosmik/dist/cosmik.css'
34
+ ```
35
+
36
+ 3. Import Cosmik components as needed:
37
+ ```js
38
+ import { Button } from '@incognia/cosmik'
39
+ ```
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "default",
4
+ "rsc": false,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "tailwind.config.js",
8
+ "css": "src/index.css",
9
+ "baseColor": "gray",
10
+ "cssVariables": false
11
+ }
12
+ }
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").ForwardRefExoticComponent<import(".").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Primary: Story;
14
+ export declare const Secondary: Story;
15
+ export declare const Ghost: Story;
16
+ export declare const Subtle: Story;
17
+ export declare const SubtleGray: Story;
18
+ export declare const Disabled: Story;
19
+ export declare const Small: Story;
20
+ export declare const Icon: Story;
21
+ export declare const WithIcon: Story;
22
+ export declare const AsChild: Story;
23
+ //# sourceMappingURL=Button.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../src/Button/Button.stories.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAItD,QAAA,MAAM,IAAI;;;;;;;CAOqB,CAAA;AAE/B,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAKpB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAKnB,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "primary" | "ghost" | "subtle" | "subtleGray" | null | undefined;
5
+ size?: "default" | "icon" | "sm" | null | undefined;
6
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ asChild?: boolean;
9
+ }
10
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export { Button, buttonVariants };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Button/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,cAAc;;;mFA2BnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,53 @@
1
+ declare const Colors: {
2
+ WHITE: string;
3
+ GRAY_50: string;
4
+ GRAY_100: string;
5
+ GRAY_200: string;
6
+ GRAY_300: string;
7
+ GRAY_400: string;
8
+ GRAY_500: string;
9
+ GRAY_600: string;
10
+ GRAY_700: string;
11
+ GRAY_800: string;
12
+ GRAY_900: string;
13
+ GREEN_50: string;
14
+ GREEN_500: string;
15
+ GREEN_600: string;
16
+ GREEN_700: string;
17
+ GREEN_800: string;
18
+ MAGENTA_50: string;
19
+ MAGENTA_500: string;
20
+ MAGENTA_600: string;
21
+ MAGENTA_700: string;
22
+ PURPLE_50: string;
23
+ PURPLE_100: string;
24
+ PURPLE_200: string;
25
+ PURPLE_300: string;
26
+ PURPLE_400: string;
27
+ PURPLE_500: string;
28
+ PURPLE_600: string;
29
+ PURPLE_700: string;
30
+ PURPLE_800: string;
31
+ PURPLE_900: string;
32
+ ROBINBLUE_50: string;
33
+ ROBINBLUE_100: string;
34
+ ROBINBLUE_200: string;
35
+ ROBINBLUE_300: string;
36
+ ROBINBLUE_400: string;
37
+ ROBINBLUE_500: string;
38
+ ROBINBLUE_600: string;
39
+ ROBINBLUE_700: string;
40
+ ROBINBLUE_800: string;
41
+ ROBINBLUE_900: string;
42
+ YELLOW_50: string;
43
+ YELLOW_500: string;
44
+ YELLOW_600: string;
45
+ YELLOW_700: string;
46
+ CHART_PURPLE: string;
47
+ CHART_MAGENTA: string;
48
+ CHART_YELLOW: string;
49
+ CHART_ROBINBLUE: string;
50
+ CHART_GREEN: string;
51
+ };
52
+ export default Colors;
53
+ //# sourceMappingURL=Colors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../src/Colors.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDX,CAAA;AAED,eAAe,MAAM,CAAA"}