injast-core 1.0.81 → 1.0.83
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 +87 -1
- package/dist/components/index.js +1143 -1
- package/dist/constants/index.js +4 -0
- package/dist/headphone-FHILIBNI.svg +7 -0
- package/dist/index.js +1160 -17
- package/dist/types/components/index.d.ts +19 -0
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/mobile-app-template/components/mobile-app-footer-nav.d.ts +16 -0
- package/dist/types/mobile-app-template/components/mobile-app-layout.d.ts +19 -0
- package/dist/types/mobile-app-template/index.d.ts +2 -0
- package/dist/types/shared/components/Badge.d.ts +7 -0
- package/dist/types/shared/components/SidebarRow.d.ts +40 -0
- package/dist/types/shared/components/TemplateDashboardSidebar.d.ts +24 -0
- package/dist/types/shared/components/app-page-footer.d.ts +14 -0
- package/dist/types/shared/components/app-page-header.d.ts +28 -0
- package/dist/types/shared/components/template-dashboard/TemplateDashboard.d.ts +2 -0
- package/dist/types/shared/components/template-dashboard/TemplateDashboard.types.d.ts +18 -0
- package/dist/types/shared/components/template-dashboard/index.d.ts +3 -0
- package/dist/types/shared/components/template-dashboard-header/TemplateDashboardHeader.d.ts +3 -0
- package/dist/types/shared/components/template-dashboard-header/TemplateDashboardHeader.styles.d.ts +99 -0
- package/dist/types/shared/components/template-dashboard-header/TemplateDashboardHeader.types.d.ts +8 -0
- package/dist/types/shared/components/template-dashboard-header/index.d.ts +3 -0
- package/dist/types/theme/colors.d.ts +36 -0
- package/guidelines/Guidelines.md +46 -14
- package/guidelines/ai-index.md +111 -0
- package/guidelines/components/app-templates.md +103 -0
- package/guidelines/components/data-display.md +1 -1
- package/guidelines/components/date-inputs.md +2 -2
- package/guidelines/components/feedback.md +9 -3
- package/guidelines/components/forms.md +3 -1
- package/guidelines/components/layout.md +7 -5
- package/guidelines/foundations/spacing.md +3 -3
- package/guidelines/setup.md +14 -3
- package/package.json +6 -3
- package/skills/injast-app-builder/SKILL.md +54 -0
- package/skills/injast-app-builder/agents/openai.yaml +4 -0
package/README.md
CHANGED
|
@@ -106,6 +106,69 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
106
106
|
|
|
107
107
|
Most wrapper components accept the corresponding Material UI component props, with additional Injast-specific props where documented in Storybook stories.
|
|
108
108
|
|
|
109
|
+
## Persian Calendar
|
|
110
|
+
|
|
111
|
+
برای انتخاب تاریخ شمسی، از `MobileDatePicker` یا `WheelDatePicker` استفاده کنید. هر دو کامپوننت تاریخ را برای کاربر به صورت شمسی نمایش میدهند.
|
|
112
|
+
|
|
113
|
+
`MobileDatePicker` برای تقویم مودالی مناسب است. مقدار `value` و خروجی `onChange` آن میلادی و با فرمت `YYYY-MM-DD` است، اما `minDate` و `maxDate` را به صورت شمسی `YYYY/MM/DD` میگیرد:
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
import { useState } from "react";
|
|
117
|
+
import { MobileDatePicker } from "injast-core";
|
|
118
|
+
|
|
119
|
+
export function BirthDateField() {
|
|
120
|
+
const [birthDate, setBirthDate] = useState("2024-03-20");
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<MobileDatePicker
|
|
124
|
+
label="تاریخ تولد"
|
|
125
|
+
placeholder="تاریخ را انتخاب کنید"
|
|
126
|
+
value={birthDate}
|
|
127
|
+
onChange={setBirthDate}
|
|
128
|
+
minDate="1300/01/01"
|
|
129
|
+
maxDate="1403/12/30"
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`WheelDatePicker` برای انتخابگر چرخشی داخل دراور مناسب است. اگر میخواهید state فرم شمسی بماند، `dateFormat="jalali"` بگذارید:
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
import { useState } from "react";
|
|
139
|
+
import { WheelDatePicker } from "injast-core";
|
|
140
|
+
|
|
141
|
+
export function DeliveryDateField() {
|
|
142
|
+
const [deliveryDate, setDeliveryDate] = useState<string | null>("1403/01/01");
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<WheelDatePicker
|
|
146
|
+
title="تاریخ تحویل"
|
|
147
|
+
placeholder="تاریخ تحویل"
|
|
148
|
+
value={deliveryDate}
|
|
149
|
+
onChange={(value) =>
|
|
150
|
+
setDeliveryDate(typeof value === "string" ? value : null)
|
|
151
|
+
}
|
|
152
|
+
dateFormat="jalali"
|
|
153
|
+
/>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
برای ارسال تاریخ به API یا نمایش تاریخ، از utilityهای آماده استفاده کنید و تبدیل شمسی/میلادی را دستی ننویسید:
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import {
|
|
162
|
+
gregorianToJalali,
|
|
163
|
+
jalaliToGregorian,
|
|
164
|
+
shortDateFormat,
|
|
165
|
+
} from "injast-core";
|
|
166
|
+
|
|
167
|
+
gregorianToJalali("2024-03-20"); // "1403/01/01"
|
|
168
|
+
jalaliToGregorian("1403/01/01"); // "2024-03-20"
|
|
169
|
+
shortDateFormat("2024-03-20");
|
|
170
|
+
```
|
|
171
|
+
|
|
109
172
|
## Utilities and Hooks
|
|
110
173
|
|
|
111
174
|
Useful utilities are exported from `injast-core/utils`, including date conversion helpers, Persian number formatting, query string creation, iframe messaging, and `coreFaIR` for MUI Persian locale configuration.
|
|
@@ -137,10 +200,33 @@ Then select `injast-core` from the public unscoped package results.
|
|
|
137
200
|
For Make kits, start with the included guidelines:
|
|
138
201
|
|
|
139
202
|
```text
|
|
203
|
+
guidelines/ai-index.md
|
|
140
204
|
guidelines/Guidelines.md
|
|
141
205
|
```
|
|
142
206
|
|
|
143
|
-
The
|
|
207
|
+
The AI index routes Make and coding agents to setup instructions, foundations, component selection rules, focused component usage notes, runtime helpers, and TypeScript types. In a Vite/React Make file, use `SPAThemeProvider`, import `injast-core/fonts.css` once, and prefer Injast components over raw HTML controls.
|
|
208
|
+
|
|
209
|
+
For Figma-driven implementation, use the Figma MCP flow before coding. The local MCP endpoint is:
|
|
210
|
+
|
|
211
|
+
```text
|
|
212
|
+
http://127.0.0.1:3845/mcp
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Fetch structured design context and a screenshot for the exact node, then translate the design into Injast Core components, RTL layout, Persian copy, and the project guidelines.
|
|
216
|
+
|
|
217
|
+
Generated mobile app screens should follow the Gold reference app at `/Users/ali/Documents/Gold`: centered `max-width: 520px` shell, wired navigation and overlay behavior, Injast Core inputs, drawer-based pre-invoices, and no mobile OS/app status bar chrome.
|
|
218
|
+
|
|
219
|
+
## Codex Skill
|
|
220
|
+
|
|
221
|
+
The package ships a Codex skill for Injast app generation:
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
skills/injast-app-builder
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
After installing the package, consumers can point Codex at `node_modules/injast-core/skills/injast-app-builder` or copy that folder into their Codex skills directory if their Codex setup does not auto-discover package-bundled skills.
|
|
228
|
+
|
|
229
|
+
The skill starts from `guidelines/ai-index.md` and then loads focused guideline files for the requested screen or flow.
|
|
144
230
|
|
|
145
231
|
## License
|
|
146
232
|
|