@okam/next-component 0.1.0 → 0.1.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.
package/package.json CHANGED
@@ -1,4 +1,7 @@
1
1
  {
2
2
  "name": "@okam/next-component",
3
- "version": "0.1.0"
4
- }
3
+ "version": "0.1.1",
4
+ "module": "./index.esm.js",
5
+ "type": "module",
6
+ "main": "./index.esm.js"
7
+ }
@@ -0,0 +1,3 @@
1
+ import type TImgProps from './interface';
2
+ declare const Img: (props: TImgProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Img;
@@ -0,0 +1,6 @@
1
+ import type { TDefaultComponent } from '@okam/stack-ui';
2
+ import type { ImageProps, StaticImageData } from 'next/image';
3
+ type TImgProps = TDefaultComponent & Omit<ImageProps, 'src'> & {
4
+ src: string | StaticImageData;
5
+ };
6
+ export default TImgProps;
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lib/next-component';
@@ -0,0 +1 @@
1
+ export declare function HelloServer(): Promise<import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1,4 @@
1
+ export interface NextComponentProps {
2
+ }
3
+ export declare function NextComponent(props: NextComponentProps): import("react/jsx-runtime").JSX.Element;
4
+ export default NextComponent;
@@ -0,0 +1 @@
1
+ export * from './lib/hello-server';
package/.eslintrc.js DELETED
@@ -1,21 +0,0 @@
1
- const { getDefaultIgnorePatterns } = require("../../../linter/helpers");
2
-
3
- module.exports = {
4
- extends: ['plugin:@nx/react', '../../../.eslintrc.js', '../../../linter/bases/typescript', '../../../linter/bases/regexp', '../../../linter/bases/jest', '../../../linter/bases/rtl', '../../../linter/bases/storybook', '../../../linter/bases/react', '../../../linter/bases/prettier', 'plugin:storybook/recommended'],
5
- ignorePatterns: ['!**/*', ...getDefaultIgnorePatterns()],
6
- overrides: [
7
- {
8
- files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
9
- // We set parserOptions.project for the project to allow TypeScript to create the type-checker behind the scenes when we run linting
10
- parserOptions: {
11
- project: `${__dirname}/tsconfig.*?.json`,
12
- },
13
- rules: {
14
- "@nx/dependency-checks": "error"
15
- }
16
- },
17
- ],
18
- rules: {
19
- 'react/react-in-jsx-scope': 'off',
20
- },
21
- }
@@ -1,33 +0,0 @@
1
- /* eslint-disable @typescript-eslint/ban-ts-comment */
2
- import type { StorybookConfig } from '@storybook/nextjs'
3
-
4
- const config: StorybookConfig = {
5
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
6
- addons: [
7
- '@storybook/addon-a11y',
8
- '@storybook/addon-links',
9
- '@storybook/addon-essentials',
10
- '@storybook/addon-interactions',
11
- {
12
- name: '@storybook/addon-styling',
13
- options: {
14
- // Check out https://github.com/storybookjs/addon-styling/blob/main/docs/api.md
15
- // For more details on this addon's options.
16
- postCss: true,
17
- },
18
- },
19
- ],
20
- framework: {
21
- name: '@storybook/nextjs',
22
- options: {},
23
- },
24
- docs: {
25
- autodocs: 'tag',
26
- },
27
- }
28
-
29
- export default config
30
-
31
- // To customize your Vite configuration you can use the viteFinal field.
32
- // Check https://storybook.js.org/docs/react/builders/vite#configuration
33
- // and https://nx.dev/packages/storybook/documents/custom-builder-configs
File without changes
package/CHANGELOG.md DELETED
@@ -1,16 +0,0 @@
1
- ## 0.1.0 (2024-06-28)
2
-
3
-
4
- ### 🚀 Features
5
-
6
- - add new libs ([#71](https://github.com/OKAMca/stack/pull/71))
7
-
8
-
9
- ### 🩹 Fixes
10
-
11
- - publishing for new libs ([#125](https://github.com/OKAMca/stack/pull/125))
12
-
13
-
14
- ### ❤️ Thank You
15
-
16
- - Marie-Maxime Tanguay @marie-maxime
package/images/image.png DELETED
Binary file
package/project.json DELETED
@@ -1,75 +0,0 @@
1
- {
2
- "name": "next-component",
3
- "$schema": "../../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "libs/stack/next-component/src",
5
- "projectType": "library",
6
- "tags": [],
7
- "targets": {
8
- "lint": {
9
- "executor": "@nx/eslint:lint"
10
- },
11
- "build": {
12
- "executor": "@nx/rollup:rollup",
13
- "outputs": ["{options.outputPath}"],
14
- "options": {
15
- "outputPath": "dist/libs/stack/next-component",
16
- "tsConfig": "libs/stack/next-component/tsconfig.lib.json",
17
- "project": "libs/stack/next-component/package.json",
18
- "entryFile": "libs/stack/next-component/src/index.ts",
19
- "external": "all",
20
- "rollupConfig": "@nx/react/plugins/bundle-rollup",
21
- "compiler": "swc",
22
- "assets": [
23
- {
24
- "glob": "libs/stack/next-component/README.md",
25
- "input": ".",
26
- "output": "."
27
- }
28
- ]
29
- }
30
- },
31
- "storybook": {
32
- "executor": "@nx/storybook:storybook",
33
- "options": {
34
- "port": 4400,
35
- "configDir": "libs/stack/next-component/.storybook"
36
- },
37
- "configurations": {
38
- "ci": {
39
- "quiet": true
40
- }
41
- }
42
- },
43
- "build-storybook": {
44
- "executor": "@nx/storybook:build",
45
- "outputs": ["{options.outputDir}"],
46
- "options": {
47
- "outputDir": "dist/storybook/next-component",
48
- "configDir": "libs/stack/next-component/.storybook"
49
- },
50
- "configurations": {
51
- "ci": {
52
- "quiet": true
53
- }
54
- }
55
- },
56
- "test-storybook": {
57
- "executor": "nx:run-commands",
58
- "options": {
59
- "command": "test-storybook -c libs/stack/next-component/.storybook --url=http://localhost:4400"
60
- }
61
- },
62
- "static-storybook": {
63
- "executor": "@nx/web:file-server",
64
- "options": {
65
- "buildTarget": "next-component:build-storybook",
66
- "staticFilePath": "dist/storybook/next-component"
67
- },
68
- "configurations": {
69
- "ci": {
70
- "buildTarget": "next-component:build-storybook:ci"
71
- }
72
- }
73
- }
74
- }
75
- }
@@ -1,30 +0,0 @@
1
- import { useThemeContext } from '@okam/stack-ui'
2
- import Image from 'next/image'
3
- import type TImgProps from './interface'
4
-
5
- const Img = (props: TImgProps) => {
6
- const { src, width, height, themeName = 'img', tokens, customTheme, ...rest } = props
7
- const theme = useThemeContext(themeName, tokens, customTheme)
8
-
9
- if (typeof src === 'object') {
10
- const { blurWidth, blurHeight, width: srcWidth, height: srcHeight, ...withoutBlurDimensions } = src
11
- const blur = {
12
- blurwidth: blurWidth,
13
- blurheight: blurHeight,
14
- }
15
-
16
- return (
17
- <Image
18
- className={theme}
19
- {...withoutBlurDimensions}
20
- {...rest}
21
- {...blur}
22
- width={srcWidth ?? width}
23
- height={srcHeight ?? height}
24
- />
25
- )
26
- }
27
- return <Image width={width} height={height} className={theme} src={src} {...rest} />
28
- }
29
-
30
- export default Img
@@ -1,9 +0,0 @@
1
- import type { TDefaultComponent } from '@okam/stack-ui'
2
- import type { ImageProps, StaticImageData } from 'next/image'
3
-
4
- type TImgProps = TDefaultComponent &
5
- Omit<ImageProps, 'src'> & {
6
- src: string | StaticImageData
7
- }
8
-
9
- export default TImgProps
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- // Use this file to export React client components (e.g. those with 'use client' directive) or other non-server utilities
2
-
3
- export * from './lib/next-component'
@@ -1,4 +0,0 @@
1
- // React server components are async so you make database or API calls.
2
- export async function HelloServer() {
3
- return <h1>Hello Server Component!</h1>
4
- }
@@ -1,16 +0,0 @@
1
- 'use client'
2
-
3
- import styles from './next-component.module.css'
4
-
5
- /* eslint-disable-next-line */
6
- export interface NextComponentProps {}
7
-
8
- export function NextComponent(props: NextComponentProps) {
9
- return (
10
- <div className={styles.container}>
11
- <h1>Hello Client Component!</h1>
12
- </div>
13
- )
14
- }
15
-
16
- export default NextComponent
package/src/server.ts DELETED
@@ -1,2 +0,0 @@
1
- // Use this file to export React server components
2
- export * from './lib/hello-server'
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "jsx": "react-jsx",
4
- "allowJs": false,
5
- "esModuleInterop": false,
6
- "allowSyntheticDefaultImports": true,
7
- "strict": true
8
- },
9
- "files": [],
10
- "include": [],
11
- "references": [
12
- {
13
- "path": "./tsconfig.lib.json"
14
- },
15
- {
16
- "path": "./tsconfig.storybook.json"
17
- }
18
- ],
19
- "extends": "../../../tsconfig.base.json"
20
- }
package/tsconfig.lib.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../../dist/out-tsc",
5
- "types": [
6
- "node",
7
- "@nx/react/typings/cssmodule.d.ts",
8
- "@nx/react/typings/image.d.ts",
9
- "next",
10
- "@nx/next/typings/image.d.ts"
11
- ]
12
- },
13
- "exclude": [
14
- "jest.config.ts",
15
- "src/**/*.spec.ts",
16
- "src/**/*.test.ts",
17
- "src/**/*.spec.tsx",
18
- "src/**/*.test.tsx",
19
- "src/**/*.spec.js",
20
- "src/**/*.test.js",
21
- "src/**/*.spec.jsx",
22
- "src/**/*.test.jsx",
23
- "**/*.stories.ts",
24
- "**/*.stories.js",
25
- "**/*.stories.jsx",
26
- "**/*.stories.tsx"
27
- ],
28
- "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
29
- }
@@ -1,31 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "emitDecoratorMetadata": true,
5
- "outDir": ""
6
- },
7
- "files": [
8
- "../../../node_modules/@nx/react/typings/styled-jsx.d.ts",
9
- "../../../node_modules/@nx/react/typings/cssmodule.d.ts",
10
- "../../../node_modules/@nx/react/typings/image.d.ts"
11
- ],
12
- "exclude": [
13
- "src/**/*.spec.ts",
14
- "src/**/*.test.ts",
15
- "src/**/*.spec.js",
16
- "src/**/*.test.js",
17
- "src/**/*.spec.tsx",
18
- "src/**/*.test.tsx",
19
- "src/**/*.spec.jsx",
20
- "src/**/*.test.js"
21
- ],
22
- "include": [
23
- "src/**/*.stories.ts",
24
- "src/**/*.stories.js",
25
- "src/**/*.stories.jsx",
26
- "src/**/*.stories.tsx",
27
- "src/**/*.stories.mdx",
28
- ".storybook/*.js",
29
- ".storybook/*.ts"
30
- ]
31
- }