@nice2dev/ui 1.0.5 → 1.0.8
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/README.md +253 -207
- package/dist/NiceAPIFlow.doc-DnQLPUie.js +30 -0
- package/dist/NiceAPIFlow.doc-Dx4qw1lm.cjs +6 -0
- package/dist/NiceBranchManager.doc-BXjiENlD.cjs +6 -0
- package/dist/NiceBranchManager.doc-xLB82YwU.js +30 -0
- package/dist/NiceButton-B5RXLDwI.cjs +1 -0
- package/dist/NiceButton-CDiS45Ya.cjs +1 -0
- package/dist/NiceButton-D9l39Rs7.js +595 -0
- package/dist/NiceButton-DmTHNHet.js +450 -0
- package/dist/NiceCodeTemplate.doc-BWxTE4C_.cjs +6 -0
- package/dist/NiceCodeTemplate.doc-CA2U5F-v.js +30 -0
- package/dist/NiceDataBranchGraph.doc-CkitupWc.js +29 -0
- package/dist/NiceDataBranchGraph.doc-DDUgipqH.cjs +5 -0
- package/dist/NiceDataBranchManager.doc-B0ODKOs4.js +30 -0
- package/dist/NiceDataBranchManager.doc-CC5o8ihs.cjs +6 -0
- package/dist/NiceDataConflictResolver.doc-CdzScNie.cjs +5 -0
- package/dist/NiceDataConflictResolver.doc-V8vxYAeo.js +29 -0
- package/dist/NiceDataDiffViewer.doc-CR14Bq3A.cjs +6 -0
- package/dist/NiceDataDiffViewer.doc-w2I2QjhX.js +30 -0
- package/dist/NiceDataMapper.doc-C7jSyHRM.js +30 -0
- package/dist/NiceDataMapper.doc-DXjQHz87.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-CV32WC_w.cjs +6 -0
- package/dist/NiceDataMergeBuilder.doc-DtuYb3nx.js +30 -0
- package/dist/NiceDataSnapshot.doc-CFLkY3ry.js +30 -0
- package/dist/NiceDataSnapshot.doc-CpZyQ17u.cjs +6 -0
- package/dist/NiceErrorBoundary-BAeqfoSc.cjs +1 -0
- package/dist/NiceErrorBoundary-D1hh5GGe.js +732 -0
- package/dist/NiceErrorBoundary-Dta4TGee.cjs +1 -0
- package/dist/NiceErrorBoundary-niMx1aSJ.js +837 -0
- package/dist/NiceEventOrchestrator.doc-C4SJfIDV.js +30 -0
- package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +6 -0
- package/dist/NiceGitBlame.doc-BG3_K9_0.cjs +6 -0
- package/dist/NiceGitBlame.doc-DrJABEat.js +30 -0
- package/dist/NiceGitConflictResolver.doc-BK7hAfz6.js +30 -0
- package/dist/NiceGitConflictResolver.doc-CgroGM9_.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-BAwgcY_3.cjs +6 -0
- package/dist/NiceGitDiffViewer.doc-BXKJeP-E.js +30 -0
- package/dist/NiceGitGraph.doc-B-WtGuzn.cjs +5 -0
- package/dist/NiceGitGraph.doc-DxnDPCgC.js +29 -0
- package/dist/NiceGitHooks.doc-BrEizvMp.js +29 -0
- package/dist/NiceGitHooks.doc-C4EdV5zj.cjs +5 -0
- package/dist/NiceMergeRequestBuilder.doc-C5p8mYuh.cjs +6 -0
- package/dist/NiceMergeRequestBuilder.doc-Ct9RCmU8.js +30 -0
- package/dist/NiceModuleLifecyclePanel-BapdidD6.js +4776 -0
- package/dist/NiceModuleLifecyclePanel-Brg1RLwi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-CsFsm534.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-I_TXRiiY.js +5053 -0
- package/dist/NicePinCodeInput-4q8yULuo.js +13359 -0
- package/dist/NicePinCodeInput-CrMfdxxc.js +15287 -0
- package/dist/NicePinCodeInput-D0aF9MK8.cjs +692 -0
- package/dist/NicePinCodeInput-eD2q8nGa.cjs +692 -0
- package/dist/NicePinCodeInput.css +1 -0
- package/dist/NicePipelineEditor.doc-0eGt8zbX.cjs +5 -0
- package/dist/NicePipelineEditor.doc-DTmaOebn.js +29 -0
- package/dist/NicePipelineMonitor.doc-67CmsRcf.cjs +5 -0
- package/dist/NicePipelineMonitor.doc-mSMdhuG8.js +29 -0
- package/dist/NiceSavedQueryPanel-BZNvqSQW.cjs +596 -0
- package/dist/NiceSavedQueryPanel-CUAsdOjJ.js +6190 -0
- package/dist/NiceSavedQueryPanel-DUw8plYP.js +5666 -0
- package/dist/NiceSavedQueryPanel-xpk09zy1.cjs +596 -0
- package/dist/NiceSavedQueryPanel.css +1 -0
- package/dist/NiceStateDesigner.doc-B36u0hNU.js +29 -0
- package/dist/NiceStateDesigner.doc-MPmvNHSx.cjs +5 -0
- package/dist/NiceStockChart-CHlOnWzN.cjs +287 -0
- package/dist/NiceStockChart-Cpmv9_Cc.js +2341 -0
- package/dist/NiceStockChart.css +1 -0
- package/dist/NiceTestBuilder.doc-BFInj8GJ.js +30 -0
- package/dist/NiceTestBuilder.doc-CB03U_uR.cjs +6 -0
- package/dist/NiceToggle-C1UKGXmJ.js +209 -0
- package/dist/NiceToggle-CaY1u82g.js +277 -0
- package/dist/NiceToggle-DFJFQv_Z.cjs +1 -0
- package/dist/NiceToggle-lVi-ETi0.cjs +1 -0
- package/dist/NiceWindow-D1awkyFl.js +1636 -0
- package/dist/NiceWindow-IdHAcP70.cjs +1 -0
- package/dist/NiceWindow-SiCaREbq.js +1408 -0
- package/dist/NiceWindow-yARTUJsg.cjs +1 -0
- package/dist/charts-Bx_kNBsE.js +4280 -0
- package/dist/charts-DECVsCHX.cjs +754 -0
- package/dist/charts.cjs +1 -0
- package/dist/charts.css +1 -0
- package/dist/charts.d.ts +1043 -0
- package/dist/charts.mjs +23 -0
- package/dist/core-BZBTsGWN.cjs +96 -0
- package/dist/core-BpghV7Ls.js +17555 -0
- package/dist/core-CfXsl755.js +16305 -0
- package/dist/core-DGJSUW64.cjs +96 -0
- package/dist/data-branching-De4ExX-S.cjs +1 -0
- package/dist/data-branching-DiRfob1f.js +6071 -0
- package/dist/data-branching.cjs +1 -0
- package/dist/data-branching.d.ts +401 -0
- package/dist/data-branching.mjs +9 -0
- package/dist/data.cjs +1 -0
- package/dist/data.d.ts +2003 -0
- package/dist/data.mjs +21 -0
- package/dist/devops-BnYinjkT.cjs +17 -0
- package/dist/devops-Ckh57eti.js +7198 -0
- package/dist/devops.cjs +1 -0
- package/dist/devops.d.ts +758 -0
- package/dist/devops.mjs +12 -0
- package/dist/editors.cjs +1 -0
- package/dist/editors.d.ts +2728 -0
- package/dist/editors.mjs +66 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.d.ts +339 -0
- package/dist/feedback.mjs +16 -0
- package/dist/index-C853adw1.cjs +6199 -0
- package/dist/index-CBIZ6mTQ.cjs +5734 -0
- package/dist/index-CIl98Vbm.js +72951 -0
- package/dist/index-CNwVELPJ.js +62857 -0
- package/dist/index-CUx_-gKK.cjs +1 -0
- package/dist/index-x8mRM4Jc.js +17 -0
- package/dist/index.cjs +1 -7866
- package/dist/index.css +1 -0
- package/dist/index.d.ts +4888 -180
- package/dist/index.mjs +1021 -105889
- package/dist/lazy.cjs +1 -0
- package/dist/lazy.d.ts +1880 -0
- package/dist/lazy.mjs +98 -0
- package/dist/navigation.cjs +1 -0
- package/dist/navigation.d.ts +1862 -0
- package/dist/navigation.mjs +576 -0
- package/dist/no-code-BCuadkm4.cjs +332 -0
- package/dist/no-code-TL7PyulA.js +7005 -0
- package/dist/no-code.cjs +1 -0
- package/dist/no-code.d.ts +870 -0
- package/dist/no-code.mjs +13 -0
- package/dist/overlays.cjs +1 -0
- package/dist/overlays.d.ts +706 -0
- package/dist/overlays.mjs +482 -0
- package/package.json +51 -1
package/README.md
CHANGED
|
@@ -95,193 +95,232 @@ function App() {
|
|
|
95
95
|
|
|
96
96
|
---
|
|
97
97
|
|
|
98
|
+
## Code Splitting & Tree Shaking
|
|
99
|
+
|
|
100
|
+
For optimal bundle size, import only the components you need. The library supports multiple entry points for code splitting:
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
// Import everything (full bundle)
|
|
104
|
+
import { NiceButton, NiceDataGrid, NiceChart } from '@nice2dev/ui';
|
|
105
|
+
|
|
106
|
+
// Or import from specific submodules for smaller bundles
|
|
107
|
+
import { NiceDataGrid, NiceTreeGrid } from '@nice2dev/ui/data';
|
|
108
|
+
import { NiceChart, NicePieChart } from '@nice2dev/ui/charts';
|
|
109
|
+
import { NiceTextInput, NiceSelect } from '@nice2dev/ui/editors';
|
|
110
|
+
import { NiceAlert, NiceModal, useNiceToast } from '@nice2dev/ui/feedback';
|
|
111
|
+
import { NiceTabs, NiceNavbar } from '@nice2dev/ui/navigation';
|
|
112
|
+
import { NiceWindow, NiceLoadPanel } from '@nice2dev/ui/overlays';
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Lazy Loading Heavy Components
|
|
116
|
+
|
|
117
|
+
For code-heavy components like code editors and document viewers, use the built-in lazy loading:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import { LazyComponents, createLazyComponent, usePreloadOnIdle } from '@nice2dev/ui';
|
|
121
|
+
|
|
122
|
+
// Use pre-built lazy components
|
|
123
|
+
<LazyComponents.CodeEditor value={code} language="typescript" onChange={setCode} />;
|
|
124
|
+
|
|
125
|
+
// Or create your own lazy wrapper
|
|
126
|
+
const LazyChart = createLazyComponent(() => import('@nice2dev/ui/charts').then((m) => ({ default: m.NiceChart })), {
|
|
127
|
+
preloadOnHover: true,
|
|
128
|
+
displayName: 'LazyChart',
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Preload components when browser is idle
|
|
132
|
+
usePreloadOnIdle([LazyComponents.CodeEditor.preload, LazyComponents.HtmlEditor.preload]);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
98
137
|
## Component Catalog
|
|
99
138
|
|
|
100
139
|
### Editors (28 components)
|
|
101
140
|
|
|
102
141
|
Form input components with consistent `NiceFormFieldProps` interface: `label`, `helperText`, `error`, `required`, `disabled`, `readOnly`, `size`, `name`.
|
|
103
142
|
|
|
104
|
-
| Component
|
|
105
|
-
|
|
106
|
-
| `NiceTextInput`
|
|
107
|
-
| `NiceTextArea`
|
|
108
|
-
| `NiceNumberInput`
|
|
109
|
-
| `NiceDatePicker`
|
|
110
|
-
| `NiceSelect`
|
|
111
|
-
| `NiceCheckbox`
|
|
112
|
-
| `NiceToggle`
|
|
113
|
-
| `NiceRadioGroup`
|
|
114
|
-
| `NiceSlider`
|
|
115
|
-
| `NiceColorPicker`
|
|
116
|
-
| `NiceAutocomplete` | `value`, `onChange`, `options[]`, `onSearch`, `debounce`
|
|
117
|
-
| `NiceLookup`
|
|
118
|
-
| `NiceCalendar`
|
|
119
|
-
| `NiceDateRangeBox` | `startDate`, `endDate`, `onChange`, `format`
|
|
120
|
-
| `NiceTagBox`
|
|
121
|
-
| `NiceRangeSlider`
|
|
122
|
-
| `NiceDropDownBox`
|
|
123
|
-
| `NiceHtmlEditor`
|
|
124
|
-
| `NiceForm`
|
|
125
|
-
| `NiceRating`
|
|
126
|
-
| `NiceOtpInput`
|
|
127
|
-
| `NiceSignaturePad` | `value`, `onChange`, `width`, `height`, `penColor`
|
|
128
|
-
| `NiceMentionInput` | `value`, `onChange`, `users[]`, `trigger`
|
|
129
|
-
| `NiceTreeSelect`
|
|
130
|
-
| `NiceMaskedInput`
|
|
131
|
-
| `NiceKnob`
|
|
132
|
-
| `NicePickList`
|
|
133
|
-
| `NiceInlineEdit`
|
|
134
|
-
| `NiceLookup`
|
|
143
|
+
| Component | Key Props | Description |
|
|
144
|
+
| ------------------ | ----------------------------------------------------------------------- | --------------------------- |
|
|
145
|
+
| `NiceTextInput` | `value`, `onChange`, `placeholder`, `type`, `clearable` | Standard text input |
|
|
146
|
+
| `NiceTextArea` | `value`, `onChange`, `rows`, `autoResize`, `maxLength` | Multi-line text input |
|
|
147
|
+
| `NiceNumberInput` | `value`, `onChange`, `min`, `max`, `step`, `format` | Numeric input with stepper |
|
|
148
|
+
| `NiceDatePicker` | `value`, `onChange`, `format`, `minDate`, `maxDate` | Date selection |
|
|
149
|
+
| `NiceSelect` | `value`, `onChange`, `options[]`, `searchable`, `clearable`, `multiple` | Dropdown select |
|
|
150
|
+
| `NiceCheckbox` | `checked`, `onChange`, `indeterminate` | Checkbox |
|
|
151
|
+
| `NiceToggle` | `checked`, `onChange`, `labelOn`, `labelOff` | Toggle switch |
|
|
152
|
+
| `NiceRadioGroup` | `value`, `onChange`, `options[]`, `direction` | Radio button group |
|
|
153
|
+
| `NiceSlider` | `value`, `onChange`, `min`, `max`, `step`, `showTooltip` | Single-value slider |
|
|
154
|
+
| `NiceColorPicker` | `value`, `onChange`, `format`, `presets[]` | Color picker with presets |
|
|
155
|
+
| `NiceAutocomplete` | `value`, `onChange`, `options[]`, `onSearch`, `debounce` | Autocomplete input |
|
|
156
|
+
| `NiceLookup` | `value`, `onChange`, `dataSource`, `displayExpr`, `valueExpr` | Lookup field |
|
|
157
|
+
| `NiceCalendar` | `value`, `onChange`, `minDate`, `maxDate`, `disabledDates` | Inline calendar |
|
|
158
|
+
| `NiceDateRangeBox` | `startDate`, `endDate`, `onChange`, `format` | Date range picker |
|
|
159
|
+
| `NiceTagBox` | `value`, `onChange`, `options[]`, `maxTags`, `allowCustom` | Tag/chip input |
|
|
160
|
+
| `NiceRangeSlider` | `value` (tuple), `onChange`, `min`, `max`, `step` | Dual-handle range slider |
|
|
161
|
+
| `NiceDropDownBox` | `value`, `onChange`, `renderContent`, `displayValue` | Generic drop-down container |
|
|
162
|
+
| `NiceHtmlEditor` | `value`, `onChange`, `toolbar`, `placeholder` | Rich text (HTML) editor |
|
|
163
|
+
| `NiceForm` | `children`, `onSubmit`, `layout`, `labelPosition` | Form layout wrapper |
|
|
164
|
+
| `NiceRating` | `value`, `onChange`, `max`, `icon`, `allowHalf` | Star/icon rating input |
|
|
165
|
+
| `NiceOtpInput` | `value`, `onChange`, `length`, `type` | One-time password input |
|
|
166
|
+
| `NiceSignaturePad` | `value`, `onChange`, `width`, `height`, `penColor` | Signature capture pad |
|
|
167
|
+
| `NiceMentionInput` | `value`, `onChange`, `users[]`, `trigger` | Text input with @mentions |
|
|
168
|
+
| `NiceTreeSelect` | `value`, `onChange`, `nodes[]`, `multiple` | Tree-based selection |
|
|
169
|
+
| `NiceMaskedInput` | `value`, `onChange`, `mask`, `placeholder` | Masked/formatted input |
|
|
170
|
+
| `NiceKnob` | `value`, `onChange`, `min`, `max`, `draggable` | Rotary knob input |
|
|
171
|
+
| `NicePickList` | `source[]`, `target[]`, `onChange` | Dual-list pick transfer |
|
|
172
|
+
| `NiceInlineEdit` | `value`, `onChange`, `renderDisplay`, `renderEditor` | Click-to-edit inline |
|
|
173
|
+
| `NiceLookup` | `value`, `onChange`, `dataSource`, `displayExpr`, `valueExpr` | Lookup field |
|
|
135
174
|
|
|
136
175
|
### Buttons (5 components)
|
|
137
176
|
|
|
138
|
-
| Component
|
|
139
|
-
|
|
140
|
-
| `NiceButton`
|
|
141
|
-
| `NiceButtonGroup`
|
|
142
|
-
| `NiceIconButton`
|
|
143
|
-
| `NiceDropDownButton`
|
|
144
|
-
| `NiceSpeedDialAction` | `icon`, `actions[]`, `position`, `onClick`
|
|
177
|
+
| Component | Key Props | Description |
|
|
178
|
+
| --------------------- | ----------------------------------------------------------- | ---------------------------- |
|
|
179
|
+
| `NiceButton` | `variant`, `size`, `icon`, `loading`, `disabled`, `onClick` | Standard button |
|
|
180
|
+
| `NiceButtonGroup` | `items[]`, `selectedIndex`, `onSelect`, `variant` | Grouped buttons |
|
|
181
|
+
| `NiceIconButton` | `icon`, `size`, `variant`, `onClick`, `tooltip` | Icon-only button |
|
|
182
|
+
| `NiceDropDownButton` | `text`, `items[]`, `onItemClick`, `variant`, `icon` | Button with dropdown menu |
|
|
183
|
+
| `NiceSpeedDialAction` | `icon`, `actions[]`, `position`, `onClick` | Floating action button (FAB) |
|
|
145
184
|
|
|
146
185
|
### Data Display (13 components)
|
|
147
186
|
|
|
148
|
-
| Component
|
|
149
|
-
|
|
150
|
-
| `NiceBadge`
|
|
151
|
-
| `NiceTag`
|
|
152
|
-
| `NiceAvatar`
|
|
153
|
-
| `NiceAvatarGroup`
|
|
154
|
-
| `NiceProgress`
|
|
155
|
-
| `NiceDivider`
|
|
156
|
-
| `NiceTooltip`
|
|
157
|
-
| `NiceSkeleton`
|
|
158
|
-
| `NiceSpinner`
|
|
159
|
-
| `NiceEmpty`
|
|
160
|
-
| `NiceTimeline`
|
|
161
|
-
| `NiceCarousel`
|
|
162
|
-
| `NiceVirtualScroller` | `items[]`, `itemHeight`, `renderItem`
|
|
187
|
+
| Component | Key Props | Description |
|
|
188
|
+
| --------------------- | -------------------------------------------------------------- | ----------------------------------- |
|
|
189
|
+
| `NiceBadge` | `count`, `variant`, `dot`, `max`, `children` | Notification badge |
|
|
190
|
+
| `NiceTag` | `children`, `variant`, `closable`, `onClose`, `icon` | Tag/chip |
|
|
191
|
+
| `NiceAvatar` | `src`, `alt`, `size`, `fallback`, `shape` | User avatar |
|
|
192
|
+
| `NiceAvatarGroup` | `items[]`, `max`, `size` | Stacked avatar group |
|
|
193
|
+
| `NiceProgress` | `value`, `max`, `variant`, `showLabel`, `size` | Progress bar |
|
|
194
|
+
| `NiceDivider` | `orientation`, `label`, `variant` | Horizontal/vertical divider |
|
|
195
|
+
| `NiceTooltip` | `content`, `position`, `delay`, `children` | Tooltip wrapper |
|
|
196
|
+
| `NiceSkeleton` | `variant` (`text`/`circle`/`rect`), `width`, `height`, `count` | Loading skeleton |
|
|
197
|
+
| `NiceSpinner` | `size`, `variant`, `overlay` | Loading spinner |
|
|
198
|
+
| `NiceEmpty` | `icon`, `title`, `description`, `action` | Empty state placeholder |
|
|
199
|
+
| `NiceTimeline` | `items[]`, `mode`, `pending` | Vertical/horizontal timeline |
|
|
200
|
+
| `NiceCarousel` | `items[]`, `autoPlay`, `interval`, `dots` | Image/content carousel |
|
|
201
|
+
| `NiceVirtualScroller` | `items[]`, `itemHeight`, `renderItem` | Virtualized list for large datasets |
|
|
163
202
|
|
|
164
203
|
### Feedback (6 components + 1 hook)
|
|
165
204
|
|
|
166
|
-
| Component
|
|
167
|
-
|
|
168
|
-
| `NiceAlert`
|
|
169
|
-
| `NiceModal`
|
|
170
|
-
| `NiceDrawer`
|
|
171
|
-
| `NiceToastContainer` | —
|
|
172
|
-
| `useNiceToast()`
|
|
173
|
-
| `NiceConfirmDialog`
|
|
174
|
-
| `NiceCookieConsent`
|
|
175
|
-
| `NiceLoginForm`
|
|
205
|
+
| Component | Key Props | Description |
|
|
206
|
+
| -------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
207
|
+
| `NiceAlert` | `variant` (`info`/`success`/`warning`/`error`), `title`, `closable`, `icon` | Alert banner |
|
|
208
|
+
| `NiceModal` | `open`, `onClose`, `title`, `size`, `footer`, `closeOnOverlay`, `closeOnEscape` | Modal dialog |
|
|
209
|
+
| `NiceDrawer` | `open`, `onClose`, `title`, `placement` (`left`/`right`/`top`/`bottom`), `width` | Slide-out drawer |
|
|
210
|
+
| `NiceToastContainer` | — | Container for toast notifications (mount once) |
|
|
211
|
+
| `useNiceToast()` | — | Hook: `{ show: (message, type?, duration?) => void }` |
|
|
212
|
+
| `NiceConfirmDialog` | `open`, `onConfirm`, `onCancel`, `title`, `message` | Confirmation prompt |
|
|
213
|
+
| `NiceCookieConsent` | `onAccept`, `onDecline`, `privacyUrl` | GDPR cookie consent bar |
|
|
214
|
+
| `NiceLoginForm` | `onLogin`, `onForgotPassword`, `logo` | Pre-built login form |
|
|
176
215
|
|
|
177
216
|
### Navigation (16 components)
|
|
178
217
|
|
|
179
|
-
| Component
|
|
180
|
-
|
|
181
|
-
| `NiceTabs`
|
|
182
|
-
| `NiceAccordion`
|
|
183
|
-
| `NiceBreadcrumb`
|
|
184
|
-
| `NicePagination`
|
|
185
|
-
| `NiceCard`
|
|
186
|
-
| `NiceMenu`
|
|
187
|
-
| `NiceContextMenu`
|
|
188
|
-
| `NiceMultiView`
|
|
189
|
-
| `NiceTabPanel`
|
|
190
|
-
| `NiceSplitter`
|
|
191
|
-
| `NiceToolbar`
|
|
192
|
-
| `NiceAppLayout`
|
|
193
|
-
| `NiceBottomNavigation` | `items[]`, `active`, `onChange`
|
|
194
|
-
| `NiceDashboardLayout`
|
|
195
|
-
| `NiceDesktop`
|
|
196
|
-
| `NiceConsole`
|
|
218
|
+
| Component | Key Props | Description |
|
|
219
|
+
| ---------------------- | --------------------------------------------------------------------------------------- | ------------------------------------- |
|
|
220
|
+
| `NiceTabs` | `tabs[]`, `activeTab`, `onChange`, `variant` (`default`/`pills`/`enclosed`), `vertical` | Tab navigation |
|
|
221
|
+
| `NiceAccordion` | `items[]`, `multiple`, `defaultOpen` | Collapsible accordion panels |
|
|
222
|
+
| `NiceBreadcrumb` | `items[]`, `separator` | Breadcrumb trail |
|
|
223
|
+
| `NicePagination` | `current`, `total`, `onChange`, `pageSize`, `showSizeChanger` | Pagination controls |
|
|
224
|
+
| `NiceCard` | `title`, `extra`, `bordered`, `hoverable`, `loading`, `children` | Card container |
|
|
225
|
+
| `NiceMenu` | `items[]`, `theme`, `mode` (`vertical`/`horizontal`) | Navigation menu |
|
|
226
|
+
| `NiceContextMenu` | `items[]`, `onAction`, `children` | Right-click context menu |
|
|
227
|
+
| `NiceMultiView` | `views[]`, `activeView`, `onChange` | Multi-view container |
|
|
228
|
+
| `NiceTabPanel` | `label`, `icon`, `children` | Tab panel (used inside NiceMultiView) |
|
|
229
|
+
| `NiceSplitter` | `direction` (`horizontal`/`vertical`), `sizes`, `children` | Resizable split panes |
|
|
230
|
+
| `NiceToolbar` | `items[]`, `theme`, `mode` | Toolbar with configurable items |
|
|
231
|
+
| `NiceAppLayout` | `sidebar`, `header`, `footer`, `children` | Application shell layout |
|
|
232
|
+
| `NiceBottomNavigation` | `items[]`, `active`, `onChange` | Mobile bottom navigation bar |
|
|
233
|
+
| `NiceDashboardLayout` | `widgets[]`, `columns`, `draggable` | Dashboard grid layout |
|
|
234
|
+
| `NiceDesktop` | `windows[]`, `wallpaper`, `onWindowChange` | Desktop window manager |
|
|
235
|
+
| `NiceConsole` | `commands[]`, `onCommand`, `history` | Terminal/console emulator |
|
|
197
236
|
|
|
198
237
|
### Data (11 components)
|
|
199
238
|
|
|
200
|
-
| Component
|
|
201
|
-
|
|
202
|
-
| `NiceTable`
|
|
203
|
-
| `NiceDataGrid`
|
|
204
|
-
| `NiceList`
|
|
205
|
-
| `NiceTreeView`
|
|
206
|
-
| `NiceTreeList`
|
|
207
|
-
| `NiceCardView`
|
|
208
|
-
| `NiceTileView`
|
|
209
|
-
| `NicePivotGrid`
|
|
210
|
-
| `NicePivotGridFieldChooser` | —
|
|
211
|
-
| `NiceKanbanBoard`
|
|
212
|
-
| `NiceSpreadsheet`
|
|
239
|
+
| Component | Key Props | Description |
|
|
240
|
+
| --------------------------- | ---------------------------------------------------------------------------- | ----------------------------------------- |
|
|
241
|
+
| `NiceTable` | `columns[]`, `data[]`, `striped`, `compact`, `emptyText` | Simple data table |
|
|
242
|
+
| `NiceDataGrid` | `columns[]`, `data[]`, `virtualized`, `sortable`, `filterable`, `selectable` | Full-featured data grid |
|
|
243
|
+
| `NiceList` | `items[]`, `renderItem`, `emptyText`, `virtualized` | List view |
|
|
244
|
+
| `NiceTreeView` | `nodes[]`, `onSelect`, `selectable`, `expandable` | Tree structure viewer |
|
|
245
|
+
| `NiceTreeList` | `nodes[]`, `renderNode`, `editable` | Editable tree list |
|
|
246
|
+
| `NiceCardView` | `items[]`, `renderCard`, `columns`, `gap` | Card grid layout |
|
|
247
|
+
| `NiceTileView` | `items[]`, `renderTile`, `columns` | Tile grid layout |
|
|
248
|
+
| `NicePivotGrid` | `data[]`, `fields[]`, `rowGrandTotal`, `columnGrandTotal` | Pivot table |
|
|
249
|
+
| `NicePivotGridFieldChooser` | — | Field chooser companion for NicePivotGrid |
|
|
250
|
+
| `NiceKanbanBoard` | `columns[]`, `cards[]`, `onCardMove` | Kanban board |
|
|
251
|
+
| `NiceSpreadsheet` | `data[][]`, `columns[]`, `editable` | Excel-like spreadsheet |
|
|
213
252
|
|
|
214
253
|
### Charts (16 components)
|
|
215
254
|
|
|
216
|
-
| Component
|
|
217
|
-
|
|
218
|
-
| `NiceChart`
|
|
219
|
-
| `NicePieChart`
|
|
220
|
-
| `NicePolarChart`
|
|
221
|
-
| `NiceCircularGauge`
|
|
222
|
-
| `NiceLinearGauge`
|
|
223
|
-
| `NiceBarGauge`
|
|
224
|
-
| `NiceSparkline`
|
|
225
|
-
| `NiceBullet`
|
|
226
|
-
| `NiceFunnel`
|
|
227
|
-
| `NiceSankey`
|
|
228
|
-
| `NiceRangeSelector`
|
|
229
|
-
| `NiceVectorMap`
|
|
230
|
-
| `NiceHeatMap`
|
|
231
|
-
| `NiceTreeMap`
|
|
232
|
-
| `NiceStockChart`
|
|
233
|
-
| `NiceOrganizationChart` | `nodes[]`, `direction`, `onNodeClick`
|
|
255
|
+
| Component | Key Props | Description |
|
|
256
|
+
| ----------------------- | ------------------------------------------------------------------------------ | ---------------------- |
|
|
257
|
+
| `NiceChart` | `data[]`, `series[]`, `type` (`line`/`bar`/`area`/`scatter`), `xAxis`, `yAxis` | Multi-type chart |
|
|
258
|
+
| `NicePieChart` | `data[]`, `legend`, `donut` | Pie / donut chart |
|
|
259
|
+
| `NicePolarChart` | `data[]`, `series[]`, `angleAxis`, `radiusAxis` | Polar coordinate chart |
|
|
260
|
+
| `NiceCircularGauge` | `value`, `min`, `max`, `threshold`, `unit` | Circular gauge |
|
|
261
|
+
| `NiceLinearGauge` | `value`, `min`, `max`, `orientation` | Linear gauge |
|
|
262
|
+
| `NiceBarGauge` | `value`, `max`, `count` | Bar gauge |
|
|
263
|
+
| `NiceSparkline` | `data[]`, `type`, `trend` | Inline sparkline |
|
|
264
|
+
| `NiceBullet` | `value`, `ranges[]`, `measure`, `comparative` | Bullet chart |
|
|
265
|
+
| `NiceFunnel` | `data[]`, `link` | Funnel chart |
|
|
266
|
+
| `NiceSankey` | `nodes[]`, `links[]` | Sankey diagram |
|
|
267
|
+
| `NiceRangeSelector` | `data[]`, `onRangeChange` | Range selector chart |
|
|
268
|
+
| `NiceVectorMap` | `regions[]`, `mapName`, `onRegionClick` | Vector map |
|
|
269
|
+
| `NiceHeatMap` | `data[][]`, `xLabels`, `yLabels`, `colorScale` | Heat map grid |
|
|
270
|
+
| `NiceTreeMap` | `data[]`, `valueField`, `labelField` | Hierarchical tree map |
|
|
271
|
+
| `NiceStockChart` | `data[]`, `type` (`candlestick`/`ohlc`), `volume` | Financial stock chart |
|
|
272
|
+
| `NiceOrganizationChart` | `nodes[]`, `direction`, `onNodeClick` | Org chart / hierarchy |
|
|
234
273
|
|
|
235
274
|
### Overlays & Layout (9 components)
|
|
236
275
|
|
|
237
|
-
| Component
|
|
238
|
-
|
|
239
|
-
| `NiceActionSheet`
|
|
240
|
-
| `NicePopover`
|
|
241
|
-
| `NiceLoadPanel`
|
|
242
|
-
| `NiceBox`
|
|
243
|
-
| `NiceResponsiveBox` | `items[]`, `children`
|
|
244
|
-
| `NiceResizable`
|
|
245
|
-
| `NiceScrollView`
|
|
246
|
-
| `NiceBlockUI`
|
|
247
|
-
| `NiceWindow`
|
|
276
|
+
| Component | Key Props | Description |
|
|
277
|
+
| ------------------- | ------------------------------------------------------------------ | --------------------------- |
|
|
278
|
+
| `NiceActionSheet` | `open`, `onClose`, `items[]`, `title` | Mobile-style action sheet |
|
|
279
|
+
| `NicePopover` | `content`, `trigger`, `position`, `visible`, `children` | Popover |
|
|
280
|
+
| `NiceLoadPanel` | `visible`, `message` | Full-screen loading overlay |
|
|
281
|
+
| `NiceBox` | `padding`, `margin`, `border`, `background`, `children` | Box layout container |
|
|
282
|
+
| `NiceResponsiveBox` | `items[]`, `children` | Responsive layout container |
|
|
283
|
+
| `NiceResizable` | `width`, `height`, `minWidth`, `minHeight`, `onResize`, `children` | Resizable container |
|
|
284
|
+
| `NiceScrollView` | `horizontal`, `vertical`, `showTrack`, `children` | Custom scroll container |
|
|
285
|
+
| `NiceBlockUI` | `blocked`, `message`, `children` | Block UI overlay |
|
|
286
|
+
| `NiceWindow` | `title`, `open`, `onClose`, `resizable`, `draggable` | Draggable/resizable window |
|
|
248
287
|
|
|
249
288
|
### Planning (4 components)
|
|
250
289
|
|
|
251
|
-
| Component
|
|
252
|
-
|
|
290
|
+
| Component | Key Props | Description |
|
|
291
|
+
| --------------- | -------------------------------------------------------------- | ------------------ |
|
|
253
292
|
| `NiceScheduler` | `events[]`, `onEventChange`, `view`, `resources[]`, `workDays` | Calendar scheduler |
|
|
254
|
-
| `NiceGantt`
|
|
255
|
-
| `NiceDiagram`
|
|
256
|
-
| `NiceStepper`
|
|
293
|
+
| `NiceGantt` | `tasks[]`, `columns[]`, `scale`, `onTaskChange` | Gantt chart |
|
|
294
|
+
| `NiceDiagram` | `nodes[]`, `edges[]`, `onNodeClick`, `onEdgeClick` | Node/edge diagram |
|
|
295
|
+
| `NiceStepper` | `steps[]`, `currentStep`, `onStepChange`, `vertical` | Step wizard |
|
|
257
296
|
|
|
258
297
|
### Tools (14 components)
|
|
259
298
|
|
|
260
|
-
| Component
|
|
261
|
-
|
|
262
|
-
| `NiceChat`
|
|
263
|
-
| `NiceDraggable`
|
|
264
|
-
| `NiceSortable`
|
|
265
|
-
| `NiceFileUploader`
|
|
266
|
-
| `NiceFileManager`
|
|
267
|
-
| `NiceFilterBuilder`
|
|
268
|
-
| `NiceGallery`
|
|
269
|
-
| `NiceMap`
|
|
270
|
-
| `NiceSpeechToText`
|
|
271
|
-
| `NiceThemeDesigner`
|
|
272
|
-
| `NiceThemeBuilder`
|
|
273
|
-
| `NiceControlConfigurator` | `controlType`, `propDescriptors[]`, `renderPreview`
|
|
274
|
-
| `NiceViewBuilder`
|
|
275
|
-
| `NiceShowcase`
|
|
299
|
+
| Component | Key Props | Description |
|
|
300
|
+
| ------------------------- | ------------------------------------------------------- | ------------------------------------ |
|
|
301
|
+
| `NiceChat` | `messages[]`, `onSendMessage`, `currentUser` | Chat widget |
|
|
302
|
+
| `NiceDraggable` | `onDrag`, `ghostImage`, `children` | Drag source wrapper |
|
|
303
|
+
| `NiceSortable` | `items[]`, `onSort`, `direction` | Sortable list |
|
|
304
|
+
| `NiceFileUploader` | `onUpload`, `accept`, `multiple`, `maxSize`, `maxFiles` | File upload |
|
|
305
|
+
| `NiceFileManager` | `items[]`, `onDelete`, `onRename`, `onNavigate` | File browser |
|
|
306
|
+
| `NiceFilterBuilder` | `fields[]`, `onChange`, `value` | Visual filter/query builder |
|
|
307
|
+
| `NiceGallery` | `items[]`, `columns`, `gap`, `onItemClick` | Image gallery |
|
|
308
|
+
| `NiceMap` | `markers[]`, `center`, `zoom`, `onMarkerClick` | Map with markers |
|
|
309
|
+
| `NiceSpeechToText` | `onResult`, `language`, `continuous` | Speech recognition |
|
|
310
|
+
| `NiceThemeDesigner` | `onChange`, `onSave`, `onExport` | Live theme editor |
|
|
311
|
+
| `NiceThemeBuilder` | `sections[]`, `onChange`, `onExport` | Theme builder with CSS export |
|
|
312
|
+
| `NiceControlConfigurator` | `controlType`, `propDescriptors[]`, `renderPreview` | Interactive prop configurator |
|
|
313
|
+
| `NiceViewBuilder` | `definition`, `onChange`, `controlRegistry` | Drag-and-drop view builder |
|
|
314
|
+
| `NiceShowcase` | `defaultTab`, `showAbout`, `packageName`, `version` | Embeddable component showcase & docs |
|
|
276
315
|
|
|
277
316
|
### Validation (3 components + 1 hook)
|
|
278
317
|
|
|
279
|
-
| Component
|
|
280
|
-
|
|
281
|
-
| `NiceValidationGroup`
|
|
282
|
-
| `NiceValidator`
|
|
283
|
-
| `NiceValidationSummary` | `errors`
|
|
284
|
-
| `useNiceValidation()`
|
|
318
|
+
| Component | Key Props | Description |
|
|
319
|
+
| ----------------------- | ------------------------------ | ---------------------------------------------------- |
|
|
320
|
+
| `NiceValidationGroup` | `onSubmit`, `children` | Validation group wrapper |
|
|
321
|
+
| `NiceValidator` | `rules[]`, `value`, `onChange` | Field-level validator |
|
|
322
|
+
| `NiceValidationSummary` | `errors` | Error summary display |
|
|
323
|
+
| `useNiceValidation()` | — | Hook: `{ validate: (data) => NiceValidationRule[] }` |
|
|
285
324
|
|
|
286
325
|
---
|
|
287
326
|
|
|
@@ -294,8 +333,7 @@ All components build on a shared type system defined in `src/core/types.ts`:
|
|
|
294
333
|
```typescript
|
|
295
334
|
type NiceSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
296
335
|
|
|
297
|
-
type NiceVariant = 'primary' | 'secondary' | 'success' | 'warning'
|
|
298
|
-
| 'error' | 'info' | 'ghost' | 'outline';
|
|
336
|
+
type NiceVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info' | 'ghost' | 'outline';
|
|
299
337
|
|
|
300
338
|
type NiceDensity = 'compact' | 'normal' | 'comfortable';
|
|
301
339
|
|
|
@@ -331,23 +369,23 @@ type NiceOption<T = string> = {
|
|
|
331
369
|
|
|
332
370
|
Utility hooks exported from the package:
|
|
333
371
|
|
|
334
|
-
| Hook
|
|
335
|
-
|
|
336
|
-
| `useControlId`
|
|
337
|
-
| `useDebouncedValue`
|
|
338
|
-
| `useClickOutside`
|
|
339
|
-
| `useFocusTrap`
|
|
340
|
-
| `useIsTouchDevice`
|
|
341
|
-
| `useInputMode`
|
|
342
|
-
| `useLongPress`
|
|
343
|
-
| `useBreakpoint`
|
|
344
|
-
| `useMediaQuery`
|
|
345
|
-
| `useResponsiveValue` | `<T>(map: Record<Breakpoint, T>) => T`
|
|
346
|
-
| `useContainerSize`
|
|
347
|
-
| `useNiceToast`
|
|
348
|
-
| `useNiceTranslation` | `() => { t: NiceTranslateFn }`
|
|
349
|
-
| `useNiceIcon`
|
|
350
|
-
| `useNiceValidation`
|
|
372
|
+
| Hook | Signature | Description |
|
|
373
|
+
| -------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
374
|
+
| `useControlId` | `(externalId?: string) => string` | Generates a stable unique ID for form field–label associations. Uses the provided ID if given, otherwise generates one via `useId()`. |
|
|
375
|
+
| `useDebouncedValue` | `<T>(value: T, delayMs: number) => T` | Returns a debounced version of the input value. |
|
|
376
|
+
| `useClickOutside` | `(ref: RefObject<HTMLElement>, handler: () => void) => void` | Fires `handler` when a click or touch occurs outside the referenced element. |
|
|
377
|
+
| `useFocusTrap` | `(ref: RefObject<HTMLElement>, active: boolean) => void` | Traps keyboard focus within the referenced element (Tab/Shift+Tab cycling). Used by modals and drawers. |
|
|
378
|
+
| `useIsTouchDevice` | `() => boolean` | Detects `(pointer: coarse)` media query — returns `true` on touch devices. |
|
|
379
|
+
| `useInputMode` | `() => 'touch' \| 'mouse'` | Dynamically switches based on last input type (touchstart vs pointerdown). |
|
|
380
|
+
| `useLongPress` | `(callback, holdMs?) => PointerHandlers` | Long-press gesture detection for touch (default 500ms). |
|
|
381
|
+
| `useBreakpoint` | `() => 'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | Current viewport breakpoint. |
|
|
382
|
+
| `useMediaQuery` | `(query: string) => boolean` | CSS media query match. |
|
|
383
|
+
| `useResponsiveValue` | `<T>(map: Record<Breakpoint, T>) => T` | Returns value matching current breakpoint. |
|
|
384
|
+
| `useContainerSize` | `(ref: RefObject) => { width, height }` | Container element dimensions. |
|
|
385
|
+
| `useNiceToast` | `() => { show: (msg, type?, duration?) => void }` | Programmatic toast notifications. |
|
|
386
|
+
| `useNiceTranslation` | `() => { t: NiceTranslateFn }` | Access the current translation function. |
|
|
387
|
+
| `useNiceIcon` | `(name: string, size: number) => ReactNode \| undefined` | Resolve an icon name via the current icon provider. |
|
|
388
|
+
| `useNiceValidation` | `() => { validate: (data) => NiceValidationRule[] }` | Form validation. |
|
|
351
389
|
|
|
352
390
|
### Icon System
|
|
353
391
|
|
|
@@ -355,16 +393,16 @@ The library ships with **78 built-in SVG icons** covering common UI needs. No ex
|
|
|
355
393
|
|
|
356
394
|
#### Built-in Icon Categories
|
|
357
395
|
|
|
358
|
-
| Category
|
|
359
|
-
|
|
360
|
-
| Navigation | 8
|
|
361
|
-
| Actions
|
|
362
|
-
| UI Chrome
|
|
363
|
-
| Status
|
|
364
|
-
| Content
|
|
365
|
-
| Media
|
|
366
|
-
| Toggle
|
|
367
|
-
| Misc
|
|
396
|
+
| Category | Count | Examples |
|
|
397
|
+
| ---------- | ----- | ---------------------------------------------------------------------------------------------------------- |
|
|
398
|
+
| Navigation | 8 | `chevron-down`, `arrow-left`, `arrow-right`, `arrow-up` |
|
|
399
|
+
| Actions | 10 | `close`, `plus`, `minus`, `check`, `edit`, `trash`, `copy`, `download`, `upload`, `refresh` |
|
|
400
|
+
| UI Chrome | 10 | `search`, `filter`, `sort-asc`, `sort-desc`, `menu`, `more-vertical`, `settings`, `eye`, `eye-off`, `lock` |
|
|
401
|
+
| Status | 6 | `info`, `warning`, `error`, `success`, `help`, `bell` |
|
|
402
|
+
| Content | 12 | `calendar`, `clock`, `file`, `folder`, `image`, `link`, `mail`, `phone`, `user`, `users`, `home`, `star` |
|
|
403
|
+
| Media | 3 | `play`, `pause`, `stop` |
|
|
404
|
+
| Toggle | 3 | `expand`, `collapse`, `external-link` |
|
|
405
|
+
| Misc | 3+ | `heart`, `grip`, `more-horizontal` |
|
|
368
406
|
|
|
369
407
|
#### Using Icons
|
|
370
408
|
|
|
@@ -393,10 +431,11 @@ const myResolver: NiceIconResolver = (name, size) => {
|
|
|
393
431
|
|
|
394
432
|
<NiceIconProvider resolver={myResolver}>
|
|
395
433
|
<App />
|
|
396
|
-
</NiceIconProvider
|
|
434
|
+
</NiceIconProvider>;
|
|
397
435
|
```
|
|
398
436
|
|
|
399
437
|
The `NiceIconResolver` type signature:
|
|
438
|
+
|
|
400
439
|
```typescript
|
|
401
440
|
type NiceIconResolver = (name: string, size: number) => React.ReactNode | undefined;
|
|
402
441
|
```
|
|
@@ -406,12 +445,12 @@ The companion package [`@nice2dev/icons`](#companion-package-nice2devicons) prov
|
|
|
406
445
|
#### Icon Sizes
|
|
407
446
|
|
|
408
447
|
| Size Key | Pixels |
|
|
409
|
-
|
|
410
|
-
| `xs`
|
|
411
|
-
| `sm`
|
|
412
|
-
| `md`
|
|
413
|
-
| `lg`
|
|
414
|
-
| `xl`
|
|
448
|
+
| -------- | ------ |
|
|
449
|
+
| `xs` | 12 |
|
|
450
|
+
| `sm` | 16 |
|
|
451
|
+
| `md` | 20 |
|
|
452
|
+
| `lg` | 24 |
|
|
453
|
+
| `xl` | 32 |
|
|
415
454
|
|
|
416
455
|
You can also pass a numeric value directly: `<NiceIcon name="check" size={18} />`
|
|
417
456
|
|
|
@@ -445,10 +484,11 @@ const myTranslate: NiceTranslateFn = (key, defaultValue) => {
|
|
|
445
484
|
|
|
446
485
|
<NiceI18nProvider t={myTranslate}>
|
|
447
486
|
<App />
|
|
448
|
-
</NiceI18nProvider
|
|
487
|
+
</NiceI18nProvider>;
|
|
449
488
|
```
|
|
450
489
|
|
|
451
490
|
The `NiceTranslateFn` type:
|
|
491
|
+
|
|
452
492
|
```typescript
|
|
453
493
|
type NiceTranslateFn = (key: string, defaultValue: string) => string;
|
|
454
494
|
```
|
|
@@ -469,6 +509,7 @@ function DocsPage() {
|
|
|
469
509
|
```
|
|
470
510
|
|
|
471
511
|
Props:
|
|
512
|
+
|
|
472
513
|
- `defaultTab` — initial tab (`'about'`, `'dashboard'`, `'forms'`, `'controls'`, etc.)
|
|
473
514
|
- `showAbout` — show/hide the About & Installation tab (default: `true`)
|
|
474
515
|
- `tabs` — array of visible tabs (default: all)
|
|
@@ -486,14 +527,13 @@ Built-in per-component access modes allow controlling visibility and interactivi
|
|
|
486
527
|
import { NiceAccessControl, NiceTextInput, NiceButton } from '@nice2dev/ui';
|
|
487
528
|
|
|
488
529
|
// Provider-level permissions:
|
|
489
|
-
<NiceAccessControl
|
|
490
|
-
defaultMode="full"
|
|
491
|
-
permissions={{ 'salary-field': 'readOnly', 'delete-btn': 'hidden' }}
|
|
492
|
-
>
|
|
530
|
+
<NiceAccessControl defaultMode="full" permissions={{ 'salary-field': 'readOnly', 'delete-btn': 'hidden' }}>
|
|
493
531
|
<NiceTextInput accessMode="full" label="Name" />
|
|
494
532
|
<NiceTextInput componentId="salary-field" label="Salary" />
|
|
495
|
-
<NiceButton componentId="delete-btn" variant="error">
|
|
496
|
-
|
|
533
|
+
<NiceButton componentId="delete-btn" variant="error">
|
|
534
|
+
Delete
|
|
535
|
+
</NiceButton>
|
|
536
|
+
</NiceAccessControl>;
|
|
497
537
|
```
|
|
498
538
|
|
|
499
539
|
Modes: `'full'` (default), `'readOnly'`, `'disabled'`, `'hidden'`
|
|
@@ -537,10 +577,10 @@ import '@nice2dev/ui/style.css';
|
|
|
537
577
|
--hover-bg: #f1f5f9;
|
|
538
578
|
|
|
539
579
|
/* Shadows */
|
|
540
|
-
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
|
|
541
|
-
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
|
|
542
|
-
--shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
|
|
543
|
-
--shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
|
|
580
|
+
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
581
|
+
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
582
|
+
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
|
|
583
|
+
--shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
544
584
|
}
|
|
545
585
|
```
|
|
546
586
|
|
|
@@ -556,13 +596,19 @@ Dark mode is supported in three ways:
|
|
|
556
596
|
<!-- Auto: follows OS preference (default behavior, no extra code) -->
|
|
557
597
|
|
|
558
598
|
<!-- Manual toggle via class: -->
|
|
559
|
-
<body class="nice-dark"
|
|
599
|
+
<body class="nice-dark">
|
|
600
|
+
...
|
|
601
|
+
</body>
|
|
560
602
|
|
|
561
603
|
<!-- Manual toggle via attribute: -->
|
|
562
|
-
<body data-theme="dark"
|
|
604
|
+
<body data-theme="dark">
|
|
605
|
+
...
|
|
606
|
+
</body>
|
|
563
607
|
|
|
564
608
|
<!-- Opt-in light mode when OS is dark: -->
|
|
565
|
-
<body data-theme="light"
|
|
609
|
+
<body data-theme="light">
|
|
610
|
+
...
|
|
611
|
+
</body>
|
|
566
612
|
```
|
|
567
613
|
|
|
568
614
|
### Custom Themes
|
|
@@ -572,7 +618,7 @@ Create a custom theme by overriding CSS variables:
|
|
|
572
618
|
```css
|
|
573
619
|
/* my-theme.css */
|
|
574
620
|
:root {
|
|
575
|
-
--color-primary: #8b5cf6;
|
|
621
|
+
--color-primary: #8b5cf6; /* purple primary */
|
|
576
622
|
--color-primary-hover: #7c3aed;
|
|
577
623
|
--bg-primary: #faf5ff;
|
|
578
624
|
--border-color: #ddd6fe;
|
|
@@ -598,12 +644,12 @@ npm run preview # Preview built library
|
|
|
598
644
|
|
|
599
645
|
### Build Output
|
|
600
646
|
|
|
601
|
-
| File
|
|
602
|
-
|
|
603
|
-
| `dist/index.mjs`
|
|
604
|
-
| `dist/index.cjs`
|
|
605
|
-
| `dist/style.css`
|
|
606
|
-
| `dist/index.d.ts` | TypeScript | —
|
|
647
|
+
| File | Format | Size | Purpose |
|
|
648
|
+
| ----------------- | ---------- | ------- | ----------------------------------------- |
|
|
649
|
+
| `dist/index.mjs` | ESM | ~207 KB | Modern bundlers (Vite, webpack 5, Rollup) |
|
|
650
|
+
| `dist/index.cjs` | CJS | ~146 KB | Node.js, older bundlers |
|
|
651
|
+
| `dist/style.css` | CSS | ~79 KB | All component styles |
|
|
652
|
+
| `dist/index.d.ts` | TypeScript | — | Type definitions |
|
|
607
653
|
|
|
608
654
|
### Build Configuration
|
|
609
655
|
|