forstok-ui-lib 7.7.1 → 8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "7.7.1",
3
+ "version": "8.0.1",
4
4
  "description": "Forstok UI Components Library",
5
5
  "path": "dist",
6
6
  "main": "dist/index.js",
package/rollup.config.js CHANGED
@@ -2,17 +2,19 @@ import PeerDepsExternalPlugin from 'rollup-plugin-peer-deps-external';
2
2
  import resolve from '@rollup/plugin-node-resolve';
3
3
  import commonjs from '@rollup/plugin-commonjs';
4
4
  import terser from '@rollup/plugin-terser';
5
- import dts from 'rollup-plugin-dts';
5
+ import { default as dts } from 'rollup-plugin-dts';
6
6
  import typescript from '@rollup/plugin-typescript';
7
7
  import url from '@rollup/plugin-url';
8
8
  import svgr from '@svgr/rollup';
9
9
  import image from '@rollup/plugin-image';
10
10
  import css from 'rollup-plugin-import-css';
11
11
  import createStyledComponentsTransformer from 'typescript-plugin-styled-components';
12
-
13
12
  const packageJson = require('./package.json');
14
13
 
15
14
  export default [
15
+ // -----------------------------
16
+ // 1️⃣ JS Build (CJS + ESM)
17
+ // -----------------------------
16
18
  {
17
19
  input: 'src/index.ts',
18
20
  output: [
@@ -20,7 +22,7 @@ export default [
20
22
  { file: packageJson.module, format: 'esm', sourcemap: true, interop: 'auto' },
21
23
  ],
22
24
  plugins: [
23
- PeerDepsExternalPlugin(), // automatically externalizes peerDependencies
25
+ PeerDepsExternalPlugin(),
24
26
  typescript({
25
27
  tsconfig: './tsconfig.json',
26
28
  transformers: [
@@ -36,26 +38,13 @@ export default [
36
38
  }),
37
39
  ],
38
40
  }),
39
- commonjs({
40
- include: /node_modules/,
41
- requireReturnsDefault: 'auto',
42
- dynamicRequireTargets: []
43
- }),
44
- resolve({
45
- browser: true,
46
- extensions: ['.mjs', '.js', '.json', '.ts', '.tsx'],
47
- preferBuiltins: false,
48
- mainFields: ['module', 'main', 'browser'],
49
- }),
50
- terser(),
41
+ commonjs({ include: /node_modules/, requireReturnsDefault: 'auto', dynamicRequireTargets: [] }),
42
+ resolve({ browser: true, extensions: ['.mjs', '.js', '.json', '.ts', '.tsx'], preferBuiltins: false }),
51
43
  css({ minify: true, modules: true, inject: true }),
52
44
  url(),
53
45
  svgr({ icon: true }),
54
- image({
55
- output: `${packageJson.path}/images`,
56
- extensions: /\.(png|jpg|jpeg|gif|svg)$/,
57
- exclude: 'node_modules/**',
58
- }),
46
+ image({ output: `${packageJson.path}/images`, extensions: /\.(png|jpg|jpeg|gif|svg)$/ }),
47
+ terser(),
59
48
  ],
60
49
  external: (id) =>
61
50
  [
@@ -74,31 +63,18 @@ export default [
74
63
  'frimousse',
75
64
  ].some((pkg) => id === pkg || id.startsWith(pkg + '/')),
76
65
  onwarn: (warning, warn) => {
77
- // Ignore dynamic require warnings
78
- if (warning.code === 'CIRCULAR_DEPENDENCY') return; // optional
79
- if (warning.code === 'EVAL' || /the request of a dependency is an expression/.test(warning.message)) {
80
- return;
81
- }
82
- warn(warning); // show other warnings
66
+ if (warning.code === 'CIRCULAR_DEPENDENCY') return;
67
+ if (warning.code === 'EVAL' || /the request of a dependency is an expression/.test(warning.message)) return;
68
+ warn(warning);
83
69
  },
84
70
  },
71
+
72
+ // -----------------------------
73
+ // 2️⃣ DTS Build (ONLY types)
74
+ // -----------------------------
85
75
  {
86
76
  input: 'src/index.ts',
87
- output: [
88
- {
89
- file: packageJson.main,
90
- format: 'cjs',
91
- sourcemap: true,
92
- interop: 'auto',
93
- inlineDynamicImports: true,
94
- },
95
- {
96
- file: packageJson.module,
97
- format: 'esm',
98
- sourcemap: true,
99
- interop: 'auto',
100
- }
101
- ],
77
+ output: { file: packageJson.types || 'dist/index.d.ts', format: 'es' },
102
78
  plugins: [dts.default()],
103
79
  external: [/\.css$/],
104
80
  },
@@ -466,7 +466,7 @@ const getNameModFunc = ({ $mode }:{ $mode?: string }) => {
466
466
  style +=`
467
467
  font-size: 22px;
468
468
  ${multiElipsis}
469
- line-height: 1;
469
+ line-height: normal;
470
470
  `
471
471
  }
472
472
  return style
@@ -1,4 +1,4 @@
1
- import { HTMLAttributes, ReactNode } from 'react';
1
+ import type { HTMLAttributes, ReactNode } from 'react';
2
2
  import { TextContainer } from './styles';
3
3
 
4
4
  type TText = HTMLAttributes<HTMLSpanElement> & {
@@ -9,7 +9,7 @@ type TText = HTMLAttributes<HTMLSpanElement> & {
9
9
 
10
10
  const TextComponent = ({ children, $color, $elipsis=true, ...props }:TText) => {
11
11
  return (
12
- <TextContainer $elipsis={$elipsis ? true : false} $color={$color} {...props}>
12
+ <TextContainer $elipsis={$elipsis} $color={$color} {...props}>
13
13
  {children}
14
14
  </TextContainer>
15
15
  );
package/tsconfig.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "noEmit": false,
4
+ "allowJs": false,
5
+ "isolatedModules": false,
4
6
  "declaration": false,
5
7
  "emitDeclarationOnly": false,
6
8
  "target": "ES2017",
@@ -10,7 +12,6 @@
10
12
  "ESNext"
11
13
  ],
12
14
  "sourceMap": true,
13
- "allowJs": true,
14
15
  "skipLibCheck": true,
15
16
  "esModuleInterop": true,
16
17
  "allowSyntheticDefaultImports": true,
@@ -19,7 +20,6 @@
19
20
  "module": "esnext",
20
21
  "moduleResolution": "node",
21
22
  "resolveJsonModule": true,
22
- "isolatedModules": true,
23
23
  "jsx": "react-jsx"
24
24
  },
25
25
  "include": [