@wovenui/components 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +284 -2
- package/dist/components.json +4204 -0
- package/dist/llms-full.txt +2839 -0
- package/dist/wovenui-kit.css +5002 -0
- package/dist/wovenui-kit.css.map +1 -0
- package/dist/wovenui-kit.iife.js +532 -0
- package/dist/wovenui-kit.js +529 -0
- package/dist/wovenui-kit.min.css +2 -0
- package/dist/wovenui-kit.min.css.map +1 -0
- package/package.json +268 -4
- package/src/_close.scss +45 -0
- package/src/_helpers.scss +11 -0
- package/src/_kit.scss +124 -0
- package/src/_shared.scss +10 -0
- package/src/components/_accordion.scss +132 -0
- package/src/components/_alert.scss +161 -0
- package/src/components/_autocomplete.scss +129 -0
- package/src/components/_avatar-group.scss +80 -0
- package/src/components/_avatar.scss +134 -0
- package/src/components/_badge.scss +91 -0
- package/src/components/_breadcrumb.scss +115 -0
- package/src/components/_btn-group.scss +113 -0
- package/src/components/_button.scss +301 -0
- package/src/components/_card.scss +120 -0
- package/src/components/_checkbox.scss +168 -0
- package/src/components/_code-block.scss +78 -0
- package/src/components/_confirm-modal.scss +75 -0
- package/src/components/_data-table.scss +79 -0
- package/src/components/_desc-list.scss +180 -0
- package/src/components/_divider.scss +66 -0
- package/src/components/_dot.scss +115 -0
- package/src/components/_drawer.scss +200 -0
- package/src/components/_dropdown.scss +182 -0
- package/src/components/_empty-state.scss +146 -0
- package/src/components/_field-group.scss +68 -0
- package/src/components/_field-message.scss +75 -0
- package/src/components/_field.scss +127 -0
- package/src/components/_form-actions.scss +58 -0
- package/src/components/_info-row.scss +69 -0
- package/src/components/_input-group.scss +87 -0
- package/src/components/_input.scss +278 -0
- package/src/components/_list.scss +76 -0
- package/src/components/_modal.scss +168 -0
- package/src/components/_page-header.scss +85 -0
- package/src/components/_pagination.scss +138 -0
- package/src/components/_panel.scss +69 -0
- package/src/components/_popover.scss +154 -0
- package/src/components/_progress-circle.scss +123 -0
- package/src/components/_progress.scss +122 -0
- package/src/components/_radio.scss +162 -0
- package/src/components/_segmented.scss +183 -0
- package/src/components/_select.scss +154 -0
- package/src/components/_sidebar.scss +300 -0
- package/src/components/_skeleton.scss +90 -0
- package/src/components/_spinner.scss +84 -0
- package/src/components/_stat.scss +92 -0
- package/src/components/_table.scss +460 -0
- package/src/components/_tabs.scss +327 -0
- package/src/components/_tag.scss +143 -0
- package/src/components/_text.scss +42 -0
- package/src/components/_textarea.scss +57 -0
- package/src/components/_timeline.scss +196 -0
- package/src/components/_title.scss +41 -0
- package/src/components/_toast.scss +221 -0
- package/src/components/_toggle.scss +171 -0
- package/src/components/_toolbar.scss +74 -0
- package/src/components/_topbar.scss +204 -0
- package/src/entries/accordion.scss +4 -0
- package/src/entries/alert.scss +4 -0
- package/src/entries/autocomplete.scss +4 -0
- package/src/entries/avatar-group.scss +4 -0
- package/src/entries/avatar.scss +4 -0
- package/src/entries/badge.scss +4 -0
- package/src/entries/breadcrumb.scss +4 -0
- package/src/entries/btn-group.scss +4 -0
- package/src/entries/button.scss +4 -0
- package/src/entries/card.scss +4 -0
- package/src/entries/checkbox.scss +4 -0
- package/src/entries/code-block.scss +4 -0
- package/src/entries/confirm-modal.scss +4 -0
- package/src/entries/data-table.scss +4 -0
- package/src/entries/desc-list.scss +4 -0
- package/src/entries/divider.scss +4 -0
- package/src/entries/dot.scss +4 -0
- package/src/entries/drawer.scss +4 -0
- package/src/entries/dropdown.scss +4 -0
- package/src/entries/empty-state.scss +4 -0
- package/src/entries/field-group.scss +4 -0
- package/src/entries/field-message.scss +4 -0
- package/src/entries/field.scss +4 -0
- package/src/entries/form-actions.scss +4 -0
- package/src/entries/info-row.scss +4 -0
- package/src/entries/input-group.scss +4 -0
- package/src/entries/input.scss +4 -0
- package/src/entries/list.scss +4 -0
- package/src/entries/modal.scss +4 -0
- package/src/entries/page-header.scss +4 -0
- package/src/entries/pagination.scss +4 -0
- package/src/entries/panel.scss +4 -0
- package/src/entries/popover.scss +4 -0
- package/src/entries/progress-circle.scss +4 -0
- package/src/entries/progress.scss +4 -0
- package/src/entries/radio.scss +4 -0
- package/src/entries/segmented.scss +4 -0
- package/src/entries/select.scss +4 -0
- package/src/entries/sidebar.scss +4 -0
- package/src/entries/skeleton.scss +4 -0
- package/src/entries/spinner.scss +4 -0
- package/src/entries/stat.scss +4 -0
- package/src/entries/table.scss +4 -0
- package/src/entries/tabs.scss +4 -0
- package/src/entries/tag.scss +4 -0
- package/src/entries/text.scss +4 -0
- package/src/entries/textarea.scss +4 -0
- package/src/entries/timeline.scss +4 -0
- package/src/entries/title.scss +4 -0
- package/src/entries/toast.scss +4 -0
- package/src/entries/toggle.scss +4 -0
- package/src/entries/toolbar.scss +4 -0
- package/src/entries/topbar.scss +4 -0
- package/src/index.scss +7 -0
- package/src/js/autocomplete.js +86 -0
- package/src/js/data-table.js +141 -0
- package/src/js/index.js +34 -0
- package/src/js/input-clear.js +25 -0
- package/src/js/package.json +3 -0
- package/src/js/tabs.js +73 -0
- package/src/js/toast.js +161 -0
- package/src/js/util.js +21 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
////
|
|
2
|
+
//// @component wu-toolbar
|
|
3
|
+
//// Wrapping row of controls, with groups, separators, an end group and a boxed variant.
|
|
4
|
+
////
|
|
5
|
+
//// A toolbar holds controls of one height, so it lines up by itself. Status displays such as tags and badges go outside the row.
|
|
6
|
+
////
|
|
7
|
+
//// `role="toolbar"` promises arrow-key focus, so add it only with a script that provides it; otherwise use a plain `div`.
|
|
8
|
+
////
|
|
9
|
+
//// @since 1.0.0
|
|
10
|
+
//// @needs none
|
|
11
|
+
//// @js none
|
|
12
|
+
//// @example html
|
|
13
|
+
//// <div class="wu-toolbar">
|
|
14
|
+
//// <div class="wu-toolbar-group">
|
|
15
|
+
//// <button class="wu-btn sm" type="button">Bold</button>
|
|
16
|
+
//// <button class="wu-btn sm" type="button">Italic</button>
|
|
17
|
+
//// </div>
|
|
18
|
+
//// <span class="wu-toolbar-separator" aria-hidden="true"></span>
|
|
19
|
+
//// <div class="wu-toolbar-end">
|
|
20
|
+
//// <button class="wu-btn brand sm" type="button">Publish</button>
|
|
21
|
+
//// </div>
|
|
22
|
+
//// </div>
|
|
23
|
+
//// @example html
|
|
24
|
+
//// <div class="wu-toolbar boxed">
|
|
25
|
+
//// <span class="wu-text sm">3 selected</span>
|
|
26
|
+
//// <button class="wu-btn sm" type="button">Archive</button>
|
|
27
|
+
//// </div>
|
|
28
|
+
//// @modifier boxed - Border, padding and the alternate background @since 1.0.0
|
|
29
|
+
//// @modifier sm - Smaller gap @since 1.0.0
|
|
30
|
+
//// @part wu-toolbar-group - Controls that stay together @since 1.0.0
|
|
31
|
+
//// @part wu-toolbar-separator - Vertical line between groups @since 1.0.0
|
|
32
|
+
//// @part wu-toolbar-end - Pushes itself and what follows to the end @since 1.0.0
|
|
33
|
+
////
|
|
34
|
+
|
|
35
|
+
@use "@wovenui/core/mixins" as woven;
|
|
36
|
+
|
|
37
|
+
.wu-toolbar {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: woven.token(space-2);
|
|
42
|
+
color: woven.token(text-regular);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.wu-toolbar-group,
|
|
46
|
+
.wu-toolbar-end {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-wrap: wrap;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: inherit;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Pushes itself and what follows to the end
|
|
54
|
+
.wu-toolbar-end {
|
|
55
|
+
margin-inline-start: auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.wu-toolbar-separator {
|
|
59
|
+
align-self: stretch;
|
|
60
|
+
width: woven.token(border-width-1);
|
|
61
|
+
margin-block: woven.token(space-1);
|
|
62
|
+
background: woven.token(border-regular);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.wu-toolbar.boxed {
|
|
66
|
+
padding: woven.token(space-2);
|
|
67
|
+
border: woven.token(border-width-1) solid woven.token(border-regular);
|
|
68
|
+
border-radius: woven.token(radius-md);
|
|
69
|
+
background: woven.token(bg-alternate);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.wu-toolbar.sm {
|
|
73
|
+
gap: woven.token(space-1);
|
|
74
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
////
|
|
2
|
+
//// @component wu-topbar
|
|
3
|
+
//// Application header with a brand, a scrolling nav, an end group, a pinned variant and a page progress line.
|
|
4
|
+
////
|
|
5
|
+
//// `wu-topbar-nav` works on the `nav` itself or on the `ul` inside it. When space runs out the nav scrolls first, then the brand truncates.
|
|
6
|
+
////
|
|
7
|
+
//// The bar stays in the flow; add `pinned` to stick it to the top. The progress line is decoration, so mark it `aria-hidden="true"`; it fills as the page scrolls and stays hidden when reduced motion is set.
|
|
8
|
+
////
|
|
9
|
+
//// @since 1.0.0
|
|
10
|
+
//// @needs none
|
|
11
|
+
//// @js none
|
|
12
|
+
//// @example html
|
|
13
|
+
//// <header class="wu-topbar pinned">
|
|
14
|
+
//// <a class="wu-topbar-brand" href="/">Acme</a>
|
|
15
|
+
//// <nav aria-label="Main">
|
|
16
|
+
//// <ul class="wu-topbar-nav">
|
|
17
|
+
//// <li><a class="wu-topbar-link" href="/dashboard" aria-current="page">Dashboard</a></li>
|
|
18
|
+
//// <li><a class="wu-topbar-link" href="/billing">Billing</a></li>
|
|
19
|
+
//// </ul>
|
|
20
|
+
//// </nav>
|
|
21
|
+
//// <div class="wu-topbar-end">
|
|
22
|
+
//// <button class="wu-btn sm" type="button">Sign out</button>
|
|
23
|
+
//// </div>
|
|
24
|
+
//// <div class="wu-topbar-progress" aria-hidden="true"></div>
|
|
25
|
+
//// </header>
|
|
26
|
+
//// @example html
|
|
27
|
+
//// <header class="wu-topbar">
|
|
28
|
+
//// <a class="wu-topbar-brand" href="/">Acme</a>
|
|
29
|
+
//// <nav class="wu-topbar-nav" aria-label="Main">
|
|
30
|
+
//// <a class="wu-topbar-link" href="/billing" aria-current="page">Billing</a>
|
|
31
|
+
//// <a class="wu-topbar-link" href="/team">Team</a>
|
|
32
|
+
//// </nav>
|
|
33
|
+
//// </header>
|
|
34
|
+
//// @modifier pinned - Sticks to the top of its scroll container, with a shadow once stuck @since 1.0.0
|
|
35
|
+
//// @part wu-topbar-brand - Brand link or text; truncates last @since 1.0.0
|
|
36
|
+
//// @part wu-topbar-nav - Nav, or its list, that takes the free space and scrolls sideways @since 1.0.0
|
|
37
|
+
//// @part wu-topbar-link - Nav link; a direct child `svg` is sized to `1em` @since 1.0.0
|
|
38
|
+
//// @part wu-topbar-end - Group pushed to the inline end @since 1.0.0
|
|
39
|
+
//// @part wu-topbar-progress - Line along the bottom edge that fills as the page scrolls @since 1.0.0
|
|
40
|
+
//// @state aria-current="page" - On a link: current page, brand underline @since 1.0.0
|
|
41
|
+
////
|
|
42
|
+
|
|
43
|
+
@use "@wovenui/core/mixins" as woven;
|
|
44
|
+
|
|
45
|
+
.wu-topbar {
|
|
46
|
+
position: relative;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
gap: woven.token(space-4);
|
|
50
|
+
min-height: woven.token(space-16);
|
|
51
|
+
padding-inline: woven.token(space-4);
|
|
52
|
+
overflow-x: clip;
|
|
53
|
+
border-block-end: woven.token(border-width-1) solid woven.token(border-regular);
|
|
54
|
+
background: woven.token(bg-surface);
|
|
55
|
+
color: woven.token(text-regular);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.wu-topbar-brand {
|
|
59
|
+
display: inline-flex;
|
|
60
|
+
flex: 0 1 auto;
|
|
61
|
+
align-items: center;
|
|
62
|
+
gap: woven.token(space-2);
|
|
63
|
+
min-width: 0;
|
|
64
|
+
overflow: hidden;
|
|
65
|
+
color: inherit;
|
|
66
|
+
font-weight: woven.token(font-weight-semibold);
|
|
67
|
+
text-decoration: none;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
|
|
71
|
+
&:focus-visible {
|
|
72
|
+
outline: woven.token(border-focus-width) solid woven.token(border-focus);
|
|
73
|
+
outline-offset: woven.token(border-focus-offset);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// On <nav> with links, or on its <ul>; scrolls sideways when it runs out of room.
|
|
78
|
+
// A zero basis lets it take the free space and give it up before the brand and the end group.
|
|
79
|
+
.wu-topbar-nav,
|
|
80
|
+
.wu-topbar > :has(> .wu-topbar-nav) {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex: 1 1 0;
|
|
83
|
+
align-self: stretch;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.wu-topbar-nav {
|
|
88
|
+
gap: woven.token(space-1);
|
|
89
|
+
margin: 0;
|
|
90
|
+
padding: 0;
|
|
91
|
+
overflow-x: auto;
|
|
92
|
+
list-style: none;
|
|
93
|
+
|
|
94
|
+
> li {
|
|
95
|
+
display: flex;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.wu-topbar-link {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
gap: woven.token(space-2);
|
|
103
|
+
padding-inline: woven.token(space-3);
|
|
104
|
+
box-shadow: inset 0 calc(-1 * #{woven.token(border-width-2)}) 0 transparent;
|
|
105
|
+
color: woven.token(text-muted);
|
|
106
|
+
font-size: woven.token(font-size-sm);
|
|
107
|
+
font-weight: woven.token(font-weight-medium);
|
|
108
|
+
text-decoration: none;
|
|
109
|
+
white-space: nowrap;
|
|
110
|
+
transition-property: color, box-shadow;
|
|
111
|
+
transition-duration: woven.token(duration-150);
|
|
112
|
+
transition-timing-function: woven.token(ease-out);
|
|
113
|
+
|
|
114
|
+
&:hover {
|
|
115
|
+
color: woven.token(text-regular);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Inset ring, so the scrolling nav does not clip it
|
|
119
|
+
&:focus-visible {
|
|
120
|
+
outline: woven.token(border-focus-width) solid woven.token(border-focus);
|
|
121
|
+
outline-offset: calc(-1 * #{woven.token(border-focus-width)});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&[aria-current="page"] {
|
|
125
|
+
box-shadow: inset 0 calc(-1 * #{woven.token(border-width-2)}) 0 woven.token(brand);
|
|
126
|
+
color: woven.token(text-regular);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
> svg {
|
|
130
|
+
flex-shrink: 0;
|
|
131
|
+
width: 1em;
|
|
132
|
+
height: 1em;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.wu-topbar-end {
|
|
137
|
+
display: flex;
|
|
138
|
+
flex: none;
|
|
139
|
+
align-items: center;
|
|
140
|
+
gap: woven.token(space-2);
|
|
141
|
+
margin-inline-start: auto;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.wu-topbar.pinned {
|
|
145
|
+
position: sticky;
|
|
146
|
+
inset-block-start: 0;
|
|
147
|
+
z-index: woven.token(z-sticky);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Shadow only once the bar is stuck; the bottom border is the fallback
|
|
151
|
+
@supports (container-type: scroll-state) {
|
|
152
|
+
.wu-topbar.pinned {
|
|
153
|
+
container-type: scroll-state;
|
|
154
|
+
|
|
155
|
+
&::after {
|
|
156
|
+
content: "";
|
|
157
|
+
position: absolute;
|
|
158
|
+
inset: 0;
|
|
159
|
+
box-shadow: woven.token(shadow-md);
|
|
160
|
+
opacity: 0;
|
|
161
|
+
pointer-events: none;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@container scroll-state(stuck: top) {
|
|
166
|
+
.wu-topbar.pinned::after {
|
|
167
|
+
opacity: 1;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Page progress: <div class="wu-topbar-progress" aria-hidden="true">, filled by page scroll where supported
|
|
173
|
+
.wu-topbar-progress {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@supports (animation-timeline: scroll()) {
|
|
178
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
179
|
+
.wu-topbar-progress {
|
|
180
|
+
display: block;
|
|
181
|
+
position: absolute;
|
|
182
|
+
inset-inline: 0;
|
|
183
|
+
inset-block-end: calc(-1 * #{woven.token(border-width-1)});
|
|
184
|
+
height: woven.token(border-width-2);
|
|
185
|
+
background: woven.token(brand);
|
|
186
|
+
transform-origin: left;
|
|
187
|
+
scale: 0 1;
|
|
188
|
+
animation-name: wu-topbar-progress;
|
|
189
|
+
animation-timing-function: linear;
|
|
190
|
+
animation-fill-mode: both;
|
|
191
|
+
animation-timeline: scroll(root block);
|
|
192
|
+
|
|
193
|
+
&:dir(rtl) {
|
|
194
|
+
transform-origin: right;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@keyframes wu-topbar-progress {
|
|
201
|
+
to {
|
|
202
|
+
scale: 1 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
package/src/index.scss
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @wovenui/components: one bundled entry. Core mixins load once; components output only kit rules.
|
|
2
|
+
@use "kit";
|
|
3
|
+
|
|
4
|
+
// Switch components off: @use "@wovenui/components" with ($components: ("button": false))
|
|
5
|
+
$components: () !default;
|
|
6
|
+
|
|
7
|
+
@include kit.emit(kit.enabled($components));
|