bitwrench 2.0.11 → 2.0.13
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/bitwrench-code-edit.cjs.js +1 -1
- package/dist/bitwrench-code-edit.es5.js +1 -1
- package/dist/bitwrench-code-edit.es5.min.js +1 -1
- package/dist/bitwrench-code-edit.esm.js +1 -1
- package/dist/bitwrench-code-edit.esm.min.js +1 -1
- package/dist/bitwrench-code-edit.umd.js +1 -1
- package/dist/bitwrench-code-edit.umd.min.js +1 -1
- package/dist/bitwrench-lean.cjs.js +112 -9
- package/dist/bitwrench-lean.cjs.min.js +5 -5
- package/dist/bitwrench-lean.es5.js +178 -14
- package/dist/bitwrench-lean.es5.min.js +3 -3
- package/dist/bitwrench-lean.esm.js +112 -9
- package/dist/bitwrench-lean.esm.min.js +5 -5
- package/dist/bitwrench-lean.umd.js +112 -9
- package/dist/bitwrench-lean.umd.min.js +5 -5
- package/dist/bitwrench.cjs.js +289 -9
- package/dist/bitwrench.cjs.min.js +5 -5
- package/dist/bitwrench.css +425 -21
- package/dist/bitwrench.es5.js +378 -14
- package/dist/bitwrench.es5.min.js +4 -4
- package/dist/bitwrench.esm.js +289 -9
- package/dist/bitwrench.esm.min.js +5 -5
- package/dist/bitwrench.umd.js +289 -9
- package/dist/bitwrench.umd.min.js +5 -5
- package/dist/builds.json +60 -60
- package/dist/sri.json +25 -25
- package/package.json +1 -1
- package/readme.html +1 -1
- package/src/bitwrench-components-v2.js +176 -0
- package/src/bitwrench-styles.js +208 -15
- package/src/bitwrench.js +39 -2
- package/src/generate-css.js +20 -3
- package/src/version.js +3 -3
package/src/bitwrench-styles.js
CHANGED
|
@@ -570,15 +570,36 @@ function generateAccordionThemed(scope, palette) {
|
|
|
570
570
|
rules[scopeSelector(scope, '.bw-accordion-button')] = {
|
|
571
571
|
'color': palette.dark.base
|
|
572
572
|
};
|
|
573
|
+
rules[scopeSelector(scope, '.bw-accordion-button:not(.bw-collapsed)')] = {
|
|
574
|
+
'color': palette.primary.darkText,
|
|
575
|
+
'background-color': palette.primary.light
|
|
576
|
+
};
|
|
573
577
|
rules[scopeSelector(scope, '.bw-accordion-button:hover')] = {
|
|
574
578
|
'background-color': palette.light.light
|
|
575
579
|
};
|
|
580
|
+
rules[scopeSelector(scope, '.bw-accordion-button:not(.bw-collapsed):hover')] = {
|
|
581
|
+
'background-color': palette.primary.hover
|
|
582
|
+
};
|
|
583
|
+
rules[scopeSelector(scope, '.bw-accordion-button:focus-visible')] = {
|
|
584
|
+
'box-shadow': '0 0 0 0.2rem ' + palette.primary.focus
|
|
585
|
+
};
|
|
576
586
|
rules[scopeSelector(scope, '.bw-accordion-body')] = {
|
|
577
587
|
'border-top': '1px solid ' + palette.light.border
|
|
578
588
|
};
|
|
579
589
|
return rules;
|
|
580
590
|
}
|
|
581
591
|
|
|
592
|
+
function generateCarouselThemed(scope, palette) {
|
|
593
|
+
var rules = {};
|
|
594
|
+
rules[scopeSelector(scope, '.bw-carousel')] = {
|
|
595
|
+
'background-color': palette.light.light
|
|
596
|
+
};
|
|
597
|
+
rules[scopeSelector(scope, '.bw-carousel-indicator.active')] = {
|
|
598
|
+
'background-color': palette.primary.base
|
|
599
|
+
};
|
|
600
|
+
return rules;
|
|
601
|
+
}
|
|
602
|
+
|
|
582
603
|
function generateModalThemed(scope, palette) {
|
|
583
604
|
var rules = {};
|
|
584
605
|
rules[scopeSelector(scope, '.bw-modal-content')] = {
|
|
@@ -659,7 +680,7 @@ function generateSwitchThemed(scope, palette) {
|
|
|
659
680
|
function generateSkeletonThemed(scope, palette) {
|
|
660
681
|
var rules = {};
|
|
661
682
|
rules[scopeSelector(scope, '.bw-skeleton')] = {
|
|
662
|
-
'background
|
|
683
|
+
'background': 'linear-gradient(90deg, ' + palette.light.border + ' 25%, ' + palette.light.light + ' 37%, ' + palette.light.border + ' 63%)'
|
|
663
684
|
};
|
|
664
685
|
return rules;
|
|
665
686
|
}
|
|
@@ -706,6 +727,7 @@ export function generateThemedCSS(scopeName, palette, layout) {
|
|
|
706
727
|
generateCloseButtonThemed(scopeName, palette),
|
|
707
728
|
generateSectionsThemed(scopeName, palette),
|
|
708
729
|
generateAccordionThemed(scopeName, palette),
|
|
730
|
+
generateCarouselThemed(scopeName, palette),
|
|
709
731
|
generateModalThemed(scopeName, palette),
|
|
710
732
|
generateToastThemed(scopeName, palette),
|
|
711
733
|
generateDropdownThemed(scopeName, palette),
|
|
@@ -855,7 +877,7 @@ export const defaultStyles = {
|
|
|
855
877
|
'font-weight': '600',
|
|
856
878
|
'line-height': '1.25',
|
|
857
879
|
'letter-spacing': '-0.01em',
|
|
858
|
-
'color': '
|
|
880
|
+
'color': 'inherit'
|
|
859
881
|
},
|
|
860
882
|
'h1': {
|
|
861
883
|
'font-size': 'calc(1.375rem + 1.5vw)'
|
|
@@ -1747,6 +1769,18 @@ export const defaultStyles = {
|
|
|
1747
1769
|
},
|
|
1748
1770
|
'.bw-tab-pane.active': {
|
|
1749
1771
|
'display': 'block'
|
|
1772
|
+
},
|
|
1773
|
+
'.bw-nav-scrollable': {
|
|
1774
|
+
'flex-wrap': 'nowrap',
|
|
1775
|
+
'overflow-x': 'auto',
|
|
1776
|
+
'-webkit-overflow-scrolling': 'touch',
|
|
1777
|
+
'scrollbar-width': 'none'
|
|
1778
|
+
},
|
|
1779
|
+
'.bw-nav-scrollable::-webkit-scrollbar': {
|
|
1780
|
+
'display': 'none'
|
|
1781
|
+
},
|
|
1782
|
+
'.bw-nav-scrollable .bw-nav-link': {
|
|
1783
|
+
'white-space': 'nowrap'
|
|
1750
1784
|
}
|
|
1751
1785
|
},
|
|
1752
1786
|
|
|
@@ -2091,7 +2125,7 @@ export const defaultStyles = {
|
|
|
2091
2125
|
},
|
|
2092
2126
|
'.bw-cta-description': {
|
|
2093
2127
|
'font-size': '1.125rem',
|
|
2094
|
-
'color': '#
|
|
2128
|
+
'color': '#555b62',
|
|
2095
2129
|
'max-width': '36rem',
|
|
2096
2130
|
'margin-left': 'auto',
|
|
2097
2131
|
'margin-right': 'auto'
|
|
@@ -2404,7 +2438,7 @@ export const defaultStyles = {
|
|
|
2404
2438
|
},
|
|
2405
2439
|
'.bw-accordion-item': {
|
|
2406
2440
|
'background-color': '#fff',
|
|
2407
|
-
'border': '1px solid #
|
|
2441
|
+
'border': '1px solid #d5d5d5'
|
|
2408
2442
|
},
|
|
2409
2443
|
'.bw-accordion-item + .bw-accordion-item': {
|
|
2410
2444
|
'border-top': '0'
|
|
@@ -2448,12 +2482,26 @@ export const defaultStyles = {
|
|
|
2448
2482
|
'background-size': '1.25rem',
|
|
2449
2483
|
'transition': 'transform 0.2s ease-in-out'
|
|
2450
2484
|
},
|
|
2485
|
+
// Expanded header: tinted background + darker text (Bootstrap pattern)
|
|
2486
|
+
'.bw-accordion-button:not(.bw-collapsed)': {
|
|
2487
|
+
'color': '#0a5868',
|
|
2488
|
+
'background-color': '#e8f6f8'
|
|
2489
|
+
},
|
|
2451
2490
|
'.bw-accordion-button:not(.bw-collapsed)::after': {
|
|
2452
|
-
'transform': 'rotate(-180deg)'
|
|
2491
|
+
'transform': 'rotate(-180deg)',
|
|
2492
|
+
'background-image': "url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230a5868'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e\")"
|
|
2453
2493
|
},
|
|
2454
2494
|
'.bw-accordion-button:hover': {
|
|
2455
2495
|
'background-color': 'rgba(0,0,0,0.03)'
|
|
2456
2496
|
},
|
|
2497
|
+
'.bw-accordion-button:not(.bw-collapsed):hover': {
|
|
2498
|
+
'background-color': '#daf0f3'
|
|
2499
|
+
},
|
|
2500
|
+
'.bw-accordion-button:focus-visible': {
|
|
2501
|
+
'z-index': '3',
|
|
2502
|
+
'outline': '0',
|
|
2503
|
+
'box-shadow': '0 0 0 0.2rem rgba(10, 88, 104, 0.25)'
|
|
2504
|
+
},
|
|
2457
2505
|
'.bw-accordion-collapse': {
|
|
2458
2506
|
'max-height': '0',
|
|
2459
2507
|
'overflow': 'hidden',
|
|
@@ -2463,7 +2511,107 @@ export const defaultStyles = {
|
|
|
2463
2511
|
'max-height': 'none'
|
|
2464
2512
|
},
|
|
2465
2513
|
'.bw-accordion-body': {
|
|
2466
|
-
'padding': '1rem 1.25rem'
|
|
2514
|
+
'padding': '1rem 1.25rem',
|
|
2515
|
+
'border-top': '1px solid #d5d5d5'
|
|
2516
|
+
}
|
|
2517
|
+
},
|
|
2518
|
+
|
|
2519
|
+
/**
|
|
2520
|
+
* Carousel/slideshow styles
|
|
2521
|
+
*/
|
|
2522
|
+
carousel: {
|
|
2523
|
+
'.bw-carousel': {
|
|
2524
|
+
'position': 'relative',
|
|
2525
|
+
'overflow': 'hidden',
|
|
2526
|
+
'border-radius': '8px',
|
|
2527
|
+
'background-color': '#f0f0f0'
|
|
2528
|
+
},
|
|
2529
|
+
'.bw-carousel-track': {
|
|
2530
|
+
'display': 'flex',
|
|
2531
|
+
'transition': 'transform 0.4s ease',
|
|
2532
|
+
'height': '100%'
|
|
2533
|
+
},
|
|
2534
|
+
'.bw-carousel-slide': {
|
|
2535
|
+
'min-width': '100%',
|
|
2536
|
+
'flex-shrink': '0',
|
|
2537
|
+
'overflow': 'hidden',
|
|
2538
|
+
'position': 'relative',
|
|
2539
|
+
'display': 'flex',
|
|
2540
|
+
'align-items': 'center',
|
|
2541
|
+
'justify-content': 'center'
|
|
2542
|
+
},
|
|
2543
|
+
'.bw-carousel-slide img': {
|
|
2544
|
+
'width': '100%',
|
|
2545
|
+
'height': '100%',
|
|
2546
|
+
'object-fit': 'cover'
|
|
2547
|
+
},
|
|
2548
|
+
'.bw-carousel-caption': {
|
|
2549
|
+
'position': 'absolute',
|
|
2550
|
+
'bottom': '0',
|
|
2551
|
+
'left': '0',
|
|
2552
|
+
'right': '0',
|
|
2553
|
+
'padding': '0.75rem 1rem',
|
|
2554
|
+
'background': 'linear-gradient(transparent, rgba(0,0,0,0.6))',
|
|
2555
|
+
'color': '#fff',
|
|
2556
|
+
'font-size': '0.9rem'
|
|
2557
|
+
},
|
|
2558
|
+
'.bw-carousel-control': {
|
|
2559
|
+
'position': 'absolute',
|
|
2560
|
+
'top': '50%',
|
|
2561
|
+
'transform': 'translateY(-50%)',
|
|
2562
|
+
'width': '40px',
|
|
2563
|
+
'height': '40px',
|
|
2564
|
+
'border': 'none',
|
|
2565
|
+
'border-radius': '50%',
|
|
2566
|
+
'background-color': 'rgba(0,0,0,0.4)',
|
|
2567
|
+
'cursor': 'pointer',
|
|
2568
|
+
'display': 'flex',
|
|
2569
|
+
'align-items': 'center',
|
|
2570
|
+
'justify-content': 'center',
|
|
2571
|
+
'z-index': '2',
|
|
2572
|
+
'padding': '0',
|
|
2573
|
+
'transition': 'background-color 0.2s ease'
|
|
2574
|
+
},
|
|
2575
|
+
'.bw-carousel-control:hover': {
|
|
2576
|
+
'background-color': 'rgba(0,0,0,0.6)'
|
|
2577
|
+
},
|
|
2578
|
+
'.bw-carousel-control img': {
|
|
2579
|
+
'width': '20px',
|
|
2580
|
+
'height': '20px',
|
|
2581
|
+
'pointer-events': 'none'
|
|
2582
|
+
},
|
|
2583
|
+
'.bw-carousel-control-prev': {
|
|
2584
|
+
'left': '10px'
|
|
2585
|
+
},
|
|
2586
|
+
'.bw-carousel-control-next': {
|
|
2587
|
+
'right': '10px'
|
|
2588
|
+
},
|
|
2589
|
+
'.bw-carousel-indicators': {
|
|
2590
|
+
'position': 'absolute',
|
|
2591
|
+
'bottom': '12px',
|
|
2592
|
+
'left': '50%',
|
|
2593
|
+
'transform': 'translateX(-50%)',
|
|
2594
|
+
'display': 'flex',
|
|
2595
|
+
'gap': '6px',
|
|
2596
|
+
'z-index': '2'
|
|
2597
|
+
},
|
|
2598
|
+
'.bw-carousel-indicator': {
|
|
2599
|
+
'width': '10px',
|
|
2600
|
+
'height': '10px',
|
|
2601
|
+
'border-radius': '50%',
|
|
2602
|
+
'border': '2px solid #fff',
|
|
2603
|
+
'background-color': 'transparent',
|
|
2604
|
+
'opacity': '0.6',
|
|
2605
|
+
'cursor': 'pointer',
|
|
2606
|
+
'padding': '0',
|
|
2607
|
+
'transition': 'opacity 0.2s ease, background-color 0.2s ease'
|
|
2608
|
+
},
|
|
2609
|
+
'.bw-carousel-indicator:hover': {
|
|
2610
|
+
'opacity': '0.8'
|
|
2611
|
+
},
|
|
2612
|
+
'.bw-carousel-indicator.active': {
|
|
2613
|
+
'opacity': '1',
|
|
2614
|
+
'background-color': '#fff'
|
|
2467
2615
|
}
|
|
2468
2616
|
},
|
|
2469
2617
|
|
|
@@ -2722,9 +2870,10 @@ export const defaultStyles = {
|
|
|
2722
2870
|
*/
|
|
2723
2871
|
skeleton: {
|
|
2724
2872
|
'.bw-skeleton': {
|
|
2725
|
-
'background
|
|
2873
|
+
'background': 'linear-gradient(90deg, #dde0e4 25%, #eceef1 37%, #dde0e4 63%)',
|
|
2874
|
+
'background-size': '400% 100%',
|
|
2726
2875
|
'border-radius': '4px',
|
|
2727
|
-
'animation': 'bw-skeleton-
|
|
2876
|
+
'animation': 'bw-skeleton-shimmer 1.4s ease infinite'
|
|
2728
2877
|
},
|
|
2729
2878
|
'.bw-skeleton-text': {
|
|
2730
2879
|
'height': '1em',
|
|
@@ -2740,10 +2889,9 @@ export const defaultStyles = {
|
|
|
2740
2889
|
'display': 'flex',
|
|
2741
2890
|
'flex-direction': 'column'
|
|
2742
2891
|
},
|
|
2743
|
-
'@keyframes bw-skeleton-
|
|
2744
|
-
'0%': { '
|
|
2745
|
-
'
|
|
2746
|
-
'100%': { 'opacity': '1' }
|
|
2892
|
+
'@keyframes bw-skeleton-shimmer': {
|
|
2893
|
+
'0%': { 'background-position': '100% 50%' },
|
|
2894
|
+
'100%': { 'background-position': '0 50%' }
|
|
2747
2895
|
}
|
|
2748
2896
|
},
|
|
2749
2897
|
|
|
@@ -3311,6 +3459,8 @@ export function getStructuralStyles() {
|
|
|
3311
3459
|
rules['.bw-tab-content'] = { 'padding': '1.25rem 0' };
|
|
3312
3460
|
rules['.bw-tab-pane'] = { 'display': 'none' };
|
|
3313
3461
|
rules['.bw-tab-pane.active'] = { 'display': 'block' };
|
|
3462
|
+
rules['.bw-nav-scrollable'] = { 'flex-wrap': 'nowrap', 'overflow-x': 'auto', '-webkit-overflow-scrolling': 'touch', 'scrollbar-width': 'none' };
|
|
3463
|
+
rules['.bw-nav-scrollable .bw-nav-link'] = { 'white-space': 'nowrap' };
|
|
3314
3464
|
|
|
3315
3465
|
// List groups (structural)
|
|
3316
3466
|
rules['.bw-list-group'] = { 'display': 'flex', 'flex-direction': 'column', 'padding-left': '0', 'margin-bottom': '0', 'border-radius': '0.375rem' };
|
|
@@ -3477,6 +3627,29 @@ export function getStructuralStyles() {
|
|
|
3477
3627
|
rules['.bw-modal-body'] = { 'position': 'relative', 'flex': '1 1 auto', 'padding': '1.5rem' };
|
|
3478
3628
|
rules['.bw-modal-footer'] = { 'display': 'flex', 'flex-wrap': 'wrap', 'align-items': 'center', 'justify-content': 'flex-end', 'padding': '0.75rem 1.5rem', 'gap': '0.5rem' };
|
|
3479
3629
|
|
|
3630
|
+
// Carousel (structural)
|
|
3631
|
+
rules['.bw-carousel'] = { 'position': 'relative', 'overflow': 'hidden', 'border-radius': '8px' };
|
|
3632
|
+
rules['.bw-carousel-track'] = { 'display': 'flex', 'transition': 'transform 0.4s ease', 'height': '100%' };
|
|
3633
|
+
rules['.bw-carousel-slide'] = { 'min-width': '100%', 'flex-shrink': '0', 'overflow': 'hidden', 'position': 'relative', 'display': 'flex', 'align-items': 'center', 'justify-content': 'center' };
|
|
3634
|
+
rules['.bw-carousel-slide img'] = { 'width': '100%', 'height': '100%', 'object-fit': 'cover' };
|
|
3635
|
+
rules['.bw-carousel-caption'] = { 'position': 'absolute', 'bottom': '0', 'left': '0', 'right': '0', 'padding': '0.75rem 1rem' };
|
|
3636
|
+
rules['.bw-carousel-control'] = {
|
|
3637
|
+
'position': 'absolute', 'top': '50%', 'transform': 'translateY(-50%)', 'width': '40px', 'height': '40px',
|
|
3638
|
+
'border': 'none', 'border-radius': '50%', 'cursor': 'pointer', 'display': 'flex', 'align-items': 'center',
|
|
3639
|
+
'justify-content': 'center', 'z-index': '2', 'padding': '0', 'transition': 'background-color 0.2s ease'
|
|
3640
|
+
};
|
|
3641
|
+
rules['.bw-carousel-control img'] = { 'width': '20px', 'height': '20px', 'pointer-events': 'none' };
|
|
3642
|
+
rules['.bw-carousel-control-prev'] = { 'left': '10px' };
|
|
3643
|
+
rules['.bw-carousel-control-next'] = { 'right': '10px' };
|
|
3644
|
+
rules['.bw-carousel-indicators'] = {
|
|
3645
|
+
'position': 'absolute', 'bottom': '12px', 'left': '50%', 'transform': 'translateX(-50%)',
|
|
3646
|
+
'display': 'flex', 'gap': '6px', 'z-index': '2'
|
|
3647
|
+
};
|
|
3648
|
+
rules['.bw-carousel-indicator'] = {
|
|
3649
|
+
'width': '10px', 'height': '10px', 'border-radius': '50%', 'border': '2px solid transparent',
|
|
3650
|
+
'padding': '0', 'cursor': 'pointer', 'transition': 'opacity 0.2s ease, background-color 0.2s ease'
|
|
3651
|
+
};
|
|
3652
|
+
|
|
3480
3653
|
// Toast (structural)
|
|
3481
3654
|
rules['.bw-toast-container'] = {
|
|
3482
3655
|
'position': 'fixed', 'z-index': '1080', 'pointer-events': 'none',
|
|
@@ -3526,12 +3699,12 @@ export function getStructuralStyles() {
|
|
|
3526
3699
|
rules['.bw-form-switch .bw-switch-input:disabled'] = { 'opacity': '0.5', 'cursor': 'not-allowed' };
|
|
3527
3700
|
|
|
3528
3701
|
// Skeleton (structural)
|
|
3529
|
-
rules['.bw-skeleton'] = { 'border-radius': '4px', 'animation': 'bw-skeleton-
|
|
3702
|
+
rules['.bw-skeleton'] = { 'border-radius': '4px', 'background-size': '400% 100%', 'animation': 'bw-skeleton-shimmer 1.4s ease infinite' };
|
|
3530
3703
|
rules['.bw-skeleton-text'] = { 'height': '1em', 'margin-bottom': '0.5rem' };
|
|
3531
3704
|
rules['.bw-skeleton-circle'] = { 'border-radius': '50%' };
|
|
3532
3705
|
rules['.bw-skeleton-rect'] = { 'border-radius': '8px' };
|
|
3533
3706
|
rules['.bw-skeleton-group'] = { 'display': 'flex', 'flex-direction': 'column' };
|
|
3534
|
-
rules['@keyframes bw-skeleton-
|
|
3707
|
+
rules['@keyframes bw-skeleton-shimmer'] = { '0%': { 'background-position': '100% 50%' }, '100%': { 'background-position': '0 50%' } };
|
|
3535
3708
|
|
|
3536
3709
|
// Avatar (structural)
|
|
3537
3710
|
rules['.bw-avatar'] = {
|
|
@@ -3742,6 +3915,7 @@ export function getAllStyles() {
|
|
|
3742
3915
|
defaultStyles.codeDemo,
|
|
3743
3916
|
defaultStyles.buttonGroup,
|
|
3744
3917
|
defaultStyles.accordion,
|
|
3918
|
+
defaultStyles.carousel,
|
|
3745
3919
|
defaultStyles.modal,
|
|
3746
3920
|
defaultStyles.toast,
|
|
3747
3921
|
defaultStyles.dropdown,
|
|
@@ -3948,12 +4122,31 @@ export function generateDarkModeCSS(palette) {
|
|
|
3948
4122
|
'.bw-dark .bw-accordion-button': {
|
|
3949
4123
|
'color': textColor
|
|
3950
4124
|
},
|
|
4125
|
+
'.bw-dark .bw-accordion-button:not(.bw-collapsed)': {
|
|
4126
|
+
'color': '#7dd3e0',
|
|
4127
|
+
'background-color': 'rgba(125, 211, 224, 0.1)'
|
|
4128
|
+
},
|
|
3951
4129
|
'.bw-dark .bw-accordion-button:hover': {
|
|
3952
4130
|
'background-color': bodyBg
|
|
3953
4131
|
},
|
|
4132
|
+
'.bw-dark .bw-accordion-button:not(.bw-collapsed):hover': {
|
|
4133
|
+
'background-color': 'rgba(125, 211, 224, 0.15)'
|
|
4134
|
+
},
|
|
4135
|
+
'.bw-dark .bw-accordion-button:focus-visible': {
|
|
4136
|
+
'box-shadow': '0 0 0 0.2rem rgba(125, 211, 224, 0.3)'
|
|
4137
|
+
},
|
|
3954
4138
|
'.bw-dark .bw-accordion-body': {
|
|
3955
4139
|
'border-top-color': borderColor
|
|
3956
4140
|
},
|
|
4141
|
+
'.bw-dark .bw-carousel': {
|
|
4142
|
+
'background-color': bodyBg
|
|
4143
|
+
},
|
|
4144
|
+
'.bw-dark .bw-carousel-control': {
|
|
4145
|
+
'background-color': 'rgba(255,255,255,0.15)'
|
|
4146
|
+
},
|
|
4147
|
+
'.bw-dark .bw-carousel-control:hover': {
|
|
4148
|
+
'background-color': 'rgba(255,255,255,0.25)'
|
|
4149
|
+
},
|
|
3957
4150
|
'.bw-dark .bw-modal-content': {
|
|
3958
4151
|
'background-color': surfaceBg,
|
|
3959
4152
|
'border-color': borderColor
|
|
@@ -3989,7 +4182,7 @@ export function generateDarkModeCSS(palette) {
|
|
|
3989
4182
|
'border-top-color': borderColor
|
|
3990
4183
|
},
|
|
3991
4184
|
'.bw-dark .bw-skeleton': {
|
|
3992
|
-
'background
|
|
4185
|
+
'background': 'linear-gradient(90deg, ' + borderColor + ' 25%, ' + surfaceBg + ' 37%, ' + borderColor + ' 63%)'
|
|
3993
4186
|
},
|
|
3994
4187
|
'.bw-dark h1, .bw-dark h2, .bw-dark h3, .bw-dark h4, .bw-dark h5, .bw-dark h6': {
|
|
3995
4188
|
'color': textColor
|
package/src/bitwrench.js
CHANGED
|
@@ -426,6 +426,26 @@ bw.escapeHTML = function(str) {
|
|
|
426
426
|
return str.replace(/[&<>"'/]/g, (char) => escapeMap[char]);
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
+
/**
|
|
430
|
+
* Mark a string as raw HTML so it will not be escaped by bw.html() or bw.createDOM().
|
|
431
|
+
*
|
|
432
|
+
* By default, bitwrench escapes all text content to prevent XSS. Use bw.raw()
|
|
433
|
+
* when you need to embed pre-sanitized HTML, entities, or inline markup.
|
|
434
|
+
*
|
|
435
|
+
* @param {string} str - HTML string to mark as raw
|
|
436
|
+
* @returns {Object} Marked object recognized by bw.html() and bw.createDOM()
|
|
437
|
+
* @category DOM Generation
|
|
438
|
+
* @see bw.escapeHTML
|
|
439
|
+
* @see bw.html
|
|
440
|
+
* @example
|
|
441
|
+
* bw.raw('Hello — World')
|
|
442
|
+
* // Used in TACO content:
|
|
443
|
+
* { t: 'p', c: bw.raw('Price: <strong>$9.99</strong>') }
|
|
444
|
+
*/
|
|
445
|
+
bw.raw = function(str) {
|
|
446
|
+
return { __bw_raw: true, v: String(str) };
|
|
447
|
+
};
|
|
448
|
+
|
|
429
449
|
/**
|
|
430
450
|
* Normalize CSS class names by converting underscores to hyphens for bw-prefixed classes.
|
|
431
451
|
*
|
|
@@ -477,6 +497,11 @@ bw.html = function(taco, options = {}) {
|
|
|
477
497
|
return taco.map(t => bw.html(t, options)).join('');
|
|
478
498
|
}
|
|
479
499
|
|
|
500
|
+
// Handle bw.raw() marked content
|
|
501
|
+
if (taco && taco.__bw_raw) {
|
|
502
|
+
return taco.v;
|
|
503
|
+
}
|
|
504
|
+
|
|
480
505
|
// Handle primitives and non-TACO objects
|
|
481
506
|
if (typeof taco !== 'object' || !taco.t) {
|
|
482
507
|
return options.raw ? String(taco) : bw.escapeHTML(String(taco));
|
|
@@ -577,12 +602,21 @@ bw.createDOM = function(taco, options = {}) {
|
|
|
577
602
|
|
|
578
603
|
// Handle null/undefined
|
|
579
604
|
if (taco == null) return document.createTextNode('');
|
|
580
|
-
|
|
605
|
+
|
|
606
|
+
// Handle bw.raw() marked content — inject as HTML
|
|
607
|
+
if (taco && taco.__bw_raw) {
|
|
608
|
+
var frag = document.createDocumentFragment();
|
|
609
|
+
var tmp = document.createElement('span');
|
|
610
|
+
tmp.innerHTML = taco.v;
|
|
611
|
+
while (tmp.firstChild) frag.appendChild(tmp.firstChild);
|
|
612
|
+
return frag;
|
|
613
|
+
}
|
|
614
|
+
|
|
581
615
|
// Handle text nodes
|
|
582
616
|
if (typeof taco !== 'object' || !taco.t) {
|
|
583
617
|
return document.createTextNode(String(taco));
|
|
584
618
|
}
|
|
585
|
-
|
|
619
|
+
|
|
586
620
|
const { t: tag, a: attrs = {}, c: content, o: opts = {} } = taco;
|
|
587
621
|
|
|
588
622
|
// Create element
|
|
@@ -647,6 +681,9 @@ bw.createDOM = function(taco, options = {}) {
|
|
|
647
681
|
}
|
|
648
682
|
}
|
|
649
683
|
});
|
|
684
|
+
} else if (typeof content === 'object' && content.__bw_raw) {
|
|
685
|
+
// Raw HTML content — inject via innerHTML
|
|
686
|
+
el.innerHTML = content.v;
|
|
650
687
|
} else if (typeof content === 'object' && content.t) {
|
|
651
688
|
var childEl = bw.createDOM(content, options);
|
|
652
689
|
el.appendChild(childEl);
|
package/src/generate-css.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Creates class-based CSS to prevent collisions with other frameworks
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { getAllStyles } from './bitwrench-styles.js';
|
|
6
|
+
import { getAllStyles, getStructuralStyles } from './bitwrench-styles.js';
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import path from 'path';
|
|
9
9
|
|
|
@@ -92,8 +92,25 @@ function processRules(rules, indent = '') {
|
|
|
92
92
|
return css;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
//
|
|
96
|
-
|
|
95
|
+
// Deep-merge themed + structural: structural properties override themed
|
|
96
|
+
// per-property within the same selector (not overwriting entire selectors)
|
|
97
|
+
function deepMergeStyles(base, overrides) {
|
|
98
|
+
const merged = Object.assign({}, base);
|
|
99
|
+
for (const [selector, rules] of Object.entries(overrides)) {
|
|
100
|
+
if (merged[selector] && typeof merged[selector] === 'object' && typeof rules === 'object') {
|
|
101
|
+
merged[selector] = Object.assign({}, merged[selector], rules);
|
|
102
|
+
} else {
|
|
103
|
+
merged[selector] = rules;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return merged;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Generate the CSS — merge themed styles + structural styles
|
|
110
|
+
const themed = getAllStyles();
|
|
111
|
+
const structural = getStructuralStyles();
|
|
112
|
+
// Structural properties take precedence; themed properties preserved where structural doesn't override
|
|
113
|
+
const styles = deepMergeStyles(themed, structural);
|
|
97
114
|
const css = stylesToCSS(styles);
|
|
98
115
|
|
|
99
116
|
// Add additional bitwrench-specific styles
|
package/src/version.js
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* DO NOT EDIT DIRECTLY - Use npm run generate-version
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export const VERSION = '2.0.
|
|
6
|
+
export const VERSION = '2.0.13';
|
|
7
7
|
export const VERSION_INFO = {
|
|
8
|
-
version: '2.0.
|
|
8
|
+
version: '2.0.13',
|
|
9
9
|
name: 'bitwrench',
|
|
10
10
|
description: 'A library for javascript UI functions.',
|
|
11
11
|
license: 'BSD-2-Clause',
|
|
12
12
|
homepage: 'https://deftio.github.com/bitwrench/pages',
|
|
13
13
|
repository: 'git+https://github.com/deftio/bitwrench.git',
|
|
14
14
|
author: 'manu a. chatterjee <deftio@deftio.com> (https://deftio.com/)',
|
|
15
|
-
buildDate: '2026-03-
|
|
15
|
+
buildDate: '2026-03-07T22:35:06.056Z'
|
|
16
16
|
};
|