@iyulab/components 0.2.0 → 0.2.1

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.
Files changed (49) hide show
  1. package/CHANGELOG.md +113 -105
  2. package/LICENSE +20 -20
  3. package/README.md +283 -26
  4. package/dist/assets/icons/arrow-down.svg.js +1 -1
  5. package/dist/assets/icons/arrow-repeat.svg.js +1 -1
  6. package/dist/assets/icons/arrow-up.svg.js +1 -1
  7. package/dist/assets/icons/ban.svg.js +1 -1
  8. package/dist/assets/icons/bell-fill.svg.js +1 -1
  9. package/dist/assets/icons/box-arrow-up-right.svg.js +1 -1
  10. package/dist/assets/icons/check-circle-fill.svg.js +1 -1
  11. package/dist/assets/icons/check-lg.svg.js +1 -1
  12. package/dist/assets/icons/chevron-down.svg.js +1 -1
  13. package/dist/assets/icons/chevron-left.svg.js +1 -1
  14. package/dist/assets/icons/chevron-right.svg.js +1 -1
  15. package/dist/assets/icons/chevron-up.svg.js +1 -1
  16. package/dist/assets/icons/copy.svg.js +1 -1
  17. package/dist/assets/icons/dash-lg.svg.js +1 -1
  18. package/dist/assets/icons/exclamation-circle-fill.svg.js +1 -1
  19. package/dist/assets/icons/exclamation-triangle-fill.svg.js +1 -1
  20. package/dist/assets/icons/eye-slash.svg.js +1 -1
  21. package/dist/assets/icons/eye.svg.js +1 -1
  22. package/dist/assets/icons/file-earmark.svg.js +1 -1
  23. package/dist/assets/icons/flag.svg.js +1 -1
  24. package/dist/assets/icons/globe.svg.js +1 -1
  25. package/dist/assets/icons/hand-thumbs-down-fill.svg.js +1 -1
  26. package/dist/assets/icons/hand-thumbs-down.svg.js +1 -1
  27. package/dist/assets/icons/hand-thumbs-up-fill.svg.js +1 -1
  28. package/dist/assets/icons/hand-thumbs-up.svg.js +1 -1
  29. package/dist/assets/icons/info-circle-fill.svg.js +1 -1
  30. package/dist/assets/icons/layout-sidebar.svg.js +1 -1
  31. package/dist/assets/icons/lightbulb-fill.svg.js +1 -1
  32. package/dist/assets/icons/lightbulb-off.svg.js +1 -1
  33. package/dist/assets/icons/lightbulb.svg.js +1 -1
  34. package/dist/assets/icons/mic-fill.svg.js +1 -1
  35. package/dist/assets/icons/mic-mute-fill.svg.js +1 -1
  36. package/dist/assets/icons/paperclip.svg.js +1 -1
  37. package/dist/assets/icons/pencil-square.svg.js +1 -1
  38. package/dist/assets/icons/plus-lg.svg.js +1 -1
  39. package/dist/assets/icons/search.svg.js +1 -1
  40. package/dist/assets/icons/share.svg.js +1 -1
  41. package/dist/assets/icons/stop-circle.svg.js +1 -1
  42. package/dist/assets/icons/tools.svg.js +1 -1
  43. package/dist/assets/icons/x-lg.svg.js +1 -1
  44. package/dist/assets/styles/dark.css +129 -129
  45. package/dist/assets/styles/dark.css.js +1 -1
  46. package/dist/assets/styles/light.css +129 -129
  47. package/dist/assets/styles/light.css.js +1 -1
  48. package/dist/components/icon/UIcon.component.d.ts +1 -4
  49. package/package.json +60 -60
package/CHANGELOG.md CHANGED
@@ -1,105 +1,113 @@
1
- # Changelog
2
-
3
- ## 0.2.0 (2026-01-16)
4
-
5
- ### Breaking Changes
6
- - **Utilities**: Refactored utility class architecture to static-only pattern
7
- - `IconRegistry`: Changed from singleton instance to static class (use `IconRegistry.register()` instead of `icons.register()`)
8
- - `Notifier`: Changed from singleton instance to static class (use `Notifier.toast()` instead of `notifier.toast()`)
9
- - `Theme`: Changed from singleton instance to static class (use `Theme.init()` instead of `theme.init()`)
10
- - **IconButton**: Removed `UIconButton` component (use `UButton` with icon slot instead)
11
-
12
- ### Features
13
- - **UTag**: Added new Tag component for displaying labels, categories, and status
14
- - Supports variants: `default`, `info`, `success`, `warning`, `danger`
15
- - Removable tag functionality with smooth animation
16
- - Prefix/suffix slots for custom content
17
- - **UButton**: Added `variant` property with support for `default`, `borderless`, and `link` styles
18
- - **UTooltip**: Added `interactive` property for keeping tooltip open when hovering over it
19
- - **Icons**: Added new icon assets
20
- - `arrow-repeat`, `box-arrow-up-right`, `file-earmark`, `flag`, `globe`
21
- - `hand-thumbs-up`, `hand-thumbs-up-fill`, `hand-thumbs-down`, `hand-thumbs-down-fill`
22
- - `share`, `stop-circle`, `tools`
23
- - **Utilities**: Added new utility functions
24
- - `converters.ts`: `arrayAttrConverter()` for array attribute conversion
25
- - `elements.ts`: DOM helper functions (`getParentElement`, `querySelectorWithin`, `querySelectorAllWithin`)
26
-
27
- ### Improvements
28
- - **FloatingElement**: Enhanced positioning and anchor management logic
29
- - **UButton**: Improved click event handling for disabled and loading states
30
- - **UDialog/UDrawer**: Updated to use improved modal element patterns
31
- - **UMenu**: Refactored submenu handling and dropdown logic
32
- - **IconRegistry**: Reorganized and improved icon loading architecture
33
- - **Utilities**: Moved internal utilities to public utilities directory
34
- - `internals/attribute-converters.ts` → `utilities/converters.ts`
35
- - `internals/node-helpers.ts` → `utilities/elements.ts`
36
- - `utilities/icons.ts` `utilities/IconRegistry.ts`
37
-
38
- ## 0.1.11 (2026-01-06)
39
-
40
- ### Fixes
41
- - Fixed d.ts generation error for `Theme` class by exporting the class
42
-
43
- ### Features
44
- - **UTreeItem**: Added `loading` property with spinner indicator
45
- - **UTreeItem**: Added MutationObserver for dynamic child loading support
46
- - **UMenuItem**: Added `loading` property with spinner indicator
47
-
48
- ### Improvements
49
- - **UDivider**: Simplified component (removed movable functionality)
50
- - **USplitPanel**: Completely rewritten with native splitter implementation
51
- - **UMenu/UMenuItem**: Refactored submenu handling logic
52
- - **UTreeItem**: Improved children slot handling with `processChildren` method
53
- - **UTreeItem**: Changed indent styling to use CSS custom property (`--indent-level`)
54
-
55
- ## 0.1.10 (2025-12-19)
56
- - Fixed circular dependency issue between `UMenu` and `UMenuItem`
57
- - Changed `UMenuItem` to use tagName check instead of `instanceof` for submenu detection
58
-
59
- ## 0.1.9 (2025-12-19)
60
- - Added `Tree`, `TreeItem` components for hierarchical data display
61
- - Updated React wrapper plugin to support new file structure
62
- - Removed `CopyButton` component
63
- - Changed React wrapper output directory to `react-components`
64
-
65
- ## 0.1.8 (2025-12-18)
66
- - **Breaking Change**: Added `U` prefix to all component class names (e.g., `Alert` → `UAlert`)
67
- - **Breaking Change**: Changed file naming convention
68
- - `{Name}.ts` `U{Name}.component.ts` (class implementation)
69
- - `{Name}.styles.ts` `U{Name}.styles.ts` (styles)
70
- - `index.ts` `U{Name}.ts` (element definition)
71
-
72
- ## 0.1.7 (2025-12-13)
73
- - Added `FloatingElement` base class for popover, tooltip common logic
74
- - Added `ModalElement` base class for dialog, drawer common logic
75
- - Added `Drawer` component
76
- - Added `Skeleton` component
77
- - Improved `Menu` component with dropdown, contextmenu, submenu support
78
- - Refactored `Dialog` component based on `ModalElement`
79
- - Removed `ContextMenu`, `DropdownMenu` (merged into `Menu`)
80
-
81
- ## 0.1.5 (2025-12-10)
82
- - Improved `Icon` component and refactored icon utilities
83
- - Improved `Input` component styles and validation
84
- - Improved `Tooltip`, `Divider`, `SplitPanel` components
85
- - Improved `notifier` utility
86
- - Removed `Panel` component
87
- - Updated theme styles (light/dark)
88
-
89
- ## 0.1.4 (2025-12-05)
90
- - Fixes some issues
91
-
92
- ## 0.1.3 (2025-11-17)
93
- - fixed a theme `useBuiltIn` Option, now it works as expected.
94
- - added `ProgressBar` component to show loading progress at the top of the page.
95
-
96
- ## 0.1.2 (2025-11-13)
97
- - fixed a type issue in `theme` utility.
98
-
99
- ## 0.1.1 (2025-11-13)
100
- - added `BrowserStorage` which supports `localStorage` and `cookie` with async methods for getting, setting, and removing items.
101
- - changed theme `persist` option to `store` option, and fixed some issues.
102
- - removed `toggle` method from theme utility.
103
-
104
- ## 0.1.0 (2025-11-12)
105
- - Initial library version release
1
+ # Changelog
2
+
3
+ ## 0.2.1 (2026-02-09)
4
+
5
+ ### Documentation
6
+ - **Events**: Added complete event API reference with all `u-*` events, detail types, and usage examples (closes #3)
7
+ - **CSS Custom Properties**: Added full `--u-*` variable reference with light/dark values (closes #2)
8
+ - **Theming**: Added theme setup, switching, and external design system integration guide
9
+ - **Components**: Added component list with tags and descriptions
10
+
11
+ ## 0.2.0 (2026-01-16)
12
+
13
+ ### Breaking Changes
14
+ - **Utilities**: Refactored utility class architecture to static-only pattern
15
+ - `IconRegistry`: Changed from singleton instance to static class (use `IconRegistry.register()` instead of `icons.register()`)
16
+ - `Notifier`: Changed from singleton instance to static class (use `Notifier.toast()` instead of `notifier.toast()`)
17
+ - `Theme`: Changed from singleton instance to static class (use `Theme.init()` instead of `theme.init()`)
18
+ - **IconButton**: Removed `UIconButton` component (use `UButton` with icon slot instead)
19
+
20
+ ### Features
21
+ - **UTag**: Added new Tag component for displaying labels, categories, and status
22
+ - Supports variants: `default`, `info`, `success`, `warning`, `danger`
23
+ - Removable tag functionality with smooth animation
24
+ - Prefix/suffix slots for custom content
25
+ - **UButton**: Added `variant` property with support for `default`, `borderless`, and `link` styles
26
+ - **UTooltip**: Added `interactive` property for keeping tooltip open when hovering over it
27
+ - **Icons**: Added new icon assets
28
+ - `arrow-repeat`, `box-arrow-up-right`, `file-earmark`, `flag`, `globe`
29
+ - `hand-thumbs-up`, `hand-thumbs-up-fill`, `hand-thumbs-down`, `hand-thumbs-down-fill`
30
+ - `share`, `stop-circle`, `tools`
31
+ - **Utilities**: Added new utility functions
32
+ - `converters.ts`: `arrayAttrConverter()` for array attribute conversion
33
+ - `elements.ts`: DOM helper functions (`getParentElement`, `querySelectorWithin`, `querySelectorAllWithin`)
34
+
35
+ ### Improvements
36
+ - **FloatingElement**: Enhanced positioning and anchor management logic
37
+ - **UButton**: Improved click event handling for disabled and loading states
38
+ - **UDialog/UDrawer**: Updated to use improved modal element patterns
39
+ - **UMenu**: Refactored submenu handling and dropdown logic
40
+ - **IconRegistry**: Reorganized and improved icon loading architecture
41
+ - **Utilities**: Moved internal utilities to public utilities directory
42
+ - `internals/attribute-converters.ts` → `utilities/converters.ts`
43
+ - `internals/node-helpers.ts` → `utilities/elements.ts`
44
+ - `utilities/icons.ts` `utilities/IconRegistry.ts`
45
+
46
+ ## 0.1.11 (2026-01-06)
47
+
48
+ ### Fixes
49
+ - Fixed d.ts generation error for `Theme` class by exporting the class
50
+
51
+ ### Features
52
+ - **UTreeItem**: Added `loading` property with spinner indicator
53
+ - **UTreeItem**: Added MutationObserver for dynamic child loading support
54
+ - **UMenuItem**: Added `loading` property with spinner indicator
55
+
56
+ ### Improvements
57
+ - **UDivider**: Simplified component (removed movable functionality)
58
+ - **USplitPanel**: Completely rewritten with native splitter implementation
59
+ - **UMenu/UMenuItem**: Refactored submenu handling logic
60
+ - **UTreeItem**: Improved children slot handling with `processChildren` method
61
+ - **UTreeItem**: Changed indent styling to use CSS custom property (`--indent-level`)
62
+
63
+ ## 0.1.10 (2025-12-19)
64
+ - Fixed circular dependency issue between `UMenu` and `UMenuItem`
65
+ - Changed `UMenuItem` to use tagName check instead of `instanceof` for submenu detection
66
+
67
+ ## 0.1.9 (2025-12-19)
68
+ - Added `Tree`, `TreeItem` components for hierarchical data display
69
+ - Updated React wrapper plugin to support new file structure
70
+ - Removed `CopyButton` component
71
+ - Changed React wrapper output directory to `react-components`
72
+
73
+ ## 0.1.8 (2025-12-18)
74
+ - **Breaking Change**: Added `U` prefix to all component class names (e.g., `Alert` `UAlert`)
75
+ - **Breaking Change**: Changed file naming convention
76
+ - `{Name}.ts` `U{Name}.component.ts` (class implementation)
77
+ - `{Name}.styles.ts` `U{Name}.styles.ts` (styles)
78
+ - `index.ts` `U{Name}.ts` (element definition)
79
+
80
+ ## 0.1.7 (2025-12-13)
81
+ - Added `FloatingElement` base class for popover, tooltip common logic
82
+ - Added `ModalElement` base class for dialog, drawer common logic
83
+ - Added `Drawer` component
84
+ - Added `Skeleton` component
85
+ - Improved `Menu` component with dropdown, contextmenu, submenu support
86
+ - Refactored `Dialog` component based on `ModalElement`
87
+ - Removed `ContextMenu`, `DropdownMenu` (merged into `Menu`)
88
+
89
+ ## 0.1.5 (2025-12-10)
90
+ - Improved `Icon` component and refactored icon utilities
91
+ - Improved `Input` component styles and validation
92
+ - Improved `Tooltip`, `Divider`, `SplitPanel` components
93
+ - Improved `notifier` utility
94
+ - Removed `Panel` component
95
+ - Updated theme styles (light/dark)
96
+
97
+ ## 0.1.4 (2025-12-05)
98
+ - Fixes some issues
99
+
100
+ ## 0.1.3 (2025-11-17)
101
+ - fixed a theme `useBuiltIn` Option, now it works as expected.
102
+ - added `ProgressBar` component to show loading progress at the top of the page.
103
+
104
+ ## 0.1.2 (2025-11-13)
105
+ - fixed a type issue in `theme` utility.
106
+
107
+ ## 0.1.1 (2025-11-13)
108
+ - added `BrowserStorage` which supports `localStorage` and `cookie` with async methods for getting, setting, and removing items.
109
+ - changed theme `persist` option to `store` option, and fixed some issues.
110
+ - removed `toggle` method from theme utility.
111
+
112
+ ## 0.1.0 (2025-11-12)
113
+ - 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
- ## Core Dependencies
20
-
21
- - [lit](https://www.npmjs.com/package/lit) - Fast web components framework
22
- - [@floating-ui/dom](https://www.npmjs.com/package/@floating-ui/dom) - Positioning library for tooltips and popovers
23
-
24
- ## License
25
-
26
- MIT © [iyulab](https://www.iyulab.com)
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 };
@@ -1,3 +1,3 @@
1
- const chevronLeft = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\"/>\n</svg>";
1
+ const chevronLeft = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\">\r\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\"/>\r\n</svg>";
2
2
 
3
3
  export { chevronLeft as default };