@youngonesworks/ui 0.1.34 → 0.1.36

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.
@@ -1,3 +1,4 @@
1
+ import { type ReactNode } from 'react';
1
2
  interface IBadgeProps {
2
3
  styleVariant?: 'green-light' | 'red' | 'accent-blue' | 'warning' | 'gray' | 'black' | 'purple' | 'pink' | 'pink-light' | 'gray' | 'white';
3
4
  color?: 'dark' | 'gray' | 'red' | 'pink' | 'grape' | 'violet' | 'indigo' | 'blue' | 'cyan' | 'green' | 'lime' | 'yellow' | 'orange' | 'teal';
@@ -10,12 +11,12 @@ interface IBadgeProps {
10
11
  /** Sets badge width to 100% of parent element, hides overflow text with text-overflow: ellipsis */
11
12
  fullWidth?: boolean;
12
13
  /** Section rendered on the left side of label */
13
- leftSection?: React.ReactNode;
14
+ leftSection?: ReactNode;
14
15
  /** Section rendered on the right side of label */
15
- rightSection?: React.ReactNode;
16
+ rightSection?: ReactNode;
16
17
  favorite?: boolean;
17
18
  /** Badge label */
18
- children?: React.ReactNode;
19
+ children?: ReactNode;
19
20
  mobile?: boolean;
20
21
  className?: string;
21
22
  badgeBorder?: boolean;
@@ -1,9 +1,13 @@
1
- import { type ReactNode } from 'react';
1
+ import { type FC, type ReactNode } from 'react';
2
2
  interface IBreadCrumb {
3
3
  children: ReactNode;
4
+ LinkText: FC<{
5
+ classNames: string;
6
+ children: ReactNode;
7
+ }>;
4
8
  }
5
9
  export declare const BreadCrumb: {
6
- ({ children }: IBreadCrumb): import("react/jsx-runtime").JSX.Element;
10
+ ({ children, LinkText }: IBreadCrumb): import("react/jsx-runtime").JSX.Element;
7
11
  displayName: string;
8
12
  };
9
13
  export {};
@@ -1,9 +1,9 @@
1
- import { type JSX } from 'react';
1
+ import { type JSX, type ReactNode } from 'react';
2
2
  interface ICheckbox extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
3
  className?: string;
4
4
  mediumBoldText?: boolean;
5
5
  error?: string;
6
- label?: React.ReactNode;
6
+ label?: ReactNode;
7
7
  indeterminate?: boolean;
8
8
  size?: 'sm' | 'md';
9
9
  }
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { type ReactNode } from 'react';
2
3
  interface IIsland extends React.HTMLAttributes<HTMLDivElement> {
3
- children: React.ReactNode;
4
+ children: ReactNode;
4
5
  noShadow?: boolean;
5
6
  noPadding?: boolean;
6
7
  }
@@ -1,5 +1,6 @@
1
+ import { type ReactNode } from 'react';
1
2
  interface LabelProps {
2
- children: React.ReactNode | string | React.ReactNode[];
3
+ children: ReactNode | string | ReactNode[];
3
4
  htmlFor?: string;
4
5
  className?: string;
5
6
  }
@@ -1,5 +1,6 @@
1
+ import { type ReactNode } from 'react';
1
2
  interface PageUnavailableProps {
2
- notAvailableButton: React.ReactNode;
3
+ notAvailableButton: ReactNode;
3
4
  notAvailableDescription: string;
4
5
  notAvailableHeaderText: string;
5
6
  }
@@ -1,5 +1,6 @@
1
+ import { type ReactNode } from 'react';
1
2
  interface ITableHeader {
2
- children: React.ReactNode;
3
+ children: ReactNode;
3
4
  }
4
5
  export declare const TableHeader: ({ children }: ITableHeader) => import("react/jsx-runtime").JSX.Element;
5
6
  export {};
@@ -1,6 +1,6 @@
1
- import { type HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  interface ITableHeaderItem extends HTMLAttributes<HTMLDivElement> {
3
- children?: React.ReactNode;
3
+ children?: ReactNode;
4
4
  smallPadding?: boolean;
5
5
  }
6
6
  export declare const TableHeaderItem: ({ children, smallPadding, className }: ITableHeaderItem) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { type HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  export interface IThemeIcon extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
3
3
  styleVariant?: 'black' | 'gray' | 'pink' | 'pink-with-background' | 'turquoise' | 'accent-blue' | 'check' | 'warning' | 'error';
4
- icon: React.ReactNode;
4
+ icon: ReactNode;
5
5
  className?: string;
6
6
  adjustedSize?: string | number;
7
7
  title: string;
@@ -0,0 +1,17 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ declare const meta: {
3
+ title: string;
4
+ component: import("react").ForwardRefExoticComponent<import("./index").ITimeInput & import("react").RefAttributes<HTMLInputElement>>;
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 WithLabel: Story;
14
+ export declare const WithError: Story;
15
+ export declare const WithSeconds: Story;
16
+ export declare const Disabled: Story;
17
+ export declare const WithDefaultValue: Story;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface ITimeInput extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
3
+ 'data-testid'?: string;
4
+ label?: string;
5
+ error?: string;
6
+ withSeconds?: boolean;
7
+ }
8
+ export declare const TimeInput: React.ForwardRefExoticComponent<ITimeInput & React.RefAttributes<HTMLInputElement>>;
@@ -1,7 +1,8 @@
1
+ import { type ReactNode } from 'react';
1
2
  type IUnorderedListProps = {
2
- children: React.ReactNode;
3
+ children: ReactNode;
3
4
  className?: string;
4
- actionItem?: React.ReactNode;
5
+ actionItem?: ReactNode;
5
6
  };
6
7
  export declare const UnorderedList: ({ children, className, actionItem, ...props }: IUnorderedListProps) => import("react/jsx-runtime").JSX.Element;
7
8
  export {};
package/dist/index.cjs CHANGED
@@ -103307,18 +103307,9 @@ const BigBadge = ({ styleVariant = COLOR.GREEN, className, children,...props })
103307
103307
  children
103308
103308
  });
103309
103309
 
103310
- //#endregion
103311
- //#region src/components/linkText/index.tsx
103312
- /** @deprecated dont use this anymore, instead use the next link */
103313
- const LinkText = ({ children, classNames: classNames$1 }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
103314
- className: classNames$1,
103315
- children
103316
- });
103317
- LinkText.displayName = "LinkText";
103318
-
103319
103310
  //#endregion
103320
103311
  //#region src/components/breadCrumb/index.tsx
103321
- const BreadCrumb = ({ children }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkText, {
103312
+ const BreadCrumb = ({ children, LinkText }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkText, {
103322
103313
  "data-component": "BreadCrumb",
103323
103314
  classNames: "flex items-center",
103324
103315
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconArrowNarrowLeft, { size: 20 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -116064,6 +116055,37 @@ function ThemeIcon({ styleVariant = "black", className, icon, adjustedSize, titl
116064
116055
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(M, { id: title })] });
116065
116056
  }
116066
116057
 
116058
+ //#endregion
116059
+ //#region src/components/timeInput/index.tsx
116060
+ const TimeInput = (0, react.forwardRef)(({ label, error: error$1, withSeconds, className = "",...props }, ref) => {
116061
+ const handleTimeChange = (e$2) => {
116062
+ if (props.onChange) props.onChange(e$2);
116063
+ };
116064
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
116065
+ className: "leading-none",
116066
+ "data-component": "timeInput",
116067
+ children: [
116068
+ label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
116069
+ className: "mb-2 block text-xs font-medium",
116070
+ htmlFor: props.id,
116071
+ children: label
116072
+ }),
116073
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
116074
+ ...props,
116075
+ ref,
116076
+ type: "time",
116077
+ step: withSeconds ? "1" : "60",
116078
+ onChange: handleTimeChange,
116079
+ className: `bg-ultra-light-gray focus:border-primary flex h-10 min-h-[36px] w-full items-center rounded-[5px] border border-solid border-gray-200 px-3 text-sm font-normal focus:outline-hidden ${error$1 ? "border-red-500" : ""} ${className}`
116080
+ }),
116081
+ error$1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
116082
+ className: "pt-2 text-xs font-normal text-red-500",
116083
+ children: error$1
116084
+ })
116085
+ ]
116086
+ });
116087
+ });
116088
+
116067
116089
  //#endregion
116068
116090
  //#region src/components/toggle/index.tsx
116069
116091
  const Toggle = ({ onClick, value, disabled = false }) => {
@@ -140444,7 +140466,6 @@ exports.HR = HR;
140444
140466
  exports.HamburgerMenuButton = HamburgerMenuButton;
140445
140467
  exports.Island = Island;
140446
140468
  exports.Label = Label;
140447
- exports.LinkText = LinkText;
140448
140469
  exports.Loader = Loader;
140449
140470
  exports.LogoBlack = LogoBlack;
140450
140471
  exports.Modal = Modal;
@@ -140478,6 +140499,7 @@ exports.TabsWrapper = TabsWrapper;
140478
140499
  exports.TextInput = TextInput;
140479
140500
  exports.Textarea = Textarea;
140480
140501
  exports.ThemeIcon = ThemeIcon;
140502
+ exports.TimeInput = TimeInput;
140481
140503
  exports.Toggle = Toggle;
140482
140504
  exports.Tooltip = Tooltip;
140483
140505
  exports.TruncatedText = TruncatedText;