@iit/precision-ui 0.1.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 +27 -0
- package/dist/Adapters.d.ts +21 -0
- package/dist/Adapters.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +7 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.d.ts.map +1 -0
- package/dist/components/ui/Image.d.ts +11 -0
- package/dist/components/ui/Image.d.ts.map +1 -0
- package/dist/components/ui/Link.d.ts +15 -0
- package/dist/components/ui/Link.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/button/ButtonIcon.d.ts +17 -0
- package/dist/components/ui/button/ButtonIcon.d.ts.map +1 -0
- package/dist/components/ui/button/ButtonPrimary.d.ts +24 -0
- package/dist/components/ui/button/ButtonPrimary.d.ts.map +1 -0
- package/dist/components/ui/button/ButtonSecondary.d.ts +15 -0
- package/dist/components/ui/button/ButtonSecondary.d.ts.map +1 -0
- package/dist/components/ui/button/ButtonText.d.ts +21 -0
- package/dist/components/ui/button/ButtonText.d.ts.map +1 -0
- package/dist/components/ui/button/ButtonUnique.d.ts +15 -0
- package/dist/components/ui/button/ButtonUnique.d.ts.map +1 -0
- package/dist/components/ui/button/button.d.ts +13 -0
- package/dist/components/ui/button/button.d.ts.map +1 -0
- package/dist/components/ui/button/index.d.ts +1 -0
- package/dist/components/ui/button/index.d.ts.map +1 -0
- package/dist/components/ui/icon.d.ts +5 -0
- package/dist/components/ui/icon.d.ts.map +1 -0
- package/dist/decorators/LinkWrapper.d.ts +10 -0
- package/dist/decorators/LinkWrapper.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +23 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.es10.js +50 -0
- package/dist/index.es10.js.map +1 -0
- package/dist/index.es11.js +9 -0
- package/dist/index.es11.js.map +1 -0
- package/dist/index.es12.js +25 -0
- package/dist/index.es12.js.map +1 -0
- package/dist/index.es2.js +46 -0
- package/dist/index.es2.js.map +1 -0
- package/dist/index.es3.js +32 -0
- package/dist/index.es3.js.map +1 -0
- package/dist/index.es4.js +76 -0
- package/dist/index.es4.js.map +1 -0
- package/dist/index.es5.js +40 -0
- package/dist/index.es5.js.map +1 -0
- package/dist/index.es6.js +70 -0
- package/dist/index.es6.js.map +1 -0
- package/dist/index.es7.js +54 -0
- package/dist/index.es7.js.map +1 -0
- package/dist/index.es8.js +41 -0
- package/dist/index.es8.js.map +1 -0
- package/dist/index.es9.js +13 -0
- package/dist/index.es9.js.map +1 -0
- package/dist/lib/utils/cn.d.ts +4 -0
- package/dist/lib/utils/cn.d.ts.map +1 -0
- package/dist/setupTests.d.ts +2 -0
- package/dist/setupTests.d.ts.map +1 -0
- package/dist/stories/Button.d.ts +16 -0
- package/dist/stories/Button.d.ts.map +1 -0
- package/dist/stories/Header.d.ts +13 -0
- package/dist/stories/Header.d.ts.map +1 -0
- package/dist/stories/Page.d.ts +4 -0
- package/dist/stories/Page.d.ts.map +1 -0
- package/dist/styles.css +730 -0
- package/dist/vite.svg +1 -0
- package/package.json +101 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Precision UI
|
|
2
|
+
|
|
3
|
+
Just a repo with React UI components.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@iit/precision-ui) [](https://github.com/wowxoxo/precision-ui)
|
|
6
|
+
|
|
7
|
+
## Expanding the ESLint configuration
|
|
8
|
+
|
|
9
|
+
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
|
|
10
|
+
|
|
11
|
+
- Configure the top-level `parserOptions` property like this:
|
|
12
|
+
|
|
13
|
+
```js
|
|
14
|
+
export default {
|
|
15
|
+
// other rules...
|
|
16
|
+
parserOptions: {
|
|
17
|
+
ecmaVersion: 'latest',
|
|
18
|
+
sourceType: 'module',
|
|
19
|
+
project: ['./tsconfig.json', './tsconfig.node.json'],
|
|
20
|
+
tsconfigRootDir: __dirname,
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
|
|
26
|
+
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
|
|
27
|
+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type ComponentAdapter<TProps = unknown> = React.FC<TProps>;
|
|
2
|
+
interface Adapters {
|
|
3
|
+
LinkWrapper?: ComponentAdapter<{
|
|
4
|
+
href: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
target?: string;
|
|
8
|
+
rel?: string;
|
|
9
|
+
}>;
|
|
10
|
+
ImageWrapper?: ComponentAdapter<{
|
|
11
|
+
src: string;
|
|
12
|
+
alt: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
height?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export declare const registerAdapter: <T extends keyof Adapters>(key: T, adapter: NonNullable<Adapters[T]>) => void;
|
|
19
|
+
export declare const getAdapter: <T extends keyof Adapters>(key: T) => NonNullable<Adapters[T]>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=Adapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Adapters.d.ts","sourceRoot":"","sources":["../src/Adapters.tsx"],"names":[],"mappings":"AAAA,KAAK,gBAAgB,CAAC,MAAM,GAAG,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,CAAA;AAE1D,UAAU,QAAQ;IAChB,WAAW,CAAC,EAAE,gBAAgB,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAA;QACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;QACzB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,GAAG,CAAC,EAAE,MAAM,CAAA;KACb,CAAC,CAAA;IACF,YAAY,CAAC,EAAE,gBAAgB,CAAC;QAC9B,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB,CAAC,CAAA;CACH;AAID,eAAO,MAAM,eAAe,kCACrB,CAAC,WACG,YAAY,QAAQ,CAAC,CAAC,CAAC,CAAC,SAGlC,CAAA;AAED,eAAO,MAAM,UAAU,kCAChB,CAAC,KACL,YAAY,QAAQ,CAAC,CAAC,CAAC,CAMzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.tsx"],"names":[],"mappings":"AAEA,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,IAAI,2BAA4B,SAAS,gDAerD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAaA,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const linkVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "white" | "navy" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
interface AppLinkProps extends React.HTMLAttributes<HTMLAnchorElement>, VariantProps<typeof linkVariants> {
|
|
8
|
+
href: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
target?: string;
|
|
12
|
+
}
|
|
13
|
+
declare const AppLink: React.FC<AppLinkProps>;
|
|
14
|
+
export default AppLink;
|
|
15
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/ui/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,YAAY;;8EAWhB,CAAA;AAEF,UAAU,YACR,SAAQ,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAC7C,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAsBnC,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
9
|
+
//# sourceMappingURL=alert.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAoBjE,QAAA,MAAM,KAAK;;sHAUT,CAAA;AAGF,QAAA,MAAM,UAAU,uHASd,CAAA;AAGF,QAAA,MAAM,gBAAgB,yHASpB,CAAA;AAGF,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { IconName } from '../icon';
|
|
4
|
+
|
|
5
|
+
declare const buttonVariants: (props?: ({
|
|
6
|
+
variant?: "default" | "outline" | "white" | "outlineWhite" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface ButtonIconProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
9
|
+
className?: string;
|
|
10
|
+
icon?: IconName;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const ButtonIcon: React.FC<ButtonIconProps>;
|
|
16
|
+
export default ButtonIcon;
|
|
17
|
+
//# sourceMappingURL=ButtonIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonIcon.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/ButtonIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAGvC,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAe,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE/C,QAAA,MAAM,cAAc;;8EAgBnB,CAAA;AAED,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAezC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
theme?: "default" | "opacity" | "sapphire" | null | undefined;
|
|
6
|
+
size?: "default" | "defaultWithoutIcon" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
declare const arrowContainerVariants: (props?: ({
|
|
9
|
+
theme?: "default" | "opacity" | "sapphire" | null | undefined;
|
|
10
|
+
iconDirection?: "default" | "down" | null | undefined;
|
|
11
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
12
|
+
interface ArrowContainerPropsToButton {
|
|
13
|
+
iconDirection?: VariantProps<typeof arrowContainerVariants>['iconDirection'];
|
|
14
|
+
}
|
|
15
|
+
export interface ButtonPrimaryProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants>, ArrowContainerPropsToButton {
|
|
16
|
+
className?: string;
|
|
17
|
+
linkClassName?: string;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
href?: string;
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare const ButtonPrimary: React.FC<ButtonPrimaryProps>;
|
|
23
|
+
export default ButtonPrimary;
|
|
24
|
+
//# sourceMappingURL=ButtonPrimary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,cAAc;;;8EAmBnB,CAAA;AAED,QAAA,MAAM,sBAAsB;;;8EAmB3B,CAAA;AAED,UAAU,2BAA2B;IACnC,aAAa,CAAC,EAAE,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC,eAAe,CAAC,CAAA;CAC7E;AAED,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC,EACnC,2BAA2B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA4C/C,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "outline" | "white" | "outlineWhite" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface ButtonSecondaryProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const ButtonSecondary: React.ForwardRefExoticComponent<ButtonSecondaryProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
export default ButtonSecondary;
|
|
15
|
+
//# sourceMappingURL=ButtonSecondary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/ButtonSecondary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,cAAc;;;8EAsBnB,CAAA;AAED,MAAM,WAAW,oBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,eAAe,gGAcnB,CAAA;AAIF,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "white" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export type ButtonTextIconName = 'arrowRight' | 'plus' | 'minus' | 'download';
|
|
8
|
+
interface NewProps {
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
icon?: ButtonTextIconName;
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ButtonTextProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants>, NewProps {
|
|
15
|
+
}
|
|
16
|
+
export interface ButtonTextPropsWithoutHTMLAttributes extends Omit<NewProps, 'children' | 'className'> {
|
|
17
|
+
text: string;
|
|
18
|
+
}
|
|
19
|
+
declare const ButtonText: React.FC<ButtonTextProps>;
|
|
20
|
+
export default ButtonText;
|
|
21
|
+
//# sourceMappingURL=ButtonText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonText.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/ButtonText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;8EAUlB,CAAA;AA2BF,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAA;AAqB7E,UAAU,QAAQ;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,IAAI,CAAC,EAAE,kBAAkB,CAAA;IACzB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC,EACnC,QAAQ;CAAG;AAEf,MAAM,WAAW,oCACf,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,GAAG,WAAW,CAAC;IAChD,IAAI,EAAE,MAAM,CAAA;CACb;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAwBzC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "white" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonUniqueProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
className?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
icon?: string;
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const ButtonUnique: React.FC<ButtonUniqueProps>;
|
|
14
|
+
export default ButtonUnique;
|
|
15
|
+
//# sourceMappingURL=ButtonUnique.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonUnique.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/ButtonUnique.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAGjE,QAAA,MAAM,cAAc;;8EAUlB,CAAA;AA2BF,MAAM,WAAW,iBACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwB7C,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
|
|
4
|
+
declare const buttonVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "destructive" | "outline" | "ghost" | "link" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export { Button, buttonVariants };
|
|
13
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAyBnB,CAAA;AAED,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/button/index.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type IconName = 'chevronLeft' | 'chevronRight' | 'plus' | 'minus' | 'like' | 'dislike';
|
|
4
|
+
export declare const iconDefiner: (icon?: IconName, width?: number | string, height?: number | string) => React.ReactElement;
|
|
5
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/ui/icon.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,MAAM,QAAQ,GAChB,aAAa,GACb,cAAc,GACd,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,CAAA;AA2Cb,eAAO,MAAM,WAAW,UACf,QAAQ,UACP,MAAM,GAAG,MAAM,WACd,MAAM,GAAG,MAAM,KACvB,MAAM,YAQR,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkWrapper.d.ts","sourceRoot":"","sources":["../../src/decorators/LinkWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAaA,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Button, ButtonProps } from './components/ui/button/button';
|
|
2
|
+
import { default as ButtonIcon, ButtonIconProps } from './components/ui/button/ButtonIcon';
|
|
3
|
+
import { default as ButtonPrimary, ButtonPrimaryProps } from './components/ui/button/ButtonPrimary';
|
|
4
|
+
import { default as ButtonSecondary, ButtonSecondaryProps } from './components/ui/button/ButtonSecondary';
|
|
5
|
+
import { default as ButtonText, ButtonTextProps } from './components/ui/button/ButtonText';
|
|
6
|
+
import { default as ButtonUnique, ButtonUniqueProps } from './components/ui/button/ButtonUnique';
|
|
7
|
+
import { default as AppLink } from './components/ui/Link';
|
|
8
|
+
import { registerAdapter } from './Adapters';
|
|
9
|
+
|
|
10
|
+
export { Alert, AlertDescription, AlertTitle } from './components/ui/alert';
|
|
11
|
+
export { Button, type ButtonProps };
|
|
12
|
+
export { ButtonIcon, type ButtonIconProps };
|
|
13
|
+
export { ButtonPrimary, type ButtonPrimaryProps };
|
|
14
|
+
export { ButtonSecondary, type ButtonSecondaryProps };
|
|
15
|
+
export { ButtonText, type ButtonTextProps };
|
|
16
|
+
export { ButtonUnique, type ButtonUniqueProps };
|
|
17
|
+
export { AppLink };
|
|
18
|
+
export { registerAdapter };
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAC/E,OAAO,aAAa,EAAE,EACpB,KAAK,kBAAkB,EACxB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,eAAe,EAAE,EACtB,KAAK,oBAAoB,EAC1B,MAAM,wCAAwC,CAAA;AAC/C,OAAO,UAAU,EAAE,EACjB,KAAK,eAAe,EACrB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,YAAY,EAAE,EACnB,KAAK,iBAAiB,EACvB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,OAAO,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAG5C,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAE3E,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,CAAA;AAE/C,OAAO,EAAE,OAAO,EAAE,CAAA;AAElB,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Button as o } from "./index.es2.js";
|
|
2
|
+
import { default as a } from "./index.es3.js";
|
|
3
|
+
import { default as p } from "./index.es4.js";
|
|
4
|
+
import { default as n } from "./index.es5.js";
|
|
5
|
+
import { default as m } from "./index.es6.js";
|
|
6
|
+
import { default as d } from "./index.es7.js";
|
|
7
|
+
import { default as i } from "./index.es8.js";
|
|
8
|
+
import { registerAdapter as A } from "./index.es9.js";
|
|
9
|
+
import { Alert as y, AlertDescription as T, AlertTitle as g } from "./index.es10.js";
|
|
10
|
+
export {
|
|
11
|
+
y as Alert,
|
|
12
|
+
T as AlertDescription,
|
|
13
|
+
g as AlertTitle,
|
|
14
|
+
i as AppLink,
|
|
15
|
+
o as Button,
|
|
16
|
+
a as ButtonIcon,
|
|
17
|
+
p as ButtonPrimary,
|
|
18
|
+
n as ButtonSecondary,
|
|
19
|
+
m as ButtonText,
|
|
20
|
+
d as ButtonUnique,
|
|
21
|
+
A as registerAdapter
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { cva as i } from "class-variance-authority";
|
|
3
|
+
import { cn as l } from "./index.es11.js";
|
|
4
|
+
const d = i(
|
|
5
|
+
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-background text-foreground",
|
|
10
|
+
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
), o = e.forwardRef(({ className: t, variant: r, ...a }, s) => /* @__PURE__ */ e.createElement(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
ref: s,
|
|
21
|
+
role: "alert",
|
|
22
|
+
className: l(d({ variant: r }), t),
|
|
23
|
+
...a
|
|
24
|
+
}
|
|
25
|
+
));
|
|
26
|
+
o.displayName = "Alert";
|
|
27
|
+
const n = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e.createElement(
|
|
28
|
+
"h5",
|
|
29
|
+
{
|
|
30
|
+
ref: a,
|
|
31
|
+
className: l("mb-1 font-medium leading-none tracking-tight", t),
|
|
32
|
+
...r
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
n.displayName = "AlertTitle";
|
|
36
|
+
const c = e.forwardRef(({ className: t, ...r }, a) => /* @__PURE__ */ e.createElement(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
ref: a,
|
|
40
|
+
className: l("text-sm [&_p]:leading-relaxed", t),
|
|
41
|
+
...r
|
|
42
|
+
}
|
|
43
|
+
));
|
|
44
|
+
c.displayName = "AlertDescription";
|
|
45
|
+
export {
|
|
46
|
+
o as Alert,
|
|
47
|
+
c as AlertDescription,
|
|
48
|
+
n as AlertTitle
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.es10.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es10.js","sources":["../src/components/ui/alert.tsx"],"sourcesContent":["import * as React from 'react'\r\nimport { cva, type VariantProps } from 'class-variance-authority'\r\n\r\nimport { cn } from '@/lib/utils/cn'\r\n\r\nconst alertVariants = cva(\r\n 'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground',\r\n {\r\n variants: {\r\n variant: {\r\n default: 'bg-background text-foreground',\r\n destructive:\r\n 'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'default',\r\n },\r\n }\r\n)\r\n\r\nconst Alert = React.forwardRef<\r\n HTMLDivElement,\r\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\r\n>(({ className, variant, ...props }, ref) => (\r\n <div\r\n ref={ref}\r\n role=\"alert\"\r\n className={cn(alertVariants({ variant }), className)}\r\n {...props}\r\n />\r\n))\r\nAlert.displayName = 'Alert'\r\n\r\nconst AlertTitle = React.forwardRef<\r\n HTMLParagraphElement,\r\n React.HTMLAttributes<HTMLHeadingElement>\r\n>(({ className, ...props }, ref) => (\r\n <h5\r\n ref={ref}\r\n className={cn('mb-1 font-medium leading-none tracking-tight', className)}\r\n {...props}\r\n />\r\n))\r\nAlertTitle.displayName = 'AlertTitle'\r\n\r\nconst AlertDescription = React.forwardRef<\r\n HTMLParagraphElement,\r\n React.HTMLAttributes<HTMLParagraphElement>\r\n>(({ className, ...props }, ref) => (\r\n <div\r\n ref={ref}\r\n className={cn('text-sm [&_p]:leading-relaxed', className)}\r\n {...props}\r\n />\r\n))\r\nAlertDescription.displayName = 'AlertDescription'\r\n\r\nexport { Alert, AlertTitle, AlertDescription }\r\n"],"names":["alertVariants","cva","Alert","React","className","variant","props","ref","cn","AlertTitle","AlertDescription"],"mappings":";;;AAKA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MACJ;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF,GAEMC,IAAQC,EAAM,WAGlB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,GAAGC,EAAM,GAAGC,MACnC,gBAAAJ,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAI;AAAA,IACA,MAAK;AAAA,IACL,WAAWC,EAAGR,EAAc,EAAE,SAAAK,EAAS,CAAA,GAAGD,CAAS;AAAA,IAClD,GAAGE;AAAA,EAAA;AACN,CACD;AACDJ,EAAM,cAAc;AAEd,MAAAO,IAAaN,EAAM,WAGvB,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAM,GAAGC,MAC1B,gBAAAJ,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAI;AAAA,IACA,WAAWC,EAAG,gDAAgDJ,CAAS;AAAA,IACtE,GAAGE;AAAA,EAAA;AACN,CACD;AACDG,EAAW,cAAc;AAEnB,MAAAC,IAAmBP,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,GAAGE,EAAM,GAAGC,MAC1B,gBAAAJ,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAI;AAAA,IACA,WAAWC,EAAG,iCAAiCJ,CAAS;AAAA,IACvD,GAAGE;AAAA,EAAA;AACN,CACD;AACDI,EAAiB,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es11.js","sources":["../src/lib/utils/cn.ts"],"sourcesContent":["import { type ClassValue, clsx } from 'clsx'\r\nimport { twMerge } from 'tailwind-merge'\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n return twMerge(clsx(inputs))\r\n}\r\n"],"names":["cn","inputs","twMerge","clsx"],"mappings":";;AAGO,SAASA,KAAMC,GAAsB;AACnC,SAAAC,EAAQC,EAAKF,CAAM,CAAC;AAC7B;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ArrowSliderPrev16X16 as s, ArrowSliderNext16X16 as m, MoreLink16X16 as l, LessLink16X16 as u } from "@iit/precision-ui-icons";
|
|
2
|
+
import { ThumbsUp as f, ThumbsDown as p } from "lucide-react";
|
|
3
|
+
import o from "react";
|
|
4
|
+
const i = "1em", a = (e) => Object.keys(e).reduce((r, t) => (r[t] = ({
|
|
5
|
+
width: n = i,
|
|
6
|
+
height: c = i
|
|
7
|
+
}) => o.createElement(e[t], { width: n, height: c }), r), {}), d = {
|
|
8
|
+
chevronLeft: s,
|
|
9
|
+
chevronRight: m,
|
|
10
|
+
plus: l,
|
|
11
|
+
minus: u,
|
|
12
|
+
like: f,
|
|
13
|
+
dislike: p
|
|
14
|
+
}, h = a(d), I = (e, r, t) => {
|
|
15
|
+
if (e) {
|
|
16
|
+
const n = h[e];
|
|
17
|
+
if (n)
|
|
18
|
+
return n({ width: r, height: t });
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
I as iconDefiner
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.es12.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es12.js","sources":["../src/components/ui/icon.tsx"],"sourcesContent":["import {\r\n ArrowSliderNext16X16,\r\n ArrowSliderPrev16X16,\r\n LessLink16X16,\r\n MoreLink16X16,\r\n} from '@iit/precision-ui-icons'\r\nimport { ThumbsDown, ThumbsUp } from 'lucide-react'\r\n\r\nimport React from 'react'\r\n\r\nconst DEFAULT_ICON_SIZE = '1em'\r\n\r\nexport type IconName =\r\n | 'chevronLeft'\r\n | 'chevronRight'\r\n | 'plus'\r\n | 'minus'\r\n | 'like'\r\n | 'dislike'\r\n\r\n// TODO: move to separate file\r\n// type IconMap = {\r\n// [key in IconName]: (props: {\r\n// width?: number | string\r\n// height?: number | string\r\n// }) => React.ReactElement\r\n// }\r\n\r\ninterface IconProps {\r\n width?: number | string\r\n height?: number | string\r\n}\r\n\r\nconst generateIconMap = (\r\n icons: Record<IconName, React.ComponentType<React.SVGProps<SVGSVGElement>>>\r\n) => {\r\n return Object.keys(icons).reduce<\r\n Record<IconName, (props: IconProps) => React.ReactElement>\r\n >((acc, key) => {\r\n acc[key as IconName] = ({\r\n width = DEFAULT_ICON_SIZE,\r\n height = DEFAULT_ICON_SIZE,\r\n }: IconProps) =>\r\n React.createElement(icons[key as IconName], { width, height })\r\n return acc\r\n }, {} as Record<IconName, (props: IconProps) => React.ReactElement>)\r\n}\r\n\r\nconst icons: Record<\r\n IconName,\r\n React.ComponentType<React.SVGProps<SVGSVGElement>>\r\n> = {\r\n chevronLeft: ArrowSliderPrev16X16,\r\n chevronRight: ArrowSliderNext16X16,\r\n plus: MoreLink16X16,\r\n minus: LessLink16X16,\r\n like: ThumbsUp,\r\n dislike: ThumbsDown,\r\n}\r\n\r\nconst iconMap = generateIconMap(icons)\r\nexport const iconDefiner = (\r\n icon?: IconName,\r\n width?: number | string,\r\n height?: number | string\r\n): React.ReactElement => {\r\n if (icon) {\r\n const selectedIcon = iconMap[icon]\r\n if (selectedIcon) {\r\n return selectedIcon({ width, height })\r\n }\r\n }\r\n return <></>\r\n}\r\n"],"names":["DEFAULT_ICON_SIZE","generateIconMap","icons","acc","key","width","height","React","ArrowSliderPrev16X16","ArrowSliderNext16X16","MoreLink16X16","LessLink16X16","ThumbsUp","ThumbsDown","iconMap","iconDefiner","icon","selectedIcon"],"mappings":";;;AAUA,MAAMA,IAAoB,OAuBpBC,IAAkB,CACtBC,MAEO,OAAO,KAAKA,CAAK,EAAE,OAExB,CAACC,GAAKC,OACFD,EAAAC,CAAe,IAAI,CAAC;AAAA,EACtB,OAAAC,IAAQL;AAAA,EACR,QAAAM,IAASN;AAAA,MAETO,EAAM,cAAcL,EAAME,CAAe,GAAG,EAAE,OAAAC,GAAO,QAAAC,EAAA,CAAQ,GACxDH,IACN,CAAgE,CAAA,GAG/DD,IAGF;AAAA,EACF,aAAaM;AAAA,EACb,cAAcC;AAAA,EACd,MAAMC;AAAA,EACN,OAAOC;AAAA,EACP,MAAMC;AAAA,EACN,SAASC;AACX,GAEMC,IAAUb,EAAgBC,CAAK,GACxBa,IAAc,CACzBC,GACAX,GACAC,MACuB;AACvB,MAAIU,GAAM;AACF,UAAAC,IAAeH,EAAQE,CAAI;AACjC,QAAIC;AACF,aAAOA,EAAa,EAAE,OAAAZ,GAAO,QAAAC,EAAQ,CAAA;AAAA,EAEzC;AACA,SAASC,gBAAAA,EAAA,cAAAA,EAAA,UAAA,IAAA;AACX;"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { Slot as d } from "@radix-ui/react-slot";
|
|
3
|
+
import { cva as c } from "class-variance-authority";
|
|
4
|
+
import { cn as u } from "./index.es11.js";
|
|
5
|
+
const l = c(
|
|
6
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-full typo_variant_button ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed border-none",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-white text-navy hover:bg-navy-opacity-4",
|
|
11
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
12
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
13
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-10 px-4 py-2",
|
|
18
|
+
sm: "h-9 rounded-md px-3",
|
|
19
|
+
lg: "h-11 rounded-md px-8",
|
|
20
|
+
icon: "h-10 w-10"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
// variant: "default",
|
|
25
|
+
// size: "default",
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
), f = e.forwardRef(
|
|
29
|
+
({ className: t, variant: o, size: r, asChild: n = !1, ...i }, a) => {
|
|
30
|
+
const s = n ? d : "button";
|
|
31
|
+
return /* @__PURE__ */ e.createElement(
|
|
32
|
+
s,
|
|
33
|
+
{
|
|
34
|
+
className: u(l({ variant: o, size: r }), t),
|
|
35
|
+
ref: a,
|
|
36
|
+
...i
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
f.displayName = "Button";
|
|
42
|
+
export {
|
|
43
|
+
f as Button,
|
|
44
|
+
l as buttonVariants
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=index.es2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es2.js","sources":["../src/components/ui/button/button.tsx"],"sourcesContent":["import React from 'react'\r\nimport { Slot } from '@radix-ui/react-slot'\r\nimport { cva, type VariantProps } from 'class-variance-authority'\r\n\r\nimport { cn } from '@/lib/utils/cn'\r\n\r\nconst buttonVariants = cva(\r\n 'inline-flex items-center justify-center whitespace-nowrap rounded-full typo_variant_button ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed border-none',\r\n {\r\n variants: {\r\n variant: {\r\n default: 'bg-white text-navy hover:bg-navy-opacity-4',\r\n destructive:\r\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\r\n outline:\r\n 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',\r\n ghost: 'hover:bg-accent hover:text-accent-foreground',\r\n link: 'text-primary underline-offset-4 hover:underline',\r\n },\r\n size: {\r\n default: 'h-10 px-4 py-2',\r\n sm: 'h-9 rounded-md px-3',\r\n lg: 'h-11 rounded-md px-8',\r\n icon: 'h-10 w-10',\r\n },\r\n },\r\n defaultVariants: {\r\n // variant: \"default\",\r\n // size: \"default\",\r\n },\r\n }\r\n)\r\n\r\nexport interface ButtonProps\r\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n VariantProps<typeof buttonVariants> {\r\n asChild?: boolean\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n ({ className, variant, size, asChild = false, ...props }, ref) => {\r\n const Comp = asChild ? Slot : 'button'\r\n return (\r\n <Comp\r\n className={cn(buttonVariants({ variant, size }), className)}\r\n ref={ref}\r\n {...props}\r\n />\r\n )\r\n }\r\n)\r\nButton.displayName = 'Button'\r\n\r\nexport { Button, buttonVariants }\r\n"],"names":["buttonVariants","cva","Button","React","className","variant","size","asChild","props","ref","Comp","Slot","cn"],"mappings":";;;;AAMA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA;AAAA;AAAA,IAGjB;AAAA,EACF;AACF,GAQMC,IAASC,EAAM;AAAA,EACnB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,MAAAC,GAAM,SAAAC,IAAU,IAAO,GAAGC,EAAM,GAAGC,MAAQ;AAC1D,UAAAC,IAAOH,IAAUI,IAAO;AAE5B,WAAAR,gBAAAA,EAAA;AAAA,MAACO;AAAA,MAAA;AAAA,QACC,WAAWE,EAAGZ,EAAe,EAAE,SAAAK,GAAS,MAAAC,EAAK,CAAC,GAAGF,CAAS;AAAA,QAC1D,KAAAK;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;AACAN,EAAO,cAAc;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import e, { Fragment as c } from "react";
|
|
2
|
+
import { Button as h } from "./index.es2.js";
|
|
3
|
+
import { cva as l } from "class-variance-authority";
|
|
4
|
+
import { cn as u } from "./index.es11.js";
|
|
5
|
+
import { iconDefiner as d } from "./index.es12.js";
|
|
6
|
+
const m = l(
|
|
7
|
+
"rounded-lg p-[10px] transition-all hover:rounded-[24px]",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "text-navy bg-navy-opacity-4",
|
|
12
|
+
outline: "text-navy border border-navy-opacity-32 hover:bg-white",
|
|
13
|
+
white: "text-white bg-whitish-opacity-8 hover:bg-whitish-opacity-16",
|
|
14
|
+
outlineWhite: "text-white border border-whitish-opacity-32 hover:bg-white hover:text-navy"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
defaultVariants: {
|
|
18
|
+
variant: "default"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
), v = ({
|
|
22
|
+
className: o,
|
|
23
|
+
icon: r,
|
|
24
|
+
variant: a,
|
|
25
|
+
width: i,
|
|
26
|
+
height: n,
|
|
27
|
+
...t
|
|
28
|
+
}) => /* @__PURE__ */ e.createElement(h, { className: u(m({ variant: a, className: o })), ...t }, /* @__PURE__ */ e.createElement(c, null, d(r, i, n), " ", t.children)), w = v;
|
|
29
|
+
export {
|
|
30
|
+
w as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=index.es3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es3.js","sources":["../src/components/ui/button/ButtonIcon.tsx"],"sourcesContent":["import React, { Fragment } from 'react'\r\nimport { Button } from './button'\r\n\r\nimport { cva, type VariantProps } from 'class-variance-authority'\r\nimport { cn } from '@/lib/utils/cn'\r\nimport { iconDefiner, IconName } from '../icon'\r\n\r\nconst buttonVariants = cva(\r\n 'rounded-lg p-[10px] transition-all hover:rounded-[24px]',\r\n {\r\n variants: {\r\n variant: {\r\n default: 'text-navy bg-navy-opacity-4',\r\n outline: 'text-navy border border-navy-opacity-32 hover:bg-white',\r\n white: 'text-white bg-whitish-opacity-8 hover:bg-whitish-opacity-16',\r\n outlineWhite:\r\n 'text-white border border-whitish-opacity-32 hover:bg-white hover:text-navy',\r\n },\r\n },\r\n defaultVariants: {\r\n variant: 'default',\r\n },\r\n }\r\n)\r\n\r\nexport interface ButtonIconProps\r\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n VariantProps<typeof buttonVariants> {\r\n className?: string\r\n icon?: IconName\r\n width?: number | string\r\n height?: number | string\r\n children?: React.ReactNode\r\n}\r\n\r\nconst ButtonIcon: React.FC<ButtonIconProps> = ({\r\n className,\r\n icon,\r\n variant,\r\n width,\r\n height,\r\n ...props\r\n}) => {\r\n return (\r\n <Button className={cn(buttonVariants({ variant, className }))} {...props}>\r\n <Fragment>\r\n {iconDefiner(icon, width, height)} {props.children}\r\n </Fragment>\r\n </Button>\r\n )\r\n}\r\n\r\nexport default ButtonIcon\r\n"],"names":["buttonVariants","cva","ButtonIcon","className","icon","variant","width","height","props","React","Button","cn","Fragment","iconDefiner","ButtonIcon$1"],"mappings":";;;;;AAOA,MAAMA,IAAiBC;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SAAS;AAAA,QACT,OAAO;AAAA,QACP,cACE;AAAA,MACJ;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF,GAYMC,IAAwC,CAAC;AAAA,EAC7C,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAA,cAACC,KAAO,WAAWC,EAAGX,EAAe,EAAE,SAAAK,GAAS,WAAAF,GAAW,CAAC,GAAI,GAAGK,EACjE,GAAAC,gBAAAA,EAAA,cAACG,GACE,MAAAC,EAAYT,GAAME,GAAOC,CAAM,GAAE,KAAEC,EAAM,QAC5C,CACF,GAIJM,IAAeZ;"}
|