@wwtdev/bsds-css 1.1.0 → 1.3.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.
@@ -0,0 +1,191 @@
1
+ .bs-input-addon {
2
+ --input-border: var(--bs-violet-300);
3
+ align-items: center;
4
+ background-color: var(--input-bg, var(--bs-bg-base));
5
+ border-radius: .25rem;
6
+ color: var(--bs-ink-base);
7
+ display: flex;
8
+ height: 2.5rem;
9
+ overflow: hidden;
10
+ padding: 0;
11
+ pointer-events: none;
12
+ position: relative;
13
+ width: 100%;
14
+ }
15
+ /**
16
+ Implement an outer 'border' via pseudo-element instead of
17
+ on main element to avoid content shifting, double-stroke effect,
18
+ and issues with box-sizing
19
+ */
20
+ .bs-input-addon::after,
21
+ .bs-input-addon::before,
22
+ .bs-input-addon ::after,
23
+ .bs-input-addon ::before {
24
+ pointer-events: none;
25
+ }
26
+
27
+ .bs-input-addon::after,
28
+ .bs-input-addon::before {
29
+ content: '';
30
+ height: 100%;
31
+ left: 0;
32
+ position: absolute;
33
+ top: 0;
34
+ width: 100%;
35
+ }
36
+
37
+ .bs-input-addon::after {
38
+ border-radius: .25rem;
39
+ border: 1px solid var(--input-border);
40
+ }
41
+
42
+ .bs-input-addon > * {
43
+ flex-grow: 0;
44
+ flex-shrink: 0;
45
+ }
46
+ .bs-input-addon > :where(bs-input, input, .bs-input-addon) {
47
+ flex-grow: 1;
48
+ flex-shrink: 1;
49
+ }
50
+
51
+ .bs-input-addon > *:where(:not(.bs-input-addon)) {
52
+ background-color: var(--input-bg, var(--bs-bg-base));
53
+ border-width: 0px;
54
+ display: flex;
55
+ height: 100%;
56
+ overflow: hidden;
57
+ pointer-events: auto;
58
+ position: relative;
59
+ }
60
+
61
+ /* Remove (hide) children's borders, outlines */
62
+ .bs-input-addon > *,
63
+ .bs-input-addon :where(input, select),
64
+ .bs-input-addon :is(bs-input, bs-select) :where(input, select),
65
+ .bs-input-addon :where(.bs-input-addon)::after {
66
+ border-color: transparent;
67
+ border-width: 0px;
68
+ }
69
+
70
+ .bs-input-addon :where(:focus-within) :where(input, select),
71
+ .bs-input-addon :where(:focus-within) :is(bs-input, bs-select) :where(input, select),
72
+ .bs-input-addon :where(input, select):where(:focus, :focus-within, :focus-visible),
73
+ .bs-input-addon :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
74
+ --input-border: transparent;
75
+ box-shadow: none;
76
+ outline: none;
77
+ }
78
+
79
+ /* -------- Inner-bordered styles -------- */
80
+ /** Inner borders should be straight; shown only if variant: "inner-bordered" */
81
+ .bs-input-addon > :where(.bs-input-addon:not(:last-child, :focus-within)),
82
+ .bs-input-addon > :where(:not(:last-child, :focus-within))::after {
83
+ border-top-right-radius: 0;
84
+ border-bottom-right-radius: 0;
85
+ }
86
+
87
+ .bs-input-addon > :where(.bs-input-addon:not(:first-child, :focus-within)),
88
+ .bs-input-addon > :where(:not(:first-child, :focus-within))::after {
89
+ border-top-left-radius: 0;
90
+ border-bottom-left-radius: 0;
91
+ }
92
+
93
+ .bs-input-addon:where([data-variant="inner-bordered"]:not(.bs-input-addon .bs-input-addon)) > :where(:not(.bs-input-addon, :focus, :focus-within))::after {
94
+ border-right-color: var(--input-border);
95
+ border-right-width: 1px;
96
+ content: '';
97
+ height: 100%;
98
+ position: absolute;
99
+ width: 100%;
100
+ }
101
+
102
+ .bs-input-addon:where([data-variant="inner-bordered"]) > :where(.bs-input-addon)::after {
103
+ border-right-width: 1px;
104
+ border-right-color: var(--input-border);
105
+ border-radius: 0px;
106
+ }
107
+
108
+
109
+ /* -------- Focus styles -------- */
110
+
111
+ .bs-input-addon:where(:not([data-multifocus]):focus-within),
112
+ .bs-input-addon:where([data-multifocus]) :where(input, select):where(:focus, :focus-within, :focus-visible),
113
+ .bs-input-addon:where([data-multifocus]) :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
114
+ --input-border: var(--bs-blue-400);
115
+ position: relative;
116
+ z-index: 1;
117
+ }
118
+
119
+ .bs-input-addon :where(.bs-input-addon:where(:not([data-multifocus]):focus-within))::after {
120
+ border-color: var(--input-border);
121
+ border-radius: .25rem;
122
+ border-width: 1px;
123
+ z-index: 1;
124
+ }
125
+
126
+ .bs-input-addon:where([data-multifocus]) > :where(:not(.bs-input-addon)) > :where(input:focus),
127
+ .bs-input-addon:where([data-multifocus]) > bs-input :where(input:focus),
128
+ .bs-input-addon:where([data-multifocus]) > :where(input:focus) {
129
+ border-radius: .25rem;
130
+ box-shadow: var(--input-border) 0px 0px 0px 1px inset;
131
+ }
132
+
133
+ .bs-input-addon:where([data-multifocus]) > :where(:not(.bs-input-addon)) > :where(select:focus),
134
+ .bs-input-addon:where([data-multifocus]) > bs-select :where(select:focus),
135
+ .bs-input-addon:where([data-multifocus]) > :where(select:focus) {
136
+ border-radius: .25rem;
137
+ box-shadow: var(--input-border) 0px 0px 0px 2px inset;
138
+ }
139
+
140
+ .bs-input-addon:where(:not([data-multifocus]):focus-within)::after {
141
+ border-width: 1px;
142
+ border-radius: .25rem;
143
+ }
144
+
145
+ .bs-input-addon:where(:focus-within) :where(:not(:focus, :focus-within))::after,
146
+ .bs-input-addon:where(:focus-within) :where(:not(:focus, :focus-within)) {
147
+ border-color: transparent;
148
+ }
149
+
150
+ /* Straight-lined ::before border to fill the gap below the rounded ::after border */
151
+ .bs-input-addon:where([data-multifocus]) :where(:focus-within)::before {
152
+ border-bottom-width: 1px;
153
+ border-color: var(--bs-violet-300);
154
+ border-radius: 0;
155
+ border-top-width: 1px;
156
+ z-index: 1;
157
+ }
158
+
159
+ /* -------- Disabled styles -------- */
160
+ .bs-input-addon:where([data-disabled]:not([data-disabled="false"])),
161
+ .bs-input-addon:where([data-disabled]:not([data-disabled="false"])) bs-button .bs-button {
162
+ --input-bg: var(--bs-gray-200);
163
+ --input-border: var(--bs-gray-400);
164
+ color: var(--bs-gray-400);
165
+ }
166
+ .bs-input-addon:where([data-disabled]:not([data-disabled="false"])) * {
167
+ pointer-events: none;
168
+ }
169
+
170
+ /* -------- Error styles -------- */
171
+ .bs-input-addon:where([data-error]),
172
+ .bs-input-addon:where([data-error]) > ::after {
173
+ --input-border: var(--bs-red-400);
174
+ }
175
+
176
+ .bs-input-addon:where([data-error][data-multifocus]) > :where(:focus-within),
177
+ .bs-input-addon:where([data-error][data-multifocus]) :where(input, select):where(:focus, :focus-within, :focus-visible),
178
+ .bs-input-addon:where([data-error][data-multifocus]) :is(bs-input, bs-select) :where(input, select):where(:focus, :focus-within, :focus-visible) {
179
+ --input-border: var(--bs-red-400);
180
+ border-color: var(--input-border);
181
+ }
182
+
183
+ .bs-input-addon:where([data-error],[data-disabled]) > *::before,
184
+ .bs-input-addon:where(.bs-input-addon[data-error] .bs-input-addon, .bs-input-addon[data-disabled] .bs-input-addon) > *::before {
185
+ border-color: var(--input-border);
186
+ }
187
+
188
+ /* -------- Label margin -------- */
189
+ :where(label, .bs-label, bs-label) + .bs-input-addon {
190
+ margin-top: 0.25rem;
191
+ }
@@ -0,0 +1,92 @@
1
+ :where(label + input, label > input):where(:not([type='checkbox'], [type='radio'])),
2
+ :where(label + textarea, label > textarea),
3
+ :where(label + select, label > select) {
4
+ margin-top: 0.25rem;
5
+ }
6
+
7
+ input:where(:not([type='checkbox'], [type='radio'], [type='file'], [type='range'])),
8
+ textarea, select {
9
+ appearance: none;
10
+ background-color: var(--input-bg, var(--bs-bg-base));
11
+ border: 1px solid var(--input-border, var(--bs-violet-300));
12
+ border-radius: 0.25rem;
13
+ caret-color: var(--bs-blue-400);
14
+ color: var(--bs-ink-base);
15
+ font-size: var(--bs-text-base);
16
+ font-weight: 400;
17
+ height: 2.5rem;
18
+ line-height: var(--bs-leading-base);
19
+ min-height: 2.5rem;
20
+ padding-inline: 0.75rem;
21
+ width: 100%;
22
+ }
23
+
24
+ textarea {
25
+ height: auto;
26
+ padding-block: 0.5rem;
27
+ resize: vertical;
28
+ }
29
+
30
+ :is(input, textarea, select)::placeholder {
31
+ color: var(--bs-violet-200);
32
+ }
33
+ :is(input, textarea, select):where(:focus-visible)::placeholder {
34
+ opacity: 0;
35
+ }
36
+
37
+ :is(input:where(:not([type='checkbox'], [type='radio'])), textarea, select):where(:focus-visible) {
38
+ --input-border: var(--bs-blue-400);
39
+ outline-width: 0px;
40
+ }
41
+
42
+ :is(input:where(:not([type='checkbox'],[type='radio'])), textarea, select):where(:disabled) {
43
+ --input-border: var(--bs-gray-400);
44
+ background-color: var(--bs-gray-200);
45
+ color: var(--bs-gray-400);
46
+ }
47
+
48
+ /* Errors and Messages */
49
+ :is(input, select, textarea):where([data-error]) {
50
+ --input-border: var(--bs-red-500);
51
+ }
52
+
53
+ /*
54
+ Removes the built-in 'margin' on bottom of textarea
55
+ see https://bugs.chromium.org/p/chromium/issues/detail?id=89530
56
+ :has not fully supported yet but will work for most
57
+ */
58
+ :has(> textarea:only-child) {
59
+ display: block;
60
+ line-height: 0;
61
+ }
62
+
63
+ /* chrome user agent styling was applying opacity: 0.7 */
64
+ :where(select:disabled) {
65
+ opacity: 1;
66
+ }
67
+
68
+ :is(input, textarea, select):disabled::placeholder,
69
+ :is(input, textarea, select)[disabled]::placeholder {
70
+ color: var(--bs-gray-400);
71
+ opacity: 1;
72
+ }
73
+
74
+ /* Select */
75
+
76
+ select {
77
+ /* URL Encoded SVG dropdown caret so there is something there */
78
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%230A0B19' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
79
+ background-position: right 0.75rem center;
80
+ background-repeat: no-repeat;
81
+ background-size: 1em 1em;
82
+ padding-right: var(--bs-space-9);
83
+ }
84
+ .dark select {
85
+ /* URL Encoded SVG dropdown caret so there is something there */
86
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
87
+ }
88
+
89
+ .dark select:disabled {
90
+ /* URL Encoded SVG dropdown caret so there is something there */
91
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23555775' d='M8.048 13.375a.745.745 0 0 1-.526-.217L0 5.686l1.053-1.061 6.995 6.95 6.897-6.85 1.053 1.06-7.423 7.373a.745.745 0 0 1-.527.217Z'/%3E%3C/svg%3E");
92
+ }
@@ -0,0 +1,154 @@
1
+ /* -------------------- BASE STYLES -------------------- */
2
+ .bs-tooltip {
3
+ display: inline-block;
4
+ position: relative;
5
+ }
6
+
7
+ .bs-tooltip :where(.bs-tooltip-text) {
8
+ align-items: center;
9
+ background-color: var(--bs-bg-base);
10
+ border-radius: 4px;
11
+ box-shadow: var(--bs-shadow-contentLowCenter);
12
+ color: var(--bs-violet-400);
13
+ display: flex;
14
+ font-size: var(--bs-text-sm);
15
+ justify-content: center;
16
+ max-width: 16rem;
17
+ min-width: 4rem;
18
+ opacity: 0;
19
+ padding-bottom: 0.25rem;
20
+ padding-left: 0.5rem;
21
+ padding-right: 0.5rem;
22
+ padding-top: 0.25rem;
23
+ position: absolute;
24
+ transform: scale(0);
25
+ transition-duration: 75ms;
26
+ transition-property: opacity, transform;
27
+ transition-timing-function: ease-in-out;
28
+ width: max-content;
29
+ z-index: 999;
30
+ }
31
+
32
+ /* -------------------- POSITION: UNDEFINED / TOP -------------------- */
33
+ .bs-tooltip:where(:not([data-position])) :where(.bs-tooltip-text),
34
+ .bs-tooltip:where([data-position="top"]) :where(.bs-tooltip-text) {
35
+ bottom: calc(100% + 0.5rem);
36
+ left: 50%;
37
+ transform-origin: bottom center;
38
+ transform: translateX(-50%) scale(0);
39
+ }
40
+
41
+ /* Active States */
42
+ :where(.bs-tooltip:not([data-position])):hover :where(.bs-tooltip-text),
43
+ :where(.bs-tooltip[data-position="top"]):hover :where(.bs-tooltip-text),
44
+ :where(.bs-tooltip:not([data-position])):focus-within :where(.bs-tooltip-text),
45
+ :where(.bs-tooltip[data-position="top"]):focus-within :where(.bs-tooltip-text),
46
+ :where(.bs-tooltip:not([data-position]))[data-shown] :where(.bs-tooltip-text),
47
+ :where(.bs-tooltip[data-position="top"])[data-shown] :where(.bs-tooltip-text) {
48
+ opacity: 1;
49
+ transform: translateX(-50%) scale(1);
50
+ }
51
+
52
+ /* -------------------- POSITION: BOTTOM -------------------- */
53
+ .bs-tooltip:where([data-position="bottom"]) :where(.bs-tooltip-text) {
54
+ left: 50%;
55
+ top: calc(100% + 0.5rem);
56
+ transform-origin: top center;
57
+ transform: translateX(-50%) scale(0);
58
+ }
59
+
60
+ /* Active States */
61
+ :where(.bs-tooltip[data-position="bottom"]):hover :where(.bs-tooltip-text),
62
+ :where(.bs-tooltip[data-position="bottom"]):focus-within :where(.bs-tooltip-text),
63
+ :where(.bs-tooltip[data-position="bottom"])[data-shown] :where(.bs-tooltip-text) {
64
+ opacity: 1;
65
+ transform: translateX(-50%) scale(1);
66
+ }
67
+
68
+ /* -------------------- POSITION: LEFT -------------------- */
69
+ .bs-tooltip:where([data-position="left"]) :where(.bs-tooltip-text) {
70
+ right: calc(100% + 0.5rem);
71
+ top: 50%;
72
+ transform-origin: center right;
73
+ transform: translateY(-50%) scale(0);
74
+ }
75
+
76
+ /* Active States */
77
+ :where(.bs-tooltip[data-position="left"]):hover :where(.bs-tooltip-text),
78
+ :where(.bs-tooltip[data-position="left"]):focus-within :where(.bs-tooltip-text),
79
+ :where(.bs-tooltip[data-position="left"])[data-shown] :where(.bs-tooltip-text) {
80
+ opacity: 1;
81
+ transform: translateY(-50%) scale(1);
82
+ }
83
+
84
+ /* -------------------- POSITION: RIGHT -------------------- */
85
+ .bs-tooltip:where([data-position="right"]) :where(.bs-tooltip-text) {
86
+ left: calc(100% + 0.5rem);
87
+ top: 50%;
88
+ transform-origin: center left;
89
+ transform: translateY(-50%) scale(0);
90
+ }
91
+
92
+ :where(.bs-tooltip[data-position="right"]):hover :where(.bs-tooltip-text),
93
+ :where(.bs-tooltip[data-position="right"]):focus-within :where(.bs-tooltip-text),
94
+ :where(.bs-tooltip[data-position="right"])[data-shown] :where(.bs-tooltip-text) {
95
+ opacity: 1;
96
+ transform: translateY(-50%) scale(1);
97
+ }
98
+
99
+ /* -------------------- POSITION: CORNERS -------------------- */
100
+ /* top-left */
101
+ .bs-tooltip:where([data-position="top-left"]) :where(.bs-tooltip-text) {
102
+ bottom: calc(100% + 0.5rem);
103
+ right: calc(100% + 0.5rem);
104
+ transform-origin: bottom right;
105
+ }
106
+
107
+ /* top-right */
108
+ .bs-tooltip:where([data-position="top-right"]) :where(.bs-tooltip-text) {
109
+ bottom: calc(100% + 0.5rem);
110
+ left: calc(100% + 0.5rem);
111
+ transform-origin: bottom left;
112
+ }
113
+
114
+ /* bottom-left */
115
+ .bs-tooltip:where([data-position="bottom-left"]) :where(.bs-tooltip-text) {
116
+ right: calc(100% + 0.5rem);
117
+ top: calc(100% + 0.5rem);
118
+ transform-origin: top right;
119
+ }
120
+
121
+ /* bottom-right */
122
+ .bs-tooltip:where([data-position="bottom-right"]) :where(.bs-tooltip-text) {
123
+ left: calc(100% + 0.5rem);
124
+ top: calc(100% + 0.5rem);
125
+ transform-origin: top left;
126
+ }
127
+
128
+ /* Active States */
129
+ :where(.bs-tooltip[data-position="top-left"]):hover :where(.bs-tooltip-text),
130
+ :where(.bs-tooltip[data-position="top-right"]):hover :where(.bs-tooltip-text),
131
+ :where(.bs-tooltip[data-position="bottom-left"]):hover :where(.bs-tooltip-text),
132
+ :where(.bs-tooltip[data-position="bottom-right"]):hover :where(.bs-tooltip-text),
133
+ :where(.bs-tooltip[data-position="top-left"]):focus-within :where(.bs-tooltip-text),
134
+ :where(.bs-tooltip[data-position="top-right"]):focus-within :where(.bs-tooltip-text),
135
+ :where(.bs-tooltip[data-position="bottom-left"]):focus-within :where(.bs-tooltip-text),
136
+ :where(.bs-tooltip[data-position="bottom-right"]):focus-within :where(.bs-tooltip-text),
137
+ :where(.bs-tooltip[data-position="top-left"])[data-shown] :where(.bs-tooltip-text),
138
+ :where(.bs-tooltip[data-position="top-right"])[data-shown] :where(.bs-tooltip-text),
139
+ :where(.bs-tooltip[data-position="bottom-left"])[data-shown] :where(.bs-tooltip-text),
140
+ :where(.bs-tooltip[data-position="bottom-right"])[data-shown] :where(.bs-tooltip-text) {
141
+ opacity: 1;
142
+ transform: scale(1);
143
+ }
144
+
145
+ /* -------------------- DISABLED -------------------- */
146
+ /*
147
+ Don't display unless data-shown is present
148
+ This must go last to properly override the other classes
149
+ */
150
+ :where(.bs-tooltip[data-disabled]:not([data-shown])):hover :where(.bs-tooltip-text),
151
+ :where(.bs-tooltip[data-disabled]:not([data-shown])):focus-within :where(.bs-tooltip-text) {
152
+ opacity: 0;
153
+ transform: scale(0);
154
+ }