@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.
Files changed (131) hide show
  1. package/dist/atomix.css +9351 -9259
  2. package/dist/atomix.css.map +1 -1
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/atomix.min.css.map +1 -1
  5. package/dist/charts.d.ts +12 -19
  6. package/dist/charts.js +555 -358
  7. package/dist/charts.js.map +1 -1
  8. package/dist/core.d.ts +21 -24
  9. package/dist/core.js +435 -265
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.d.ts +11 -18
  12. package/dist/forms.js +411 -257
  13. package/dist/forms.js.map +1 -1
  14. package/dist/heavy.d.ts +14 -21
  15. package/dist/heavy.js +409 -254
  16. package/dist/heavy.js.map +1 -1
  17. package/dist/index.d.ts +38 -41
  18. package/dist/index.esm.js +731 -487
  19. package/dist/index.esm.js.map +1 -1
  20. package/dist/index.js +733 -492
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.min.js +1 -1
  23. package/dist/index.min.js.map +1 -1
  24. package/package.json +1 -1
  25. package/scripts/atomix-cli.js +34 -1
  26. package/src/components/AtomixGlass/AtomixGlass.tsx +82 -54
  27. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +17 -18
  28. package/src/components/AtomixGlass/README.md +5 -5
  29. package/src/components/AtomixGlass/stories/Customization.stories.tsx +2 -2
  30. package/src/components/AtomixGlass/stories/Examples.stories.tsx +42 -42
  31. package/src/components/AtomixGlass/stories/Modes.stories.tsx +5 -5
  32. package/src/components/AtomixGlass/stories/Overview.stories.tsx +3 -3
  33. package/src/components/AtomixGlass/stories/Performance.stories.tsx +2 -2
  34. package/src/components/AtomixGlass/stories/Playground.stories.tsx +45 -45
  35. package/src/components/AtomixGlass/stories/Shaders.stories.tsx +3 -3
  36. package/src/components/Badge/Badge.stories.tsx +1 -1
  37. package/src/components/Badge/Badge.tsx +1 -1
  38. package/src/components/Breadcrumb/Breadcrumb.tsx +90 -77
  39. package/src/components/Breadcrumb/index.ts +2 -2
  40. package/src/components/Button/Button.stories.tsx +1 -1
  41. package/src/components/Button/Button.tsx +2 -1
  42. package/src/components/Button/README.md +2 -2
  43. package/src/components/Callout/Callout.test.tsx +3 -3
  44. package/src/components/Callout/Callout.tsx +2 -2
  45. package/src/components/Callout/README.md +2 -2
  46. package/src/components/Card/Card.tsx +31 -11
  47. package/src/components/Chart/Chart.stories.tsx +1 -1
  48. package/src/components/Chart/Chart.tsx +5 -5
  49. package/src/components/Chart/TreemapChart.tsx +37 -29
  50. package/src/components/DatePicker/readme.md +3 -3
  51. package/src/components/Dropdown/Dropdown.stories.tsx +1 -1
  52. package/src/components/Dropdown/Dropdown.tsx +276 -273
  53. package/src/components/EdgePanel/EdgePanel.stories.tsx +7 -7
  54. package/src/components/Footer/FooterLink.tsx +2 -2
  55. package/src/components/Form/Checkbox.stories.tsx +1 -1
  56. package/src/components/Form/Checkbox.tsx +1 -1
  57. package/src/components/Form/Input.stories.tsx +1 -1
  58. package/src/components/Form/Input.tsx +1 -1
  59. package/src/components/Form/Radio.stories.tsx +1 -1
  60. package/src/components/Form/Radio.tsx +1 -1
  61. package/src/components/Form/Select.stories.tsx +1 -1
  62. package/src/components/Form/Select.tsx +1 -1
  63. package/src/components/Form/Textarea.stories.tsx +1 -1
  64. package/src/components/Form/Textarea.tsx +1 -1
  65. package/src/components/Hero/Hero.stories.tsx +2 -2
  66. package/src/components/Hero/Hero.tsx +2 -2
  67. package/src/components/Messages/Messages.stories.tsx +1 -1
  68. package/src/components/Messages/Messages.tsx +2 -2
  69. package/src/components/Modal/Modal.stories.tsx +1 -1
  70. package/src/components/Navigation/Nav/Nav.stories.tsx +2 -2
  71. package/src/components/Navigation/Nav/Nav.tsx +1 -1
  72. package/src/components/Navigation/Nav/NavItem.tsx +6 -3
  73. package/src/components/Navigation/Navbar/Navbar.stories.tsx +3 -3
  74. package/src/components/Navigation/Navbar/Navbar.tsx +1 -1
  75. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +2 -2
  76. package/src/components/Navigation/SideMenu/SideMenu.tsx +1 -1
  77. package/src/components/Pagination/Pagination.stories.tsx +1 -1
  78. package/src/components/Pagination/Pagination.tsx +1 -1
  79. package/src/components/Popover/Popover.stories.tsx +1 -1
  80. package/src/components/Popover/Popover.tsx +1 -1
  81. package/src/components/Progress/Progress.tsx +1 -1
  82. package/src/components/Rating/Rating.stories.tsx +1 -1
  83. package/src/components/Rating/Rating.test.tsx +73 -0
  84. package/src/components/Rating/Rating.tsx +25 -37
  85. package/src/components/Spinner/Spinner.tsx +1 -1
  86. package/src/components/Steps/Steps.stories.tsx +1 -1
  87. package/src/components/Steps/Steps.tsx +2 -2
  88. package/src/components/Tabs/Tabs.stories.tsx +1 -1
  89. package/src/components/Tabs/Tabs.tsx +1 -1
  90. package/src/components/Todo/Todo.tsx +0 -1
  91. package/src/components/Toggle/Toggle.stories.tsx +1 -1
  92. package/src/components/Toggle/Toggle.tsx +1 -1
  93. package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
  94. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +2 -2
  95. package/src/lib/composables/__tests__/useAtomixGlassPerf.test.tsx +88 -0
  96. package/src/lib/composables/__tests__/useChart.test.ts +50 -0
  97. package/src/lib/composables/__tests__/useChart.test.tsx +139 -0
  98. package/src/lib/composables/__tests__/useHeroBackgroundSlider.test.tsx +59 -0
  99. package/src/lib/composables/__tests__/useSliderAutoplay.test.tsx +68 -0
  100. package/src/lib/composables/atomix-glass/useGlassBackgroundDetection.ts +329 -0
  101. package/src/lib/composables/atomix-glass/useGlassCornerRadius.ts +82 -0
  102. package/src/lib/composables/atomix-glass/useGlassMouseTracking.ts +153 -0
  103. package/src/lib/composables/atomix-glass/useGlassOverLight.ts +198 -0
  104. package/src/lib/composables/atomix-glass/useGlassSize.ts +117 -0
  105. package/src/lib/composables/atomix-glass/useGlassState.ts +112 -0
  106. package/src/lib/composables/atomix-glass/useGlassTransforms.ts +160 -0
  107. package/src/lib/composables/glass-styles.ts +302 -0
  108. package/src/lib/composables/index.ts +0 -4
  109. package/src/lib/composables/useAtomixGlass.ts +331 -522
  110. package/src/lib/composables/useAtomixGlassStyles.ts +307 -0
  111. package/src/lib/composables/useBarChart.ts +1 -1
  112. package/src/lib/composables/useBreadcrumb.ts +6 -6
  113. package/src/lib/composables/useChart.ts +104 -21
  114. package/src/lib/composables/useHeroBackgroundSlider.ts +16 -7
  115. package/src/lib/composables/useSlider.ts +66 -34
  116. package/src/lib/theme/devtools/CLI.ts +1 -1
  117. package/src/lib/theme/utils/__tests__/themeUtils.test.ts +213 -0
  118. package/src/lib/types/components.ts +18 -21
  119. package/src/lib/utils/__tests__/dom.test.ts +100 -0
  120. package/src/lib/utils/__tests__/fontPreloader.test.ts +102 -0
  121. package/src/styles/02-tools/_tools.breakpoints.scss +1 -1
  122. package/src/styles/02-tools/_tools.utility-api.scss +6 -6
  123. package/src/styles/06-components/_components.accordion.scss +0 -2
  124. package/src/styles/06-components/_components.chart.scss +0 -1
  125. package/src/styles/06-components/_components.dropdown.scss +0 -1
  126. package/src/styles/06-components/_components.edge-panel.scss +0 -2
  127. package/src/styles/06-components/_components.photoviewer.scss +0 -1
  128. package/src/styles/06-components/_components.river.scss +0 -1
  129. package/src/styles/06-components/_components.slider.scss +0 -3
  130. package/src/styles/99-utilities/_utilities.glass-fixes.scss +0 -1
  131. 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
+ });
@@ -8,7 +8,7 @@
8
8
  // Breakpoint viewport sizes and media queries.
9
9
  @mixin media-breakpoint-up($name, $breakpoints: breakpoints.$grid-breakpoints) {
10
10
  $min: map.get($breakpoints, $name);
11
- @if $min and $min != 0 {
11
+ @if $min {
12
12
  @media (min-width: $min) {
13
13
  @content;
14
14
  }
@@ -22,7 +22,7 @@ $utility-defaults: (
22
22
  class: null,
23
23
  state: null,
24
24
  local-vars: (),
25
- is-important: true,
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 if(map.get($utility, is-important), !important, null);
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 if(map.get($utility, is-important), !important, null);
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 if(map.get($utility, is-important), !important, null);
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 if(map.get($utility, is-important), !important, null);
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
- is-important: map.get($config, is-important),
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;
@@ -634,7 +634,6 @@
634
634
  text-rendering: optimizeLegibility;
635
635
  image-rendering: -webkit-optimize-contrast;
636
636
  image-rendering: crisp-edges;
637
- will-change: contents;
638
637
  backface-visibility: hidden;
639
638
  transform: translateZ(0);
640
639
  opacity: 0;
@@ -99,7 +99,6 @@
99
99
  pointer-events: none;
100
100
 
101
101
  &:not(.is-glass) {
102
- will-change: transform, opacity, visibility;
103
102
  transform: translateY(-15px) scale(0.95);
104
103
  transform-origin: top center;
105
104
  }
@@ -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)
@@ -77,7 +77,6 @@
77
77
  max-height: 100%;
78
78
  object-fit: contain;
79
79
  transform-origin: center center;
80
- will-change: transform;
81
80
 
82
81
  // Enhanced image quality
83
82
  image-rendering: auto;
@@ -149,7 +149,6 @@
149
149
  max-width: none;
150
150
  @include square(100%);
151
151
  @include object-fit(cover);
152
- will-change: transform;
153
152
  }
154
153
 
155
154
  // When the river has a background image, we need to adjust text colors for readability
@@ -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 {
@@ -14,7 +14,6 @@
14
14
  transform-style: flat !important;
15
15
  will-change: auto !important;
16
16
  transform: none !important;
17
- z-index: unset;
18
17
  }
19
18
 
20
19
  // =============================================================================
@@ -99,6 +99,7 @@ $utilities-text: (
99
99
  values: (
100
100
  break: break-word,
101
101
  ),
102
+ rtl: false,
102
103
  ),
103
104
  'color': (
104
105
  property: color,