@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 AALA IT Solutions
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,285 @@
|
|
|
1
|
-
#
|
|
1
|
+
# WovenUI Components
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
HTML and CSS components (a UI kit) for the WovenUI design system: buttons, cards, forms, tables, modals, drawers, dropdowns, tabs, toasts and more, written as plain markup with `wu-` classes.
|
|
4
|
+
|
|
5
|
+
**[Live docs and demos](https://wovenui.com/components/docs/)** · [Components site](https://wovenui.com/components/) · [GitHub](https://github.com/WovenUI/components)
|
|
6
|
+
|
|
7
|
+
WovenUI Components needs one companion package, [`@wovenui/core`](https://www.npmjs.com/package/@wovenui/core). Core provides the design tokens (shared CSS variables for colors, spacing, radii and type) and the light and dark themes; the components read those variables, so they change with the theme.
|
|
8
|
+
|
|
9
|
+
## Quick start
|
|
10
|
+
|
|
11
|
+
Save this as an HTML file and open it in a browser. It loads core and the components from a CDN and shows a button that opens a modal, with no JavaScript:
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<!doctype html>
|
|
15
|
+
<html lang="en">
|
|
16
|
+
<head>
|
|
17
|
+
<meta charset="utf-8">
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
19
|
+
<title>WovenUI Components</title>
|
|
20
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@wovenui/core/dist/wovenui.min.css">
|
|
21
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@wovenui/components/dist/wovenui-kit.min.css">
|
|
22
|
+
<!-- Optional: only for tabs, toast, autocomplete, data table sorting, table row selection and the input clear button -->
|
|
23
|
+
<script src="https://cdn.jsdelivr.net/npm/@wovenui/components/dist/wovenui-kit.iife.js" defer></script>
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
<button class="wu-btn brand" type="button" commandfor="hello" command="show-modal">Open the modal</button>
|
|
27
|
+
|
|
28
|
+
<dialog class="wu-modal" id="hello" aria-labelledby="hello-title" closedby="any">
|
|
29
|
+
<header class="wu-modal-header">
|
|
30
|
+
<h2 class="wu-modal-title" id="hello-title">Hello</h2>
|
|
31
|
+
<button class="wu-modal-close" type="button" commandfor="hello" command="close" aria-label="Close"></button>
|
|
32
|
+
</header>
|
|
33
|
+
<div class="wu-modal-body">This modal is a native dialog element, opened by the button with no script.</div>
|
|
34
|
+
<form class="wu-modal-footer" method="dialog">
|
|
35
|
+
<button class="wu-btn">Cancel</button>
|
|
36
|
+
<button class="wu-btn brand" value="confirm">Save</button>
|
|
37
|
+
</form>
|
|
38
|
+
</dialog>
|
|
39
|
+
</body>
|
|
40
|
+
</html>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The `commandfor` attribute on a button names the element it controls, and `command` says what to do (`show-modal`, `close`). The browser opens and closes the dialog, moves focus and handles the Esc key.
|
|
44
|
+
|
|
45
|
+
The script line is optional. Leave it out unless the page uses tabs, toasts, autocomplete, data table sorting, table row selection and expandable rows, or the input clear button.
|
|
46
|
+
|
|
47
|
+
The same paths work on unpkg (`https://unpkg.com/@wovenui/components/...`). For production, pin an exact version after the package name.
|
|
48
|
+
|
|
49
|
+
## Install
|
|
50
|
+
|
|
51
|
+
### CSS only
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm i @wovenui/core @wovenui/components
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Load core first, then the components:
|
|
58
|
+
|
|
59
|
+
```html
|
|
60
|
+
<link rel="stylesheet" href="node_modules/@wovenui/core/dist/wovenui.min.css">
|
|
61
|
+
<link rel="stylesheet" href="node_modules/@wovenui/components/dist/wovenui-kit.min.css">
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### With Sass
|
|
65
|
+
|
|
66
|
+
To compile the components from SCSS (turn components off, load one component at a time, share your core settings), add Dart Sass:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npm i @wovenui/core @wovenui/components sass
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
See [SCSS setup](#scss-setup) below.
|
|
73
|
+
|
|
74
|
+
### Download
|
|
75
|
+
|
|
76
|
+
Download the built CSS and JS files from [wovenui.com](https://wovenui.com/components/docs/install/#direct-download) and host them yourself. Load the core CSS first, then the components CSS, then the script if you use it.
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- [`@wovenui/core`](https://www.npmjs.com/package/@wovenui/core), loaded before the components.
|
|
81
|
+
- Dart Sass `>=1.79.0 <2`, only when you compile from SCSS. The prebuilt CSS needs no Sass.
|
|
82
|
+
|
|
83
|
+
Works in current Chrome, Firefox and Safari.
|
|
84
|
+
|
|
85
|
+
## Components
|
|
86
|
+
|
|
87
|
+
Each name links to its page with live examples.
|
|
88
|
+
|
|
89
|
+
- **Actions:** [Button](https://wovenui.com/components/docs/button/), [Button group](https://wovenui.com/components/docs/btn-group/)
|
|
90
|
+
- **Data display:** [Avatar](https://wovenui.com/components/docs/avatar/), [Avatar group](https://wovenui.com/components/docs/avatar-group/), [Badge](https://wovenui.com/components/docs/badge/), [Description list](https://wovenui.com/components/docs/desc-list/), [Info row](https://wovenui.com/components/docs/info-row/), [List](https://wovenui.com/components/docs/list/), [Stat](https://wovenui.com/components/docs/stat/), [Table](https://wovenui.com/components/docs/table/), [Tag](https://wovenui.com/components/docs/tag/), [Timeline](https://wovenui.com/components/docs/timeline/)
|
|
91
|
+
- **Feedback and status:** [Alert](https://wovenui.com/components/docs/alert/), [Circular progress](https://wovenui.com/components/docs/progress-circle/), [Empty state](https://wovenui.com/components/docs/empty-state/), [Progress bar](https://wovenui.com/components/docs/progress/), [Skeleton loader](https://wovenui.com/components/docs/skeleton/), [Spinner](https://wovenui.com/components/docs/spinner/), [Status dot](https://wovenui.com/components/docs/dot/)
|
|
92
|
+
- **Surfaces and text:** [Card](https://wovenui.com/components/docs/card/), [Code block](https://wovenui.com/components/docs/code-block/), [Divider](https://wovenui.com/components/docs/divider/), [Heading](https://wovenui.com/components/docs/title/), [Panel](https://wovenui.com/components/docs/panel/), [Text](https://wovenui.com/components/docs/text/)
|
|
93
|
+
- **Navigation and layout:** [Breadcrumb](https://wovenui.com/components/docs/breadcrumb/), [Page header](https://wovenui.com/components/docs/page-header/), [Pagination](https://wovenui.com/components/docs/pagination/), [Sidebar](https://wovenui.com/components/docs/sidebar/), [Toolbar](https://wovenui.com/components/docs/toolbar/), [Top bar](https://wovenui.com/components/docs/topbar/)
|
|
94
|
+
- **Forms:** [Checkbox](https://wovenui.com/components/docs/checkbox/), [Field message](https://wovenui.com/components/docs/field-message/), [Form actions](https://wovenui.com/components/docs/form-actions/), [Form field](https://wovenui.com/components/docs/field/), [Form field group](https://wovenui.com/components/docs/field-group/), [Input group](https://wovenui.com/components/docs/input-group/), [Radio button](https://wovenui.com/components/docs/radio/), [Segmented control](https://wovenui.com/components/docs/segmented/), [Select](https://wovenui.com/components/docs/select/), [Text input](https://wovenui.com/components/docs/input/), [Textarea](https://wovenui.com/components/docs/textarea/), [Toggle switch](https://wovenui.com/components/docs/toggle/)
|
|
95
|
+
- **Overlays and disclosure:** [Accordion](https://wovenui.com/components/docs/accordion/), [Confirmation dialog](https://wovenui.com/components/docs/confirm-modal/), [Drawer](https://wovenui.com/components/docs/drawer/), [Dropdown menu](https://wovenui.com/components/docs/dropdown/), [Modal](https://wovenui.com/components/docs/modal/), [Popover](https://wovenui.com/components/docs/popover/), [Tooltip](https://wovenui.com/components/docs/tooltip/) (part of core)
|
|
96
|
+
- **Interactive:** [Autocomplete](https://wovenui.com/components/docs/autocomplete/), [Data table](https://wovenui.com/components/docs/data-table/), [Tabs](https://wovenui.com/components/docs/tabs/), [Toast notification](https://wovenui.com/components/docs/toast/)
|
|
97
|
+
|
|
98
|
+
## Overview
|
|
99
|
+
|
|
100
|
+
- **CSS first.** Most components need no JavaScript. A small optional script, with no dependencies, covers the few that do.
|
|
101
|
+
- **Native HTML.** Modals and drawers are `<dialog>` elements opened with the `commandfor` attribute. Dropdowns and popovers use the `popover` attribute, open under their trigger and flip when there is no room. Accordions are `<details>` elements; accordions that share a `name` keep only one open.
|
|
102
|
+
- **Right to left.** Components use logical properties, so they follow `dir="rtl"` from the same stylesheet, with no separate RTL build.
|
|
103
|
+
- **Themes from core.** Colors, spacing, radii and type come from core. Change them once in core and the components follow, in light, dark, high-contrast and inverse sections (a section shown in the opposite theme of the page).
|
|
104
|
+
- **No motion unless you ask.** Animations are off until you turn them on, and they never run when the visitor has asked the system to reduce motion.
|
|
105
|
+
- **Bring your own icons.** Built-in indicators (select arrows, accordion chevrons, close marks) are drawn in CSS, and the package ships no icon files. An `svg` placed directly inside a component is sized to the text and keeps its own colors.
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<article class="wu-card">
|
|
109
|
+
<header class="wu-card-header">
|
|
110
|
+
<h3 class="wu-card-title">Team plan</h3>
|
|
111
|
+
<span class="wu-badge success">Active</span>
|
|
112
|
+
</header>
|
|
113
|
+
<div class="wu-card-body">Seats, billing and members.</div>
|
|
114
|
+
<footer class="wu-card-footer">
|
|
115
|
+
<button class="wu-btn" type="button">Manage seats</button>
|
|
116
|
+
<button class="wu-btn brand" type="button">Invite</button>
|
|
117
|
+
</footer>
|
|
118
|
+
</article>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Naming
|
|
122
|
+
|
|
123
|
+
- The component root carries the `wu-` prefix: `wu-btn`, `wu-card`, `wu-modal`.
|
|
124
|
+
- Modifiers are bare words, valid only together with the root: `wu-btn brand sm`. The CSS emits them as compounds (`.wu-btn.brand`), never alone, so they do not clash with other class names.
|
|
125
|
+
- Parts use the root name plus a part: `wu-card-header`, `wu-modal-body`.
|
|
126
|
+
- Color words are core role names: `brand`, `success`, `danger`, `warning`, `info`. There is no `primary`.
|
|
127
|
+
- State lives in attributes (`aria-selected`, `aria-expanded`, `aria-pressed`, `hidden`, `open`), not classes.
|
|
128
|
+
|
|
129
|
+
```html
|
|
130
|
+
<button class="wu-btn brand lg" type="button">Save</button>
|
|
131
|
+
<button class="wu-btn danger sm" type="button">Delete</button>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
A dropdown on the `popover` attribute, with no script:
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<button class="wu-btn" type="button" popovertarget="menu1">Actions</button>
|
|
138
|
+
<div class="wu-dropdown" id="menu1" popover>
|
|
139
|
+
<a class="wu-dropdown-item" href="/edit">Edit</a>
|
|
140
|
+
<button class="wu-dropdown-item danger" type="button" popovertarget="menu1" popovertargetaction="hide">Delete</button>
|
|
141
|
+
</div>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Right to left
|
|
145
|
+
|
|
146
|
+
Set `dir="rtl"` on the page or on one section, and components follow it. Arrows the kit draws itself turn on their own. For your own directional icons, `wu-mirror` flips the element in right to left:
|
|
147
|
+
|
|
148
|
+
```html
|
|
149
|
+
<section lang="ar" dir="rtl">
|
|
150
|
+
<a class="wu-btn" href="/back"><svg class="wu-mirror" aria-hidden="true">...</svg>رجوع</a>
|
|
151
|
+
</section>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Animations
|
|
155
|
+
|
|
156
|
+
Turn motion on per component with the word `animated`, or for a page or section with `wu-animated` on an ancestor:
|
|
157
|
+
|
|
158
|
+
```html
|
|
159
|
+
<button class="wu-btn brand animated" type="button">Save</button>
|
|
160
|
+
|
|
161
|
+
<body class="wu-animated">...</body>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Motion runs only when the visitor's system allows it (`prefers-reduced-motion: no-preference`).
|
|
165
|
+
|
|
166
|
+
## JavaScript
|
|
167
|
+
|
|
168
|
+
Most components are CSS only. These need the script: tabs, toast, autocomplete, data table sorting, table row selection and expandable rows, and the input clear button. Modals, drawers, dropdowns, popovers and accordions need none.
|
|
169
|
+
|
|
170
|
+
The script looks for these components by their class (`wu-tabs`, `wu-toast-region`, `wu-autocomplete`, `wu-table`, `wu-data-table`, `wu-input-clear`) and starts them when the page loads. There is no setup attribute.
|
|
171
|
+
|
|
172
|
+
Drop-in script, which defines the global `WovenUIKit`:
|
|
173
|
+
|
|
174
|
+
```html
|
|
175
|
+
<script src="node_modules/@wovenui/components/dist/wovenui-kit.iife.js" defer></script>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
ES module:
|
|
179
|
+
|
|
180
|
+
```js
|
|
181
|
+
import { init, toast } from '@wovenui/components/js';
|
|
182
|
+
|
|
183
|
+
toast('Your changes are live.', { title: 'Saved', variant: 'success' });
|
|
184
|
+
toast('Upload failed.', { title: 'Error', variant: 'danger', duration: 0 }); // stays until closed
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
| Export | Use |
|
|
188
|
+
| --- | --- |
|
|
189
|
+
| `init(root)` | Starts every kit component inside `root` (`document` by default), including content added later. Each element starts once |
|
|
190
|
+
| `toast(message, options)` | Shows a toast and returns its element. Options: `title`, `variant`, `duration` (milliseconds, 0 keeps it), `closeLabel` |
|
|
191
|
+
| `dismiss(element)` | Closes a toast |
|
|
192
|
+
| `sortTable(table, th)` | Sorts a data table by a header cell |
|
|
193
|
+
| `initTabs`, `initToast`, `initAutocomplete`, `initDataTable`, `initTable`, `initInputClear` | Start one kind of component inside a root |
|
|
194
|
+
|
|
195
|
+
Apps built with React, Vue or another framework can skip the script and keep the CSS: set the same attributes (`aria-selected`, `aria-expanded`, `aria-sort`, `hidden`) from component state.
|
|
196
|
+
|
|
197
|
+
## Package files
|
|
198
|
+
|
|
199
|
+
| Export | File |
|
|
200
|
+
| --- | --- |
|
|
201
|
+
| `@wovenui/components` (`style`, `default`), `@wovenui/components/min.css` | `dist/wovenui-kit.min.css` |
|
|
202
|
+
| `@wovenui/components/css` | `dist/wovenui-kit.css` |
|
|
203
|
+
| `@wovenui/components/js` | `dist/wovenui-kit.js` (ES module) |
|
|
204
|
+
| `dist/wovenui-kit.iife.js` | Drop-in script, global `WovenUIKit` |
|
|
205
|
+
| `dist/llms-full.txt` | AI guide (below) |
|
|
206
|
+
|
|
207
|
+
## AI guide
|
|
208
|
+
|
|
209
|
+
`dist/llms-full.txt` ships in the package and is also at https://wovenui.com/components/llms-full.txt. Give it to an AI coding assistant so it writes correct markup: every component, its classes, modifiers, variables and examples.
|
|
210
|
+
|
|
211
|
+
## SCSS setup
|
|
212
|
+
|
|
213
|
+
### SCSS bundle
|
|
214
|
+
|
|
215
|
+
Through a bundler (Vite, webpack), which reads the package `sass` export, load all components in your global stylesheet:
|
|
216
|
+
|
|
217
|
+
```scss
|
|
218
|
+
@use "@wovenui/core";
|
|
219
|
+
@use "@wovenui/components";
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Every component is on by default. Turn components off with `$components`:
|
|
223
|
+
|
|
224
|
+
```scss
|
|
225
|
+
@use "@wovenui/components" with ($components: ("toast": false, "data-table": false));
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
A component that needs another one stops the compile with an error naming both when the needed one is off:
|
|
229
|
+
|
|
230
|
+
| Component | Needs |
|
|
231
|
+
| --- | --- |
|
|
232
|
+
| `btn-group` | `button` |
|
|
233
|
+
| `avatar-group` | `avatar` |
|
|
234
|
+
| `pagination` | `button` |
|
|
235
|
+
| `confirm-modal` | `modal`, `button` |
|
|
236
|
+
| `autocomplete` | `input` |
|
|
237
|
+
| `data-table` | `table` |
|
|
238
|
+
|
|
239
|
+
### Per-component entries
|
|
240
|
+
|
|
241
|
+
For CSS modules and component `<style>` blocks, load one component with what it needs:
|
|
242
|
+
|
|
243
|
+
```scss
|
|
244
|
+
@use "@wovenui/components/button";
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Every component has an entry named after it: `@wovenui/components/modal`, `@wovenui/components/data-table` and so on. Each entry also emits the shared kit values (`:root` custom properties such as `--wu-kit-ease-spring`).
|
|
248
|
+
|
|
249
|
+
Pick one path per project: the bundle or per-component entries, not both. Shared rules would be emitted twice.
|
|
250
|
+
|
|
251
|
+
### Configuration
|
|
252
|
+
|
|
253
|
+
Configure core once in a partial, as in the [core setup](https://www.npmjs.com/package/@wovenui/core). The components load `@wovenui/core/mixins` and follow the same configuration:
|
|
254
|
+
|
|
255
|
+
```scss
|
|
256
|
+
// src/styles/_woven.scss
|
|
257
|
+
@forward "@wovenui/core/mixins" with ($brand: #4361ee);
|
|
258
|
+
|
|
259
|
+
// src/styles/global.scss
|
|
260
|
+
@use "woven";
|
|
261
|
+
@use "@wovenui/core";
|
|
262
|
+
@use "@wovenui/components";
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
`@use "woven"` comes first, before core and the components load.
|
|
266
|
+
|
|
267
|
+
Compile through a bundler. The `sass` command line on its own cannot find the package files the components load; without a bundler, use the prebuilt CSS.
|
|
268
|
+
|
|
269
|
+
### Cascade layers
|
|
270
|
+
|
|
271
|
+
The CSS declares the layer order `@layer reset, base, components, recipes;`. Core uses the first three; `recipes` is an extra layer above the components, for patterns you build from them, and the package puts nothing in it. Every component lives in `@layer components`. Utility classes and your own unlayered CSS win over the components without `!important`.
|
|
272
|
+
|
|
273
|
+
## Documentation
|
|
274
|
+
|
|
275
|
+
- [Documentation](https://wovenui.com/components/docs/), one page per component with live examples
|
|
276
|
+
- [Install and download](https://wovenui.com/components/docs/install/)
|
|
277
|
+
- [JavaScript](https://wovenui.com/components/docs/javascript/)
|
|
278
|
+
- [Right to left](https://wovenui.com/components/docs/rtl/)
|
|
279
|
+
- [WovenUI Components site](https://wovenui.com/components/)
|
|
280
|
+
- [WovenUI core](https://wovenui.com/core/)
|
|
281
|
+
- [GitHub repository](https://github.com/WovenUI/components)
|
|
282
|
+
|
|
283
|
+
## License
|
|
284
|
+
|
|
285
|
+
WovenUI Components is open source under the [MIT License](LICENSE). Copyright (c) AALA IT Solutions.
|