@indinno/digicode-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 +39 -143
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +1496 -0
- package/dist/ui.d.ts +78 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +76 -0
- package/dist/ui.js.map +1 -0
- package/package.json +43 -22
- package/LICENSE +0 -21
- package/bin/digicode.mjs +0 -136
- package/registry/components/accordion.tsx +0 -41
- package/registry/components/alert.tsx +0 -21
- package/registry/components/avatar.tsx +0 -18
- package/registry/components/badge.tsx +0 -9
- package/registry/components/breadcrumb.tsx +0 -22
- package/registry/components/button.tsx +0 -38
- package/registry/components/card.tsx +0 -10
- package/registry/components/checkbox.tsx +0 -15
- package/registry/components/dialog.tsx +0 -46
- package/registry/components/drawer.tsx +0 -42
- package/registry/components/dropdown-menu.tsx +0 -38
- package/registry/components/empty-state.tsx +0 -20
- package/registry/components/input.tsx +0 -28
- package/registry/components/pagination.tsx +0 -21
- package/registry/components/progress.tsx +0 -17
- package/registry/components/radio-group.tsx +0 -40
- package/registry/components/select.tsx +0 -33
- package/registry/components/separator.tsx +0 -10
- package/registry/components/skeleton.tsx +0 -6
- package/registry/components/spinner.tsx +0 -11
- package/registry/components/stat-card.tsx +0 -21
- package/registry/components/switch.tsx +0 -15
- package/registry/components/table.tsx +0 -11
- package/registry/components/tabs.tsx +0 -52
- package/registry/components/textarea.tsx +0 -22
- package/registry/components/tooltip.tsx +0 -16
- package/registry/lib/cn.ts +0 -3
- package/registry/registry.json +0 -32
- package/registry/styles/digicode.css +0 -253
package/README.md
CHANGED
|
@@ -1,167 +1,63 @@
|
|
|
1
|
-
# DigiCode
|
|
1
|
+
# DigiCode UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components extracted from the DigiCode Solutions website, with TypeScript declarations and a standalone CSS stylesheet. Package name: `@indinno/digicode-ui`. Version 0.1.1 is prepared locally and has not been published by this project.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Development
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- Breadcrumb
|
|
14
|
-
- Button
|
|
15
|
-
- Card
|
|
16
|
-
- Checkbox
|
|
17
|
-
- Dialog
|
|
18
|
-
- Drawer
|
|
19
|
-
- Dropdown Menu
|
|
20
|
-
- Empty State
|
|
21
|
-
- Input
|
|
22
|
-
- Pagination
|
|
23
|
-
- Progress
|
|
24
|
-
- Radio Group
|
|
25
|
-
- Select
|
|
26
|
-
- Separator
|
|
27
|
-
- Skeleton
|
|
28
|
-
- Spinner
|
|
29
|
-
- Stat Card
|
|
30
|
-
- Switch
|
|
31
|
-
- Table
|
|
32
|
-
- Tabs
|
|
33
|
-
- Textarea
|
|
34
|
-
- Tooltip
|
|
35
|
-
|
|
36
|
-
## Publish to npm
|
|
37
|
-
|
|
38
|
-
1. Change the package name in `package.json` if needed. The starter uses:
|
|
39
|
-
|
|
40
|
-
```json
|
|
41
|
-
"name": "@indinno/digicode-ui"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
2. Login and publish:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm login
|
|
48
|
-
npm publish --access public
|
|
7
|
+
```sh
|
|
8
|
+
npm ci
|
|
9
|
+
npm run preview -- --port 4173
|
|
10
|
+
npm run typecheck
|
|
11
|
+
npm run build
|
|
12
|
+
npm run pack:check
|
|
49
13
|
```
|
|
50
14
|
|
|
51
|
-
|
|
15
|
+
Open http://127.0.0.1:4173 to explore buttons, form controls, cards, illustrations, and corner options. Build output is generated in `dist/`.
|
|
52
16
|
|
|
53
|
-
|
|
17
|
+
## Usage
|
|
54
18
|
|
|
55
|
-
|
|
56
|
-
npx @indinno/digicode-ui init
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Add only the components you need:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npx @indinno/digicode-ui add button input card badge
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Or install the full primitive set:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npx @indinno/digicode-ui add all
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
List available components:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
npx @indinno/digicode-ui list
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
The CLI copies source into either:
|
|
78
|
-
|
|
79
|
-
```text
|
|
80
|
-
src/components/ui
|
|
81
|
-
src/lib/cn.ts
|
|
82
|
-
src/styles/digicode.css
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
or, for projects without a `src` directory:
|
|
86
|
-
|
|
87
|
-
```text
|
|
88
|
-
components/ui
|
|
89
|
-
lib/cn.ts
|
|
90
|
-
styles/digicode.css
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
That means the consuming project **owns the source code**, just like the shadcn model. You can edit a copied button or card locally without waiting for a library release.
|
|
94
|
-
|
|
95
|
-
## Import the stylesheet once
|
|
96
|
-
|
|
97
|
-
For a Next.js app using `src/app`, add this to the root layout or global stylesheet entry:
|
|
19
|
+
After installing the package in a React application, import the stylesheet once:
|
|
98
20
|
|
|
99
21
|
```tsx
|
|
100
|
-
import "
|
|
101
|
-
|
|
22
|
+
import { Button, Field, Select } from "@indinno/digicode-ui";
|
|
23
|
+
import "@indinno/digicode-ui/styles.css";
|
|
102
24
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
import { Button } from "@/components/ui/button";
|
|
107
|
-
import {
|
|
108
|
-
Card,
|
|
109
|
-
CardContent,
|
|
110
|
-
CardHeader,
|
|
111
|
-
CardTitle,
|
|
112
|
-
} from "@/components/ui/card";
|
|
113
|
-
import { Input } from "@/components/ui/input";
|
|
114
|
-
|
|
115
|
-
export function Example() {
|
|
25
|
+
export function ProjectForm() {
|
|
116
26
|
return (
|
|
117
|
-
<
|
|
118
|
-
<
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</
|
|
125
|
-
|
|
27
|
+
<form>
|
|
28
|
+
<Field label="Project type">
|
|
29
|
+
<Select name="projectType" corners="subtle" defaultValue="automation">
|
|
30
|
+
<option value="automation">Automation</option>
|
|
31
|
+
<option value="website">Website</option>
|
|
32
|
+
<option value="dashboard">Dashboard</option>
|
|
33
|
+
</Select>
|
|
34
|
+
</Field>
|
|
35
|
+
<Button label="Start a project" corners="square" arrow />
|
|
36
|
+
</form>
|
|
126
37
|
);
|
|
127
38
|
}
|
|
128
39
|
```
|
|
129
40
|
|
|
130
|
-
|
|
41
|
+
React, React DOM, and lucide-react are peer dependencies. See `package.json` for supported ranges. The library uses ES modules.
|
|
131
42
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
```tsx
|
|
135
|
-
<div data-digicode-theme="dark">
|
|
136
|
-
<Button>Dark theme button</Button>
|
|
137
|
-
</div>
|
|
138
|
-
```
|
|
43
|
+
## Components
|
|
139
44
|
|
|
140
|
-
|
|
45
|
+
- `Button`, `ButtonLink`: dark, light, and text variants; rolling labels and optional animated arrows.
|
|
46
|
+
- `Input`, `Textarea`, `Select`, `Field`: native form controls with labels and optional hints.
|
|
47
|
+
- `Brand`, `SectionHeading`: branding and section headings.
|
|
48
|
+
- `ServiceCard`, `ServiceVisual`: automation, store, logistics, analytics, and AI illustrations.
|
|
49
|
+
- `ProductCard`, `ProductPreview`: tasks, inventory, and school previews.
|
|
141
50
|
|
|
142
|
-
|
|
51
|
+
Buttons, links, inputs, textareas, and selects accept `corners="square" | "subtle" | "rounded" | "pill"`. The default is `subtle` (4px). Dropdown panels use matching corner styles; pill textareas use a practical 24px radius.
|
|
143
52
|
|
|
144
|
-
|
|
145
|
-
:root {
|
|
146
|
-
--digicode-primary: #2474ad;
|
|
147
|
-
--digicode-ink: #1c2f41;
|
|
148
|
-
--digicode-radius: 12px;
|
|
149
|
-
--digicode-radius-lg: 18px;
|
|
150
|
-
}
|
|
151
|
-
```
|
|
53
|
+
The enhanced select menu uses CSS `appearance: base-select` where supported. Other browsers retain their native picker. Native selection, keyboard navigation, and form behavior are preserved. Select animations respect reduced-motion preferences.
|
|
152
54
|
|
|
153
|
-
|
|
55
|
+
Style tokens such as `--dc-ink`, `--dc-heading`, `--dc-muted`, and `--dc-blue` can be overridden in application CSS. Components inherit the application's font.
|
|
154
56
|
|
|
155
|
-
##
|
|
57
|
+
## Publishing
|
|
156
58
|
|
|
157
|
-
|
|
59
|
+
Configure the npm trusted publisher with owner `misindinno`, repository `digicode-ui`, workflow filename `publish.yml`, no environment, and Allow npm publish enabled.
|
|
158
60
|
|
|
159
|
-
-
|
|
160
|
-
- hero sections
|
|
161
|
-
- website navigation
|
|
162
|
-
- footer sections
|
|
163
|
-
- DigiCode-specific copy/data
|
|
164
|
-
- API/enquiry logic
|
|
165
|
-
- app-specific dashboards
|
|
61
|
+
To publish, update the version in package.json and package-lock.json, commit and push, then publish a GitHub release with a matching tag (for example, `v0.1.1`). The Publish to npm workflow checks the version, builds the package, and publishes it automatically. Draft releases, prereleases, and ordinary pushes do not publish. Each npm release needs a previously unused version.
|
|
166
62
|
|
|
167
|
-
|
|
63
|
+
You can also manually run Publish to npm from GitHub Actions on `main`. The workflow only publishes from `misindinno/digicode-ui`; the rinkupuri copy remains separate. No release is created by adding this workflow.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Brand, Button, ButtonLink, Field, Input, ProductCard, ProductPreview, SectionHeading, Select, ServiceCard, ServiceVisual, Textarea, type ButtonProps, type CornerStyle, type CornerProps, type FieldProps, type ProductCardProps, type ProductPreviewKind, type ServiceCardProps, type ServiceVisualKind, } from "./ui.js";
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,EACR,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,cAAc,EACd,cAAc,EACd,MAAM,EACN,WAAW,EACX,aAAa,EACb,QAAQ,GAST,MAAM,SAAS,CAAC"}
|