bianic-ui 1.9.0-beta.2 → 1.9.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.
Files changed (29) hide show
  1. package/dist/cjs/index.js +61 -15
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Forms/TextInput/index.d.ts +1 -0
  4. package/dist/cjs/types/components/Progress/Bar/index.d.ts +3 -1
  5. package/dist/cjs/types/components/Window/index.d.ts +3 -4
  6. package/dist/cjs/types/components/index.d.ts +1 -0
  7. package/dist/cjs/types/stories/Button/Button.stories.d.ts +1 -1
  8. package/dist/cjs/types/stories/Form/LiveSearch/Livesearch.stories.d.ts +38 -0
  9. package/dist/cjs/types/stories/Form/SelectInput/SelectInput.stories.d.ts +0 -1
  10. package/dist/cjs/types/stories/Progress/Bar/ProgressBar.stories.d.ts +2 -0
  11. package/dist/cjs/types/stories/Window/Window.stories.d.ts +2 -1
  12. package/dist/esm/index.js +61 -16
  13. package/dist/esm/lib.css +1 -1
  14. package/dist/esm/types/components/Forms/TextInput/index.d.ts +1 -0
  15. package/dist/esm/types/components/Progress/Bar/index.d.ts +3 -1
  16. package/dist/esm/types/components/Window/index.d.ts +3 -4
  17. package/dist/esm/types/components/index.d.ts +1 -0
  18. package/dist/esm/types/stories/Button/Button.stories.d.ts +1 -1
  19. package/dist/esm/types/stories/Form/LiveSearch/Livesearch.stories.d.ts +38 -0
  20. package/dist/esm/types/stories/Form/SelectInput/SelectInput.stories.d.ts +0 -1
  21. package/dist/esm/types/stories/Progress/Bar/ProgressBar.stories.d.ts +2 -0
  22. package/dist/esm/types/stories/Window/Window.stories.d.ts +2 -1
  23. package/dist/index.d.ts +12 -2
  24. package/package.json +5 -6
  25. package/src/style/scrollbar.css +9 -1
  26. package/dist/cjs/types/stories/Form/LiveSearch/LiveSearch.stories.d.ts +0 -15
  27. package/dist/cjs/types/stories/Menu/MenuContainer.stories.d.ts +0 -13
  28. package/dist/esm/types/stories/Form/LiveSearch/LiveSearch.stories.d.ts +0 -15
  29. package/dist/esm/types/stories/Menu/MenuContainer.stories.d.ts +0 -13
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import TextInputProps from './PropsInterface';
3
+ import './style.css';
3
4
  declare function TextInput({ descText, disabled, icon, id, size, isValid, label, placeholder, readOnly, required, variant, value, onChange, maxLength, inputClassName, isFlatRight, actionElement, autoComplete, ...props }: TextInputProps): React.JSX.Element;
4
5
  declare namespace TextInput {
5
6
  var defaultProps: {
@@ -3,6 +3,8 @@ export interface ProgressBarProps {
3
3
  title?: string;
4
4
  percentage: number;
5
5
  caption?: string;
6
+ icon?: React.ReactNode | boolean;
7
+ barColor?: string;
6
8
  variant?: 'success' | 'failed' | 'loading';
7
9
  }
8
- export default function ProgressBar({ title, percentage, caption, variant, }: ProgressBarProps): React.JSX.Element;
10
+ export default function ProgressBar({ title, percentage, caption, variant, icon, barColor, }: ProgressBarProps): React.JSX.Element;
@@ -1,11 +1,10 @@
1
- import React, { ComponentPropsWithoutRef } from 'react';
1
+ import React, { ComponentPropsWithRef } from 'react';
2
2
  import '../../tailwind.css';
3
- export interface WindowProps extends ComponentPropsWithoutRef<'div'> {
3
+ export interface WindowProps extends ComponentPropsWithRef<'div'> {
4
4
  size?: 'sm' | 'md' | 'lg' | 'xl';
5
5
  zIndex?: number;
6
6
  title?: string;
7
- open: boolean;
8
7
  onClose: () => void;
9
8
  }
10
- declare function Window({ size, title, open, zIndex, onClose, ...rest }: WindowProps): React.JSX.Element | null;
9
+ declare function Window({ size, title, zIndex, onClose, ...rest }: WindowProps): React.JSX.Element;
11
10
  export default Window;
@@ -27,3 +27,4 @@ export { default as TagLabel } from './TagLabel';
27
27
  export { default as Tooltip } from './Tooltip';
28
28
  export { Display, P, Heading, Text, Link } from './Typography';
29
29
  export { Toaster } from './Toaster';
30
+ export { default as Window } from './Window';
@@ -6,7 +6,6 @@ declare const meta: {
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
9
- tags: string[];
10
9
  args: {};
11
10
  };
12
11
  export default meta;
@@ -30,3 +29,4 @@ export declare const DemoWithIconLeft: Story;
30
29
  export declare const DemoWithIconRight: Story;
31
30
  export declare const DemoWithIconBoth: Story;
32
31
  export declare const DemoWithIconOnly: Story;
32
+ export declare const DemoWithMovingIcon: Story;
@@ -0,0 +1,38 @@
1
+ import { StoryObj } from '@storybook/react/*';
2
+ import { LiveSearch } from '../../../components';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof LiveSearch;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ argTypes: {
10
+ id: {
11
+ description: string;
12
+ };
13
+ label: {
14
+ description: string;
15
+ };
16
+ descText: {
17
+ description: string;
18
+ };
19
+ children: {
20
+ description: string;
21
+ };
22
+ value: {
23
+ description: string;
24
+ };
25
+ setValue: {
26
+ description: string;
27
+ };
28
+ size: {
29
+ description: string;
30
+ };
31
+ dropContProps: {
32
+ description: string;
33
+ };
34
+ };
35
+ };
36
+ export default meta;
37
+ type Story = StoryObj<typeof meta>;
38
+ export declare const LivesearchProp: Story;
@@ -6,7 +6,6 @@ declare const meta: {
6
6
  parameters: {
7
7
  layout: string;
8
8
  };
9
- tags: string[];
10
9
  args: {};
11
10
  };
12
11
  export default meta;
@@ -11,3 +11,5 @@ declare const meta: {
11
11
  export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
13
  export declare const Demo: Story;
14
+ export declare const NoIconDemo: Story;
15
+ export declare const CustomColorDemo: Story;
@@ -1,7 +1,8 @@
1
1
  import type { StoryObj } from '@storybook/react';
2
+ import { Window } from '../../components';
2
3
  declare const meta: {
3
4
  title: string;
4
- component: any;
5
+ component: typeof Window;
5
6
  parameters: {
6
7
  layout: string;
7
8
  };
package/dist/esm/index.js CHANGED
@@ -88,6 +88,8 @@ function TbCircleCheckFilled (props) {
88
88
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"currentColor"},"child":[{"tag":"path","attr":{"d":"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z"},"child":[]}]})(props);
89
89
  }function TbAlertTriangle (props) {
90
90
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M12 9v4"},"child":[]},{"tag":"path","attr":{"d":"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z"},"child":[]},{"tag":"path","attr":{"d":"M12 16h.01"},"child":[]}]})(props);
91
+ }function TbCalendar (props) {
92
+ return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z"},"child":[]},{"tag":"path","attr":{"d":"M16 3v4"},"child":[]},{"tag":"path","attr":{"d":"M8 3v4"},"child":[]},{"tag":"path","attr":{"d":"M4 11h16"},"child":[]},{"tag":"path","attr":{"d":"M11 15h1"},"child":[]},{"tag":"path","attr":{"d":"M12 15v3"},"child":[]}]})(props);
91
93
  }function TbCheck (props) {
92
94
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M5 12l5 5l10 -10"},"child":[]}]})(props);
93
95
  }function TbChevronDown (props) {
@@ -1873,6 +1875,8 @@ function TextInput(_a) {
1873
1875
  if (variant === 'password') {
1874
1876
  iconElement = (React.createElement(PasswordIcon, { isShow: isShow, showHandler: setIsShow, iconSize: iconSize, disabled: disabled }));
1875
1877
  }
1878
+ if (variant === 'date')
1879
+ iconElement = React.createElement(TbCalendar, { className: "text-bia-coolgrey", size: 18 });
1876
1880
  var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle);
1877
1881
  var labelStatus = readOnly ? 'read-only:pointer-events-none' : '';
1878
1882
  return (React.createElement("div", { className: "bianic-text-input-container bianic-fgc-container flex w-full flex-col gap-y-2 text-bia-black" },
@@ -2368,7 +2372,7 @@ function LiveSearch(_a) {
2368
2372
  React.createElement("div", { className: "absolute inset-y-0 z-20 hidden pl-3 group-hover:block ".concat(iconClass) },
2369
2373
  React.createElement("button", { onClick: function () { return setValue({ id: null, label: '' }); }, className: "flex h-full w-full items-center" },
2370
2374
  React.createElement(TbX, { className: "text-primary-black", style: { fontSize: iconSize } }))),
2371
- children !== undefined && isOpen && (React.createElement("div", { className: "border-grey-100 absolute z-10 max-h-60 w-full overflow-y-auto rounded-b-md border bg-primary-white shadow-lg", onClick: onClickDropdown }, filteredOptions.map(function (option) {
2375
+ children === undefined && isOpen && (React.createElement("div", { className: "border-grey-100 absolute z-10 max-h-60 w-full overflow-y-auto rounded-b-md border bg-primary-white shadow-lg", onClick: onClickDropdown }, filteredOptions.map(function (option) {
2372
2376
  var isSelected = value && value.id && option.id === value.id;
2373
2377
  return option.custom ? (React.createElement(CustomDropdownItem, { size: size, isSelected: isSelected, className: dropdownClassName, onClick: function () {
2374
2378
  setValue(option);
@@ -2904,35 +2908,49 @@ var SpinnerIcon = function (_a) {
2904
2908
 
2905
2909
  var config = {
2906
2910
  success: {
2907
- progress: 'bg-bia-green',
2911
+ progress: 'bg-bia-green outline-bia-green',
2908
2912
  statusIcon: React.createElement(TbCircleCheckFilled, { className: "text-[16px] text-bia-green" }),
2909
2913
  },
2910
2914
  failed: {
2911
- progress: 'bg-bia-red',
2915
+ progress: 'bg-bia-red outline-bia-red',
2912
2916
  statusIcon: React.createElement(TbPlaystationX, { className: "text-[16px] text-bia-red" }),
2913
2917
  },
2914
2918
  loading: {
2915
- progress: 'bg-bia-blue',
2919
+ progress: 'bg-bia-blue outline-bia-blue ',
2916
2920
  statusIcon: React.createElement(SpinnerIcon, { className: "text-[16px] text-bia-grey-dark-10" }),
2917
2921
  },
2918
2922
  };
2919
2923
 
2920
2924
  function ProgressBar(_a) {
2921
- var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.percentage, percentage = _c === void 0 ? 0 : _c, caption = _a.caption, _d = _a.variant, variant = _d === void 0 ? 'loading' : _d;
2922
- var persentageVal = percentage;
2925
+ var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.percentage, percentage = _c === void 0 ? 0 : _c, caption = _a.caption, _d = _a.variant, variant = _d === void 0 ? 'loading' : _d, _e = _a.icon, icon = _e === void 0 ? true : _e, barColor = _a.barColor;
2926
+ var percentageVal = percentage;
2927
+ if (percentageVal === 0)
2928
+ percentageVal = 0.5;
2923
2929
  if (percentage > 100)
2924
- persentageVal = 100;
2925
- var _e = config[variant], progress = _e.progress, statusIcon = _e.statusIcon;
2930
+ percentageVal = 100;
2931
+ var _f = config[variant], progress = _f.progress, statusIcon = _f.statusIcon;
2932
+ var barColorRules = barColor
2933
+ ? "outline-bia-".concat(barColor, " bg-bia-").concat(barColor)
2934
+ : progress; // Use the provided barColor or fallback to the default progress color
2935
+ var iconElement = null;
2936
+ if (icon) {
2937
+ if (typeof icon === 'boolean') {
2938
+ iconElement = statusIcon; // Use the default icon based on the variant
2939
+ }
2940
+ else {
2941
+ iconElement = icon; // Use the provided icon
2942
+ }
2943
+ }
2926
2944
  return (React.createElement("div", { className: "bianic-progress-bar-container flex w-[320px] flex-col rounded-radius-lg bg-bia-grey-light-80 p-[10px] " },
2927
2945
  React.createElement("div", { className: "flex items-center justify-between text-primary-black" },
2928
2946
  React.createElement(Text, { variant: "small-text-semibold", extended: "bianic-progress-bar-title" }, title),
2929
2947
  React.createElement("div", { className: "flex gap-1" },
2930
- React.createElement(Text, { variant: "small-text-semibold", extended: "bianic-progress-bar-persentage" },
2931
- persentageVal,
2948
+ React.createElement(Text, { variant: "small-text-semibold", extended: "bianic-progress-bar-percentage" },
2949
+ percentage,
2932
2950
  "%"),
2933
- statusIcon)),
2951
+ iconElement)),
2934
2952
  React.createElement("div", { className: "bianic-progress-bar mb-1 mt-2 w-full rounded-radius-lg bg-bia-white p-[3px]" },
2935
- React.createElement("div", { className: "h-1 w-full rounded-radius-lg ".concat(progress), style: { width: "".concat(persentageVal, "%") } })),
2953
+ React.createElement("div", { className: "h-[1px] rounded-radius-lg outline outline-[1.5px] ".concat(barColorRules), style: { width: "".concat(percentageVal, "%") } })),
2936
2954
  caption && (React.createElement(Text, { variant: "small-text-semibold", extended: "text-bia-coolgrey-dark-10" }, caption))));
2937
2955
  }
2938
2956
 
@@ -3107,7 +3125,7 @@ var alternativeConfigs = {
3107
3125
  false: 'cursor-pointer bg-bia-verdantgreen-dark-40 hover:bg-bia-verdantgreen-dark-50 text-primary-white overflow-hidden',
3108
3126
  };
3109
3127
  var alternativeButtonConfigs = {
3110
- true: 'absolute px-[5px] opacity-0 hover:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-primary-white from-50% to-primary-white/[.0] inset-y-0 right-0',
3128
+ true: 'absolute px-[5px] opacity-0 group-hover/container:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-primary-white from-50% to-primary-white/[.0] inset-y-0 right-0',
3111
3129
  false: ' absolute px-[5px] opacity-0 hover:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-bia-verdantgreen-dark-50 from-50% to-bia-verdantgreen-dark-50/[.0] inset-y-0 right-0',
3112
3130
  };
3113
3131
  var actionButtonConfig = {
@@ -3136,11 +3154,11 @@ var TabMenu = function (_a) {
3136
3154
  usedButtonConfig = defaultButtonConfigs[isActive];
3137
3155
  usedActionButtonConfig = '';
3138
3156
  }
3139
- return (React.createElement("div", __assign({ className: "tab-menu flex flex-row font-arial text-size-tiny font-normal ".concat(radiusConfig[validatedRadius], " ").concat(variantConfig[validatedVariant], " ").concat(usedBaseConfig, " ").concat(rest.className) }, rest),
3157
+ return (React.createElement("div", __assign({ className: "tab-menu group/container flex flex-row font-arial text-size-tiny font-normal ".concat(radiusConfig[validatedRadius], " ").concat(variantConfig[validatedVariant], " ").concat(usedBaseConfig, " ").concat(rest.className) }, rest),
3140
3158
  text,
3141
3159
  React.createElement("div", { className: "grid ".concat(usedButtonConfig, " ") },
3142
3160
  validatedVariant === 'alternative' && React.createElement("div", { className: "order-first" }),
3143
- React.createElement("button", { className: "group order-last ", onClick: onClose },
3161
+ React.createElement("button", { className: "group order-last", onClick: onClose },
3144
3162
  React.createElement(TbX, { className: "rounded-radius-sm ".concat(usedActionButtonConfig), size: 14 })))));
3145
3163
  };
3146
3164
 
@@ -3442,4 +3460,31 @@ function Toaster(_a) {
3442
3460
  React.createElement(TbX, { size: 14 })))));
3443
3461
  }
3444
3462
 
3445
- export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Node as BCNode, Outlet as BCOutlet, Port as BCPort, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, VirtualPort as BCVirtualPort, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, ContextualButton, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, Heading, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip };
3463
+ function Window(_a) {
3464
+ var _b = _a.size, size = _b === void 0 ? 'sm' : _b, title = _a.title; _a.zIndex; var onClose = _a.onClose, rest = __rest(_a, ["size", "title", "zIndex", "onClose"]);
3465
+ var windowSize;
3466
+ // sizing logic
3467
+ switch (size) {
3468
+ case 'sm':
3469
+ windowSize = 'w-[300px]';
3470
+ break;
3471
+ case 'md':
3472
+ windowSize = 'w-[540px]';
3473
+ break;
3474
+ case 'lg':
3475
+ windowSize = 'w-[800px]';
3476
+ break;
3477
+ case 'xl':
3478
+ windowSize = 'w-[1140px]';
3479
+ break;
3480
+ default:
3481
+ windowSize = 'w-[540px]';
3482
+ }
3483
+ return (React.createElement("div", { className: "bianic-window drag-handle flex flex-col gap-[20px] rounded-[5px] bg-white ".concat(windowSize, " shadow-[0px_3px_20px_0px_rgba(0,0,0,0.10)]") },
3484
+ React.createElement("div", { className: "bianic-window-header flex cursor-move justify-between px-[20px] pt-[20px]" },
3485
+ React.createElement("div", { className: " text-wrap text-left font-humnst777 text-[18px] font-bold leading-[21.85px] text-primary-black" }, title),
3486
+ React.createElement(Button, { variant: "subtle", radius: "full-rounded", iconLeft: React.createElement(TbX, null), size: "tn", onClick: function () { return onClose(); } })),
3487
+ React.createElement("div", { className: "bianic-window-content flex w-full flex-col items-start gap-[20px] px-[20px] pb-[20px] text-primary-black" }, rest.children)));
3488
+ }
3489
+
3490
+ export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Node as BCNode, Outlet as BCOutlet, Port as BCPort, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, VirtualPort as BCVirtualPort, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, ContextualButton, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, Heading, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, Window };