@youngonesworks/ui 0.1.1 → 0.1.5
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 +4 -4
- package/dist/components/AutoCompleteInput/index.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +1 -1
- package/dist/components/Button/index.d.ts +13 -0
- package/dist/components/Table/tableCell/TableCell.stories.d.ts +6 -0
- package/dist/components/Table/tableCell/index.d.ts +7 -0
- package/dist/components/Table/tableHeader/TableHeader.stories.d.ts +6 -0
- package/dist/components/Table/tableHeader/index.d.ts +5 -0
- package/dist/components/Table/tableHeaderItem/TableHeaderItem.stories.d.ts +6 -0
- package/dist/components/Table/tableHeaderItem/index.d.ts +7 -0
- package/dist/components/Table/tableHeaderRow/TableHeaderRow.stories.d.ts +6 -0
- package/dist/components/Table/tableHeaderRow/index.d.ts +6 -0
- package/dist/components/Table/tableRow/TableRow.stories.d.ts +6 -0
- package/dist/components/Table/tableRow/index.d.ts +8 -0
- package/dist/components/accordion/Accordion.stories.d.ts +6 -0
- package/dist/components/accordion/AccordionItem.d.ts +14 -0
- package/dist/components/accordion/AccordionItem.stories.d.ts +11 -0
- package/dist/components/accordion/AccordionItem.test.d.ts +1 -0
- package/dist/components/accordion/AccordionWrapper.d.ts +7 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/favouriteButton/FavouriteButton.stories.d.ts +6 -0
- package/dist/components/favouriteButton/FavouriteButton.test.d.ts +1 -0
- package/dist/components/favouriteButton/index.d.ts +24 -0
- package/dist/components/filters/FilterButton.d.ts +9 -0
- package/dist/components/filters/FilterButton.stories.d.ts +7 -0
- package/dist/components/filters/FilterButton.test.d.ts +1 -0
- package/dist/components/filters/FilterItem.d.ts +7 -0
- package/dist/components/filters/FilterItem.stories.d.ts +7 -0
- package/dist/components/filters/FilterItem.test.d.ts +1 -0
- package/dist/components/filters/Filters.stories.d.ts +7 -0
- package/dist/components/filters/index.d.ts +11 -0
- package/dist/components/navButtons/NavButtons.stories.d.ts +10 -0
- package/dist/components/navButtons/NavButtons.test.d.ts +1 -0
- package/dist/components/navButtons/index.d.ts +6 -0
- package/dist/components/stepper/NumberedStepper.d.ts +13 -0
- package/dist/components/stepper/NumberedStepper.stories.d.ts +8 -0
- package/dist/components/stepper/NumberedStepper.test.d.ts +1 -0
- package/dist/components/stepper/Stepper.d.ts +16 -0
- package/dist/components/stepper/Stepper.stories.d.ts +9 -0
- package/dist/components/stepper/Stepper.test.d.ts +1 -0
- package/dist/components/stepper/index.d.ts +2 -0
- package/dist/components/tabs/Tab.d.ts +11 -0
- package/dist/components/tabs/Tab.stories.d.ts +15 -0
- package/dist/components/tabs/Tab.test.d.ts +1 -0
- package/dist/components/tabs/TabsBadge.d.ts +8 -0
- package/dist/components/tabs/TabsBadge.stories.d.ts +19 -0
- package/dist/components/tabs/TabsBadge.test.d.ts +1 -0
- package/dist/components/tabs/TabsWrapper.d.ts +17 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/index.cjs +244 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +55 -52
- package/dist/index.js +230 -63
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @youngonesworks/ui
|
|
2
2
|
|
|
3
3
|
A React component library built with Tailwind CSS v4.
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ A React component library built with Tailwind CSS v4.
|
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
# yarn
|
|
18
|
-
yarn add
|
|
18
|
+
yarn add @youngonesworks/ui
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
### Peer Dependencies
|
|
@@ -37,7 +37,7 @@ Update `tailwind.config.js`:
|
|
|
37
37
|
module.exports = {
|
|
38
38
|
content: [
|
|
39
39
|
'./src/**/*.{js,jsx,ts,tsx}',
|
|
40
|
-
'./node_modules/
|
|
40
|
+
'./node_modules/@youngonesworks/ui/**/*.{js,jsx,ts,tsx}',
|
|
41
41
|
],
|
|
42
42
|
theme: { extend: {} },
|
|
43
43
|
plugins: [],
|
|
@@ -47,7 +47,7 @@ module.exports = {
|
|
|
47
47
|
## Usage
|
|
48
48
|
|
|
49
49
|
```tsx
|
|
50
|
-
import { Button } from '
|
|
50
|
+
import { Button } from '@youngonesworks/ui';
|
|
51
51
|
|
|
52
52
|
function App() {
|
|
53
53
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChangeEvent, type KeyboardEvent, type ReactNode, type Ref } from 'react';
|
|
2
|
-
import { type TextInputProps } from '../
|
|
2
|
+
import { type TextInputProps } from '../textInput';
|
|
3
3
|
interface ISearchLocationFormProps extends TextInputProps {
|
|
4
4
|
label: string;
|
|
5
5
|
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import { buttonVariants } from './buttonVariants';
|
|
3
|
+
interface IButton extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
variant?: keyof typeof buttonVariants;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
block?: boolean;
|
|
8
|
+
dataTestId?: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
iconRight?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Button: import("react").ForwardRefExoticComponent<IButton & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
interface ITableCell extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
smallPadding?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const TableCell: ({ children, smallPadding, className }: ITableCell) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
interface ITableHeaderItem extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
smallPadding?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const TableHeaderItem: ({ children, smallPadding, className }: ITableHeaderItem) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
interface ITableRow extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare const TableHeaderRow: ({ children, ...props }: ITableRow) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
interface ITableRow extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
header?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const TableRow: import("react").ForwardRefExoticComponent<ITableRow & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
import { AccordionWrapper } from '../accordion';
|
|
3
|
+
declare const meta: Meta<typeof AccordionWrapper>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const AccordionWrapperStory: Story;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface IAccordionItem {
|
|
3
|
+
controlContent: ReactNode;
|
|
4
|
+
panelContent: ReactNode;
|
|
5
|
+
endContent?: ReactNode;
|
|
6
|
+
style?: 'light' | 'dark' | 'onboarding';
|
|
7
|
+
border?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
chevronPosition?: 'left' | 'right';
|
|
10
|
+
active?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const AccordionItem: ({ controlContent, panelContent, style, border, chevronPosition, disabled, active, endContent, className, }: IAccordionItem) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AccordionItem } from './AccordionItem';
|
|
3
|
+
declare const meta: Meta<typeof AccordionItem>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AccordionItem>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithEndContent: Story;
|
|
8
|
+
export declare const DarkStyle: Story;
|
|
9
|
+
export declare const WithBorder: Story;
|
|
10
|
+
export declare const ChevronRight: Story;
|
|
11
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
2
|
+
import { FavouriteButton } from './index';
|
|
3
|
+
declare const meta: Meta<typeof FavouriteButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const FavouriteButtonStory: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface IFavouriteButtonProps {
|
|
3
|
+
onClick: () => void;
|
|
4
|
+
favourite: boolean;
|
|
5
|
+
iconOutline?: ReactNode;
|
|
6
|
+
iconFilled?: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Can be removed and replaced by iconSize
|
|
9
|
+
*/
|
|
10
|
+
width?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Can be removed and replaced by iconSize
|
|
13
|
+
*/
|
|
14
|
+
height?: string;
|
|
15
|
+
iconSize?: number;
|
|
16
|
+
className?: string;
|
|
17
|
+
favouriteTitle?: string;
|
|
18
|
+
'data-testid'?: string;
|
|
19
|
+
iconColor?: string;
|
|
20
|
+
iconColorSelected?: string;
|
|
21
|
+
styleVariant?: 'transparent' | 'small' | 'default' | 'round' | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare const FavouriteButton: import("react").ForwardRefExoticComponent<IFavouriteButtonProps & import("react").RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface IFilterButtonProps {
|
|
2
|
+
onClick: () => void;
|
|
3
|
+
hasFilters: boolean;
|
|
4
|
+
reset: () => void;
|
|
5
|
+
filtersText: string;
|
|
6
|
+
resetText: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const FilterButton: ({ onClick, hasFilters, reset, filtersText, resetText }: IFilterButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FilterButton } from './FilterButton';
|
|
3
|
+
declare const meta: Meta<typeof FilterButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FilterButton>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithActiveFilters: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { FilterItem } from './FilterItem';
|
|
3
|
+
declare const meta: Meta<typeof FilterItem>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FilterItem>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Active: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Filters } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Filters>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Filters>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithSelectedFilters: Story;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface IFilterProps {
|
|
2
|
+
filters: string[];
|
|
3
|
+
selectedFilters: string[];
|
|
4
|
+
selectedFiltersText: string;
|
|
5
|
+
setFilters: (filter: string[]) => void;
|
|
6
|
+
callBack?: () => void;
|
|
7
|
+
filtersText: string;
|
|
8
|
+
resetText: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const Filters: ({ filters, setFilters, selectedFilters, selectedFiltersText, filtersText, resetText }: IFilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { NavButtons } from '.';
|
|
3
|
+
declare const meta: Meta<typeof NavButtons>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof NavButtons>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const OnlyNext: Story;
|
|
8
|
+
export declare const OnlyPrev: Story;
|
|
9
|
+
export declare const Disabled: Story;
|
|
10
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface Step {
|
|
2
|
+
label: string;
|
|
3
|
+
}
|
|
4
|
+
interface NumberedStepperProps {
|
|
5
|
+
steps: Step[];
|
|
6
|
+
active: number;
|
|
7
|
+
stepsCompleted: number[];
|
|
8
|
+
completedLabel: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
onStepClick: (index: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const NumberedStepper: ({ steps, active, className, stepsCompleted, completedLabel, onStepClick, }: NumberedStepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { NumberedStepper } from './NumberedStepper';
|
|
3
|
+
declare const meta: Meta<typeof NumberedStepper>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof NumberedStepper>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithCompletedSteps: Story;
|
|
8
|
+
export declare const CustomClassNameStepper: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Step {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
interface StepperProps {
|
|
6
|
+
steps: Step[];
|
|
7
|
+
clickableSteps?: number[];
|
|
8
|
+
completedSteps?: number[];
|
|
9
|
+
setStep?: (step: number) => void;
|
|
10
|
+
variant?: 'small' | 'default';
|
|
11
|
+
activeStep: number;
|
|
12
|
+
isMobile: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const Stepper: ({ steps, setStep, variant, clickableSteps, completedSteps, activeStep, isMobile, className, }: StepperProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Stepper } from './Stepper';
|
|
3
|
+
declare const meta: Meta<typeof Stepper>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Stepper>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const SmallVariant: Story;
|
|
8
|
+
export declare const WithCompletedSteps: Story;
|
|
9
|
+
export declare const CustomClassNameStepper: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
export interface TabProps {
|
|
3
|
+
setActiveTab: (tab: string) => void;
|
|
4
|
+
tabId: string;
|
|
5
|
+
ref: RefObject<HTMLButtonElement | null>;
|
|
6
|
+
activeTab: boolean;
|
|
7
|
+
tabContent: ReactNode | ReactNode[] | string;
|
|
8
|
+
rightSection?: ReactNode | undefined;
|
|
9
|
+
clickFnc: (tabId: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const Tab: React.ForwardRefExoticComponent<Omit<TabProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").ForwardRefExoticComponent<Omit<import("./Tab").TabProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
13
|
+
export declare const Active: Story;
|
|
14
|
+
export declare const WithBadge: Story;
|
|
15
|
+
export declare const LongContent: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: {
|
|
5
|
+
({ children }: import("./TabsBadge").TabsBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
};
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const SingleDigit: Story;
|
|
16
|
+
export declare const MultipleDigits: Story;
|
|
17
|
+
export declare const SingleCharacter: Story;
|
|
18
|
+
export declare const Text: Story;
|
|
19
|
+
export declare const LongText: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
interface ITab {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
rightSection?: ReactElement | undefined;
|
|
6
|
+
clickFnc: (val: string) => void;
|
|
7
|
+
requiredPermissions?: string[];
|
|
8
|
+
}
|
|
9
|
+
interface TabsWrapperProps {
|
|
10
|
+
children?: ReactNode | ReactNode[];
|
|
11
|
+
defaultActive?: string;
|
|
12
|
+
setActiveTab: (value: string) => void;
|
|
13
|
+
activeTab?: string;
|
|
14
|
+
tabs: ITab[];
|
|
15
|
+
}
|
|
16
|
+
export declare const TabsWrapper: ({ setActiveTab, activeTab, tabs }: TabsWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|