@kiteapps/lite-ui 0.1.0 → 0.1.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.
- package/README.md +13 -11
- package/dist/index.cjs +783 -37
- package/dist/index.mjs +778 -33
- package/dist/types/admin/screens.d.ts +13 -0
- package/dist/types/lib/index.d.ts +2 -0
- package/dist/types/pages/AdminScreen.d.ts +10 -0
- package/dist/types/pages/ConfigurationPage.d.ts +46 -0
- package/dist/types/pages/DashboardPage.d.ts +30 -0
- package/dist/types/pages/ReportsPage.d.ts +30 -0
- package/dist/types/pages/index.d.ts +4 -0
- package/dist/types/widgets/ConfigurationWidgets.d.ts +90 -0
- package/dist/types/widgets/DashboardWidgets.d.ts +113 -0
- package/dist/types/widgets/Primitives.d.ts +119 -0
- package/dist/types/widgets/ReportWidgets.d.ts +71 -0
- package/dist/types/widgets/SettingsWidgets.d.ts +32 -0
- package/dist/types/widgets/Shell.d.ts +112 -0
- package/dist/types/widgets/index.d.ts +7 -0
- package/package.json +62 -20
- package/dist/pages.cjs +0 -1319
- package/dist/pages.css +0 -2070
- package/dist/pages.mjs +0 -1287
package/README.md
CHANGED
|
@@ -8,23 +8,26 @@ A React widget library and interactive reference implementation of the [ADSelfSe
|
|
|
8
8
|
npm install
|
|
9
9
|
npm start
|
|
10
10
|
npm run storybook
|
|
11
|
-
npm run build
|
|
11
|
+
npm run build
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
`npm run build`
|
|
14
|
+
`npm run build` creates the distributable package in `dist`. `npm run build:demo` builds the standalone demo; `npm run build-storybook` builds the component catalog. The demo starts on Login Settings. Use the top navigation to open Dashboard, Reports, and Configuration.
|
|
15
15
|
|
|
16
16
|
## Package entries
|
|
17
17
|
|
|
18
|
-
The root entry exports
|
|
18
|
+
The root entry exports every widget and page. Install the package and its peer dependencies in your React project:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install @kiteapps/lite-ui lucide-react
|
|
21
|
+
npm install @kiteapps/lite-ui react react-dom lucide-react
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
import '@kiteapps/lite-ui/styles.css';
|
|
26
|
-
import {
|
|
27
|
-
|
|
26
|
+
import {
|
|
27
|
+
AppShell, TopNavigation, CollapsibleSidebar, MetricWidget, MfaChart,
|
|
28
|
+
ShortcutRail, ReportCategoryBar, ReportNavigation, PolicyTable,
|
|
29
|
+
DashboardPage, ReportsPage, ConfigurationPage, AdminScreen,
|
|
30
|
+
} from '@kiteapps/lite-ui';
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
## Use your own content
|
|
@@ -34,8 +37,7 @@ The ADSelfService Plus text and counts are defaults for the demo. Pass your own
|
|
|
34
37
|
```jsx
|
|
35
38
|
import { ShoppingCart } from 'lucide-react';
|
|
36
39
|
import '@kiteapps/lite-ui/styles.css';
|
|
37
|
-
import { AppShell, MetricWidget, ReportNavigation, PolicyTable } from '@kiteapps/lite-ui';
|
|
38
|
-
import { DashboardPage, ReportsPage } from '@kiteapps/lite-ui/pages';
|
|
40
|
+
import { AppShell, MetricWidget, ReportNavigation, PolicyTable, DashboardPage, ReportsPage } from '@kiteapps/lite-ui';
|
|
39
41
|
|
|
40
42
|
const metrics = [
|
|
41
43
|
{ id: 'orders', title: 'Orders Today', value: '128', caption: 'Across all stores', icon: ShoppingCart, report: 'daily' },
|
|
@@ -74,11 +76,11 @@ const reportGroups = [
|
|
|
74
76
|
|
|
75
77
|
`ConfigurationPage` accepts custom `groups`, `policies` or `initialPolicies`, `features`, `columns`, `labels`, `onFeatureSelect`, and policy action callbacks. It manages policies locally unless you pass `policies` and `onPoliciesChange`. The toolbar searches and paginates the displayed rows; set `toolbarProps.pageSize` to change page size. `PolicyTable` accepts custom columns such as `{ key: 'owner', label: 'Owner' }`, with values read from each policy object. `DataTable` likewise accepts object columns, object rows, custom cell renderers, and `onRowClick`.
|
|
76
78
|
|
|
77
|
-
Every page imports its building blocks from the public widget entry, and the Storybook **
|
|
79
|
+
Every page imports its building blocks from the public widget entry, and the Storybook **Widgets** and **Pages** stories show the same prop patterns interactively. To use one piece without a full page, render it directly, for example `<MetricWidget title="Orders" value="128" caption="Today" onClick={openOrders} />`.
|
|
78
80
|
|
|
79
81
|
`AdminScreen` is a reference page gallery. Pass `screens={{ myScreen: MySettingsPage }}` or `renderScreen={id => ...}` to supply your own page; build it from the exported form widgets such as `Frame`, `FormRow`, `CheckRow`, `InlineSelect`, `DataTable`, and `SaveBar`.
|
|
80
82
|
|
|
81
|
-
For local package installation, run `npm pack` and install the resulting `.tgz` in the consuming project. React, React DOM, and Lucide React are peer dependencies. The library builds ESM and CommonJS files and
|
|
83
|
+
For local package installation, run `npm pack` and install the resulting `.tgz` in the consuming project. React, React DOM, and Lucide React are peer dependencies. The library builds ESM and CommonJS files, TypeScript declarations, and CSS. Import the stylesheet once in your app. The `/pages` import path remains available for existing consumers.
|
|
82
84
|
|
|
83
85
|
## Publish to npm
|
|
84
86
|
|
|
@@ -95,7 +97,7 @@ npm publish --access public
|
|
|
95
97
|
|
|
96
98
|
`prepack` also runs the library build when publishing. For a later release, update the version with `npm version patch` (or `minor`/`major`) before publishing again. See the [npm guide to scoped public packages](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages/).
|
|
97
99
|
|
|
98
|
-
The Storybook catalog
|
|
100
|
+
The Storybook catalog has only **Widgets** and **Pages**. Widgets contains editable, interactive stories for PageHeader, DashboardToolbar, report navigation and filters, ShellHeader, TopNavigation, ShellFooter, AppShell, collapsible and configuration sidebars, policy features and tables, settings tabs, and InlineSelect. Each story has **Controls** for text and data props and a **Last action** readout for callback behavior. PolicyTable includes custom-column and empty-state variations.
|
|
99
101
|
|
|
100
102
|
| Widget | Content props | Action props |
|
|
101
103
|
| --- | --- | --- |
|