@risalabs_frontend_org/oasis-ui-kit 0.18.0 → 0.22.0
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 +231 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/SVG/copy-icon.d.ts +7 -0
- package/dist/src/SVG/edit-icon.d.ts +7 -0
- package/dist/src/SVG/trash-icon.d.ts +7 -0
- package/dist/src/components/action-input/action-input.d.ts +16 -0
- package/dist/src/components/custom-dropdown/custom-dropdown.d.ts +22 -0
- package/dist/src/components/horizontal-navigation-tab/horizontal-navigation-tab.d.ts +18 -0
- package/dist/src/components/multi-line-text-with-copy/multi-line-text-with-copy.d.ts +13 -0
- package/dist/src/components/radio-button/radio-button.d.ts +19 -0
- package/dist/src/components/rule-card/rule-card.d.ts +14 -0
- package/dist/src/components/select-input/select-input.d.ts +18 -0
- package/dist/src/components/tags/tags.d.ts +21 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# RISA Oasis UI Kit
|
|
2
2
|
|
|
3
|
-
A comprehensive React UI component library built with TypeScript and SCSS, featuring
|
|
3
|
+
A comprehensive React UI component library built with TypeScript and SCSS, featuring 35+ production-ready components for building modern web applications.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -163,6 +163,89 @@ import { Toggle, ToggleSwitch } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
|
163
163
|
/>
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
+
#### `RadioButton`
|
|
167
|
+
A radio button group supporting vertical/horizontal layout with customizable selected color.
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
import { RadioButton } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
171
|
+
|
|
172
|
+
<RadioButton
|
|
173
|
+
name="plan"
|
|
174
|
+
options={[
|
|
175
|
+
{ label: 'Basic', value: 'basic' },
|
|
176
|
+
{ label: 'Premium', value: 'premium' },
|
|
177
|
+
{ label: 'Enterprise', value: 'enterprise', disabled: true }
|
|
178
|
+
]}
|
|
179
|
+
value="basic"
|
|
180
|
+
onChange={(value) => console.log(value)}
|
|
181
|
+
direction="vertical" // "vertical" | "horizontal"
|
|
182
|
+
gap="0.75rem" // Custom gap between options
|
|
183
|
+
selectedColor="#1e69da" // Custom selection color
|
|
184
|
+
/>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
#### `SelectInput`
|
|
188
|
+
A lightweight select component using the native `<select>` element with custom styling.
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
import { SelectInput } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
192
|
+
|
|
193
|
+
<SelectInput
|
|
194
|
+
label="Organization"
|
|
195
|
+
options={[
|
|
196
|
+
{ label: 'Acme Corp', value: 'acme' },
|
|
197
|
+
{ label: 'Globex Inc', value: 'globex' }
|
|
198
|
+
]}
|
|
199
|
+
defaultValue="acme"
|
|
200
|
+
placeholder="Select..."
|
|
201
|
+
onChange={(value, option) => console.log(value, option)}
|
|
202
|
+
focusBorderWidth="2px"
|
|
203
|
+
/>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### `CustomDropdown`
|
|
207
|
+
A fully custom dropdown with viewport-aware positioning, portal support, validation, and keyboard navigation.
|
|
208
|
+
|
|
209
|
+
```tsx
|
|
210
|
+
import { CustomDropdown } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
211
|
+
|
|
212
|
+
<CustomDropdown
|
|
213
|
+
label="Organization"
|
|
214
|
+
options={[
|
|
215
|
+
{ label: 'Acme Corp', value: 'acme' },
|
|
216
|
+
{ label: 'Globex Inc', value: 'globex' }
|
|
217
|
+
]}
|
|
218
|
+
defaultValue="acme"
|
|
219
|
+
placeholder="Select..."
|
|
220
|
+
onChange={(value, option) => console.log(value, option)}
|
|
221
|
+
required={true}
|
|
222
|
+
error="This field is required" // Shows red border and error message
|
|
223
|
+
hint="Choose your organization"
|
|
224
|
+
shouldUsePortal={false} // Render via React portal to escape overflow:hidden
|
|
225
|
+
focusBorderWidth="1px"
|
|
226
|
+
/>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### `ActionInput`
|
|
230
|
+
A text input with an adjacent action button and dirty-state detection. The icon color changes when the value differs from the initial value.
|
|
231
|
+
|
|
232
|
+
```tsx
|
|
233
|
+
import { ActionInput } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
234
|
+
|
|
235
|
+
<ActionInput
|
|
236
|
+
value="BMKYUTS8"
|
|
237
|
+
onChange={(value) => console.log(value)}
|
|
238
|
+
onAction={(value) => console.log('Submitted:', value)}
|
|
239
|
+
placeholder="Enter code..."
|
|
240
|
+
readOnly={false}
|
|
241
|
+
disabled={false}
|
|
242
|
+
iconColor="#6B6B6B" // Default icon color
|
|
243
|
+
iconSize={16} // Icon size in px
|
|
244
|
+
height="2rem" // Container height
|
|
245
|
+
dirtyColor="#0056D6" // Icon color when value is modified
|
|
246
|
+
/>
|
|
247
|
+
```
|
|
248
|
+
|
|
166
249
|
### Date & Time Components
|
|
167
250
|
|
|
168
251
|
#### `DateInput`
|
|
@@ -270,6 +353,27 @@ import { SideNavigation } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
|
270
353
|
/>
|
|
271
354
|
```
|
|
272
355
|
|
|
356
|
+
#### `HorizontalNavigationTab`
|
|
357
|
+
A horizontal tab navigation bar with active indicator, custom colors, and keyboard navigation.
|
|
358
|
+
|
|
359
|
+
```tsx
|
|
360
|
+
import { HorizontalNavigationTab } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
361
|
+
|
|
362
|
+
<HorizontalNavigationTab
|
|
363
|
+
tabs={[
|
|
364
|
+
{ label: 'Overview', value: 'overview' },
|
|
365
|
+
{ label: 'Details', value: 'details' },
|
|
366
|
+
{ label: 'History', value: 'history', disabled: true }
|
|
367
|
+
]}
|
|
368
|
+
value="overview"
|
|
369
|
+
onChange={(value) => console.log(value)}
|
|
370
|
+
activeColor="#1E69DA" // Active tab text & border color
|
|
371
|
+
backgroundColor="#F5F5F5" // Tab background
|
|
372
|
+
activeBackgroundColor="#FFF" // Active tab background
|
|
373
|
+
rounded={true} // Rounded top corners
|
|
374
|
+
/>
|
|
375
|
+
```
|
|
376
|
+
|
|
273
377
|
#### `TabContainer` & `SingleTab`
|
|
274
378
|
Horizontal tab navigation components.
|
|
275
379
|
|
|
@@ -422,6 +526,132 @@ import { StatusText } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
|
422
526
|
<StatusText {...props} />
|
|
423
527
|
```
|
|
424
528
|
|
|
529
|
+
#### `Tags`
|
|
530
|
+
A styled tag component with optional dropdown selection. Options are displayed as styled tags. Supports portal rendering for overflow-hidden containers.
|
|
531
|
+
|
|
532
|
+
```tsx
|
|
533
|
+
import { Tags } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
534
|
+
|
|
535
|
+
<Tags
|
|
536
|
+
label="Financial"
|
|
537
|
+
backgroundColor="#FFFCD6"
|
|
538
|
+
textColor="#665D00"
|
|
539
|
+
showBorder={false}
|
|
540
|
+
shouldUsePortal={false}
|
|
541
|
+
options={[
|
|
542
|
+
{ label: 'Financial', value: 'financial', backgroundColor: '#FFFCD6', textColor: '#665D00' },
|
|
543
|
+
{ label: 'Medical', value: 'medical', backgroundColor: '#eefcf4', textColor: '#007028' },
|
|
544
|
+
{ label: 'Clinical', value: 'clinical', backgroundColor: '#eaf2ff', textColor: '#002152' }
|
|
545
|
+
]}
|
|
546
|
+
onSelect={(option) => console.log(option)}
|
|
547
|
+
/>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
#### `Badge`
|
|
551
|
+
A styled badge with optional left/right icons, tooltip, and customizable colors.
|
|
552
|
+
|
|
553
|
+
```tsx
|
|
554
|
+
import { Badge } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
555
|
+
|
|
556
|
+
<Badge
|
|
557
|
+
text="Active"
|
|
558
|
+
backgroundColor="#eefcf4"
|
|
559
|
+
textColor="#007028"
|
|
560
|
+
size="medium" // "small" | "medium" | "large"
|
|
561
|
+
maxWidth="200px"
|
|
562
|
+
borderColor="#007028"
|
|
563
|
+
showTooltip={true}
|
|
564
|
+
leftIcon={<SomeIcon />}
|
|
565
|
+
onLeftIconClick={(e) => {}}
|
|
566
|
+
/>
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
#### `BadgeGroup`
|
|
570
|
+
Displays a collection of badges with overflow handling, showing a "+N more" indicator for hidden items.
|
|
571
|
+
|
|
572
|
+
```tsx
|
|
573
|
+
import { BadgeGroup } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
574
|
+
|
|
575
|
+
<BadgeGroup
|
|
576
|
+
badges={[
|
|
577
|
+
{ text: 'React', backgroundColor: '#e0f2fe', textColor: '#0369a1' },
|
|
578
|
+
{ text: 'TypeScript', backgroundColor: '#ede9fe', textColor: '#6d28d9' },
|
|
579
|
+
{ text: 'SCSS', backgroundColor: '#fce7f3', textColor: '#be185d' }
|
|
580
|
+
]}
|
|
581
|
+
maxVisible={2}
|
|
582
|
+
size="medium"
|
|
583
|
+
showBadgeTooltips={true}
|
|
584
|
+
showOverflowTooltip={true}
|
|
585
|
+
onOverflowClick={(hiddenBadges) => console.log(hiddenBadges)}
|
|
586
|
+
/>
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
#### `RuleCard`
|
|
590
|
+
A card for displaying text rules with optional numbered index and edit/delete action buttons.
|
|
591
|
+
|
|
592
|
+
```tsx
|
|
593
|
+
import { RuleCard } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
594
|
+
|
|
595
|
+
<RuleCard
|
|
596
|
+
content="Patient must have a valid prescription before dispensing."
|
|
597
|
+
index={1} // Optional numbered badge
|
|
598
|
+
onEdit={() => console.log('edit')}
|
|
599
|
+
onDelete={() => console.log('delete')}
|
|
600
|
+
editIconColor="#0056D6"
|
|
601
|
+
deleteIconColor="#F50400"
|
|
602
|
+
iconSize={12}
|
|
603
|
+
contentClassName="custom-text"
|
|
604
|
+
/>
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
#### `MultiLineTextWithCopy`
|
|
608
|
+
Displays primary and secondary text with a copy-to-clipboard button for the secondary value.
|
|
609
|
+
|
|
610
|
+
```tsx
|
|
611
|
+
import { MultiLineTextWithCopy } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
612
|
+
|
|
613
|
+
<MultiLineTextWithCopy
|
|
614
|
+
primaryText="John Doe"
|
|
615
|
+
secondaryText="NPI-1234567890"
|
|
616
|
+
copyValue="1234567890" // Optional: overrides secondaryText for clipboard
|
|
617
|
+
onCopy={(value) => console.log('Copied:', value)}
|
|
618
|
+
copyIconColor="#0056D6"
|
|
619
|
+
copyIconSize={16}
|
|
620
|
+
shouldTruncate={false} // Truncate primary text with ellipsis
|
|
621
|
+
/>
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
#### `ThreeDotButton`
|
|
625
|
+
A three-dot (kebab) menu button with a dropdown options list and viewport-aware positioning.
|
|
626
|
+
|
|
627
|
+
```tsx
|
|
628
|
+
import { ThreeDotButton } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
629
|
+
|
|
630
|
+
<ThreeDotButton
|
|
631
|
+
options={[
|
|
632
|
+
{ id: 'edit', text: 'Edit' },
|
|
633
|
+
{ id: 'delete', text: 'Delete' },
|
|
634
|
+
{ id: 'archive', text: 'Archive' }
|
|
635
|
+
]}
|
|
636
|
+
onOptionClick={(optionId) => console.log(optionId)}
|
|
637
|
+
/>
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
#### `PopOverWithClickableOptions`
|
|
641
|
+
A popover menu displaying a list of clickable options with optional icons.
|
|
642
|
+
|
|
643
|
+
```tsx
|
|
644
|
+
import { PopOverWithClickableOptions } from '@risalabs_frontend_org/oasis-ui-kit';
|
|
645
|
+
|
|
646
|
+
<PopOverWithClickableOptions
|
|
647
|
+
options={[
|
|
648
|
+
{ id: 'view', text: 'View Details', icon: <ViewIcon /> },
|
|
649
|
+
{ id: 'download', text: 'Download' }
|
|
650
|
+
]}
|
|
651
|
+
onClick={(id) => console.log(id)}
|
|
652
|
+
/>
|
|
653
|
+
```
|
|
654
|
+
|
|
425
655
|
#### `ProfileButton`
|
|
426
656
|
A user profile button with avatar and dropdown indicator.
|
|
427
657
|
|
package/dist/index.d.ts
CHANGED
|
@@ -32,4 +32,12 @@ export * from "./src/components/badge/badge";
|
|
|
32
32
|
export * from "./src/components/badge-group/BadgeGroup";
|
|
33
33
|
export * from "./src/components/three-dot-button/three-dot-button";
|
|
34
34
|
export * from "./src/components/pop-over-with-clickable-options/pop-over-with-clickable-options";
|
|
35
|
+
export * from "./src/components/tags/tags";
|
|
36
|
+
export * from "./src/components/radio-button/radio-button";
|
|
37
|
+
export * from "./src/components/multi-line-text-with-copy/multi-line-text-with-copy";
|
|
38
|
+
export * from "./src/components/horizontal-navigation-tab/horizontal-navigation-tab";
|
|
39
|
+
export * from "./src/components/rule-card/rule-card";
|
|
40
|
+
export * from "./src/components/select-input/select-input";
|
|
41
|
+
export * from "./src/components/custom-dropdown/custom-dropdown";
|
|
42
|
+
export * from "./src/components/action-input/action-input";
|
|
35
43
|
export * from "./src/shared/types";
|