@pittorica/quote-react 0.8.2
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/.turbo/turbo-build.log +18 -0
- package/LICENSE +21 -0
- package/dist/Quote.d.ts +8 -0
- package/dist/Quote.d.ts.map +1 -0
- package/dist/index.cjs +13175 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13169 -0
- package/dist/index.js.map +1 -0
- package/dist/quote.css.d.ts +3 -0
- package/dist/quote.css.d.ts.map +1 -0
- package/package.json +43 -0
- package/src/Quote.tsx +30 -0
- package/src/index.ts +2 -0
- package/src/quote.css.ts +16 -0
- package/tsconfig.app.json +33 -0
- package/tsconfig.json +7 -0
- package/tsconfig.node.json +26 -0
- package/vite.config.ts +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote.css.d.ts","sourceRoot":"","sources":["../src/quote.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAavD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pittorica/quote-react",
|
|
3
|
+
"version": "0.8.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Davide Di Criscito"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@vanilla-extract/recipes": "^0.5.7",
|
|
19
|
+
"clsx": "^2.1.1",
|
|
20
|
+
"react": "^19.2.3",
|
|
21
|
+
"react-dom": "^19.2.3",
|
|
22
|
+
"@pittorica/box-react": "0.8.2"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^25.0.10",
|
|
26
|
+
"@types/react": "^19.2.9",
|
|
27
|
+
"@types/react-dom": "^19.2.3",
|
|
28
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
29
|
+
"babel-plugin-react-compiler": "^1.0.0",
|
|
30
|
+
"typescript": "~5.9.3",
|
|
31
|
+
"vite": "npm:rolldown-vite@7.3.1",
|
|
32
|
+
"vite-plugin-dts": "^4.5.4"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -b && vite build",
|
|
39
|
+
"dev": "vite",
|
|
40
|
+
"lint": "eslint .",
|
|
41
|
+
"preview": "vite preview"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/Quote.tsx
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { type QuoteHTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
|
|
5
|
+
import { Box, type BoxProps } from '@pittorica/box-react';
|
|
6
|
+
|
|
7
|
+
import { quoteRecipe } from './quote.css.js';
|
|
8
|
+
|
|
9
|
+
export interface QuoteProps extends Omit<
|
|
10
|
+
BoxProps & QuoteHTMLAttributes<HTMLQuoteElement>,
|
|
11
|
+
'as' | 'children' | 'cite'
|
|
12
|
+
> {
|
|
13
|
+
cite: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Quote: React.FC<QuoteProps> = ({
|
|
18
|
+
className,
|
|
19
|
+
children,
|
|
20
|
+
cite,
|
|
21
|
+
...props
|
|
22
|
+
}) => {
|
|
23
|
+
const recipeClass = quoteRecipe();
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Box as="q" className={clsx(recipeClass, className)} cite={cite} {...props}>
|
|
27
|
+
{children}
|
|
28
|
+
</Box>
|
|
29
|
+
);
|
|
30
|
+
};
|
package/src/index.ts
ADDED
package/src/quote.css.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { recipe, type RuntimeFn } from '@vanilla-extract/recipes';
|
|
2
|
+
|
|
3
|
+
export const quoteRecipe: RuntimeFn<Record<string, never>> = recipe({
|
|
4
|
+
base: {
|
|
5
|
+
fontStyle: 'italic',
|
|
6
|
+
quotes: '"“" "”" "‘" "’"',
|
|
7
|
+
selectors: {
|
|
8
|
+
'&::before': {
|
|
9
|
+
content: 'open-quote',
|
|
10
|
+
},
|
|
11
|
+
'&::after': {
|
|
12
|
+
content: 'close-quote',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "dist",
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
6
|
+
"target": "ES2022",
|
|
7
|
+
"useDefineForClassFields": true,
|
|
8
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
9
|
+
"module": "ESNext",
|
|
10
|
+
"types": ["vite/client"],
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
|
|
13
|
+
/* Bundler mode */
|
|
14
|
+
"moduleResolution": "bundler",
|
|
15
|
+
"allowImportingTsExtensions": false,
|
|
16
|
+
"verbatimModuleSyntax": true,
|
|
17
|
+
"moduleDetection": "force",
|
|
18
|
+
"noEmit": false,
|
|
19
|
+
"emitDeclarationOnly": true,
|
|
20
|
+
"declaration": true,
|
|
21
|
+
"declarationMap": true,
|
|
22
|
+
"jsx": "react-jsx",
|
|
23
|
+
|
|
24
|
+
/* Linting */
|
|
25
|
+
"strict": true,
|
|
26
|
+
"noUnusedLocals": true,
|
|
27
|
+
"noUnusedParameters": true,
|
|
28
|
+
"erasableSyntaxOnly": true,
|
|
29
|
+
"noFallthroughCasesInSwitch": true,
|
|
30
|
+
"noUncheckedSideEffectImports": true
|
|
31
|
+
},
|
|
32
|
+
"include": ["src"]
|
|
33
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": false,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"erasableSyntaxOnly": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true
|
|
24
|
+
},
|
|
25
|
+
"include": ["vite.config.ts"]
|
|
26
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
import dts from 'vite-plugin-dts';
|
|
5
|
+
import react from '@vitejs/plugin-react';
|
|
6
|
+
|
|
7
|
+
// https://vite.dev/config/
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [
|
|
10
|
+
react({
|
|
11
|
+
babel: {
|
|
12
|
+
plugins: [['babel-plugin-react-compiler']],
|
|
13
|
+
},
|
|
14
|
+
}),
|
|
15
|
+
dts({
|
|
16
|
+
insertTypesEntry: true,
|
|
17
|
+
include: ['src'],
|
|
18
|
+
rollupTypes: false,
|
|
19
|
+
outDir: 'dist',
|
|
20
|
+
tsconfigPath: './tsconfig.app.json',
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
|
|
24
|
+
build: {
|
|
25
|
+
lib: {
|
|
26
|
+
entry: path.resolve(import.meta.dirname, 'src/index.ts'),
|
|
27
|
+
name: '@pittorica/quote-react',
|
|
28
|
+
formats: ['es', 'cjs'],
|
|
29
|
+
fileName: (format: string): string =>
|
|
30
|
+
`index.${format === 'es' ? 'js' : 'cjs'}`,
|
|
31
|
+
},
|
|
32
|
+
sourcemap: true,
|
|
33
|
+
minify: false,
|
|
34
|
+
},
|
|
35
|
+
});
|