@donotdev/components 0.2.0 → 0.2.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/dist/CarouselContent-F4JSFIQD.js +1 -0
- package/dist/CarouselContent-KLQY6OVW.css +1 -0
- package/dist/CodeContent-265AM7HO.css +1 -0
- package/dist/CodeContent-NMM2R33O.js +2 -0
- package/dist/CodeContent-S3BDX46F.js +2 -0
- package/dist/MarqueeContent-7BVN7TX3.css +1 -0
- package/dist/MarqueeContent-NBXB2YLR.js +1 -0
- package/dist/atomic/Badge/index.d.ts +1 -1
- package/dist/atomic/Button/index.d.ts +1 -1
- package/dist/atomic/HeroSection/index.d.ts +1 -1
- package/dist/atomic/Icons/Partner/InstagramIcon.d.ts +13 -0
- package/dist/atomic/Icons/Partner/InstagramIcon.d.ts.map +1 -0
- package/dist/atomic/Icons/Partner/InstagramIcon.js +29 -0
- package/dist/atomic/Icons/Partner/index.d.ts +1 -0
- package/dist/atomic/Icons/Partner/index.d.ts.map +1 -1
- package/dist/atomic/Icons/Partner/index.js +1 -0
- package/dist/atomic/Rating/index.d.ts +1 -1
- package/dist/atomic/Stepper/index.d.ts +1 -1
- package/dist/atomic/Tabs/index.d.ts +1 -1
- package/dist/atomic/Text/index.d.ts +0 -5
- package/dist/atomic/Text/index.d.ts.map +1 -1
- package/dist/atomic/Text/index.js +2 -2
- package/dist/atomic/Toggle/index.d.ts +1 -1
- package/dist/chunk-3IECHFZB.js +3 -0
- package/dist/chunk-RIB7YURO.js +3 -0
- package/dist/chunk-UTPWB5VD.js +1 -0
- package/dist/index.js +9 -9
- package/dist/styles/index.css +35 -46
- package/dist/symbol-index.json +1 -1
- package/dist/utils/initRipple.d.ts.map +1 -1
- package/dist/utils/initRipple.js +18 -11
- package/dist/utils/variants.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initRipple.d.ts","sourceRoot":"","sources":["../../src/utils/initRipple.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAMjC;
|
|
1
|
+
{"version":3,"file":"initRipple.d.ts","sourceRoot":"","sources":["../../src/utils/initRipple.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAMjC;AAsDD;;;GAGG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAMpC"}
|
package/dist/utils/initRipple.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview Ripple effect initialization
|
|
4
4
|
* @description Event delegation for ripple effect on all .dndev-interactive elements.
|
|
5
|
-
* Call once at app startup. Uses CSS variable --ripple-opacity (0 = disabled).
|
|
5
|
+
* Call once at app startup. Uses CSS variable --ripple-opacity (0 or unset = disabled).
|
|
6
6
|
*
|
|
7
7
|
* @version 0.1.0
|
|
8
8
|
* @since 0.1.0
|
|
@@ -38,14 +38,17 @@ function handleRipple(event) {
|
|
|
38
38
|
return;
|
|
39
39
|
// Check if ripple is disabled via CSS variable
|
|
40
40
|
const styles = getComputedStyle(target);
|
|
41
|
-
const rippleOpacity = parseFloat(styles.getPropertyValue('--ripple-opacity')
|
|
42
|
-
if (rippleOpacity
|
|
41
|
+
const rippleOpacity = parseFloat(styles.getPropertyValue('--ripple-opacity'));
|
|
42
|
+
if (!(rippleOpacity > 0))
|
|
43
43
|
return;
|
|
44
|
-
// Get click position relative to target
|
|
44
|
+
// Get click position relative to the target's padding box (the ripple's containing block)
|
|
45
45
|
const rect = target.getBoundingClientRect();
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
|
|
46
|
+
const paddingBoxStart = rect.left + target.clientLeft;
|
|
47
|
+
const inlineOffset = styles.direction === 'rtl'
|
|
48
|
+
? paddingBoxStart + target.clientWidth - event.clientX
|
|
49
|
+
: event.clientX - paddingBoxStart;
|
|
50
|
+
const blockOffset = event.clientY - rect.top - target.clientTop;
|
|
51
|
+
// Base ripple size on the element's longest side
|
|
49
52
|
const size = Math.max(rect.width, rect.height);
|
|
50
53
|
// Create ripple element
|
|
51
54
|
const ripple = document.createElement('span');
|
|
@@ -53,14 +56,18 @@ function handleRipple(event) {
|
|
|
53
56
|
ripple.style.cssText = `
|
|
54
57
|
width: ${size}px;
|
|
55
58
|
height: ${size}px;
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
inset-inline-start: ${inlineOffset - size / 2}px;
|
|
60
|
+
inset-block-start: ${blockOffset - size / 2}px;
|
|
58
61
|
`;
|
|
62
|
+
// Clip inside a dedicated layer: layout rules can override the target's overflow
|
|
63
|
+
const clip = document.createElement('span');
|
|
64
|
+
clip.className = 'dndev-ripple-clip';
|
|
65
|
+
clip.appendChild(ripple);
|
|
59
66
|
// Add to target
|
|
60
|
-
target.appendChild(
|
|
67
|
+
target.appendChild(clip);
|
|
61
68
|
// Remove after animation completes
|
|
62
69
|
ripple.addEventListener('animationend', () => {
|
|
63
|
-
|
|
70
|
+
clip.remove();
|
|
64
71
|
}, { once: true });
|
|
65
72
|
}
|
|
66
73
|
/**
|
package/dist/utils/variants.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
9
9
|
* Used by: Card, DualCard, StackedCards, Dialog, Sheet, Alert
|
|
10
10
|
*/
|
|
11
11
|
export declare const surfaceVariants: (props?: ({
|
|
12
|
-
variant?: "default" | "muted" | "
|
|
12
|
+
variant?: "default" | "muted" | "primary" | "secondary" | "accent" | "success" | "warning" | "destructive" | "outline" | "glass" | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
14
|
/** CVA variant props for surface components (Card, DualCard, etc.). */
|
|
15
15
|
export type SurfaceVariantProps = VariantProps<typeof surfaceVariants>;
|