@magic-spells/cart-progress-bar 1.0.0 → 2.0.0

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.
@@ -1,124 +0,0 @@
1
- // SCSS Variables (can be overridden before import)
2
- $cart-progress-bar-height: 12px !default;
3
- $cart-progress-bar-border-radius: 6px !default;
4
- $cart-progress-bar-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !default;
5
- $cart-progress-bar-transition-duration: 0.3s !default;
6
-
7
- // Core color variables
8
- $cart-progress-section-bg: transparent !default;
9
- $cart-progress-section-color: #495057 !default;
10
- $cart-progress-bar-bg: #e9ecef !default;
11
- $cart-progress-bar-fill-before: #28a745 !default;
12
- $cart-progress-bar-fill-after: #007bff !default;
13
-
14
- // Responsive breakpoints
15
- $cart-progress-mobile-breakpoint: 768px !default;
16
-
17
- // Cart progress bar component styles
18
- cart-progress-bar {
19
- // CSS Custom Properties for customization (mapped from SCSS variables)
20
- --cart-progress-bar-height: #{$cart-progress-bar-height};
21
- --cart-progress-bar-border-radius: #{$cart-progress-bar-border-radius};
22
- --cart-progress-bar-shadow: #{$cart-progress-bar-shadow};
23
- --cart-progress-bar-transition-duration: #{$cart-progress-bar-transition-duration};
24
-
25
- // Core color variables
26
- --cart-progress-section-bg: #{$cart-progress-section-bg};
27
- --cart-progress-section-color: #{$cart-progress-section-color};
28
- --cart-progress-bar-bg: #{$cart-progress-bar-bg};
29
- --cart-progress-bar-fill-before: #{$cart-progress-bar-fill-before};
30
- --cart-progress-bar-fill-after: #{$cart-progress-bar-fill-after};
31
-
32
- // Dynamic variables (set by JavaScript)
33
- --cart-progress-percent: 0%;
34
- --cart-progress-bar-fill-current: var(--cart-progress-bar-fill-before);
35
-
36
- display: block;
37
- width: 100%;
38
- max-width: 100%;
39
- background-color: var(--cart-progress-section-bg);
40
- color: var(--cart-progress-section-color);
41
-
42
- // Message styling
43
- p[data-content-cart-progress-message] {
44
- color: inherit;
45
- transition: opacity var(--cart-progress-bar-transition-duration) ease;
46
- }
47
-
48
- // State-based styling
49
- &[complete='true'] {
50
- p[data-content-cart-progress-message] {
51
- font-weight: 600;
52
- }
53
- }
54
-
55
- // State-based progress bar coloring
56
- &[complete='false'] {
57
- --cart-progress-bar-fill-current: var(--cart-progress-bar-fill-before);
58
- }
59
-
60
- &[complete='true'] {
61
- --cart-progress-bar-fill-current: var(--cart-progress-bar-fill-after);
62
- }
63
- }
64
-
65
- // Progress bar component styles
66
- progress-bar {
67
- display: block;
68
- width: 100%;
69
- height: var(--cart-progress-bar-height);
70
- background-color: var(--cart-progress-bar-bg);
71
- border-radius: var(--cart-progress-bar-border-radius);
72
- box-shadow: var(--cart-progress-bar-shadow);
73
- overflow: hidden;
74
- position: relative;
75
-
76
- .progress-bar-fill {
77
- height: 100%;
78
- width: var(--cart-progress-percent);
79
- background-color: var(--cart-progress-bar-fill-current);
80
- border-radius: var(--cart-progress-bar-border-radius);
81
- transition:
82
- width var(--cart-progress-bar-transition-duration) ease,
83
- background-color var(--cart-progress-bar-transition-duration) ease;
84
- position: relative;
85
-
86
- // Subtle gradient effect
87
- background-image: linear-gradient(
88
- 45deg,
89
- rgba(255, 255, 255, 0.1) 25%,
90
- transparent 25%,
91
- transparent 50%,
92
- rgba(255, 255, 255, 0.1) 50%,
93
- rgba(255, 255, 255, 0.1) 75%,
94
- transparent 75%,
95
- transparent
96
- );
97
- background-size: 12px 12px;
98
-
99
- // Shine effect for completed state
100
- &::after {
101
- content: '';
102
- position: absolute;
103
- top: 0;
104
- left: -100%;
105
- width: 100%;
106
- height: 100%;
107
- background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
108
- transition: left 0.5s ease;
109
- }
110
- }
111
-
112
- // Animate shine effect when complete
113
- cart-progress-bar[complete='true'] & {
114
- .progress-bar-fill::after {
115
- left: 100%;
116
- }
117
- }
118
-
119
- // Accessibility improvements
120
- &:focus-visible {
121
- outline: 2px solid #007bff;
122
- outline-offset: 2px;
123
- }
124
- }