@leonardaustin/ui 0.20.0 → 0.22.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.
package/dist/styles.css CHANGED
@@ -2557,3 +2557,445 @@ select:disabled + .ui-select-placeholder {
2557
2557
  transition: none;
2558
2558
  }
2559
2559
  }
2560
+
2561
+ /* AudioPlayer: native-style controls with a transparent seek input. */
2562
+ /* Local reset: a consumer without Tailwind's preflight still gets correct controls. */
2563
+ :where(.ui-audio, .ui-audio *, .ui-audio *::before, .ui-audio *::after) {
2564
+ box-sizing: border-box;
2565
+ }
2566
+ :where(.ui-audio button, .ui-audio select, .ui-audio input) {
2567
+ font: inherit;
2568
+ color: inherit;
2569
+ margin: 0;
2570
+ }
2571
+ :where(.ui-audio button) {
2572
+ border: 0;
2573
+ background: none;
2574
+ padding: 0;
2575
+ }
2576
+ :where(.ui-audio p) {
2577
+ margin: 0;
2578
+ }
2579
+
2580
+ .ui-audio {
2581
+ display: flex;
2582
+ flex-direction: column;
2583
+ gap: 8px;
2584
+ }
2585
+ .ui-audio-row {
2586
+ display: flex;
2587
+ align-items: center;
2588
+ }
2589
+ .ui-audio-card {
2590
+ padding: 0.75rem;
2591
+ border: 1px solid var(--border);
2592
+ border-radius: var(--ui-radius-md);
2593
+ background: var(--bg-secondary);
2594
+ }
2595
+ .ui-audio-title {
2596
+ font-size: 0.8125rem;
2597
+ font-weight: 500;
2598
+ color: var(--text-primary);
2599
+ }
2600
+ .ui-audio audio {
2601
+ display: none;
2602
+ }
2603
+
2604
+ /* Progress: drawn track, fill and thumb under a transparent native range */
2605
+ .ui-audio-progress {
2606
+ flex: 1 1 0%;
2607
+ min-width: 0;
2608
+ }
2609
+ .ui-audio-track {
2610
+ position: relative;
2611
+ height: 4px;
2612
+ border-radius: 9999px;
2613
+ background: var(--ui-audio-rest);
2614
+ }
2615
+ .ui-audio-track:has(.ui-audio-seek:focus-visible) {
2616
+ outline: 2px solid var(--accent);
2617
+ outline-offset: 2px;
2618
+ }
2619
+ .ui-audio-fill,
2620
+ .ui-audio-thumb {
2621
+ position: absolute;
2622
+ pointer-events: none;
2623
+ background: var(--ui-audio-fill);
2624
+ }
2625
+ .ui-audio-fill {
2626
+ top: 0;
2627
+ left: 0;
2628
+ height: 100%;
2629
+ border-radius: 9999px;
2630
+ transition: none;
2631
+ }
2632
+ .ui-audio-thumb {
2633
+ top: 50%;
2634
+ width: var(--ui-audio-thumb);
2635
+ height: var(--ui-audio-thumb);
2636
+ border-radius: 9999px;
2637
+ transform: translateY(-50%);
2638
+ opacity: 0;
2639
+ transition: opacity 100ms;
2640
+ }
2641
+ .ui-audio-track:hover .ui-audio-seek:not(:disabled) ~ .ui-audio-thumb,
2642
+ .ui-audio-seek:is(:focus-visible, :active):not(:disabled) ~ .ui-audio-thumb {
2643
+ opacity: 1;
2644
+ }
2645
+ .ui-audio-seek {
2646
+ position: absolute;
2647
+ z-index: 1;
2648
+ top: -0.5rem;
2649
+ left: calc(var(--ui-audio-thumb) / -2);
2650
+ width: calc(100% + var(--ui-audio-thumb));
2651
+ height: 1.5rem;
2652
+ margin: 0;
2653
+ padding: 0;
2654
+ border: 0;
2655
+ appearance: none;
2656
+ background: transparent;
2657
+ cursor: pointer;
2658
+ opacity: 0;
2659
+ }
2660
+ .ui-audio-seek::-webkit-slider-thumb {
2661
+ width: var(--ui-audio-thumb);
2662
+ height: var(--ui-audio-thumb);
2663
+ appearance: none;
2664
+ }
2665
+ .ui-audio-seek::-moz-range-thumb {
2666
+ width: var(--ui-audio-thumb);
2667
+ height: var(--ui-audio-thumb);
2668
+ border: 0;
2669
+ }
2670
+ .ui-audio-seek:focus-visible {
2671
+ outline: none;
2672
+ }
2673
+ .ui-audio-seek:disabled {
2674
+ cursor: not-allowed;
2675
+ }
2676
+
2677
+ .ui-audio-play,
2678
+ .ui-audio-icon-btn {
2679
+ display: inline-flex;
2680
+ flex-shrink: 0;
2681
+ align-items: center;
2682
+ justify-content: center;
2683
+ cursor: pointer;
2684
+ text-decoration: none;
2685
+ }
2686
+ .ui-audio-icon-btn:disabled {
2687
+ cursor: not-allowed;
2688
+ opacity: 0.5;
2689
+ }
2690
+ .ui-audio-play:disabled {
2691
+ cursor: not-allowed;
2692
+ }
2693
+ .ui-audio-select {
2694
+ flex-shrink: 0;
2695
+ }
2696
+ .ui-audio-select select {
2697
+ cursor: pointer;
2698
+ font-family: inherit;
2699
+ }
2700
+ .ui-audio-select select:disabled {
2701
+ cursor: not-allowed;
2702
+ opacity: 0.4;
2703
+ }
2704
+ .ui-audio-icon-btn:focus-visible,
2705
+ .ui-audio-play:focus-visible,
2706
+ .ui-audio-select select:focus-visible,
2707
+ .ui-audio-volume-slider:focus-visible {
2708
+ outline: 2px solid var(--accent);
2709
+ outline-offset: 2px;
2710
+ }
2711
+ .ui-audio-mute {
2712
+ display: inline-flex;
2713
+ flex-shrink: 0;
2714
+ }
2715
+ /* States */
2716
+ .ui-audio-status {
2717
+ display: flex;
2718
+ align-items: center;
2719
+ gap: 0.5rem;
2720
+ font-size: 0.75rem;
2721
+ color: var(--text-secondary);
2722
+ }
2723
+ .ui-audio-spinner {
2724
+ width: 0.875rem;
2725
+ height: 0.875rem;
2726
+ border-radius: 9999px;
2727
+ border: 2px solid var(--border-strong);
2728
+ border-top-color: var(--accent);
2729
+ animation: ui-audio-spin 1s linear infinite;
2730
+ }
2731
+ .ui-audio-error {
2732
+ padding: 1rem;
2733
+ text-align: center;
2734
+ font-size: 0.875rem;
2735
+ line-height: 1.25rem;
2736
+ color: var(--red);
2737
+ background: var(--red-muted);
2738
+ border: 1px solid var(--red);
2739
+ border-radius: var(--ui-radius-lg);
2740
+ }
2741
+ @keyframes ui-audio-spin {
2742
+ to {
2743
+ transform: rotate(360deg);
2744
+ }
2745
+ }
2746
+ .ui-audio-clock {
2747
+ flex-shrink: 0;
2748
+ white-space: nowrap;
2749
+ font-variant-numeric: tabular-nums;
2750
+ }
2751
+ .ui-audio-pill {
2752
+ --ui-audio-thumb: 12px;
2753
+ --ui-audio-bg: light-dark(#f1f3f4, #38393a);
2754
+ --ui-audio-fg: light-dark(#000, #fff);
2755
+ --ui-audio-fill: light-dark(#0b0b0b, #f5f5f5);
2756
+ --ui-audio-rest: light-dark(#585959, #b5b6b6);
2757
+ --ui-audio-hover: light-dark(rgb(0 0 0 / 0.1), rgb(255 255 255 / 0.15));
2758
+ gap: 8px;
2759
+ }
2760
+ .ui-audio-pill .ui-audio-row {
2761
+ flex-wrap: nowrap;
2762
+ gap: 0;
2763
+ height: var(--ui-audio-height, 54px);
2764
+ padding: 0 11px 0 9.5px;
2765
+ border-radius: 9999px;
2766
+ background: var(--ui-audio-bg);
2767
+ color: var(--ui-audio-fg);
2768
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
2769
+ }
2770
+ .ui-audio-pill .ui-audio-clock {
2771
+ font-size: 14px;
2772
+ line-height: 16px;
2773
+ color: var(--ui-audio-fg);
2774
+ font-variant-numeric: normal;
2775
+ margin-left: 5px;
2776
+ }
2777
+ .ui-audio-pill .ui-audio-clock + .ui-audio-clock {
2778
+ margin-left: 0;
2779
+ }
2780
+ .ui-audio-pill .ui-audio-progress {
2781
+ min-width: 0;
2782
+ margin: 0 16px 0 16px;
2783
+ }
2784
+ .ui-audio-pill .ui-audio-track {
2785
+ height: 4px;
2786
+ border-radius: 2px;
2787
+ background: var(--ui-audio-rest);
2788
+ }
2789
+ .ui-audio-pill .ui-audio-fill {
2790
+ border-radius: 2px;
2791
+ background: var(--ui-audio-fill);
2792
+ transition: none;
2793
+ }
2794
+ .ui-audio-pill .ui-audio-thumb {
2795
+ background: var(--ui-audio-fill);
2796
+ transition: none;
2797
+ }
2798
+ .ui-audio-pill .ui-audio-play,
2799
+ .ui-audio-pill .ui-audio-icon-btn,
2800
+ .ui-audio-pill .ui-audio-select select {
2801
+ width: 32px;
2802
+ height: 32px;
2803
+ border-radius: 9999px;
2804
+ background: transparent;
2805
+ color: var(--ui-audio-fg);
2806
+ }
2807
+ .ui-audio-pill .ui-audio-play:hover:not(:disabled),
2808
+ .ui-audio-pill .ui-audio-icon-btn:hover:not(:disabled),
2809
+ .ui-audio-pill .ui-audio-select select:hover:not(:disabled) {
2810
+ background: var(--ui-audio-hover);
2811
+ }
2812
+ .ui-audio-pill .ui-audio-play:disabled {
2813
+ background: transparent;
2814
+ opacity: 0.4;
2815
+ }
2816
+ .ui-audio-pill .ui-audio-icon-btn {
2817
+ color: var(--ui-audio-fg);
2818
+ }
2819
+ .ui-audio-pill .ui-audio-select select {
2820
+ appearance: none;
2821
+ width: 32px;
2822
+ padding: 0;
2823
+ border: 0;
2824
+ text-align: center;
2825
+ text-align-last: center;
2826
+ font-size: 12px;
2827
+ letter-spacing: -0.02em;
2828
+ font-family: inherit;
2829
+ line-height: 32px;
2830
+ }
2831
+
2832
+ .ui-audio-glass {
2833
+ --ui-audio-thumb: 9px;
2834
+ --ui-audio-fg: #fff;
2835
+ --ui-audio-hover: rgb(255 255 255 / 0.18);
2836
+ gap: 8px;
2837
+ }
2838
+ .ui-audio-glass .ui-audio-row {
2839
+ flex-wrap: nowrap;
2840
+ gap: 16px;
2841
+ height: var(--ui-audio-height, 31px);
2842
+ padding: 0 16px 0 15.5px;
2843
+ border-radius: 6px;
2844
+ /* Darker in light schemes so white text keeps about 6:1 contrast. */
2845
+ background: light-dark(rgb(0 0 0 / 0.62), rgb(0 0 0 / 0.4));
2846
+ color: var(--ui-audio-fg);
2847
+ font-family:
2848
+ system-ui,
2849
+ -apple-system,
2850
+ "Helvetica Neue",
2851
+ Arial,
2852
+ sans-serif;
2853
+ }
2854
+ .ui-audio-glass .ui-audio-clock {
2855
+ font-size: 13px;
2856
+ line-height: 16px;
2857
+ font-weight: 500;
2858
+ letter-spacing: -0.6px;
2859
+ color: var(--ui-audio-fg);
2860
+ }
2861
+
2862
+ .ui-audio-glass .ui-audio-skip,
2863
+ .ui-audio-glass .ui-audio-play {
2864
+ margin: 0 -2.6px;
2865
+ }
2866
+ .ui-audio-glass
2867
+ .ui-audio-icon-btn:not(.ui-audio-skip)
2868
+ svg[viewBox="0 0 22 16"] {
2869
+ margin: 0 -2px;
2870
+ }
2871
+ .ui-audio-glass .ui-audio-select {
2872
+ margin: 0 -7px;
2873
+ }
2874
+ .ui-audio-glass .ui-audio-progress {
2875
+ min-width: 0;
2876
+ }
2877
+ .ui-audio-glass .ui-audio-clock + .ui-audio-progress {
2878
+ margin-left: -10px;
2879
+ }
2880
+ .ui-audio-glass .ui-audio-progress + .ui-audio-clock {
2881
+ margin-left: -10px;
2882
+ }
2883
+ .ui-audio-glass .ui-audio-track {
2884
+ height: 4.5px;
2885
+ border-radius: 3px;
2886
+ background: rgb(255 255 255 / 0.1);
2887
+ }
2888
+ .ui-audio-glass .ui-audio-fill {
2889
+ border-radius: 3px;
2890
+ background: rgb(255 255 255 / 0.42);
2891
+ transition: none;
2892
+ }
2893
+ .ui-audio-glass .ui-audio-thumb {
2894
+ background: #fff;
2895
+ opacity: 1;
2896
+ transition: none;
2897
+ }
2898
+ .ui-audio-glass .ui-audio-play,
2899
+ .ui-audio-glass .ui-audio-icon-btn,
2900
+ .ui-audio-glass .ui-audio-select select {
2901
+ width: auto;
2902
+ height: auto;
2903
+ min-width: 0;
2904
+ padding: 0;
2905
+ border-radius: 3px;
2906
+ background: transparent;
2907
+ color: var(--ui-audio-fg);
2908
+ display: inline-flex;
2909
+ align-items: center;
2910
+ justify-content: center;
2911
+ }
2912
+ .ui-audio-glass .ui-audio-play:hover:not(:disabled),
2913
+ .ui-audio-glass .ui-audio-icon-btn:hover:not(:disabled),
2914
+ .ui-audio-glass .ui-audio-select select:hover:not(:disabled) {
2915
+ background: transparent;
2916
+ opacity: 0.7;
2917
+ }
2918
+ .ui-audio-glass .ui-audio-play:disabled {
2919
+ background: transparent;
2920
+ opacity: 0.4;
2921
+ }
2922
+ .ui-audio-glass .ui-audio-icon-btn {
2923
+ color: var(--ui-audio-fg);
2924
+ }
2925
+ .ui-audio-glass .ui-audio-select select {
2926
+ appearance: none;
2927
+ border: 0;
2928
+ width: 30px;
2929
+ font-size: 12px;
2930
+ letter-spacing: -0.02em;
2931
+ font-weight: 500;
2932
+ font-family: inherit;
2933
+ text-align: center;
2934
+ text-align-last: center;
2935
+ }
2936
+
2937
+ .ui-audio-pill .ui-audio-track:has(.ui-audio-seek:focus-visible),
2938
+ .ui-audio-glass .ui-audio-track:has(.ui-audio-seek:focus-visible) {
2939
+ outline-offset: 3px;
2940
+ }
2941
+ .ui-audio-pill .ui-audio-select option,
2942
+ .ui-audio-glass .ui-audio-select option {
2943
+ color: initial;
2944
+ }
2945
+
2946
+ /* Collapsed rather than hidden so Tab can reach the native volume slider. */
2947
+ .ui-audio-volume {
2948
+ display: inline-flex;
2949
+ align-items: center;
2950
+ flex-shrink: 0;
2951
+ color: var(--ui-audio-fg);
2952
+ }
2953
+ .ui-audio-volume-popup {
2954
+ width: 0;
2955
+ overflow: hidden;
2956
+ display: flex;
2957
+ align-items: center;
2958
+ transition: width 100ms;
2959
+ }
2960
+ .ui-audio-volume:hover .ui-audio-volume-popup,
2961
+ .ui-audio-volume:focus-within .ui-audio-volume-popup {
2962
+ width: 72px;
2963
+ }
2964
+ .ui-audio-volume-slider {
2965
+ appearance: none;
2966
+ flex-shrink: 0;
2967
+ width: 60px;
2968
+ height: 4px;
2969
+ margin: 6px;
2970
+ padding: 0;
2971
+ border: 0;
2972
+ border-radius: 2px;
2973
+ background: var(--ui-audio-fg);
2974
+ cursor: pointer;
2975
+ }
2976
+ .ui-audio-volume-slider::-webkit-slider-thumb {
2977
+ appearance: none;
2978
+ width: 9px;
2979
+ height: 9px;
2980
+ border: 0;
2981
+ border-radius: 50%;
2982
+ background: var(--ui-audio-fg);
2983
+ }
2984
+ .ui-audio-volume-slider::-moz-range-thumb {
2985
+ width: 9px;
2986
+ height: 9px;
2987
+ border: 0;
2988
+ border-radius: 50%;
2989
+ background: var(--ui-audio-fg);
2990
+ }
2991
+ @media (prefers-reduced-motion: reduce) {
2992
+ .ui-audio-fill,
2993
+ .ui-audio-thumb,
2994
+ .ui-audio-play,
2995
+ .ui-audio-icon-btn,
2996
+ .ui-audio-spinner,
2997
+ .ui-audio-volume-popup {
2998
+ transition: none;
2999
+ animation: none;
3000
+ }
3001
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonardaustin/ui",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "description": "Reusable React component library and application shell for Leonard Austin projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",