@poppyui/core 0.1.0 → 0.1.2-next.0c371f0
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/LICENSE +21 -21
- package/README.md +225 -166
- package/dist/components/accordion.css +1 -1
- package/dist/components/button.css +3 -3
- package/dist/components/checkbox.css +2 -2
- package/dist/components/drawer.css +4 -4
- package/dist/components/dropdown.css +3 -3
- package/dist/components/input.css +2 -2
- package/dist/components/modal.css +6 -6
- package/dist/components/progress.css +1 -1
- package/dist/components/radio.css +1 -1
- package/dist/components/skeleton.css +1 -1
- package/dist/components/stat.css +1 -1
- package/dist/components/tabs.css +2 -2
- package/dist/components/toast.css +2 -2
- package/dist/components/toggle.css +1 -1
- package/dist/core.css +2 -0
- package/dist/poppy.css +32 -30
- package/dist/poppy.min.css +1 -1
- package/package.json +53 -53
- package/src/base/base.css +40 -40
- package/src/components/accordion.css +98 -98
- package/src/components/alert.css +58 -58
- package/src/components/avatar.css +67 -67
- package/src/components/badge.css +87 -87
- package/src/components/breadcrumbs.css +68 -68
- package/src/components/button.css +139 -139
- package/src/components/card.css +87 -87
- package/src/components/checkbox.css +77 -77
- package/src/components/divider.css +46 -46
- package/src/components/drawer.css +84 -84
- package/src/components/dropdown.css +100 -100
- package/src/components/field.css +71 -71
- package/src/components/input.css +127 -127
- package/src/components/join.css +70 -70
- package/src/components/kbd.css +35 -35
- package/src/components/loading.css +74 -74
- package/src/components/menu.css +147 -147
- package/src/components/modal.css +83 -83
- package/src/components/navbar.css +54 -54
- package/src/components/progress.css +91 -91
- package/src/components/radio.css +65 -65
- package/src/components/range.css +83 -83
- package/src/components/skeleton.css +43 -43
- package/src/components/stat.css +54 -54
- package/src/components/steps.css +100 -100
- package/src/components/table.css +65 -65
- package/src/components/tabs.css +125 -125
- package/src/components/toast.css +80 -80
- package/src/components/toggle.css +76 -76
- package/src/components/tooltip.css +59 -59
- package/src/core.css +7 -7
- package/src/poppy.css +34 -34
- package/src/themes/dark.css +33 -31
- package/src/themes/light.css +33 -32
- package/src/tokens/tokens.css +52 -52
package/src/components/field.css
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Field, fieldset, inline label
|
|
3
|
-
* <div class="field">
|
|
4
|
-
* <label class="field-label" for="email">Email</label>
|
|
5
|
-
* <input class="input" id="email" type="email" required aria-describedby="email-error">
|
|
6
|
-
* <p class="field-hint">We never share it.</p>
|
|
7
|
-
* <p class="field-error" id="email-error">Enter a valid email.</p>
|
|
8
|
-
* </div>
|
|
9
|
-
* <fieldset class="fieldset"><legend class="fieldset-legend">Plan</legend>...</fieldset>
|
|
10
|
-
* <label class="label-inline"><input type="checkbox" class="checkbox"> Remember me</label>
|
|
11
|
-
* `.field-error` is visible only while the field contains a :user-invalid control.
|
|
12
|
-
*/
|
|
13
|
-
@layer poppy.tokens, poppy.base, poppy.components;
|
|
14
|
-
|
|
15
|
-
@layer poppy.components {
|
|
16
|
-
.field {
|
|
17
|
-
display: grid;
|
|
18
|
-
gap: var(--space-1);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.field-label {
|
|
22
|
-
font-size: var(--text-sm);
|
|
23
|
-
font-weight: var(--weight-medium);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.field-hint {
|
|
27
|
-
margin: 0;
|
|
28
|
-
font-size: var(--text-sm);
|
|
29
|
-
color: var(--color-muted);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.field-error {
|
|
33
|
-
display: none;
|
|
34
|
-
margin: 0;
|
|
35
|
-
font-size: var(--text-sm);
|
|
36
|
-
font-weight: var(--weight-medium);
|
|
37
|
-
color: var(--color-danger);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.field:has(:user-invalid) .field-error {
|
|
41
|
-
display: block;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.fieldset {
|
|
45
|
-
display: grid;
|
|
46
|
-
gap: var(--space-3);
|
|
47
|
-
min-inline-size: 0;
|
|
48
|
-
margin: 0;
|
|
49
|
-
padding: var(--space-4);
|
|
50
|
-
border: 1px solid var(--color-border);
|
|
51
|
-
border-radius: var(--radius-md);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.fieldset-legend {
|
|
55
|
-
padding-inline: var(--space-2);
|
|
56
|
-
font-size: var(--text-sm);
|
|
57
|
-
font-weight: var(--weight-semibold);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.label-inline {
|
|
61
|
-
display: inline-flex;
|
|
62
|
-
align-items: center;
|
|
63
|
-
gap: var(--space-2);
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
|
|
66
|
-
&:has(:disabled) {
|
|
67
|
-
opacity: 0.5;
|
|
68
|
-
cursor: not-allowed;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Field, fieldset, inline label
|
|
3
|
+
* <div class="field">
|
|
4
|
+
* <label class="field-label" for="email">Email</label>
|
|
5
|
+
* <input class="input" id="email" type="email" required aria-describedby="email-error">
|
|
6
|
+
* <p class="field-hint">We never share it.</p>
|
|
7
|
+
* <p class="field-error" id="email-error">Enter a valid email.</p>
|
|
8
|
+
* </div>
|
|
9
|
+
* <fieldset class="fieldset"><legend class="fieldset-legend">Plan</legend>...</fieldset>
|
|
10
|
+
* <label class="label-inline"><input type="checkbox" class="checkbox"> Remember me</label>
|
|
11
|
+
* `.field-error` is visible only while the field contains a :user-invalid control.
|
|
12
|
+
*/
|
|
13
|
+
@layer poppy.tokens, poppy.base, poppy.components;
|
|
14
|
+
|
|
15
|
+
@layer poppy.components {
|
|
16
|
+
.field {
|
|
17
|
+
display: grid;
|
|
18
|
+
gap: var(--space-1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.field-label {
|
|
22
|
+
font-size: var(--text-sm);
|
|
23
|
+
font-weight: var(--weight-medium);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.field-hint {
|
|
27
|
+
margin: 0;
|
|
28
|
+
font-size: var(--text-sm);
|
|
29
|
+
color: var(--color-muted);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.field-error {
|
|
33
|
+
display: none;
|
|
34
|
+
margin: 0;
|
|
35
|
+
font-size: var(--text-sm);
|
|
36
|
+
font-weight: var(--weight-medium);
|
|
37
|
+
color: var(--color-danger);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.field:has(:user-invalid) .field-error {
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.fieldset {
|
|
45
|
+
display: grid;
|
|
46
|
+
gap: var(--space-3);
|
|
47
|
+
min-inline-size: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: var(--space-4);
|
|
50
|
+
border: 1px solid var(--color-border);
|
|
51
|
+
border-radius: var(--radius-md);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.fieldset-legend {
|
|
55
|
+
padding-inline: var(--space-2);
|
|
56
|
+
font-size: var(--text-sm);
|
|
57
|
+
font-weight: var(--weight-semibold);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.label-inline {
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--space-2);
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
|
|
66
|
+
&:has(:disabled) {
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/components/input.css
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Input, textarea, select
|
|
3
|
-
* <input class="input" type="text" aria-label="Name">
|
|
4
|
-
* <textarea class="textarea"></textarea>
|
|
5
|
-
* <select class="select"><option>One</option></select>
|
|
6
|
-
* Colors: *-primary | *-secondary | *-success | *-warning | *-info | *-danger (border)
|
|
7
|
-
* Sizes: *-sm | (default) | *-lg Style: input-ghost
|
|
8
|
-
* States: :disabled, :user-invalid (danger border)
|
|
9
|
-
* `.select` uses appearance: base-select (progressive enhancement), else the native control.
|
|
10
|
-
*/
|
|
11
|
-
@layer poppy.tokens, poppy.base, poppy.components;
|
|
12
|
-
|
|
13
|
-
@layer poppy.components {
|
|
14
|
-
.input,
|
|
15
|
-
.textarea,
|
|
16
|
-
.select {
|
|
17
|
-
--input-border: var(--color-border);
|
|
18
|
-
--input-h: 2.5rem;
|
|
19
|
-
--input-px: var(--space-3);
|
|
20
|
-
--input-text: var(--text-md);
|
|
21
|
-
|
|
22
|
-
inline-size: 100%;
|
|
23
|
-
min-block-size: var(--input-h);
|
|
24
|
-
padding-inline: var(--input-px);
|
|
25
|
-
border: 1px solid var(--input-border);
|
|
26
|
-
border-radius: var(--radius-md);
|
|
27
|
-
background: var(--color-
|
|
28
|
-
color: var(--color-base-content);
|
|
29
|
-
font: inherit;
|
|
30
|
-
font-size: var(--input-text);
|
|
31
|
-
transition:
|
|
32
|
-
border-color var(--duration-fast) var(--ease-out),
|
|
33
|
-
background-color var(--duration-fast) var(--ease-out);
|
|
34
|
-
|
|
35
|
-
&::placeholder {
|
|
36
|
-
color: var(--color-muted);
|
|
37
|
-
opacity: 1;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&:hover:not(:disabled) {
|
|
41
|
-
border-color: color-mix(in oklch, var(--input-border), var(--color-base-content) 25%);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
&:focus-visible {
|
|
45
|
-
outline: var(--focus-width) solid var(--color-focus);
|
|
46
|
-
outline-offset: 1px;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&:disabled {
|
|
50
|
-
opacity: 0.5;
|
|
51
|
-
cursor: not-allowed;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.textarea {
|
|
56
|
-
padding-block: var(--space-2);
|
|
57
|
-
min-block-size: 5rem;
|
|
58
|
-
line-height: var(--leading);
|
|
59
|
-
resize: vertical;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.input-ghost,
|
|
63
|
-
.textarea-ghost,
|
|
64
|
-
.select-ghost {
|
|
65
|
-
--input-border: transparent;
|
|
66
|
-
background: var(--color-base-200);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.input-primary, .textarea-primary, .select-primary { --input-border: var(--color-primary); }
|
|
70
|
-
.input-secondary, .textarea-secondary, .select-secondary { --input-border: var(--color-secondary); }
|
|
71
|
-
.input-success, .textarea-success, .select-success { --input-border: var(--color-success); }
|
|
72
|
-
.input-warning, .textarea-warning, .select-warning { --input-border: var(--color-warning); }
|
|
73
|
-
.input-info, .textarea-info, .select-info { --input-border: var(--color-info); }
|
|
74
|
-
.input-danger, .textarea-danger, .select-danger { --input-border: var(--color-danger); }
|
|
75
|
-
|
|
76
|
-
.input-sm,
|
|
77
|
-
.textarea-sm,
|
|
78
|
-
.select-sm {
|
|
79
|
-
--input-h: 2rem;
|
|
80
|
-
--input-px: var(--space-2);
|
|
81
|
-
--input-text: var(--text-sm);
|
|
82
|
-
border-radius: var(--radius-sm);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.input-lg,
|
|
86
|
-
.textarea-lg,
|
|
87
|
-
.select-lg {
|
|
88
|
-
--input-h: 3rem;
|
|
89
|
-
--input-px: var(--space-4);
|
|
90
|
-
--input-text: var(--text-lg);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/* Declared last so a failed validation beats any color modifier. */
|
|
94
|
-
:is(.input, .textarea, .select):user-invalid {
|
|
95
|
-
--input-border: var(--color-danger);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@supports (appearance: base-select) {
|
|
99
|
-
.select,
|
|
100
|
-
.select::picker(select) {
|
|
101
|
-
appearance: base-select;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.select::picker(select) {
|
|
105
|
-
border: 1px solid var(--color-border);
|
|
106
|
-
border-radius: var(--radius-md);
|
|
107
|
-
background: var(--color-base-100);
|
|
108
|
-
color: var(--color-base-content);
|
|
109
|
-
box-shadow: var(--shadow-md);
|
|
110
|
-
padding: var(--space-1);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.select option {
|
|
114
|
-
padding: var(--space-2) var(--space-3);
|
|
115
|
-
border-radius: var(--radius-sm);
|
|
116
|
-
|
|
117
|
-
&:hover,
|
|
118
|
-
&:focus-visible {
|
|
119
|
-
background: var(--color-base-200);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&:checked {
|
|
123
|
-
font-weight: var(--weight-semibold);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Input, textarea, select
|
|
3
|
+
* <input class="input" type="text" aria-label="Name">
|
|
4
|
+
* <textarea class="textarea"></textarea>
|
|
5
|
+
* <select class="select"><option>One</option></select>
|
|
6
|
+
* Colors: *-primary | *-secondary | *-success | *-warning | *-info | *-danger (border)
|
|
7
|
+
* Sizes: *-sm | (default) | *-lg Style: input-ghost
|
|
8
|
+
* States: :disabled, :user-invalid (danger border)
|
|
9
|
+
* `.select` uses appearance: base-select (progressive enhancement), else the native control.
|
|
10
|
+
*/
|
|
11
|
+
@layer poppy.tokens, poppy.base, poppy.components;
|
|
12
|
+
|
|
13
|
+
@layer poppy.components {
|
|
14
|
+
.input,
|
|
15
|
+
.textarea,
|
|
16
|
+
.select {
|
|
17
|
+
--input-border: var(--color-border);
|
|
18
|
+
--input-h: 2.5rem;
|
|
19
|
+
--input-px: var(--space-3);
|
|
20
|
+
--input-text: var(--text-md);
|
|
21
|
+
|
|
22
|
+
inline-size: 100%;
|
|
23
|
+
min-block-size: var(--input-h);
|
|
24
|
+
padding-inline: var(--input-px);
|
|
25
|
+
border: 1px solid var(--input-border);
|
|
26
|
+
border-radius: var(--radius-md);
|
|
27
|
+
background: var(--color-field);
|
|
28
|
+
color: var(--color-base-content);
|
|
29
|
+
font: inherit;
|
|
30
|
+
font-size: var(--input-text);
|
|
31
|
+
transition:
|
|
32
|
+
border-color var(--duration-fast) var(--ease-out),
|
|
33
|
+
background-color var(--duration-fast) var(--ease-out);
|
|
34
|
+
|
|
35
|
+
&::placeholder {
|
|
36
|
+
color: var(--color-muted);
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:hover:not(:disabled) {
|
|
41
|
+
border-color: color-mix(in oklch, var(--input-border), var(--color-base-content) 25%);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:focus-visible {
|
|
45
|
+
outline: var(--focus-width) solid var(--color-focus);
|
|
46
|
+
outline-offset: 1px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:disabled {
|
|
50
|
+
opacity: 0.5;
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.textarea {
|
|
56
|
+
padding-block: var(--space-2);
|
|
57
|
+
min-block-size: 5rem;
|
|
58
|
+
line-height: var(--leading);
|
|
59
|
+
resize: vertical;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.input-ghost,
|
|
63
|
+
.textarea-ghost,
|
|
64
|
+
.select-ghost {
|
|
65
|
+
--input-border: transparent;
|
|
66
|
+
background: var(--color-base-200);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.input-primary, .textarea-primary, .select-primary { --input-border: var(--color-primary); }
|
|
70
|
+
.input-secondary, .textarea-secondary, .select-secondary { --input-border: var(--color-secondary); }
|
|
71
|
+
.input-success, .textarea-success, .select-success { --input-border: var(--color-success); }
|
|
72
|
+
.input-warning, .textarea-warning, .select-warning { --input-border: var(--color-warning); }
|
|
73
|
+
.input-info, .textarea-info, .select-info { --input-border: var(--color-info); }
|
|
74
|
+
.input-danger, .textarea-danger, .select-danger { --input-border: var(--color-danger); }
|
|
75
|
+
|
|
76
|
+
.input-sm,
|
|
77
|
+
.textarea-sm,
|
|
78
|
+
.select-sm {
|
|
79
|
+
--input-h: 2rem;
|
|
80
|
+
--input-px: var(--space-2);
|
|
81
|
+
--input-text: var(--text-sm);
|
|
82
|
+
border-radius: var(--radius-sm);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.input-lg,
|
|
86
|
+
.textarea-lg,
|
|
87
|
+
.select-lg {
|
|
88
|
+
--input-h: 3rem;
|
|
89
|
+
--input-px: var(--space-4);
|
|
90
|
+
--input-text: var(--text-lg);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Declared last so a failed validation beats any color modifier. */
|
|
94
|
+
:is(.input, .textarea, .select):user-invalid {
|
|
95
|
+
--input-border: var(--color-danger);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@supports (appearance: base-select) {
|
|
99
|
+
.select,
|
|
100
|
+
.select::picker(select) {
|
|
101
|
+
appearance: base-select;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.select::picker(select) {
|
|
105
|
+
border: 1px solid var(--color-border);
|
|
106
|
+
border-radius: var(--radius-md);
|
|
107
|
+
background: var(--color-base-100);
|
|
108
|
+
color: var(--color-base-content);
|
|
109
|
+
box-shadow: var(--shadow-md);
|
|
110
|
+
padding: var(--space-1);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.select option {
|
|
114
|
+
padding: var(--space-2) var(--space-3);
|
|
115
|
+
border-radius: var(--radius-sm);
|
|
116
|
+
|
|
117
|
+
&:hover,
|
|
118
|
+
&:focus-visible {
|
|
119
|
+
background: var(--color-base-200);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:checked {
|
|
123
|
+
font-weight: var(--weight-semibold);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
package/src/components/join.css
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Join: zero JS. Groups adjacent buttons/inputs flush, sharing one outer radius.
|
|
3
|
-
*
|
|
4
|
-
* <div class="join">
|
|
5
|
-
* <input class="input" placeholder="Email">
|
|
6
|
-
* <button class="btn btn-primary">Subscribe</button>
|
|
7
|
-
* </div>
|
|
8
|
-
*
|
|
9
|
-
* Modifier: .join-vertical.
|
|
10
|
-
*/
|
|
11
|
-
@layer poppy.tokens, poppy.base, poppy.components;
|
|
12
|
-
|
|
13
|
-
@layer poppy.components {
|
|
14
|
-
/* Doubled class: must outrank the children's own .btn / .input radius regardless of file order. */
|
|
15
|
-
.join.join {
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
align-items: stretch;
|
|
18
|
-
--join-radius: var(--radius-md);
|
|
19
|
-
|
|
20
|
-
& > * {
|
|
21
|
-
border-radius: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* Collapse the inner borders. */
|
|
25
|
-
& > * + * {
|
|
26
|
-
margin-inline-start: -1px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
& > :first-child {
|
|
30
|
-
border-start-start-radius: var(--join-radius);
|
|
31
|
-
border-end-start-radius: var(--join-radius);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
& > :last-child {
|
|
35
|
-
border-start-end-radius: var(--join-radius);
|
|
36
|
-
border-end-end-radius: var(--join-radius);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/* Keep the focused/hovered item's full border above its neighbours. */
|
|
40
|
-
& > :is(:hover, :focus-visible) {
|
|
41
|
-
z-index: 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
& > * {
|
|
45
|
-
position: relative;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&.join-vertical {
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
|
|
51
|
-
& > * + * {
|
|
52
|
-
margin-inline-start: 0;
|
|
53
|
-
margin-block-start: -1px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
& > :first-child {
|
|
57
|
-
border-radius: var(--join-radius) var(--join-radius) 0 0;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
& > :last-child {
|
|
61
|
-
border-radius: 0 0 var(--join-radius) var(--join-radius);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
&.join-vertical > :only-child,
|
|
66
|
-
& > :only-child {
|
|
67
|
-
border-radius: var(--join-radius);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Join: zero JS. Groups adjacent buttons/inputs flush, sharing one outer radius.
|
|
3
|
+
*
|
|
4
|
+
* <div class="join">
|
|
5
|
+
* <input class="input" placeholder="Email">
|
|
6
|
+
* <button class="btn btn-primary">Subscribe</button>
|
|
7
|
+
* </div>
|
|
8
|
+
*
|
|
9
|
+
* Modifier: .join-vertical.
|
|
10
|
+
*/
|
|
11
|
+
@layer poppy.tokens, poppy.base, poppy.components;
|
|
12
|
+
|
|
13
|
+
@layer poppy.components {
|
|
14
|
+
/* Doubled class: must outrank the children's own .btn / .input radius regardless of file order. */
|
|
15
|
+
.join.join {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: stretch;
|
|
18
|
+
--join-radius: var(--radius-md);
|
|
19
|
+
|
|
20
|
+
& > * {
|
|
21
|
+
border-radius: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Collapse the inner borders. */
|
|
25
|
+
& > * + * {
|
|
26
|
+
margin-inline-start: -1px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& > :first-child {
|
|
30
|
+
border-start-start-radius: var(--join-radius);
|
|
31
|
+
border-end-start-radius: var(--join-radius);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
& > :last-child {
|
|
35
|
+
border-start-end-radius: var(--join-radius);
|
|
36
|
+
border-end-end-radius: var(--join-radius);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Keep the focused/hovered item's full border above its neighbours. */
|
|
40
|
+
& > :is(:hover, :focus-visible) {
|
|
41
|
+
z-index: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
& > * {
|
|
45
|
+
position: relative;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.join-vertical {
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
|
|
51
|
+
& > * + * {
|
|
52
|
+
margin-inline-start: 0;
|
|
53
|
+
margin-block-start: -1px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
& > :first-child {
|
|
57
|
+
border-radius: var(--join-radius) var(--join-radius) 0 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
& > :last-child {
|
|
61
|
+
border-radius: 0 0 var(--join-radius) var(--join-radius);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.join-vertical > :only-child,
|
|
66
|
+
& > :only-child {
|
|
67
|
+
border-radius: var(--join-radius);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
package/src/components/kbd.css
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Kbd
|
|
3
|
-
* <kbd class="kbd">Ctrl</kbd> + <kbd class="kbd">K</kbd>
|
|
4
|
-
* Sizes: kbd-sm | (default) | kbd-lg
|
|
5
|
-
*/
|
|
6
|
-
@layer poppy.tokens, poppy.base, poppy.components;
|
|
7
|
-
|
|
8
|
-
@layer poppy.components {
|
|
9
|
-
.kbd {
|
|
10
|
-
--kbd-text: var(--text-sm);
|
|
11
|
-
|
|
12
|
-
display: inline-flex;
|
|
13
|
-
align-items: center;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
min-inline-size: 1.75em;
|
|
16
|
-
padding-inline: 0.5em;
|
|
17
|
-
padding-block: 0.125em;
|
|
18
|
-
border: 1px solid var(--color-border);
|
|
19
|
-
border-block-end-width: 2px;
|
|
20
|
-
border-radius: var(--radius-sm);
|
|
21
|
-
background: var(--color-base-200);
|
|
22
|
-
color: var(--color-base-content);
|
|
23
|
-
font-family: var(--font-mono);
|
|
24
|
-
font-size: var(--kbd-text);
|
|
25
|
-
line-height: 1.5;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.kbd-sm {
|
|
29
|
-
--kbd-text: 0.75rem;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.kbd-lg {
|
|
33
|
-
--kbd-text: var(--text-md);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Kbd
|
|
3
|
+
* <kbd class="kbd">Ctrl</kbd> + <kbd class="kbd">K</kbd>
|
|
4
|
+
* Sizes: kbd-sm | (default) | kbd-lg
|
|
5
|
+
*/
|
|
6
|
+
@layer poppy.tokens, poppy.base, poppy.components;
|
|
7
|
+
|
|
8
|
+
@layer poppy.components {
|
|
9
|
+
.kbd {
|
|
10
|
+
--kbd-text: var(--text-sm);
|
|
11
|
+
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
min-inline-size: 1.75em;
|
|
16
|
+
padding-inline: 0.5em;
|
|
17
|
+
padding-block: 0.125em;
|
|
18
|
+
border: 1px solid var(--color-border);
|
|
19
|
+
border-block-end-width: 2px;
|
|
20
|
+
border-radius: var(--radius-sm);
|
|
21
|
+
background: var(--color-base-200);
|
|
22
|
+
color: var(--color-base-content);
|
|
23
|
+
font-family: var(--font-mono);
|
|
24
|
+
font-size: var(--kbd-text);
|
|
25
|
+
line-height: 1.5;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.kbd-sm {
|
|
29
|
+
--kbd-text: 0.75rem;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.kbd-lg {
|
|
33
|
+
--kbd-text: var(--text-md);
|
|
34
|
+
}
|
|
35
|
+
}
|