@iyulab/components 0.2.0 → 0.2.2
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/CHANGELOG.md +118 -105
- package/LICENSE +20 -20
- package/README.md +283 -26
- package/dist/assets/icons/arrow-down.svg.js +1 -1
- package/dist/assets/icons/arrow-repeat.svg.js +1 -1
- package/dist/assets/icons/arrow-up.svg.js +1 -1
- package/dist/assets/icons/ban.svg.js +1 -1
- package/dist/assets/icons/bell-fill.svg.js +1 -1
- package/dist/assets/icons/box-arrow-up-right.svg.js +1 -1
- package/dist/assets/icons/check-circle-fill.svg.js +1 -1
- package/dist/assets/icons/check-lg.svg.js +1 -1
- package/dist/assets/icons/chevron-down.svg.js +1 -1
- package/dist/assets/icons/chevron-left.svg.js +1 -1
- package/dist/assets/icons/chevron-right.svg.js +1 -1
- package/dist/assets/icons/chevron-up.svg.js +1 -1
- package/dist/assets/icons/copy.svg.js +1 -1
- package/dist/assets/icons/dash-lg.svg.js +1 -1
- package/dist/assets/icons/exclamation-circle-fill.svg.js +1 -1
- package/dist/assets/icons/exclamation-triangle-fill.svg.js +1 -1
- package/dist/assets/icons/eye-slash.svg.js +1 -1
- package/dist/assets/icons/eye.svg.js +1 -1
- package/dist/assets/icons/file-earmark.svg.js +1 -1
- package/dist/assets/icons/flag.svg.js +1 -1
- package/dist/assets/icons/globe.svg.js +1 -1
- package/dist/assets/icons/hand-thumbs-down-fill.svg.js +1 -1
- package/dist/assets/icons/hand-thumbs-down.svg.js +1 -1
- package/dist/assets/icons/hand-thumbs-up-fill.svg.js +1 -1
- package/dist/assets/icons/hand-thumbs-up.svg.js +1 -1
- package/dist/assets/icons/info-circle-fill.svg.js +1 -1
- package/dist/assets/icons/lightbulb-fill.svg.js +1 -1
- package/dist/assets/icons/lightbulb-off.svg.js +1 -1
- package/dist/assets/icons/lightbulb.svg.js +1 -1
- package/dist/assets/icons/mic-fill.svg.js +1 -1
- package/dist/assets/icons/mic-mute-fill.svg.js +1 -1
- package/dist/assets/icons/paperclip.svg.js +1 -1
- package/dist/assets/icons/pencil-square.svg.js +1 -1
- package/dist/assets/icons/plus-lg.svg.js +1 -1
- package/dist/assets/icons/search.svg.js +1 -1
- package/dist/assets/icons/share.svg.js +1 -1
- package/dist/assets/icons/stop-circle.svg.js +1 -1
- package/dist/assets/icons/tools.svg.js +1 -1
- package/dist/assets/icons/x-lg.svg.js +1 -1
- package/dist/assets/styles/dark.css +129 -129
- package/dist/assets/styles/dark.css.js +1 -1
- package/dist/assets/styles/light.css +129 -129
- package/dist/assets/styles/light.css.js +1 -1
- package/dist/components/icon/UIcon.component.d.ts +1 -4
- package/dist/components/input/UInput.component.d.ts +6 -0
- package/dist/components/input/UInput.component.js +12 -0
- package/dist/utilities/IconRegistry.js +1 -2
- package/package.json +60 -60
- package/dist/assets/icons/layout-sidebar.svg.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,105 +1,118 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.2.
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
- **
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- **
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
- **
|
|
31
|
-
- **
|
|
32
|
-
- **
|
|
33
|
-
-
|
|
34
|
-
- `
|
|
35
|
-
- `
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
###
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- **
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## 0.1.
|
|
73
|
-
- Added `
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.2 (2026-02-09)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
- **UInput**: Added `min`, `max`, `step` properties for number/date/time input types (closes #1)
|
|
7
|
+
|
|
8
|
+
## 0.2.1 (2026-02-09)
|
|
9
|
+
|
|
10
|
+
### Documentation
|
|
11
|
+
- **Events**: Added complete event API reference with all `u-*` events, detail types, and usage examples (closes #3)
|
|
12
|
+
- **CSS Custom Properties**: Added full `--u-*` variable reference with light/dark values (closes #2)
|
|
13
|
+
- **Theming**: Added theme setup, switching, and external design system integration guide
|
|
14
|
+
- **Components**: Added component list with tags and descriptions
|
|
15
|
+
|
|
16
|
+
## 0.2.0 (2026-01-16)
|
|
17
|
+
|
|
18
|
+
### Breaking Changes
|
|
19
|
+
- **Utilities**: Refactored utility class architecture to static-only pattern
|
|
20
|
+
- `IconRegistry`: Changed from singleton instance to static class (use `IconRegistry.register()` instead of `icons.register()`)
|
|
21
|
+
- `Notifier`: Changed from singleton instance to static class (use `Notifier.toast()` instead of `notifier.toast()`)
|
|
22
|
+
- `Theme`: Changed from singleton instance to static class (use `Theme.init()` instead of `theme.init()`)
|
|
23
|
+
- **IconButton**: Removed `UIconButton` component (use `UButton` with icon slot instead)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
- **UTag**: Added new Tag component for displaying labels, categories, and status
|
|
27
|
+
- Supports variants: `default`, `info`, `success`, `warning`, `danger`
|
|
28
|
+
- Removable tag functionality with smooth animation
|
|
29
|
+
- Prefix/suffix slots for custom content
|
|
30
|
+
- **UButton**: Added `variant` property with support for `default`, `borderless`, and `link` styles
|
|
31
|
+
- **UTooltip**: Added `interactive` property for keeping tooltip open when hovering over it
|
|
32
|
+
- **Icons**: Added new icon assets
|
|
33
|
+
- `arrow-repeat`, `box-arrow-up-right`, `file-earmark`, `flag`, `globe`
|
|
34
|
+
- `hand-thumbs-up`, `hand-thumbs-up-fill`, `hand-thumbs-down`, `hand-thumbs-down-fill`
|
|
35
|
+
- `share`, `stop-circle`, `tools`
|
|
36
|
+
- **Utilities**: Added new utility functions
|
|
37
|
+
- `converters.ts`: `arrayAttrConverter()` for array attribute conversion
|
|
38
|
+
- `elements.ts`: DOM helper functions (`getParentElement`, `querySelectorWithin`, `querySelectorAllWithin`)
|
|
39
|
+
|
|
40
|
+
### Improvements
|
|
41
|
+
- **FloatingElement**: Enhanced positioning and anchor management logic
|
|
42
|
+
- **UButton**: Improved click event handling for disabled and loading states
|
|
43
|
+
- **UDialog/UDrawer**: Updated to use improved modal element patterns
|
|
44
|
+
- **UMenu**: Refactored submenu handling and dropdown logic
|
|
45
|
+
- **IconRegistry**: Reorganized and improved icon loading architecture
|
|
46
|
+
- **Utilities**: Moved internal utilities to public utilities directory
|
|
47
|
+
- `internals/attribute-converters.ts` → `utilities/converters.ts`
|
|
48
|
+
- `internals/node-helpers.ts` → `utilities/elements.ts`
|
|
49
|
+
- `utilities/icons.ts` → `utilities/IconRegistry.ts`
|
|
50
|
+
|
|
51
|
+
## 0.1.11 (2026-01-06)
|
|
52
|
+
|
|
53
|
+
### Fixes
|
|
54
|
+
- Fixed d.ts generation error for `Theme` class by exporting the class
|
|
55
|
+
|
|
56
|
+
### Features
|
|
57
|
+
- **UTreeItem**: Added `loading` property with spinner indicator
|
|
58
|
+
- **UTreeItem**: Added MutationObserver for dynamic child loading support
|
|
59
|
+
- **UMenuItem**: Added `loading` property with spinner indicator
|
|
60
|
+
|
|
61
|
+
### Improvements
|
|
62
|
+
- **UDivider**: Simplified component (removed movable functionality)
|
|
63
|
+
- **USplitPanel**: Completely rewritten with native splitter implementation
|
|
64
|
+
- **UMenu/UMenuItem**: Refactored submenu handling logic
|
|
65
|
+
- **UTreeItem**: Improved children slot handling with `processChildren` method
|
|
66
|
+
- **UTreeItem**: Changed indent styling to use CSS custom property (`--indent-level`)
|
|
67
|
+
|
|
68
|
+
## 0.1.10 (2025-12-19)
|
|
69
|
+
- Fixed circular dependency issue between `UMenu` and `UMenuItem`
|
|
70
|
+
- Changed `UMenuItem` to use tagName check instead of `instanceof` for submenu detection
|
|
71
|
+
|
|
72
|
+
## 0.1.9 (2025-12-19)
|
|
73
|
+
- Added `Tree`, `TreeItem` components for hierarchical data display
|
|
74
|
+
- Updated React wrapper plugin to support new file structure
|
|
75
|
+
- Removed `CopyButton` component
|
|
76
|
+
- Changed React wrapper output directory to `react-components`
|
|
77
|
+
|
|
78
|
+
## 0.1.8 (2025-12-18)
|
|
79
|
+
- **Breaking Change**: Added `U` prefix to all component class names (e.g., `Alert` → `UAlert`)
|
|
80
|
+
- **Breaking Change**: Changed file naming convention
|
|
81
|
+
- `{Name}.ts` → `U{Name}.component.ts` (class implementation)
|
|
82
|
+
- `{Name}.styles.ts` → `U{Name}.styles.ts` (styles)
|
|
83
|
+
- `index.ts` → `U{Name}.ts` (element definition)
|
|
84
|
+
|
|
85
|
+
## 0.1.7 (2025-12-13)
|
|
86
|
+
- Added `FloatingElement` base class for popover, tooltip common logic
|
|
87
|
+
- Added `ModalElement` base class for dialog, drawer common logic
|
|
88
|
+
- Added `Drawer` component
|
|
89
|
+
- Added `Skeleton` component
|
|
90
|
+
- Improved `Menu` component with dropdown, contextmenu, submenu support
|
|
91
|
+
- Refactored `Dialog` component based on `ModalElement`
|
|
92
|
+
- Removed `ContextMenu`, `DropdownMenu` (merged into `Menu`)
|
|
93
|
+
|
|
94
|
+
## 0.1.5 (2025-12-10)
|
|
95
|
+
- Improved `Icon` component and refactored icon utilities
|
|
96
|
+
- Improved `Input` component styles and validation
|
|
97
|
+
- Improved `Tooltip`, `Divider`, `SplitPanel` components
|
|
98
|
+
- Improved `notifier` utility
|
|
99
|
+
- Removed `Panel` component
|
|
100
|
+
- Updated theme styles (light/dark)
|
|
101
|
+
|
|
102
|
+
## 0.1.4 (2025-12-05)
|
|
103
|
+
- Fixes some issues
|
|
104
|
+
|
|
105
|
+
## 0.1.3 (2025-11-17)
|
|
106
|
+
- fixed a theme `useBuiltIn` Option, now it works as expected.
|
|
107
|
+
- added `ProgressBar` component to show loading progress at the top of the page.
|
|
108
|
+
|
|
109
|
+
## 0.1.2 (2025-11-13)
|
|
110
|
+
- fixed a type issue in `theme` utility.
|
|
111
|
+
|
|
112
|
+
## 0.1.1 (2025-11-13)
|
|
113
|
+
- added `BrowserStorage` which supports `localStorage` and `cookie` with async methods for getting, setting, and removing items.
|
|
114
|
+
- changed theme `persist` option to `store` option, and fixed some issues.
|
|
115
|
+
- removed `toggle` method from theme utility.
|
|
116
|
+
|
|
117
|
+
## 0.1.0 (2025-11-12)
|
|
118
|
+
- Initial library version release
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) [year] [fullname]
|
|
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
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [year] [fullname]
|
|
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
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,26 +1,283 @@
|
|
|
1
|
-
# @iyulab/components
|
|
2
|
-
|
|
3
|
-
Modern web components library built with Lit-Element for building reactive user interfaces.
|
|
4
|
-
|
|
5
|
-
Visit our [Demo Site](https://components.iyulab.com) to explore all components and their features.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @iyulab/components
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import "@iyulab/components";
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
##
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
# @iyulab/components
|
|
2
|
+
|
|
3
|
+
Modern web components library built with Lit-Element for building reactive user interfaces.
|
|
4
|
+
|
|
5
|
+
Visit our [Demo Site](https://components.iyulab.com) to explore all components and their features.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @iyulab/components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import "@iyulab/components";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Components
|
|
20
|
+
|
|
21
|
+
| Component | Tag | Description |
|
|
22
|
+
|-----------|-----|-------------|
|
|
23
|
+
| UAlert | `u-alert` | Alert messages with variants |
|
|
24
|
+
| UButton | `u-button` | Button with variants, loading state |
|
|
25
|
+
| UDialog | `u-dialog` | Modal dialog |
|
|
26
|
+
| UDrawer | `u-drawer` | Slide-in drawer panel |
|
|
27
|
+
| UDivider | `u-divider` | Visual divider |
|
|
28
|
+
| UForm | `u-form` | Form container with validation |
|
|
29
|
+
| UIcon | `u-icon` | Icon display |
|
|
30
|
+
| UInput | `u-input` | Text input with validation |
|
|
31
|
+
| UMenu | `u-menu` | Dropdown/context menu |
|
|
32
|
+
| UMenuItem | `u-menu-item` | Menu item |
|
|
33
|
+
| UProgressBar | `u-progress-bar` | Progress bar |
|
|
34
|
+
| UProgressRing | `u-progress-ring` | Circular progress indicator |
|
|
35
|
+
| USkeleton | `u-skeleton` | Loading placeholder |
|
|
36
|
+
| USpinner | `u-spinner` | Loading spinner |
|
|
37
|
+
| USplitPanel | `u-split-panel` | Resizable split panel |
|
|
38
|
+
| UTag | `u-tag` | Label/status tag |
|
|
39
|
+
| UTooltip | `u-tooltip` | Tooltip |
|
|
40
|
+
| UTree | `u-tree` | Tree view |
|
|
41
|
+
| UTreeItem | `u-tree-item` | Tree view item |
|
|
42
|
+
|
|
43
|
+
## Events
|
|
44
|
+
|
|
45
|
+
All custom events use the `u-<action>` naming convention. Events bubble across Shadow DOM boundaries (`bubbles: true`, `composed: true`).
|
|
46
|
+
|
|
47
|
+
### Event Reference
|
|
48
|
+
|
|
49
|
+
| Event | Emitted By | Detail | Description |
|
|
50
|
+
|-------|-----------|--------|-------------|
|
|
51
|
+
| `u-input` | `u-input` | `{ value: string }` | Fires on every keystroke (real-time input) |
|
|
52
|
+
| `u-change` | `u-input` | `{ value: string }` | Fires when value is committed (blur/enter) |
|
|
53
|
+
| `u-select` | `u-tree-item` | `{ value: string, item: UTreeItem }` | Fires when a leaf item is selected |
|
|
54
|
+
| `u-show` | `u-dialog`, `u-drawer`, `u-tooltip` | — | Fires when the element becomes visible |
|
|
55
|
+
| `u-hide` | `u-dialog`, `u-drawer`, `u-tooltip` | — | Fires when the element is hidden |
|
|
56
|
+
| `u-toggle` | `u-tree-item` | `{ expanded: boolean, item: UTreeItem }` | Fires when a branch item expands/collapses |
|
|
57
|
+
| `u-resize` | `u-split-panel` | — | Fires when the panel is resized |
|
|
58
|
+
|
|
59
|
+
### TypeScript Support
|
|
60
|
+
|
|
61
|
+
All events are typed and registered on `GlobalEventHandlersEventMap`:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
import type { UInputEvent, UChangeEvent, USelectEvent, UShowEvent, UHideEvent, UResizeEvent } from '@iyulab/components';
|
|
65
|
+
|
|
66
|
+
element.addEventListener('u-input', (e: UInputEvent) => {
|
|
67
|
+
console.log(e.detail.value);
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Listening to Events
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<!-- Lit template -->
|
|
75
|
+
<u-input @u-input=${this.handleInput} @u-change=${this.handleChange}></u-input>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
```javascript
|
|
79
|
+
// Vanilla JS
|
|
80
|
+
document.querySelector('u-input').addEventListener('u-input', (e) => {
|
|
81
|
+
console.log('Real-time value:', e.detail.value);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
document.querySelector('u-input').addEventListener('u-change', (e) => {
|
|
85
|
+
console.log('Committed value:', e.detail.value);
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## CSS Custom Properties
|
|
90
|
+
|
|
91
|
+
All CSS custom properties use the `--u-` prefix and are defined on `:root`. They respond to light/dark theme changes automatically.
|
|
92
|
+
|
|
93
|
+
### Semantic Colors
|
|
94
|
+
|
|
95
|
+
These variables reference the color palette and should be used in most cases:
|
|
96
|
+
|
|
97
|
+
#### Text
|
|
98
|
+
|
|
99
|
+
| Variable | Light | Dark |
|
|
100
|
+
|----------|-------|------|
|
|
101
|
+
| `--u-txt-color` | neutral-900 | neutral-900 |
|
|
102
|
+
| `--u-txt-color-inverse` | neutral-0 | neutral-100 |
|
|
103
|
+
| `--u-txt-color-hover` | blue-600 | blue-600 |
|
|
104
|
+
| `--u-txt-color-active` | blue-600 | blue-600 |
|
|
105
|
+
| `--u-txt-color-disabled` | neutral-400 | neutral-500 |
|
|
106
|
+
| `--u-txt-color-weak` | neutral-700 | neutral-700 |
|
|
107
|
+
| `--u-txt-color-strong` | neutral-1000 | neutral-1000 |
|
|
108
|
+
| `--u-link-txt-color` | blue-700 | blue-700 |
|
|
109
|
+
| `--u-tooltip-txt-color` | neutral-0 | neutral-100 |
|
|
110
|
+
|
|
111
|
+
#### Icon
|
|
112
|
+
|
|
113
|
+
| Variable | Light | Dark |
|
|
114
|
+
|----------|-------|------|
|
|
115
|
+
| `--u-icon-color` | neutral-700 | neutral-800 |
|
|
116
|
+
| `--u-icon-color-inverse` | neutral-0 | neutral-100 |
|
|
117
|
+
| `--u-icon-color-hover` | blue-600 | blue-600 |
|
|
118
|
+
| `--u-icon-color-active` | blue-600 | blue-600 |
|
|
119
|
+
| `--u-icon-color-disabled` | neutral-400 | neutral-500 |
|
|
120
|
+
|
|
121
|
+
#### Border
|
|
122
|
+
|
|
123
|
+
| Variable | Light | Dark |
|
|
124
|
+
|----------|-------|------|
|
|
125
|
+
| `--u-border-color` | neutral-300 | neutral-400 |
|
|
126
|
+
| `--u-border-color-weak` | neutral-200 | neutral-300 |
|
|
127
|
+
| `--u-border-color-strong` | neutral-400 | neutral-500 |
|
|
128
|
+
| `--u-input-border-color` | neutral-300 | neutral-400 |
|
|
129
|
+
| `--u-input-border-color-hover` | neutral-400 | neutral-500 |
|
|
130
|
+
| `--u-input-border-color-focus` | blue-600 | blue-600 |
|
|
131
|
+
| `--u-input-border-color-invalid` | red-600 | red-600 |
|
|
132
|
+
|
|
133
|
+
#### Background
|
|
134
|
+
|
|
135
|
+
| Variable | Light | Dark |
|
|
136
|
+
|----------|-------|------|
|
|
137
|
+
| `--u-bg-color` | neutral-0 | neutral-100 |
|
|
138
|
+
| `--u-bg-color-inverse` | neutral-900 | neutral-0 |
|
|
139
|
+
| `--u-bg-color-hover` | neutral-100 | neutral-300 |
|
|
140
|
+
| `--u-bg-color-active` | neutral-200 | neutral-400 |
|
|
141
|
+
| `--u-bg-color-disabled` | neutral-50 | neutral-100 |
|
|
142
|
+
| `--u-input-bg-color` | neutral-0 | neutral-200 |
|
|
143
|
+
| `--u-panel-bg-color` | neutral-0 | neutral-200 |
|
|
144
|
+
| `--u-overlay-bg-color` | `rgba(0,0,0,0.5)` | `rgba(0,0,0,0.7)` |
|
|
145
|
+
| `--u-tooltip-bg-color` | `rgba(0,0,0,0.75)` | `rgba(255,255,255,0.85)` |
|
|
146
|
+
|
|
147
|
+
#### Shadow
|
|
148
|
+
|
|
149
|
+
| Variable | Light | Dark |
|
|
150
|
+
|----------|-------|------|
|
|
151
|
+
| `--u-shadow-color-weaker` | `rgba(0,0,0,0.04)` | `rgba(0,0,0,0.15)` |
|
|
152
|
+
| `--u-shadow-color-weak` | `rgba(0,0,0,0.08)` | `rgba(0,0,0,0.25)` |
|
|
153
|
+
| `--u-shadow-color-normal` | `rgba(0,0,0,0.12)` | `rgba(0,0,0,0.35)` |
|
|
154
|
+
| `--u-shadow-color-strong` | `rgba(0,0,0,0.16)` | `rgba(0,0,0,0.45)` |
|
|
155
|
+
| `--u-shadow-color-stronger` | `rgba(0,0,0,0.24)` | `rgba(0,0,0,0.60)` |
|
|
156
|
+
|
|
157
|
+
#### Scrollbar
|
|
158
|
+
|
|
159
|
+
| Variable | Light | Dark |
|
|
160
|
+
|----------|-------|------|
|
|
161
|
+
| `--u-scrollbar-color` | neutral-400 | neutral-500 |
|
|
162
|
+
| `--u-scrollbar-color-hover` | neutral-500 | neutral-600 |
|
|
163
|
+
| `--u-scrollbar-track-color` | `transparent` | `transparent` |
|
|
164
|
+
|
|
165
|
+
### Typography
|
|
166
|
+
|
|
167
|
+
| Variable | Value |
|
|
168
|
+
|----------|-------|
|
|
169
|
+
| `--u-font-base` | -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif |
|
|
170
|
+
| `--u-font-mono` | ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Monaco, monospace |
|
|
171
|
+
| `--u-font-serif` | 'Georgia', 'Times New Roman', Times, serif |
|
|
172
|
+
| `--u-font-display` | 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif |
|
|
173
|
+
| `--u-font-modern` | 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif |
|
|
174
|
+
| `--u-font-rounded` | 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif |
|
|
175
|
+
|
|
176
|
+
### Color Palette
|
|
177
|
+
|
|
178
|
+
The base color palettes (`neutral`, `blue`, `green`, `yellow`, `red`) range from `0` (lightest) to `1000` (darkest) in light mode, and are inverted for dark mode.
|
|
179
|
+
|
|
180
|
+
```css
|
|
181
|
+
--u-neutral-{0|50|100|200|300|400|500|600|700|800|900|1000}
|
|
182
|
+
--u-blue-{0|100|200|300|400|500|600|700|800|900|1000}
|
|
183
|
+
--u-green-{0|100|200|300|400|500|600|700|800|900|1000}
|
|
184
|
+
--u-yellow-{0|100|200|300|400|500|600|700|800|900|1000}
|
|
185
|
+
--u-red-{0|100|200|300|400|500|600|700|800|900|1000}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Customizing Styles
|
|
189
|
+
|
|
190
|
+
Override any `--u-*` variable on `:root` or on specific elements:
|
|
191
|
+
|
|
192
|
+
```css
|
|
193
|
+
/* Global override */
|
|
194
|
+
:root {
|
|
195
|
+
--u-blue-600: #3B82F6;
|
|
196
|
+
--u-font-base: 'Pretendard', sans-serif;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Scoped override */
|
|
200
|
+
u-button {
|
|
201
|
+
--u-bg-color: var(--my-brand-primary);
|
|
202
|
+
--u-txt-color: var(--my-brand-on-primary);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Integrating with External Design Systems
|
|
207
|
+
|
|
208
|
+
Bridge `--u-*` variables with your design tokens:
|
|
209
|
+
|
|
210
|
+
```css
|
|
211
|
+
/* Tailwind CSS bridge */
|
|
212
|
+
:root {
|
|
213
|
+
--u-blue-500: var(--color-blue-500);
|
|
214
|
+
--u-blue-600: var(--color-blue-600);
|
|
215
|
+
--u-neutral-0: var(--color-white);
|
|
216
|
+
--u-neutral-900: var(--color-gray-900);
|
|
217
|
+
--u-font-base: var(--font-sans);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* Material Design bridge */
|
|
221
|
+
:root {
|
|
222
|
+
--u-blue-600: var(--md-sys-color-primary);
|
|
223
|
+
--u-bg-color: var(--md-sys-color-surface);
|
|
224
|
+
--u-txt-color: var(--md-sys-color-on-surface);
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Theming
|
|
229
|
+
|
|
230
|
+
### Setup
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
import { Theme } from '@iyulab/components';
|
|
234
|
+
|
|
235
|
+
await Theme.init({
|
|
236
|
+
default: 'system', // 'light' | 'dark' | 'system'
|
|
237
|
+
useBuiltIn: true, // use built-in light/dark CSS (default: true)
|
|
238
|
+
store: { // persist theme preference
|
|
239
|
+
type: 'localStorage',
|
|
240
|
+
prefix: 'my-app',
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### Switching Themes
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
Theme.set('dark'); // apply dark theme
|
|
249
|
+
Theme.set('light'); // apply light theme
|
|
250
|
+
Theme.set('system'); // follow OS preference
|
|
251
|
+
const current = Theme.get(); // get current theme
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### External Theme Toggle Integration
|
|
255
|
+
|
|
256
|
+
When using an external dark mode toggle (e.g., Tailwind's `dark:` class), disable built-in styles and bridge the variables:
|
|
257
|
+
|
|
258
|
+
```typescript
|
|
259
|
+
// Disable built-in theme styles
|
|
260
|
+
await Theme.init({ useBuiltIn: false });
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
```css
|
|
264
|
+
/* Provide your own light/dark values */
|
|
265
|
+
:root {
|
|
266
|
+
--u-bg-color: #ffffff;
|
|
267
|
+
--u-txt-color: #212121;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
[data-theme="dark"] {
|
|
271
|
+
--u-bg-color: #121212;
|
|
272
|
+
--u-txt-color: #d4d4d4;
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Core Dependencies
|
|
277
|
+
|
|
278
|
+
- [lit](https://www.npmjs.com/package/lit) - Fast web components framework
|
|
279
|
+
- [@floating-ui/dom](https://www.npmjs.com/package/@floating-ui/dom) - Positioning library for tooltips and popovers
|
|
280
|
+
|
|
281
|
+
## License
|
|
282
|
+
|
|
283
|
+
MIT © [iyulab](https://www.iyulab.com)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const arrowDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path stroke=\"currentColor\" stroke-width=\"1.5\" d=\"M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1\"/>\n</svg>";
|
|
1
|
+
const arrowDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path stroke=\"currentColor\" stroke-width=\"1.5\" d=\"M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { arrowDown as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const arrowRepeat = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41m-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9\"/>\n <path fill-rule=\"evenodd\" d=\"M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5 5 0 0 0 8 3M3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9z\"/>\n</svg>";
|
|
1
|
+
const arrowRepeat = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path d=\"M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41m-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9\"/>\r\n <path fill-rule=\"evenodd\" d=\"M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5 5 0 0 0 8 3M3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9z\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { arrowRepeat as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const arrowUp = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path stroke=\"currentColor\" stroke-width=\"1.5\" d=\"M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5\"/>\n</svg>";
|
|
1
|
+
const arrowUp = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path stroke=\"currentColor\" stroke-width=\"1.5\" d=\"M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { arrowUp as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const ban = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M15 8a6.97 6.97 0 0 0-1.71-4.584l-9.874 9.875A7 7 0 0 0 15 8M2.71 12.584l9.874-9.875a7 7 0 0 0-9.874 9.874ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0\"/>\n</svg>";
|
|
1
|
+
const ban = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path d=\"M15 8a6.97 6.97 0 0 0-1.71-4.584l-9.874 9.875A7 7 0 0 0 15 8M2.71 12.584l9.874-9.875a7 7 0 0 0-9.874 9.874ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { ban as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const bellFill = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2m.995-14.901a1 1 0 1 0-1.99 0A5 5 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901\"/>\n</svg>";
|
|
1
|
+
const bellFill = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path d=\"M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2m.995-14.901a1 1 0 1 0-1.99 0A5 5 0 0 0 3 6c0 1.098-.5 6-2 7h14c-1.5-1-2-5.902-2-7 0-2.42-1.72-4.44-4.005-4.901\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { bellFill as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const boxArrowUpRight = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5\"/>\n <path fill-rule=\"evenodd\" d=\"M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z\"/>\n</svg>";
|
|
1
|
+
const boxArrowUpRight = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5\"/>\r\n <path fill-rule=\"evenodd\" d=\"M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { boxArrowUpRight as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const checkCircleFill = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z\"/>\n</svg>";
|
|
1
|
+
const checkCircleFill = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path d=\"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { checkCircleFill as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const checkLg = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path d=\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z\"/>\n</svg>";
|
|
1
|
+
const checkLg = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path d=\"M12.736 3.97a.733.733 0 0 1 1.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 0 1-1.065.02L3.217 8.384a.757.757 0 0 1 0-1.06.733.733 0 0 1 1.047 0l3.052 3.093 5.4-6.425z\"/>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { checkLg as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const chevronDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708\"></path>\n</svg>";
|
|
1
|
+
const chevronDown = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708\"></path>\r\n</svg>";
|
|
2
2
|
|
|
3
3
|
export { chevronDown as default };
|