@forsyteco/product-ui 0.0.3 → 0.0.4
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 +11 -2
- package/dist/icon-button/icon-button.d.ts +34 -0
- package/dist/icon-button/icon-button.d.ts.map +1 -0
- package/dist/icon-button/index.d.ts +4 -0
- package/dist/icon-button/index.d.ts.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4825 -4167
- package/dist/relative-time/index.d.ts +3 -0
- package/dist/relative-time/index.d.ts.map +1 -0
- package/dist/relative-time/relative-time.d.ts +7 -0
- package/dist/relative-time/relative-time.d.ts.map +1 -0
- package/dist/select/select.d.ts.map +1 -1
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/utils/create-component.d.ts +5 -0
- package/dist/utils/create-component.d.ts.map +1 -0
- package/dist/utils/types/component-props.d.ts +9 -0
- package/dist/utils/types/component-props.d.ts.map +1 -0
- package/fonts/plus-jakart-sans-medium.woff2 +0 -0
- package/fonts/plus-jakarta-sans-[wght].woff2 +0 -0
- package/fonts/plus-jakarta-sans-bold-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-bold.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-bold-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-bold.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-light-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-light.woff2 +0 -0
- package/fonts/plus-jakarta-sans-italic-[wght].woff2 +0 -0
- package/fonts/plus-jakarta-sans-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-light-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-light.woff2 +0 -0
- package/fonts/plus-jakarta-sans-medium-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-regular.woff2 +0 -0
- package/fonts/plus-jakarta-sans-semi-bold-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-semi-bold.woff2 +0 -0
- package/package.json +10 -4
- package/styles.css +179 -0
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ npm install react@^19.2.1 react-dom@^19.2.1 tailwindcss@^4.1.17
|
|
|
22
22
|
|
|
23
23
|
## Setup
|
|
24
24
|
|
|
25
|
-
### 1. Import Tailwind
|
|
25
|
+
### 1. Import Tailwind base styles
|
|
26
26
|
|
|
27
27
|
Make sure Tailwind CSS is imported in your application:
|
|
28
28
|
|
|
@@ -31,7 +31,16 @@ Make sure Tailwind CSS is imported in your application:
|
|
|
31
31
|
@import 'tailwindcss';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
### 2. Import
|
|
34
|
+
### 2. Import the design system styles
|
|
35
|
+
|
|
36
|
+
Pull in the design tokens, fonts, and utilities provided by the library:
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
/* src/index.css or your main CSS file, after tailwindcss */
|
|
40
|
+
@import '@forsyteco/product-ui/styles.css';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Import components
|
|
35
44
|
|
|
36
45
|
```typescript
|
|
37
46
|
import { Spinner } from '@forsyteco/product-ui'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const iconButtonVariants: (props?: ({
|
|
4
|
+
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | null | undefined;
|
|
5
|
+
shape?: "square" | "circle" | null | undefined;
|
|
6
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
type IconComponent = ComponentType<{
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
type BaseIconButtonProps = {
|
|
12
|
+
icon: IconComponent;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
description?: string;
|
|
15
|
+
inactive?: boolean;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
keybindingHint?: string;
|
|
18
|
+
tooltipDirection?: 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
19
|
+
className?: string;
|
|
20
|
+
'aria-label': string;
|
|
21
|
+
};
|
|
22
|
+
type IconButtonAsButton = BaseIconButtonProps & VariantProps<typeof iconButtonVariants> & Omit<ComponentPropsWithoutRef<'button'>, keyof BaseIconButtonProps | 'as' | 'href' | 'children'> & {
|
|
23
|
+
as?: 'button';
|
|
24
|
+
href?: never;
|
|
25
|
+
};
|
|
26
|
+
type IconButtonAsAnchor = BaseIconButtonProps & VariantProps<typeof iconButtonVariants> & Omit<ComponentPropsWithoutRef<'a'>, keyof BaseIconButtonProps | 'as' | 'children'> & {
|
|
27
|
+
as: 'a';
|
|
28
|
+
href: string;
|
|
29
|
+
};
|
|
30
|
+
export type IconButtonProps = IconButtonAsButton | IconButtonAsAnchor;
|
|
31
|
+
declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
32
|
+
export { IconButton, iconButtonVariants };
|
|
33
|
+
export default IconButton;
|
|
34
|
+
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAElB,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AACd,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,QAAA,MAAM,kBAAkB;;;;8EA2BvB,CAAA;AAED,KAAK,aAAa,GAAG,aAAa,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE1D,KAAK,mBAAmB,G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