woby-tooltip 1.0.2 → 1.0.4

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.
@@ -0,0 +1,7 @@
1
+ import { ObservableMaybe, type JSX } from 'woby';
2
+ export declare const Arrow: ({ isHovered, hovBkg, bkgCol, flat }: {
3
+ isHovered: ObservableMaybe<boolean>;
4
+ hovBkg: ObservableMaybe<string>;
5
+ bkgCol: ObservableMaybe<string>;
6
+ flat?: ObservableMaybe<boolean>;
7
+ }) => JSX.Element;
@@ -0,0 +1,48 @@
1
+ import { Child, Observable, ObservableMaybe, type JSX } from 'woby';
2
+ type _Align = 'start' | 'end' | 'center' | 'bottom' | 'top' | 'right' | 'left';
3
+ export type Align = _Align | `v-${_Align}` | `h-${_Align}`;
4
+ export type Side = 'bottom' | 'top' | 'left' | 'right';
5
+ export declare const isSide: (side: ObservableMaybe<Side>, str: Side) => boolean;
6
+ export declare const isAlign: (align: ObservableMaybe<Align>, str: Align) => boolean;
7
+ export declare const isAlignA: (position: any, str: string) => boolean;
8
+ type TextboxType = {
9
+ hoverBackground?: ObservableMaybe<string>;
10
+ backgroundColor?: ObservableMaybe<string>;
11
+ arrowAlign?: ObservableMaybe<Align>;
12
+ moveDown?: ObservableMaybe<string>;
13
+ moveRight?: ObservableMaybe<string>;
14
+ moveLeft?: ObservableMaybe<string>;
15
+ color?: ObservableMaybe<string>;
16
+ animation?: ObservableMaybe<string>;
17
+ zIndex?: ObservableMaybe<string>;
18
+ flat?: ObservableMaybe<boolean>;
19
+ show?: ObservableMaybe<boolean>;
20
+ hoverColor?: ObservableMaybe<string>;
21
+ /** no tailwind */
22
+ textboxWidth?: ObservableMaybe<string>;
23
+ /** no tailwind */
24
+ padding?: ObservableMaybe<string>;
25
+ /** tailwind */
26
+ borderRadius?: ObservableMaybe<string>;
27
+ shadowColor?: ObservableMaybe<string>;
28
+ shadowShape?: ObservableMaybe<string>;
29
+ static?: ObservableMaybe<boolean>;
30
+ alert?: ObservableMaybe<string>;
31
+ hoverArrow: Observable<boolean>;
32
+ arw: ObservableMaybe<Align>;
33
+ pos: {
34
+ side: ObservableMaybe<Side>;
35
+ align: ObservableMaybe<Align>;
36
+ };
37
+ /** tailwind border-b-*/
38
+ lines: ObservableMaybe<string>;
39
+ move: {
40
+ down: number;
41
+ up: number;
42
+ left: number;
43
+ right: number;
44
+ };
45
+ children?: Child;
46
+ };
47
+ export declare const TextBox: (props: TextboxType & JSX.HTMLAttributes<HTMLDivElement>) => JSX.Element;
48
+ export {};
@@ -0,0 +1,47 @@
1
+ import { ObservableMaybe, Observable, type JSX } from 'woby';
2
+ import { Align } from './TextBox';
3
+ export type TooltipType = {
4
+ /** tailwind
5
+ * border-b border-b-[#ececec]
6
+ */
7
+ lineSeparated?: ObservableMaybe<boolean | string>;
8
+ position?: ObservableMaybe<string>;
9
+ /** tailwind */
10
+ hoverBackground?: ObservableMaybe<string>;
11
+ /** tailwind */
12
+ backgroundColor?: ObservableMaybe<string>;
13
+ arrowAlign?: ObservableMaybe<Align>;
14
+ moveDown?: ObservableMaybe<string>;
15
+ moveRight?: ObservableMaybe<string>;
16
+ moveLeft?: ObservableMaybe<string>;
17
+ moveUp?: ObservableMaybe<string>;
18
+ textAlign?: ObservableMaybe<string>;
19
+ fontFamily?: ObservableMaybe<string>;
20
+ fontWeight?: ObservableMaybe<string>;
21
+ /** tailwind */
22
+ fontSize?: ObservableMaybe<string>;
23
+ /** tailwind */
24
+ color?: ObservableMaybe<string>;
25
+ animation?: ObservableMaybe<string>;
26
+ zIndex?: ObservableMaybe<string>;
27
+ flat?: ObservableMaybe<boolean>;
28
+ show?: ObservableMaybe<boolean>;
29
+ /** tailwind */
30
+ hoverColor?: ObservableMaybe<string>;
31
+ /** no tailwind */
32
+ textboxWidth?: ObservableMaybe<string>;
33
+ /** tailwind */
34
+ padding?: ObservableMaybe<string>;
35
+ /** tailwind */
36
+ borderRadius?: ObservableMaybe<string>;
37
+ shadowColor?: ObservableMaybe<string>;
38
+ shadowShape?: ObservableMaybe<string>;
39
+ static?: ObservableMaybe<boolean>;
40
+ alert?: ObservableMaybe<string>;
41
+ children?: JSX.Element;
42
+ };
43
+ export declare const Tooltip: <T extends HTMLElement>(properties?: TooltipType & JSX.HTMLAttributes<HTMLDivElement> & {
44
+ parentRef?: Observable<HTMLElement>;
45
+ parent?: JSX.Child;
46
+ containerClass?: JSX.Class;
47
+ }) => JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './Tooltip';
package/package.json CHANGED
@@ -1,51 +1,51 @@
1
1
  {
2
- "name": "woby-tooltip",
3
- "version": "1.0.2",
4
- "description": "A powerful tooltip and menu component library for woby.",
5
- "main": "./dist/index.cjs.js",
6
- "module": "./dist/index.es.js",
7
- "browser": "./dist/index.umd.js",
8
- "types": "./dist/types/index.d.ts",
9
- "scripts": {
10
- "css:watch": "tailwindcss -i ./src/input.css -o ./dist/output.css --watch",
11
- "css": "tailwindcss -i ./src/input.css -o ./dist/output.css",
12
- "declaration": "tsc --build --force --declaration --emitDeclarationOnly --verbose",
13
- "declaration:watch": "tsc --build --force --declaration --emitDeclarationOnly --verbose --watch",
14
- "watch": "run-p build:watch css:watch",
15
- "build": "run-s css build:vite css",
16
- "build:web": "vite build --config=vite.config.web.ts --force --mode production",
17
- "web": "vite preview --config=vite.config.web.ts --host",
18
- "dev:only": "vite --config=vite.config.web.ts --force --mode dev --host",
19
- "dev": "run-p css:watch dev:only",
20
- "build:vite": "vite build",
21
- "build:watch": "vite build --watch",
22
- "preview": "vite preview --host",
23
- "icon": "node ./node_modules/svg2tsx/cli/index.js"
24
- },
25
- "keywords": [
26
- "tooltip",
27
- "notification",
28
- "menu",
29
- "woby",
30
- "woby-component"
31
- ],
32
- "license": "MIT",
33
- "peerDependencies": {
34
- "woby": "workspace:../woby"
35
- },
36
- "devDependencies": {
37
- "concurrently": "^3.6.1",
38
- "puppeteer": "^1.20.0",
39
- "style-loader": "^0.21.0",
40
- "svg2tsx": "workspace:../svg2tsx",
41
- "tailwindcss": "^3.3.3",
42
- "vite": "^4.4.11",
43
- "vite-plugin-dts": "^2.3.0"
44
- },
45
- "author": "Chi Chong <wongchichong@gmail.com>",
46
- "homepage": "https://github.com/wongchichong/woby-tooltip",
47
- "repository": {
48
- "type": "git",
49
- "url": "git@github.com:wongchichong/woby-tooltip.git"
50
- }
2
+ "name": "woby-tooltip",
3
+ "version": "1.0.4",
4
+ "description": "A powerful tooltip and menu component library for woby.",
5
+ "main": "./dist/index.cjs.js",
6
+ "module": "./dist/index.es.js",
7
+ "browser": "./dist/index.umd.js",
8
+ "types": "./dist/types/index.d.ts",
9
+ "keywords": [
10
+ "tooltip",
11
+ "notification",
12
+ "menu",
13
+ "woby",
14
+ "woby-component"
15
+ ],
16
+ "license": "MIT",
17
+ "peerDependencies": {
18
+ "woby": "^0.57.14"
19
+ },
20
+ "devDependencies": {
21
+ "concurrently": "^3.6.1",
22
+ "puppeteer": "^1.20.0",
23
+ "style-loader": "^0.21.0",
24
+ "tailwindcss": "^3.4.1",
25
+ "vite": "^4.5.2",
26
+ "vite-plugin-dts": "^2.3.0",
27
+ "svg2tsx": "^1.0.1"
28
+ },
29
+ "author": "Chi Chong <wongchichong@gmail.com>",
30
+ "homepage": "https://github.com/wongchichong/woby-tooltip",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git@github.com:wongchichong/woby-tooltip.git"
34
+ },
35
+ "scripts": {
36
+ "css:watch": "tailwindcss -i ./src/input.css -o ./dist/output.css --watch",
37
+ "css": "tailwindcss -i ./src/input.css -o ./dist/output.css",
38
+ "declaration": "tsc --build --force --declaration --emitDeclarationOnly --verbose",
39
+ "declaration:watch": "tsc --build --force --declaration --emitDeclarationOnly --verbose --watch",
40
+ "watch": "run-p build:watch css:watch",
41
+ "build": "run-s css build:vite css",
42
+ "build:web": "vite build --config=vite.config.web.ts --force --mode production",
43
+ "web": "vite preview --config=vite.config.web.ts --host",
44
+ "dev:only": "vite --config=vite.config.web.ts --force --mode dev --host",
45
+ "dev": "run-p css:watch dev:only",
46
+ "build:vite": "vite build",
47
+ "build:watch": "vite build --watch",
48
+ "preview": "vite preview --host",
49
+ "icon": "node ./node_modules/svg2tsx/cli/index.js"
50
+ }
51
51
  }
@@ -23,8 +23,8 @@ const config = defineConfig({
23
23
  resolve: {
24
24
  alias: {
25
25
  '~': path.resolve(__dirname, 'src'),
26
- 'woby/jsx-dev-runtime': process.argv.includes('dev') ? path.resolve('../woby/src/jsx/runtime') : 'woby/jsx-dev-runtime',
27
- 'woby/jsx-runtime': process.argv.includes('dev') ? path.resolve('../woby/src/jsx/runtime') : 'woby/jsx-runtime',
26
+ 'woby/jsx-dev-runtime': process.argv.includes('dev') ? path.resolve('../woby/src/jsx/runtime') : 'woby', //'woby/jsx-dev-runtime',
27
+ 'woby/jsx-runtime': process.argv.includes('dev') ? path.resolve('../woby/src/jsx/runtime') : 'woby', //'woby/jsx-runtime',
28
28
  'woby': process.argv.includes('dev') ? path.resolve('../woby/src') : 'woby'
29
29
  },
30
30
  },