@bit.rhplus/ui2.ai-button 0.0.4 → 0.0.5

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,18 +1,18 @@
1
1
  {
2
2
  "name": "@bit.rhplus/ui2.ai-button",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "homepage": "https://bit.cloud/remote-scope/ui2/ai-button",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "remote-scope",
8
8
  "name": "ui2/ai-button",
9
- "version": "0.0.4"
9
+ "version": "0.0.5"
10
10
  },
11
11
  "dependencies": {
12
12
  "classnames": "^2.5.1"
13
13
  },
14
14
  "devDependencies": {
15
- "@teambit/react.react-env": "1.3.1"
15
+ "@bitdev/react.react-env": "4.0.14"
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
@@ -20,6 +20,7 @@
20
20
  "license": "SEE LICENSE IN UNLICENSED",
21
21
  "optionalDependencies": {},
22
22
  "peerDependenciesMeta": {},
23
+ "type": "module",
23
24
  "private": false,
24
25
  "publishConfig": {
25
26
  "scope": "@bit.rhplus",
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<React.RefAttributes<any>>>;
2
- export default _default;
3
- import React from 'react';
package/dist/index.js DELETED
@@ -1,73 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /* eslint-disable */
3
- import React, { useEffect, useRef, useCallback } from 'react';
4
- import classnames from 'classnames';
5
- import './style.css';
6
- /**
7
- * AI Rainbow Button - Moderní tlačítko s rotujícím duhovým prstencem
8
- * OPTIMALIZOVÁNO PRO MAXIMÁLNÍ VÝKON:
9
- * - IntersectionObserver pro pause/resume animací
10
- * - Box-shadow místo blur filter
11
- * - GPU akcelerace a will-change hints
12
- * - Sloučené animace
13
- * - CSS containment
14
- *
15
- * @param {Object} props
16
- * @param {string} [props.label='AI'] - Text zobrazený na tlačítku
17
- * @param {Function} [props.onClick] - Handler pro kliknutí
18
- * @param {string|number} [props.size='110px'] - Velikost tlačítka
19
- * @param {string|number} [props.ring='10px'] - Tloušťka duhového prstence
20
- * @param {string} [props.className] - Dodatečné CSS třídy
21
- * @param {string} [props.ariaLabel] - Aria label pro accessibility (výchozí je hodnota label)
22
- * @param {string} [props.type='button'] - Typ tlačítka
23
- * @param {Object} [props.style] - Inline styly pro tlačítko
24
- * @param {boolean} [props.disabled=false] - Zakázat tlačítko
25
- * @param {boolean} [props.disableVisibilityOptimization=false] - Vypnout automatické pausování animací
26
- */
27
- const AIButton = React.forwardRef((props, ref) => {
28
- const { label = 'AI', onClick, size = '110px', ring = '10px', className, ariaLabel, type = 'button', style, disabled = false, disableVisibilityOptimization = false, ...restProps } = props;
29
- // Interní ref pro IntersectionObserver
30
- const internalRef = useRef(null);
31
- const [isPaused, setIsPaused] = React.useState(false);
32
- // Kombinace external a internal ref
33
- const setRefs = useCallback((node) => {
34
- internalRef.current = node;
35
- if (typeof ref === 'function') {
36
- ref(node);
37
- }
38
- else if (ref) {
39
- ref.current = node;
40
- }
41
- }, [ref]);
42
- // IntersectionObserver - pausne animace když tlačítko není viditelné
43
- useEffect(() => {
44
- if (disableVisibilityOptimization || !internalRef.current)
45
- return;
46
- const observer = new IntersectionObserver((entries) => {
47
- entries.forEach((entry) => {
48
- // Pausne když není viditelné nebo je mimo viewport
49
- setIsPaused(!entry.isIntersecting);
50
- });
51
- }, {
52
- threshold: 0, // Spustí se hned jak zmizí z viewportu
53
- rootMargin: '50px', // Trochu bufferu
54
- });
55
- observer.observe(internalRef.current);
56
- return () => {
57
- observer.disconnect();
58
- };
59
- }, [disableVisibilityOptimization]);
60
- // Inline CSS proměnné pro customizaci
61
- const buttonStyle = {
62
- '--size': typeof size === 'number' ? `${size}px` : size,
63
- '--ring': typeof ring === 'number' ? `${ring}px` : ring,
64
- ...style,
65
- };
66
- return (_jsx("button", { ref: setRefs, className: classnames('ai-btn', className, {
67
- 'ai-btn-paused': isPaused,
68
- }), type: type, "aria-label": ariaLabel || label, onClick: onClick, style: buttonStyle, disabled: disabled, ...restProps, children: _jsx("div", { className: "ai-inner", children: _jsx("div", { className: "ai-label", children: label }) }) }));
69
- });
70
- AIButton.displayName = 'AIButton';
71
- // Memoizace komponenty - zabrání zbytečným re-renderům
72
- export default React.memo(AIButton);
73
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.jsx"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC/C,MAAM,EACJ,KAAK,GAAG,IAAI,EACZ,OAAO,EACP,IAAI,GAAG,OAAO,EACd,IAAI,GAAG,MAAM,EACb,SAAS,EACT,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,KAAK,EACL,QAAQ,GAAG,KAAK,EAChB,6BAA6B,GAAG,KAAK,EACrC,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,uCAAuC;IACvC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEtD,oCAAoC;IACpC,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,IAAI,EAAE,EAAE;QACP,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,IAAI,OAAO,GAAG,KAAK,UAAU,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AI,EAAE,IAAI,gBACE,SAAS,IAAI,KAAK,EAC9B,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,KACd,SAAS,YAEb,cAAK,SAAS,EAAC,UAAU,YACvB,cAAK,SAAS,EAAC,UAAU,YAAE,KAAK,GAAO,GACnC,GACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,uDAAuD;AACvD,eAAe,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- ;
2
- ;
3
-
4
- export const compositions = [];
5
- export const overview = [];
6
-
7
- export const compositions_metadata = {"compositions":[]};
package/dist/style.css DELETED
@@ -1,202 +0,0 @@
1
- /* AI Rainbow Button - Duhové tlačítko s rotujícím prstencem */
2
- /* OPTIMALIZOVÁNO PRO MAXIMÁLNÍ VÝKON */
3
-
4
- .ai-btn {
5
- /* CSS proměnné - lze přepsat pomocí inline style */
6
- --size: 110px;
7
- --ring: 10px;
8
- --bg: #ffffff;
9
- --text: rgba(20, 20, 20, 0.92);
10
-
11
- /* Sdílený gradient - použije se vícekrát */
12
- --rainbow-gradient: conic-gradient(
13
- from 0deg,
14
- #ff004c,
15
- #ff8a00,
16
- #ffe600,
17
- #35ff7a,
18
- #00d4ff,
19
- #6a5cff,
20
- #ff4fd8,
21
- #ff004c
22
- );
23
-
24
- position: relative;
25
- width: var(--size);
26
- height: var(--size);
27
- border: 0;
28
- border-radius: 999px;
29
- cursor: pointer;
30
- background: transparent;
31
- padding: 0;
32
- outline: none;
33
- -webkit-tap-highlight-color: transparent;
34
-
35
- /* GPU akcelerace + containment pro izolaci */
36
- transform: translateZ(0);
37
- will-change: transform;
38
- contain: layout style paint;
39
- transition: transform 0.15s ease;
40
- }
41
-
42
- .ai-btn:disabled {
43
- cursor: not-allowed;
44
- opacity: 0.5;
45
- }
46
-
47
- /* Duhový rotující prstenec */
48
- .ai-btn::before {
49
- content: '';
50
- position: absolute;
51
- inset: 0;
52
- border-radius: inherit;
53
-
54
- /* Použití sdíleného gradientu */
55
- background: var(--rainbow-gradient);
56
-
57
- /* Vyříznutí vnitřku => prstenec */
58
- -webkit-mask: radial-gradient(
59
- closest-side,
60
- transparent calc(100% - var(--ring)),
61
- #000 calc(100% - var(--ring) + 1px)
62
- );
63
- mask: radial-gradient(
64
- closest-side,
65
- transparent calc(100% - var(--ring)),
66
- #000 calc(100% - var(--ring) + 1px)
67
- );
68
-
69
- /* GPU akcelerace pro rotaci */
70
- transform: translateZ(0);
71
- will-change: transform;
72
-
73
- /* Animace "točení" barev */
74
- animation: ai-btn-spin 3.2s linear infinite;
75
- filter: saturate(1.15) brightness(1.05);
76
- }
77
-
78
- .ai-btn:disabled::before {
79
- animation: none;
80
- filter: saturate(0.5) brightness(0.8);
81
- }
82
-
83
- /* Glow aura kolem tlačítka - OPTIMALIZOVÁNO: box-shadow místo blur */
84
- .ai-btn::after {
85
- content: '';
86
- position: absolute;
87
- inset: 0;
88
- border-radius: inherit;
89
-
90
- /* Použití sdíleného gradientu */
91
- background: var(--rainbow-gradient);
92
-
93
- /* GPU akcelerace */
94
- transform: translateZ(0);
95
- will-change: transform, opacity;
96
-
97
- /* Box-shadow glow místo blur filter (MNOHEM rychlejší) */
98
- box-shadow: 0 0 30px 12px rgba(255, 0, 76, 0.4),
99
- 0 0 50px 20px rgba(255, 138, 0, 0.3), 0 0 70px 28px rgba(0, 212, 255, 0.25),
100
- 0 0 90px 35px rgba(106, 92, 255, 0.2);
101
-
102
- /* Sloučená animace pro lepší výkon */
103
- animation: ai-btn-glow 3.2s linear infinite;
104
- opacity: 0.35;
105
- pointer-events: none;
106
- }
107
-
108
- .ai-btn:disabled::after {
109
- animation: none;
110
- opacity: 0.15;
111
- }
112
-
113
- /* Pausnutí animací když není viditelné - řízeno IntersectionObserver */
114
- .ai-btn.ai-btn-paused::before,
115
- .ai-btn.ai-btn-paused::after {
116
- animation-play-state: paused;
117
- }
118
-
119
- /* Vnitřek tlačítka */
120
- .ai-inner {
121
- position: absolute;
122
- inset: var(--ring);
123
- border-radius: inherit;
124
- background: radial-gradient(
125
- 120% 120% at 30% 20%,
126
- rgba(255, 255, 255, 1) 0%,
127
- rgba(250, 250, 250, 1) 40%,
128
- rgba(240, 242, 245, 1) 80%,
129
- rgba(235, 237, 240, 1) 100%
130
- );
131
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08),
132
- inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.12);
133
- display: grid;
134
- place-items: center;
135
- user-select: none;
136
- }
137
-
138
- .ai-label {
139
- font-weight: 700;
140
- letter-spacing: 0.08em;
141
- font-size: 14px;
142
- text-transform: uppercase;
143
- color: var(--text);
144
- text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
145
- }
146
-
147
- /* Hover efekt */
148
- .ai-btn:hover:not(:disabled) {
149
- transform: translateZ(0) scale(1.03);
150
- }
151
-
152
- /* Active (stisknuté) */
153
- .ai-btn:active:not(:disabled) {
154
- transform: translateZ(0) scale(0.98);
155
- }
156
-
157
- /* Focus - accessibility */
158
- .ai-btn:focus-visible .ai-inner {
159
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12),
160
- inset 0 -10px 30px rgba(0, 0, 0, 0.55), 0 10px 30px rgba(0, 0, 0, 0.35),
161
- 0 0 0 3px rgba(255, 255, 255, 0.16);
162
- }
163
-
164
- /* Animace - rotace */
165
- @keyframes ai-btn-spin {
166
- to {
167
- transform: translateZ(0) rotate(360deg);
168
- }
169
- }
170
-
171
- /* Animace - sloučená glow (spin + breathe) pro lepší výkon */
172
- @keyframes ai-btn-glow {
173
- 0% {
174
- transform: translateZ(0) rotate(0deg);
175
- opacity: 0.28;
176
- }
177
- 25% {
178
- opacity: 0.38;
179
- }
180
- 50% {
181
- transform: translateZ(0) rotate(180deg);
182
- opacity: 0.46;
183
- }
184
- 75% {
185
- opacity: 0.38;
186
- }
187
- 100% {
188
- transform: translateZ(0) rotate(360deg);
189
- opacity: 0.28;
190
- }
191
- }
192
-
193
- /* Respektovat uživatelské preference pro redukci pohybu */
194
- @media (prefers-reduced-motion: reduce) {
195
- .ai-btn::before,
196
- .ai-btn::after {
197
- animation: none;
198
- }
199
- .ai-btn {
200
- transition: none;
201
- }
202
- }
package/types/asset.d.ts DELETED
@@ -1,43 +0,0 @@
1
- declare module '*.png' {
2
- const value: any;
3
- export = value;
4
- }
5
- declare module '*.svg' {
6
- import type { FunctionComponent, SVGProps } from 'react';
7
-
8
- export const ReactComponent: FunctionComponent<
9
- SVGProps<SVGSVGElement> & { title?: string }
10
- >;
11
- const src: string;
12
- export default src;
13
- }
14
-
15
- // @TODO Gilad
16
- declare module '*.jpg' {
17
- const value: any;
18
- export = value;
19
- }
20
- declare module '*.jpeg' {
21
- const value: any;
22
- export = value;
23
- }
24
- declare module '*.gif' {
25
- const value: any;
26
- export = value;
27
- }
28
- declare module '*.bmp' {
29
- const value: any;
30
- export = value;
31
- }
32
- declare module '*.otf' {
33
- const value: any;
34
- export = value;
35
- }
36
- declare module '*.woff' {
37
- const value: any;
38
- export = value;
39
- }
40
- declare module '*.woff2' {
41
- const value: any;
42
- export = value;
43
- }
package/types/style.d.ts DELETED
@@ -1,42 +0,0 @@
1
- declare module '*.module.css' {
2
- const classes: { readonly [key: string]: string };
3
- export default classes;
4
- }
5
- declare module '*.module.scss' {
6
- const classes: { readonly [key: string]: string };
7
- export default classes;
8
- }
9
- declare module '*.module.sass' {
10
- const classes: { readonly [key: string]: string };
11
- export default classes;
12
- }
13
-
14
- declare module '*.module.less' {
15
- const classes: { readonly [key: string]: string };
16
- export default classes;
17
- }
18
-
19
- declare module '*.less' {
20
- const classes: { readonly [key: string]: string };
21
- export default classes;
22
- }
23
-
24
- declare module '*.css' {
25
- const classes: { readonly [key: string]: string };
26
- export default classes;
27
- }
28
-
29
- declare module '*.sass' {
30
- const classes: { readonly [key: string]: string };
31
- export default classes;
32
- }
33
-
34
- declare module '*.scss' {
35
- const classes: { readonly [key: string]: string };
36
- export default classes;
37
- }
38
-
39
- declare module '*.mdx' {
40
- const component: any;
41
- export default component;
42
- }