@okshaun/components 0.1.8 → 0.3.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 +82 -0
- package/dist/index.d.ts +7 -9
- package/dist/index.js +462 -644
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +139 -172
- package/dist/preset.js +1723 -1062
- package/dist/preset.js.map +1 -1
- package/package.json +18 -4
package/README.md
CHANGED
|
@@ -338,6 +338,88 @@ const styles = css({
|
|
|
338
338
|
})
|
|
339
339
|
```
|
|
340
340
|
|
|
341
|
+
## Fonts
|
|
342
|
+
|
|
343
|
+
The preset includes **IBM Plex Sans**, **IBM Plex Mono**, and **Piazzolla Variable** as the default font families. These fonts are **optional peer dependencies** - you can choose to use them or override with your own fonts.
|
|
344
|
+
|
|
345
|
+
### Option 1: Use Default Fonts
|
|
346
|
+
|
|
347
|
+
Install the font packages:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
npm install @fontsource/ibm-plex-sans @fontsource/ibm-plex-mono @fontsource-variable/piazzolla
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Import them in your app entry file (e.g., `src/main.tsx`):
|
|
354
|
+
|
|
355
|
+
```typescript
|
|
356
|
+
// Import default fonts
|
|
357
|
+
import '@fontsource/ibm-plex-sans/400.css'
|
|
358
|
+
import '@fontsource/ibm-plex-sans/400-italic.css'
|
|
359
|
+
import '@fontsource/ibm-plex-sans/500.css'
|
|
360
|
+
import '@fontsource/ibm-plex-sans/500-italic.css'
|
|
361
|
+
import '@fontsource/ibm-plex-sans/700.css'
|
|
362
|
+
import '@fontsource/ibm-plex-sans/700-italic.css'
|
|
363
|
+
import '@fontsource/ibm-plex-mono/400.css'
|
|
364
|
+
import '@fontsource/ibm-plex-mono/600.css'
|
|
365
|
+
import '@fontsource-variable/piazzolla/index.css'
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Option 2: Use Custom Fonts
|
|
369
|
+
|
|
370
|
+
Override the font tokens in your `panda.config.ts`:
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
import { defineConfig } from '@pandacss/dev'
|
|
374
|
+
import { okshaunPreset } from '@okshaun/components/preset'
|
|
375
|
+
|
|
376
|
+
export default defineConfig({
|
|
377
|
+
presets: [okshaunPreset],
|
|
378
|
+
theme: {
|
|
379
|
+
extend: {
|
|
380
|
+
tokens: {
|
|
381
|
+
fonts: {
|
|
382
|
+
sans: { value: "'Inter', sans-serif" },
|
|
383
|
+
serif: { value: "'Merriweather', serif" },
|
|
384
|
+
mono: { value: "'Fira Code', monospace" }
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
})
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Then load your custom fonts using your preferred method:
|
|
393
|
+
- `@fontsource` packages: `npm install @fontsource/inter`
|
|
394
|
+
- Google Fonts CDN
|
|
395
|
+
- Self-hosted font files
|
|
396
|
+
|
|
397
|
+
### Option 3: Use System Fonts
|
|
398
|
+
|
|
399
|
+
For minimal bundle size, use system fonts:
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
theme: {
|
|
403
|
+
extend: {
|
|
404
|
+
tokens: {
|
|
405
|
+
fonts: {
|
|
406
|
+
sans: {
|
|
407
|
+
value: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', system-ui, sans-serif"
|
|
408
|
+
},
|
|
409
|
+
serif: {
|
|
410
|
+
value: "ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif"
|
|
411
|
+
},
|
|
412
|
+
mono: {
|
|
413
|
+
value: "ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
No additional font packages needed!
|
|
422
|
+
|
|
341
423
|
## Development
|
|
342
424
|
|
|
343
425
|
### Prerequisites
|
package/dist/index.d.ts
CHANGED
|
@@ -98,13 +98,15 @@ declare type ButtonComponent = <E extends React_2.ElementType = 'button'>(props:
|
|
|
98
98
|
* It includes props for the element type E (default "button") and ButtonVariantProps.
|
|
99
99
|
* This means that any prop accepted by the underlying element (e.g. onClick) is automatically allowed.
|
|
100
100
|
*/
|
|
101
|
-
declare type ButtonProps<E extends React_2.ElementType = 'button'> = React_2.ComponentPropsWithoutRef<E> & ButtonVariantProps & {
|
|
101
|
+
declare type ButtonProps<E extends React_2.ElementType = 'button'> = React_2.ComponentPropsWithoutRef<E> & Omit<ButtonVariantProps, 'iconBefore' | 'iconAfter'> & {
|
|
102
102
|
as?: E;
|
|
103
103
|
href?: string;
|
|
104
104
|
loading?: boolean;
|
|
105
105
|
className?: string;
|
|
106
106
|
children?: React_2.ReactNode;
|
|
107
107
|
disabled?: boolean;
|
|
108
|
+
iconBefore?: IconNamesList;
|
|
109
|
+
iconAfter?: IconNamesList;
|
|
108
110
|
};
|
|
109
111
|
|
|
110
112
|
export declare const Card: React.FC<CardProps>;
|
|
@@ -133,11 +135,12 @@ export declare const CheckboxInput: FC<CheckboxInputProps>;
|
|
|
133
135
|
|
|
134
136
|
declare type CheckboxInputProps = BoxProps & CheckboxInputVariantProps & {
|
|
135
137
|
name: string;
|
|
138
|
+
checked: boolean;
|
|
139
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
136
140
|
id?: string;
|
|
137
141
|
error?: boolean;
|
|
138
142
|
children?: string | ReactNode;
|
|
139
|
-
|
|
140
|
-
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
143
|
+
disabled?: boolean;
|
|
141
144
|
};
|
|
142
145
|
|
|
143
146
|
declare type CheckboxProps = {
|
|
@@ -201,8 +204,6 @@ declare type IconButtonProps<E extends React_2.ElementType = 'button'> = React_2
|
|
|
201
204
|
as?: E;
|
|
202
205
|
href?: string;
|
|
203
206
|
loading?: boolean;
|
|
204
|
-
loadingText?: React_2.ReactNode;
|
|
205
|
-
children?: React_2.ReactNode;
|
|
206
207
|
disabled?: boolean;
|
|
207
208
|
className?: string;
|
|
208
209
|
iconName?: IconNamesList;
|
|
@@ -758,9 +759,7 @@ export declare const Textarea: React.FC<TextareaProps>;
|
|
|
758
759
|
|
|
759
760
|
declare type TextareaProps = Omit<BoxProps, keyof TextareaVariantProps> & TextareaVariantProps & {
|
|
760
761
|
name: string;
|
|
761
|
-
autoSize?: boolean;
|
|
762
762
|
error?: boolean;
|
|
763
|
-
disabled?: boolean;
|
|
764
763
|
id?: string;
|
|
765
764
|
};
|
|
766
765
|
|
|
@@ -770,8 +769,7 @@ declare type TextInputProps = Omit<BoxProps, keyof TextinputVariantProps> & Text
|
|
|
770
769
|
name: string;
|
|
771
770
|
error?: boolean;
|
|
772
771
|
id?: string;
|
|
773
|
-
|
|
774
|
-
} & AriaAttributes;
|
|
772
|
+
};
|
|
775
773
|
|
|
776
774
|
declare type TextProps = Omit<BoxProps, keyof TextVariantProps> & TextVariantProps & {
|
|
777
775
|
italic?: boolean;
|