luna-components-library 1.1.39 → 1.1.41
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 +62 -53
- package/dist/luna-components-library.js +291 -204
- package/dist/luna-components-library.js.map +1 -1
- package/dist/src/components/Accordion.d.ts +8 -3
- package/dist/src/components/Anchor.d.ts +3 -3
- package/dist/src/components/Button.d.ts +10 -7
- package/dist/src/components/DataTable.d.ts +25 -3
- package/dist/src/components/DropDown.d.ts +16 -5
- package/dist/src/components/Input.d.ts +9 -6
- package/dist/src/components/MultiSelect.d.ts +27 -4
- package/dist/src/components/Popconfirm.d.ts +19 -3
- package/dist/src/components/QRCode.d.ts +10 -3
- package/dist/src/components/Toast.d.ts +18 -3
- package/dist/src/styles.d.ts +24 -19
- package/dist/src/types.d.ts +1 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,28 +125,35 @@ const isValid = validators.isEmail('user@luna.com'); // true
|
|
|
125
125
|
All components use TypeScript with specific types for better type safety and IntelliSense. The library follows a minimal documentation approach with descriptive type names instead of extensive JSDoc comments.
|
|
126
126
|
|
|
127
127
|
### Button
|
|
128
|
-
A versatile button component with multiple variants and
|
|
128
|
+
A versatile button component with multiple variants, sizes, icons, and rounded style.
|
|
129
129
|
|
|
130
130
|
```jsx
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</Button>
|
|
131
|
+
// Basic
|
|
132
|
+
<Button variant="primary" size="md" onClick={handleClick}>Click Me</Button>
|
|
133
|
+
|
|
134
|
+
// Rounded (pill)
|
|
135
|
+
<Button variant="primary" rounded>Rounded</Button>
|
|
136
|
+
|
|
137
|
+
// With icon
|
|
138
|
+
<Button variant="primary" icon="🚀">Deploy</Button>
|
|
139
|
+
<Button variant="outline" icon="→" iconPosition="right">Next</Button>
|
|
140
|
+
|
|
141
|
+
// Icon only
|
|
142
|
+
<Button variant="danger" rounded icon="✕" />
|
|
139
143
|
```
|
|
140
144
|
|
|
141
145
|
**Props:**
|
|
142
|
-
- `children
|
|
146
|
+
- `children?: React.ReactNode` - Button content (optional when using icon only)
|
|
143
147
|
- `variant?: ButtonVariant` - Button style (default: 'primary')
|
|
144
|
-
- `size?: ButtonSize` - Button size (default: '
|
|
148
|
+
- `size?: ButtonSize` - Button size (default: 'sm')
|
|
149
|
+
- `rounded?: boolean` - Pill/circle shape (default: false)
|
|
150
|
+
- `icon?: React.ReactNode` - Icon element, emoji, or any ReactNode
|
|
151
|
+
- `iconPosition?: 'left' | 'right'` - Icon placement (default: 'left')
|
|
145
152
|
- `onClick?: React.MouseEventHandler<HTMLButtonElement>` - Click handler
|
|
146
153
|
- `disabled?: boolean` - Disable button (default: false)
|
|
147
154
|
- `className?: string` - Additional CSS classes
|
|
148
155
|
- `style?: React.CSSProperties` - Custom inline styles
|
|
149
|
-
- `...props`: any - Additional HTML button attributes
|
|
156
|
+
- `...props`: any - Additional HTML button attributes
|
|
150
157
|
|
|
151
158
|
**Types:**
|
|
152
159
|
```typescript
|
|
@@ -155,15 +162,15 @@ type ButtonSize = 'sm' | 'md' | 'lg';
|
|
|
155
162
|
```
|
|
156
163
|
|
|
157
164
|
**Variants:**
|
|
158
|
-
- `primary` - Blue background
|
|
159
|
-
- `secondary` - Gray background
|
|
165
|
+
- `primary` - Blue background
|
|
166
|
+
- `secondary` - Gray background
|
|
160
167
|
- `outline` - Transparent with border
|
|
161
|
-
- `success` - Green background
|
|
162
|
-
- `danger` - Red background
|
|
163
|
-
- `warning` - Yellow background
|
|
164
|
-
- `info` - Cyan background
|
|
165
|
-
- `dark` - Dark gray background
|
|
166
|
-
- `light` - Light gray background
|
|
168
|
+
- `success` - Green background
|
|
169
|
+
- `danger` - Red background
|
|
170
|
+
- `warning` - Yellow background
|
|
171
|
+
- `info` - Cyan background
|
|
172
|
+
- `dark` - Dark gray background
|
|
173
|
+
- `light` - Light gray background
|
|
167
174
|
- `link` - Blue text link with hover effects
|
|
168
175
|
|
|
169
176
|
### Card
|
|
@@ -626,67 +633,69 @@ const MyComponent = () => {
|
|
|
626
633
|
```
|
|
627
634
|
|
|
628
635
|
### Input
|
|
629
|
-
A versatile input component with multiple variants, sizes, masks, currency formatting, and
|
|
636
|
+
A versatile input component with multiple variants, sizes, masks, currency formatting, icons, and required indicator.
|
|
630
637
|
|
|
631
638
|
```jsx
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
</Input>
|
|
639
|
+
// Basic
|
|
640
|
+
<Input variant="primary" placeholder="Enter text">Label</Input>
|
|
641
|
+
|
|
642
|
+
// With icon
|
|
643
|
+
<Input icon="🔍" placeholder="Search...">Search</Input>
|
|
644
|
+
<Input icon="🔒" iconPosition="right" variant="danger" placeholder="Password">Password</Input>
|
|
645
|
+
|
|
646
|
+
// Required indicator
|
|
647
|
+
<Input isRequired variant="primary" placeholder="Email">Email</Input>
|
|
648
|
+
|
|
649
|
+
// Currency
|
|
650
|
+
<Input useCurrency currency="USD" locale="en-US" placeholder="$0.00">Price</Input>
|
|
651
|
+
|
|
652
|
+
// Mask
|
|
653
|
+
<Input mask="(999) 999-9999" placeholder="(555) 000-0000">Phone</Input>
|
|
644
654
|
```
|
|
645
655
|
|
|
646
656
|
**Props:**
|
|
647
|
-
- `children?: React.ReactNode` - Label content
|
|
648
|
-
- `variant?: InputVariant` -
|
|
657
|
+
- `children?: React.ReactNode` - Label content
|
|
658
|
+
- `variant?: InputVariant` - Border color variant (default: 'none')
|
|
649
659
|
- `inputSize?: InputSize` - Input size (default: 'md')
|
|
650
660
|
- `type?: InputType` - HTML input type (default: 'text')
|
|
651
661
|
- `placeholder?: string` - Placeholder text
|
|
652
|
-
- `value?: string` -
|
|
662
|
+
- `value?: string` - Controlled value
|
|
653
663
|
- `onChange?: (value: string) => void` - Change handler
|
|
654
664
|
- `onFocus?: () => void` - Focus handler
|
|
655
665
|
- `onBlur?: () => void` - Blur handler
|
|
656
666
|
- `disabled?: boolean` - Disable input (default: false)
|
|
657
|
-
- `required?: boolean` -
|
|
667
|
+
- `required?: boolean` - HTML required attribute (default: false)
|
|
668
|
+
- `isRequired?: boolean` - Shows a red `*` next to the label (default: false)
|
|
658
669
|
- `readOnly?: boolean` - Read-only input (default: false)
|
|
670
|
+
- `icon?: React.ReactNode` - Icon inside the input (emoji, SVG, component)
|
|
671
|
+
- `iconPosition?: 'left' | 'right'` - Icon placement (default: 'left')
|
|
659
672
|
- `className?: string` - Additional CSS classes
|
|
660
673
|
- `style?: React.CSSProperties` - Custom inline styles
|
|
661
|
-
- `id?: string` - HTML id
|
|
674
|
+
- `id?: string` - HTML id for label association
|
|
662
675
|
- `name?: string` - HTML name attribute
|
|
663
|
-
- `classNames?: InputClassNames` - Custom class names
|
|
664
|
-
- `styles?: InputStyles` - Custom inline styles per element
|
|
665
|
-
- `mask?: string` - Input mask pattern (e.g. "(999) 999-9999")
|
|
666
|
-
- `maskChar?: string` - Mask placeholder character (default: '_')
|
|
676
|
+
- `classNames?: InputClassNames` - Custom class names per sub-element
|
|
677
|
+
- `styles?: InputStyles` - Custom inline styles per sub-element
|
|
678
|
+
- `mask?: string` - Input mask pattern (e.g. `"(999) 999-9999"`)
|
|
679
|
+
- `maskChar?: string` - Mask placeholder character (default: `'_'`)
|
|
667
680
|
- `useCurrency?: boolean` - Enable currency formatting
|
|
668
|
-
- `currency?: string` - Currency code (e.g. "USD"
|
|
669
|
-
- `locale?: string` - Locale for formatting (e.g. "en-US"
|
|
681
|
+
- `currency?: string` - Currency code (e.g. `"USD"`, `"CRC"`)
|
|
682
|
+
- `locale?: string` - Locale for formatting (e.g. `"en-US"`, `"es-CR"`)
|
|
670
683
|
- `minFractionDigits?: number` - Minimum fraction digits (default: 0)
|
|
671
684
|
- `maxFractionDigits?: number` - Maximum fraction digits (default: 2)
|
|
672
|
-
- `aria-label?: string` - ARIA label
|
|
685
|
+
- `aria-label?: string` - ARIA label
|
|
673
686
|
- `aria-labelledby?: string` - ARIA labelledby
|
|
674
687
|
- `...props`: any - Additional HTML input attributes
|
|
675
688
|
|
|
676
689
|
**Types:**
|
|
677
690
|
```typescript
|
|
678
|
-
type InputVariant = 'none' | 'primary' | 'secondary' | 'outline' | 'danger' | 'success';
|
|
691
|
+
type InputVariant = 'none' | 'primary' | 'secondary' | 'outline' | 'danger' | 'success' | 'warning' | 'info' | 'dark' | 'light' | 'link';
|
|
679
692
|
type InputSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
680
693
|
type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'time' | 'datetime-local' | 'month' | 'week' | 'color' | 'file' | 'hidden' | 'image' | 'range' | 'reset' | 'submit';
|
|
681
694
|
```
|
|
682
695
|
|
|
683
|
-
**
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
- `secondary` - Gray focus ring
|
|
687
|
-
- `outline` - Border only
|
|
688
|
-
- `danger` - Red focus ring
|
|
689
|
-
- `success` - Green focus ring
|
|
696
|
+
**Focus behavior:** Border increases from `1px` to `2px` on focus, using the variant color. On blur it returns to `1px` with the same variant color.
|
|
697
|
+
|
|
698
|
+
**Variants:** Each variant applies a distinct border color — `primary` (blue), `secondary` (gray), `danger` (red), `success` (green), `warning` (yellow), `info` (cyan), `dark`, `light`, `outline` (default gray), `none` (default gray).
|
|
690
699
|
|
|
691
700
|
**Size Options:**
|
|
692
701
|
- `sm` - Small padding and text
|