periplo-ui 1.6.0 → 1.7.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 CHANGED
@@ -1,15 +1,43 @@
1
- ## Publishing the library
1
+ # Periplo UI: IATI UI Library
2
2
 
3
- 1. Build the package: `npm run build`
4
- 2. Open `package.json`, update package description, author, repository, remove `"private": true`.
5
- 3. Run `npm publish`
3
+ **Description:** Periplo UI is a TypeScript library built with React and shadcn-ui modified components, providing reusable and accessible UI components for building IATI compliant applications.
6
4
 
7
- ## Publishing docs to GitHub pages
5
+ ## Getting Started:
8
6
 
9
- Storybook static is built to `docs` directory which is under git. To publish it to GitHub Pages do this:
7
+ 1. **Prerequisites:**
10
8
 
11
- - Publish this repo to GitHub.
12
- - Run `npm run build-docs`, commit `docs` folder and push.
13
- - [Create a separate GitHub Pages repo](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site#creating-a-repository-for-your-site) if you haven't yet.
14
- - [Set up GitHub pages for this project](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site#creating-your-site) to build from `docs` folder from `main` branch.
15
- - To do this go to this repo's settings and open `Pages` section (menu on the left side). Select `Source` -> `Deploy from a branch`, select `Branch` -> `main` and `/docs` folder.
9
+ - Node.js v20+ is required.
10
+
11
+ 2. **Installation:**
12
+
13
+ ```bash
14
+ npm install periplo-ui
15
+ ```
16
+
17
+ 3. **Usage:**
18
+
19
+ - Import component:
20
+
21
+ ```javascript
22
+ import { Badge } from 'periplo-ui'
23
+
24
+ function MyComponent() {
25
+ return <Badge />
26
+ }
27
+ ```
28
+
29
+ - Refer to documentation for individual component usage and API reference: https://periplo-ui.vercel.app/?path=/docs/getting-started--docs
30
+
31
+ ## Available Commands:
32
+
33
+ | Command | Description |
34
+ | ------------------- | -------------------------------------------------------------- |
35
+ | build | Builds all components for distribution (output dist) |
36
+ | dev | Starts development server on localhost:6006 |
37
+ | lint | Lints all code according to code style guidelines |
38
+ | test | Runs unit and integration tests |
39
+ | storybook | Starts the Storybook development server |
40
+ | storybook-build | Builds Storybook documentation (output build-storybook-static) |
41
+ | prepare | Setup git hooks and runs build before npm install |
42
+ | update-dependencies | Updates all dependencies to their latest versions |
43
+ | commit | Opens the Commitizen prompt for creating commit messages |
@@ -0,0 +1,12 @@
1
+ import * as AvatarPrimitive from '@radix-ui/react-avatar';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ import React from 'react';
4
+ declare const avatarVariants: (props?: ({
5
+ size?: "sm" | "lg" | "md" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface AvatarProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof avatarVariants> {
8
+ }
9
+ declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
10
+ declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
11
+ declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
12
+ export { Avatar, AvatarImage, AvatarFallback };
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ /**
4
+ * Avatar:
5
+ * This is a React functional component created using React.forwardRef.
6
+ * It accepts props such as className and size.
7
+ * It renders the AvatarPrimitive.Root component with appropriate props and class names.
8
+
9
+ *AvatarImage and AvatarFallback:
10
+ * These are similar to the Avatar component but render different parts of the avatar, the image and fallback content.
11
+ */
12
+ declare const meta: {
13
+ component: import("react").ForwardRefExoticComponent<import("./Avatar").AvatarProps & import("react").RefAttributes<HTMLSpanElement>>;
14
+ tags: string[];
15
+ argTypes: {};
16
+ parameters: {
17
+ layout: string;
18
+ };
19
+ };
20
+ export default meta;
21
+ type Story = StoryObj<typeof meta>;
22
+ export declare const Default: Story;
23
+ export declare const WithBadge: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Avatar';
@@ -0,0 +1,9 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import * as React from 'react';
3
+ declare const badgeVariants: (props?: ({
4
+ intent?: "neutral" | "primary" | "accent" | "success" | "warning" | "error" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof badgeVariants> {
7
+ }
8
+ declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLButtonElement>>;
9
+ export { Badge };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ component: import("react").ForwardRefExoticComponent<import("./Badge").BadgeProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ tags: string[];
6
+ argTypes: {};
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Badge';
@@ -1,13 +1,9 @@
1
- import { type VariantProps } from 'class-variance-authority';
2
1
  import * as React from 'react';
3
- declare const cardMediaVariants: (props?: ({
4
- variant?: "vertical" | "horizontal" | null | undefined;
5
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
- export interface CardMediaProps extends React.ImgHTMLAttributes<HTMLImageElement>, VariantProps<typeof cardMediaVariants> {
2
+ export interface CardMediaProps extends React.ImgHTMLAttributes<HTMLImageElement> {
7
3
  alt: string;
8
4
  src: string;
9
5
  }
10
6
  declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
11
7
  declare const CardMedia: React.ForwardRefExoticComponent<CardMediaProps & React.RefAttributes<HTMLImageElement>>;
12
8
  declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
13
- export { Card, CardMedia, CardContent, cardMediaVariants };
9
+ export { Card, CardMedia, CardContent };
@@ -10,5 +10,4 @@ declare const meta: {
10
10
  };
11
11
  export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
- export declare const Vertical: Story;
14
- export declare const Horizontal: Story;
13
+ export declare const Default: Story;
@@ -0,0 +1,27 @@
1
+ import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
2
+ import * as React from 'react';
3
+ type CarouselApi = UseEmblaCarouselType[1];
4
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
5
+ type CarouselOptions = UseCarouselParameters[0];
6
+ type CarouselPlugin = UseCarouselParameters[1];
7
+ export interface CarouselProps {
8
+ opts?: CarouselOptions;
9
+ plugins?: CarouselPlugin;
10
+ orientation?: 'horizontal' | 'vertical';
11
+ setApi?: (api: CarouselApi) => void;
12
+ }
13
+ type CarouselContextProps = {
14
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
15
+ api: ReturnType<typeof useEmblaCarousel>[1];
16
+ scrollPrev: () => void;
17
+ scrollNext: () => void;
18
+ canScrollPrev: boolean;
19
+ canScrollNext: boolean;
20
+ } & CarouselProps;
21
+ declare const CarouselContext: React.Context<CarouselContextProps | null>;
22
+ declare const Carousel: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & CarouselProps & React.RefAttributes<HTMLDivElement>>;
23
+ declare const CarouselContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
24
+ declare const CarouselItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
25
+ declare const CarouselPrevious: React.ForwardRefExoticComponent<Omit<import("../Button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
26
+ declare const CarouselNext: React.ForwardRefExoticComponent<Omit<import("../Button").ButtonProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
27
+ export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselContext };
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ component: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & import("./Carousel").CarouselProps & import("react").RefAttributes<HTMLDivElement>>;
5
+ tags: string[];
6
+ argTypes: {};
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Primary: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Carousel';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Button, buttonVariants, type ButtonProps } from './components/Button';
2
2
  export { Typography, typographyVariants, type TypographyProps } from './components/Typography';
3
- export { Card, CardMedia, CardContent, cardMediaVariants, type CardMediaProps } from './components/Card';
3
+ export { Card, CardMedia, CardContent, type CardMediaProps } from './components/Card';
4
+ export { Avatar, AvatarFallback, AvatarImage, type AvatarProps } from './components/Avatar';
5
+ export { Badge, type BadgeProps } from './components/Badge';
6
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CarouselProps, } from './components/Carousel';
4
7
  export * from './lib/plugin';