bianic-ui 2.0.0 → 2.1.0-beta.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.
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
- interface FormLabelProps {
2
+ export interface FormLabelProps {
3
+ size?: 'sm' | 'md';
4
+ fontWeight?: 'normal' | 'semibold';
3
5
  children: React.ReactNode;
4
6
  className?: string;
5
7
  htmlFor?: string;
@@ -7,12 +9,14 @@ interface FormLabelProps {
7
9
  required?: boolean;
8
10
  }
9
11
  declare const FormLabel: {
10
- ({ children, className, htmlFor, readOnly, required, }: FormLabelProps): React.JSX.Element;
12
+ ({ children, className, htmlFor, readOnly, required, size, fontWeight, }: FormLabelProps): React.JSX.Element;
11
13
  defaultProps: {
12
14
  className: string;
13
15
  htmlFor: undefined;
14
16
  required: boolean;
15
17
  readOnly: boolean;
18
+ size: string;
19
+ fontWeight: string;
16
20
  };
17
21
  };
18
22
  export default FormLabel;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { FormLabelProps } from './FormLabel';
3
+ declare const FormLabelSimulation: ({ className, children, htmlFor, required, readOnly, fontWeight, size, }: FormLabelProps) => React.JSX.Element;
4
+ export default FormLabelSimulation;
@@ -9,3 +9,4 @@ export { SegmentButtonItem, SegmentButtonGroup } from './SegmentButton';
9
9
  export { FormGroup, FormGroupButton, FormGroupLabel } from './Group';
10
10
  export { DropdownContainer, DropdownItem } from './Dropdown';
11
11
  export { DatePicker, PickerCalendar } from './DatePicker';
12
+ export { default as FormLabel } from './Label/FormLabel';
@@ -10,7 +10,7 @@ export { default as Color } from './Color';
10
10
  export { default as Divider } from './Divider/Divider';
11
11
  export { default as FileTree } from './FileTree';
12
12
  export { MenuContainer, MenuItem } from './Menu';
13
- export { TextInput, Radio, TextArea, Checkbox, SelectInput, LiveSearch, Toggle, SegmentButtonItem, SegmentButtonGroup, FormGroup, FormGroupButton, FormGroupLabel, DropdownItem, DropdownContainer, DatePicker, PickerCalendar, } from './Forms';
13
+ export { TextInput, Radio, TextArea, Checkbox, SelectInput, LiveSearch, Toggle, SegmentButtonItem, SegmentButtonGroup, FormLabel, FormGroup, FormGroupButton, FormGroupLabel, DropdownItem, DropdownContainer, DatePicker, PickerCalendar, } from './Forms';
14
14
  export * from './Icons';
15
15
  export { default as InfoPanel } from './InfoPanel';
16
16
  export { default as Modal } from './Modal/Modal';
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ className, children, htmlFor, required, readOnly, fontWeight, size, }: import("../../../components/Forms/Label/FormLabel").FormLabelProps) => import("react").JSX.Element;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ args: {};
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Simulation: Story;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: {
6
+ ({ children, className, htmlFor, readOnly, required, size, fontWeight, }: import("../../../components/Forms/Label/FormLabel").FormLabelProps): import("react").JSX.Element;
7
+ defaultProps: {
8
+ className: string;
9
+ htmlFor: undefined;
10
+ required: boolean;
11
+ readOnly: boolean;
12
+ size: string;
13
+ fontWeight: string;
14
+ };
15
+ };
16
+ parameters: {
17
+ layout: string;
18
+ };
19
+ tags: string[];
20
+ args: {};
21
+ };
22
+ export default meta;
23
+ type Story = StoryObj<typeof meta>;
24
+ export declare const Demo: Story;
package/dist/esm/index.js CHANGED
@@ -2009,18 +2009,25 @@ Tooltip.defaultProps = {
2009
2009
  Tooltip.defaultProps = {};
2010
2010
 
2011
2011
  var FormLabel = function (_a) {
2012
- var children = _a.children, className = _a.className, htmlFor = _a.htmlFor, readOnly = _a.readOnly, required = _a.required;
2013
- var labelClass = readOnly ? 'pointer-events-none' : '';
2014
- return (React.createElement(Tooltip, { content: "Required", delay: 2000, direction: "right" },
2015
- React.createElement("label", { htmlFor: htmlFor, className: "bianic-form-label group/formlabel text-xs font-semibold ".concat(labelClass, " ").concat(className) },
2016
- children,
2017
- required && (React.createElement("span", { className: "p-1 text-bia-coolgrey group-hover/form:text-bia-red group-hover/formlabel:text-bia-red" }, "*")))));
2012
+ var children = _a.children, className = _a.className, htmlFor = _a.htmlFor, readOnly = _a.readOnly, required = _a.required, _b = _a.size, size = _b === void 0 ? 'sm' : _b, _c = _a.fontWeight, fontWeight = _c === void 0 ? 'semibold' : _c;
2013
+ var labelpointer = readOnly ? 'pointer-events-none' : '';
2014
+ var labelSize = size === 'sm' ? 'text-size-sm' : 'text-size-md';
2015
+ var labelFontWeight = fontWeight === 'semibold' ? 'font-semibold' : 'font-normal';
2016
+ var labelClass = "".concat(labelpointer, " ").concat(labelSize, " ").concat(labelFontWeight);
2017
+ var labelContent = (React.createElement("label", { htmlFor: htmlFor, className: "bianic-form-label group/formlabel ".concat(labelClass, " ").concat(className) },
2018
+ children,
2019
+ required && (React.createElement("span", { className: "p-1 text-bia-coolgrey group-hover/form:text-bia-red group-hover/formlabel:text-bia-red" }, "*"))));
2020
+ if (required)
2021
+ return (React.createElement(Tooltip, { content: "Required", delay: 2000, direction: "right" }, labelContent));
2022
+ return labelContent;
2018
2023
  };
2019
2024
  FormLabel.defaultProps = {
2020
2025
  className: '',
2021
2026
  htmlFor: undefined,
2022
2027
  required: false,
2023
2028
  readOnly: false,
2029
+ size: 'sm',
2030
+ fontWeight: 'semibold',
2024
2031
  };
2025
2032
 
2026
2033
  function PasswordIcon(_a) {
@@ -4216,4 +4223,4 @@ function Window(_a) {
4216
4223
  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)));
4217
4224
  }
4218
4225
 
4219
- 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, Neutral as BCNeutral, 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, DatePicker, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, Window };
4226
+ 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, Neutral as BCNeutral, 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, DatePicker, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, Window };