loseta 0.6.0 → 0.8.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,7 +1,7 @@
1
1
  {
2
2
  "$schema": "./schema.json",
3
3
  "name": "loseta",
4
- "version": "0.6.0",
4
+ "version": "0.8.0",
5
5
  "styles": [
6
6
  {
7
7
  "name": "nova",
@@ -244,6 +244,30 @@
244
244
  }
245
245
  ]
246
246
  },
247
+ {
248
+ "name": "listbox",
249
+ "type": "primitive",
250
+ "status": "experimental",
251
+ "title": "Listbox primitive",
252
+ "description": "Shared listbox option, group, empty and indicator rules used by select, combobox and command.",
253
+ "root": [
254
+ "[role='listbox']"
255
+ ],
256
+ "files": [
257
+ {
258
+ "path": "primitives/listbox.css",
259
+ "target": "primitives/listbox.css",
260
+ "role": "base",
261
+ "layer": "loseta.components"
262
+ },
263
+ {
264
+ "path": "styles/nova/primitives/listbox.css",
265
+ "target": "styles/nova/primitives/listbox.css",
266
+ "role": "style",
267
+ "layer": "loseta.style"
268
+ }
269
+ ]
270
+ },
247
271
  {
248
272
  "name": "popover-primitive",
249
273
  "type": "primitive",
@@ -2658,6 +2682,265 @@
2658
2682
  "examples": [
2659
2683
  "examples/sheet.html"
2660
2684
  ]
2685
+ },
2686
+ {
2687
+ "name": "collapsible",
2688
+ "type": "component",
2689
+ "status": "experimental",
2690
+ "title": "Collapsible",
2691
+ "description": "A native disclosure that reveals or hides content.",
2692
+ "docs": "/docs/components/collapsible",
2693
+ "root": [
2694
+ ".collapsible"
2695
+ ],
2696
+ "registryDependencies": [],
2697
+ "optionalDependencies": [],
2698
+ "files": [
2699
+ {
2700
+ "path": "components/collapsible.css",
2701
+ "target": "components/collapsible.css",
2702
+ "role": "base",
2703
+ "layer": "loseta.components"
2704
+ },
2705
+ {
2706
+ "path": "styles/nova/collapsible.css",
2707
+ "target": "styles/nova/collapsible.css",
2708
+ "role": "style",
2709
+ "layer": "loseta.style"
2710
+ }
2711
+ ],
2712
+ "examples": [
2713
+ "examples/collapsible.html"
2714
+ ]
2715
+ },
2716
+ {
2717
+ "name": "input-group",
2718
+ "type": "component",
2719
+ "status": "experimental",
2720
+ "title": "Input Group",
2721
+ "description": "Composes inputs, textareas and addons into one control surface.",
2722
+ "docs": "/docs/components/input-group",
2723
+ "root": [
2724
+ ".input-group"
2725
+ ],
2726
+ "registryDependencies": [],
2727
+ "optionalDependencies": [
2728
+ "input",
2729
+ "textarea",
2730
+ "button"
2731
+ ],
2732
+ "files": [
2733
+ {
2734
+ "path": "components/input-group.css",
2735
+ "target": "components/input-group.css",
2736
+ "role": "base",
2737
+ "layer": "loseta.components"
2738
+ },
2739
+ {
2740
+ "path": "styles/nova/input-group.css",
2741
+ "target": "styles/nova/input-group.css",
2742
+ "role": "style",
2743
+ "layer": "loseta.style"
2744
+ }
2745
+ ],
2746
+ "examples": [
2747
+ "examples/input-group.html"
2748
+ ]
2749
+ },
2750
+ {
2751
+ "name": "input-otp",
2752
+ "type": "component",
2753
+ "status": "experimental",
2754
+ "title": "Input OTP",
2755
+ "description": "A single native input for one-time codes.",
2756
+ "docs": "/docs/components/input-otp",
2757
+ "root": [
2758
+ ".input-otp"
2759
+ ],
2760
+ "registryDependencies": [],
2761
+ "optionalDependencies": [],
2762
+ "files": [
2763
+ {
2764
+ "path": "components/input-otp.css",
2765
+ "target": "components/input-otp.css",
2766
+ "role": "base",
2767
+ "layer": "loseta.components"
2768
+ },
2769
+ {
2770
+ "path": "styles/nova/input-otp.css",
2771
+ "target": "styles/nova/input-otp.css",
2772
+ "role": "style",
2773
+ "layer": "loseta.style"
2774
+ }
2775
+ ],
2776
+ "examples": [
2777
+ "examples/input-otp.html"
2778
+ ]
2779
+ },
2780
+ {
2781
+ "name": "scroll-area",
2782
+ "type": "component",
2783
+ "status": "experimental",
2784
+ "title": "Scroll Area",
2785
+ "description": "A scroll container with native styled scrollbars.",
2786
+ "docs": "/docs/components/scroll-area",
2787
+ "root": [
2788
+ ".scroll-area"
2789
+ ],
2790
+ "registryDependencies": [],
2791
+ "optionalDependencies": [],
2792
+ "files": [
2793
+ {
2794
+ "path": "components/scroll-area.css",
2795
+ "target": "components/scroll-area.css",
2796
+ "role": "base",
2797
+ "layer": "loseta.components"
2798
+ },
2799
+ {
2800
+ "path": "styles/nova/scroll-area.css",
2801
+ "target": "styles/nova/scroll-area.css",
2802
+ "role": "style",
2803
+ "layer": "loseta.style"
2804
+ }
2805
+ ],
2806
+ "examples": [
2807
+ "examples/scroll-area.html"
2808
+ ]
2809
+ },
2810
+ {
2811
+ "name": "slider",
2812
+ "type": "component",
2813
+ "status": "experimental",
2814
+ "title": "Slider",
2815
+ "description": "A native range input for selecting a value from a range.",
2816
+ "docs": "/docs/components/slider",
2817
+ "root": [
2818
+ ".slider"
2819
+ ],
2820
+ "registryDependencies": [],
2821
+ "optionalDependencies": [],
2822
+ "files": [
2823
+ {
2824
+ "path": "components/slider.css",
2825
+ "target": "components/slider.css",
2826
+ "role": "base",
2827
+ "layer": "loseta.components"
2828
+ },
2829
+ {
2830
+ "path": "styles/nova/slider.css",
2831
+ "target": "styles/nova/slider.css",
2832
+ "role": "style",
2833
+ "layer": "loseta.style"
2834
+ }
2835
+ ],
2836
+ "examples": [
2837
+ "examples/slider.html"
2838
+ ]
2839
+ },
2840
+ {
2841
+ "name": "select",
2842
+ "type": "component",
2843
+ "status": "experimental",
2844
+ "title": "Select",
2845
+ "description": "A custom single-select listbox with a button trigger.",
2846
+ "docs": "/docs/components/select",
2847
+ "root": [
2848
+ ".select"
2849
+ ],
2850
+ "registryDependencies": [
2851
+ "listbox",
2852
+ "popover-primitive"
2853
+ ],
2854
+ "optionalDependencies": [],
2855
+ "files": [
2856
+ {
2857
+ "path": "components/select.css",
2858
+ "target": "components/select.css",
2859
+ "role": "base",
2860
+ "layer": "loseta.components"
2861
+ },
2862
+ {
2863
+ "path": "styles/nova/select.css",
2864
+ "target": "styles/nova/select.css",
2865
+ "role": "style",
2866
+ "layer": "loseta.style"
2867
+ }
2868
+ ],
2869
+ "examples": [
2870
+ "examples/select.html"
2871
+ ]
2872
+ },
2873
+ {
2874
+ "name": "combobox",
2875
+ "type": "component",
2876
+ "status": "experimental",
2877
+ "title": "Combobox",
2878
+ "description": "A text input combined with a listbox of options.",
2879
+ "docs": "/docs/components/combobox",
2880
+ "root": [
2881
+ ".combobox"
2882
+ ],
2883
+ "registryDependencies": [
2884
+ "listbox",
2885
+ "popover-primitive"
2886
+ ],
2887
+ "optionalDependencies": [
2888
+ "button"
2889
+ ],
2890
+ "files": [
2891
+ {
2892
+ "path": "components/combobox.css",
2893
+ "target": "components/combobox.css",
2894
+ "role": "base",
2895
+ "layer": "loseta.components"
2896
+ },
2897
+ {
2898
+ "path": "styles/nova/combobox.css",
2899
+ "target": "styles/nova/combobox.css",
2900
+ "role": "style",
2901
+ "layer": "loseta.style"
2902
+ }
2903
+ ],
2904
+ "examples": [
2905
+ "examples/combobox.html"
2906
+ ]
2907
+ },
2908
+ {
2909
+ "name": "command",
2910
+ "type": "component",
2911
+ "status": "experimental",
2912
+ "title": "Command",
2913
+ "description": "A searchable command list for palettes and dialogs.",
2914
+ "docs": "/docs/components/command",
2915
+ "root": [
2916
+ ".command"
2917
+ ],
2918
+ "registryDependencies": [
2919
+ "listbox",
2920
+ "input-group"
2921
+ ],
2922
+ "optionalDependencies": [
2923
+ "dialog-shell",
2924
+ "popover-primitive",
2925
+ "card"
2926
+ ],
2927
+ "files": [
2928
+ {
2929
+ "path": "components/command.css",
2930
+ "target": "components/command.css",
2931
+ "role": "base",
2932
+ "layer": "loseta.components"
2933
+ },
2934
+ {
2935
+ "path": "styles/nova/command.css",
2936
+ "target": "styles/nova/command.css",
2937
+ "role": "style",
2938
+ "layer": "loseta.style"
2939
+ }
2940
+ ],
2941
+ "examples": [
2942
+ "examples/command.html"
2943
+ ]
2661
2944
  }
2662
2945
  ]
2663
2946
  }
@@ -0,0 +1,50 @@
1
+ /* Collapsible */
2
+ @layer loseta.style {
3
+ .collapsible {
4
+ > summary {
5
+ gap: 0.5rem;
6
+ border-style: solid;
7
+ border-width: 1px;
8
+ border-color: transparent;
9
+ border-radius: var(--radius-md);
10
+ padding-block: 0.25rem;
11
+ text-align: start;
12
+ font-size: var(--text-sm);
13
+ line-height: var(--text-sm--line-height);
14
+ font-weight: 500;
15
+ transition-property: border-color, box-shadow;
16
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
17
+ transition-duration: 150ms;
18
+
19
+ &:focus-visible {
20
+ border-color: var(--ring);
21
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
22
+ }
23
+
24
+ > svg:last-child {
25
+ margin-inline-start: auto;
26
+ width: 1rem;
27
+ height: 1rem;
28
+ color: var(--muted-foreground);
29
+ }
30
+ }
31
+
32
+ > :not(summary) {
33
+ padding-block-start: 0.5rem;
34
+ font-size: var(--text-sm);
35
+ line-height: var(--text-sm--line-height);
36
+ }
37
+
38
+ &::details-content {
39
+ opacity: 0%;
40
+ transition-property: block-size, opacity;
41
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
42
+ transition-duration: 150ms;
43
+ transition-behavior: allow-discrete;
44
+ }
45
+
46
+ &[open]::details-content {
47
+ opacity: 100%;
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,59 @@
1
+ /* Combobox */
2
+ @layer loseta.style {
3
+ .combobox {
4
+ > input {
5
+ height: 2rem;
6
+ border-style: solid;
7
+ border-width: 1px;
8
+ border-color: var(--input);
9
+ border-radius: var(--radius-lg);
10
+ background-color: light-dark(
11
+ transparent,
12
+ color-mix(in oklab, var(--input) 30%, transparent)
13
+ );
14
+ padding-inline: 0.5rem;
15
+ font-size: var(--text-base);
16
+ line-height: 1.5;
17
+ transition-property: color, background-color, border-color, box-shadow;
18
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
19
+ transition-duration: 150ms;
20
+
21
+ &:focus-visible {
22
+ border-color: var(--ring);
23
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
24
+ }
25
+
26
+ &[aria-invalid='true'] {
27
+ border-color: light-dark(
28
+ var(--destructive),
29
+ color-mix(in oklab, var(--destructive) 50%, transparent)
30
+ );
31
+ box-shadow: 0 0 0 3px light-dark(
32
+ color-mix(in oklab, var(--destructive) 20%, transparent),
33
+ color-mix(in oklab, var(--destructive) 40%, transparent)
34
+ );
35
+ }
36
+
37
+ @media (width >= 48rem) {
38
+ font-size: var(--text-sm);
39
+ line-height: var(--text-sm--line-height);
40
+ }
41
+ }
42
+
43
+ &:has(> [data-slot='clear']) > input {
44
+ padding-inline-end: 2rem;
45
+ }
46
+
47
+ > [data-slot='clear'] {
48
+ width: 1.5rem;
49
+ height: 1.5rem;
50
+ border-radius: min(var(--radius-md), 10px);
51
+ color: var(--muted-foreground);
52
+
53
+ &:hover {
54
+ background-color: var(--muted);
55
+ color: var(--foreground);
56
+ }
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,19 @@
1
+ /* Command */
2
+ @layer loseta.style {
3
+ .command {
4
+ [data-slot='shortcut'] {
5
+ font-size: var(--text-xs);
6
+ line-height: var(--text-xs--line-height);
7
+ letter-spacing: 0.1em;
8
+ color: var(--muted-foreground);
9
+ }
10
+
11
+ [role='listbox'] [role='option'] {
12
+ padding-inline-end: 0.375rem;
13
+ }
14
+
15
+ [role='listbox'] [role='option']:is(:hover, [data-highlighted]) [data-slot='shortcut'] {
16
+ color: var(--accent-foreground);
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,86 @@
1
+ /* Input Group */
2
+ @layer loseta.style {
3
+ .input-group {
4
+ min-height: 2rem;
5
+ gap: 0.25rem;
6
+ border-style: solid;
7
+ border-width: 1px;
8
+ border-color: var(--input);
9
+ border-radius: var(--radius-lg);
10
+ background-color: light-dark(
11
+ transparent,
12
+ color-mix(in oklab, var(--input) 30%, transparent)
13
+ );
14
+ padding: 0.25rem 0.375rem;
15
+ transition-property: border-color, box-shadow;
16
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
17
+ transition-duration: 150ms;
18
+
19
+ &:focus-within {
20
+ border-color: var(--ring);
21
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
22
+ }
23
+
24
+ &:has([aria-invalid='true']) {
25
+ border-color: light-dark(
26
+ var(--destructive),
27
+ color-mix(in oklab, var(--destructive) 50%, transparent)
28
+ );
29
+ box-shadow: 0 0 0 3px light-dark(
30
+ color-mix(in oklab, var(--destructive) 20%, transparent),
31
+ color-mix(in oklab, var(--destructive) 40%, transparent)
32
+ );
33
+ }
34
+
35
+ &:has(> textarea) {
36
+ align-items: stretch;
37
+ padding-block: 0.5rem;
38
+ }
39
+
40
+ > :is(input, textarea) {
41
+ border-width: 0;
42
+ border-radius: 0;
43
+ background-color: transparent;
44
+ padding: 0;
45
+ font-size: var(--text-base);
46
+ line-height: 1.5;
47
+ box-shadow: none;
48
+
49
+ &:focus-visible {
50
+ border-color: transparent;
51
+ box-shadow: none;
52
+ }
53
+
54
+ &[aria-invalid='true'] {
55
+ border-color: transparent;
56
+ box-shadow: none;
57
+ }
58
+
59
+ @media (width >= 48rem) {
60
+ font-size: var(--text-sm);
61
+ line-height: var(--text-sm--line-height);
62
+ }
63
+ }
64
+
65
+ > [data-slot='addon'] {
66
+ color: var(--muted-foreground);
67
+ font-size: var(--text-sm);
68
+ line-height: var(--text-sm--line-height);
69
+ -webkit-user-select: none;
70
+ user-select: none;
71
+
72
+ > svg {
73
+ width: 1rem;
74
+ height: 1rem;
75
+ }
76
+
77
+ &[data-align='block-start'] {
78
+ padding-block-end: 0.125rem;
79
+ }
80
+
81
+ &[data-align='block-end'] {
82
+ padding-block-start: 0.125rem;
83
+ }
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,51 @@
1
+ /* Input OTP */
2
+ @layer loseta.style {
3
+ .input-otp {
4
+ height: 2.5rem;
5
+ border-style: solid;
6
+ border-width: 1px;
7
+ border-color: var(--input);
8
+ border-radius: var(--radius-lg);
9
+ background-color: light-dark(
10
+ transparent,
11
+ color-mix(in oklab, var(--input) 30%, transparent)
12
+ );
13
+ padding-inline: 0.5rem;
14
+ font-size: var(--text-lg);
15
+ line-height: var(--text-lg--line-height);
16
+ letter-spacing: 0.5em;
17
+ transition-property: color, background-color, border-color, box-shadow;
18
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
19
+ transition-duration: 150ms;
20
+
21
+ &:focus-visible {
22
+ border-color: var(--ring);
23
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
24
+ }
25
+
26
+ &[aria-invalid='true'] {
27
+ border-color: light-dark(
28
+ var(--destructive),
29
+ color-mix(in oklab, var(--destructive) 50%, transparent)
30
+ );
31
+ box-shadow: 0 0 0 3px light-dark(
32
+ color-mix(in oklab, var(--destructive) 20%, transparent),
33
+ color-mix(in oklab, var(--destructive) 40%, transparent)
34
+ );
35
+ }
36
+
37
+ &[data-size='sm'] {
38
+ height: 2rem;
39
+ font-size: var(--text-base);
40
+ line-height: var(--text-base--line-height);
41
+ letter-spacing: 0.35em;
42
+ }
43
+
44
+ &[data-size='lg'] {
45
+ height: 3rem;
46
+ font-size: var(--text-xl);
47
+ line-height: var(--text-xl--line-height);
48
+ letter-spacing: 0.6em;
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,71 @@
1
+ /* Listbox primitive */
2
+ @layer loseta.style {
3
+ [data-popover]:has(> [role='listbox']) {
4
+ gap: 0;
5
+ width: 100%;
6
+ overflow-x: hidden;
7
+ overflow-y: auto;
8
+ border-radius: var(--radius-lg);
9
+ background-color: var(--popover);
10
+ padding: 0.25rem;
11
+ color: var(--popover-foreground);
12
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent), var(--shadow-md);
13
+ transition-duration: 100ms;
14
+ }
15
+
16
+ [role='listbox'] {
17
+ & [role='option'] {
18
+ gap: 0.375rem;
19
+ border-radius: var(--radius-md);
20
+ padding-inline: 0.375rem;
21
+ padding-inline-end: 1.75rem;
22
+ padding-block: 0.25rem;
23
+ font-size: var(--text-sm);
24
+ line-height: var(--text-sm--line-height);
25
+
26
+ & svg {
27
+ width: 1rem;
28
+ height: 1rem;
29
+ }
30
+
31
+ &[aria-selected='true'] {
32
+ font-weight: 500;
33
+ }
34
+
35
+ &:hover:not([aria-disabled='true']):not(:disabled),
36
+ &[data-highlighted] {
37
+ background-color: var(--accent);
38
+ color: var(--accent-foreground);
39
+ }
40
+
41
+ &[aria-disabled='true'] {
42
+ color: var(--muted-foreground);
43
+ }
44
+ }
45
+
46
+ & [data-slot='indicator'] {
47
+ position: absolute;
48
+ inset-inline-end: 0.5rem;
49
+ display: flex;
50
+ align-items: center;
51
+ justify-content: center;
52
+ }
53
+
54
+ & [data-slot='label'] {
55
+ padding-inline: 0.375rem;
56
+ padding-block: 0.25rem;
57
+ font-size: var(--text-xs);
58
+ line-height: var(--text-xs--line-height);
59
+ font-weight: 500;
60
+ color: var(--muted-foreground);
61
+ }
62
+
63
+ & [data-slot='empty'] {
64
+ padding-inline: 0.375rem;
65
+ padding-block: 0.5rem;
66
+ font-size: var(--text-sm);
67
+ line-height: var(--text-sm--line-height);
68
+ color: var(--muted-foreground);
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,30 @@
1
+ /* Scroll Area */
2
+ @layer loseta.style {
3
+ .scroll-area {
4
+ scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
5
+ scrollbar-width: auto;
6
+
7
+ &::-webkit-scrollbar {
8
+ width: var(--scrollbar-width);
9
+ height: var(--scrollbar-width);
10
+ }
11
+
12
+ &::-webkit-scrollbar-track {
13
+ background-color: var(--scrollbar-track);
14
+ }
15
+
16
+ &::-webkit-scrollbar-thumb {
17
+ border-radius: var(--scrollbar-radius);
18
+ background-color: var(--scrollbar-thumb);
19
+ }
20
+
21
+ &[data-size='sm'] {
22
+ scrollbar-width: thin;
23
+
24
+ &::-webkit-scrollbar {
25
+ width: var(--scrollbar-sm-width);
26
+ height: var(--scrollbar-sm-width);
27
+ }
28
+ }
29
+ }
30
+ }