@shohojdhara/atomix 0.4.1 → 0.4.3
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/atomix.css +9351 -9259
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +4 -4
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.d.ts +12 -19
- package/dist/charts.js +555 -358
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +21 -24
- package/dist/core.js +435 -265
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +11 -18
- package/dist/forms.js +411 -257
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +14 -21
- package/dist/heavy.js +409 -254
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +38 -41
- package/dist/index.esm.js +731 -487
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +733 -492
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/scripts/atomix-cli.js +34 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +82 -54
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +17 -18
- package/src/components/AtomixGlass/README.md +5 -5
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +42 -42
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +5 -5
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +3 -3
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +45 -45
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +3 -3
- package/src/components/Badge/Badge.stories.tsx +1 -1
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +90 -77
- package/src/components/Breadcrumb/index.ts +2 -2
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Button/README.md +2 -2
- package/src/components/Callout/Callout.test.tsx +3 -3
- package/src/components/Callout/Callout.tsx +2 -2
- package/src/components/Callout/README.md +2 -2
- package/src/components/Card/Card.tsx +31 -11
- package/src/components/Chart/Chart.stories.tsx +1 -1
- package/src/components/Chart/Chart.tsx +5 -5
- package/src/components/Chart/TreemapChart.tsx +37 -29
- package/src/components/DatePicker/readme.md +3 -3
- package/src/components/Dropdown/Dropdown.stories.tsx +1 -1
- package/src/components/Dropdown/Dropdown.tsx +276 -273
- package/src/components/EdgePanel/EdgePanel.stories.tsx +7 -7
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.stories.tsx +1 -1
- package/src/components/Form/Checkbox.tsx +1 -1
- package/src/components/Form/Input.stories.tsx +1 -1
- package/src/components/Form/Input.tsx +1 -1
- package/src/components/Form/Radio.stories.tsx +1 -1
- package/src/components/Form/Radio.tsx +1 -1
- package/src/components/Form/Select.stories.tsx +1 -1
- package/src/components/Form/Select.tsx +1 -1
- package/src/components/Form/Textarea.stories.tsx +1 -1
- package/src/components/Form/Textarea.tsx +1 -1
- package/src/components/Hero/Hero.stories.tsx +2 -2
- package/src/components/Hero/Hero.tsx +2 -2
- package/src/components/Messages/Messages.stories.tsx +1 -1
- package/src/components/Messages/Messages.tsx +2 -2
- package/src/components/Modal/Modal.stories.tsx +1 -1
- package/src/components/Navigation/Nav/Nav.stories.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.tsx +1 -1
- package/src/components/Navigation/Nav/NavItem.tsx +6 -3
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +3 -3
- package/src/components/Navigation/Navbar/Navbar.tsx +1 -1
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +2 -2
- package/src/components/Navigation/SideMenu/SideMenu.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.tsx +1 -1
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/Rating/Rating.stories.tsx +1 -1
- package/src/components/Rating/Rating.test.tsx +73 -0
- package/src/components/Rating/Rating.tsx +25 -37
- package/src/components/Spinner/Spinner.tsx +1 -1
- package/src/components/Steps/Steps.stories.tsx +1 -1
- package/src/components/Steps/Steps.tsx +2 -2
- package/src/components/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +1 -1
- package/src/components/Todo/Todo.tsx +0 -1
- package/src/components/Toggle/Toggle.stories.tsx +1 -1
- package/src/components/Toggle/Toggle.tsx +1 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +2 -2
- package/src/lib/composables/__tests__/useAtomixGlassPerf.test.tsx +88 -0
- package/src/lib/composables/__tests__/useChart.test.ts +50 -0
- package/src/lib/composables/__tests__/useChart.test.tsx +139 -0
- package/src/lib/composables/__tests__/useHeroBackgroundSlider.test.tsx +59 -0
- package/src/lib/composables/__tests__/useSliderAutoplay.test.tsx +68 -0
- package/src/lib/composables/atomix-glass/useGlassBackgroundDetection.ts +329 -0
- package/src/lib/composables/atomix-glass/useGlassCornerRadius.ts +82 -0
- package/src/lib/composables/atomix-glass/useGlassMouseTracking.ts +153 -0
- package/src/lib/composables/atomix-glass/useGlassOverLight.ts +198 -0
- package/src/lib/composables/atomix-glass/useGlassSize.ts +117 -0
- package/src/lib/composables/atomix-glass/useGlassState.ts +112 -0
- package/src/lib/composables/atomix-glass/useGlassTransforms.ts +160 -0
- package/src/lib/composables/glass-styles.ts +302 -0
- package/src/lib/composables/index.ts +0 -4
- package/src/lib/composables/useAtomixGlass.ts +331 -522
- package/src/lib/composables/useAtomixGlassStyles.ts +307 -0
- package/src/lib/composables/useBarChart.ts +1 -1
- package/src/lib/composables/useBreadcrumb.ts +6 -6
- package/src/lib/composables/useChart.ts +104 -21
- package/src/lib/composables/useHeroBackgroundSlider.ts +16 -7
- package/src/lib/composables/useSlider.ts +66 -34
- package/src/lib/theme/devtools/CLI.ts +1 -1
- package/src/lib/theme/utils/__tests__/themeUtils.test.ts +213 -0
- package/src/lib/types/components.ts +18 -21
- package/src/lib/utils/__tests__/dom.test.ts +100 -0
- package/src/lib/utils/__tests__/fontPreloader.test.ts +102 -0
- package/src/styles/02-tools/_tools.breakpoints.scss +1 -1
- package/src/styles/02-tools/_tools.utility-api.scss +6 -6
- package/src/styles/06-components/_components.accordion.scss +0 -2
- package/src/styles/06-components/_components.chart.scss +0 -1
- package/src/styles/06-components/_components.dropdown.scss +0 -1
- package/src/styles/06-components/_components.edge-panel.scss +0 -2
- package/src/styles/06-components/_components.photoviewer.scss +0 -1
- package/src/styles/06-components/_components.river.scss +0 -1
- package/src/styles/06-components/_components.slider.scss +0 -3
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +0 -1
- package/src/styles/99-utilities/_utilities.text.scss +1 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
createFontPreloadLink,
|
|
4
|
+
preloadFonts,
|
|
5
|
+
generateFontPreloadTags,
|
|
6
|
+
type FontPreloadConfig,
|
|
7
|
+
} from '../fontPreloader';
|
|
8
|
+
|
|
9
|
+
describe('fontPreloader', () => {
|
|
10
|
+
describe('createFontPreloadLink', () => {
|
|
11
|
+
it('should create a link element with correct attributes', () => {
|
|
12
|
+
const config: FontPreloadConfig = {
|
|
13
|
+
family: 'Test Font',
|
|
14
|
+
path: '/fonts/test.woff2',
|
|
15
|
+
weight: 400,
|
|
16
|
+
style: 'normal',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const link = createFontPreloadLink(config);
|
|
20
|
+
|
|
21
|
+
expect(link).toBeInstanceOf(HTMLLinkElement);
|
|
22
|
+
expect(link.rel).toBe('preload');
|
|
23
|
+
expect(link.as).toBe('font');
|
|
24
|
+
expect(link.href).toContain('/fonts/test.woff2');
|
|
25
|
+
expect(link.type).toBe('font/woff2');
|
|
26
|
+
expect(link.crossOrigin).toBe('anonymous');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should use default values for optional properties', () => {
|
|
30
|
+
const config: FontPreloadConfig = {
|
|
31
|
+
family: 'Test Font',
|
|
32
|
+
path: '/fonts/test.woff2',
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const link = createFontPreloadLink(config);
|
|
36
|
+
|
|
37
|
+
expect(link.type).toBe('font/woff2');
|
|
38
|
+
expect(link.crossOrigin).toBe('anonymous');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should respect custom format and crossorigin', () => {
|
|
42
|
+
const config: FontPreloadConfig = {
|
|
43
|
+
family: 'Test Font',
|
|
44
|
+
path: '/fonts/test.woff',
|
|
45
|
+
format: 'woff',
|
|
46
|
+
crossorigin: 'use-credentials',
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const link = createFontPreloadLink(config);
|
|
50
|
+
|
|
51
|
+
expect(link.type).toBe('font/woff');
|
|
52
|
+
expect(link.crossOrigin).toBe('use-credentials');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('preloadFonts', () => {
|
|
57
|
+
it('should create multiple link elements', () => {
|
|
58
|
+
const configs: FontPreloadConfig[] = [
|
|
59
|
+
{ family: 'Font 1', path: '/f1.woff2' },
|
|
60
|
+
{ family: 'Font 2', path: '/f2.woff2' },
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const links = preloadFonts(configs);
|
|
64
|
+
|
|
65
|
+
expect(links).toHaveLength(2);
|
|
66
|
+
expect(links[0]).toBeInstanceOf(HTMLLinkElement);
|
|
67
|
+
expect(links[1]).toBeInstanceOf(HTMLLinkElement);
|
|
68
|
+
expect(links[0].href).toContain('/f1.woff2');
|
|
69
|
+
expect(links[1].href).toContain('/f2.woff2');
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
describe('generateFontPreloadTags', () => {
|
|
74
|
+
it('should generate HTML strings for preload links', () => {
|
|
75
|
+
const configs: FontPreloadConfig[] = [
|
|
76
|
+
{ family: 'Font 1', path: '/f1.woff2' },
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
const tags = generateFontPreloadTags(configs);
|
|
80
|
+
|
|
81
|
+
expect(tags).toHaveLength(1);
|
|
82
|
+
expect(tags[0]).toContain('<link rel="preload" as="font"');
|
|
83
|
+
expect(tags[0]).toContain('href="/f1.woff2"');
|
|
84
|
+
expect(tags[0]).toContain('type="font/woff2"');
|
|
85
|
+
expect(tags[0]).toContain('crossorigin="anonymous"');
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('should handle multiple configurations', () => {
|
|
89
|
+
const configs: FontPreloadConfig[] = [
|
|
90
|
+
{ family: 'Font 1', path: '/f1.woff2' },
|
|
91
|
+
{ family: 'Font 2', path: '/f2.woff', format: 'woff' },
|
|
92
|
+
];
|
|
93
|
+
|
|
94
|
+
const tags = generateFontPreloadTags(configs);
|
|
95
|
+
|
|
96
|
+
expect(tags).toHaveLength(2);
|
|
97
|
+
expect(tags[0]).toContain('href="/f1.woff2"');
|
|
98
|
+
expect(tags[1]).toContain('href="/f2.woff"');
|
|
99
|
+
expect(tags[1]).toContain('type="font/woff"');
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -22,7 +22,7 @@ $utility-defaults: (
|
|
|
22
22
|
class: null,
|
|
23
23
|
state: null,
|
|
24
24
|
local-vars: (),
|
|
25
|
-
|
|
25
|
+
rtl: true,
|
|
26
26
|
) !default;
|
|
27
27
|
|
|
28
28
|
// Core function to generate utility classes
|
|
@@ -77,11 +77,11 @@ $utility-defaults: (
|
|
|
77
77
|
--atomix-u-#{$css-variable-name}: #{$value};
|
|
78
78
|
} @else if $properties {
|
|
79
79
|
@each $property in $properties {
|
|
80
|
-
#{$property}: $value
|
|
80
|
+
#{$property}: $value;
|
|
81
81
|
}
|
|
82
82
|
} @else if $value != null {
|
|
83
83
|
// Guard: only emit property declaration if value is not null
|
|
84
|
-
#{$property-class}: $value
|
|
84
|
+
#{$property-class}: $value;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
// Add local CSS variables if specified
|
|
@@ -111,11 +111,11 @@ $utility-defaults: (
|
|
|
111
111
|
--atomix-u-#{$css-variable-name}#{$modifier}: #{$value};
|
|
112
112
|
} @else if $properties {
|
|
113
113
|
@each $property in $properties {
|
|
114
|
-
#{$property}: $value
|
|
114
|
+
#{$property}: $value;
|
|
115
115
|
}
|
|
116
116
|
} @else if $value != null {
|
|
117
117
|
// Guard: only emit property declaration if value is not null
|
|
118
|
-
#{$base-class}: $value
|
|
118
|
+
#{$base-class}: $value;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
// Add local CSS variables if specified
|
|
@@ -169,7 +169,7 @@ $utility-defaults: (
|
|
|
169
169
|
values: map.get($config, values),
|
|
170
170
|
class: map.get($config, class),
|
|
171
171
|
state: map.get($config, state),
|
|
172
|
-
|
|
172
|
+
rtl: map.get($config, rtl),
|
|
173
173
|
css-var: map.get($config, css-var),
|
|
174
174
|
local-vars: map.get($config, local-vars),
|
|
175
175
|
responsive: map.get($config, responsive),
|
|
@@ -83,7 +83,6 @@
|
|
|
83
83
|
&__icon {
|
|
84
84
|
color: var(--#{config.$prefix}accordion-icon-color);
|
|
85
85
|
font-size: var(--#{config.$prefix}accordion-icon-size);
|
|
86
|
-
will-change: transform;
|
|
87
86
|
flex-shrink: 0;
|
|
88
87
|
display: inline-flex;
|
|
89
88
|
align-items: center;
|
|
@@ -95,7 +94,6 @@
|
|
|
95
94
|
&__panel {
|
|
96
95
|
height: var(--panel-height);
|
|
97
96
|
overflow: hidden;
|
|
98
|
-
will-change: height;
|
|
99
97
|
|
|
100
98
|
@if accordion.$accordion-enable-smooth-scroll {
|
|
101
99
|
scroll-behavior: smooth;
|
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
opacity: 0;
|
|
40
40
|
z-index: map.get($z-layers, 1);
|
|
41
41
|
transition: opacity var(--#{$prefix}edge-panel-animation-duration) ease;
|
|
42
|
-
will-change: opacity;
|
|
43
42
|
|
|
44
43
|
&.is-animating {
|
|
45
44
|
animation: fadeIn 0.3s ease forwards;
|
|
@@ -62,7 +61,6 @@
|
|
|
62
61
|
overflow: hidden;
|
|
63
62
|
display: flex;
|
|
64
63
|
flex-direction: column;
|
|
65
|
-
will-change: transform, opacity;
|
|
66
64
|
|
|
67
65
|
&.is-animating {
|
|
68
66
|
animation: slideIn var(--#{$prefix}edge-panel-animation-duration)
|
|
@@ -43,8 +43,6 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.c-slider__wrapper {
|
|
46
|
-
will-change: transform;
|
|
47
|
-
|
|
48
46
|
&.transitioning {
|
|
49
47
|
transition: transform var(--#{config.$prefix}slider-speed)
|
|
50
48
|
var(--#{config.$prefix}slider-easing);
|
|
@@ -85,7 +83,6 @@
|
|
|
85
83
|
z-index: slider.$slider-z-index-base;
|
|
86
84
|
display: flex;
|
|
87
85
|
box-sizing: content-box;
|
|
88
|
-
will-change: transform;
|
|
89
86
|
}
|
|
90
87
|
|
|
91
88
|
.c-slider__slide {
|