Highlight user tasks in DiagramBPMN
v0The
DiagramBPMN component allows for highlighting specific user tasks within the BPMN diagram.website·Indexed 31 days ago
https://alurkerja-docs.vercel.app/A library for building CRUD applications, featuring a suite of UI components including FormLowcode, TableLowcode, ReactHookWrapper, and various input elements like InputDate, InputYear, and PendingUpload.
DiagramBPMN component allows for highlighting specific user tasks within the BPMN diagram.To contribute to Alurkerja, clone the repository from GitHub and follow the installation steps provided in the project's README file. The project uses a monorepo architecture with the following structure:
packages/alurkerja-uiapp/alurkerja-docs# Repository URL
https://github.com/shaddamalbz/alurkerjaInput component from alurkerja-ui is a styled wrapper around the standard HTML <input> tag. It supports all standard input attributes and behaviors, allowing it to be used exactly like a native input element.import { Input } from 'alurkerja-ui'
export const Example = () => {
return <Input />
}Select component with remote data, fetch the data (e.g., using axios), map the response to the required { label, value } format, and use the isLoading prop to indicate the loading state.import { Select } from 'alurkerja-ui'
import axios from "axios"
import { useState, useEffect } from 'react'
export const SelectPage = () => {
const [options, setOptions] = useState()
const [isLoading, setIsLoading] = useState(false)
useEffect(() => {
setIsLoading(true)
axios
.get('https://dummyjson.com/products')
.then((res) => {
setOptions(res.data.products.map((item: any) => ({ label: item.title, value: item.id })))
})
.finally(() => {setIsLoading(false)})
}, [])
return(
<Select options={options} isLoading={isLoading} />
)
}Skeleton component from alurkerja-ui is used to create placeholder shapes that indicate content is loading. It supports basic usage, custom dimensions, and different shapes via the variant prop.import { Skeleton } from 'alurkerja-ui'
export const LoadingPage = () => {
return(
<Skeleton />
)
}FormLowcode component renders a form based on a specification provided via a URL. It requires integration with react-hook-form to manage form state and submission.import { FormLowcode } from 'alurkerja-ui'
import { useForm } from 'react-hook-form'
export const FormLowcodePage = () => {
const { formState, handleSubmit, control, setValue } = useForm()
return(
<FormLowcode
title="Create"
baseUrl="https://alurkerja-ui-bot.vercel.app"
specPath="/api/data"
formState={formState}
handleSubmit={handleSubmit}
control={control}
setValue={setValue}
/>
)
}When migrating from v0 to v1, be aware of the following breaking changes and component updates:
AlurkerjaForm component has been renamed to FormLowcode.Wysiwyg component has been removed in v1.Modal, Button, and data as arguments.// Example for custom filter button
const customButtonFilter = (_Modal: () => JSX.Element, Button: (props: ButtonHTMLAttributes<HTMLButtonElement>) => JSX.Element) => {
return <Button onClick={() => alert('filter clicked')} />
}
// Usage
<TableLowcode
baseUrl='...'
specPath='...'
customButtonFilter={customButtonFilter}
customButtonCreate={customButtonCreate}
customButtonEdit={customButtonEdit}
customButtonDetail={customButtonDetail}
/>FormLowcodeLite component is used to generate forms based on a provided specification array. It handles the rendering of various input types but does not include built-in CRUD (Create, Read, Update, Delete) functions. Developers must handle the submission logic via the onSubmit prop.import { FormLowcodeLite } from 'alurkerja-ui'
export const FormLowcodeLitePage = () => {
const spec = [
{
form_field_type: 'INPUT_TEXT',
label: 'Nama',
name: 'nama.tes',
type: 'text',
},
{
form_field_type: 'INPUT_TEXT',
label: 'No. Hp',
name: 'handphone',
type: 'number',
},
{
form_field_type: 'INPUT_TEXTAREA',
label: 'Alamat',
name: 'addres',
type: 'text',
},
{
form_field_type: 'INPUT_SWITCH',
label: 'required',
name: 'required',
type: 'text',
},
{
form_field_type: 'INPUT_SELECT',
label: 'Tes',
name: 'tes',
type: 'text',
select_options: {
method: 'GET',
option_key: 'id',
option_label: 'nama',
options: [
{
key: 1,
label: 'Menu1',
},
{
key: 2,
label: 'Menu2',
},
],
},
},
]
return(
<FormLowcodeLite
baseUrl="https://alurkerja-ui-bot.vercel.app"
onCancel={(_reset) => {}}
onSubmit={(data) => console.log(data)}
spec={spec}
/>
)
}
tailwind.config.js to include the library's distribution files in the content array. This ensures Tailwind scans the UI components for classes. Additionally, the library relies on a specific set of brand colors (alurkerja palette) and the @tailwindcss/forms plugin configured with the class strategy./** @type {import('tailwindcss').Config} */
const defaultTheme = require('tailwindcss/defaultTheme')
export default {
content: [
'./index.html',
'./src/**/*.{js,ts,jsx,tsx}',
'./node_modules/alurkerja-ui/dist/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {
fontFamily: { sans: ['Poppins', ...defaultTheme.fontFamily.sans] },
colors: {
black: '#3F4254',
red: { alurkerja: '#F64E60' },
orange: { alurkerja: '#FFA800' },
purple: { alurkerja: '#9056FC' },
blue: { alurkerja: '#586BE2' },
'main-blue': { alurkerja: '#0095E8' },
'tifany-blue': { alurkerja: '#17BCB4' },
green: { alurkerja: '#50CD89' },
'forst-white': { alurkerja: '#F3F6F9' },
'light-blue': { alurkerja: '#E1F0FF' },
black: {
alurkerja: {
1: '#1E1E2D',
2: '#3F4254',
},
},
grey: {
alurkerja: {
1: '#7E8299',
2: '#B5B5C3',
3: '#E4E6EF',
},
},
},
},
},
plugins: [
require('@tailwindcss/forms')({
strategy: 'class',
}),
],
}columnNumber to set the total number of columns and columnSpan to define how many columns a specific field should occupy (mapped by field name).<FormLowcode
// ... other props
columnNumber={2}
columnSpan={{ name: 2 }}
/>