@undefine-ui/design-system 3.6.2 → 3.7.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 +60 -0
- package/dist/index.cjs +226 -113
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +226 -113
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ const ThemeSwitcher = () => {
|
|
|
62
62
|
```tsx
|
|
63
63
|
import {
|
|
64
64
|
CopyButton,
|
|
65
|
+
CustomFormLabel,
|
|
65
66
|
Field,
|
|
66
67
|
Form,
|
|
67
68
|
Icon,
|
|
@@ -813,6 +814,65 @@ import { OTPInput, Field } from '@undefine-ui/design-system';
|
|
|
813
814
|
|
|
814
815
|
The `Field.OTP` component automatically integrates with React Hook Form, providing validation and error handling out of the box.
|
|
815
816
|
|
|
817
|
+
### FormLabel
|
|
818
|
+
|
|
819
|
+
A custom form label component with support for optional text, tooltips, and custom icons. Perfect for creating consistent form field labels across your application.
|
|
820
|
+
|
|
821
|
+
**Usage:**
|
|
822
|
+
|
|
823
|
+
```tsx
|
|
824
|
+
import { CustomFormLabel } from '@undefine-ui/design-system';
|
|
825
|
+
|
|
826
|
+
// Basic label
|
|
827
|
+
<CustomFormLabel label="Email Address" />
|
|
828
|
+
|
|
829
|
+
// Optional field label
|
|
830
|
+
<CustomFormLabel label="Phone Number" optional />
|
|
831
|
+
|
|
832
|
+
// With tooltip
|
|
833
|
+
<CustomFormLabel
|
|
834
|
+
label="API Key"
|
|
835
|
+
tooltip="Your API key can be found in the developer settings."
|
|
836
|
+
/>
|
|
837
|
+
|
|
838
|
+
// Optional with tooltip
|
|
839
|
+
<CustomFormLabel
|
|
840
|
+
label="Company Name"
|
|
841
|
+
optional
|
|
842
|
+
tooltip="Enter your company name if applicable."
|
|
843
|
+
/>
|
|
844
|
+
|
|
845
|
+
// With custom icon
|
|
846
|
+
<CustomFormLabel
|
|
847
|
+
label="Password"
|
|
848
|
+
tooltip="Password must be at least 8 characters long."
|
|
849
|
+
icon={<Icon icon="HelpCircle" sx={{ width: 16, height: 16, color: 'primary.main' }} />}
|
|
850
|
+
/>
|
|
851
|
+
|
|
852
|
+
// Complete form example
|
|
853
|
+
<Box>
|
|
854
|
+
<CustomFormLabel label="Full Name" />
|
|
855
|
+
<TextField fullWidth placeholder="Enter your full name" size="small" />
|
|
856
|
+
</Box>
|
|
857
|
+
```
|
|
858
|
+
|
|
859
|
+
**Props:**
|
|
860
|
+
|
|
861
|
+
- `label` - Label text to display (required)
|
|
862
|
+
- `optional` - Show "(Optional)" text after label (default: `false`)
|
|
863
|
+
- `tooltip` - Tooltip text shown on hover of info icon
|
|
864
|
+
- `icon` - Custom icon for tooltip (default: `InfoCircle` icon)
|
|
865
|
+
- `sx` - MUI sx prop for styling
|
|
866
|
+
- All MUI `FormLabelProps` are supported (except `children`)
|
|
867
|
+
|
|
868
|
+
**Features:**
|
|
869
|
+
|
|
870
|
+
- **Optional indicator:** Shows "(Optional)" text for non-required fields
|
|
871
|
+
- **Tooltip support:** Info icon with tooltip for additional context
|
|
872
|
+
- **Custom icons:** Replace default info icon with custom icons
|
|
873
|
+
- **Flexible styling:** Supports all MUI FormLabel props and sx styling
|
|
874
|
+
- **Theme integration:** Uses theme variables for consistent styling
|
|
875
|
+
|
|
816
876
|
### Dialog
|
|
817
877
|
|
|
818
878
|
Custom dialog components with close button and feedback variations. Includes a base `CustomDialog` with a close button positioned on the right, and a `FeedbackDialog` for success, error, and confirmation states.
|